@objectstack/console 17.6.0 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +428 -0
- package/dist/.objectstack-injection.json +2 -2
- package/dist/.objectui-sha +1 -1
- package/dist/assets/{ActionResultDialog-4kHDGnT3.js → ActionResultDialog-ChYnuROr.js} +3 -3
- package/dist/assets/{AiPendingActionsPage-JjOddm0h.js → AiPendingActionsPage-Dh3-i4BB.js} +1 -1
- package/dist/assets/{ApiConsolePage-BgS26lbp.js → ApiConsolePage-CKYEqlMs.js} +1 -1
- package/dist/assets/{AppDocsIndex-BDoH5ECM.js → AppDocsIndex-B5Tky2xg.js} +1 -1
- package/dist/assets/{AppManagementPage-CCgKmNTj.js → AppManagementPage-ZwyvnHpM.js} +1 -1
- package/dist/assets/ApprovalsInboxPage-DD4fe0Em.js +1 -0
- package/dist/assets/AuditLogPage-Sed6iMqP.js +1 -0
- package/dist/assets/BookPage-DYjUsQIc.js +1 -0
- package/dist/assets/{ComponentNavView-B5g9c6fx.js → ComponentNavView-DrlxM4SY.js} +1 -1
- package/dist/assets/CreateViewDialog-Cp72x_O7.js +1 -0
- package/dist/assets/{DashboardView-BOcovpPd.js → DashboardView-juicRxcP.js} +1 -1
- package/dist/assets/DocPage-CxJaQ-pC.js +1 -0
- package/dist/assets/{DocsIndex-DwW2QsYY.js → DocsIndex-LALVtIVR.js} +1 -1
- package/dist/assets/{DocsLayout-D63StSgd.js → DocsLayout-BAwlJQQf.js} +1 -1
- package/dist/assets/{DocsSlug-CP9fcabi.js → DocsSlug-CkF1E-Zs.js} +1 -1
- package/dist/assets/ExpressionProvider-Dr0e99r1.js +1 -0
- package/dist/assets/FlowRunsPage-R3W3t2s4.js +1 -0
- package/dist/assets/{IntegrationsPage-DvG0x0Nb.js → IntegrationsPage-DIuFLEbF.js} +2 -2
- package/dist/assets/InterfaceListPage-BfoCldGu.js +1 -0
- package/dist/assets/{MarketplaceInstalledPage-B7KETQG2.js → MarketplaceInstalledPage-DyjhcUNB.js} +1 -1
- package/dist/assets/MarketplacePackagePage-BbO27Pgs.js +4 -0
- package/dist/assets/MarketplacePage-DO2_b64U.js +1 -0
- package/dist/assets/{MetadataInspector-EP0I3-Kq.js → MetadataInspector-BQyu9pOE.js} +1 -1
- package/dist/assets/ObjectDataPage-DIY-yefK.js +1 -0
- package/dist/assets/PageView-C-qWu3Jw.js +1 -0
- package/dist/assets/ProfilePage-Qp8DL8CF.js +1 -0
- package/dist/assets/{PublicFormsPage-D3uCTR-8.js → PublicFormsPage-D3AT2EH9.js} +1 -1
- package/dist/assets/RecordDetailView-B3XBEgk2.js +3 -0
- package/dist/assets/{RecordFormPage-kiJI-ieF.js → RecordFormPage-CcoZfUJ3.js} +1 -1
- package/dist/assets/ReportDefaultInspector-DVcWM6sh.js +1 -0
- package/dist/assets/ReportView-pJCFptzp.js +2 -0
- package/dist/assets/RuntimeDraftBar-DObTyFu2.js +1 -0
- package/dist/assets/SchemaForm-BWSWYMLE.js +3 -0
- package/dist/assets/SearchResultsPage-ChVIzFob.js +1 -0
- package/dist/assets/{SettingsHub-DP1mrzEN.js → SettingsHub-CPP9FDe8.js} +1 -1
- package/dist/assets/{SettingsView-u7mc6pcc.js → SettingsView-CrHAROu9.js} +1 -1
- package/dist/assets/{SkeletonDetail-DIwlbHTr.js → SkeletonDetail-CP-35B8x.js} +1 -1
- package/dist/assets/{af-DPUgkQl0.js → af-Bhbso4Pg.js} +1 -1
- package/dist/assets/ai-BAPiCsNk.js +3 -0
- package/dist/assets/app-shell-eager-leaves-D9tgfJOe.js +1 -0
- package/dist/assets/{ar-B-6GTIRU.js → ar-DG8TAFtm.js} +1 -1
- package/dist/assets/{ar-DZ-wEl298ti.js → ar-DZ-BtSien-d.js} +1 -1
- package/dist/assets/{ar-EG-YBT90_S0.js → ar-EG-DpXC0zoY.js} +1 -1
- package/dist/assets/{ar-MA-3uT-EYh6.js → ar-MA-D1qVJLyE.js} +1 -1
- package/dist/assets/{ar-SA-SiQsjhhc.js → ar-SA-BIYKNgv8.js} +1 -1
- package/dist/assets/{ar-TN-CfzXjKzS.js → ar-TN-mUR5Mq3s.js} +1 -1
- package/dist/assets/{az-BqAfcNza.js → az-B7IqwHGK.js} +1 -1
- package/dist/assets/{be-CQgWXa9_.js → be-CnZyPaSX.js} +1 -1
- package/dist/assets/{be-tarask-BmNg0Sir.js → be-tarask--uMMCC7l.js} +1 -1
- package/dist/assets/{bg-D3evgRuS.js → bg-CZwuirtY.js} +1 -1
- package/dist/assets/{bn-uItkARwm.js → bn-BbOX0r-z.js} +1 -1
- package/dist/assets/{bs-DueReOpO.js → bs-B5W75cYR.js} +1 -1
- package/dist/assets/{ca-Cr3AHktR.js → ca-Be69LdIM.js} +1 -1
- package/dist/assets/{ckb-CTi5BET7.js → ckb-B-nKM1Vn.js} +1 -1
- package/dist/assets/{createDerive-CjN1i5vn.js → createDerive-CynsXU-B.js} +1 -1
- package/dist/assets/{cs-43mFX9jr.js → cs-qHngxH7l.js} +1 -1
- package/dist/assets/{cy-BBSkg3F8.js → cy-DscO2Pgf.js} +1 -1
- package/dist/assets/{da-C5oA5qcs.js → da-vibkaLMF.js} +1 -1
- package/dist/assets/data-adapter-BDsrq0TX.js +2 -0
- package/dist/assets/{de-AT-CApxwJzu.js → de-AT--JneEuBw.js} +1 -1
- package/dist/assets/{de-CPtbLlAf.js → de-BCT78XYW.js} +1 -1
- package/dist/assets/default-inspector-registry-Dktr6x_q.js +1 -0
- package/dist/assets/dist-yh3dYtHt.js +14 -0
- package/dist/assets/drillUrlFilters-N0RngQg6.js +1 -0
- package/dist/assets/{el-Dto2xBQU.js → el-Cl0y9T2b.js} +1 -1
- package/dist/assets/en-AU-By42tTB7.js +1 -0
- package/dist/assets/{en-CA-DKuJPN1U.js → en-CA-BqEEoj-Y.js} +1 -1
- package/dist/assets/en-GB-Cx8B9nkB.js +1 -0
- package/dist/assets/en-IE-CX9nv6uO.js +1 -0
- package/dist/assets/en-IN-ByGSBHa4.js +1 -0
- package/dist/assets/en-NZ-BPMwa2ZN.js +1 -0
- package/dist/assets/en-ZA-lj_N4R6c.js +1 -0
- package/dist/assets/{eo-BL8JXIWd.js → eo-oOXROuhF.js} +1 -1
- package/dist/assets/{es-BnoaNxsu.js → es-EudscwjH.js} +1 -1
- package/dist/assets/{et-tPYLNenO.js → et-CB-5LLh6.js} +1 -1
- package/dist/assets/{eu-CUBG6bT0.js → eu-B4-hcseX.js} +1 -1
- package/dist/assets/{fa-IR-Rr2d9xSs.js → fa-IR-CogavcMJ.js} +1 -1
- package/dist/assets/{fi-B0NVIZsV.js → fi-CIBE0mYa.js} +1 -1
- package/dist/assets/{formatLong-1-gt9bpo.js → formatLong-qqgm7lV1.js} +1 -1
- package/dist/assets/{fr-CA-CBDvLXFg.js → fr-CA-BugXMutW.js} +1 -1
- package/dist/assets/{fr-BbhHek8e.js → fr-CDReXYWW.js} +1 -1
- package/dist/assets/{fr-CH-WPNmwPn7.js → fr-CH-fiTiB6X1.js} +1 -1
- package/dist/assets/framework-CAuH4h0L.js +35 -0
- package/dist/assets/{fy-DvOBbvEF.js → fy-t_GzIAg_.js} +1 -1
- package/dist/assets/{gd-BQPiTPX5.js → gd-CSncIxtN.js} +1 -1
- package/dist/assets/getIcon-BDkBRQFw.js +1 -0
- package/dist/assets/{gl-BJCXK8uO.js → gl-_138Mj2S.js} +1 -1
- package/dist/assets/{gu-CctPRz3V.js → gu-COfH-YUT.js} +1 -1
- package/dist/assets/{he-CVFMk6p2.js → he-BXL4lOKY.js} +1 -1
- package/dist/assets/{hi-Ba30-RwS.js → hi-kXuYI0TJ.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BQ57IrBV.js → highlighted-body-OFNGDK62-CK7x7Gzm.js} +1 -1
- package/dist/assets/{hr-BZUqTbZs.js → hr-DAOsQWzI.js} +1 -1
- package/dist/assets/{ht-BLe05tPx.js → ht-Ch8SKz8p.js} +1 -1
- package/dist/assets/{hu-2CQ_Mkww.js → hu-q6W_rWPT.js} +1 -1
- package/dist/assets/{hy-CclcPG4H.js → hy-0M8OmwnM.js} +1 -1
- package/dist/assets/{i18n-BnUsCaSC.js → i18n-DTfZonAM.js} +3 -3
- package/dist/assets/i18n-locale-ar-O6rs-Cir.js +4 -0
- package/dist/assets/i18n-locale-de-CMc1jk4a.js +4 -0
- package/dist/assets/i18n-locale-en-CbRQO81h.js +4 -0
- package/dist/assets/i18n-locale-es-t47nyoCX.js +4 -0
- package/dist/assets/i18n-locale-fr-E425EqJM.js +4 -0
- package/dist/assets/i18n-locale-ja-y_fk77fz.js +4 -0
- package/dist/assets/i18n-locale-ko-CdnY2uCg.js +4 -0
- package/dist/assets/i18n-locale-pt-BaUOXS6y.js +4 -0
- package/dist/assets/i18n-locale-ru-pFlhX9wg.js +4 -0
- package/dist/assets/i18n-locale-zh-Dkj4ROTN.js +4 -0
- package/dist/assets/i18n-runtime-CdWyaiOD.js +1 -0
- package/dist/assets/{id-6JLB8s-f.js → id-BM_H1_jv.js} +1 -1
- package/dist/assets/index-ocmkyCt6.js +19 -0
- package/dist/assets/index-v2Ijn9Gr.css +2 -0
- package/dist/assets/{infrastructure-Cc34lEqb.js → infrastructure-CSnL6ntj.js} +2 -2
- package/dist/assets/integration-7NqwVHuJ.js +1 -0
- package/dist/assets/{is-to0CWzm1.js → is-B_7jXZfS.js} +1 -1
- package/dist/assets/isSameWeek-D90tBsli.js +1 -0
- package/dist/assets/{it-ea0B8Ujp.js → it-CBM0J9cD.js} +1 -1
- package/dist/assets/{it-CH-DhdfjP5Z.js → it-CH-BQltCNsR.js} +1 -1
- package/dist/assets/{ja-B1bzkgDW.js → ja-DBjnsx21.js} +1 -1
- package/dist/assets/{ja-Hira-CMrY5hXO.js → ja-Hira-BZfSmj1i.js} +1 -1
- package/dist/assets/{ka-DKSXLnXP.js → ka-HwpuKgUY.js} +1 -1
- package/dist/assets/{kk-DHwMv8Dn.js → kk-DLKA9paj.js} +1 -1
- package/dist/assets/{km-tpLG1xNr.js → km-BU5kermq.js} +1 -1
- package/dist/assets/{kn-MLreVnHA.js → kn-BNFqbCoi.js} +1 -1
- package/dist/assets/{ko-CI0DBazn.js → ko-D8n4uMqQ.js} +1 -1
- package/dist/assets/{lb-CmL572Xe.js → lb-B1empQ7m.js} +1 -1
- package/dist/assets/{lt-DRtUOLdw.js → lt-gMukpK3G.js} +1 -1
- package/dist/assets/{lv-COSHgkOP.js → lv-D2O5AnsZ.js} +1 -1
- package/dist/assets/{match-BQoOW8Cj.js → match-BTF6WqJh.js} +1 -1
- package/dist/assets/{match-B-ergJQb.js → match-Cyum2eeW.js} +1 -1
- package/dist/assets/{match-dfBS0YSQ.js → match-ScHH8kYk.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-D4H6EVJQ.js +1 -0
- package/dist/assets/metadata-admin-CEhVmXFv.js +9 -0
- package/dist/assets/{mk-B0IH_YL_.js → mk-D-Zl0xVN.js} +1 -1
- package/dist/assets/{mn-P-QdQ2n3.js → mn-jJbTslgD.js} +1 -1
- package/dist/assets/{ms-CtyEOINy.js → ms-CUuJHLA4.js} +1 -1
- package/dist/assets/{mt-DfuZ2HRm.js → mt-yIcbfxKY.js} +1 -1
- package/dist/assets/{nb-2Hp-5Tnt.js → nb-D9WNypoj.js} +1 -1
- package/dist/assets/{nl-BE-mmxbfNoR.js → nl-BE-B1vKiw2h.js} +1 -1
- package/dist/assets/{nl-CZ_nLREz.js → nl-DC7b5e90.js} +1 -1
- package/dist/assets/{nn-ccWhYsNa.js → nn-uP4yJ9s0.js} +1 -1
- package/dist/assets/{oc-z504BFRV.js → oc-DHTqadJI.js} +1 -1
- package/dist/assets/{pl-DeQ7ASt-.js → pl-Bxnnizf5.js} +1 -1
- package/dist/assets/plugin-calendar-b7C35ANT.js +1 -0
- package/dist/assets/plugin-charts-b-yVtmdI.js +7 -0
- package/dist/assets/{plugin-chatbot-Ck47EhDX.js → plugin-chatbot-D1KW_oIO.js} +8 -8
- package/dist/assets/plugin-dashboard-DTkPoPEb.js +6 -0
- package/dist/assets/plugin-form-UIRm-FpQ.js +1 -0
- package/dist/assets/plugin-gantt-9dtc8zzX.js +63 -0
- package/dist/assets/plugin-grid-Cp4RKtMJ.js +10 -0
- package/dist/assets/plugin-kanban-B2JOPZIJ.js +1 -0
- package/dist/assets/plugin-map-CBJcVJYk.js +1 -0
- package/dist/assets/{plugin-markdown-BOkHcir_.js → plugin-markdown-CNlDzqP-.js} +1 -1
- package/dist/assets/plugin-report-IZzgQb-Q.js +59 -0
- package/dist/assets/plugin-timeline-DsmtjcJ3.js +1 -0
- package/dist/assets/plugin-tree-DTRPBdhe.js +1 -0
- package/dist/assets/plugin-view-D9ixsNDG.js +1 -0
- package/dist/assets/plugins-views-CnvkdSJK.js +3 -0
- package/dist/assets/{pt-BR-D80_lPYF.js → pt-BR-D416seHT.js} +1 -1
- package/dist/assets/{pt-CJJ1RmXd.js → pt-DwHBy9_c.js} +1 -1
- package/dist/assets/{ro-EuFb2TCj.js → ro-DDf1X3Np.js} +1 -1
- package/dist/assets/{ru-CMaVQScp.js → ru-8eM3mcgK.js} +1 -1
- package/dist/assets/{runtime-metadata-persistence-ClOTznqa.js → runtime-metadata-persistence-DX29lQ62.js} +1 -1
- package/dist/assets/{se-DsfdKLdF.js → se-D4JvQeRX.js} +1 -1
- package/dist/assets/{sk-BNV9omI8.js → sk-DvpgttGI.js} +1 -1
- package/dist/assets/{sl-DJS_nINU.js → sl-B3gCZ-_a.js} +1 -1
- package/dist/assets/{sq-HEgjcbHe.js → sq-CVaTmL0V.js} +1 -1
- package/dist/assets/{sr-CO0CFu4X.js → sr-CnH5Ffyz.js} +1 -1
- package/dist/assets/{sr-Latn-eE1Idzey.js → sr-Latn-Dw9w61q6.js} +1 -1
- package/dist/assets/src-BUry7633.js +2 -0
- package/dist/assets/{src-BU7L2v4J.js → src-DMDT5a27.js} +1 -1
- package/dist/assets/src-ZxH3AOCu.js +16 -0
- package/dist/assets/{studioEntry-WeMfaSGn.js → studioEntry-DAqcBFtr.js} +1 -1
- package/dist/assets/{submitRedirect-C2lfZSHt.js → submitRedirect-iy0oOi7I.js} +1 -1
- package/dist/assets/{sv-5uTzgQT3.js → sv-CU7wdxyK.js} +1 -1
- package/dist/assets/{ta-BzgdkBZG.js → ta-DPH6q0HR.js} +1 -1
- package/dist/assets/{te-Ct_pl7ZJ.js → te-BSaThkGV.js} +1 -1
- package/dist/assets/{th-DouAlk0-.js → th-NXP8_Qb8.js} +1 -1
- package/dist/assets/{tr-3XNBsI40.js → tr-DDXoH663.js} +1 -1
- package/dist/assets/types-zod-ChJ30y25.js +1 -0
- package/dist/assets/{ug-B9n24h9G.js → ug-Guus6pPe.js} +1 -1
- package/dist/assets/ui-components-D8wcRNrt.js +37 -0
- package/dist/assets/ui-layout-BYO3rRIl.js +1 -0
- package/dist/assets/{uk-DCAenByf.js → uk-uiy4vsp8.js} +1 -1
- package/dist/assets/use-book-data-DFTswcKm.js +1 -0
- package/dist/assets/{useActionModal-Blp4rhOk.js → useActionModal-h52Z5Pkl.js} +1 -1
- package/dist/assets/useCanAuthorMetadata-TDrVrYGB.js +1 -0
- package/dist/assets/useDatasetCatalog-BOd0Ybr1.js +1 -0
- package/dist/assets/{useNavTargetLabel-BOJncjIb.js → useNavTargetLabel-D8lRdb6O.js} +1 -1
- package/dist/assets/useOpenRecordList-C7oqUD3F.js +1 -0
- package/dist/assets/{usePackageL10n-Ci9uVkRZ.js → usePackageL10n-Jl2XiF2F.js} +1 -1
- package/dist/assets/{useSettingsLabel-CeMnMWsh.js → useSettingsLabel-CSpBDTdy.js} +1 -1
- package/dist/assets/{uz-Cyrl-JSeHEqu-.js → uz-Cyrl-Cmb5bvbf.js} +1 -1
- package/dist/assets/{uz-DT3s9bZS.js → uz-DJWxoTz4.js} +1 -1
- package/dist/assets/vendor-objectstack-C4eD5dbT.js +139 -0
- package/dist/assets/{vi-D2p-h6bY.js → vi-Bb3QoIJC.js} +1 -1
- package/dist/assets/{zh-CN-DHOKqAit.js → zh-CN-C-Hts1ZR.js} +1 -1
- package/dist/assets/{zh-HK-D4iIPY7I.js → zh-HK-CtBAZ_ZS.js} +1 -1
- package/dist/assets/{zh-TW-gORQ_tZh.js → zh-TW-B7DDahD-.js} +1 -1
- package/dist/chunk-membership.json +28 -26
- package/dist/eager-closure.json +107 -101
- package/dist/index.html +4 -4
- package/dist/sdui.manifest.json +486 -63
- package/package.json +1 -1
- package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +0 -1
- package/dist/assets/AuditLogPage-v2dKXMuk.js +0 -1
- package/dist/assets/BookPage-DwFMcTSN.js +0 -1
- package/dist/assets/CreateViewDialog-D3l-tYHM.js +0 -1
- package/dist/assets/DocPage-B6AkH5WI.js +0 -1
- package/dist/assets/ExpressionProvider-CrL6jhVq.js +0 -1
- package/dist/assets/FlowRunsPage-CxdaiUyk.js +0 -1
- package/dist/assets/InterfaceListPage-C4wPYohR.js +0 -1
- package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +0 -4
- package/dist/assets/MarketplacePage-DNEyU5AE.js +0 -1
- package/dist/assets/ObjectDataPage-CykEm9MD.js +0 -1
- package/dist/assets/PageView-C6u86tni.js +0 -1
- package/dist/assets/ProfilePage-C3SjXMzi.js +0 -1
- package/dist/assets/RecordDetailView-DgR_zhP4.js +0 -3
- package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +0 -1
- package/dist/assets/ReportView-BREO-ADE.js +0 -2
- package/dist/assets/RuntimeDraftBar-BCWfd2yS.js +0 -1
- package/dist/assets/SchemaForm-C4uMMZ13.js +0 -3
- package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +0 -1
- package/dist/assets/ai-DPBykF2N.js +0 -3
- package/dist/assets/app-shell-eager-leaves-Cf2bM6uT.js +0 -1
- package/dist/assets/data-adapter-Cymvlczj.js +0 -1
- package/dist/assets/default-inspector-registry-Bs6GBn00.js +0 -1
- package/dist/assets/dist-BF-ssUpn.js +0 -14
- package/dist/assets/drillUrlFilters-hi-2d3DW.js +0 -1
- package/dist/assets/en-AU-FVwCiDJO.js +0 -1
- package/dist/assets/en-GB-DQ_y5VbJ.js +0 -1
- package/dist/assets/en-IE-DaXOhsZW.js +0 -1
- package/dist/assets/en-IN-CnRZnAom.js +0 -1
- package/dist/assets/en-NZ-CBZLEToK.js +0 -1
- package/dist/assets/en-ZA-BE59v0wZ.js +0 -1
- package/dist/assets/framework-DFR4HNtj.js +0 -35
- package/dist/assets/getIcon-Cfwf-Egt.js +0 -1
- package/dist/assets/i18n-locale-ar-92O_xtDZ.js +0 -4
- package/dist/assets/i18n-locale-de-T5ic3yH9.js +0 -4
- package/dist/assets/i18n-locale-en-rxr7WJYl.js +0 -4
- package/dist/assets/i18n-locale-es-D_WOifJ_.js +0 -4
- package/dist/assets/i18n-locale-fr-3cvyjMkp.js +0 -4
- package/dist/assets/i18n-locale-ja-DXlIkB8I.js +0 -4
- package/dist/assets/i18n-locale-ko-DngRpS45.js +0 -4
- package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +0 -4
- package/dist/assets/i18n-locale-ru-E5wLh-y6.js +0 -4
- package/dist/assets/i18n-locale-zh-BL4_Yand.js +0 -4
- package/dist/assets/i18n-runtime-97_bDVjP.js +0 -1
- package/dist/assets/index-Cadlh4t_.css +0 -2
- package/dist/assets/index-D98sa5GF.js +0 -20
- package/dist/assets/integration-CeAF4JFT.js +0 -1
- package/dist/assets/isSameWeek-DBXaA1Gd.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +0 -1
- package/dist/assets/metadata-admin-CABUxbJl.js +0 -9
- package/dist/assets/plugin-calendar-Cn5HaZU8.js +0 -1
- package/dist/assets/plugin-charts-B6RcFWbo.js +0 -7
- package/dist/assets/plugin-dashboard-DjEx8e5Y.js +0 -6
- package/dist/assets/plugin-form-CLDvL0up.js +0 -1
- package/dist/assets/plugin-gantt-CrVrxVdi.js +0 -63
- package/dist/assets/plugin-grid-D2rmQEW_.js +0 -11
- package/dist/assets/plugin-kanban-BUNHFfIC.js +0 -1
- package/dist/assets/plugin-map-y-7RQQC5.js +0 -1
- package/dist/assets/plugin-report-mT3jpna0.js +0 -59
- package/dist/assets/plugin-timeline-B1EF83D3.js +0 -1
- package/dist/assets/plugin-tree-MTHUt3_S.js +0 -1
- package/dist/assets/plugin-view-DHJI-ahf.js +0 -1
- package/dist/assets/plugins-views-CfkgqD30.js +0 -3
- package/dist/assets/src-BUtIBFDA.js +0 -1
- package/dist/assets/src-C0eXlKtx.js +0 -16
- package/dist/assets/types-zod-DXpXw10W.js +0 -1
- package/dist/assets/ui-components-D6cEVg0T.js +0 -37
- package/dist/assets/ui-layout-DgVDuPEM.js +0 -1
- package/dist/assets/use-book-data-CwRldFxP.js +0 -1
- package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +0 -1
- package/dist/assets/useOpenRecordList-BrwJFojQ.js +0 -1
- package/dist/assets/vendor-objectstack-DFqu45yM.js +0 -138
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ui-components-BL3SEdAz.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{h as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{Zi as i}from"./vendor-objectstack-C4eD5dbT.js";import{$n as a,$t as o,Bn as s,Fr as c,Ir as l,It as u,Jn as d,Kn as f,Ln as p,Lr as m,Lt as h,Mr as g,Pt as _,Qt as v,Rn as y,Rr as b,Si as x,Vn as S,Wt as C,Xt as w,Yn as T,Zt as E,bi as D,cn as O,en as k,jr as A,qn as j,qt as M,tn as ee,zn as N,zr as P}from"./ui-components-D8wcRNrt.js";import{Ft as F,t as I}from"./framework-CAuH4h0L.js";import{w as te}from"./i18n-runtime-CdWyaiOD.js";import{r as ne}from"./vendor-ui-utils-DIUdEYii.js";import{t as L}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as re}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as ie}from"./vendor-icon-chevron-up-C-6o_0je.js";import{t as ae}from"./vendor-icon-chevrons-up-down-CbDukqtA.js";import{t as oe}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as se}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as R}from"./vendor-icon-code-xml-C9EWHSC8.js";import{t as ce}from"./vendor-icon-eye-off-Dy3GIcvl.js";import{t as le}from"./vendor-icon-eye-C3HaEGOo.js";import{t as ue}from"./vendor-icon-grip-vertical-B01-ovq0.js";import{t as de}from"./vendor-icon-list-filter-C15EN_7M.js";import{t as z}from"./vendor-icon-plus-BlfcDDsa.js";import{t as fe}from"./vendor-icon-search-B2Uqtp_W.js";import{t as pe}from"./vendor-icon-settings-2-BHIWdy1J.js";import{t as me}from"./vendor-icon-sigma-DSt0XKnk.js";import{t as B}from"./vendor-icon-trash-BLsWkwB9.js";import{t as he}from"./vendor-icon-triangle-alert-D5n0T3q_.js";import{t as ge}from"./vendor-icon-x-CcLtgRNL.js";import{o as _e}from"./createDerive-CynsXU-B.js";import{r as ve}from"./plugin-form-UIRm-FpQ.js";import{g as V,h as ye,i as H,m as be,p as xe,r as U,s as Se}from"./i18n-DTfZonAM.js";var W=e(r(),1),G=n(),Ce=I(`metadataAdminFieldsReadDoor`),we=`referenceTo`,Te=`reference`;function Ee(e){return typeof e==`string`&&e.trim()!==``}function De(e){let t=Ce.filter(t=>t in e);if(t.length===0)return e;let n={...e};for(let e of t)delete n[e];return t.includes(we)&&!Ee(n[Te])&&Ee(e[we])&&(n[Te]=e[we]),n}function Oe(e){return Array.isArray(e)?{shape:`array`,entries:e.map((e,t)=>{let{name:n,...r}=e??{};return{name:typeof n==`string`&&n?n:`field_${t+1}`,def:De(r)}})}:e&&typeof e==`object`?{shape:`record`,entries:Object.entries(e).map(([e,t])=>({name:e,def:De({...t??{}})}))}:{shape:`record`,entries:[]}}function ke(e){return e.shape===`array`?e.entries.map(e=>({name:e.name,...e.def})):Object.fromEntries(e.entries.map(e=>[e.name,e.def]))}function Ae(e,t){return e.entries.findIndex(e=>e.name===t)}function je(e,t,n){let r={type:t,label:n??Me(e)};return(t===`select`||t===`multiselect`||t===`radio`||t===`checkboxes`)&&(r.options=[]),{name:e,def:r}}function Me(e){return e?e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):``}function Ne(e){let t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).replace(/_{2,}/g,`_`);return t?/^[a-z_]/.test(t)?t:`f_${t}`:`field`}function Pe(e){let t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+/g,``).replace(/_{2,}/g,`_`);return t?/^[a-z_]/.test(t)?t:`f_${t}`:``}function Fe(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`).map(e=>({...e,key:typeof e.key==`string`?e.key:``,label:typeof e.label==`string`?e.label:``})).filter(e=>e.key):[]}function Ie(e,t){let n=/[a-z0-9]/i.test(e)?Ne(e):`group`;if(!t.includes(n))return n;let r=2;for(;t.includes(`${n}_${r}`);)r+=1;return`${n}_${r}`}function Le(e,t){let n=t.trim()||`New section`,r=Ie(n,e.map(e=>e.key));return[...e,{key:r,label:n}]}function Re(e,t,n){let r=n.trim();return r?e.map(e=>e.key===t?{...e,label:r}:e):e}function ze(e,t,n){return e.map(e=>{if(e.key!==t)return e;let r={...e};for(let[e,t]of Object.entries(n))t===void 0?delete r[e]:r[e]=t;return r})}function Be(e,t){return e.filter(e=>e.key!==t)}function Ve(e,t,n){let r=e.findIndex(e=>e.key===t);if(r<0)return e;let i=r+n;return i<0||i>=e.length?e:Ue(e,r,i)}function He(e,t){return{shape:e.shape,entries:e.entries.map(e=>e.def.group===t?{name:e.name,def:{...e.def,group:void 0}}:e)}}function Ue(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function We(e,t,n){let r=Array.isArray(t)?t.filter(e=>typeof e?.key==`string`):[],i=new Map;for(let e of r)i.set(e.key,{key:e.key,label:String(e.label??e.key),entries:[]});let a=new Set(r.map(e=>e.key));for(let t of e.entries){let e=typeof t.def.group==`string`?t.def.group:null;e&&a.has(e)?i.get(e).entries.push(t):(i.has(null)||i.set(null,{key:null,label:`Ungrouped`,entries:[]}),i.get(null).entries.push(t))}let o=!!n?.includeEmptyDeclared;return Array.from(i.values()).filter(e=>e.entries.length>0||o&&e.key!==null)}function Ge(e,t){return e===t||JSON.stringify(e??null)===JSON.stringify(t??null)}function Ke(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]),r=[];for(let i of n)Ge(e[i],t[i])||r.push(i);return r.sort()}function qe(e,t){let n=Oe(e),r=Oe(t),i=new Map(n.entries.map(e=>[e.name,e])),a=new Set(r.entries.map(e=>e.name)),o={},s=0,c=0;for(let e of r.entries){let t=i.get(e.name);if(!t){o[e.name]={name:e.name,status:`added`,changedKeys:[]},s+=1;continue}let n=Ke(t.def,e.def);n.length?(o[e.name]={name:e.name,status:`changed`,changedKeys:n},c+=1):o[e.name]={name:e.name,status:`unchanged`,changedKeys:[]}}let l=n.entries.filter(e=>!a.has(e.name));return{byName:o,removed:l,counts:{added:s,changed:c,removed:l.length}}}var Je=new Set([...u,`is_empty`,`is_not_empty`,`is_null`,`is_not_null`]);function Ye(e,t){return!h(String(e??``),t)}function Xe(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return Array.isArray(t.conditions)||t.logic===`and`||t.logic===`or`}function Ze(e){if(e==null)return{ok:!0,rules:[]};let t=Xe(e)&&Array.isArray(e.conditions)?e.conditions:[],n=[];for(let e of t){if(Xe(e))return{ok:!1,reason:`nested_group`};if(typeof e!=`object`||!e)continue;let t=e;if(typeof t.field!=`string`||t.field===``)continue;let r=i(t.operator);if(!Je.has(String(t.operator))&&!Je.has(String(r))&&Ye(t.operator,t.value))continue;let a={field:t.field,operator:r};t.value!==void 0&&(a.value=t.value),n.push(a)}return(Xe(e)?e.logic:void 0)===`or`&&n.length>1?{ok:!1,reason:`or_logic`}:{ok:!0,rules:n}}var Qe={or_logic:`console.objectView.filterOrNotSavable`,nested_group:`console.objectView.filterNestedNotSavable`},$e=[`current_user`,`user`,`ctx`,`os`];function K(e,t){let n={data:e??{}};if(t)for(let e of $e)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.data=e??{},n}function et(e,t){return nt(e.visibleWhen,t)}function tt(e,t){return e.filter(e=>et(e,t))}function nt(e,t){if(e==null)return!0;let n=typeof e==`string`?e:e.source;if(!n)return!0;try{return _t(n.trim(),t,n)}catch(e){return e instanceof rt&<(e.path,n,t),!0}}var rt=class extends Error{path;constructor(e){super(`unresolved predicate path: ${e}`),this.path=e,this.name=`UnresolvedPathError`}},it=new Set,at=new Set,ot=new Set,st=new Set,ct=()=>!1;function lt(e,t,n){if(!ct())return;let r=`${e}::${t}`;if(it.has(r))return;it.add(r);let i=e.split(`.`)[0],a=Object.keys(n).sort().map(e=>`\`${e}\``).join(`, `);console.warn(`[metadata-admin] visibility predicate \`${t}\` references \`${e}\`, but \`${i}\` is not a name in this form's evaluation scope — the names here are ${a} (\`data\` is the current draft; the identity roots are bound only under a host \`ExpressionProvider\`). The predicate was treated as TRUE (fail-open) so the field stays visible instead of disappearing without a trace; check the spelling — draft values are addressed as \`data.<field>\` (e.g. \`data.type in [...]\`) and the signed-in user as \`current_user.<field>\`. A predicate served by an older backend is the usual cause (objectstack#6254 re-spelled the bare \`objectForm\` predicates; objectstack#6936).`)}var ut=/^[A-Za-z_$][A-Za-z0-9_$]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*$/;function dt(e,t){if(!ct())return;let n=`${e}::${t}`;at.has(n)||(at.add(n),console.warn(`[metadata-admin] visibility predicate \`${t}\` compares against \`${e}\`, which looks like a path but is being used as the literal string "${e}" — this evaluator resolves paths only on the LEFT of \`==\` / \`!=\`; the right-hand side is always a literal (supported subset: \`path == 'literal'\`). So \`data.a == data.b\` is FALSE even when both sides hold the same value, and \`data.a != data.b\` is TRUE — the verdict does not depend on the right-hand path at all. If you meant the text, quote it (\`== 'text'\`). If you meant to compare two paths, that is outside this evaluator's subset: it is an interim stand-in for \`@objectstack/formula\` until CEL lands (ROADMAP M9), and predicate expressions are validated at publish time (objectstack#7010). objectui#4049.`))}function ft(e){let t=e.slice(1,-1);if(!t.trim())return null;for(let e of vt(t,`,`)){let t=e.trim();if(t)try{let e=t.replace(/'([^']*)'/g,(e,t)=>JSON.stringify(t));JSON.parse(e)}catch{return t}}return null}function pt(e,t){if(!ct())return;let n=`${e}::${t}`;if(ot.has(n))return;ot.add(n);let r=ft(e);console.warn(`[metadata-admin] visibility predicate \`${t}\` has an \`in\` set \`${e}\``+(r==null?`, which this evaluator could not parse — `:` containing \`${r}\`, which is not a literal this evaluator can parse — `)+"the WHOLE set was treated as EMPTY, so the predicate is FALSE for every row (not just the element that failed — one bad element discards the good literals next to it too). This evaluator only supports literal elements inside `in [...]` (supported subset: `path in ['a','b']`); it does not resolve paths there — paths resolve only on the LEFT of an operator (objectui#4049). If you meant a literal, quote it. If you meant to test membership against another field, that is outside this evaluator's subset: it is an interim stand-in for `@objectstack/formula` until CEL lands (ROADMAP M9), and predicate expressions are validated at publish time (objectstack#7010). objectui#4266.")}var mt=` in `;function ht(e){return vt(e,mt).length>1}function gt(e,t){if(!ct())return;let n=`${e}::${t}`;st.has(n)||(st.add(n),console.warn(`[metadata-admin] visibility predicate \`${t}\` spells a membership test \`${e}\` whose right-hand side is not a bracketed literal set. This evaluator matches \`in\` ONLY against a bracketed set of literals (supported subset: \`path in ['a','b']\`), so this text was never treated as a membership test at all — it fell through every operator branch to a BARE TRUTHY check of the whole string, and the verdict has nothing to do with the membership that was written. With a quoted left side — ADR-0068's own headline example \`'admin' in current_user.positions\` — the whole text comes back verbatim as a non-empty string, so the predicate reads TRUE for EVERY user and a gate meant for admins is open to everyone; with a path-shaped left side it reads FALSE for every row instead. There is no working spelling of this form on this surface: a path on the RIGHT of \`in\` CANNOT be written here today. Paths resolve only on the LEFT of an operator (objectui#4049) and the right of \`in\` must be a literal set spelled out in the predicate itself, so testing membership against a value the draft or the signed-in user holds is outside this evaluator's subset and cannot be expressed — not with different punctuation, not with a different spelling, not at all. This evaluator is an interim stand-in for \`@objectstack/formula\` until CEL lands (ROADMAP M9), and predicate expressions are validated at publish time (objectstack#7010). objectui#6617.`))}function _t(e,t,n){let r=vt(e,`||`);if(r.length>1)return r.some(e=>_t(e.trim(),t,n));let i=vt(e,`&&`);if(i.length>1)return i.every(e=>_t(e.trim(),t,n));if(e.startsWith(`!`))return!_t(e.slice(1).trim(),t,n);let a=e.match(/^(.+?)\s+in\s+(\[.*\])$/);if(a){let e=yt(a[1].trim(),t,n),r=bt(a[2],n);return Array.isArray(r)&&r.includes(e)}let o=e.match(/^(.+?)\s*(==|!=)\s*(.+)$/);if(o){let e=yt(o[1].trim(),t,n),r=bt(o[3].trim(),n),i=e=>e==null,a=i(e)&&i(r)?!0:e===r;return o[2]===`==`?a:!a}return ht(e)&>(e,n),!!yt(e,t,n)}function vt(e,t){let n=[],r=0,i=null,a=``;for(let o=0;o<e.length;o++){let s=e[o];if(i){a+=s,s===i&&e[o-1]!==`\\`&&(i=null);continue}if(s===`'`||s===`"`){i=s,a+=s;continue}if(s===`(`||s===`[`?r++:(s===`)`||s===`]`)&&r--,r===0&&e.slice(o,o+t.length)===t&&e[o+t.length]!==`=`){n.push(a),a=``,o+=t.length-1;continue}a+=s}return a&&n.push(a),n}function yt(e,t,n){if(/^['"]/.test(e)||/^-?\d/.test(e)||e===`true`||e===`false`||e===`null`)return bt(e,n);let r=e.split(`.`);if(!Object.prototype.hasOwnProperty.call(t,r[0]))throw new rt(e);let i=t;for(let e of r){if(i==null)return;i=i[e]}return i}function bt(e,t){let n=e.trim();if(n===`true`)return!0;if(n===`false`)return!1;if(n===`null`)return null;if(/^-?\d+(\.\d+)?$/.test(n))return Number(n);if(n.startsWith(`'`)&&n.endsWith(`'`)||n.startsWith(`"`)&&n.endsWith(`"`))return n.slice(1,-1);if(n.startsWith(`[`)&&n.endsWith(`]`))try{let e=n.replace(/'([^']*)'/g,(e,t)=>JSON.stringify(t));return JSON.parse(e)}catch{return pt(n,t),[]}return ut.test(n)&&dt(n,t),n}var xt=[{value:`default`,label:`Default`,css:`#9ca3af`},{value:`blue`,label:`Blue`,css:`#3b82f6`},{value:`teal`,label:`Teal`,css:`#14b8a6`},{value:`orange`,label:`Orange`,css:`#f97316`},{value:`purple`,label:`Purple`,css:`#a855f7`},{value:`success`,label:`Success`,css:`#22c55e`},{value:`warning`,label:`Warning`,css:`#f59e0b`},{value:`danger`,label:`Danger`,css:`#ef4444`},{value:`green`,label:`Green`,css:`#22c55e`},{value:`red`,label:`Red`,css:`#ef4444`},{value:`amber`,label:`Amber`,css:`#f59e0b`}],St=Object.fromEntries(xt.map(e=>[e.value,e.css]));function Ct(e){return e?/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)?e:St[e]??`#9ca3af`:`#9ca3af`}function wt({value:e,onChange:t,disabled:n,options:r,required:i,ariaLabelledBy:a,ariaLabel:o}){let s=r?r.map(e=>({value:e.value,label:e.label??e.value,css:Ct(e.value)})):xt.slice(0,8),c=e??`default`;return(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`radiogroup`,"aria-labelledby":a,"aria-label":o,"aria-required":i?!0:void 0,children:s.map(e=>{let r=c===e.value;return(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":e.label,title:e.label,disabled:n,onClick:()=>t(e.value),className:x(`flex h-7 w-7 items-center justify-center rounded-full border transition-all`,r?`border-transparent ring-2 ring-foreground/60 ring-offset-1 ring-offset-background`:`border-border hover:scale-110`,n&&`cursor-not-allowed opacity-50`),children:(0,G.jsx)(`span`,{className:`h-4 w-4 rounded-full`,style:{backgroundColor:e.css}})},e.value)})})}function Tt(e,t){let n=_e(),r=V(),[i,a]=W.useState({result:{fields:[],loading:!t&&!!e,error:null},notFound:!1});return W.useEffect(()=>{if(t){a({result:{fields:t,loading:!1,error:null},notFound:!1});return}if(!e){a({result:{fields:[],loading:!1,error:null},notFound:!1});return}let r=!1;return a(e=>({result:{...e.result,loading:!0,error:null},notFound:!1})),n.get(`object`,e).then(e=>{if(r)return;if(!e){a({result:{fields:[],loading:!1,error:null},notFound:!0});return}let t=Oe(e.fields).entries.map(e=>({name:e.name,label:typeof e.def.label==`string`&&e.def.label?e.def.label:e.name,type:typeof e.def.type==`string`?e.def.type:`text`,hidden:e.def.hidden===!0,...e.def.required===!0?{required:!0}:{}}));a({result:{fields:t,loading:!1,error:null},notFound:!1})}).catch(e=>{r||a({result:{fields:[],loading:!1,error:e?.message??String(e)},notFound:!1})}),()=>{r=!0}},[n,e,t]),i.notFound?{...i.result,error:U(`engine.form.objectNotFound`,r)}:i.result}var Et=null;function Dt(){return Et||=t(()=>import(`./vendor-objectstack-C4eD5dbT.js`).then(e=>e.ft).then(e=>e),[],import.meta.url).catch(()=>null),Et}var Ot=[`record`,``],kt=[`current_user`,`user`],At=null,jt=null;function Mt(){return jt||=t(()=>import(`./dist-yh3dYtHt.js`).then(e=>{let t=e?.fieldRuleRootIssue;return typeof t==`function`?t:null}),[],import.meta.url).catch(()=>null),jt}var Nt=[`visibleWhen`,`readonlyWhen`,`requiredWhen`];function Pt(){return At||=t(async()=>{let{detectNonCanonicalRowSpelling:e}=await import(`./framework-CAuH4h0L.js`).then(e=>e.Lt);return{detectNonCanonicalRowSpelling:e}},[],import.meta.url).then(({detectNonCanonicalRowSpelling:e})=>({detectNonCanonicalRowSpelling:e})).catch(()=>null),At}async function Ft(e,t){if(t!==void 0&&Nt.includes(t)){let n=await Mt();if(n){let r=n(t,e);return r?{severity:`warning`,message:r.message}:null}}let n=(await Pt())?.detectNonCanonicalRowSpelling?.(e,null,!0);return!n||n.kind!==`metadata-layer-root`?null:{severity:`warning`,messageKey:`engine.celLint.notTheRow`,messageVars:{identifier:n.identifier,canonical:n.canonical}}}async function It(e,t={}){if(!e||!e.trim())return[];try{let n=await Dt();if(!n?.validateExpression)return[];let r=n.validateExpression(t.role??`predicate`,e,{objectName:t.objectName,fields:t.fields,scope:t.scope??`flattened`}),i=[];for(let e of r?.errors??[])e?.message&&i.push({severity:`error`,message:e.message});for(let e of r?.warnings??[])e?.message&&i.push({severity:`warning`,message:e.message});if(i.every(e=>e.severity!==`error`)&&t.clause===`using`&&n.isPushdownableCel)try{let t=n.isPushdownableCel(e,{fieldRoots:Ot,variableRoots:kt});t&&t.ok===!1&&t.reason!==`parse-error`&&i.push({severity:`warning`,messageKey:`engine.celLint.notPushdownable`,messageVars:{detail:t.detail}})}catch{}if(i.every(e=>e.severity!==`error`)&&t.scope===`record`)try{let n=await Ft(e,t.slot);n&&i.push(n)}catch{}return i}catch{return[]}}var Lt=[`number`,`text`,`boolean`,`date`,`unknown`];async function Rt(e,t={}){if(!e||!e.trim())return null;try{let n=await Dt();if(!n?.inferExpressionType)return null;let r=n.inferExpressionType(e,{objectName:t.objectName,fields:t.fields,scope:t.scope??`record`});return Lt.includes(r)?r:`unknown`}catch{return null}}async function zt(e={}){let t={fields:e.fields??[],roots:e.roots??[],functions:[]};try{let n=await Dt();if(!n?.introspectScope)return t;let r=n.introspectScope(e.role??`predicate`,{objectName:e.objectName,fields:e.fields,scope:e.scope??`flattened`});return{fields:r?.fields??e.fields??[],roots:e.roots??r?.roots??[],functions:r?.functions??[]}}catch{return t}}var Bt=/[A-Za-z0-9_$]/,Vt=/[A-Za-z_$]/;function Ht(e,t){let n=t;for(;n>0&&Bt.test(e[n-1]);)n--;if(n===t)return null;let r=e.slice(n,t);return!Vt.test(r[0])||n>0&&e[n-1]===`.`?null:{start:n,end:t,text:r}}function Ut(e,t){let n=t;for(;n>0&&Bt.test(e[n-1]);)n--;let r=e.slice(n,t);if(r&&!Vt.test(r[0])||n===0||e[n-1]!==`.`)return null;let i=n-1;for(;i>0&&Bt.test(e[i-1]);)i--;let a=e.slice(i,n-1);return!a||!Vt.test(a[0])||i>0&&e[i-1]===`.`?null:{root:a,start:n,end:t,text:r}}function Wt(e){let t=new Set,n=[],r=(e,r)=>{e&&!t.has(e)&&(t.add(e),n.push({label:e,kind:r}))};return e.fields.forEach(e=>r(e,`field`)),e.roots.forEach(e=>r(e,`root`)),e.functions.forEach(e=>r(e,`function`)),n}function Gt(e,t,n=!1){let r=t.toLowerCase();if(!r&&!n)return[];let i=[];for(let t of e){let e=t.label.toLowerCase();if(e.startsWith(r)&&e!==r&&i.push(t),i.length>=8)break}return i}async function Kt(e,t){if(!e||!e.trim())return{status:`error`,kind:`parse`,messageKey:`engine.celTest.predicateEmpty`};let n;try{n=await Dt()}catch{return{status:`unavailable`}}if(!n?.ExpressionEngine?.evaluate)return{status:`unavailable`};try{let r=t.record??{},i=t.currentUser??{},a={record:r,extra:{...r,record:r,current_user:i,user:i}},o=n.ExpressionEngine.evaluate({dialect:`cel`,source:e},a);if(!o||o.ok!==!0){let e=o&&o.ok===!1?o.error:void 0,t=e?.kind??`runtime`;return e?.message==null?{status:`error`,kind:t,messageKey:`engine.flowSim.note.evaluationFailed`}:{status:`error`,kind:t,message:e.message}}return o.value===!0?{status:`allow`}:o.value===!1?{status:`deny`}:{status:`value`,value:o.value}}catch(e){return{status:`error`,kind:`runtime`,message:e?.message??String(e)}}}var qt=250,Jt={field:`field`,root:`scope`,function:`fn`},Yt=new Set([`record`,`previous`]),Xt=[];function Zt(e,t){if(e.messageKey===void 0)return e.message;let n=e.messageVars;return t(e.messageKey).replace(/\{(\w+)\}/g,(e,t)=>t in n?n[t]:e)}function Qt({value:e,onChange:t,disabled:n,placeholder:r,label:i,objectName:o,fieldNames:s=Xt,clause:c,scope:l,roots:u,slot:d,role:f,onLintChange:p,onInferredTypeChange:m,t:h,id:g}){let _=W.useId(),v=g??_,y=W.useRef(null),[b,S]=W.useState([]),[C,w]=W.useState(!1),[T,D]=W.useState(null),[O,k]=W.useState(null),[A,j]=W.useState(!1),[M,ee]=W.useState([]),[N,P]=W.useState(0),F=W.useRef(null),I=W.useRef(null),te=s.join(`,`),ne=u?u.join(`,`):``,L=W.useRef(p),re=W.useRef(m);W.useEffect(()=>{L.current=p,re.current=m}),W.useEffect(()=>{let t=!1,n=setTimeout(()=>{let n={objectName:o,fields:s,clause:c,scope:l,slot:d,role:f};It(e,n).then(e=>{t||(S(e),w(!0),L.current?.(e))}),f===`value`&&Rt(e,n).then(e=>{t||(D(e),re.current?.(e))})},qt);return()=>{t=!0,clearTimeout(n)}},[e,o,te,c,l,d,f]),W.useEffect(()=>{e.trim()||(S([]),w(!1),D(null),L.current?.([]),f===`value`&&re.current?.(null))},[e]),W.useEffect(()=>{let e=!1;return zt({objectName:o,fields:s,scope:l,roots:u}).then(t=>{e||k(t)}),()=>{e=!0}},[o,te,l,ne]);let ie=W.useMemo(()=>O?Wt(l===`record`?{...O,fields:[]}:O):[],[O,l]),ae=W.useMemo(()=>O?O.fields.map(e=>({label:e,kind:`field`})):[],[O]);W.useEffect(()=>{if(I.current!=null&&y.current){let e=I.current;I.current=null,y.current.setSelectionRange(e,e)}},[e]);let R=W.useCallback(()=>{j(!1),ee([]),F.current=null},[]),ce=W.useCallback(()=>{let e=y.current;if(!e||n)return R();let t=e.value,r=e.selectionStart??t.length,i=null,a=[],o=Ht(t,r);if(o)i=o,a=Gt(ie,o.text);else{let e=Ut(t,r);e&&Yt.has(e.root)&&(i=e,a=Gt(ae,e.text,!0))}if(!i||!a.length)return R();F.current={start:i.start,end:i.end},ee(a),P(0),j(!0)},[ie,ae,n,R]),le=W.useCallback(e=>{let n=F.current,r=y.current;if(!n||!r)return;let i=r.value,a=e.kind===`function`?`${e.label}(`:e.label,o=i.slice(0,n.start)+a+i.slice(n.end);I.current=n.start+a.length,R(),t(o)},[t,R]),ue=W.useRef(ce);W.useEffect(()=>{ue.current=ce},[ce]),W.useEffect(()=>{y.current&&document.activeElement===y.current&&ue.current()},[ie,ae]);let de=e=>{A&&M.length!==0&&(e.key===`ArrowDown`?(e.preventDefault(),P(e=>(e+1)%M.length)):e.key===`ArrowUp`?(e.preventDefault(),P(e=>(e-1+M.length)%M.length)):e.key===`Enter`||e.key===`Tab`?(e.preventDefault(),le(M[N])):e.key===`Escape`&&(e.preventDefault(),R()))},z=b.filter(e=>e.severity===`error`),fe=b.filter(e=>e.severity===`warning`),pe=C&&!!e.trim()&&b.length===0,B=f===`value`&&C&&!!e.trim()&&z.length===0&&T!==null,ge=`${v}-ac`;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(a,{className:`text-[10px] uppercase text-muted-foreground`,htmlFor:v,children:i}),(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(E,{ref:y,id:v,value:e,disabled:n,rows:2,placeholder:r,spellCheck:!1,autoComplete:`off`,role:`combobox`,"aria-expanded":A,"aria-autocomplete":`list`,"aria-controls":A?ge:void 0,"aria-invalid":z.length>0||void 0,onChange:e=>{t(e.target.value),ce()},onKeyDown:de,onClick:ce,onBlur:()=>{window.setTimeout(()=>R(),120)},className:x(`font-mono text-xs`,z.length>0&&`border-destructive focus-visible:ring-destructive/40`)}),A&&M.length>0&&(0,G.jsx)(`ul`,{id:ge,role:`listbox`,"aria-label":h(`perm.cel.suggestions`),className:`absolute z-50 mt-1 max-h-48 w-72 overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,children:M.map((e,t)=>(0,G.jsxs)(`li`,{role:`option`,"aria-selected":t===N,onMouseDown:t=>{t.preventDefault(),le(e)},onMouseEnter:()=>P(t),className:x(`flex cursor-pointer items-center justify-between gap-2 rounded-sm px-2 py-1 text-xs`,t===N?`bg-accent text-accent-foreground`:`hover:bg-accent/60`),children:[(0,G.jsx)(`span`,{className:`font-mono`,children:e.label}),(0,G.jsx)(`span`,{className:`text-[10px] uppercase text-muted-foreground`,children:Jt[e.kind]})]},`${e.kind}:${e.label}`))})]}),(z.length>0||fe.length>0)&&(0,G.jsxs)(`ul`,{className:`mt-1 space-y-1`,"aria-live":`polite`,children:[z.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-1.5 text-[11px] text-destructive`,children:[(0,G.jsx)(oe,{className:`mt-[1px] h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:Zt(e,h)})]},`e${t}`)),fe.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-1.5 text-[11px] text-amber-600 dark:text-amber-500`,children:[(0,G.jsx)(he,{className:`mt-[1px] h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:Zt(e,h)})]},`w${t}`))]}),pe&&(0,G.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(se,{className:`h-3 w-3 shrink-0 text-emerald-600 dark:text-emerald-500`}),h(`perm.cel.valid`)]}),B&&(0,G.jsxs)(`p`,{className:`mt-1 flex items-start gap-1.5 text-[11px] text-muted-foreground`,"aria-live":`polite`,children:[(0,G.jsx)(me,{className:`mt-[1px] h-3 w-3 shrink-0`}),(0,G.jsxs)(`span`,{children:[h(`perm.cel.type`),` `,(0,G.jsx)(`span`,{className:x(`font-medium`,T!==`unknown`&&`text-foreground`),children:h(`perm.cel.type.${T}`)}),T===`unknown`&&(0,G.jsxs)(G.Fragment,{children:[` — `,h(`perm.cel.type.unknownHint`)]})]})]})]})}var $t=[{value:`==`,labelKey:`engine.inspector.condition.op.equals`},{value:`!=`,labelKey:`engine.inspector.condition.op.notEquals`},{value:`>`,labelKey:`engine.inspector.condition.op.greaterThan`},{value:`<`,labelKey:`engine.inspector.condition.op.lessThan`},{value:`>=`,symbol:`≥`},{value:`<=`,symbol:`≤`},{value:`truthy`,labelKey:`engine.inspector.condition.op.truthy`},{value:`falsy`,labelKey:`engine.inspector.condition.op.falsy`}],en=[{value:`record.id`,label:`record.id`},{value:`user.id`,label:`user.id`},{value:`user.email`,label:`user.email`},{value:`user.role`,label:`user.role`},{value:`user.isAdmin`,label:`user.isAdmin`}],tn=e=>e.replace(/\s+/g,` `).trim(),nn=RegExp(`^(?:${[`record`,`previous`,`parent`,`user`,`current_user`,`org`].join(`|`)})(?:\\.[A-Za-z_][A-Za-z0-9_]*)+$`),rn=[`record`,`previous`],an=[`record`,`current_user`,`user`,`ctx`,`os`,`features`],on=new Set([`true`,`false`,`null`,`in`]),sn=/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g,cn=/[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*/g;function ln(e){let t=e.replace(sn,` `),n=new Set;for(let e of t.match(cn)??[]){let t=e.split(`.`)[0];on.has(t)||n.add(t)}return[...n]}var un=[`record.status != 'done'`,`user.isAdmin`];function dn(e){return(e?un.filter(t=>ln(t).every(t=>e.includes(t))):[...un]).join(` && `)}var fn=[{value:`record.id`,label:`record.id`}];function pn(e,t=`'`){let n=e.trim();return n===`true`||n===`false`||n===`null`||n!==``&&!Number.isNaN(Number(n))||nn.test(n)?n:`${t}${t===`'`?n.replace(/'/g,`\\'`):n.replace(/"/g,`\\"`)}${t}`}function mn(e){let t=e.trim(),n=/^'(.*)'$/.exec(t);if(n)return{value:n[1].replace(/\\'/g,`'`),quote:`'`};let r=/^"(.*)"$/.exec(t);return r?{value:r[1].replace(/\\"/g,`"`),quote:`"`}:{value:t}}function hn(e,t){return e.filter(e=>e.subject).map(e=>e.op===`truthy`?e.subject:e.op===`falsy`?`!${e.subject}`:`${e.subject} ${e.op} ${pn(e.value,e.quote)}`).join(` ${t} `)}function gn(e){let t=tn(e);if(!t)return{rows:[],join:`&&`};let n=t.includes(`&&`),r=t.includes(`||`);if(n&&r)return null;let i=r?`||`:`&&`,a=t.split(r?`||`:`&&`).map(e=>e.trim()),o=[];for(let e of a){let t=/^([a-zA-Z_][\w.]*)\s*(==|!=|>=|<=|>|<)\s*(.+)$/.exec(e);if(t){let e=mn(t[3]);o.push({subject:t[1],op:t[2],value:e.value,quote:e.quote});continue}let n=/^!\s*([a-zA-Z_][\w.]*)$/.exec(e);if(n){o.push({subject:n[1],op:`falsy`,value:``});continue}let r=/^([a-zA-Z_][\w.]*)$/.exec(e);if(r){o.push({subject:r[1],op:`truthy`,value:``});continue}return null}return{rows:o,join:i}}function _n(e){let t=gn(e||``);return t&&tn(hn(t.rows,t.join))===tn(e||``)?{rows:t.rows,join:t.join,raw:!1}:{rows:[],join:`&&`,raw:!!e}}function vn({label:e,value:t,onCommit:n,objectName:r,fields:i,disabled:o,onBlockingIssuesChange:c,subjects:l,scope:u,roots:d}){let{fields:f}=Tt(r),m=i??f,h=l?.fieldPrefix??`record.`,g=l?.includePrevious??!1,_=l?.context??en,v=d??(u===`record`?rn:void 0),b=W.useMemo(()=>{let e=m.filter(e=>!e.hidden),t=e.map(e=>({value:`${h}${e.name}`,label:`${h}${e.name}`})),n=g?[{value:`previous`,label:`previous`},...e.map(e=>({value:`previous.${e.name}`,label:`previous.${e.name}`}))]:[],r=_.map(e=>({value:e.value,label:e.label??e.value}));return[...t,...n,...r]},[m,h,g,_]),x=V(),C=W.useCallback(e=>U(e,x),[x]),w=W.useMemo(()=>m.filter(e=>!e.hidden).map(e=>e.name),[m]),E=W.useMemo(()=>_n(t),[]),[O,k]=W.useState(E.rows),[A,j]=W.useState(E.join),[M,ee]=W.useState(E.raw),P=W.useRef(t||``);W.useEffect(()=>{let e=t||``;if(e===P.current)return;P.current=e;let n=_n(e);k(n.rows),j(n.join),ee(n.raw)},[t]);let F=(e,t)=>{let r=hn(e,t);P.current=r,n(r)},I=(e,t=A)=>{k(e),j(t),F(e,t)},[te,ne]=W.useState(0),L=W.useCallback(e=>{let t=e.filter(e=>e.severity===`error`).length;ne(e=>e===t?e:t)},[]),re=M?te:0,ie=W.useRef(c);W.useEffect(()=>{ie.current=c}),W.useEffect(()=>{ie.current?.(re)},[re]);let ae=hn(O,A);return M?(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e?(0,G.jsx)(a,{className:`text-xs text-muted-foreground`,children:e}):(0,G.jsx)(`span`,{}),(0,G.jsxs)(`button`,{type:`button`,disabled:o,onClick:()=>{let e=_n(t);(!t||!e.raw)&&(k(e.rows),j(e.join),ee(!1))},className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-50`,children:[(0,G.jsx)(de,{className:`h-3 w-3`}),` `,C(`engine.inspector.condition.builder`)]})]}),(0,G.jsx)(Qt,{label:C(`engine.condition.celLabel`),value:t,onChange:e=>{P.current=e,n(e)},onLintChange:L,disabled:o,placeholder:dn(v),objectName:r,fieldNames:w,scope:u,roots:v,t:C}),t&&!gn(t)&&(0,G.jsx)(`div`,{className:`text-[10px] text-muted-foreground/70`,children:C(`engine.condition.advancedHint`)})]}):(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e?(0,G.jsx)(a,{className:`text-xs text-muted-foreground`,children:e}):(0,G.jsx)(`span`,{}),(0,G.jsxs)(`button`,{type:`button`,disabled:o,onClick:()=>ee(!0),className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-50`,children:[(0,G.jsx)(R,{className:`h-3 w-3`}),` `,C(`engine.inspector.condition.expression`)]})]}),O.length===0?(0,G.jsx)(`p`,{className:`rounded-md border border-dashed bg-muted/30 px-3 py-2 text-center text-[11px] text-muted-foreground`,children:C(`engine.inspector.condition.always`)}):(0,G.jsx)(`div`,{className:`space-y-1.5`,children:O.map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1 rounded-md border border-border p-1.5`,children:[t>0&&(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsxs)(p,{value:A,onValueChange:e=>I(O,e),disabled:o,children:[(0,G.jsx)(s,{className:`h-6 w-16 text-[10px]`,children:(0,G.jsx)(S,{})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(N,{value:`&&`,children:C(`engine.inspector.condition.and`)}),(0,G.jsx)(N,{value:`||`,children:C(`engine.inspector.condition.or`)})]})]})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsxs)(p,{value:e.subject,onValueChange:e=>I(O.map((n,r)=>r===t?{...n,subject:e}:n)),disabled:o,children:[(0,G.jsx)(s,{className:`h-7 text-xs`,children:(0,G.jsx)(S,{placeholder:C(`engine.inspector.condition.subjectPlaceholder`)})}),(0,G.jsxs)(y,{children:[b.map(e=>(0,G.jsx)(N,{value:e.value,children:e.label},e.value)),e.subject&&!b.some(t=>t.value===e.subject)&&(0,G.jsx)(N,{value:e.subject,children:e.subject})]})]})}),(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,disabled:o,"aria-label":C(`engine.inspector.condition.remove`),onClick:()=>I(O.filter((e,n)=>n!==t)),children:(0,G.jsx)(ge,{className:`h-3.5 w-3.5`})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`div`,{className:`w-28 shrink-0`,children:(0,G.jsxs)(p,{value:e.op,onValueChange:e=>I(O.map((n,r)=>r===t?{...n,op:e}:n)),disabled:o,children:[(0,G.jsx)(s,{className:`h-7 text-xs`,children:(0,G.jsx)(S,{})}),(0,G.jsx)(y,{children:$t.map(e=>(0,G.jsx)(N,{value:e.value,children:`symbol`in e?e.symbol:C(e.labelKey)},e.value))})]})}),e.op!==`truthy`&&e.op!==`falsy`&&(0,G.jsx)(T,{className:`h-7 flex-1 text-xs`,value:e.value,placeholder:C(`engine.inspector.condition.valuePlaceholder`),disabled:o,onChange:e=>I(O.map((n,r)=>r===t?{...n,value:e.target.value}:n))})]})]},t))}),!o&&(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>I([...O,{subject:``,op:`truthy`,value:``}]),children:[(0,G.jsx)(z,{className:`mr-1 h-3.5 w-3.5`}),` `,C(`engine.inspector.condition.add`)]}),ae&&(0,G.jsx)(`div`,{className:`rounded bg-muted/40 px-2 py-1 text-[10px] font-mono text-muted-foreground break-all`,children:ae})]})}function yn(e){return typeof e==`number`&&Number.isFinite(e)}function bn(e){let t=e.position;if(yn(t?.x)&&yn(t?.y))return{x:t.x,y:t.y};let n=e.ui;return yn(n?.x)&&yn(n?.y)?{x:n.x,y:n.y}:null}function xn(e){return bn(e)!==null}function Sn(e){return e.some(e=>e&&`ui`in e)?e.map(e=>{if(!e||!(`ui`in e))return e;let{ui:t,...n}=e,r=bn(e);return r?{...n,position:r}:n}):e}function Cn(e){if(!e||typeof e!=`object`)return null;let t=e;return!Array.isArray(t.nodes)||t.nodes.length===0?null:{nodes:t.nodes,edges:Array.isArray(t.edges)?t.edges:[]}}function wn(e){let t=e.config??{};switch(e.type){case`loop`:{let e=Cn(t.body);return e?[{key:`body`,label:void 0,...e}]:[]}case`parallel`:{let e=[];return(Array.isArray(t.branches)?t.branches:[]).forEach((t,n)=>{let r=Cn(t);if(!r)return;let i=t.name;e.push({key:`branch-${n}`,label:typeof i==`string`&&i?i:`Branch ${n+1}`,...r})}),e}case`try_catch`:{let e=[],n=Cn(t.try);n&&e.push({key:`try`,label:`Try`,...n});let r=Cn(t.catch);return r&&e.push({key:`catch`,label:`Catch`,...r}),e}default:return[]}}function Tn(e,t,n=()=>66){let r=new Map,i=new Map(e.map(e=>[e.id,n(e)]));if(e.length===0)return{positions:r,heights:i,size:{width:28,height:28}};let a=new Map(e.map(e=>[e.id,e])),o=new Map(e.map((e,t)=>[e.id,t])),s=new Map,c=new Map;for(let t of e)c.set(t.id,0);for(let e of t)a.has(e.source)&&a.has(e.target)&&e.source!==e.target&&(Mn(e)||(s.has(e.source)||s.set(e.source,[]),s.get(e.source).push(e.target),c.set(e.target,(c.get(e.target)??0)+1)));let l=[];for(let t of e)t.type===`start`&&l.push(t.id);for(let t of e)(c.get(t.id)??0)===0&&!l.includes(t.id)&&l.push(t.id);l.length===0&&l.push(e[0].id);let u=new Map,d=[];for(let e of l)u.set(e,0),d.push(e);let f=e.length*Math.max(1,t.length)+e.length+1,p=0;for(;d.length&&p<f;){p+=1;let e=d.shift(),t=u.get(e)??0;for(let n of s.get(e)??[]){let e=t+1;(u.get(n)??-1)<e&&(u.set(n,e),d.push(n))}}let m=0;for(let e of u.values())m=Math.max(m,e);for(let t of e)u.has(t.id)||(m+=1,u.set(t.id,m));let h=new Map;for(let t of e){let e=u.get(t.id)??0;h.has(e)||h.set(e,[]),h.get(e).push(t.id)}for(let e of h.values())e.sort((e,t)=>(o.get(e)??0)-(o.get(t)??0));let g=[...h.keys()].sort((e,t)=>e-t),_=0,v;for(let e of g){v!==void 0&&(_+=(e-v-1)*122);let t=h.get(e),n=-(t.length*240+(t.length-1)*44)/2,o=66;t.forEach((e,t)=>{r.set(e,{x:n+t*284,y:_});let s=a.get(e);s&&!xn(s)&&(o=Math.max(o,i.get(e)??66))}),_+=o+56,v=e}let y=1/0,b=1/0;for(let e of r.values())y=Math.min(y,e.x),b=Math.min(b,e.y);if(Number.isFinite(y)&&Number.isFinite(b)){let e=28-y,t=28-b;for(let[n,i]of r)r.set(n,{x:i.x+e,y:i.y+t})}for(let t of e){let e=bn(t);e&&r.set(t.id,{x:Math.max(0,e.x),y:Math.max(0,e.y)})}let x=0,S=0;for(let[e,t]of r)x=Math.max(x,t.x+240),S=Math.max(S,t.y+(i.get(e)??66));return{positions:r,heights:i,size:{width:x+28,height:S+28}}}function En(e,t){return Tn(e,t).positions}function Dn(e){let t=0,n=0;for(let r of e.values())t=Math.max(t,r.x+240),n=Math.max(n,r.y+66);return{width:t+28,height:n+28}}function On(e,t=66){return{x:e.x+120,y:e.y+t}}function kn(e){return{x:e.x+120,y:e.y}}function An(e,t){let n=Math.max(Math.abs(t.y-e.y)*.5,24),r={x:e.x,y:e.y+n},i={x:t.x,y:t.y-n};return`M ${e.x},${e.y} C ${r.x},${r.y} ${i.x},${i.y} ${t.x},${t.y}`}function jn(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Mn(e){return e.type===`back`}function Nn(e){return{x:e.x+240,y:e.y+33}}function Pn(e,t){return Math.max(64,Math.abs(t.y-e.y)*.35)}function Fn(e,t){let n=Pn(e,t),r={x:e.x+n,y:e.y},i={x:t.x+n,y:t.y};return`M ${e.x},${e.y} C ${r.x},${r.y} ${i.x},${i.y} ${t.x},${t.y}`}function In(e,t){let n=Pn(e,t);return{x:Math.max(e.x,t.x)+n*.75,y:(e.y+t.y)/2}}function Ln(e,t){return e.id||`${e.source}->${e.target}#${t}`}function Rn(e){if(e){if(typeof e==`string`)return e;if(typeof e==`object`&&typeof e.source==`string`)return e.source}}function zn(e){return Rn(e)??``}function Bn(e){if(e&&typeof e==`object`&&!Array.isArray(e))return typeof e.dialect==`string`?e:void 0}function Vn(e,t){if(!t)return;let n=Bn(e);if(!n)return t;let r={...n,source:t};return delete r.ast,r}var Hn=new Set([`object`,`object-field`,`flow`,`org-membership-level`,`position`,`node`,`user`,`team`,`queue`,`department`,`manager`,`connector`,`email-template`]);function Un(e){if(!e||typeof e!=`object`)return;let t=e;if(t.source===`data`)return typeof t.object==`string`&&t.object&&typeof t.valueField==`string`&&t.valueField?{source:`data`,object:t.object,valueField:t.valueField}:void 0;if(t.source===`enum`){let e=Array.isArray(t.values)?t.values.filter(e=>typeof e==`string`):[];return e.length?{source:`enum`,values:e}:void 0}if(t.source===`auto`||t.source===`trigger-field`||t.source===`expression`||t.source===`unsupported`)return{source:t.source}}function Wn(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e)){let e=Un(r);e&&(t[n]=e)}return Object.keys(t).length?t:void 0}function Gn(e){let t=e.xRef;if(!t||typeof t!=`object`)return;let n=typeof t.objectSource==`string`&&t.objectSource?{objectSource:t.objectSource}:{};if(typeof t.kindFrom==`string`&&t.kindFrom&&t.map&&typeof t.map==`object`){let e={};for(let[n,r]of Object.entries(t.map))typeof r==`string`&&Hn.has(r)&&(e[n]=r);if(Object.keys(e).length===0)return;let r=Wn(t.sources);return{kindFrom:t.kindFrom,map:e,...n,...r?{sources:r}:{}}}if(typeof t.kind==`string`&&Hn.has(t.kind))return{kind:t.kind,...n}}function Kn(e){let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).trim();return t?t.split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}function q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function qn(e){if(Array.isArray(e.type))return e.type.find(e=>e!==`null`);if(typeof e.type==`string`)return e.type;if(Array.isArray(e.enum))return`string`;if(e.properties)return`object`;if(e.items)return`array`}function Jn(e,t){let n=new Set((t??[]).filter(e=>typeof e==`string`));return e.filter(e=>typeof e==`string`).filter(e=>!n.has(e)).map(e=>({value:e,label:Kn(e)}))}function Yn(e){if(e.default!==void 0&&e.default!==null){if(typeof e.default==`boolean`||typeof e.default==`number`)return String(e.default);if(typeof e.default==`string`)return e.default}}function Xn(e){return e.xExpression===`expression`||e.xExpression===`template`?e.xExpression:void 0}function Zn(e){if(Array.isArray(e.enum))return{kind:`select`};let t=qn(e);if(t===`boolean`)return{kind:`boolean`};if(t===`number`||t===`integer`)return{kind:`number`};if(t===`string`){let t=e.format===`multiline`,n=Xn(e);return n===`expression`?t?{kind:`textarea`,refMode:`expression`}:{kind:`expression`}:n===`template`?t?{kind:`textarea`,refMode:`template`}:{kind:`expression`,refMode:`template`}:{kind:t?`textarea`:`text`}}}var Qn=4;function $n(e,t){let n=q(e.items)?e.items:void 0,r=n?qn(n):void 0;return n&&r===`object`&&q(n.properties)?t>=Qn?null:{kind:`objectList`,columns:er(n,t+1)}:r===`string`?{kind:`stringList`}:r===`number`||r===`integer`?{kind:`numberList`}:null}function er(e,t=0){let n=e.properties??{},r=[];for(let[e,i]of Object.entries(n)){if(!q(i))continue;let n=qn(i);if(n===`array`){let n=$n(i,t);if(n){r.push({key:e,label:i.title||Kn(e),kind:n.kind,...n.columns?{columns:n.columns}:{},...i.description?{placeholder:i.description}:{}});continue}}let a,o,s=Gn(i);s?a=`reference`:Array.isArray(i.enum)?(a=`select`,o=Jn(i.enum,i.xEnumDeprecated)):a=n===`boolean`?`boolean`:Xn(i)===`expression`?`expression`:`text`,r.push({key:e,label:i.title||Kn(e),kind:a,...o?{options:o}:{},...s?{ref:s}:{},...i.description?{placeholder:i.description}:{}})}return r}function tr(e,t){return{label:e.title||Kn(t),...e.description?{help:e.description}:{},...Yn(e)?{defaultValue:Yn(e)}:{}}}function nr(e){if(!q(e)||qn(e)!==`object`||!q(e.properties))return null;let t=[];for(let[n,r]of Object.entries(e.properties)){if(!q(r))continue;let e=qn(r);if(e===`array`){let e=q(r.items)?r.items:void 0,i=e?qn(e):void 0;e&&i===`object`&&q(e.properties)?t.push({id:n,path:[`config`,n],kind:`objectList`,columns:er(e),...tr(r,n)}):i===`string`?t.push({id:n,path:[`config`,n],kind:`stringList`,...tr(r,n)}):(i===`number`||i===`integer`)&&t.push({id:n,path:[`config`,n],kind:`numberList`,...tr(r,n)});continue}if(e===`object`&&q(r.properties)){let e=Object.entries(r.properties).filter(([,e])=>q(e)),i=e.some(([e,t])=>e===`enabled`&&qn(t)===`boolean`);for(let[a,o]of e){let e=o,s=Gn(e),c=s?void 0:Zn(e),l=s?`reference`:c?.kind;if(!l)continue;let u=`${n}.${a}`,d=i&&a===`enabled`,f={id:u,path:[`config`,n,a],kind:l,...d?{label:r.title||Kn(n),...r.description?{help:r.description}:{},...Yn(e)?{defaultValue:Yn(e)}:{}}:tr(e,a),...s?{ref:s}:{},...c?.refMode?{refMode:c.refMode}:{},...l===`select`&&Array.isArray(e.enum)?{options:Jn(e.enum,e.xEnumDeprecated)}:{},...i&&!d?{showWhen:{field:`${n}.enabled`,equals:[`true`]}}:{}};t.push(f)}continue}if(e===`object`&&r.additionalProperties!==void 0&&r.additionalProperties!==!1){t.push({id:n,path:[`config`,n],kind:`keyValue`,...tr(r,n)});continue}let i=Gn(r);if(i){t.push({id:n,path:[`config`,n],kind:`reference`,ref:i,...tr(r,n)});continue}let a=Zn(r);a&&t.push({id:n,path:[`config`,n],kind:a.kind,...tr(r,n),...a.refMode?{refMode:a.refMode}:{},...a.kind===`select`&&Array.isArray(r.enum)?{options:Jn(r.enum,r.xEnumDeprecated)}:{}})}return t}function rr(e,t){return t&&t!==e?`${t} (${e})`:e}function ir(e){return e.map(e=>({value:e.name,label:rr(e.name,e.label),...e.description?{hint:e.description}:{}}))}function ar(e){return ir(e).map(e=>({value:e.value,label:e.hint?`${e.label} — ${e.hint}`:e.label}))}var J={status:`idle`};function Y(e,t){return e.status===`loaded`?e.data:t}function or(e,t){return e.status===`loaded`?{status:`loaded`,data:t(e.data)}:e}function sr(e){return{status:`loaded`,data:e}}function cr(e){return{status:`error`,message:e}}function lr(e){if(e instanceof Error&&e.message)return e.message;let t=e?.message;return typeof t==`string`&&t?t:String(e)}function ur(e,t){return e.status===`loaded`?e.data:t}function dr(e){return e.status===`loading`}function fr(e){return e.status===`error`?e.message:void 0}function pr(e){let[t,n]=W.useState(()=>e?{status:`loading`}:{status:`idle`});return W.useEffect(()=>{if(!e){n({status:`idle`});return}let t=!1;return n({status:`loading`}),(async()=>{try{let r=await e();t||n({status:`loaded`,data:r})}catch(e){t||n({status:`error`,message:lr(e)})}})(),()=>{t=!0}},[e]),t}var mr=[],hr=[],gr=[],_r=[],vr=[];function X({id:e,ariaLabelledBy:t,required:n}){return{id:e,"aria-labelledby":t,"aria-required":n?!0:void 0}}function Z({message:e,testId:t}){let n=V();return(0,G.jsxs)(`div`,{"data-testid":t,role:`status`,className:`rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,G.jsx)(he,{className:`h-3.5 w-3.5 shrink-0`}),U(`engine.form.optionsLoadFailedTitle`,n)]}),(0,G.jsx)(`p`,{className:`mt-1 text-amber-800`,children:U(`engine.form.optionsLoadFailedDesc`,n)}),e?(0,G.jsx)(`p`,{"data-testid":`${t}-cause`,className:`mt-1 max-w-full break-words font-mono text-[10px] text-amber-700`,children:e}):null]})}function yr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o}){let c=V(),l=o?.objectNames??J,u=r==null?``:String(r);if(l.status===`error`)return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(Z,{message:l.message,testId:`ref-object-load-failed`}),(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value||void 0)})]});if(dr(l))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:!0,placeholder:U(`engine.form.loadingObjects`,c)});let d=Y(l,mr);return d.length===0?(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value||void 0),placeholder:U(`engine.form.noObjects`,c)}):(0,G.jsxs)(p,{value:u,onValueChange:e=>i(e||void 0),disabled:a,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectObject`,c)})}),(0,G.jsx)(y,{children:d.map(e=>(0,G.jsx)(N,{value:e,children:e},e))})]})}function br(e){let t=[],n=new Set,r=e=>{if(!e||typeof e!=`object`)return;let r=e,a=r.id;typeof a==`string`&&a&&!n.has(a)&&(n.add(a),t.push({id:a,type:typeof r.type==`string`?r.type:void 0,label:typeof r.label==`string`?r.label:void 0})),i(r.components),i(r.children);let o=r.properties;o&&typeof o==`object`&&(i(o.components),i(o.children))},i=e=>{if(Array.isArray(e))for(let t of e)r(t)};if(e&&typeof e==`object`){let t=e.regions;if(Array.isArray(t))for(let e of t)e&&typeof e==`object`&&i(e.components)}return t}function xr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o}){let c=V(),l=o?.componentIds??[],u=r==null?``:String(r);if(l.length===0)return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value||void 0),placeholder:U(`engine.form.noComponents`,c)});let d=!u||l.some(e=>e.id===u);return(0,G.jsxs)(p,{value:u||Q,onValueChange:e=>i(e===Q?void 0:e),disabled:a,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectComponent`,c)})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(N,{value:Q,children:(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:U(`engine.form.none`,c)})}),!d&&u&&(0,G.jsx)(N,{value:u,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:u}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:U(`engine.form.notInObject`,c)})]})}),l.map(e=>(0,G.jsx)(N,{value:e.id,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:e.id}),(e.label||e.type)&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label||e.type})]})},e.id))]})]})}function Sr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o}){let c=V(),l=o?.datasets??J,u=r==null?``:String(r),d=(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value||void 0)});if(l.status===`error`)return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(Z,{message:l.message,testId:`ref-dataset-load-failed`}),d]});if(dr(l))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:!0,placeholder:U(`engine.form.loadingOptions`,c)});let f=ar(Y(l,vr));if(f.length===0)return d;let m=!u||f.some(e=>e.value===u);return(0,G.jsxs)(p,{value:u,onValueChange:e=>i(e||void 0),disabled:a,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectEllipsis`,c)})}),(0,G.jsxs)(y,{children:[!m&&(0,G.jsx)(N,{value:u,children:H(`engine.form.flaggedValue`,c,{value:u,flag:U(`engine.form.notFound`,c)})}),f.map(e=>(0,G.jsx)(N,{value:e.value,children:e.label},e.value))]})]})}function Cr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o,fieldSpec:c}){let l=V(),u=o?.objectNames??J,d=c?.multiple??!1,f=W.useMemo(()=>r?Array.isArray(r)?r.map(String):String(r).split(`,`).map(e=>e.trim()).filter(Boolean):[],[r]),m=e=>{if(!a){if(!d){i(e);return}i(f.includes(e)?f.filter(t=>t!==e):[...f,e])}},h=e=>{if(a)return;let t=f.filter(t=>t!==e);i(d?t:``)},[g,_]=W.useState(``),v=e=>{let t=e.trim();if(_(``),!a&&t){if(!d){i(t);return}f.includes(t)||i([...f,t])}};if(dr(u))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:U(`engine.form.loadingObjects`,l),readOnly:!0,disabled:!0});let b=f.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:f.map(e=>(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded bg-secondary px-2 py-1 text-sm`,children:[(0,G.jsx)(`span`,{children:e}),!a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`text-muted-foreground hover:text-foreground`,children:`×`})]},e))});if(u.status===`error`)return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[b,(0,G.jsx)(Z,{message:u.message,testId:`object-selector-load-failed`}),(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),"data-testid":`object-selector-freeform`,value:g,disabled:a,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v(g))},onBlur:()=>v(g)})]});let x=Y(u,mr);return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[b,(0,G.jsxs)(p,{value:``,onValueChange:m,disabled:a||x.length===0,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:U(d?`engine.form.addObjects`:`engine.form.selectObject`,l)})}),(0,G.jsx)(y,{children:x.map(e=>(0,G.jsxs)(N,{value:e,disabled:!d&&f.includes(e),children:[e,f.includes(e)&&` ✓`]},e))})]})]})}var wr=[];async function Tr(e){let t=await fetch(`/api/v1/objects/${e}/fields`),n=null;try{n=await t.json()}catch{}if(!t.ok){let e=n?.error?.message??n?.error??n?.message;throw Error(typeof e==`string`&&e?e:`HTTP ${t.status}`)}return Array.isArray(n?.fields)?n.fields:[]}function Er({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,fieldSpec:o,formData:c}){let l=V(),u=o?.dependsOn||o?.reference||`objectName`,d=Array.isArray(u)?u[0]:u,f=c?.[d],m=pr(W.useMemo(()=>f?()=>Tr(f):null,[f])),h=ur(m,wr),g=fr(m),_=o?.multiple??!1,v=W.useMemo(()=>r?Array.isArray(r)?r.map(String):String(r).split(`,`).map(e=>e.trim()).filter(Boolean):[],[r]),b=e=>{if(!a){if(!_){i(e);return}i(v.includes(e)?v.filter(t=>t!==e):[...v,e])}},x=e=>{if(a)return;let t=v.filter(t=>t!==e);i(_?t:``)},[C,w]=W.useState(``),E=e=>{let t=e.trim();if(w(``),!a&&t){if(!_){i(t);return}v.includes(t)||i([...v,t])}};if(!f)return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:U(`engine.form.selectObjectFirst`,l),readOnly:!0,disabled:!0});if(dr(m))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:U(`engine.form.loadingFields`,l),readOnly:!0,disabled:!0});let D=v.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:v.map(e=>{let t=h.find(t=>t.name===e);return(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded bg-secondary px-2 py-1 text-sm`,children:[(0,G.jsx)(`span`,{children:t?.label||e}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:t?.type}),!a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>x(e),className:`text-muted-foreground hover:text-foreground`,children:`×`})]},e)})});return g?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[D,(0,G.jsx)(Z,{message:g,testId:`field-selector-load-failed`}),(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),"data-testid":`field-selector-freeform`,value:C,disabled:a,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),E(C))},onBlur:()=>E(C)})]}):(0,G.jsxs)(`div`,{className:`space-y-2`,children:[D,(0,G.jsxs)(p,{value:``,onValueChange:b,disabled:a||h.length===0,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:U(_?`engine.form.addFields`:`engine.form.selectField`,l)})}),(0,G.jsx)(y,{children:h.map(e=>(0,G.jsx)(N,{value:e.name,disabled:!_&&v.includes(e.name),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:e.label||e.name}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.type}),v.includes(e.name)&&` ✓`]})},e.name))})]})]})}function Dr({schema:e,value:t,onChange:n,readOnly:r,context:i,ariaLabelledBy:a}){let o=V(),s=e;if(s?.anyOf||s?.oneOf){let e=(s.anyOf??s.oneOf).find(e=>e?.type===`array`&&e?.items?.type===`object`);e&&(s={...s,...e})}let c=s?.items??{},l=c.properties??{},u=new Set(Array.isArray(c.required)?c.required:[]),d=Array.isArray(t)?t:[],f=Object.keys(l);if(f.length===0)return(0,G.jsx)(`div`,{role:`group`,"aria-labelledby":a,className:`rounded border border-dashed border-amber-500/40 bg-amber-500/5 p-2 text-xs text-amber-700 dark:text-amber-300`,children:U(`engine.form.masterDetailSchemaError`,o)});function p(e,t){let r=d.slice();r[e]={...r[e]??{},...t},n(r)}function m(){n([...d,{}])}function h(e){let t=d.slice();t.splice(e,1),n(t)}return(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":a,children:[(0,G.jsx)(`div`,{className:`overflow-x-auto rounded border border-border/40`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`bg-muted/40`,children:(0,G.jsxs)(`tr`,{children:[f.map(e=>(0,G.jsxs)(`th`,{className:`px-2 py-1.5 text-left text-xs font-medium text-muted-foreground`,children:[l[e]?.title??Kn(e),u.has(e)&&(0,G.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`})]},e)),(0,G.jsx)(`th`,{className:`w-8`})]})}),(0,G.jsxs)(`tbody`,{children:[d.length===0&&(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:f.length+1,className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:U(`engine.form.noRows`,o)})}),d.map((e,t)=>(0,G.jsxs)(`tr`,{className:`border-t border-border/30`,children:[f.map(n=>(0,G.jsx)(`td`,{className:`p-1`,children:(0,G.jsx)(Or,{schema:l[n],value:(e??{})[n],readOnly:r,context:i,onChange:e=>p(t,{[n]:e})})},n)),(0,G.jsx)(`td`,{className:`p-1 text-right`,children:(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>h(t),disabled:r,className:`h-7 w-7 p-0`,"aria-label":U(`engine.form.removeRow`,o),children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})})]},t))]})]})}),(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:m,disabled:r,children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` `,U(`engine.form.addRow`,o)]})]})}function Or({schema:e,value:t,readOnly:n,context:r,onChange:i}){if(e?.widget===`ref:object`)return(0,G.jsx)(yr,{schema:e,value:t,onChange:i,readOnly:n,context:r});if(e?.widget===`ref:component`)return(0,G.jsx)(xr,{schema:e,value:t,onChange:i,readOnly:n,context:r});let a=e?.enum;if(Array.isArray(a)&&a.length>0)return(0,G.jsxs)(p,{value:t==null?``:String(t),onValueChange:e=>i(e||void 0),disabled:n,children:[(0,G.jsx)(s,{className:`h-8 text-xs`,children:(0,G.jsx)(S,{placeholder:`—`})}),(0,G.jsx)(y,{children:a.map(e=>(0,G.jsx)(N,{value:String(e),children:String(e)},String(e)))})]});if(e?.type===`boolean`)return(0,G.jsx)(`input`,{type:`checkbox`,checked:!!t,disabled:n,onChange:e=>i(e.target.checked),className:`h-4 w-4`});if(e?.type===`number`||e?.type===`integer`){let r=t=>{let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0},a=r(`default`);return(0,G.jsx)(T,{type:`number`,value:t==null?``:String(t),placeholder:a==null?void 0:String(a),min:r(`minimum`),max:r(`maximum`),step:r(`multipleOf`),disabled:n,onChange:e=>{let t=e.target.valueAsNumber;i(Number.isFinite(t)?t:void 0)},className:`h-8 text-xs`})}return(0,G.jsx)(T,{value:t==null?``:String(t),disabled:n,onChange:e=>i(e.target.value||void 0),className:`h-8 text-xs`})}function kr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a}){let o=V(),s=Array.isArray(r)?r:[],[c,l]=W.useState(``);function u(e){let t=e.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(t.length===0)return;let n=[...s];for(let e of t)n.includes(e)||n.push(e);i(n),l(``)}function d(e){let t=s.slice();t.splice(e,1),i(t)}return(0,G.jsx)(`div`,{className:`rounded border border-input bg-background p-1.5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[s.map((e,t)=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:e}),!a&&(0,G.jsx)(`button`,{type:`button`,"aria-label":H(`engine.form.removeNamed`,o,{name:e}),onClick:()=>d(t),className:`text-muted-foreground hover:text-destructive`,children:`×`})]},t)),(0,G.jsx)(`input`,{...X({id:e,ariaLabelledBy:t,required:n}),type:`text`,value:c,disabled:a,placeholder:s.length===0?U(`engine.form.tagsPlaceholder`,o):``,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),u(c)):e.key===`Backspace`&&!c&&s.length>0&&d(s.length-1)},onBlur:()=>c&&u(c),className:`min-w-[8rem] flex-1 bg-transparent text-sm outline-none`})]})})}function Ar(e){return e.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function jr({value:e,onChange:t,readOnly:n,schema:r,fieldSpec:i,formData:a,ariaLabelledBy:o}){let s=F(),c=W.useMemo(()=>{if(Array.isArray(i?.options)&&i.options.length)return i.options.map(e=>({label:e.label,value:e.value,visibleWhen:e.visibleWhen}));let e=r?.items?.enum??r?.enum??[];return(Array.isArray(e)?e:[]).filter(e=>typeof e==`string`).map(e=>({label:Ar(e),value:e}))},[i,r]),l=W.useMemo(()=>tt(c,K(a,s)),[c,a,s]),u=W.useMemo(()=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],[e]);function d(e){if(n)return;let r=new Set(u);r.has(e)?r.delete(e):r.add(e);let i=c.map(e=>e.value).filter(e=>r.has(e));t(i.length?i:void 0)}return c.length===0?(0,G.jsx)(`div`,{role:`group`,"aria-labelledby":o,children:(0,G.jsx)(kr,{value:e,onChange:t,readOnly:n,schema:r,fieldSpec:i})}):(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`group`,"aria-labelledby":o,children:l.map(e=>{let t=u.includes(e.value);return(0,G.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t,disabled:n,onClick:()=>d(e.value),className:`inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium transition-colors `+(t?`border-primary bg-primary/10 text-primary`:`border-input bg-background text-muted-foreground hover:text-foreground hover:bg-muted`)+(n?` opacity-60 cursor-not-allowed`:``),children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`flex h-3.5 w-3.5 items-center justify-center rounded-[3px] border text-[9px] leading-none `+(t?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40`),children:t?`✓`:``}),e.label]},e.value)})})}var Q=`__none__`;function Mr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o}){let c=V(),l=o?.objectFields??J,u=r==null?``:String(r);if(l.status===`error`)return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(Z,{message:l.message,testId:`field-ref-load-failed`}),(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value)})]});if(dr(l))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:U(`engine.form.loadingOptions`,c),readOnly:!0,disabled:!0});let d=Y(l,hr),f=!u||d.some(e=>e.name===u);return(0,G.jsxs)(p,{value:u||Q,onValueChange:e=>i(e===Q?``:e),disabled:a,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:d.length?U(`engine.form.selectField`,c):U(`engine.form.noObjectBound`,c)})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(N,{value:Q,children:(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:U(`engine.form.none`,c)})}),!f&&u&&(0,G.jsxs)(N,{value:u,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:u}),(0,G.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:U(`engine.form.notInObject`,c)})]}),d.map(e=>(0,G.jsx)(N,{value:e.name,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:e.label||e.name}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})},e.name))]})]})}function Nr(e,t){let n=t?e.find(e=>e.name===t):void 0,r=t&&!n?e.find(e=>e.name.endsWith(`.${t}`)):void 0,i=t==="default"||t===`list`;return{exact:n,suffixMatch:r,isSpecial:i,resolves:!!n||!!r||i,showStored:!!t&&!n}}function Pr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,context:o}){let c=V(),l=o?.objectViews??J,u=r==null?``:String(r);if(l.status===`error`)return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(Z,{message:l.message,testId:`view-ref-load-failed`}),(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:u,disabled:a,onChange:e=>i(e.target.value||void 0)})]});if(dr(l))return(0,G.jsx)(T,{...X({id:e,ariaLabelledBy:t,required:n}),value:U(`engine.form.loadingOptions`,c),readOnly:!0,disabled:!0});let d=Y(l,gr),{suffixMatch:f,resolves:m,showStored:h}=Nr(d,u);return(0,G.jsxs)(p,{value:u||Q,onValueChange:e=>i(e===Q?void 0:e),disabled:a,children:[(0,G.jsx)(s,{...X({id:e,ariaLabelledBy:t,required:n}),children:(0,G.jsx)(S,{placeholder:d.length?U(`engine.form.selectEllipsis`,c):U(`engine.form.noObjectBound`,c)})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(N,{value:Q,children:(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:U(`engine.form.none`,c)})}),h&&(0,G.jsx)(N,{value:u,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:f?.label||u}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:f?`\u2192 ${f.name}`:u}),!m&&(0,G.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:U(`engine.form.notInObject`,c)})]})}),d.map(e=>(0,G.jsx)(N,{value:e.name,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:e.label||e.name}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})},e.name))]})]})}function Fr({value:e,onChange:t,readOnly:n,context:r,ariaLabelledBy:i}){let a=V(),o=r?.objectFields??J,c=fr(o),l=o.status===`error`?hr:Y(o,hr),u=Array.isArray(e)?e.map(String):typeof e==`string`&&e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[],d=e=>l.find(t=>t.name===e)?.label||e,f=l.filter(e=>!u.includes(e.name)),m=e=>{u.includes(e)||t([...u,e])},h=e=>{let n=u.slice();n.splice(e,1),t(n)},g=(e,n)=>{let r=e+n;if(r<0||r>=u.length)return;let i=u.slice();[i[e],i[r]]=[i[r],i[e]],t(i)};return(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":i,children:[u.length>0&&(0,G.jsx)(`div`,{className:`space-y-1`,children:u.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-1 rounded border border-input bg-background px-2 py-1 text-sm`,children:[(0,G.jsxs)(`span`,{className:`flex-1 truncate`,children:[d(e),(0,G.jsx)(`code`,{className:`ml-2 text-xs text-muted-foreground`,children:e})]}),!n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveUp`,a),disabled:t===0,onClick:()=>g(t,-1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:`↑`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveDown`,a),disabled:t===u.length-1,onClick:()=>g(t,1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:`↓`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":H(`engine.form.removeNamed`,a,{name:e}),onClick:()=>h(t),className:`px-1 text-muted-foreground hover:text-destructive`,children:`×`})]})]},e))}),c&&(0,G.jsx)(Z,{message:c,testId:`field-multi-load-failed`}),!n&&(0,G.jsxs)(p,{value:``,onValueChange:m,disabled:f.length===0,children:[(0,G.jsx)(s,{"aria-label":U(`engine.form.addField`,a),children:(0,G.jsx)(S,{placeholder:c?U(`engine.form.optionsLoadFailedTitle`,a):l.length?f.length?U(`engine.form.addField`,a):U(`engine.form.allFieldsAdded`,a):U(`engine.form.noObjectBound`,a)})}),(0,G.jsx)(y,{children:f.map(e=>(0,G.jsx)(N,{value:e.name,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:e.label||e.name}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})},e.name))})]})]})}var Ir=w,Lr=new Set(Ir),Rr=120;function zr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a}){let o=V(),s=r==null?``:String(r),[u,d]=W.useState(!1),[f,p]=W.useState(``),m=s?M(s):``,h=!s||Lr.has(m),_=M(f.trim()),v=W.useMemo(()=>_?Ir.filter(e=>e.includes(_)):Ir,[_]),y=v.slice(0,Rr),b=v.length>y.length,x=e=>{i(e||void 0),d(!1),p(``)};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{...X({id:e,ariaLabelledBy:t,required:n}),type:`button`,role:`combobox`,"aria-haspopup":`dialog`,"aria-expanded":u,disabled:a,onClick:()=>!a&&d(!0),className:`flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm text-left disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,G.jsx)(C,{name:h?s:void 0,className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`flex-1 truncate `+(s?`font-mono`:`text-muted-foreground`),children:s||U(`engine.form.selectEllipsis`,o)}),!h&&s&&(0,G.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:U(`engine.form.notInObject`,o)}),(0,G.jsx)(ae,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 opacity-50`})]}),(0,G.jsx)(A,{open:u,onOpenChange:e=>{d(e),e||p(``)},children:(0,G.jsxs)(g,{className:`max-w-2xl`,children:[(0,G.jsx)(c,{children:(0,G.jsx)(l,{children:U(`engine.form.chooseIcon`,o)})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2`,children:[(0,G.jsx)(fe,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`input`,{type:`text`,autoFocus:!0,value:f,"aria-label":U(`engine.form.searchIcons`,o),placeholder:U(`engine.form.searchIcons`,o),onChange:e=>p(e.target.value),className:`w-full bg-transparent text-sm outline-none`})]}),(0,G.jsxs)(`div`,{id:e?`${e}-listbox`:void 0,role:`listbox`,className:`grid max-h-[52vh] grid-cols-6 gap-1.5 overflow-y-auto pr-1 sm:grid-cols-8`,children:[s&&(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!1,title:U(`engine.form.none`,o),onClick:()=>x(void 0),className:`flex aspect-square flex-col items-center justify-center gap-1 rounded border border-dashed border-border p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:[(0,G.jsx)(B,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`w-full truncate text-center text-[9px] leading-tight`,children:U(`engine.form.noneShort`,o)})]}),!h&&s&&(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!0,title:s,onClick:()=>x(s),className:`flex aspect-square flex-col items-center justify-center gap-1 rounded bg-accent p-1 text-accent-foreground ring-1 ring-primary`,children:[(0,G.jsx)(C,{name:void 0,className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`w-full truncate text-center text-[9px] leading-tight`,children:s})]}),y.map(e=>{let t=e===m;return(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,title:e,onClick:()=>x(e),className:`flex aspect-square flex-col items-center justify-center gap-1 rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground `+(t?`bg-accent text-accent-foreground ring-1 ring-primary`:``),children:[(0,G.jsx)(C,{name:e,className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`w-full truncate text-center text-[9px] leading-tight`,children:e})]},e)}),y.length===0&&(0,G.jsx)(`p`,{className:`col-span-full px-2 py-6 text-center text-sm text-muted-foreground`,children:U(`engine.form.noMatchingIcons`,o)})]}),b&&(0,G.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:H(`engine.form.iconsTruncated`,o,{shown:y.length,total:v.length})})]})})]})}var Br=[{key:`none`,labelKey:`engine.form.filterModeNone`},{key:`tabs`,labelKey:`engine.form.filterModeTabs`},{key:`dropdown`,labelKey:`engine.form.filterModeDropdown`}],Vr=e=>(e||``).trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`tab`;function Hr({value:e,onChange:t,readOnly:n,context:r,ariaLabelledBy:i}){let a=V(),o=e&&typeof e==`object`?e:void 0,c=o?.element??(o?`dropdown`:`none`),l=r?.objectFields??J,u=fr(l),d=l.status===`error`?hr:Y(l,hr),f=e=>{if(!n){if(e===`none`){t(void 0);return}t({...o??{},element:e})}},m=Array.isArray(o?.fields)?o.fields:[],h=e=>t({...o??{},element:c===`none`?`dropdown`:c,fields:e}),g=new Set(m.map(e=>e.field)),_=d.filter(e=>!g.has(e.name)),v=e=>d.find(t=>t.name===e)?.label||e,b=c===`dropdown`||c===`toggle`,x=(Array.isArray(o?.tabs)?o.tabs:[]).map(e=>({...e,name:e?.name??e?.id??``,label:typeof e?.label==`string`?e.label:e?.name??e?.id??``,filter:Array.isArray(e?.filter)?e.filter:Array.isArray(e?.filters)?e.filters.filter(e=>Array.isArray(e)&&e.length>=2).map(e=>({field:String(e[0]),operator:String(e[1]),value:e[2]})):[],isDefault:e?.isDefault??e?.default})),C=e=>{let t={name:Vr(e.label||e.name),label:e.label||e.name||`Tab`};return e.icon&&(t.icon=e.icon),t.filter=Array.isArray(e.filter)?e.filter:[],e.isDefault&&(t.isDefault=!0),t},w=e=>{let n={},r=e.map(C).map(e=>{let t=e.name;if(n[t]){let r=2;for(;n[`${e.name}_${r}`];)r++;t=`${e.name}_${r}`}return n[t]=!0,{...e,name:t}});t({...o??{},element:`tabs`,tabs:r})},E=()=>w([...x,{name:``,label:`Tab ${x.length+1}`,filter:[]}]),D=e=>w(x.filter((t,n)=>n!==e)),k=(e,t)=>{let n=[...x],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],w(n))},A=(e,t)=>w(x.map((n,r)=>r===e?{...n,...t}:n));return(0,G.jsxs)(`div`,{className:`space-y-3`,role:`group`,"aria-labelledby":i,children:[(0,G.jsx)(`div`,{className:`inline-flex rounded-md border border-input bg-background p-0.5`,role:`radiogroup`,"aria-label":U(`engine.form.filterElement`,a),children:Br.map(e=>{let t=c===e.key;return(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t,"data-testid":`filter-mode-${e.key}`,disabled:n,onClick:()=>f(e.key),className:`px-3 py-1 text-xs font-medium rounded transition-colors `+(t?`bg-primary text-primary-foreground shadow-sm`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:U(e.labelKey,a)},e.key)})}),b&&(0,G.jsxs)(`div`,{className:`space-y-2`,"data-testid":`filter-mode-fields`,children:[m.length>0&&(0,G.jsx)(`div`,{className:`space-y-1`,children:m.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded border border-input bg-background px-2 py-1 text-sm`,children:[(0,G.jsxs)(`span`,{className:`flex-1 truncate`,children:[v(e.field),(0,G.jsx)(`code`,{className:`ml-2 text-xs text-muted-foreground`,children:e.field})]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,G.jsx)(O,{checked:!!e.showCount,disabled:n,onCheckedChange:e=>h(m.map((n,r)=>r===t?{...n,showCount:e}:n))}),`count`]}),!n&&(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.removeField`,a),onClick:()=>h(m.filter((e,n)=>n!==t)),className:`px-1 text-muted-foreground hover:text-destructive`,children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})]},e.field))}),!n&&_.length>0&&(0,G.jsxs)(p,{onValueChange:e=>h([...m,{field:e}]),children:[(0,G.jsx)(s,{className:`h-8 text-xs`,"data-testid":`filter-mode-add-field`,children:(0,G.jsx)(S,{placeholder:U(`engine.form.addFilterField`,a)})}),(0,G.jsx)(y,{children:_.map(e=>(0,G.jsx)(N,{value:e.name,children:e.label||e.name},e.name))})]}),u?(0,G.jsx)(Z,{message:u,testId:`filter-mode-fields-load-failed`}):d.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`engine.form.bindObjectForFilterFields`,a)}):null]}),c===`tabs`&&(0,G.jsxs)(`div`,{className:`space-y-2`,"data-testid":`filter-mode-tabs-editor`,children:[x.map((e,t)=>(0,G.jsxs)(`div`,{className:`rounded-md border border-input bg-background p-2 space-y-2`,"data-testid":`tab-preset-${t}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(T,{value:e.label,placeholder:U(`engine.form.tabLabel`,a),disabled:n,className:`h-8 text-sm flex-1`,"data-testid":`tab-label-${t}`,onChange:e=>A(t,{label:e.target.value})}),(0,G.jsx)(`code`,{className:`text-[10px] text-muted-foreground shrink-0 max-w-[6rem] truncate`,title:e.name,children:e.name}),!n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveTabUp`,a),disabled:t===0,onClick:()=>k(t,-1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:(0,G.jsx)(ie,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveTabDown`,a),disabled:t===x.length-1,onClick:()=>k(t,1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:(0,G.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.removeTab`,a),onClick:()=>D(t),className:`px-1 text-muted-foreground hover:text-destructive`,children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})]})]}),(0,G.jsx)(`div`,{className:`pl-1`,"data-testid":`tab-${t}-filter`,children:(0,G.jsx)(Wr,{value:e.filter,onChange:e=>A(t,{filter:e}),fields:d,loadError:u,readOnly:n})})]},t)),!n&&(0,G.jsxs)(`button`,{type:`button`,"data-testid":`filter-mode-add-tab`,onClick:E,className:`inline-flex items-center text-xs font-medium text-primary hover:underline`,children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` Add tab`]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground pt-1`,children:[(0,G.jsx)(O,{checked:o?.showAllRecords!==!1,disabled:n,"data-testid":`filter-mode-show-all`,onCheckedChange:e=>t({...o??{},element:`tabs`,showAllRecords:e})}),`Show “All records” tab`]}),u?(0,G.jsx)(Z,{message:u,testId:`filter-mode-tabs-load-failed`}):d.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`engine.form.bindObjectForTabRules`,a)}):null]})]})}function Ur({value:e,onChange:t,readOnly:n,context:r,ariaLabelledBy:i}){let a=V(),o=r?.objectActions??J,c=fr(o),l=o.status===`error`?_r:Y(o,_r),u=Array.isArray(e)?e.map(String):typeof e==`string`&&e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[],d=e=>l.find(t=>t.name===e)?.label||e,f=l.filter(e=>!u.includes(e.name)),m=e=>{u.includes(e)||t([...u,e])},h=e=>{let n=u.slice();n.splice(e,1),t(n)},g=(e,n)=>{let r=e+n;if(r<0||r>=u.length)return;let i=u.slice();[i[e],i[r]]=[i[r],i[e]],t(i)};return(0,G.jsxs)(`div`,{className:`space-y-2`,"data-testid":`action-multi`,role:`group`,"aria-labelledby":i,children:[c&&(0,G.jsx)(Z,{message:c,testId:`action-multi-load-failed`}),u.length>0&&(0,G.jsx)(`div`,{className:`space-y-1`,children:u.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-1 rounded border border-input bg-background px-2 py-1 text-sm`,children:[(0,G.jsxs)(`span`,{className:`flex-1 truncate`,children:[d(e),(0,G.jsx)(`code`,{className:`ml-2 text-xs text-muted-foreground`,children:e})]}),!n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveUp`,a),disabled:t===0,onClick:()=>g(t,-1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:`↑`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":U(`engine.form.moveDown`,a),disabled:t===u.length-1,onClick:()=>g(t,1),className:`px-1 text-muted-foreground hover:text-foreground disabled:opacity-30`,children:`↓`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":H(`engine.form.removeNamed`,a,{name:e}),onClick:()=>h(t),className:`px-1 text-muted-foreground hover:text-destructive`,children:`×`})]})]},e))}),!n&&(0,G.jsxs)(p,{value:``,onValueChange:m,disabled:f.length===0,children:[(0,G.jsx)(s,{"data-testid":`action-multi-add`,"aria-label":U(`engine.form.addActionButtonPlain`,a),children:(0,G.jsx)(S,{placeholder:c?U(`engine.form.optionsLoadFailedTitle`,a):l.length?f.length?U(`engine.form.addActionButton`,a):U(`engine.form.allActionsAdded`,a):U(`engine.form.bindObjectForActions`,a)})}),(0,G.jsx)(y,{children:f.map(e=>(0,G.jsx)(N,{value:e.name,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:e.label||e.name}),(0,G.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})},e.name))})]})]})}function Wr({value:e,onChange:t,fields:n,readOnly:r,id:i,ariaLabelledBy:a,loadError:o}){let s=V(),{t:c}=te(),l=Array.isArray(e)?e:[],u={id:`g`,logic:`and`,conditions:l.map((e,t)=>({id:`c${t}`,operator:e.operator??`equals`,field:e.field,value:e.value??``}))},p=n.map(e=>({value:e.name,label:e.label||e.name,type:e.type})),m=l.length?l.map(e=>`${n.find(t=>t.name===e.field)?.label||e.field}`).filter(Boolean).join(`, `):``,h=e=>{let n=Ze(e);if(!n.ok){ne.error(c(Qe[n.reason]));return}t(n.rules)};return(0,G.jsxs)(f,{children:[(0,G.jsx)(d,{asChild:!0,children:(0,G.jsxs)(D,{...X({id:i,ariaLabelledBy:a}),variant:`outline`,size:`sm`,disabled:r,className:`h-8 w-full justify-between text-xs font-normal`,"data-testid":`filter-builder-trigger`,children:[(0,G.jsx)(`span`,{className:`truncate text-left`,children:m||(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:`+ Add filter…`})}),(0,G.jsx)(L,{className:`h-3.5 w-3.5 opacity-60 shrink-0`})]})}),(0,G.jsx)(j,{align:`start`,className:`w-[440px] max-w-[90vw] p-3`,children:o?(0,G.jsx)(Z,{message:o,testId:`filter-builder-load-failed`}):n.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`engine.form.bindObjectForConditions`,s)}):(0,G.jsx)(_,{fields:p,value:u,onChange:h})})]})}function Gr({id:e,ariaLabelledBy:t,value:n,onChange:r,readOnly:i,context:a}){let o=a?.objectFields??J,s=fr(o),c=o.status===`error`?hr:Y(o,hr);return(0,G.jsx)(Wr,{id:e,ariaLabelledBy:t,value:n,onChange:e=>r(e.length?e:void 0),fields:c,loadError:s,readOnly:i})}function Kr(e,t){return Array.isArray(t?.options)&&t.options.length?t.options.map(e=>({value:e.value,label:e.label})):Array.isArray(e?.enum)?e.enum.filter(e=>typeof e==`string`).map(e=>({value:e})):[]}function qr(e,t){return Kr(e,t).length>0?`color-picker`:`color-input`}function Jr(e,t,n){return Array.isArray(t?.options)&&t.options.length?tt(t.options,n).map(e=>({value:e.value,label:e.label})):Kr(e,t)}function Yr({value:e,onChange:t,readOnly:n,schema:r,fieldSpec:i,formData:a,ariaLabelledBy:o,required:s}){let c=V(),l=F(),u=o?{ariaLabelledBy:o}:{ariaLabel:i?.label??(typeof r?.title==`string`?r.title:void 0)??U(`engine.form.color`,c)};return(0,G.jsx)(wt,{...u,required:s,value:e==null?void 0:String(e),onChange:e=>t(e),disabled:n,options:Jr(r,i,K(a,l))})}function Xr({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a}){let o=V(),s=r==null?``:String(r);return(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{...X({id:e,ariaLabelledBy:t,required:n}),type:`color`,value:/^#([0-9a-f]{6})$/i.test(s)?s:`#000000`,disabled:a,onChange:e=>i(e.target.value),className:`h-8 w-10 shrink-0 rounded border border-input bg-background p-0.5 disabled:opacity-60`,"aria-label":e||t?void 0:U(`engine.form.color`,o)}),(0,G.jsx)(T,{value:s,placeholder:U(`engine.form.colorHexPlaceholder`,o),disabled:a,"aria-label":U(`engine.form.colorHex`,o),onChange:e=>i(e.target.value||void 0),className:`h-8 text-sm font-mono`})]})}function Zr({value:e,onChange:t,readOnly:n,context:r,ariaLabelledBy:i}){let a=r?.objectFields??J,o=a.status===`loaded`?a.data:void 0,s=r?.conditionScope,c=r?.conditionSubjects,l=r?.conditionRoots;return(0,G.jsx)(`div`,{role:`group`,"aria-labelledby":i,children:s===`none`?(0,G.jsx)(T,{"aria-labelledby":i,value:zn(e),onChange:n=>t(Vn(e,n.target.value)),disabled:n}):(0,G.jsx)(vn,{value:zn(e),onCommit:n=>t(Vn(e,n)),fields:o,disabled:n,scope:s,subjects:c?{context:c}:void 0,roots:l})})}var Qr=`••••••••`;function $r({value:e,onChange:t,readOnly:n,schema:r,id:i,ariaLabelledBy:a,required:o}){let s=V(),c=e===Qr,[l,u]=W.useState(!1),[d,f]=W.useState(c||e==null?``:String(e)),p=e=>{f(e),t(e===``?c?Qr:void 0:e)};return(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(T,{...X({id:i,ariaLabelledBy:a,required:o}),type:l?`text`:`password`,value:d,disabled:n,autoComplete:`off`,placeholder:c?r?.description?U(`engine.form.secretSetTypeToReplace`,s):U(`engine.form.secretSetLeaveBlank`,s):typeof r?.description==`string`?``:U(`engine.form.enterAValue`,s),onChange:e=>p(e.target.value),className:`h-8 text-sm font-mono`,"aria-label":i||a?void 0:U(`engine.form.secretValue`,s)}),(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0`,disabled:n,"aria-label":U(l?`engine.form.hideValue`:`engine.form.revealValue`,s),onClick:()=>u(e=>!e),children:l?(0,G.jsx)(ce,{className:`h-4 w-4`}):(0,G.jsx)(le,{className:`h-4 w-4`})}),c&&(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 text-destructive hover:text-destructive`,disabled:n,onClick:()=>{f(``),t(null)},children:U(`engine.form.clear`,s)})]})}function ei({value:e,onChange:t,readOnly:n,fieldSpec:r,formData:i,context:o,ariaLabelledBy:c}){let l=V(),u=Array.isArray(r?.dependsOn)?r.dependsOn[0]:r?.dependsOn,d=u?i?.[u]:void 0,f=d==null?void 0:o?.dynamicSchemas?.[String(d)],m=f?.properties??{},h=new Set(f?.required??[]),g=e&&typeof e==`object`?e:{},_=(e,n)=>{let r={...g};n===void 0||n===``?delete r[e]:r[e]=n,t(r)};return d?!f||Object.keys(m).length===0?(0,G.jsx)(`div`,{role:`group`,"aria-labelledby":c,className:`text-xs text-muted-foreground`,children:H(`engine.form.noConfigNeeded`,l,{value:String(d)})}):(0,G.jsx)(`div`,{className:`space-y-2 rounded-md border border-border/60 p-3`,role:`group`,"aria-labelledby":c,children:Object.entries(m).map(([e,t])=>{let r=t?.title||e,i=g[e],o=h.has(e);if(t?.type===`boolean`)return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(a,{className:`text-xs`,children:r}),(0,G.jsx)(O,{"aria-label":r,checked:!!i,disabled:n,onCheckedChange:t=>_(e,t)})]},e);if(Array.isArray(t?.enum))return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsxs)(a,{className:`text-xs`,children:[r,o?` *`:``]}),(0,G.jsxs)(p,{value:i==null?``:String(i),onValueChange:t=>_(e,t),disabled:n,children:[(0,G.jsx)(s,{className:`h-8`,"aria-label":r,children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectEllipsis`,l)})}),(0,G.jsx)(y,{children:t.enum.map(e=>(0,G.jsx)(N,{value:String(e),children:String(e)},String(e)))})]})]},e);let c=t?.format===`password`||t?.writeOnly===!0,u=t?.type===`number`||t?.type===`integer`;return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsxs)(a,{className:`text-xs`,children:[r,o?` *`:``]}),c?(0,G.jsx)($r,{value:i,onChange:t=>_(e,t),readOnly:n,schema:t}):(0,G.jsx)(T,{type:u?`number`:`text`,value:i==null?``:String(i),disabled:n,"aria-label":r,onChange:t=>_(e,u?t.target.value===``?void 0:Number(t.target.value):t.target.value),className:`h-8 text-sm`}),t?.description&&(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:t.description})]},e)})}):(0,G.jsx)(`div`,{role:`group`,"aria-labelledby":c,className:`text-xs text-muted-foreground`,children:H(`engine.form.selectDepToConfigure`,l,{dep:u??U(`engine.form.anOption`,l)})})}var ti={"ref:object":yr,"ref:component":xr,"ref:dataset":Sr,"filter-mode":Hr,"object-selector":Cr,"field-selector":Er,"field-ref":Mr,"field-multi":Fr,"action-multi":Ur,"filter-builder":Gr,"view-ref":Pr,icon:zr,"color-picker":Yr,"color-input":Xr,condition:Zr,"master-detail":Dr,"string-tags":kr,multiselect:jr,code:si,secret:$r,"dynamic-config":ei},ni={"ref:object":`control`,"ref:component":`control`,"ref:dataset":`control`,"filter-mode":`group`,"object-selector":`control`,"field-selector":`control`,"field-ref":`control`,"field-multi":`group`,"action-multi":`group`,"filter-builder":`control`,"view-ref":`control`,icon:`control`,"color-picker":`group`,"color-input":`control`,condition:`group`,"master-detail":`group`,"string-tags":`control`,multiselect:`group`,code:`group`,secret:`control`,"dynamic-config":`group`};function ri(e){return e?ni[e]??`control`:`control`}function ii(e,t){if(e?.language)return e.language;if(typeof t?.format==`string`){let e=t.format.toLowerCase();if(e===`sql`||e===`javascript`||e===`typescript`||e===`json`||e===`yaml`||e===`html`||e===`css`||e===`python`)return e}let n=e?.field?.toLowerCase()??``;return n.includes(`sql`)||n===`query`?`sql`:`javascript`}var ai=W.lazy(()=>t(()=>import(`./src-DMDT5a27.js`).then(e=>({default:e.CodeEditorRenderer})),__vite__mapDeps([0]),import.meta.url)),oi=`expression`;function si({schema:e,value:t,onChange:n,readOnly:r,fieldSpec:i,ariaLabelledBy:a}){let o=V(),s=ii(i,e),c=s===oi,l=c?zn(t):typeof t==`string`?t:t==null?``:String(t);return(0,G.jsxs)(`div`,{className:`rounded-md border border-border/50 overflow-hidden`,role:`group`,"aria-labelledby":a,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 bg-muted/40 border-b border-border/30 text-[10px] font-mono text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:s}),r&&(0,G.jsx)(`span`,{children:U(`engine.form.readOnly`,o)})]}),(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(`div`,{className:`h-[280px] flex items-center justify-center text-xs text-muted-foreground`,children:U(`engine.form.loadingEditor`,o)}),children:(0,G.jsx)(ai,{schema:{type:`code`,language:s,theme:`vs-dark`,height:`280px`,readOnly:r},value:l,onChange:e=>n(c?Vn(t,e??``):e??``)})})]})}var ci=Symbol(`metadataForm.sourceLabel`);function li(e,t){e[ci]=t}function ui(e){return ci in e}function di(e){if(e){if(ui(e)){let t=e[ci];return typeof t==`string`?t:void 0}return typeof e.label==`string`?e.label:void 0}}var fi=new Set([`default`,`const`,`enum`,`examples`,`title`,`description`,`$schema`,`$id`,`$comment`,`required`]),pi=new Set([`properties`,`patternProperties`,`dependentSchemas`]);function mi(e){if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=t=>{let n=/^#\/(\$defs|definitions)\/(.+)$/.exec(t);if(!n)return;let r=n[2].replace(/~1/g,`/`).replace(/~0/g,`~`),i=e[n[1]];if(!i||typeof i!=`object`)return;let a=i[r];return a&&typeof a==`object`&&!Array.isArray(a)?a:void 0};function n(e,i){if(Array.isArray(e)){let t=!1,r=e.map(e=>{let r=n(e,i);return r!==e&&(t=!0),r});return t?r:e}if(!e||typeof e!=`object`)return e;let a=e,o=typeof a.$ref==`string`?a.$ref:void 0;if(o){if(i.includes(o))return e;let r=t(o);if(!r)return e;let s=n(r,[...i,o]),c={...a};return delete c.$ref,Object.keys(c).length>0?{...s,...c}:s}let s;for(let[e,t]of Object.entries(a)){if(fi.has(e)||e===`$defs`||e===`definitions`)continue;let o=pi.has(e)?r(t,i):n(t,i);o!==t&&(s??={...a},s[e]=o)}return s??e}function r(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return e;let r;for(let[i,a]of Object.entries(e)){let o=n(a,t);o!==a&&(r??={...e},r[i]=o)}return r??e}return n(e,[])}var hi=new Set([`text`,`textarea`,`number`,`switch`,`select`,`json`]);function gi(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.type===void 0&&t.properties===void 0&&Array.isArray(t.oneOf??t.anyOf)}function _i(e){let t=e.oneOf??e.anyOf;if(Array.isArray(t)&&t.length!==0)return t.flatMap(e=>{if(!gi(e))return[e];let{oneOf:t,anyOf:n,...r}=e;return(_i(e)??[e]).map(e=>({...r,...e}))})}function vi(e,t){let n=e.properties;if(!n||typeof n!=`object`)return 0;let r=Object.keys(t).filter(e=>t[e]!==void 0);if(r.length===0)return 0;let i=0;if(Array.isArray(e.required))for(let n of e.required)t[n]===void 0&&(i+=1);for(let a of r){let r=t[a],o=n[a];if(!o||typeof o!=`object`){e.additionalProperties===!1&&(i+=1);continue}r!==null&&typeof r!=`object`&&(`const`in o?o.const!==r&&(i+=1):Array.isArray(o.enum)&&!o.enum.includes(r)&&(i+=1))}return i}function yi(e,t){if(!e)return e;let n=_i(e);if(!n)return e;let r=typeof t==`object`&&!!t&&!Array.isArray(t),i=Array.isArray(t),a=r?new Set(Object.keys(t)):null,o=null,s=i&&t.length?t[0]:void 0,c=typeof s==`object`&&!!s&&!Array.isArray(s);for(let e of n){let n=0,l=0;if(e.type===`array`&&i){n+=5;let t=e.items?.type;(t===`object`&&c||t===`string`&&typeof s==`string`||t===`number`&&typeof s==`number`||t===`integer`&&typeof s==`number`)&&(l+=3)}if(e.type===`object`&&r&&(n+=5),e.type===`string`&&typeof t==`string`&&(n+=5),e.type===`number`&&typeof t==`number`&&(n+=5),e.type===`boolean`&&typeof t==`boolean`&&(n+=5),a&&Array.isArray(e.required))for(let t of e.required)a.has(t)&&(l+=1);let u=r?vi(e,t):0;(!o||n>o.kind||n===o.kind&&(u<o.contradictions||u===o.contradictions&&l>o.rest))&&(o={branch:e,kind:n,contradictions:u,rest:l})}let l=o?.branch??n[0];return{...e,...l,oneOf:void 0,anyOf:void 0}}function bi(e,t){if(!e)return{};let n=yi(e,Array.isArray(t)?t:[])?.items;return!n||typeof n!=`object`?{}:yi(n,Array.isArray(t)&&t.length?t[0]:void 0)??{}}function xi(e,t){if(e?.widget)return e.widget;if(e?.type){let t=e.type;if(t===`text`||t===`email`||t===`url`||t===`phone`||t===`password`)return`text`;if(t===`textarea`||t===`markdown`||t===`html`||t===`richtext`)return`textarea`;if(t===`number`||t===`currency`||t===`percent`)return`number`;if(t===`date`||t===`datetime`||t===`time`)return`date-picker`;if(t===`boolean`||t===`toggle`)return`switch`;if(t===`select`||t===`radio`)return e.multiple?`multiselect`:`select`;if(t===`multiselect`||t===`checkboxes`||t===`tags`)return`string-tags`;if(t===`composite`)return`composite`;if(t===`repeater`)return`repeater`;if(t===`record`)return`record`;if(t===`lookup`||t===`master_detail`||t===`tree`)return`ref-object`;if(t===`image`||t===`file`||t===`avatar`||t===`video`||t===`audio`)return`file-upload`;if(t===`code`)return`code`;if(t===`json`||t===`location`||t===`address`)return`json`;if(t===`color`)return`color-picker`;if(t===`rating`)return`number`;if(t===`slider`)return`slider`;if(t===`signature`)return`signature`;if(t===`qrcode`)return`qrcode`;if(t===`progress`)return`number`;if(t===`formula`||t===`summary`||t===`autonumber`)return`text`;if(t===`vector`)return`json`}if(t){let e=t.type;if(e===`array`&&Array.isArray(t.items?.enum))return`multiselect`;if(e===`array`&&t.items?.type===`string`)return`string-tags`;if(e===`array`&&t.items?.type===`object`)return`master-detail`;if(e===`object`)return`object-fields`;if(e===`boolean`)return`switch`;if(e===`number`||e===`integer`)return`number`;if(Array.isArray(t.enum))return`select`;if(e===`string`){if(t.format===`date`||t.format===`date-time`)return`date-picker`;if(t.format===`email`||t.format===`uri`||t.format===`uri-reference`)return`text`;if(t.format===`multiline`)return`textarea`}}}var Si=`x-objectstack-erased-authoring-input`,Ci=1;function wi(e){let t=e[Si];if(!t||typeof t!=`object`||Array.isArray(t)||t.version!==Ci)return;let n=t.type;if(typeof n==`string`)return[n];if(Array.isArray(n)&&n.every(e=>typeof e==`string`))return n}function Ti(e){let t=new Set,n=[e];for(;n.length>0;){let e=n.pop();if(!e||typeof e!=`object`||t.has(e))continue;t.add(e);let r=e;if(r.type===`string`||wi(r)?.includes(`string`))return!0;for(let e of[`anyOf`,`oneOf`]){let t=r[e];Array.isArray(t)&&n.push(...t)}}return!1}function Ei(e,t,n){if(n?.objectFields&&!Array.isArray(t?.enum)){if(t?.type===`array`&&t.items?.type===`string`&&(/Fields$/.test(e)||e===`columns`||e===`fieldOrder`))return`field-multi`;if(Ti(t)&&(/.Field$/.test(e)||e===`field`))return`field-ref`}}function Di(e,t){if(!Array.isArray(t?.enum)&&Ti(t)&&(e===`icon`||/Icon$/.test(e)))return`icon`}function Oi(e,t){if((Ti(t)||Array.isArray(t?.enum))&&(e===`color`||e===`colorVariant`||/Color$/.test(e)))return`color-picker`}function ki(e,t,n){return e===`color-picker`||e===`color-input`?qr(t,n):e}function Ai({fieldSpec:e,widget:t,schema:n,value:r}){if(e?.type===`composite`)return{kind:`composite`};if(e?.type===`repeater`)return{kind:`repeater`,itemSchema:bi(n,r)};if(e?.type===`record`)return{kind:`record`,itemSchema:n?.additionalProperties??{}};let i=yi(n,r)??n??{},a=e=>e?.type===`object`&&!!e.properties&&typeof e.properties==`object`,o=e=>{if(e?.type!==`array`||!e.items||typeof e.items!=`object`)return;let t=yi(e.items,Array.isArray(r)&&r.length?r[0]:void 0);return a(t)?t:void 0};if(t){if(ti[t])return{kind:`registered`,widget:t};if(a(i))return{kind:`nested-form`,effective:i};let e=o(i);if(e)return{kind:`object-rows`,effective:i,itemSchema:e};if(!hi.has(t))return{kind:`raw-json`,hint:t}}let s=i?.type,c=Array.isArray(e?.options)&&e.options.length>0,l=Array.isArray(i?.enum)&&i.enum.length>0;if(c||l||s===`boolean`||t===`switch`||e?.type===`boolean`||e?.type===`toggle`||s===`number`||s===`integer`||s===`string`)return{kind:`scalar`,effective:i};if(s===`array`){let e=i?.items??{};if(e.type===`string`||e.type===`number`||e.type===`integer`)return{kind:`scalar`,effective:i}}if(a(i))return{kind:`nested-form`,effective:i};let u=o(i);return u?{kind:`object-rows`,effective:i,itemSchema:u}:{kind:`raw-json`}}function ji(e){switch(e.kind){case`registered`:return ri(e.widget);case`composite`:case`repeater`:case`record`:case`nested-form`:case`object-rows`:return`group`;case`raw-json`:case`scalar`:return`control`}}var Mi=new Set([`visible`,`hidden`,`disabled`,`visibleOn`,`condition`,`predicate`]);function Ni(e,t){if(!Array.isArray(t?.enum)&&Ti(t)&&(Mi.has(e)||/When$/.test(e)))return`condition`}var Pi=/(^|_)(secret|token|api[_-]?key|access[_-]?key|client[_-]?secret|credential|private[_-]?key|passphrase)$/i;function Fi(e,t){if(t?.format===`password`||t?.writeOnly===!0||!Array.isArray(t?.enum)&&Ti(t)&&Pi.test(e))return`secret`}function Ii({name:e,schema:t,fieldSpec:n,widgetContext:r}){let i=xi(n,t);if(!n?.widget){let n=Ei(e,t,r);if(n)i=n;else{let n=Fi(e,t);if(n)i=n;else{let n=Di(e,t);if(n)i=n;else{let n=Oi(e,t);if(n)i=n;else{let n=Ni(e,t);n&&(i=n)}}}}}return ki(i,t,n)}function Li(e){return e?.visibleWhen??e?.visibleOn}function Ri({schema:e,form:t,value:n,onChange:r,issues:i=[],hiddenFields:a=[],fieldOrder:o=[],readOnly:s=!1,createMode:c=!1,widgetContext:l,idPath:u}){let d=V(),f=F(),p=W.useMemo(()=>{let e={};for(let t of i)(e[t.path]??=[]).push(ye(t.message,d));return e},[i,d]),m=W.useMemo(()=>mi(e),[e]);if(!m||typeof m!=`object`){if(n&&typeof n==`object`)m=aa(n);else return(0,G.jsx)(ia,{value:n,onChange:r,readOnly:s})}m.properties===void 0&&Array.isArray(m.anyOf??m.oneOf)&&(m=yi(m,n)??m);let h=m.properties??{},g=Array.isArray(m.required)?m.required:[],_=n??{},v=ca(Object.keys(h),o).filter(e=>!a.includes(e)).filter(e=>{let t=Li(h[e]);return!t||nt(t,K(_,f))}),y=n??{};function b(e,t){let n={...y,[e]:t};(t===void 0||t===``)&&delete n[e],r(n)}if(t?.sections?.length){let e=Ji(t),n=[];for(let t of e)for(let e of t.fields)n.push(typeof e==`string`?e:e.field);let r=n.filter(e=>h[e]).length;if(n.length===0||r>0)return(0,G.jsx)(Yi,{sections:e,formType:t.type,props:h,idPath:u,required:g,hiddenFields:a,issuesByPath:p,value:y,readOnly:s,createMode:c,widgetContext:l,onChange:b});typeof console<`u`&&console.warn(`[SchemaForm] form layout declares no fields that exist in the schema; falling back to flat schema-driven rendering. Declared:`,n,`Available:`,Object.keys(h))}return(0,G.jsx)(`div`,{className:`space-y-4`,children:v.map(e=>(0,G.jsx)(Zi,{name:e,idPath:u,schema:h[e],value:y[e],required:g.includes(e),issues:p[e],readOnly:s,widgetContext:l,fieldSpec:h[e]?.widget?{field:e,widget:h[e].widget}:void 0,formData:y,onChange:t=>b(e,t)},e))})}var zi=`drawer-metadata`,Bi=`drawer-embedded-item`,Vi=W.createContext(!1),Hi=W.createContext(!1),Ui=()=>!1;function Wi(e){let t=W.useRef(null);W.useEffect(()=>{if(!e||!Ui()||typeof document>`u`)return;let n=new Set,r=[];for(let e of Array.from(document.querySelectorAll(`[id^="mdf-"]`))){let t=e.id;n.has(t)?r.includes(t)||r.push(t):n.add(t)}let i=r.join(`,`);i!==t.current&&(t.current=i,r.length!==0&&console.error(`[SchemaForm] duplicate field host id(s) in this document: ${r.join(`, `)}. Two SchemaForm instances are mounted at once — the metadata detail drawer sits on top of the page form, which stays in the DOM — and at least one of them renders unscoped top-level ids. A \`label[for]\` resolves to the FIRST match in the document, so the later form's labels name and focus the earlier form's controls (objectui#5092). Give the secondary form a distinct \`idPath\` scope segment — see DRAWER_METADATA_ID_SCOPE / DRAWER_EMBEDDED_ITEM_ID_SCOPE in SchemaForm.tsx.`))})}function Gi(e){let t=W.useContext(Vi),n=W.useContext(Hi);Wi(!t);let r=e.createMode===!0||n;return(0,G.jsx)(Vi.Provider,{value:!0,children:(0,G.jsx)(Hi.Provider,{value:r,children:(0,G.jsx)(Ri,{...e})})})}function Ki(e){return typeof e==`string`?{field:e}:e}function qi(e){return Array.isArray(e.fields)}function Ji(e){let t=e.data,n=t&&`schemaId`in t?t.schemaId:void 0;return(ve(e.sections,{objectName:n??``,formType:e.type,objectDef:null,resolvable:!1})??[]).map((e,t)=>{if(qi(e))return e;throw TypeError(`[SchemaForm] form section ${t}${e.label?` ("${e.label}")`:``} declares neither \`fields\` nor \`group\`. A section must declare its members exactly one way, and \`@objectstack/spec\`'s FormSectionSchema refuses this shape at parse: enumerate \`fields\`, or point \`group\` at a declared field group.`)})}function Yi({sections:e,formType:t,props:n,required:r,hiddenFields:i,issuesByPath:a,value:s,readOnly:c,createMode:l,widgetContext:u,idPath:d,onChange:f}){let p=V(),h=F(),g=e.filter(e=>{let t=Li(e);return!t||nt(t,K(s,h))}),_=t===`tabbed`&&g.length>1,y=(e,t)=>{let o=e.fields.map(Ki).filter(e=>{if(e.hidden||i.includes(e.field))return!1;let t=Li(e);return!(t&&!nt(t,K(s,h)))});if(o.length===0)return null;let g=e.columns??1,_=(0,G.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`},children:o.map(e=>{let t=n[e.field];if(!t)return(0,G.jsx)(`div`,{className:`rounded border border-dashed border-amber-500/40 bg-amber-500/5 p-2 text-xs text-amber-700 dark:text-amber-300`,style:{gridColumn:`span ${e.colSpan??1}`},children:H(`engine.form.missingField`,p,{field:e.field})},e.field);let i=di(e);return(0,G.jsx)(`div`,{style:{gridColumn:`span ${e.colSpan??1}`},children:(0,G.jsx)(Zi,{name:e.field,idPath:d,schema:{...t,...i?{title:i}:{},...e.helpText?{description:e.helpText}:{},...e.placeholder?{placeholder:e.placeholder}:{}},value:s[e.field],required:e.required??r.includes(e.field),issues:a[e.field],readOnly:c||e.readonly||e.immutable&&!l,fieldSpec:e,widgetContext:u,formData:s,onChange:t=>f(e.field,t)})},e.field)})});return e.collapsible&&e.label?(0,G.jsxs)(m,{defaultOpen:!e.collapsed,className:`rounded-md border border-border/40 bg-card/30`,children:[(0,G.jsxs)(P,{className:`group flex w-full items-center justify-between gap-2 p-4 text-left`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`block text-sm font-semibold text-foreground/90`,children:e.label}),e.description&&(0,G.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]}),(0,G.jsx)(L,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-data-[state=closed]:-rotate-90`})]}),(0,G.jsx)(b,{className:`space-y-3 px-4 pb-4`,children:_})]},t):(0,G.jsxs)(`section`,{className:`space-y-3 rounded-md border border-border/40 bg-card/30 p-4`,children:[e.label&&(0,G.jsxs)(`header`,{children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-foreground/90`,children:e.label}),e.description&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),_]},t)};if(_){let e=g.filter(e=>e.fields.map(Ki).some(e=>{if(e.hidden||i.includes(e.field))return!1;let t=Li(e);return!t||nt(t,K(s,h))}));if(e.length===0)return null;let t=(e[0].label??`section-0`).toLowerCase();return(0,G.jsxs)(v,{defaultValue:t,className:`w-full`,children:[(0,G.jsx)(k,{className:`flex flex-wrap gap-1`,children:e.map((e,t)=>(0,G.jsx)(ee,{value:(e.label??`section-${t}`).toLowerCase(),children:e.label??H(`engine.form.sectionN`,p,{n:t+1})},t))}),e.map((e,t)=>(0,G.jsx)(o,{value:(e.label??`section-${t}`).toLowerCase(),className:`mt-4`,children:y(e,t)},t))]})}return(0,G.jsx)(`div`,{className:`space-y-4`,children:g.map(y)})}function $(e,t){return e?`${e}.${t}`:String(t)}function Xi(e){return`mdf-${e}`}function Zi({name:e,idPath:t,schema:n,value:r,required:i,issues:o,readOnly:s,fieldSpec:c,widgetContext:l,formData:u,onChange:d}){let f=V(),p=W.useContext(Hi),[m,h]=W.useState(!1),g=W.useCallback(()=>h(!0),[]),_=!p||m?o:void 0,v=W.useCallback(e=>{h(!0),d(e)},[d]),y=c?.label||be(e,n?.title,f)||sa(e),b=c?.helpText||xe(e,n?.description,f),x=$(t,e),S=Xi(x),C=Ii({name:e,schema:n,fieldSpec:c,widgetContext:l}),w=ji(Ai({fieldSpec:c,widget:C,schema:n,value:r}))===`group`,T=w?`${S}-label`:void 0,E=w?{id:void 0,ariaLabelledBy:T}:{id:S,ariaLabelledBy:void 0},D=w?{id:T}:{htmlFor:S},O=n?.type===`boolean`||C===`switch`,k=n?.default!==void 0,A=i&&!(O&&k),j=di(c)||n?.title||sa(e),M=sa(e).toLowerCase()===j.toLowerCase();return O?(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 py-1.5`,onBlur:g,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(a,{...D,className:`text-sm font-medium cursor-pointer`,children:[y,A&&(0,G.jsx)(`span`,{className:`text-destructive ml-0.5`,"aria-hidden":`true`,"data-required-marker":`true`,children:`*`})]}),b&&(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5`,children:b}),_?.map((e,t)=>(0,G.jsx)(`div`,{"data-testid":`schema-form-issue`,className:`text-xs text-destructive mt-0.5`,children:e},t))]}),(0,G.jsx)(Qi,{id:E.id,ariaLabelledBy:E.ariaLabelledBy,required:A,fieldName:e,idPath:x,schema:n,value:r,onChange:v,readOnly:s,widget:C,fieldSpec:c,widgetContext:l,formData:u})]}):(0,G.jsxs)(`div`,{className:`space-y-1.5`,onBlur:g,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,G.jsxs)(a,{...D,className:`text-sm font-medium`,children:[y,A&&(0,G.jsx)(`span`,{className:`text-destructive ml-0.5`,"aria-hidden":`true`,"data-required-marker":`true`,children:`*`}),!M&&(0,G.jsx)(`code`,{className:`ml-2 text-[10px] font-mono text-muted-foreground/70`,title:U(`engine.form.machineName`,f),children:e})]})}),(0,G.jsx)(Qi,{id:E.id,ariaLabelledBy:E.ariaLabelledBy,required:A,fieldName:e,idPath:x,schema:n,value:r,onChange:v,readOnly:s,widget:C,fieldSpec:c,widgetContext:l,formData:u}),b&&(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:b}),_?.map((e,t)=>(0,G.jsx)(`div`,{"data-testid":`schema-form-issue`,className:`text-xs text-destructive`,children:e},t))]})}function Qi({id:e,ariaLabelledBy:t,required:n,fieldName:r,idPath:i,schema:a,value:o,onChange:c,readOnly:l,widget:u,fieldSpec:d,widgetContext:f,formData:m}){let h=V(),g=F(),_=Ai({fieldSpec:d,widget:u,schema:a,value:o}),v=n?!0:void 0;if(_.kind===`composite`){let e=d?.fields?.length?d.fields:la(a);return(0,G.jsx)(ta,{value:o,fields:e,schema:a,readOnly:l,widgetContext:f,fieldSpec:d,ariaLabelledBy:t,idPath:i,onChange:c})}if(_.kind===`repeater`){let e=_.itemSchema,n=d?.fields?.length?d.fields:la(e);return(0,G.jsx)(na,{value:o,fields:n,schema:{...a,items:e},readOnly:l,widgetContext:f,widget:d?.widget,ariaLabelledBy:t,idPath:i,onChange:c})}if(_.kind===`record`){let e=_.itemSchema,n=d?.fields?.length?d.fields:la(e);return(0,G.jsx)(ra,{value:o,fields:n,schema:a,readOnly:l,widgetContext:f,widget:d?.widget,keyField:d?.keyField,formData:m,ariaLabelledBy:t,idPath:i,onChange:c})}if(_.kind===`registered`){let r=ti[_.widget];return(0,G.jsx)(r,{id:e,ariaLabelledBy:t,required:n,schema:a,value:o,onChange:c,readOnly:l,context:f,fieldSpec:d,formData:m})}if(_.kind===`nested-form`)return(0,G.jsx)(`div`,{className:`rounded-md border border-border/40 bg-card/30 p-3`,role:`group`,"aria-labelledby":t,children:(0,G.jsx)(Gi,{schema:_.effective,value:o??{},onChange:e=>c(e),readOnly:l,widgetContext:f,idPath:i})});if(_.kind===`object-rows`)return(0,G.jsx)(na,{value:o,fields:la(_.itemSchema),schema:{..._.effective,items:_.itemSchema},readOnly:l,widgetContext:f,widget:d?.widget,ariaLabelledBy:t,idPath:i,onChange:c});if(_.kind===`raw-json`)return _.hint?(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(ia,{id:e,ariaLabelledBy:t,required:n,value:o,onChange:e=>c(e),readOnly:l}),(0,G.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:H(`engine.form.fallbackJson`,h,{widget:_.hint})})]}):(0,G.jsx)(ia,{id:e,ariaLabelledBy:t,required:n,value:o,onChange:c,readOnly:l,small:!0});let b=_.effective,x=b?.type,C=d?.options,w=b?.enum??void 0;if(Array.isArray(C)&&C.length>0)return(0,G.jsxs)(p,{value:o==null?``:String(o),onValueChange:e=>c(e),disabled:l,children:[(0,G.jsx)(s,{id:e,"aria-labelledby":t,"aria-required":v,children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectEllipsis`,h)})}),(0,G.jsx)(y,{children:tt(C,K(m,g)).map(e=>(0,G.jsxs)(N,{value:e.value,children:[e.label,e.color&&(0,G.jsx)(`span`,{className:`ml-2 inline-block h-3 w-3 rounded`,style:{backgroundColor:e.color}})]},e.value))})]});if(Array.isArray(w)&&w.length>0)return(0,G.jsxs)(p,{value:o==null?``:String(o),onValueChange:e=>c(e),disabled:l,children:[(0,G.jsx)(s,{id:e,"aria-labelledby":t,"aria-required":v,children:(0,G.jsx)(S,{placeholder:U(`engine.form.selectEllipsis`,h)})}),(0,G.jsx)(y,{children:w.map(e=>(0,G.jsx)(N,{value:String(e),children:Se(r??``,String(e),h)},String(e)))})]});if(x===`boolean`||u===`switch`||d?.type===`boolean`||d?.type===`toggle`)return(0,G.jsx)(O,{id:e,"aria-labelledby":t,"aria-required":v,checked:!!o,onCheckedChange:e=>c(e),disabled:l});if(x===`number`||x===`integer`){let n=e=>{let t=b?.[e];return typeof t==`number`&&Number.isFinite(t)?t:void 0},r=d?.min??n(`minimum`),i=d?.max??n(`maximum`),a=n(`multipleOf`),s=n(`default`);return(0,G.jsx)(T,{id:e,"aria-labelledby":t,"aria-required":v,type:`number`,value:o==null?``:String(o),placeholder:s==null?void 0:String(s),min:r,max:i,step:a,onChange:e=>{let t=e.target.value;if(t===``)return c(void 0);let n=x===`integer`?parseInt(t,10):Number(t);c(Number.isFinite(n)?n:void 0)},readOnly:l})}if(x===`string`){let n=d?.maxLength;return b?.format===`multiline`||b?.contentMediaType===`text/markdown`||typeof o==`string`&&o.length>80?(0,G.jsx)(E,{id:e,"aria-labelledby":t,"aria-required":v,rows:4,value:o??``,maxLength:n,onChange:e=>c(e.target.value||void 0),readOnly:l}):(0,G.jsx)(T,{id:e,"aria-labelledby":t,"aria-required":v,value:o??``,maxLength:n,onChange:e=>c(e.target.value||void 0),readOnly:l})}if(x===`array`){let n=b?.items??{};if(n.type===`string`||n.type===`number`||n.type===`integer`)return(0,G.jsx)(T,{id:e,"aria-labelledby":t,"aria-required":v,value:(Array.isArray(o)?o:[]).map(String).join(`, `),placeholder:U(`engine.form.arrayPlaceholder`,h),onChange:e=>{let t=e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean);n.type===`number`||n.type===`integer`?c(t.map(e=>Number(e)).filter(e=>Number.isFinite(e))):c(t)},readOnly:l})}return(0,G.jsx)(ia,{id:e,ariaLabelledBy:t,required:n,value:o,onChange:c,readOnly:l,small:!0})}function $i(e,t,n){if(!e)return{};let r;return r=t===`composite`?e.properties:t===`repeater`?e.items?.properties:e.additionalProperties?.properties,r?.[n]??{}}function ea(e,t){let n=[];for(let r of t){let t=e[r.field];if(t==null||t===``||t===!1)continue;let i=r.label||r.field;t===!0?n.push(i):Array.isArray(t)?t.length&&n.push(t.map(e=>typeof e==`object`&&e?e.field??e.name??``:String(e)).filter(Boolean).join(`, `)):typeof t==`object`?n.push(i):n.push(String(t))}return n.join(` · `)}function ta({value:e,fields:t,schema:n,readOnly:r,widgetContext:i,fieldSpec:a,ariaLabelledBy:o,idPath:s,onChange:c}){let l=V(),u=e&&typeof e==`object`&&!Array.isArray(e)?e:{},p=t.map(Ki),m=p.map(e=>{let t=$i(n,`composite`,e.field);return(0,G.jsx)(Zi,{name:e.field,idPath:s,schema:t,value:u[e.field],required:!!e.required,readOnly:r||e.readonly,fieldSpec:e,widgetContext:i,formData:u,onChange:t=>c({...u,[e.field]:t})},e.field)});if(a?.disclosure===`popover`){let e=ea(u,p);return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-border/50 bg-muted/20 px-3 py-1.5`,role:`group`,"aria-labelledby":o,children:[(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground truncate`,title:e,children:e||(0,G.jsx)(`span`,{className:`italic opacity-70`,children:U(`engine.form.notConfigured`,l)})}),(0,G.jsxs)(f,{children:[(0,G.jsx)(d,{asChild:!0,children:(0,G.jsx)(D,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 shrink-0`,"aria-label":U(`engine.form.configure`,l),"data-testid":`composite-popover-${a.field}`,children:(0,G.jsx)(pe,{className:`h-4 w-4`})})}),(0,G.jsx)(j,{align:`end`,className:`w-80 space-y-3`,children:m})]})]})}return(0,G.jsx)(`div`,{className:`rounded-md border border-border/50 bg-muted/20 p-3 space-y-3`,role:`group`,"aria-labelledby":o,children:m})}function na({value:e,fields:t,schema:n,readOnly:r,widgetContext:i,widget:a,ariaLabelledBy:o,idPath:s,onChange:c}){let l=V(),u=Array.isArray(e)?e:[],d=t.map(Ki),[f,p]=W.useState(null),m=a===`grid`||a===`table`,h=(e,t)=>Xi($($(s,e),t)),g=e=>`${Xi($(s,e))}-col`,_=(e,t)=>{c(u.map((n,r)=>r===e?{...n,...t}:n))},v=e=>c(u.filter((t,n)=>n!==e)),y=()=>{let e={};d.forEach(t=>{e[t.field]=void 0}),c([...u,e]),p(u.length)},b=n.items??{},x=b.type;if((x===`string`||x===`number`||x===`integer`||x===`boolean`)&&u.length>0){let e=u,t=(t,n)=>c(e.map((e,r)=>r===t?n===void 0&&x===`string`?``:n:e));return(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":o,children:[e.map((e,n)=>{let a=$(s,n),c=Xi(a),u=`${c}-ordinal`,d=typeof e!=`object`||!e;return(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{id:u,className:`w-8 shrink-0 text-xs text-muted-foreground`,children:[`#`,n+1]}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(Qi,{id:c,ariaLabelledBy:o?`${o} ${u}`:u,idPath:a,schema:d?b:{},value:e,readOnly:r,widgetContext:i,onChange:e=>t(n,e)})}),!r&&(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>v(n),className:`h-7 w-7 p-0`,"aria-label":U(`engine.form.remove`,l),children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})]},n)}),!r&&(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>c([...e,x===`string`?``:void 0]),children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` `,U(`engine.form.addItem`,l)]})]})}return m?(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":o,children:[(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border/50`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`bg-muted/40`,children:(0,G.jsxs)(`tr`,{children:[d.map(e=>(0,G.jsxs)(`th`,{id:g(e.field),scope:`col`,className:`px-2 py-1.5 text-left text-xs font-medium`,children:[e.label||sa(e.field),e.required&&(0,G.jsx)(`span`,{className:`text-destructive ml-0.5`,"aria-hidden":`true`,"data-required-marker":`true`,children:`*`})]},e.field)),!r&&(0,G.jsx)(`th`,{scope:`col`,className:`w-8`})]})}),(0,G.jsxs)(`tbody`,{children:[u.length===0&&(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:d.length+1,className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:U(`engine.repeater.empty`,l)})}),u.map((e,t)=>(0,G.jsxs)(`tr`,{className:`border-t border-border/30 align-top`,children:[d.map(a=>{let o=$i(n,`repeater`,a.field);return(0,G.jsx)(`td`,{className:`p-1.5`,children:(0,G.jsx)(Qi,{id:h(t,a.field),ariaLabelledBy:g(a.field),required:!!a.required,fieldName:a.field,idPath:$($(s,t),a.field),schema:o,value:e?.[a.field],readOnly:r||a.readonly,widget:Ii({name:a.field,schema:o,fieldSpec:a,widgetContext:i}),fieldSpec:a,widgetContext:i,formData:e,onChange:e=>_(t,{[a.field]:e})})},a.field)}),!r&&(0,G.jsx)(`td`,{className:`p-1.5 text-right`,children:(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>v(t),className:`h-7 w-7 p-0`,"aria-label":U(`engine.form.remove`,l),children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})})]},t))]})]})}),!r&&(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:y,children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` `,U(`engine.form.add`,l)]})]}):(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":o,children:[u.length===0&&(0,G.jsx)(`div`,{className:`rounded-md border border-dashed border-border/50 px-3 py-4 text-center text-xs text-muted-foreground`,children:U(`engine.list.empty`,l)}),u.map((e,t)=>{let a=f===t,o=d.map(t=>e?.[t.field]).find(e=>e!=null&&e!==``);return(0,G.jsxs)(`div`,{className:`rounded-md border border-border/50 bg-muted/10`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 py-1.5 border-b border-border/30`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(a?null:t),className:`flex items-center gap-1.5 text-sm font-medium text-left flex-1 min-w-0`,children:[a?(0,G.jsx)(L,{className:`h-3.5 w-3.5`}):(0,G.jsx)(re,{className:`h-3.5 w-3.5`}),(0,G.jsxs)(`span`,{className:`truncate`,children:[`#`,t+1,o==null?``:` — ${String(o)}`]})]}),!r&&(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>v(t),className:`h-7 w-7 p-0`,"aria-label":U(`engine.form.remove`,l),children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})]}),a&&(0,G.jsx)(`div`,{className:`p-3 space-y-3`,children:d.map(a=>{let o=$i(n,`repeater`,a.field);return(0,G.jsx)(Zi,{name:a.field,idPath:$(s,t),schema:o,value:e?.[a.field],required:!!a.required,readOnly:r||a.readonly,fieldSpec:a,widgetContext:i,formData:e,onChange:e=>_(t,{[a.field]:e})},a.field)})})]},t)}),!r&&(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:y,children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` `,U(`engine.form.addItem`,l)]})]})}function ra({value:e,fields:t,schema:n,readOnly:r,widgetContext:i,widget:a,keyField:o,formData:s,ariaLabelledBy:c,idPath:l,onChange:u}){let d=V(),f=F(),[p,m]=W.useState(null),[h,g]=W.useState(``),[_,v]=W.useState(null),[y,b]=W.useState(null),[x,S]=W.useState(null);if(a){let o=ti[a];if(o)return(0,G.jsx)(o,{ariaLabelledBy:c,schema:n,value:e,onChange:u,readOnly:r,context:i,fieldSpec:{field:``,type:`record`,fields:t,widget:a},formData:s})}let C=o?.field??`name`,w=o?.label??sa(C),E=o?.regex?new RegExp(o.regex):null,O=o?.immutable!==!1,k=e&&typeof e==`object`&&!Array.isArray(e)?e:{},A=Object.entries(k),j=t.map(Ki).filter(e=>e.field!==C),M=e=>u(e),ee=(e,t)=>{let n={};for(let[r,i]of A)n[r]=r===e?{...i,...t}:i;M(n)},N=e=>{let t={};for(let[n,r]of A)n!==e&&(t[n]=r);M(t)},P=(e,t)=>{if(t===e)return;if(k[t]){v(H(`engine.form.keyExists`,d,{key:t}));return}if(E&&!E.test(t)){v(H(`engine.form.keyPattern`,d,{pattern:String(E)}));return}let n={};for(let[r,i]of A)r===e?n[t]={...i,[C]:t}:n[r]=i;v(null),M(n)},I=()=>{let e=h.trim();if(!e){v(U(`engine.form.keyRequired`,d));return}if(k[e]){v(H(`engine.form.keyExists`,d,{key:e}));return}if(E&&!E.test(e)){v(H(`engine.form.keyPattern`,d,{pattern:String(E)}));return}let t={[C]:e};j.forEach(e=>{t[e.field]=void 0}),M({...k,[e]:t}),g(``),v(null),m(e)},te=(e,t)=>{if(e===t)return;let n=A.map(([e])=>e),r=n.indexOf(e),i=n.indexOf(t);if(r<0||i<0)return;n.splice(r,1),n.splice(i,0,e);let a={};for(let e of n)a[e]=k[e];M(a)};return(0,G.jsxs)(`div`,{className:`space-y-2`,role:`group`,"aria-labelledby":c,children:[A.length===0&&(0,G.jsx)(`div`,{className:`rounded-md border border-dashed border-border/50 px-3 py-4 text-center text-xs text-muted-foreground`,children:U(`engine.list.empty`,d)}),A.map(([e,t],a)=>{let s=p===e,c=j.map(e=>t?.[e.field]).find(e=>e!=null&&e!==``);return(0,G.jsxs)(`div`,{className:`rounded-md border bg-muted/10 ${x===e&&y&&y!==e?`border-primary border-2`:`border-border/50`}`,onDragOver:t=>{y&&!r&&(t.preventDefault(),x!==e&&S(e))},onDragLeave:()=>{x===e&&S(null)},onDrop:t=>{y&&!r&&(t.preventDefault(),te(y,e),b(null),S(null))},children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 py-1.5 border-b border-border/30`,children:[!r&&(0,G.jsx)(`span`,{draggable:!0,onDragStart:t=>{b(e),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e)},onDragEnd:()=>{b(null),S(null)},className:`cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground`,"aria-label":U(`engine.form.dragToReorder`,d),title:U(`engine.form.dragToReorder`,d),children:(0,G.jsx)(ue,{className:`h-3.5 w-3.5`})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>m(s?null:e),className:`flex items-center gap-1.5 text-sm font-medium text-left flex-1 min-w-0`,children:[s?(0,G.jsx)(L,{className:`h-3.5 w-3.5`}):(0,G.jsx)(re,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{className:`font-mono text-xs px-1.5 py-0.5 rounded bg-muted/60`,children:e}),c!=null&&(0,G.jsxs)(`span`,{className:`truncate text-muted-foreground`,children:[`— `,String(c)]})]}),!r&&(0,G.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>N(e),className:`h-7 w-7 p-0`,"aria-label":U(`engine.form.remove`,d),children:(0,G.jsx)(B,{className:`h-3.5 w-3.5`})})]}),s&&(0,G.jsxs)(`div`,{className:`p-3 space-y-3`,children:[(0,G.jsx)(Zi,{name:C,idPath:$(l,a),schema:{type:`string`},value:e,required:!0,readOnly:r||O,fieldSpec:{field:C,type:`text`,label:w,helpText:o?.helpText},widgetContext:i,formData:t,onChange:t=>P(e,String(t??``).trim())}),j.map(o=>{let s=Li(o);if(s&&!nt(s,K(t,f)))return null;let c=$i(n,`record`,o.field);return(0,G.jsx)(Zi,{name:o.field,idPath:$(l,a),schema:c,value:t?.[o.field],required:!!o.required,readOnly:r||o.readonly,fieldSpec:o,widgetContext:i,formData:t,onChange:t=>ee(e,{[o.field]:t})},o.field)})]})]},e)}),!r&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(T,{value:h,onChange:e=>{g(e.target.value),_&&v(null)},placeholder:o?.placeholder??w,className:`h-8 text-xs font-mono max-w-[220px]`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I())}}),(0,G.jsxs)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:I,children:[(0,G.jsx)(z,{className:`h-3.5 w-3.5 mr-1`}),` `,U(`engine.form.add`,d)]}),_&&(0,G.jsx)(`span`,{className:`text-xs text-destructive`,children:_})]})]})}function ia({id:e,ariaLabelledBy:t,required:n,value:r,onChange:i,readOnly:a,small:o}){let s=V(),[c,l]=W.useState(()=>oa(r)),[u,d]=W.useState(null);return W.useEffect(()=>{l(oa(r)),d(null)},[JSON.stringify(r)]),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(E,{id:e,"aria-labelledby":t,"aria-required":n?!0:void 0,rows:o?4:12,className:`font-mono text-xs`,value:c,readOnly:a,onChange:e=>{let t=e.target.value;if(l(t),!t.trim()){d(null),i(void 0);return}try{let e=JSON.parse(t);d(null),i(e)}catch(e){d(e?.message??U(`engine.form.invalidJson`,s))}}}),u&&(0,G.jsx)(`div`,{className:`text-xs text-destructive`,children:u})]})}function aa(e){let t={};for(let[n,r]of Object.entries(e))if(!n.startsWith(`_`)){if(r==null)t[n]={type:`string`};else if(typeof r==`string`)t[n]=r.length>80||r.includes(`
|
|
3
|
+
`)?{type:`string`,format:`multiline`}:{type:`string`};else if(typeof r==`number`)t[n]={type:Number.isInteger(r)?`integer`:`number`};else if(typeof r==`boolean`)t[n]={type:`boolean`};else if(Array.isArray(r)){if(r.length>0&&typeof r[0]==`string`)t[n]={type:`array`,items:{type:`string`}};else if(r.length>0&&typeof r[0]==`object`&&r[0]!==null){let e=r[0],i={};for(let t of Object.keys(e))i[t]={type:`string`};t[n]={type:`array`,items:{type:`object`,properties:i}}}else t[n]={type:`array`,items:{type:`string`}}}else t[n]=typeof r==`object`?{type:`object`,additionalProperties:!0}:{type:`string`}}return{type:`object`,properties:t,additionalProperties:!0}}function oa(e){if(e===void 0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function sa(e){return e.replace(/[_-]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/\b\w/g,e=>e.toUpperCase())}function ca(e,t){if(!t.length)return e;let n=new Set(e),r=t.filter(e=>n.has(e)),i=e.filter(e=>!t.includes(e));return[...r,...i]}function la(e){let t=e?.properties??{};return Object.keys(t)}export{Fe as $,An as A,It as B,On as C,Dn as D,Rn as E,Sn as F,Le as G,Tt as H,an as I,We as J,He as K,vn as L,Mn as M,Nn as N,Ln as O,kn as P,Oe as Q,fn as R,Fn as S,Tn as T,wt as U,Kt as V,Je as W,Ve as X,Ae as Y,je as Z,rr as _,li as a,ke as at,Vn as b,ti as c,lr as d,Be as et,sr as f,ar as g,ir as h,ui as i,ze as it,wn as j,jn as k,br as l,pr as m,zi as n,Ne as nt,zr as o,or as p,qe as q,Gi as r,Pe as rt,Qr as s,Bi as t,Re as tt,cr as u,nr as v,En as w,In as x,zn as y,Qt as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{m as t,p as n,r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{p as o}from"./infrastructure-CSnL6ntj.js";import{Hr as s,Vr as c,Yn as l,et as u,ii as d}from"./ui-components-D8wcRNrt.js";import{Fr as ee,G as f,W as p,b as m}from"./framework-CAuH4h0L.js";import{w as h}from"./i18n-runtime-CdWyaiOD.js";import{t as g}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as _}from"./vendor-icon-chart-column-DicJIApF.js";import{t as v}from"./vendor-icon-database-C8JGjSkn.js";import{t as y}from"./vendor-icon-file-text-7BKAVNof.js";import{t as b}from"./vendor-icon-layout-dashboard-wba2hvZp.js";import{t as x}from"./vendor-icon-search-B2Uqtp_W.js";import{a as S,t as C}from"./useNavTargetLabel-D8lRdb6O.js";import{n as w}from"./utils-MjUhYVsx.js";import{a as T,o as E}from"./ui-layout-BYO3rRIl.js";import{t as D}from"./getIcon-BDkBRQFw.js";var O=e(a(),1),k=i();function A(e){let t=[];for(let n of e)n.type===`group`&&n.children?t.push(...A(n.children)):t.push(n);return t}var j={object:v,dashboard:b,page:y,report:_},te={object:`bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200`,dashboard:`bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200`,page:`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200`,report:`bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200`};function M(){let{t:e,language:i}=h(),{appName:a}=n(),[_,y]=t(),b=_.get(`q`)||``,[M,N]=(0,O.useState)(b),{apps:P,objects:F}=f(),I=P||[],L=(0,O.useMemo)(()=>F||[],[F]),R=S(I,a)||I[0],z=`/apps/${a}`,{user:B,activeOrganization:V}=o(),H=p(),U=C(),W=(0,O.useMemo)(()=>{if(!R)return[];let t=A(R.navigation||[]),n={currentUserId:B?.id??null,currentOrgId:V?.id??null};return t.map(t=>{let{href:r}=T(t,z,n);return{id:t.id,label:E(t,e,U,i),href:r,type:t.type,description:t.description}}).filter(e=>e.href!==`#`)},[R,z,B?.id,e,U,i]),G=(0,O.useMemo)(()=>{if(!M.trim())return W;let e=M.toLowerCase();return W.filter(t=>t.label.toLowerCase().includes(e)||t.type.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))},[W,M]),K=e=>{N(e),y(e?{q:e}:{})},q=(0,O.useMemo)(()=>{let e={};for(let t of G)(e[t.type]||=[]).push(t);return e},[G]),J=(0,O.useMemo)(()=>R?A(R.navigation||[]).filter(e=>e.type===`object`&&typeof e.objectName==`string`).map(e=>e.objectName):[],[R]),Y=u(),{results:X,isSearching:Z}=m({query:M,objects:L,dataSource:H,objectNames:J,enabled:!!H&&M.trim().length>=2,topPerObject:5,maxObjectsQueried:12,getDisplayName:ee,fieldReadPolicy:Y}),Q=(0,O.useMemo)(()=>{let e=new Map;for(let t of L)typeof t?.name==`string`&&e.set(t.name,t);return e},[L]),ne=(0,O.useMemo)(()=>{let t=[],n=new Map;for(let r of X){let i=n.get(r.objectName);if(!i){let a=Q.get(r.objectName);i={label:w(a?.label,e)||r.objectLabel,icon:a?.icon??r.icon,hits:[]},n.set(r.objectName,i),t.push(r.objectName)}i.hits.push(r)}return t.map(e=>({objectName:e,...n.get(e)}))},[X,Q,e]),$=G.length+X.length,re=$>0;return(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6 max-w-4xl mx-auto`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsxs)(r,{to:z,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,k.jsx)(g,{className:`h-4 w-4`}),e(`search.back`)]}),(0,k.jsx)(`h1`,{className:`text-xl font-semibold`,children:e(`search.title`)})]}),(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(`label`,{htmlFor:`search-results-input`,className:`sr-only`,children:e(`search.placeholder`)}),(0,k.jsx)(x,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,k.jsx)(l,{id:`search-results-input`,value:M,onChange:e=>K(e.target.value),placeholder:e(`search.placeholder`),className:`pl-10 h-11 text-base`,autoFocus:!0})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:M.trim()?e(`search.resultsCount`,{count:$,query:M}):e(`search.itemsAvailable`,{count:W.length})}),Z&&(0,k.jsx)(`span`,{"aria-hidden":!0,className:`inline-block h-1.5 w-1.5 rounded-full bg-primary motion-safe:animate-pulse`})]}),!re&&!Z?(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center`,children:[(0,k.jsx)(x,{className:`h-12 w-12 text-muted-foreground/30 mb-4`}),(0,k.jsx)(`p`,{className:`text-lg font-medium text-muted-foreground`,children:e(`search.noResults`)}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground/80 mt-1`,children:e(`search.noResultsHint`)})]}):(0,k.jsxs)(`div`,{className:`space-y-6`,children:[ne.map(e=>{let t=D(e.icon);return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`h2`,{className:`text-sm font-medium text-muted-foreground mb-2 flex items-center gap-1.5`,children:[(0,k.jsx)(t,{className:`h-4 w-4`}),e.label,(0,k.jsx)(d,{variant:`secondary`,className:`ml-1 text-xs`,children:e.hits.length})]}),(0,k.jsx)(`div`,{className:`grid gap-2`,children:e.hits.map(e=>{let t=D(e.icon);return(0,k.jsx)(r,{to:`${z}/${e.objectName}/record/${e.recordId}`,className:`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:(0,k.jsx)(c,{className:`hover:bg-accent/50 transition-colors cursor-pointer`,children:(0,k.jsxs)(s,{className:`flex items-center gap-3 p-3`,children:[(0,k.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-primary`,children:(0,k.jsx)(t,{className:`h-4 w-4`})}),(0,k.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,k.jsx)(`p`,{className:`text-sm font-medium truncate`,children:e.display}),e.subtitle&&(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:e.subtitle})]})]})})},`${e.objectName}:${e.recordId}`)})})]},`records:${e.objectName}`)}),Object.entries(q).map(([t,n])=>{let i=j[t]||v,a=`search.type${t.charAt(0).toUpperCase()}${t.slice(1)}s`;return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`h2`,{className:`text-sm font-medium text-muted-foreground mb-2 flex items-center gap-1.5`,children:[(0,k.jsx)(i,{className:`h-4 w-4`}),e(a),(0,k.jsx)(d,{variant:`secondary`,className:`ml-1 text-xs`,children:n.length})]}),(0,k.jsx)(`div`,{className:`grid gap-2`,children:n.map(t=>{let n=j[t.type]||v,i=`search.badge${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}`;return(0,k.jsx)(r,{to:t.href,className:`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:(0,k.jsx)(c,{className:`hover:bg-accent/50 transition-colors cursor-pointer`,children:(0,k.jsxs)(s,{className:`flex items-center gap-3 p-3`,children:[(0,k.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded ${te[t.type]||``}`,children:(0,k.jsx)(n,{className:`h-4 w-4`})}),(0,k.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,k.jsx)(`p`,{className:`text-sm font-medium truncate`,children:t.label}),t.description&&(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:t.description})]}),(0,k.jsx)(d,{variant:`outline`,className:`text-xs shrink-0`,children:e(i)})]})})},t.id)})})]},t)})]})]})}export{M as SearchResultsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{Gr as i,Hr as a,Ur as o,Vr as s,Wr as c,ii as l,kn as u}from"./ui-components-D8wcRNrt.js";import{w as d}from"./i18n-runtime-CdWyaiOD.js";import{t as f}from"./vendor-icon-settings-CYQ7xc_F.js";import{c as p,i as m,n as h,t as g}from"./useSettingsLabel-CSpBDTdy.js";var _=e(r(),1),v=n();function y({m:e,onOpen:t}){let{t:n}=d(),r=g(e.namespace),u=e.icon?p(e.icon):f,m=h(e.label),_=r.title(m),y=r.description(e.description??void 0);return(0,v.jsxs)(s,{className:`cursor-pointer hover:border-primary/50 hover:shadow-sm transition-all`,onClick:t,children:[(0,v.jsxs)(c,{className:`pb-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,v.jsx)(u,{className:`h-6 w-6 text-muted-foreground`}),e.beta?(0,v.jsx)(l,{variant:`secondary`,className:`text-[10px]`,children:n(`console.settingsHub.beta`)}):null]}),(0,v.jsx)(i,{className:`text-base mt-2`,children:_}),y?(0,v.jsx)(o,{className:`text-xs`,children:y}):null]}),(0,v.jsx)(a,{className:`pt-0`,children:(0,v.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:n(`console.settingsHub.settingsCount`,{n:e.specifiers.length})})})]})}function b(){let e=t(),{t:n}=d(),[r,i]=(0,_.useState)(null),[o,c]=(0,_.useState)(null);(0,_.useEffect)(()=>{m().then(e=>i(e.manifests??[])).catch(e=>c(e?.message??n(`console.settingsHub.loadError`)))},[n]);let l=(0,_.useMemo)(()=>{if(!r)return null;let e=new Map;for(let t of[...r].sort((e,t)=>(e.order??999)-(t.order??999))){let n=t.category??`Other`,r=e.get(n)??[];r.push(t),e.set(n,r)}return e},[r]);return(0,v.jsxs)(`div`,{className:`p-6 max-w-6xl mx-auto`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,v.jsx)(f,{className:`h-7 w-7 text-muted-foreground`}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:n(`console.settingsHub.title`)}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`console.settingsHub.subtitle`)})]})]}),o?(0,v.jsx)(s,{children:(0,v.jsx)(a,{className:`py-8 text-center text-sm text-destructive`,children:o})}):null,r?r.length===0?(0,v.jsx)(s,{children:(0,v.jsx)(a,{className:`py-12 text-center text-sm text-muted-foreground`,children:n(`console.settingsHub.empty`)})}):Array.from(l??[]).map(([t,r])=>(0,v.jsxs)(`section`,{className:`mb-8`,children:[(0,v.jsx)(`h2`,{className:`text-sm font-semibold tracking-wide uppercase text-muted-foreground mb-3`,children:n(`console.settingsHub.categories.${t}`,{defaultValue:t})}),(0,v.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:r.map(t=>(0,v.jsx)(y,{m:t,onOpen:()=>e(`/system/settings/${t.namespace}`)},t.namespace))})]},t)):(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(u,{className:`h-6 w-32`}),(0,v.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:3}).map((e,t)=>(0,v.jsx)(u,{className:`h-32 w-full`},t))})]})]})}export{b as SettingsHub};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{Bn as a,Br as o,Fn as s,Hn as c,In as l,Jn as u,Ln as d,On as f,Qn as p,Rn as m,Un as h,Vr as g,Xt as _,ci as v,cn as y,li as b,ri as x,si as S,sn as C,yi as w,zn as T,zr as E}from"./ui-components-D6cEVg0T.js";import{a as D}from"./framework-DFR4HNtj.js";import{w as O}from"./i18n-runtime-97_bDVjP.js";import{r as k}from"./vendor-ui-utils-DIUdEYii.js";import{t as A}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as j}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as M}from"./vendor-icon-info-DBwRTfSE.js";import{t as N}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as P}from"./vendor-icon-lock-B_psRnly.js";import{t as F}from"./vendor-icon-rotate-ccw-lr5YKsxC.js";import{t as I}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{a as L,c as R,n as z,o as B,r as V,s as H,t as U}from"./useSettingsLabel-CeMnMWsh.js";var W=e(i(),1),G=r();function K({reason:e,className:t}){return(0,G.jsxs)(x,{variant:`outline`,className:`gap-1 border-amber-300 bg-amber-50 text-amber-900 ${t??``}`,title:e??`Pinned by environment variable — cannot be edited from the UI.`,children:[(0,G.jsx)(P,{className:`h-3 w-3`}),`Locked by env`]})}function q({resolved:e,labels:t}){let n=e.cascadeChain;if(!n||n.length===0)return null;let r=n.find(e=>e.effective)??n[n.length-1],i=n.find(e=>e!==r&&e.value!==null&&e.value!==void 0),a=e=>t?.sourceLabel?.(e)??e;return r.scope!=="default"&&r.scope!==`user`&&r.scope!==`tenant`?(0,G.jsxs)(x,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,G.jsxs)(x,{variant:`outline`,className:`text-amber-700 border-amber-300 text-[10px]`,children:[`Overrides `,a(i.scope)]}):null}function J({spec:e,resolved:t,labelText:n,labels:r}){return(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(p,{className:`text-sm font-medium`,children:[n,e.required?(0,G.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`}):null]}),e.deprecated?(0,G.jsxs)(x,{variant:`outline`,className:`text-amber-700 border-amber-300`,children:[`Deprecated`,e.replacedBy?` → ${e.replacedBy}`:``]}):null,t?.locked?(0,G.jsx)(K,{reason:t.lockedReason}):null,t&&!t.locked?(0,G.jsx)(q,{resolved:t,labels:r}):null,t?.source&&t.source!=="default"&&!t.locked?(0,G.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r?.sourceLabel?.(t.source)??t.source}):null]})}function Y({description:e}){return e?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e}):null}function X({id:e,message:t}){return(0,G.jsx)(`p`,{id:e,role:`alert`,className:`text-xs text-destructive mt-1`,children:t})}function Z({id:e,value:t,options:n,disabled:r,onChange:i,...a}){let o=`${e}-domain`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(u,{id:e,type:`text`,list:n.length>0?o:void 0,value:t==null?``:String(t),disabled:r,onChange:e=>i(e.target.value),...a}),n.length>0?(0,G.jsx)(`datalist`,{id:o,children:n.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}):null]})}function Q(e){let{spec:t,resolved:n,value:r,onChange:i,onAction:o,locked:f,saving:g,labels:x,error:D}=e,k=(0,W.useId)(),{t:A}=O(),N=!!(f||g),P=z(t.label),F=t.key&&x?x.fieldLabel(t.key,P):P,I=t.key&&x?x.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&x?x.groupTitle(t.id,P):P,n=t.id&&x?x.groupDescription(t.id,t.description):t.description;return(0,G.jsxs)(`div`,{className:`pt-6 pb-2`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight text-foreground/90`,children:e}),n?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n}):null,(0,G.jsx)(s,{className:`mt-3`})]})}if(t.type===`info_banner`){let e=t.bannerSeverity===`error`?`destructive`:`default`;return(0,G.jsxs)(S,{variant:e,className:`my-2`,children:[(0,G.jsx)(M,{className:`h-4 w-4`}),(0,G.jsx)(b,{children:P}),t.bannerText?(0,G.jsx)(v,{children:t.bannerText}):null]})}if(t.type===`child_pane`)return(0,G.jsxs)(`a`,{href:`#/settings/${t.childNamespace}`,className:`flex items-center justify-between rounded-md border border-border bg-card px-4 py-3 hover:bg-accent transition-colors`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:P}),t.description?(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,G.jsx)(j,{className:`h-4 w-4 text-muted-foreground`})]});if(t.type===`title_value`)return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:x}),(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:String(r??`—`)})]});if(t.type===`action_button`){let e=t.icon?R(t.icon):null,n=t.id??t.key??`test`,r=x?x.actionLabel(n,P):P;return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:r}),t.description?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:t.description}):null]}),(0,G.jsxs)(w,{size:`sm`,variant:`secondary`,onClick:o,disabled:g,children:[e?(0,G.jsx)(e,{className:`h-4 w-4 mr-1.5`}):null,r]})]})}let L=`${k}-error`,B=e=>(0,G.jsxs)(`div`,{className:`space-y-1.5 py-2`,children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:x}),D&&(0,W.isValidElement)(e)?(0,W.cloneElement)(e,{"aria-invalid":!0,"aria-describedby":L}):e,D?(0,G.jsx)(X,{id:L,message:D}):(0,G.jsx)(Y,{description:I})]}),V=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!x?n:x.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return B((0,G.jsx)(u,{id:k,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:N,onChange:e=>i(e.target.value)}));case`password`:return B((0,G.jsx)(u,{id:k,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:N,onChange:e=>i(e.target.value)}));case`textarea`:return B((0,G.jsx)(_,{id:k,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:N,onChange:e=>i(e.target.value)}));case`number`:return B((0,G.jsx)(u,{id:k,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:N,onChange:e=>i(e.target.value===``?null:Number(e.target.value))}));case`toggle`:return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:x}),(0,G.jsx)(Y,{description:I})]}),(0,G.jsx)(C,{id:k,checked:!!r,disabled:N,onCheckedChange:e=>i(e)})]});case`select`:return t.valueDomain?B((0,G.jsx)(Z,{id:k,value:r,disabled:N,onChange:i,options:(t.options??[]).map(e=>({value:String(e.value),label:V(e)}))})):B((0,G.jsxs)(l,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:N,children:[(0,G.jsx)(T,{id:k,children:(0,G.jsx)(a,{placeholder:A(`common.select`,{defaultValue:`Select…`})})}),(0,G.jsx)(d,{children:t.options?.map(e=>(0,G.jsx)(m,{value:String(e.value),children:V(e)},String(e.value)))})]}));case`radio`:return B((0,G.jsx)(c,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:N,children:t.options?.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,G.jsx)(h,{value:String(e.value),id:`${k}-${e.value}`}),(0,G.jsx)(p,{htmlFor:`${k}-${e.value}`,className:`text-sm font-normal`,children:V(e)})]},String(e.value)))}));case`multiselect`:{let e=Array.isArray(r)?r:[];return B((0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.options?.map(t=>{let n=String(t.value),r=e.map(String).includes(n);return(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,G.jsx)(E,{checked:r,disabled:N,onCheckedChange:t=>{let r=new Set(e.map(String));t?r.add(n):r.delete(n),i(Array.from(r))}}),V(t)]},n)})}))}case`slider`:return B((0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(y,{value:[Number(r??t.min??0)],min:t.min??0,max:t.max??100,step:t.step??1,disabled:N,onValueChange:e=>i(e[0]),className:`flex-1`}),(0,G.jsx)(`span`,{className:`text-sm tabular-nums w-12 text-right`,children:String(r??t.min??0)})]}));case`color`:return B((0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(u,{id:k,type:`color`,value:r??`#000000`,disabled:N,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,G.jsx)(u,{value:r??``,disabled:N,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return B((0,G.jsx)(_,{id:k,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:N,onChange:e=>i(e.target.value)}));default:return B((0,G.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Unsupported specifier type: `,t.type]}))}}function $(e,t){if(!e)return!0;let n=e.trim().match(/^\$\{(.+)\}$/);if(!n)return!0;try{return!!Function(`data`,`with (data) { return (${n[1]}); }`)(t)}catch{return!0}}function ee(e,t){let{[t]:n,...r}=e;return r}function te(e){let t=e??{},n=e=>typeof e==`string`&&e.length>0?e:void 0,r=t.details&&typeof t.details==`object`?t.details:void 0,i=n(r?.namespace),a=n(r?.key);return{subject:a?i?`${i}.${a}`:a:void 0,prescription:n(t.message)}}function ne(){let e=n(),r=t(),{t:i}=O(),a=e.namespace??``,[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!0),[d,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),[_,v]=(0,W.useState)({}),[y,b]=(0,W.useState)({}),[S,C]=(0,W.useState)(null),T=(0,W.useCallback)(async()=>{u(!0),h(null);try{let e=await V(a);c(e),v({}),b({}),C(null)}catch(e){h(e?.message??i(`console.settingsView.loadError`))}finally{u(!1)}},[a,i]);(0,W.useEffect)(()=>{a&&T()},[a,T]);let E=(0,W.useMemo)(()=>{let e={};if(!s)return e;for(let[t,n]of Object.entries(s.values))e[t]=n.value;return{...e,..._}},[s,_]),j=(0,W.useMemo)(()=>Object.keys(_),[_]),M=U(a);if(!a)return(0,G.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:i(`console.settingsView.noNamespace`)});if(l)return(0,G.jsxs)(`div`,{className:`p-6 space-y-3 max-w-3xl`,children:[(0,G.jsx)(f,{className:`h-8 w-1/3`}),(0,G.jsx)(f,{className:`h-4 w-2/3`}),(0,G.jsx)(f,{className:`h-32 w-full`}),(0,G.jsx)(f,{className:`h-32 w-full`})]});if(m)return(0,G.jsxs)(`div`,{className:`p-6 max-w-3xl`,children:[(0,G.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,G.jsx)(A,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.back`)]}),(0,G.jsx)(o,{className:`mt-3`,children:(0,G.jsx)(g,{className:`py-8 text-center text-sm text-destructive`,children:m})})]});if(!s)return null;let{manifest:P,values:K}=s,q=P.icon?R(P.icon):null,J=M.title(z(P.label)),Y=M.description(P.description),X=async()=>{if(j.length!==0){p(!0),C(null);try{let e=await H(a,_);c({...s,values:{...K,...e.values}}),v({}),b({}),k.success(i(`console.settingsView.saved`))}catch(e){let t=e?.payload?.error;if(t?.code===`SETTINGS_LOCKED`){let e=L(t);k.error(e?i(`console.settingsView.lockedByEnv`,{key:e}):i(`console.settingsView.lockedByEnvNoKey`))}else if(t?.code===`SETTINGS_CRYPTO_UNAVAILABLE`){let e=te(t);C(e),k.error(e.subject?i(`console.settingsView.cryptoRefusalToast`,{subject:e.subject}):i(`console.settingsView.cryptoRefusalToastNoSubject`))}else{let n=D(t);n?.length&&b(Object.fromEntries(n.map(e=>[e.field,e.message]))),k.error(e?.message??i(`console.settingsView.saveFailed`))}}finally{p(!1)}}},Z=async e=>{p(!0);try{let t=await B(a,e,_);t.ok?k.success(t.message??i(`console.settingsView.actionSucceeded`)):k.error(t.message??i(`console.settingsView.actionFailed`))}catch(e){k.error(e?.message??i(`console.settingsView.actionFailed`))}finally{p(!1)}};return(0,G.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,G.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,G.jsx)(A,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.backToHub`)]}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[q?(0,G.jsx)(q,{className:`h-7 w-7 mt-0.5 text-muted-foreground`}):null,(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:J}),P.beta?(0,G.jsx)(x,{variant:`secondary`,children:i(`console.settingsHub.beta`)}):null]}),Y?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:Y}):null]})]}),P.helpText?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:P.helpText}):null,S?(0,G.jsx)(o,{className:`mt-4 border-destructive/50 bg-destructive/5`,children:(0,G.jsx)(g,{className:`py-4`,children:(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-3`,children:[(0,G.jsx)(I,{className:`h-5 w-5 mt-0.5 shrink-0 text-destructive`}),(0,G.jsxs)(`div`,{className:`flex-1 text-sm`,children:[(0,G.jsx)(`p`,{className:`font-medium text-destructive`,children:i(`console.settingsView.cryptoRefusalTitle`)}),(0,G.jsx)(`p`,{className:`mt-1`,children:S.subject?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:S.subject}),` `,i(`console.settingsView.cryptoRefusalSubjectSuffix`)]}):i(`console.settingsView.cryptoRefusalNoSubject`)}),S.prescription?(0,G.jsx)(`p`,{className:`mt-2 text-muted-foreground whitespace-pre-wrap`,children:S.prescription}):null]})]})})}):null,(0,G.jsx)(`div`,{className:`mt-6 divide-y`,children:P.specifiers.filter(e=>$(e.visible,E)).map((e,t)=>{let n=e.key,r=n?K[n]:void 0,i=n?n in _?_[n]:r?.value:void 0;return(0,G.jsx)(Q,{spec:e,resolved:r,value:i,onChange:e=>{n&&(v(t=>({...t,[n]:e})),b(e=>n in e?ee(e,n):e))},onAction:e.type===`action_button`?()=>Z(e.id??n??`test`):void 0,locked:r?.locked,saving:d,labels:M,error:n?y[n]:void 0},(n??`_layout_${t}`)+t)})}),j.length>0?(0,G.jsx)(`div`,{className:`fixed bottom-0 inset-x-0 bg-background/95 backdrop-blur border-t shadow-lg z-40`,children:(0,G.jsxs)(`div`,{className:`max-w-3xl mx-auto px-6 py-3 flex items-center justify-between`,children:[(0,G.jsx)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-unsaved-count`,children:i(`console.settingsView.unsavedCount`,{count:j.length})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:()=>{v({}),b({}),C(null)},disabled:d,children:[(0,G.jsx)(F,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.discard`)]}),(0,G.jsxs)(w,{onClick:X,disabled:d,children:[d?(0,G.jsx)(N,{className:`h-4 w-4 mr-1 animate-spin`}):null,i(`console.settingsView.saveChanges`)]})]})]})}):null]})}export{ne as SettingsView};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{$n as a,Bn as o,Br as s,Hr as c,In as l,Ln as u,Rn as d,Un as f,Vn as p,Vr as m,Wn as h,Yn as g,Zt as _,bi as v,ci as y,cn as b,ii as x,kn as S,li as C,ln as w,ui as T,zn as E}from"./ui-components-D8wcRNrt.js";import{a as D}from"./framework-CAuH4h0L.js";import{w as O}from"./i18n-runtime-CdWyaiOD.js";import{r as k}from"./vendor-ui-utils-DIUdEYii.js";import{t as A}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as j}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as M}from"./vendor-icon-info-DBwRTfSE.js";import{t as N}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as P}from"./vendor-icon-lock-B_psRnly.js";import{t as F}from"./vendor-icon-rotate-ccw-lr5YKsxC.js";import{t as I}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{a as L,c as R,n as z,o as B,r as V,s as H,t as U}from"./useSettingsLabel-CSpBDTdy.js";var W=e(i(),1),G=r();function K({reason:e,className:t}){return(0,G.jsxs)(x,{variant:`outline`,className:`gap-1 border-amber-300 bg-amber-50 text-amber-900 ${t??``}`,title:e??`Pinned by environment variable — cannot be edited from the UI.`,children:[(0,G.jsx)(P,{className:`h-3 w-3`}),`Locked by env`]})}function q({resolved:e,labels:t}){let n=e.cascadeChain;if(!n||n.length===0)return null;let r=n.find(e=>e.effective)??n[n.length-1],i=n.find(e=>e!==r&&e.value!==null&&e.value!==void 0),a=e=>t?.sourceLabel?.(e)??e;return r.scope!=="default"&&r.scope!==`user`&&r.scope!==`tenant`?(0,G.jsxs)(x,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,G.jsxs)(x,{variant:`outline`,className:`text-amber-700 border-amber-300 text-[10px]`,children:[`Overrides `,a(i.scope)]}):null}function J({spec:e,resolved:t,labelText:n,labels:r}){return(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(a,{className:`text-sm font-medium`,children:[n,e.required?(0,G.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`}):null]}),e.deprecated?(0,G.jsxs)(x,{variant:`outline`,className:`text-amber-700 border-amber-300`,children:[`Deprecated`,e.replacedBy?` → ${e.replacedBy}`:``]}):null,t?.locked?(0,G.jsx)(K,{reason:t.lockedReason}):null,t&&!t.locked?(0,G.jsx)(q,{resolved:t,labels:r}):null,t?.source&&t.source!=="default"&&!t.locked?(0,G.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r?.sourceLabel?.(t.source)??t.source}):null]})}function Y({description:e}){return e?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e}):null}function X({id:e,message:t}){return(0,G.jsx)(`p`,{id:e,role:`alert`,className:`text-xs text-destructive mt-1`,children:t})}function Z({id:e,value:t,options:n,disabled:r,onChange:i,...a}){let o=`${e}-domain`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{id:e,type:`text`,list:n.length>0?o:void 0,value:t==null?``:String(t),disabled:r,onChange:e=>i(e.target.value),...a}),n.length>0?(0,G.jsx)(`datalist`,{id:o,children:n.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}):null]})}function Q(e){let{spec:t,resolved:n,value:r,onChange:i,onAction:c,locked:m,saving:x,labels:S,error:D}=e,k=(0,W.useId)(),{t:A}=O(),N=!!(m||x),P=z(t.label),F=t.key&&S?S.fieldLabel(t.key,P):P,I=t.key&&S?S.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&S?S.groupTitle(t.id,P):P,n=t.id&&S?S.groupDescription(t.id,t.description):t.description;return(0,G.jsxs)(`div`,{className:`pt-6 pb-2`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight text-foreground/90`,children:e}),n?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n}):null,(0,G.jsx)(l,{className:`mt-3`})]})}if(t.type===`info_banner`){let e=t.bannerSeverity===`error`?`destructive`:`default`;return(0,G.jsxs)(y,{variant:e,className:`my-2`,children:[(0,G.jsx)(M,{className:`h-4 w-4`}),(0,G.jsx)(T,{children:P}),t.bannerText?(0,G.jsx)(C,{children:t.bannerText}):null]})}if(t.type===`child_pane`)return(0,G.jsxs)(`a`,{href:`#/settings/${t.childNamespace}`,className:`flex items-center justify-between rounded-md border border-border bg-card px-4 py-3 hover:bg-accent transition-colors`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:P}),t.description?(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,G.jsx)(j,{className:`h-4 w-4 text-muted-foreground`})]});if(t.type===`title_value`)return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:S}),(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:String(r??`—`)})]});if(t.type===`action_button`){let e=t.icon?R(t.icon):null,n=t.id??t.key??`test`,r=S?S.actionLabel(n,P):P;return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:r}),t.description?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:t.description}):null]}),(0,G.jsxs)(v,{size:`sm`,variant:`secondary`,onClick:c,disabled:x,children:[e?(0,G.jsx)(e,{className:`h-4 w-4 mr-1.5`}):null,r]})]})}let L=`${k}-error`,B=e=>(0,G.jsxs)(`div`,{className:`space-y-1.5 py-2`,children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:S}),D&&(0,W.isValidElement)(e)?(0,W.cloneElement)(e,{"aria-invalid":!0,"aria-describedby":L}):e,D?(0,G.jsx)(X,{id:L,message:D}):(0,G.jsx)(Y,{description:I})]}),V=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!S?n:S.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return B((0,G.jsx)(g,{id:k,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:N,onChange:e=>i(e.target.value)}));case`password`:return B((0,G.jsx)(g,{id:k,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:N,onChange:e=>i(e.target.value)}));case`textarea`:return B((0,G.jsx)(_,{id:k,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:N,onChange:e=>i(e.target.value)}));case`number`:return B((0,G.jsx)(g,{id:k,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:N,onChange:e=>i(e.target.value===``?null:Number(e.target.value))}));case`toggle`:return(0,G.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(J,{spec:t,resolved:n,labelText:F,labels:S}),(0,G.jsx)(Y,{description:I})]}),(0,G.jsx)(b,{id:k,checked:!!r,disabled:N,onCheckedChange:e=>i(e)})]});case`select`:return t.valueDomain?B((0,G.jsx)(Z,{id:k,value:r,disabled:N,onChange:i,options:(t.options??[]).map(e=>({value:String(e.value),label:V(e)}))})):B((0,G.jsxs)(u,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:N,children:[(0,G.jsx)(o,{id:k,children:(0,G.jsx)(p,{placeholder:A(`common.select`,{defaultValue:`Select…`})})}),(0,G.jsx)(d,{children:t.options?.map(e=>(0,G.jsx)(E,{value:String(e.value),children:V(e)},String(e.value)))})]}));case`radio`:return B((0,G.jsx)(f,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:N,children:t.options?.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,G.jsx)(h,{value:String(e.value),id:`${k}-${e.value}`}),(0,G.jsx)(a,{htmlFor:`${k}-${e.value}`,className:`text-sm font-normal`,children:V(e)})]},String(e.value)))}));case`multiselect`:{let e=Array.isArray(r)?r:[];return B((0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.options?.map(t=>{let n=String(t.value),r=e.map(String).includes(n);return(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,G.jsx)(s,{checked:r,disabled:N,onCheckedChange:t=>{let r=new Set(e.map(String));t?r.add(n):r.delete(n),i(Array.from(r))}}),V(t)]},n)})}))}case`slider`:return B((0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(w,{value:[Number(r??t.min??0)],min:t.min??0,max:t.max??100,step:t.step??1,disabled:N,onValueChange:e=>i(e[0]),className:`flex-1`}),(0,G.jsx)(`span`,{className:`text-sm tabular-nums w-12 text-right`,children:String(r??t.min??0)})]}));case`color`:return B((0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(g,{id:k,type:`color`,value:r??`#000000`,disabled:N,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,G.jsx)(g,{value:r??``,disabled:N,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return B((0,G.jsx)(_,{id:k,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:N,onChange:e=>i(e.target.value)}));default:return B((0,G.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Unsupported specifier type: `,t.type]}))}}function $(e,t){if(!e)return!0;let n=e.trim().match(/^\$\{(.+)\}$/);if(!n)return!0;try{return!!Function(`data`,`with (data) { return (${n[1]}); }`)(t)}catch{return!0}}function ee(e,t){let{[t]:n,...r}=e;return r}function te(e){let t=e??{},n=e=>typeof e==`string`&&e.length>0?e:void 0,r=t.details&&typeof t.details==`object`?t.details:void 0,i=n(r?.namespace),a=n(r?.key);return{subject:a?i?`${i}.${a}`:a:void 0,prescription:n(t.message)}}function ne(){let e=n(),r=t(),{t:i}=O(),a=e.namespace??``,[o,s]=(0,W.useState)(null),[l,u]=(0,W.useState)(!0),[d,f]=(0,W.useState)(!1),[p,h]=(0,W.useState)(null),[g,_]=(0,W.useState)({}),[y,b]=(0,W.useState)({}),[C,w]=(0,W.useState)(null),T=(0,W.useCallback)(async()=>{u(!0),h(null);try{let e=await V(a);s(e),_({}),b({}),w(null)}catch(e){h(e?.message??i(`console.settingsView.loadError`))}finally{u(!1)}},[a,i]);(0,W.useEffect)(()=>{a&&T()},[a,T]);let E=(0,W.useMemo)(()=>{let e={};if(!o)return e;for(let[t,n]of Object.entries(o.values))e[t]=n.value;return{...e,...g}},[o,g]),j=(0,W.useMemo)(()=>Object.keys(g),[g]),M=U(a);if(!a)return(0,G.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:i(`console.settingsView.noNamespace`)});if(l)return(0,G.jsxs)(`div`,{className:`p-6 space-y-3 max-w-3xl`,children:[(0,G.jsx)(S,{className:`h-8 w-1/3`}),(0,G.jsx)(S,{className:`h-4 w-2/3`}),(0,G.jsx)(S,{className:`h-32 w-full`}),(0,G.jsx)(S,{className:`h-32 w-full`})]});if(p)return(0,G.jsxs)(`div`,{className:`p-6 max-w-3xl`,children:[(0,G.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,G.jsx)(A,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.back`)]}),(0,G.jsx)(m,{className:`mt-3`,children:(0,G.jsx)(c,{className:`py-8 text-center text-sm text-destructive`,children:p})})]});if(!o)return null;let{manifest:P,values:K}=o,q=P.icon?R(P.icon):null,J=M.title(z(P.label)),Y=M.description(P.description),X=async()=>{if(j.length!==0){f(!0),w(null);try{let e=await H(a,g);s({...o,values:{...K,...e.values}}),_({}),b({}),k.success(i(`console.settingsView.saved`))}catch(e){let t=e?.payload?.error;if(t?.code===`SETTINGS_LOCKED`){let e=L(t);k.error(e?i(`console.settingsView.lockedByEnv`,{key:e}):i(`console.settingsView.lockedByEnvNoKey`))}else if(t?.code===`SETTINGS_CRYPTO_UNAVAILABLE`){let e=te(t);w(e),k.error(e.subject?i(`console.settingsView.cryptoRefusalToast`,{subject:e.subject}):i(`console.settingsView.cryptoRefusalToastNoSubject`))}else{let n=D(t);n?.length&&b(Object.fromEntries(n.map(e=>[e.field,e.message]))),k.error(e?.message??i(`console.settingsView.saveFailed`))}}finally{f(!1)}}},Z=async e=>{f(!0);try{let t=await B(a,e,g);t.ok?k.success(t.message??i(`console.settingsView.actionSucceeded`)):k.error(t.message??i(`console.settingsView.actionFailed`))}catch(e){k.error(e?.message??i(`console.settingsView.actionFailed`))}finally{f(!1)}};return(0,G.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,G.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,G.jsx)(A,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.backToHub`)]}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[q?(0,G.jsx)(q,{className:`h-7 w-7 mt-0.5 text-muted-foreground`}):null,(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:J}),P.beta?(0,G.jsx)(x,{variant:`secondary`,children:i(`console.settingsHub.beta`)}):null]}),Y?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:Y}):null]})]}),P.helpText?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:P.helpText}):null,C?(0,G.jsx)(m,{className:`mt-4 border-destructive/50 bg-destructive/5`,children:(0,G.jsx)(c,{className:`py-4`,children:(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-3`,children:[(0,G.jsx)(I,{className:`h-5 w-5 mt-0.5 shrink-0 text-destructive`}),(0,G.jsxs)(`div`,{className:`flex-1 text-sm`,children:[(0,G.jsx)(`p`,{className:`font-medium text-destructive`,children:i(`console.settingsView.cryptoRefusalTitle`)}),(0,G.jsx)(`p`,{className:`mt-1`,children:C.subject?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:C.subject}),` `,i(`console.settingsView.cryptoRefusalSubjectSuffix`)]}):i(`console.settingsView.cryptoRefusalNoSubject`)}),C.prescription?(0,G.jsx)(`p`,{className:`mt-2 text-muted-foreground whitespace-pre-wrap`,children:C.prescription}):null]})]})})}):null,(0,G.jsx)(`div`,{className:`mt-6 divide-y`,children:P.specifiers.filter(e=>$(e.visible,E)).map((e,t)=>{let n=e.key,r=n?K[n]:void 0,i=n?n in g?g[n]:r?.value:void 0;return(0,G.jsx)(Q,{spec:e,resolved:r,value:i,onChange:e=>{n&&(_(t=>({...t,[n]:e})),b(e=>n in e?ee(e,n):e))},onAction:e.type===`action_button`?()=>Z(e.id??n??`test`):void 0,locked:r?.locked,saving:d,labels:M,error:n?y[n]:void 0},(n??`_layout_${t}`)+t)})}),j.length>0?(0,G.jsx)(`div`,{className:`fixed bottom-0 inset-x-0 bg-background/95 backdrop-blur border-t shadow-lg z-40`,children:(0,G.jsxs)(`div`,{className:`max-w-3xl mx-auto px-6 py-3 flex items-center justify-between`,children:[(0,G.jsx)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-unsaved-count`,children:i(`console.settingsView.unsavedCount`,{count:j.length})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>{_({}),b({}),w(null)},disabled:d,children:[(0,G.jsx)(F,{className:`h-4 w-4 mr-1`}),` `,i(`console.settingsView.discard`)]}),(0,G.jsxs)(v,{onClick:X,disabled:d,children:[d?(0,G.jsx)(N,{className:`h-4 w-4 mr-1 animate-spin`}):null,i(`console.settingsView.saveChanges`)]})]})]})}):null]})}export{ne as SettingsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vendor-react-BggL7APJ.js";import{Dn as t,En as n,On as r,
|
|
1
|
+
import{t as e}from"./vendor-react-BggL7APJ.js";import{Dn as t,En as n,On as r,Si as i,Tn as a,ii as o,kn as s}from"./ui-components-D8wcRNrt.js";import{w as c}from"./i18n-runtime-CdWyaiOD.js";import{t as l}from"./vendor-icon-archive-C7XW5GSw.js";import{t as u}from"./vendor-icon-lock-B_psRnly.js";import{t as d}from"./vendor-icon-settings-2-BHIWdy1J.js";import{t as f}from"./vendor-icon-shield-alert-CJYtPI9w.js";var p=e(),m={config:{icon:d,i18nKey:`config`,short:`Admin config`,title:`Administrator configuration`,body:()=>`These rows define how the platform behaves at runtime. Author them here; the runtime data they produce lives in a separate table.`,tone:`border-sky-300/60 bg-sky-50 text-sky-900 hover:bg-sky-100 dark:border-sky-500/40 dark:bg-sky-950/40 dark:text-sky-100`},"engine-owned":{icon:u,i18nKey:`system`,short:`System-managed`,title:`Managed by the platform`,body:()=>`Rows here are created automatically when actions run on the source record. The list below is a read-only monitoring surface — row-level actions (Approve, Recall, Resend, …) live on each row.`,tone:`border-slate-300/60 bg-slate-50 text-slate-900 hover:bg-slate-100 dark:border-slate-500/40 dark:bg-slate-950/40 dark:text-slate-100`},"system-data":{icon:d,i18nKey:`systemWritable`,short:`Platform schema`,title:`Platform-defined, admin-writable`,body:()=>`This object's schema is defined by the platform, but its rows are yours to create and edit here. Who may write is governed by delegated administration and record-level security, not by this badge.`,tone:`border-slate-300/60 bg-slate-50 text-slate-900 hover:bg-slate-100 dark:border-slate-500/40 dark:bg-slate-950/40 dark:text-slate-100`},"append-only":{icon:l,i18nKey:`appendOnly`,short:`Read-only · Audit log`,title:`Read-only historical record`,body:()=>`Immutable audit log. Rows cannot be created, edited, or deleted from the UI — they're written by the platform when events occur. Use Export to download for compliance review.`,tone:`border-zinc-300/60 bg-zinc-50 text-zinc-900 hover:bg-zinc-100 dark:border-zinc-500/40 dark:bg-zinc-950/40 dark:text-zinc-100`},"better-auth":{icon:f,i18nKey:`betterAuth`,short:`Identity`,title:`Managed by the identity provider`,body:e=>`This object's schema is owned by ${e}. Direct edits bypass password hashing, session validation, two-factor checks, and audit hooks. Manage these records through your authentication provider's sign-in, invitation, and security flows instead.`,tone:`border-amber-300/60 bg-amber-50 text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-100`}};function h({managedBy:e,label:s,className:l}){let{t:u}=c();if(!e||e===`platform`)return null;let d=m[e];if(!d)return null;let f=d.icon,h=s??`better-auth`,g=u(`managedByBadge.${d.i18nKey}.short`,{defaultValue:d.short}),_=u(`managedByBadge.${d.i18nKey}.title`,{defaultValue:d.title}),v=u(`managedByBadge.${d.i18nKey}.body`,{defaultValue:d.body(h),provider:h});return(0,p.jsx)(t,{delayDuration:200,children:(0,p.jsxs)(a,{children:[(0,p.jsx)(r,{asChild:!0,children:(0,p.jsxs)(o,{variant:`outline`,"data-testid":`managed-by-badge`,"data-bucket":e,className:i(`gap-1 font-normal text-[11px] leading-none py-0.5 px-1.5 cursor-help`,d.tone,l),children:[(0,p.jsx)(f,{className:`h-3 w-3`,"aria-hidden":`true`}),(0,p.jsx)(`span`,{children:g})]})}),(0,p.jsxs)(n,{side:`bottom`,align:`start`,className:`max-w-xs text-xs leading-relaxed`,children:[(0,p.jsx)(`p`,{className:`font-semibold mb-1`,children:_}),(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:v})]})]})})}function g({fields:e=8,columns:t=2}){return(0,p.jsxs)(`div`,{className:`w-full space-y-6 p-4 sm:p-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(s,{className:`h-8 w-8 rounded`}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{className:`h-6 w-48`}),(0,p.jsx)(s,{className:`h-4 w-32`})]})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(s,{className:`h-9 w-20`}),(0,p.jsx)(s,{className:`h-9 w-20`})]})]}),(0,p.jsx)(s,{className:`h-5 w-24`}),(0,p.jsx)(`div`,{className:`grid grid-cols-1 ${t===2?`md:grid-cols-2`:``} gap-4`,children:Array.from({length:e}).map((e,t)=>(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{className:`h-4 w-24`}),(0,p.jsx)(s,{className:`h-9 w-full`})]},`field-${t}`))}),(0,p.jsxs)(`div`,{className:`space-y-3 pt-4 border-t`,children:[(0,p.jsx)(s,{className:`h-5 w-32`}),(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,p.jsx)(s,{className:`h-8 w-8 rounded-full`}),(0,p.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,p.jsx)(s,{className:`h-4 w-40`}),(0,p.jsx)(s,{className:`h-3 w-24`})]})]},`related-${t}`))})]})]})}export{h as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$r as e,Jr as t,Yr as n,Zr as r}from"./ui-components-D8wcRNrt.js";var i={lessThanXSeconds:{one:`minder as 'n sekonde`,other:`minder as {{count}} sekondes`},xSeconds:{one:`1 sekonde`,other:`{{count}} sekondes`},halfAMinute:`'n halwe minuut`,lessThanXMinutes:{one:`minder as 'n minuut`,other:`minder as {{count}} minute`},xMinutes:{one:`'n minuut`,other:`{{count}} minute`},aboutXHours:{one:`ongeveer 1 uur`,other:`ongeveer {{count}} ure`},xHours:{one:`1 uur`,other:`{{count}} ure`},xDays:{one:`1 dag`,other:`{{count}} dae`},aboutXWeeks:{one:`ongeveer 1 week`,other:`ongeveer {{count}} weke`},xWeeks:{one:`1 week`,other:`{{count}} weke`},aboutXMonths:{one:`ongeveer 1 maand`,other:`ongeveer {{count}} maande`},xMonths:{one:`1 maand`,other:`{{count}} maande`},aboutXYears:{one:`ongeveer 1 jaar`,other:`ongeveer {{count}} jaar`},xYears:{one:`1 jaar`,other:`{{count}} jaar`},overXYears:{one:`meer as 1 jaar`,other:`meer as {{count}} jaar`},almostXYears:{one:`byna 1 jaar`,other:`byna {{count}} jaar`}},a=(e,t,n)=>{let r,a=i[e];return r=typeof a==`string`?a:t===1?a.one:a.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`oor `+r:r+` gelede`:r},o={date:e({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`yyyy/MM/dd`},defaultWidth:`full`}),time:e({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:e({formats:{full:`{{date}} 'om' {{time}}`,long:`{{date}} 'om' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},s={lastWeek:`'verlede' eeee 'om' p`,yesterday:`'gister om' p`,today:`'vandag om' p`,tomorrow:`'môre om' p`,nextWeek:`eeee 'om' p`,other:`P`},c={code:`af`,formatDistance:a,formatLong:o,formatRelative:(e,t,n,r)=>s[e],localize:{ordinalNumber:e=>{let t=Number(e),n=t%100;if(n<20)switch(n){case 1:case 8:return t+`ste`;default:return t+`de`}return t+`ste`},era:r({values:{narrow:[`vC`,`nC`],abbreviated:[`vC`,`nC`],wide:[`voor Christus`,`na Christus`]},defaultWidth:`wide`}),quarter:r({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`K1`,`K2`,`K3`,`K4`],wide:[`1ste kwartaal`,`2de kwartaal`,`3de kwartaal`,`4de kwartaal`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:r({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mrt`,`Apr`,`Mei`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`],wide:[`Januarie`,`Februarie`,`Maart`,`April`,`Mei`,`Junie`,`Julie`,`Augustus`,`September`,`Oktober`,`November`,`Desember`]},defaultWidth:`wide`}),day:r({values:{narrow:[`S`,`M`,`D`,`W`,`D`,`V`,`S`],short:[`So`,`Ma`,`Di`,`Wo`,`Do`,`Vr`,`Sa`],abbreviated:[`Son`,`Maa`,`Din`,`Woe`,`Don`,`Vry`,`Sat`],wide:[`Sondag`,`Maandag`,`Dinsdag`,`Woensdag`,`Donderdag`,`Vrydag`,`Saterdag`]},defaultWidth:`wide`}),dayPeriod:r({values:{narrow:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`middaguur`,morning:`oggend`,afternoon:`middag`,evening:`laat middag`,night:`aand`},abbreviated:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`middaguur`,morning:`oggend`,afternoon:`middag`,evening:`laat middag`,night:`aand`},wide:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`middaguur`,morning:`oggend`,afternoon:`middag`,evening:`laat middag`,night:`aand`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`uur die middag`,morning:`uur die oggend`,afternoon:`uur die middag`,evening:`uur die aand`,night:`uur die aand`},abbreviated:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`uur die middag`,morning:`uur die oggend`,afternoon:`uur die middag`,evening:`uur die aand`,night:`uur die aand`},wide:{am:`vm`,pm:`nm`,midnight:`middernag`,noon:`uur die middag`,morning:`uur die oggend`,afternoon:`uur die middag`,evening:`uur die aand`,night:`uur die aand`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:t({matchPattern:/^(\d+)(ste|de)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:n({matchPatterns:{narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?C\.?)/,wide:/^((voor|na) Christus)/},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/,/^n/]},defaultParseWidth:`any`}),quarter:n({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234](st|d)e kwartaal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:n({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(Jan|Feb|Mrt|Apr|Mei|Jun|Jul|Aug|Sep|Okt|Nov|Dec)\.?/i,wide:/^(Januarie|Februarie|Maart|April|Mei|Junie|Julie|Augustus|September|Oktober|November|Desember)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^J/i,/^F/i,/^M/i,/^A/i,/^M/i,/^J/i,/^J/i,/^A/i,/^S/i,/^O/i,/^N/i,/^D/i],any:[/^Jan/i,/^Feb/i,/^Mrt/i,/^Apr/i,/^Mei/i,/^Jun/i,/^Jul/i,/^Aug/i,/^Sep/i,/^Okt/i,/^Nov/i,/^Dec/i]},defaultParseWidth:`any`}),day:n({matchPatterns:{narrow:/^[smdwv]/i,short:/^(So|Ma|Di|Wo|Do|Vr|Sa)/i,abbreviated:/^(Son|Maa|Din|Woe|Don|Vry|Sat)/i,wide:/^(Sondag|Maandag|Dinsdag|Woensdag|Donderdag|Vrydag|Saterdag)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^S/i,/^M/i,/^D/i,/^W/i,/^D/i,/^V/i,/^S/i],any:[/^So/i,/^Ma/i,/^Di/i,/^Wo/i,/^Do/i,/^Vr/i,/^Sa/i]},defaultParseWidth:`any`}),dayPeriod:n({matchPatterns:{any:/^(vm|nm|middernag|(?:uur )?die (oggend|middag|aand))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^vm/i,pm:/^nm/i,midnight:/^middernag/i,noon:/^middaguur/i,morning:/oggend/i,afternoon:/middag/i,evening:/laat middag/i,night:/aand/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};export{c as af,c as default};
|