@objectstack/console 17.3.0 → 17.4.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 +87 -0
- package/dist/.objectui-sha +1 -1
- package/dist/assets/{ActionResultDialog-CQwenjVA.js → ActionResultDialog-Bsr2GS71.js} +1 -1
- package/dist/assets/{AiPendingActionsPage-7gZ8zlOy.js → AiPendingActionsPage-DB-UVcdM.js} +1 -1
- package/dist/assets/{ApiConsolePage-DUF0ysH7.js → ApiConsolePage-Bzqo2owc.js} +1 -1
- package/dist/assets/{AppDocsIndex-CP_AVG4X.js → AppDocsIndex-KhVqdZ-P.js} +1 -1
- package/dist/assets/{AppManagementPage-BJktnoa5.js → AppManagementPage-CsZ0LMQn.js} +1 -1
- package/dist/assets/{ApprovalsInboxPage-DlnxY-uy.js → ApprovalsInboxPage-D_LOnhJ7.js} +1 -1
- package/dist/assets/{AuditLogPage-DIJPRjji.js → AuditLogPage-B9eqwuzl.js} +1 -1
- package/dist/assets/{ComponentNavView-C84QByT7.js → ComponentNavView-DeokLfkW.js} +1 -1
- package/dist/assets/{CreateViewDialog-Zbd9Cagm.js → CreateViewDialog-BMdQ4ZYy.js} +1 -1
- package/dist/assets/{DashboardView-UyKHklBx.js → DashboardView-DHZboRi8.js} +1 -1
- package/dist/assets/{DeveloperHubPage-BRyNdrCJ.js → DeveloperHubPage-C_VYirN0.js} +1 -1
- package/dist/assets/{DocPage-Bx8ZXCYt.js → DocPage-_9x-3Dbi.js} +1 -1
- package/dist/assets/{DocShell-Ipy_IDvh.js → DocShell-D4dSPfBz.js} +1 -1
- package/dist/assets/{DocsIndex-CmY-7OQR.js → DocsIndex-CJVRa_hE.js} +1 -1
- package/dist/assets/{DocsLayout-BNsSvaz2.js → DocsLayout-C-tYgUZv.js} +1 -1
- package/dist/assets/{DocsSlug-Cb_NMM1k.js → DocsSlug-DmyGpfEy.js} +1 -1
- package/dist/assets/{ExpressionProvider-DqGWVuxV.js → ExpressionProvider-B6z09kM6.js} +1 -1
- package/dist/assets/{FlowRunsPage-B6ustUgi.js → FlowRunsPage-OjGJi-JU.js} +1 -1
- package/dist/assets/{IntegrationsPage-chOxmiyU.js → IntegrationsPage-CrDMDe62.js} +1 -1
- package/dist/assets/{InterfaceListPage-DVETnQm5.js → InterfaceListPage-P3y6hqTX.js} +1 -1
- package/dist/assets/{MarketplaceInstalledPage-DA5pjhAz.js → MarketplaceInstalledPage-CQek7WnV.js} +1 -1
- package/dist/assets/{MarketplacePackagePage-dCIVHBFi.js → MarketplacePackagePage-DL2ivKSc.js} +1 -1
- package/dist/assets/{MarketplacePage-wJb6g1p7.js → MarketplacePage-B-6EokyB.js} +1 -1
- package/dist/assets/{MetadataInspector-Cu-n1FYz.js → MetadataInspector-IQGUoLyp.js} +1 -1
- package/dist/assets/{ObjectDataPage-CP-YSZYQ.js → ObjectDataPage-Bmc3RQhM.js} +1 -1
- package/dist/assets/{PageView-B1_ibRuM.js → PageView-DzUZqB_h.js} +1 -1
- package/dist/assets/{ProfilePage-DEr5iZVB.js → ProfilePage-NklCqPxc.js} +1 -1
- package/dist/assets/{PublicFormsPage-CBcKQbNl.js → PublicFormsPage-CItIvcLQ.js} +1 -1
- package/dist/assets/RecordDetailView-XWxuegfV.js +3 -0
- package/dist/assets/{RecordFormPage-CGQlYWDk.js → RecordFormPage-B-yrhs7J.js} +1 -1
- package/dist/assets/{ReportDefaultInspector-R_p6YStL.js → ReportDefaultInspector-D5Kro5_t.js} +1 -1
- package/dist/assets/{ReportView-BTMrtcGH.js → ReportView-COpZ8PQT.js} +1 -1
- package/dist/assets/{RuntimeDraftBar-agGU39FL.js → RuntimeDraftBar-CSVtuByp.js} +1 -1
- package/dist/assets/{SchemaForm-DJbupOno.js → SchemaForm-DIsxxOZF.js} +1 -1
- package/dist/assets/{SearchResultsPage-CHhZUc6L.js → SearchResultsPage-B2r6kgni.js} +1 -1
- package/dist/assets/{SettingsHub-BGLR_gS7.js → SettingsHub-DQz2HDtZ.js} +1 -1
- package/dist/assets/{SettingsView-Bq-7Zkzs.js → SettingsView-BfOEalDW.js} +1 -1
- package/dist/assets/{SkeletonDetail-B4-UKxai.js → SkeletonDetail-DMOa5zcl.js} +1 -1
- package/dist/assets/{SystemHubPage-CVZVag1e.js → SystemHubPage-DM2VRSIP.js} +1 -1
- package/dist/assets/{abnfDiagram-VCTEODGH-DUS5D5dU.js → abnfDiagram-VCTEODGH-DaPlU6Hz.js} +1 -1
- package/dist/assets/{app-shell-eager-leaves-BB0oaPx6.js → app-shell-eager-leaves-wjbiJgVZ.js} +1 -1
- package/dist/assets/architectureDiagram-5GKGNRK7-Cq014PwG.js +36 -0
- package/dist/assets/{blockDiagram-OSKFZWR5-Bz2hnVmp.js → blockDiagram-OSKFZWR5-vtlcoeZc.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-DU3u1Y6c.js → c4Diagram-7LVT6UL2-BrdwRG2M.js} +1 -1
- package/dist/assets/channel-D2IgUFnY.js +1 -0
- package/dist/assets/{chunk-3NF5O7KM-B8Q7HUio.js → chunk-3NF5O7KM-CjWAf_Jo.js} +1 -1
- package/dist/assets/{chunk-4HAMMTFA-BPKwX4iB.js → chunk-4HAMMTFA-BtV_msXT.js} +1 -1
- package/dist/assets/chunk-75Z2AOVW-DdRL9yNr.js +2 -0
- package/dist/assets/chunk-CLGD4ZFX-De9kMAXh.js +1 -0
- package/dist/assets/{chunk-DU6HZSFF-BkY4hAzc.js → chunk-DU6HZSFF-DqjylQO-.js} +1 -1
- package/dist/assets/chunk-F27PBJKO-tEB_K-iD.js +1 -0
- package/dist/assets/{chunk-GMAD6QVW-DZo_NykZ.js → chunk-GMAD6QVW-BMzd_HHM.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-9ELY9S6X.js → chunk-GVQU2GXP-B1p1nHC0.js} +1 -1
- package/dist/assets/{chunk-H2I77ZZE-vCr_buP7.js → chunk-H2I77ZZE-ioXC4dHO.js} +1 -1
- package/dist/assets/{chunk-HLEWEB6X-iPkY2ESt.js → chunk-HLEWEB6X-zZ3ZMup3.js} +1 -1
- package/dist/assets/chunk-L3NEJ4N5-DePXufTQ.js +1 -0
- package/dist/assets/{chunk-LQGUR6SS-iVI0GACK.js → chunk-LQGUR6SS-BUWUp_dz.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-DcRwXCQD.js → chunk-OSK3NFVY-L7nTUJKT.js} +2 -2
- package/dist/assets/{chunk-P2QGCYS3-nx2-dM5t.js → chunk-P2QGCYS3-BG-i3rdI.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-BxLOacOG.js → chunk-POPQ4Y6H-DLEB8EqK.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-2mst9kZu.js → chunk-PWAF6VOD-Be_prJjm.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-C3BMpr4x.js → chunk-SVP7TREG-BdJpxJji.js} +1 -1
- package/dist/assets/chunk-XXDRQBXY-CEXsCcSu.js +1 -0
- package/dist/assets/{chunk-ZLD2IHE6-ZFqtFJbj.js → chunk-ZLD2IHE6-BLIPZykR.js} +1 -1
- package/dist/assets/classDiagram-CYGNFDIV-BielDdJQ.js +1 -0
- package/dist/assets/classDiagram-v2-TLXNO2FR-BielDdJQ.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-CnLWv9XE.js +1 -0
- package/dist/assets/{createDerive-Best2JCj.js → createDerive-DtfnFzGm.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-Lnly8IJd.js → cynefinDiagram-5FMLGOSQ-Do1SZz4I.js} +1 -1
- package/dist/assets/{dagre-OS7QT2EB-CdXLxmTK.js → dagre-OS7QT2EB-CqmZ9Y9O.js} +1 -1
- package/dist/assets/data-adapter-1YRpH3h_.js +5 -0
- package/dist/assets/{default-inspector-registry-DeEG98bO.js → default-inspector-registry-CmSpNwTr.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-DE8I3gxQ.js → diagram-S7CK7UJ4-CMpcDWop.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-D2xQpbEq.js → diagram-UQ7AKVKN-DLK_4yej.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DnttDSlO.js → diagram-VSXAHHWV-MAILxw0S.js} +1 -1
- package/dist/assets/diagram-VX7I27RA-DGiXGVX7.js +24 -0
- package/dist/assets/{diagram-Z3DM3KII-BgB9f0Nv.js → diagram-Z3DM3KII-BywboeGI.js} +1 -1
- package/dist/assets/dist-B88JFSFg.js +5 -0
- package/dist/assets/{ebnfDiagram-PWID7BFC-32WvKbS2.js → ebnfDiagram-PWID7BFC-DdMLbnuP.js} +1 -1
- package/dist/assets/{erDiagram-2YWLMYGG-Dwf8uAdl.js → erDiagram-2YWLMYGG-O6raGx2P.js} +1 -1
- package/dist/assets/flowDiagram-T62WH6J4-CkAxOnqU.js +1 -0
- package/dist/assets/framework-DFE_Mws9.js +36 -0
- package/dist/assets/{ganttDiagram-EL5Y4UJY-DqYIE0Cu.js → ganttDiagram-EL5Y4UJY-Dijdjc50.js} +2 -2
- package/dist/assets/{getIcon-CgyYxSEC.js → getIcon-B4Pp7Q-0.js} +1 -1
- package/dist/assets/gitGraphDiagram-WWUBYQGX-Cfl4OIGG.js +106 -0
- package/dist/assets/{highlighted-body-OFNGDK62-BxO9mjPI.js → highlighted-body-OFNGDK62-BlqGRgbU.js} +1 -1
- package/dist/assets/{i18n-Cfqor-xb.js → i18n-DGcOKnTh.js} +1 -1
- package/dist/assets/{i18n-locales-Bz4c8KXc.js → i18n-locales-BBA090ve.js} +10 -10
- package/dist/assets/index-C5Fu9Kda.css +2 -0
- package/dist/assets/index-ClPLLRzK.js +20 -0
- package/dist/assets/{infoDiagram-FKFFQAWI-Cr1-5_Am.js → infoDiagram-FKFFQAWI-oOVNWlVA.js} +1 -1
- package/dist/assets/{infrastructure-CIpDEFyQ.js → infrastructure-B4zG1jNa.js} +2 -2
- package/dist/assets/{ishikawaDiagram-5VMMS53U-Bsjx7BsE.js → ishikawaDiagram-5VMMS53U-BUfTfup1.js} +1 -1
- package/dist/assets/{journeyDiagram-EYS64GPL-1scn5Z5c.js → journeyDiagram-EYS64GPL-4fyU8Ui9.js} +2 -2
- package/dist/assets/{kanban-definition-UXKFOSKX-DjLQAv5U.js → kanban-definition-UXKFOSKX-qwquHo2y.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-_UhQGe8N.js +1 -0
- package/dist/assets/{mermaid.core-pW40dd4u.js → mermaid.core-RfBGJVq5.js} +2 -2
- package/dist/assets/{metadata-admin-pawEBYI9.js → metadata-admin-Bo-vWW2Z.js} +3 -3
- package/dist/assets/{mindmap-definition-THT77NOG-CUcYMB9H.js → mindmap-definition-THT77NOG-cOVHgGB_.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-CT1r3sRa.js → pegDiagram-XKGWAZYB-DQikOuPL.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-CSi-V1LQ.js → pieDiagram-E7YTZNPT-Cu9wPXiv.js} +2 -2
- package/dist/assets/plugin-calendar-DqlnPeWE.js +1 -0
- package/dist/assets/plugin-charts-hJ5C1pY-.js +7 -0
- package/dist/assets/{plugin-chatbot-BGnkLzFS.js → plugin-chatbot-BeSLDg4N.js} +5 -5
- package/dist/assets/plugin-dashboard-d1o52lHr.js +6 -0
- package/dist/assets/{plugin-form-_fjHxKTV.js → plugin-form-D8x_rH5w.js} +1 -1
- package/dist/assets/plugin-gantt-B2GTMGPH.js +63 -0
- package/dist/assets/plugin-grid-DGXy_yQF.js +9 -0
- package/dist/assets/{plugin-kanban-DA0eW6yj.js → plugin-kanban-CVf6Nj3e.js} +1 -1
- package/dist/assets/plugin-map-hkbw1bGS.js +1 -0
- package/dist/assets/{plugin-markdown-B7zwZHmn.js → plugin-markdown-Bdb2UThR.js} +4 -4
- package/dist/assets/plugin-report-CelulaB7.js +59 -0
- package/dist/assets/{plugin-timeline-B6rsNNAK.js → plugin-timeline-DTcJ-hts.js} +1 -1
- package/dist/assets/plugin-tree-Bk5vG9la.js +1 -0
- package/dist/assets/{plugin-view-5qxxRyZZ.js → plugin-view-CKs41t7o.js} +1 -1
- package/dist/assets/plugins-views-DZmsFOak.js +4 -0
- package/dist/assets/{quadrantDiagram-AXDQQJYC-DUJ_94hm.js → quadrantDiagram-AXDQQJYC-DqTU6p89.js} +3 -3
- package/dist/assets/{railroadDiagram-O6MQD6OU-CEyfAhzM.js → railroadDiagram-O6MQD6OU-CHGgIBKb.js} +1 -1
- package/dist/assets/{requirementDiagram-IS5BZ75X-CAK7hvBg.js → requirementDiagram-IS5BZ75X-B20mHS5h.js} +1 -1
- package/dist/assets/{runtime-metadata-persistence-DYPxFzHI.js → runtime-metadata-persistence-DzS2YaNb.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-DgYJh7uz.js → sankeyDiagram-P5KCCOFB-oqGY91Cw.js} +3 -3
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-DsQerPtC.js → sequenceDiagram-WJ2MYXX4-CVMm7Aid.js} +1 -1
- package/dist/assets/{src-CVJP2nIc.js → src-D7tZqf12.js} +1 -1
- package/dist/assets/{src-_DxAIBqo.js → src-DCXZnd2l.js} +1 -1
- package/dist/assets/{src-S6pzKItc.js → src-DEMdKbQy.js} +1 -1
- package/dist/assets/src-hcMLuWxG.js +17 -0
- package/dist/assets/stateDiagram-XQSTLZYL-3oM7IdVe.js +1 -0
- package/dist/assets/stateDiagram-v2-IH3M54BS-BznjPAgb.js +1 -0
- package/dist/assets/studioEntry-BUFsLXCL.js +1 -0
- package/dist/assets/{submitRedirect-UXd9NsjL.js → submitRedirect-7ExeC4kw.js} +1 -1
- package/dist/assets/{swimlanes-V6O3JKXN-BiKyiEJr.js → swimlanes-V6O3JKXN-Djgbrkmh.js} +1 -1
- package/dist/assets/swimlanesDiagram-JKAHXJPX-DHJJ3qZq.js +8 -0
- package/dist/assets/{timeline-definition-24CTP7MA-CW5rY3PX.js → timeline-definition-24CTP7MA-k2lbfDvL.js} +2 -2
- package/dist/assets/ui-components-CMHDBJEm.js +37 -0
- package/dist/assets/{ui-layout-UUTFXV6S.js → ui-layout-Jk_qY9Ni.js} +1 -1
- package/dist/assets/{use-book-data-qUZAxIs0.js → use-book-data-CM73PGvc.js} +1 -1
- package/dist/assets/{useActionModal-CkM-zGdy.js → useActionModal-D_iilsul.js} +1 -1
- package/dist/assets/{usePackageL10n-F9isJ9pn.js → usePackageL10n-BfPqgsRL.js} +1 -1
- package/dist/assets/{useSettingsLabel-CSZBfUiw.js → useSettingsLabel-CW2sBbmj.js} +1 -1
- package/dist/assets/vendor-charts-BBlPrtHS.js +67 -0
- package/dist/assets/{vendor-i18n-C1AQDWux.js → vendor-i18n-CzBLXLJU.js} +1 -1
- package/dist/assets/vendor-objectstack-BU0HrnMy.js +270 -0
- package/dist/assets/{vendor-zod-r9lyeyrU.js → vendor-zod-Bwe8XZZa.js} +3 -3
- package/dist/assets/{vennDiagram-4TSXK5OY-C79cMc25.js → vennDiagram-4TSXK5OY-zweM554s.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-BAO0_jUk.js → wardleyDiagram-VM6X3IG4-Dg9r6Ajz.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-BIRd7YRo.js → xychartDiagram-S5SC5T6Z-CraplxeN.js} +2 -2
- package/dist/eager-closure.json +87 -87
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/RecordDetailView-A8bbPnkK.js +0 -3
- package/dist/assets/architectureDiagram-5GKGNRK7-mGW8P1lC.js +0 -36
- package/dist/assets/channel-FD4s9EIH.js +0 -1
- package/dist/assets/chunk-75Z2AOVW-CkSdnmiC.js +0 -2
- package/dist/assets/chunk-CLGD4ZFX-BTkDISwp.js +0 -1
- package/dist/assets/chunk-F27PBJKO-DUKg0YWV.js +0 -1
- package/dist/assets/chunk-L3NEJ4N5-Bzz35TZJ.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-iNC8aYmk.js +0 -1
- package/dist/assets/classDiagram-CYGNFDIV-D5Pd2TCl.js +0 -1
- package/dist/assets/classDiagram-v2-TLXNO2FR-D5Pd2TCl.js +0 -1
- package/dist/assets/cose-bilkent-JH36ORCC-CPQv9aQH.js +0 -1
- package/dist/assets/data-adapter-DL25qpAe.js +0 -5
- package/dist/assets/diagram-VX7I27RA-BSEwkn7K.js +0 -24
- package/dist/assets/dist-BpPy7hlB.js +0 -5
- package/dist/assets/flowDiagram-T62WH6J4-CqVSNJ8T.js +0 -1
- package/dist/assets/framework-BfSv4Kb0.js +0 -36
- package/dist/assets/gitGraphDiagram-WWUBYQGX-D1dYmoGu.js +0 -106
- package/dist/assets/index-BU-FzlQ6.js +0 -20
- package/dist/assets/index-_VyGO4ms.css +0 -2
- package/dist/assets/mermaid-GHXKKRXX-NzEcDxBh.js +0 -1
- package/dist/assets/plugin-calendar-BwiiCIjv.js +0 -1
- package/dist/assets/plugin-charts-CDGkx7z5.js +0 -7
- package/dist/assets/plugin-dashboard-Bj4ldCX6.js +0 -6
- package/dist/assets/plugin-gantt-zR8DkpEg.js +0 -63
- package/dist/assets/plugin-grid-kkbz4uec.js +0 -9
- package/dist/assets/plugin-map-DukneTNg.js +0 -1
- package/dist/assets/plugin-report-DaPtlsJr.js +0 -59
- package/dist/assets/plugin-tree-DauauLFc.js +0 -1
- package/dist/assets/plugins-views-iYcMmImr.js +0 -4
- package/dist/assets/src-JX1BkhmR.js +0 -17
- package/dist/assets/stateDiagram-XQSTLZYL-BJndPKik.js +0 -1
- package/dist/assets/stateDiagram-v2-IH3M54BS-Bi94bTLl.js +0 -1
- package/dist/assets/studioEntry-C6G8U-LG.js +0 -1
- package/dist/assets/swimlanesDiagram-JKAHXJPX-DKIR852g.js +0 -8
- package/dist/assets/ui-components-D2lrjG-t.js +0 -43
- package/dist/assets/vendor-charts-CY9WhhzX.js +0 -67
- package/dist/assets/vendor-objectstack-BeKUVjuj.js +0 -270
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{b as t,r as n}from"./vendor-react-CsWFRkED.js";import{An as r,Ft as i,G as a,Ht as o,J as s,Jt as c,Ot as l,Qt as u,U as d,Yt as f,_n as p,an as m,cn as h,en as g,fn as _,ht as v,in as y,it as b,ln as x,lt as S,on as ee,rn as C,sn as te,un as ne,vn as re,wn as ie,yn as ae,yt as oe}from"./vendor-objectstack-BU0HrnMy.js";import{c as se,h as ce,n as le,u as ue}from"./data-adapter-1YRpH3h_.js";import{S as de,a as fe,d as pe,u as me,y as he}from"./i18n-locales-BBA090ve.js";import{S as w,_ as T,a as ge,b as _e,c as E,d as ve,f as ye,g as D,h as be,i as xe,l as Se,n as Ce,o as O,p as k,s as A,t as j,u as we,v as M,x as N,y as P}from"./vendor-zod-Bwe8XZZa.js";function Te(e,t,n){if(!e)return;let r=e=>t.includes(e);if(r(e))return e;let i=`${n}.`;if(!e.includes(`.`)&&r(i+e))return i+e;if(e.startsWith(i)&&r(e.slice(i.length)))return e.slice(i.length)}var Ee=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function De(e){if(!Ee(e)||typeof e.find==`function`)return!1;let t=e.object;return typeof t==`string`&&t.length>0}function Oe(...e){let t={};for(let n of e)if(Array.isArray(n))for(let e of n){if(!Ee(e))continue;let n=e.name??e.id;typeof n==`string`&&n&&(t[n]=e)}else if(Ee(n))for(let[e,r]of Object.entries(n))Ee(r)&&(t[e]=r);return t}function ke(e,t,n){let r=Te(t,Object.keys(e),n);return r===void 0?void 0:e[r]}function Ae(e){if(!e)return;let t=e.pagination;return Ee(t)&&typeof t.pageSize==`number`?t.pageSize:typeof e.limit==`number`?e.limit:void 0}function je(e){if(!e)return;let t=e.type??e.viewType;return typeof t==`string`&&t?t:void 0}function Me(e){if(e){if(Array.isArray(e.columns))return e.columns;if(Array.isArray(e.fields))return e.fields}}function Ne(e,t){let n={object:e.object},r=Me(t);r!==void 0&&(n.columns=r);let i=t?.filter,a=i!==void 0&&e.filter!==void 0?ce(i,e.filter):e.filter??i;a!==void 0&&(n.filter=a);let o=e.sort??t?.sort;o!==void 0&&(n.sort=o);let s=e.limit??Ae(t);s!==void 0&&(n.limit=s);let c=je(t);return c!==void 0&&(n.viewType=c),n}function Pe(e,t,n){return`dataSource.view "${t}" was not found on object "${e}". ${n.length?`Known views: ${[...n].sort().join(`, `)}.`:`This object has no saved views.`}`}var Fe={name:`dataSource`,type:`object`,label:`Data Source`,binding:`object`,description:"Per-element data binding: { object, view, filter, sort, limit }. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it."},Ie=new WeakSet;function Le(e){return e&&(typeof e==`object`||typeof e==`function`)&&Ie.add(e),e}function Re(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&Ie.has(e)}var ze=`object-grid.list-view.object-form.embeddable-form.object-master-detail-form.object-kanban.object-calendar.object-gantt.object-timeline.object-map.object-metric.object-chart.dashboard.object-pivot.record:details.record:highlights.record:related_list.record:path.record:line_items.record:activity.record:discussion.record:history.record:quick_actions.record:reference_rail.record:alert.page:tabs.page:card.page:accordion.page:section.page:footer.page:sidebar.element:text.element:number.element:button.element:definition-list.element:repeater.action:button.action:group.action:menu.action:icon.flex.grid.stack.card.tabs.accordion.container.page:header.text.image.icon.markdown.element:divider.badge.alert.button.html`.split(`.`);new Set(ze);function Be(e,t){if(!Re(e))return t;let n=t?.inputs??[];return n.some(e=>e?.name===Fe.name)?t:{...t??{},inputs:[...n,{...Fe}]}}var Ve=new class{components=new Map;lazyEntries=new Map;listeners=new Set;version=0;register(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i=Be(t,n);if(n?.namespace||console.warn(`Registering component "${e}" without a namespace is deprecated. Please provide a namespace in the meta parameter.\n\n Migration:\n // Before (deprecated):\n registry.register('${e}', MyComponent);\n\n // After:\n registry.register('${e}', MyComponent, { namespace: 'my-plugin' });\n\n See: https://www.objectui.org/docs/guide/plugin-development#namespaced-registration`),this.components.has(r),this.components.set(r,{type:r,component:t,...i}),n?.namespace&&!n?.skipFallback){let n=this.components.get(e);n&&n.component!==t&&n.type!==r&&console.warn(`Component "${e}" bare-name fallback is being overwritten by "${r}". If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key.`),this.components.set(e,{type:r,component:t,...i})}this.lazyEntries.delete(r),this.lazyEntries.delete(e),this.notify()}unregister(e,t){let n=t?`${t}:${e}`:e,r=this.components.delete(n);if(t){let t=this.components.get(e);t&&t.type===n&&this.components.delete(e)}return this.lazyEntries.delete(n),this.lazyEntries.delete(e),r&&this.notify(),r}registerLazy(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i={loader:t,meta:n};this.lazyEntries.set(r,i),n?.namespace&&!n?.skipFallback&&this.lazyEntries.set(e,i),this.version++}hasLazy(e,t){return t?this.lazyEntries.has(`${t}:${e}`):this.lazyEntries.has(e)}loadLazy(e,t){let n=t?`${t}:${e}`:e,r=this.lazyEntries.get(n);if(r)return r.pending||=r.loader().catch(e=>{throw r.pending=void 0,e}),r.pending}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){this.version++;for(let e of this.listeners)try{e()}catch(e){console.error(`[Registry] listener error`,e)}}getVersion(){return this.version}get(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)?.component}return this.components.get(e)?.component}getConfig(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)}return this.components.get(e)}has(e,t){if(t){let n=`${t}:${e}`;return this.components.has(n)}return this.components.has(e)}getAllTypes(){return Array.from(this.components.keys())}getKnownTypes(){return Array.from(new Set([...this.components.keys(),...this.lazyEntries.keys()]))}getMeta(e,t){let n=t?`${t}:${e}`:e;return this.components.get(n)??this.lazyEntries.get(n)?.meta}deprecationFor(e,t,n){let r=this.getMeta(e,n)?.deprecated;if(r)return r.surfaces.includes(t)?r:void 0}getAllConfigs(){return Array.from(this.components.values())}getContractConfig(e){let t=this.components.get(e);if(t)return t;let n=this.lazyEntries.get(e);if(!n)return;let r=n.meta?.namespace,i=r&&!e.startsWith(`${r}:`)?`${r}:${e}`:e;return{...n.meta,type:i,lazy:!0}}getPublicConfigs(){let e=new Set,t=[],n=(n,r)=>{!r||e.has(r.type)||(e.add(r.type),t.push({...r,type:n}))};for(let e of ze)n(e,this.getContractConfig(e));for(let[e,t]of this.components.entries())t.tier===`public`&&!e.includes(`:`)&&n(e,t);for(let[e,t]of this.lazyEntries.entries())t.meta?.tier===`public`&&!e.includes(`:`)&&n(e,this.getContractConfig(e));return t}getNamespaceComponents(e){return Array.from(this.components.values()).filter(t=>t.namespace===e)}};function He(e){return e==null||typeof e==`string`&&e.trim()===``||Array.isArray(e)&&e.length===0}l();function Ue(e){return typeof e==`object`&&!!e&&typeof e.dialect==`string`&&typeof e.source==`string`}function We(e){return i(e)||Ue(e)}function Ge(e,t){return t?We(e?.field?.defaultValue):!1}function Ke(e){return e.includes("${")?e:`\${${e}}`}function qe(e){if(e!=null&&e!==``){if(typeof e==`boolean`)return e;if(typeof e==`string`)return Ke(e);if(typeof e==`object`&&typeof e.source==`string`){let t=e.source;return t?e.dialect===`cel`?{dialect:`cel`,source:t}:Ke(t):void 0}}}function Je(e){if(typeof e==`string`)return e.trim()===``;if(typeof e==`object`&&e){let t=e.source;if(typeof t==`string`)return t.trim()===``}return!1}function F(e){return!Je(e)&&qe(e)!==void 0}function Ye(e){return{required:!1,validate:e=>typeof e==`boolean`||F(e),message:`${e} must be a boolean or a declared predicate: an expression string (bare, e.g. "record.stage == 'closed'", or the "\${...}" template spelling), or a { dialect, source } expression envelope`}}var Xe={type:{required:!0,validate:e=>typeof e==`string`&&e.length>0,message:`type must be a non-empty string`},id:{required:!1,validate:e=>typeof e==`string`,message:`id must be a string`},className:{required:!1,validate:e=>typeof e==`string`,message:`className must be a string`},visible:Ye(`visible`),disabled:Ye(`disabled`)};function Ze(e,t=`schema`){let n=[];return!e||typeof e!=`object`?(n.push({path:t,message:`Schema must be an object`,type:`error`,code:`INVALID_SCHEMA`}),n):(Object.entries(Xe).forEach(([r,i])=>{let a=e[r];i.required&&a===void 0&&n.push({path:`${t}.${r}`,message:`${r} is required`,type:`error`,code:`MISSING_REQUIRED`}),a!==void 0&&!i.validate(a)&&n.push({path:`${t}.${r}`,message:i.message,type:`error`,code:`INVALID_TYPE`})}),n)}var Qe=Object.freeze({crud:'Node type `crud` was RETIRED (objectui#5373, ADR-0049 enforce-or-remove). `CRUDSchema` declared it in four places and no renderer ever registered it, so a node spelling it painted the OBJUI-001 "Unknown component type" panel. Compose the shapes that DO render instead: `object-grid` for the record table with its toolbar, filters, pagination and row/batch actions, `object-form` for the create/edit form, and `detail` for the record view.'});function $e(e,t=`schema`){let n=e?.type;return typeof n!=`string`||!Object.prototype.hasOwnProperty.call(Qe,n)?[]:[{path:`${t}.type`,message:Qe[n],type:`error`,code:`RETIRED_TYPE`}]}var et=`field:`;function tt(e){let t=e.widget??e.type;return typeof t==`string`?t:void 0}function nt(e,t){let n=tt(e);if(!(!n||!n.includes(`:`)||n.startsWith(et)))return{path:`${t}.${typeof e.widget==`string`?`widget`:`type`}`,message:`'${n}' is not a form field widget: a namespaced field widget id must name the \`field:\` namespace (objectui#5254), so this id resolves NOTHING on the field path and the renderer would fall through to a plain text box — putting a secret on screen in clear text when the field holds one (objectui#5375). Write the built-in spelling (e.g. \`password\`), or the field widget id \`field:${n.slice(n.indexOf(`:`)+1)}\`. Resolving in the registry is not proof it resolves HERE — \`ui:password\` is a registered SDUI node renderer and still renders clear text as a field.`,type:`error`,code:`UNRESOLVABLE_FIELD_WIDGET_NAMESPACE`}}function rt(e,t=`schema`){let n=[];return e.type===`form`&&e.fields&&Array.isArray(e.fields)&&e.fields.forEach((r,i)=>{r.name||n.push({path:`${t}.fields[${i}]`,message:`Form field requires name property`,type:`error`,code:`MISSING_FIELD_NAME`});let a=nt(r,`${t}.fields[${i}]`);a&&n.push(a),e.fields.filter(e=>e.name===r.name).length>1&&n.push({path:`${t}.fields[${i}]`,message:`Duplicate field name: ${r.name}`,type:`warning`,code:`DUPLICATE_FIELD_NAME`})}),n}function it(e,t=`schema`){let n=[],r=e.children||e.body;if(r){if(Array.isArray(r))r.forEach((e,r)=>{if(typeof e==`object`&&e){let i=at(e,`${t}.children[${r}]`);n.push(...i.errors,...i.warnings)}});else if(typeof r==`object`&&r){let e=at(r,`${t}.children`);n.push(...e.errors,...e.warnings)}}return n}function at(e,t=`schema`){let n=[];n.push(...Ze(e,t)),n.push(...$e(e,t)),n.push(...rt(e,t)),n.push(...it(e,t));let r=n.filter(e=>e.type===`error`),i=n.filter(e=>e.type===`warning`);return{valid:r.length===0,errors:r,warnings:i}}var ot=[`id`,`className`,`role`,`tabIndex`,`autoFocus`,`onClick`,`onBlur`,`onFocus`];function st(e){return e.startsWith(`data-`)||e.startsWith(`aria-`)}function ct(e,t){let n=new Set(t),r={};for(let t of Object.keys(e))(n.has(t)||st(t))&&(r[t]=e[t]);return r}function lt(e){return ct(e,ot)}l();function ut(e,t){if(e==null)return{enabled:t};if(typeof e==`boolean`)return{enabled:e};let n=e.enabled??t;if(e.visibleWhen==null&&e.disabledWhen==null)return{enabled:n};let r={};return e.visibleWhen!=null&&(r.visibleWhen=e.visibleWhen),e.disabledWhen!=null&&(r.disabledWhen=e.disabledWhen),{enabled:n,predicates:r}}function dt(e){return ut(e,!1).predicates}var ft={create:`create`,import:`import`,edit:`update`,delete:`delete`,exportCsv:`export`};function pt(e,t){let n=o({managedBy:e?.managedBy??void 0,userActions:e?.userActions??void 0});if(Array.isArray(t)){let e=new Set(t);for(let[t,r]of Object.entries(ft))n[t]&&!e.has(r)&&(n[t]=!1)}return n}function mt(e,t){return pt(e,t).edit}function ht(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){if(Array.isArray(e.records))return e.records;if(Array.isArray(e.data))return e.data;if(Array.isArray(e.value))return e.value}return[]}var gt=`field`,_t=[`name`,`fieldName`],vt=e=>!!e&&typeof e==`object`&&!Array.isArray(e),yt=e=>typeof e==`string`&&e.length>0?e:void 0;function bt(e){if(typeof e==`string`)return yt(e);if(!vt(e))return;let t=yt(e[gt]);if(t)return t;for(let t of _t){let n=yt(e[t]);if(n)return n}}var xt=new Set,St=()=>!1;function Ct(e,t,n){if(!(!St()||n.length===0))for(let r of n){let n=`${t}:${r}:${String(e[r])}`;xt.has(n)||(xt.add(n),console.warn(`[ObjectUI] Column carries two identities: \`${gt}: '${t}'\` and \`${r}: '${String(e[r])}'\`. \`${gt}\` wins — it is the only key \`ListColumnSchema\` declares — and \`${r}\` has been rewritten to match, so the rendered column and the requested field agree. Fix the producer: drop \`${r}\` and author \`${gt}\` only. (objectui#3104)`))}}function wt(e){if(typeof e==`string`||!vt(e))return e;let t=bt(e);if(!t)return e;let n=e[gt]!==t,r=_t.filter(n=>e[n]!==void 0&&e[n]!==t);if(!n&&r.length===0)return e;Ct(e,t,r);let i={...e};i[gt]=t;for(let e of r)i[e]=t;return i}function Tt(e){if(!Array.isArray(e))return e;let t=!1,n=e.map(e=>{let n=wt(e);return n!==e&&(t=!0),n});return t?n:e}function Et(e){if(vt(e))return yt(e.header)??yt(e.label)}var Dt=new Set([`lookup`,`master_detail`,`tree`,`user`]);function Ot(e){return!!e&&typeof e==`object`&&Dt.has(e.type)}function kt(e,t){if(!e||typeof e!=`object`)return[];let n=[];for(let[t,r]of Object.entries(e))Ot(r)&&n.push(t);if(n.length===0)return[];if(t&&Array.isArray(t)&&t.length>0){let e=new Set;for(let n of t){let t=bt(n);t&&e.add(t)}return n.filter(t=>e.has(t))}return n}var At=Object.freeze({owner:"[object-ui] Field type `owner` was RETIRED (objectui#4814). It was a synonym for `user` with no behavioral difference, and it is not a member of `@objectstack/spec`'s FieldType. Write the record-owner field as `{ type: 'user', name: 'owner' }` — the field NAME carries the ownership meaning, the type carries the widget. The `widget: 'field:owner'` spelling is retired with it."});function jt(e){return typeof e!=`string`||!e?!1:Object.prototype.hasOwnProperty.call(At,e)}var Mt=new Set;function Nt(e){let t=jt(e)?At[e]:void 0;return t?(Mt.has(e)||(Mt.add(e),console.error(t)),!0):!1}l();var Pt=v;function Ft(e){return!!e&&typeof e==`object`&&Pt.has(e.type)}function It(e,t=0){let n=`migrated_${t}`;return e.type===`separator`?{id:n,type:`separator`,label:e.label||``}:e.type===`group`?{id:n,type:`group`,label:e.label||``,icon:e.icon,children:(e.children||[]).map((e,n)=>It(e,t*100+n)),visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge,defaultOpen:!0}:e.href?{id:n,type:`url`,label:e.label||``,icon:e.icon,url:e.href,target:`_blank`,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}:{id:n,type:`page`,label:e.label||``,icon:e.icon,pageName:e.path||``,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}}function Lt(e){return/^[a-z][a-z0-9]*(_[a-z0-9]+)*$/.test(e)}function Rt(e){return{type:`app`,name:e.name,title:e.title,label:e.title,description:e.description,icon:e.icon,logo:e.branding.logo,favicon:e.branding.favicon,branding:e.branding,layout:e.layout,navigation:e.navigation}}function zt(e){if(!e)return null;let t=e.stageField;if(t===!1)return null;if(typeof t==`string`&&t)return t;let n=e.fields||{};for(let e of[`status`,`stage`,`state`,`phase`])if(e in n)return e;for(let[e,t]of Object.entries(n)){let n=(t?.type||``).toLowerCase();if(n===`status`||n===`stage`)return e}return null}function Bt(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=Object.keys(e);if(t.length!==1||t[0]!==`preset`)return!1;let n=e.preset;return typeof n==`string`&&n.length>0}function Vt(e){if(!e||typeof e!=`object`)return e;let t=e.defaultValue;return Bt(t)?{...e,defaultValue:t.preset}:e}function Ht(e){if(!e||typeof e!=`object`)return e;let t=e.globalFilters;if(!Array.isArray(t))return e;let n=!1,r=t.map(e=>{let t=Vt(e);return t!==e&&(n=!0),t});return n?{...e,globalFilters:r}:e}var I=e(t(),1),L=n(),Ut=[`text`,`number`,`date`,`datetime`,`currency`,`percent`,`boolean`,`action`],Wt={int:`number`,integer:`number`,float:`number`,double:`number`,"datetime-local":`datetime`};function Gt(e){if(typeof e==`string`)return Ut.includes(e)?e:Wt[e]}var Kt=new Set(`id._id.__v._version._rev.created.created_at.createdAt.created_by.createdBy.modified.modified_by.updated_at.updatedAt.updated_by.updatedBy.deleted.deleted_at.deletedAt.is_deleted.instance_state.locked.owner_id.organization_id.tenant_id.company_id.space`.split(`.`)),qt={createdAt:`created_at`,createdBy:`created_by`,updatedAt:`updated_at`,updatedBy:`updated_by`},Jt=new Set(Object.values(qt));function Yt(e,t){return t?.system===!0||Kt.has(e)}var Xt=`text.textarea.number.boolean.date.datetime.time.select.email.phone.url.password.currency.percent.lookup.formula.autonumber.file.image.markdown.html.color.code.location.address.rating.slider`.split(`.`);function Zt(e,t){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.default;if(typeof t==`string`)return t}return t}function Qt(e){let t=e.type??`tabular`,n=t===`joined`||t===`tabular`?`tabular`:t,r=(e.values??[]).map(e=>({name:e,label:Zt(void 0,e)})),i=(e.rows??[]).map(e=>({field:e,sort:`asc`}));return{type:`report`,title:Zt(e.label,e.name),description:e.description?Zt(e.description,``):void 0,reportType:n,fields:r,groupBy:i.length>0?i:void 0}}function $t(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.name!=`string`||t.type===`report`&&Array.isArray(t.fields)?!1:typeof t.dataset==`string`||Array.isArray(t.blocks)||typeof t.type==`string`&&[`tabular`,`summary`,`matrix`,`joined`].includes(t.type)}l();function en(e,t){if(!t)return!0;let n=e?.locations;return Array.isArray(n)&&n.includes(t)}var tn=`an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`;function nn(e){return e===null?`null`:Array.isArray(e)?`an array`:`a ${typeof e}`}function rn(e){let t=e=>typeof e==`string`?`id`:typeof e==`object`&&e&&!Array.isArray(e)?`object`:null;if(e.length===0)return{kind:`objects`,objects:[]};let n=t(e[0]);for(let r=0;r<e.length;r+=1){let i=e[r],a=t(i);if(a===null)return{kind:`refused`,index:r,message:`element ${r} is ${nn(i)}, which is neither an action id (a string) nor an inline action object; ${tn}`};if(a!==n)return{kind:`refused`,index:r,message:`element ${r} is ${a===`id`?`an action id`:`an inline action object`} but element 0 is ${n===`id`?`an action id`:`an inline action object`}; an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`}}return n===`id`?{kind:`ids`,ids:e}:{kind:`objects`,objects:e}}function an(e,t){let n=rn(e);if(n.kind===`refused`)return n;if(n.kind===`objects`)return{kind:`objects`,actions:Array.from(n.objects)};let r=new Map;for(let e of t??[]){let t=typeof e?.name==`string`?e.name:``;t&&!r.has(t)&&r.set(t,e)}let i=[],a=[];return n.ids.forEach((e,t)=>{let n=r.get(e);n?i.push(n):a.push({index:t,id:e})}),{kind:`ids`,ids:n.ids,actions:i,unresolved:a}}var on=S.options,sn=[`checkbox`,`reference`,`datetime-local`],cn=3e4,ln=new Set([408,425,429,502,503,504]),un=class extends Error{status;retryAfterMs;constructor(e,t,n){super(n??`Endpoint returned ${e}`),this.status=e,this.retryAfterMs=t,this.name=`HttpFetchError`}};function dn(e){return e instanceof un?ln.has(e.status):!0}function fn(e,t){if(!e)return;let n=e.trim();if(!n)return;let r;if(/^\d+$/.test(n))r=Number(n)*1e3;else{let e=Date.parse(n);if(Number.isNaN(e))return;r=e-t}if(!(!Number.isFinite(r)||r<0))return Math.min(r,cn)}function pn(e,t,n){return n===void 0?Math.min(t*2**e,cn):n}var mn=e=>new Promise(t=>setTimeout(t,e));function hn(e){return fn(e.headers?.get?.(`Retry-After`),Date.now())}var gn=Symbol.for(`objectui.inflightGet`);function _n(){let e=globalThis,t=e[gn];if(t)return t;let n=new Map;return e[gn]=n,n}function vn(e){if(!e)return``;let t=[];if(typeof Headers<`u`&&e instanceof Headers)e.forEach((e,n)=>t.push(`${n.toLowerCase()}=${e}`));else if(Array.isArray(e))for(let[n,r]of e)t.push(`${String(n).toLowerCase()}=${String(r)}`);else for(let[n,r]of Object.entries(e))t.push(`${n.toLowerCase()}=${String(r)}`);return t.sort().join(`,`)}function yn(e,t){return`GET\n${t?.credentials??`same-origin`}\n${e}\n${vn(t?.headers)}`}function bn(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}var xn=(e,t)=>fetch(e,t);async function Sn(e,t,n=xn){let r=t?.method;if(r!==void 0&&r.toUpperCase()!==`GET`)throw TypeError(`sharedGetJson is GET-only; refusing to share a ${r.toUpperCase()} request`);if(t?.signal){let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new un(r.status,hn(r));return await r.json()}let i=yn(e,t),a=_n(),o=a.get(i);if(o)return bn(await o);let s=(async()=>{let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new un(r.status,hn(r));return await r.json()})();a.set(i,s);let c=()=>{a.get(i)===s&&a.delete(i)};return s.then(c,c),bn(await s)}var Cn=`\0`,wn=`[-\\u2013\\u2014|/·,:]`,Tn=[`name`,`title`,`subject`,`label`,`full_name`,`display_name`],En=new Set([`date`,`datetime`,`time`,`number`,`currency`,`percent`,`boolean`,`file`,`image`,`attachment`,`json`,`geolocation`,`select`,`multiselect`,`picklist`,`multipicklist`,`lookup`,`master_detail`,`reference`,`autonumber`,`auto_number`,`phone`]),Dn=new Set([`text`,`string`,`textarea`,`html`]);function On(e){let t=e.name??e.full_name??e.display_name??e.label??e.title??e.subject??null;return t==null||typeof t==`string`&&!t.trim()?[e.salutation,e.first_name,e.last_name].filter(e=>typeof e==`string`&&e.trim()).map(e=>e.trim()).join(` `)||(typeof e.email==`string`&&e.email.trim()?e.email.trim():null):typeof t==`string`?t:String(t)}function kn(e,t){let n=typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`?e.source:void 0;if(!n||!t||typeof t!=`object`)return``;n=n.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,`{$1}`);let r=!1,i=n.replace(/\{([^{}]+)\}/g,(e,n)=>{let i=String(n).trim().split(`.`),a=t;for(let e of i){if(a==null)break;a=a[e]}return a&&typeof a==`object`&&(a=On(a)),a==null||a===``?Cn:(r=!0,String(a))});if(!r)return``;let a=RegExp(`\\s*${wn}\\s*${Cn}`,`g`),o=RegExp(`${Cn}\\s*${wn}\\s*`,`g`);return i=i.replace(a,``).replace(o,``).replace(new RegExp(Cn,`g`),``).replace(/\s+/g,` `).trim(),i}function An(e){if(!e||typeof e!=`object`)return!1;let t=typeof e.type==`string`?e.type.toLowerCase():void 0;if(!t)return!0;if(t===`formula`){let t=String(e.data_type??e.dataType??e.returnType??e.result_type??``).toLowerCase();return Dn.has(t)}return!En.has(t)}function jn(e){return e?Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`).map(e=>[e.name,e]):typeof e==`object`?Object.keys(e).map(t=>[t,e[t]]):[]:[]}var Mn=new WeakMap;function Nn(e){let t=jn(e?.fields).filter(([,e])=>An(e));if(t.length===0)return;for(let e of Tn){let n=t.find(([t])=>t.toLowerCase()===e);if(n)return n[0]}let n=t.find(([e])=>{let t=e.toLowerCase();return t.endsWith(`_name`)||t.endsWith(`_title`)||t.startsWith(`name_`)});return n?n[0]:t[0][0]}function Pn(e){if(typeof e!=`object`||!e)return Nn(e);if(Mn.has(e))return Mn.get(e);let t=Nn(e);return Mn.set(e,t),t}function Fn(e){return e?.nameField??e?.displayNameField??e?.NAME_FIELD_KEY}function In(e){let t=Fn(e);return typeof t==`string`&&t.length>0?t:Pn(e)}function Ln(e,t){let n=Fn(e),r=typeof n==`string`&&n.length>0,i=r?n:Pn(e),a=i?e?.fields?.[i]:void 0;return!i||!a||a.hidden||!r&&Yt(i,a)?t:[i,...t.filter(e=>e!==i)]}var Rn=[`name`,`full_name`,`fullName`,`display_name`,`displayName`,`title`,`subject`,`label`];function zn(e,t){if(!t||!e||typeof e!=`object`)return;let n=e[t];if(n&&typeof n==`object`&&(n=On(n)),n==null)return;let r=typeof n==`string`?n.trim():String(n);return r===``?void 0:r}function Bn(e,t,n){let r=zn(t,n?.titleField);if(r)return r;let i=zn(t,Fn(e));if(i)return i;if(e?.titleFormat){let n=kn(e.titleFormat,t);if(n)return n}let a=zn(t,Pn(e));if(a)return a;if(n?.deriveFromRecordKeys!==!1&&t&&typeof t==`object`){for(let e of Rn){let n=zn(t,e);if(n)return n}for(let e of Object.keys(t)){let n=e.toLowerCase();if(!(n===`id`||n===`_id`||n.endsWith(`_id`)||n.startsWith(`_`))&&(n.endsWith(`_name`)||n.endsWith(`_title`)||n.startsWith(`name_`))){let n=zn(t,e);if(n)return n}}}let o=t?.id??t?._id;return o!=null&&String(o).trim()!==``?`Record #${o}`:n?.fallback??`Untitled`}function Vn(e,t){if(e==null||e===``)return null;let n=t?.labels;if(typeof e==`string`)return n?.[e]??e;if(typeof e==`number`)return Number.isFinite(e)?n?.[String(e)]??e:null;if(typeof e==`boolean`)return e;if(e instanceof Date){let t=e.getTime();return Number.isNaN(t)?null:t}if(Array.isArray(e)){let n=e.map(e=>Vn(e,t)).filter(e=>e!==null).map(e=>String(e));return n.length>0?n.join(`, `):null}if(typeof e==`object`){let t=e,r=t.id??t._id;if(r!=null){let e=n?.[String(r)];if(e)return e}let i=Bn(void 0,t,{fallback:``});return i===``?null:i}return String(e)}function Hn(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0})}function Un(e){if(e){if(typeof e==`string`){let[t,n]=e.trim().split(/\s+/);return t?{[t]:n?.toLowerCase()===`desc`?`desc`:`asc`}:void 0}if(Array.isArray(e)){let t={};for(let n of e)!n||typeof n.field!=`string`||n.field===``||(t[n.field]=n.order===`desc`?`desc`:`asc`);return Object.keys(t).length>0?t:void 0}}}var Wn=class e{scopes=[];constructor(e={}){this.scopes.push(new Map(Object.entries(e)))}pushScope(e){this.scopes.push(new Map(Object.entries(e)))}popScope(){this.scopes.length>1&&this.scopes.pop()}get(e){let t=e.split(`.`),n=t[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(n)){let r=this.scopes[e].get(n);for(let e=1;e<t.length;e++)if(r&&typeof r==`object`)r=r[t[e]];else return;return r}}set(e,t){this.scopes.length>0&&this.scopes[this.scopes.length-1].set(e,t)}has(e){let t=e.split(`.`)[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(t))return!0;return!1}toObject(){let e={};for(let t of this.scopes)for(let[n,r]of t.entries())e[n]=r;return e}createChild(t={}){let n=new e;return n.scopes=[...this.scopes,new Map(Object.entries(t))],n}},Gn={Math,JSON,parseInt,parseFloat,isNaN,isFinite},Kn=new Set([`constructor`,`__proto__`,`prototype`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),qn=class e{source=``;pos=0;context={};_evaluating=!0;evaluate(e,t){this.source=e.trim(),this.pos=0,this.context={...Gn,...t};let n=this.parseTernary();if(this.skipWhitespace(),this.pos<this.source.length)throw SyntaxError(`Unexpected token "${this.source[this.pos]}" at position ${this.pos} in expression "${e}"`);return n}skipWhitespace(){for(;this.pos<this.source.length&&/\s/.test(this.source[this.pos]);)this.pos++}peek(e=0){return this.source[this.pos+e]??``}consume(){return this.source[this.pos++]??``}withEvaluation(e,t){let n=this._evaluating;this._evaluating=e;try{return t()}finally{this._evaluating=n}}assertSafeProp(e){if(typeof e==`string`&&Kn.has(e))throw TypeError(`Access to property "${e}" is not permitted in expressions`)}parseTernary(){let e=this.parseNullish();if(this.skipWhitespace(),this.peek()===`?`&&this.peek(1)!==`?`){if(this.pos++,this.skipWhitespace(),!this._evaluating){if(this.parseTernary(),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);this.pos++,this.skipWhitespace(),this.parseTernary();return}if(e){let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.withEvaluation(!1,()=>this.parseTernary()),e}if(this.withEvaluation(!1,()=>this.parseTernary()),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.parseTernary()}return e}parseNullish(){let e=this.parseOr();for(this.skipWhitespace();this.peek()===`?`&&this.peek(1)===`?`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e!=null)this.withEvaluation(!1,()=>this.parseOr());else{let t=this.parseOr();this._evaluating&&(e??=t)}this.skipWhitespace()}return e}parseOr(){let e=this.parseAnd();for(this.skipWhitespace();this.peek()===`|`&&this.peek(1)===`|`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e)this.withEvaluation(!1,()=>this.parseAnd());else{let t=this.parseAnd();this._evaluating&&(e||=t)}this.skipWhitespace()}return e}parseAnd(){let e=this.parseEquality();for(this.skipWhitespace();this.peek()===`&`&&this.peek(1)===`&`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&!e)this.withEvaluation(!1,()=>this.parseEquality());else{let t=this.parseEquality();this._evaluating&&(e&&=t)}this.skipWhitespace()}return e}parseEquality(){let e=this.parseAddition();for(this.skipWhitespace();;){let t;if(this.peek()===`=`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`===`,this.pos+=3;else if(this.peek()===`!`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`!==`,this.pos+=3;else if(this.peek()===`=`&&this.peek(1)===`=`)t=`==`,this.pos+=2;else if(this.peek()===`!`&&this.peek(1)===`=`)t=`!=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)===`=`)t=`>=`,this.pos+=2;else if(this.peek()===`<`&&this.peek(1)===`=`)t=`<=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)!==`>`)t=`>`,this.pos++;else if(this.peek()===`<`&&this.peek(1)!==`<`)t=`<`,this.pos++;else break;this.skipWhitespace();let n=this.parseAddition();switch(t){case`===`:e=e===n;break;case`!==`:e=e!==n;break;case`==`:e=e==n;break;case`!=`:e=e!=n;break;case`>`:e=e>n;break;case`<`:e=e<n;break;case`>=`:e=e>=n;break;case`<=`:e=e<=n}this.skipWhitespace()}return e}parseAddition(){let e=this.parseMultiplication();for(this.skipWhitespace();(this.peek()===`+`||this.peek()===`-`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseMultiplication();e=t===`+`?e+n:e-n,this.skipWhitespace()}return e}parseMultiplication(){let e=this.parseUnary();for(this.skipWhitespace();(this.peek()===`*`||this.peek()===`/`||this.peek()===`%`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseUnary();t===`*`?e*=n:t===`/`?e/=n:e%=n,this.skipWhitespace()}return e}parseUnary(){if(this.skipWhitespace(),this.source.startsWith(`typeof`,this.pos)&&!/[\w$]/.test(this.source[this.pos+6]??``)){this.pos+=6,this.skipWhitespace();try{return typeof this.parseUnary()}catch{return`undefined`}}return this.peek()===`!`?(this.pos++,!this.parseUnary()):this.peek()===`-`?(this.pos++,-this.parseUnary()):this.peek()===`+`?(this.pos++,+this.parseUnary()):this.parseMember()}parseMember(){let e=this.parsePrimary();for(;;){this.skipWhitespace();let t=this.peek()===`?`&&this.peek(1)===`.`;if(this.peek()===`.`&&this.peek(1)!==`.`||t){t&&this.pos++,this.pos++,this.skipWhitespace();let n=this.parseIdentifierName();if(!n)break;if(this.assertSafeProp(n),this.skipWhitespace(),this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}e=e!=null&&typeof e[n]==`function`?e[n](...t):void 0}else{if(!this._evaluating){e=void 0;continue}e=e?.[n]}continue}let n=this.peek()===`?`&&this.peek(1)===`[`;if(this.peek()===`[`||n){n&&this.pos++,this.pos++,this.skipWhitespace();let t=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`]`)throw SyntaxError(`Expected "]" after bracket expression at position ${this.pos}`);if(this.pos++,this.assertSafeProp(t),!this._evaluating){e=void 0;continue}e=e?.[t];continue}if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}if(typeof e==`function`)e=e(...t);else throw TypeError(`${String(e)} is not a function`);continue}break}return e}parsePrimary(){this.skipWhitespace();let e=this.peek();if(e===`(`){this.pos++;let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`)`)throw SyntaxError(`Expected ")" to close "(" expression at position ${this.pos}`);return this.pos++,e}if(e===`[`)return this.parseArrayLiteral();if(e===`"`||e===`'`)return this.parseString(e);if(/\d/.test(e)||e===`.`&&/\d/.test(this.peek(1)))return this.parseNumber();if(/[a-zA-Z_$]/.test(e))return this.parseIdentifierOrKeyword();throw SyntaxError(`Unexpected character "${e}" at position ${this.pos}`)}parseArrayLiteral(){this.pos++;let e=[];for(this.skipWhitespace();this.peek()!==`]`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());if(this.peek()!==`]`)throw SyntaxError(`Expected "]" to close array literal at position ${this.pos}`);return this.pos++,e}parseString(e){this.pos++;let t=``;for(;this.pos<this.source.length;){let n=this.source[this.pos];if(n===`\\`){this.pos++;let e=this.source[this.pos++]??``;switch(e){case`n`:t+=`
|
|
2
|
+
`;break;case`t`:t+=` `;break;case`r`:t+=`\r`;break;case`\\`:t+=`\\`;break;case`"`:t+=`"`;break;case`'`:t+=`'`;break;case"`":t+="`";break;default:t+=e}}else if(n===e){this.pos++;break}else t+=n,this.pos++}return t}parseNumber(){let e=this.pos,t=!1;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(this.source[this.pos]===`.`)for(this.pos++;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(/[eE]/.test(this.source[this.pos]??``)){this.pos++,/[+-]/.test(this.source[this.pos]??``)&&this.pos++;let t=0;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t++,this.pos++;if(t===0)throw SyntaxError(`Invalid numeric literal exponent at position ${e}`)}if(!t)throw SyntaxError(`Invalid numeric literal at position ${e}`);let n=this.source.slice(e,this.pos),r=Number(n);if(!Number.isFinite(r))throw SyntaxError(`Invalid numeric literal "${n}" at position ${e}`);return r}parseIdentifierName(){let e=this.pos;for(;this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]);)this.pos++;return this.source.slice(e,this.pos)}parseIdentifierOrKeyword(){let e=this.parseIdentifierName();switch(e){case`true`:return!0;case`false`:return!1;case`null`:return null;case`undefined`:return;case`NaN`:return NaN;case`Infinity`:return 1/0}if(e===`new`)return this.parseNewExpression();if(this.skipWhitespace(),this.peek()===`=`&&this.peek(1)===`>`)return this.parseArrowFunction(e);if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating)return;let n=this.context[e];if(typeof n==`function`)return n(...t);throw TypeError(`"${e}" is not a function`)}if(this._evaluating){if(!(e in this.context))throw ReferenceError(`${e} is not defined`);return this.context[e]}}parseNewExpression(){this.skipWhitespace();let e=this.parseIdentifierName();this.skipWhitespace();let t=[];if(this.peek()===`(`){if(this.pos++,t=this.parseArgList(),this.peek()!==`)`)throw SyntaxError(`Expected ")" after new ${e}() at position ${this.pos}`);this.pos++}if(this._evaluating)switch(e){case`Date`:return new Date(...t);case`RegExp`:return new RegExp(t[0],t[1]);default:throw TypeError(`new ${e}() is not supported in expressions`)}}parseArrowFunction(t){this.pos+=2,this.skipWhitespace();let n=this.pos,r=this.scanExpressionEnd(),i=this.source.slice(n,r).trim();this.pos=r;let a=this.context;return n=>new e().evaluate(i,{...a,[t]:n})}scanExpressionEnd(){let e=this.pos,t=0,n=!1,r=``;for(;e<this.source.length;){let i=this.source[e];if(n){if(i===`\\`){e+=2;continue}i===r&&(n=!1),e++;continue}if(i===`"`||i===`'`){n=!0,r=i,e++;continue}if(i===`(`||i===`[`)t++;else if(i===`)`||i===`]`){if(t===0)break;t--}else if(i===`,`&&t===0)break;e++}return e}parseArgList(){let e=[];for(this.skipWhitespace();this.peek()!==`)`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());return e}},Jn=class{cache=new Map;maxSize;constructor(e=1e3){this.maxSize=e}compile(e,t){let n=`${e}::${t.join(`,`)}`;if(this.cache.has(n)){let e=this.cache.get(n);return e.hitCount++,e}this.cache.size>=this.maxSize&&this.evictLFU();let r={fn:this.compileExpression(e,t),varNames:[...t],expression:e,compiledAt:Date.now(),hitCount:1};return this.cache.set(n,r),r}compileExpression(e,t){let n=new qn;return(...r)=>{let i={};for(let e=0;e<t.length;e++)i[t[e]]=r[e];return n.evaluate(e,i)}}evictLFU(){let e=null,t=1/0,n=1/0;for(let[r,i]of this.cache.entries())(i.hitCount<n||i.hitCount===n&&i.compiledAt<t)&&(e=r,t=i.compiledAt,n=i.hitCount);e&&this.cache.delete(e)}has(e,t){let n=`${e}::${t.join(`,`)}`;return this.cache.has(n)}clear(){this.cache.clear()}getStats(){let e=0,t=[];for(let n of this.cache.values())e+=n.hitCount,t.push({expression:n.expression,hitCount:n.hitCount});return{size:this.cache.size,maxSize:this.maxSize,totalHits:e,entries:t.sort((e,t)=>t.hitCount-e.hitCount)}}},Yn=class{functions=new Map;constructor(){this.registerDefaults()}register(e,t){this.functions.set(e.toUpperCase(),t)}get(e){return this.functions.get(e.toUpperCase())}has(e){return this.functions.has(e.toUpperCase())}getNames(){return Array.from(this.functions.keys())}toObject(){let e={};for(let[t,n]of this.functions)e[t]=n;return e}registerDefaults(){this.registerAggregationFunctions(),this.registerDateFunctions(),this.registerLogicFunctions(),this.registerStringFunctions(),this.registerStringSearchFunctions(),this.registerStatisticalFunctions()}registerAggregationFunctions(){this.register(`SUM`,(...e)=>R(e).reduce((e,t)=>e+t,0)),this.register(`AVG`,(...e)=>{let t=R(e);return t.length===0?0:t.reduce((e,t)=>e+t,0)/t.length}),this.register(`COUNT`,(...e)=>Xn(e).filter(e=>e!=null).length),this.register(`MIN`,(...e)=>{let t=R(e);return t.length===0?0:Math.min(...t)}),this.register(`MAX`,(...e)=>{let t=R(e);return t.length===0?0:Math.max(...t)})}registerDateFunctions(){this.register(`TODAY`,()=>new Date().toISOString().split(`T`)[0]),this.register(`NOW`,()=>new Date().toISOString()),this.register(`DATEADD`,(e,t,n)=>{let r=new Date(e);if(isNaN(r.getTime()))throw Error(`DATEADD: Invalid date "${e}"`);switch(String(n).toLowerCase()){case`day`:case`days`:r.setDate(r.getDate()+t);break;case`month`:case`months`:r.setMonth(r.getMonth()+t);break;case`year`:case`years`:r.setFullYear(r.getFullYear()+t);break;case`hour`:case`hours`:r.setHours(r.getHours()+t);break;case`minute`:case`minutes`:r.setMinutes(r.getMinutes()+t);break;default:throw Error(`DATEADD: Unsupported unit "${n}"`)}return r.toISOString()}),this.register(`DATEDIFF`,(e,t,n)=>{let r=new Date(e),i=new Date(t);if(isNaN(r.getTime()))throw Error(`DATEDIFF: Invalid date "${e}"`);if(isNaN(i.getTime()))throw Error(`DATEDIFF: Invalid date "${t}"`);let a=i.getTime()-r.getTime();switch(String(n).toLowerCase()){case`day`:case`days`:return Math.floor(a/864e5);case`month`:case`months`:return(i.getFullYear()-r.getFullYear())*12+(i.getMonth()-r.getMonth());case`year`:case`years`:return i.getFullYear()-r.getFullYear();case`hour`:case`hours`:return Math.floor(a/36e5);case`minute`:case`minutes`:return Math.floor(a/6e4);default:throw Error(`DATEDIFF: Unsupported unit "${n}"`)}}),this.register(`DATEFORMAT`,(e,t)=>{let n=new Date(e);if(isNaN(n.getTime()))throw Error(`DATEFORMAT: Invalid date "${e}"`);let r=(e,t=2)=>String(e).padStart(t,`0`);return t.replace(`YYYY`,String(n.getFullYear())).replace(`YY`,String(n.getFullYear()).slice(-2)).replace(`MM`,r(n.getMonth()+1)).replace(`DD`,r(n.getDate())).replace(`HH`,r(n.getHours())).replace(`mm`,r(n.getMinutes())).replace(`ss`,r(n.getSeconds()))})}registerLogicFunctions(){this.register(`IF`,(e,t,n)=>e?t:n),this.register(`AND`,(...e)=>e.every(Boolean)),this.register(`OR`,(...e)=>e.some(Boolean)),this.register(`NOT`,e=>!e),this.register(`SWITCH`,(e,...t)=>{for(let n=0;n<t.length-1;n+=2)if(e===t[n])return t[n+1];if(t.length%2==1)return t[t.length-1]})}registerStringFunctions(){this.register(`CONCAT`,(...e)=>e.map(e=>String(e??``)).join(``)),this.register(`LEFT`,(e,t)=>String(e??``).substring(0,t)),this.register(`RIGHT`,(e,t)=>{let n=String(e??``);return n.substring(Math.max(0,n.length-t))}),this.register(`TRIM`,e=>String(e??``).trim()),this.register(`UPPER`,e=>String(e??``).toUpperCase()),this.register(`LOWER`,e=>String(e??``).toLowerCase())}registerStringSearchFunctions(){this.register(`FIND`,(e,t,n)=>String(t??``).indexOf(String(e??``),n??0)),this.register(`REPLACE`,(e,t,n)=>String(e??``).split(String(t??``)).join(String(n??``))),this.register(`SUBSTRING`,(e,t,n)=>{let r=String(e??``);return n===void 0?r.substring(t):r.substring(t,t+n)}),this.register(`REGEX`,(e,t,n)=>{let r=String(e??``);return new RegExp(t,n).test(r)}),this.register(`LEN`,e=>String(e??``).length)}registerStatisticalFunctions(){this.register(`MEDIAN`,(...e)=>{let t=R(e).sort((e,t)=>e-t);if(t.length===0)return 0;let n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}),this.register(`STDEV`,(...e)=>{let t=R(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length,r=t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1);return Math.sqrt(r)}),this.register(`VARIANCE`,(...e)=>{let t=R(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length;return t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1)}),this.register(`PERCENTILE`,(e,...t)=>{let n=R(t).sort((e,t)=>e-t);if(n.length===0)return 0;let r=Math.max(0,Math.min(100,e))/100*(n.length-1),i=Math.floor(r),a=Math.ceil(r);if(i===a)return n[i];let o=r-i;return n[i]+o*(n[a]-n[i])})}};function R(e){let t=[];for(let n of e)if(Array.isArray(n))t.push(...R(n));else{let e=Number(n);isNaN(e)||t.push(e)}return t}function Xn(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Xn(n)):t.push(n);return t}function Zn(e){return typeof e==`string`?{dialect:`cel`,source:e}:{dialect:e.dialect??`cel`,source:e.source}}var Qn=new Set;function $n(e,t,n,r){let i=JSON.stringify([e.dialect,e.source]);Qn.has(i)||(Qn.add(i),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(r?` (${r})`:``)+` and was treated as its safe default (${String(t)}): `+JSON.stringify(e.source)+`. Reason: ${n}. Values are bound under 'record.' (e.g. record.status) — check the field names and CEL syntax.`))}function z(e,t,n,r,i,a){if(e==null||typeof e==`string`&&!e.trim())return n;let o=Zn(e),s,c=n;try{let e=d.evaluate(o,{record:t,previous:r,...i?{extra:i}:{}});e.ok?c=e.value===!0:s=`[${e.error.kind}] ${e.error.message}`}catch(e){s=`[throw] ${e instanceof Error?e.message:String(e)}`}return s===void 0?c:(a?.warn!==!1&&$n(o,n,s,a?.context),a?.onFault?.(s),n)}function er(e,t,n,r,i,a){let o=e=>({context:a?`${e} of ${a}`:e});return{visible:e.visibleWhen==null||z(e.visibleWhen,t,!0,r,i,o(`visibleWhen`)),readonly:n.readonly===!0||e.readonlyWhen!=null&&z(e.readonlyWhen,t,!1,r,i,o(`readonlyWhen`)),required:n.serverOwnedValue===!0?!1:n.required===!0||e.requiredWhen!=null&&z(e.requiredWhen,t,!1,r,i,o(`requiredWhen`))}}var tr=new Set;function nr(e,t,n,r){let i=r instanceof Error?r.message:String(r);if(e){e(i);return}let a=JSON.stringify([t,n]);tr.has(a)||(tr.add(a),console.warn(t===`template-part`?`Expression evaluation failed for: ${n}`:`Failed to evaluate expression: ${n}`,r))}var rr=class e{context;cache;formulas;constructor(e,t,n){this.context=e instanceof Wn?e:new Wn(e||{}),this.cache=t||new Jn,this.formulas=n||new Yn}evaluate(e,t={}){if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),typeof e!=`string`)return e;let{defaultValue:n,throwOnError:r=!1,sanitize:i=!0,onFault:a}=t;try{if(!e.includes("${"))return e;let t=e.match(/^\$\{([^}]+)\}$/);return t?this.evaluateExpression(t[1].trim(),{sanitize:i}):e.replace(/\$\{([^}]+)\}/g,(e,t)=>{try{let e=this.evaluateExpression(t.trim(),{sanitize:i});return String(e??``)}catch(n){if(r)throw n;return nr(a,`template-part`,t,n),e}})}catch(t){if(r)throw t;return nr(a,`whole-expression`,e,t),n??e}}evaluateExpression(e,t={}){let{sanitize:n=!0}=t;if(!(!e||e.trim()===``)){if(n&&this.isDangerous(e))throw Error(`Potentially dangerous expression detected: ${e}`);try{let t=this.context.toObject(),n={...this.formulas.toObject(),...t},r=Object.keys(n),i=Object.values(n);return this.cache.compile(e,r).fn(...i)}catch(t){throw Error(`Failed to evaluate expression "${e}": ${t.message}`)}}}isDangerous(e){return[/eval\s*\(/i,/Function\s*\(/i,/setTimeout\s*\(/i,/setInterval\s*\(/i,/import\s*\(/i,/require\s*\(/i,/process\./i,/global\./i,/window\./i,/document\./i,/__proto__/i,/constructor\s*\(/i,/prototype\./i].some(t=>t.test(e))}evaluateCondition(e,t={}){if(typeof e==`boolean`)return e;if(e&&typeof e==`object`&&e.dialect===`cel`&&typeof e.source==`string`)return this.evaluateCelCondition(e.source,t);if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),!e)return!0;if(typeof e!=`string`)return!!e;let n=e.trim();if(!n)return!0;if(n.includes("${"))return!!this.evaluate(n,t);try{return!!this.evaluateExpression(n,{sanitize:t.sanitize!==!1})}catch(e){if(t.throwOnError)throw e;return t.onFault?.(e instanceof Error?e.message:String(e)),!0}}evaluateCelCondition(e,t){if(!e.trim())return!0;let n=this.context.toObject(),r=n.record,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n;if(!t.throwOnError)return z(e,i,!0,void 0,n,t.onFault?{warn:!1,onFault:t.onFault}:void 0);let a=z(e,i,!0,void 0,n,{warn:!1});if(a!==z(e,i,!1,void 0,n,{warn:!1}))throw Error(`CEL predicate failed to evaluate: ${e}`);return a}updateContext(e){Object.entries(e).forEach(([e,t])=>{this.context.set(e,t)})}getContext(){return this.context}withContext(t){return new e(this.context.createChild(t),this.cache,this.formulas)}getCacheStats(){return this.cache.getStats()}clearCache(){this.cache.clear()}getFormulas(){return this.formulas}registerFunction(e,t){this.formulas.register(e,t)}};new Jn,new Yn;var ir=`record`,ar=`data`;function or(e,t,n){if(typeof e!=`string`||!e.trim())return null;let r=a(e);if(!r||r.ok!==!0)return null;let i=s(e);return typeof i==`string`&&typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(t,i)?{kind:`bare-shorthand`,identifier:i,canonical:`${ir}.${i}`}:n&&Array.isArray(r.roots)&&r.roots.includes(ar)?{kind:`metadata-layer-root`,identifier:ar,canonical:ir}:null}var sr=()=>!1,cr=new Set;function lr(e,t,n,r){if(!sr())return;let i=or(e,t,n);if(!i)return;let a=JSON.stringify([r??``,e,i.kind]);if(cr.has(a))return;cr.add(a);let o=r?` (${r})`:``,s=i.kind===`bare-shorthand`?`it references the bare field ${JSON.stringify(i.identifier)}; the server refuses that spelling outright ("Unknown variable: ${i.identifier}")`:"it is rooted at `data.`, which is the metadata-editing-form root — on a record surface the server binds no `data` at all, so the predicate is a constant false there rather than an error";console.warn(`[object-ui] A row predicate${o} uses a DEPRECATED spelling: ${JSON.stringify(e)} — ${s}. The canon is \`record.*\` (objectui#5330, ruled 2026-08-20): write \`${i.canonical}\`. This still evaluates here for now; the tolerance retires after a stored-metadata survey.`)}function ur(e){if(!e||typeof e!=`object`)return null;let t=new Set;if(Array.isArray(e))for(let n of e){let e=n?.name,r=n?.type;typeof e==`string`&&Dt.has(r)&&t.add(e)}else for(let[n,r]of Object.entries(e)){let e=r?.type;Dt.has(e)&&t.add(n)}return t.size>0?t:null}function dr(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.id??t._id;return typeof n==`string`||typeof n==`number`?String(n):void 0}function fr(e,t){if(!e||typeof e!=`object`)return e;let n=ur(t);if(!n)return e;let r=null,i=(t,n)=>{r||={...e},r[t]=n};for(let t of n){if(!(t in e))continue;let n=e[t];if(Array.isArray(n)){if(!n.some(e=>dr(e)!==void 0))continue;i(t,n.map(e=>dr(e)??e));continue}let r=dr(n);r!==void 0&&i(t,r)}return r??e}var pr=/\$\{|===|!==|\?\.|\?\?|\.(?:includes|indexOf|toUpperCase|toLowerCase|startsWith|endsWith|trim|split|map|filter|reduce|find|some|every|join|slice|charAt|padStart|padEnd|replace|match|test)\s*\(/;function mr(e){return pr.test(e)}var hr=new Set;function gr(e){hr.has(e)||(hr.add(e),console.warn(`[object-ui] A conditional predicate uses the legacy expression dialect and is not portable to the server CEL engine: `+JSON.stringify(e)+`. Rewrite it as CEL (use "==" not "===", "x in [..]" for membership, ".contains()" not ".includes()", and drop template interpolation).`))}var _r=new Set;function vr(e,t,n){let r=JSON.stringify([t??``,e]);_r.has(r)||(_r.add(r),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(t?` (${t})`:``)+` and was treated as its safe default: `+JSON.stringify(e)+(n?`. Reason: ${n}`:``)+`. Check the field names and CEL syntax.`))}function yr(e,t,n){let r,i={warn:!1,onFault:e=>{r??=e}},a=z(e,t,!0,void 0,n,i);return a===z(e,t,!1,void 0,n,i)?{ok:!0,value:a}:{ok:!1,value:!1,reason:r}}function br(e,t,n={}){let r=n.fallback??!1;if(e==null)return r;let i=typeof e==`string`?e:void 0;if(i!==void 0&&!i.trim())return r;let a=n.rowless?{}:fr(t&&typeof t==`object`?t:{},n.fields),o=n.rowless?{...n.scope??{}}:{...n.scope??{},...a,data:a,record:a},s=i??(e&&typeof e==`object`&&typeof e.source==`string`?e.source:`(expression)`);if(i!==void 0&&mr(i)){gr(i);try{return new rr(o).evaluateCondition(i,{throwOnError:!0})}catch(e){return n.warnOnError&&vr(i,n.label,`[legacy] ${e instanceof Error?e.message:String(e)}`),r}}if(s!==`(expression)`&&lr(s,a,!n.rowless,n.label),!n.warnOnError)return z(e,a,r,void 0,o,{context:n.label});let c=yr(e,a,o);return c.ok?c.value:(vr(s,n.label,c.reason),r)}function xr(e,t,n={}){if(e==null||e===``)return{eligible:t,skipped:0};if(typeof e==`boolean`)return e?{eligible:t,skipped:0}:{eligible:[],skipped:t.length};let r=t.filter(t=>br(e,t,{...n,warnOnError:n.warnOnError??!0,fallback:!1}));return{eligible:r,skipped:t.length-r.length}}function B(e){if(e==null)return`null`;let t=typeof e;return t===`string`?JSON.stringify(e):t===`number`||t===`boolean`?String(e):Array.isArray(e)?`[${e.map(B).join(`, `)}]`:JSON.stringify(String(e))}function Sr(e){let{field:t,operator:n,value:r}=e;if(!t||!n)return null;let i=`record[${JSON.stringify(t)}]`;switch(n){case`equals`:return`${i} == ${B(r)}`;case`not_equals`:return`${i} != ${B(r)}`;case`greater_than`:return`${i} > ${B(r)}`;case`less_than`:return`${i} < ${B(r)}`;case`contains`:return`${i}.contains(${B(r)})`;case`in`:return`${i} in ${B(Array.isArray(r)?r:[r])}`;default:return null}}function Cr(e){return e.condition==null?typeof e.expression==`string`&&e.expression.trim()?e.expression:Sr(e):e.condition}function wr(e){let t={};if(e.style&&typeof e.style==`object`)for(let[n,r]of Object.entries(e.style))r!=null&&(t[n]=String(r));return e.backgroundColor&&(t.backgroundColor=String(e.backgroundColor)),e.textColor&&(t.color=String(e.textColor)),e.borderColor&&(t.borderColor=String(e.borderColor)),t}function Tr(e,t,n,r){if(!t||t.length===0)return{};let i=e&&typeof e==`object`?e:{};for(let e=0;e<t.length;e++){let a=t[e];if(!a||typeof a!=`object`)continue;let o=Cr(a);if(o!=null&&br(o,i,{fallback:!1,scope:n,fields:r,label:`conditionalFormatting[${e}]`}))return wr(a)}return{}}function Er(e){return e?(Array.isArray(e)?e:[e]).map(e=>typeof e==`string`?e:e&&typeof e==`object`?e.field:null).filter(e=>typeof e==`string`&&e.length>0):[]}function Dr(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function Or(e,t){return Er(e).some(e=>Dr(t[e]))}function kr(e,t,n){return!e||e.length===0?[]:e.filter(e=>e?.visibleWhen==null||z(e.visibleWhen,t,!0,void 0,n,{context:`visibleWhen of option '${String(e.value)}'`}))}function Ar(e,t){return Dr(e)?!0:Array.isArray(e)?e.every(e=>t.some(t=>t.value===e)):t.some(t=>t.value===e)}function jr(e,t,n,r){let i=Er(n),a=i.length>0&&Or(n,t);return{options:a?[]:kr(e,t,r),gated:a,dependsOnFields:i}}var Mr=new Set([`select`,`multiselect`,`radio`,`checkboxes`]);function Nr(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.type==`string`&&typeof t.objectName==`string`&&typeof t.recordId==`string`&&typeof t.timestamp==`number`}var V=new class e{undoStack=[];redoStack=[];maxHistory;listeners=new Set;constructor(e){this.maxHistory=e?.maxHistory??50}push(e){this.undoStack.push(e),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack=[],this.notify()}peekUndo(){return this.undoStack[this.undoStack.length-1]}peekRedo(){return this.redoStack[this.redoStack.length-1]}popUndo(){let e=this.undoStack.pop();return e&&(this.redoStack.push(e),this.notify()),e}popRedo(){let e=this.redoStack.pop();return e&&(this.undoStack.push(e),this.notify()),e}clear(){this.undoStack=[],this.redoStack=[],this.notify()}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get undoCount(){return this.undoStack.length}get redoCount(){return this.redoStack.length}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getHistory(){return[...this.undoStack]}getRedoHistory(){return[...this.redoStack]}pushBatch(e){e.length!==0&&(this.undoStack.push(...e),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.redoStack=[],this.notify())}popUndoBatch(e){let t=Math.min(e,this.undoStack.length);if(t===0)return[];let n=this.undoStack.splice(this.undoStack.length-t,t);return this.redoStack.push(...n),this.notify(),n}popRedoBatch(e){let t=Math.min(e,this.redoStack.length);if(t===0)return[];let n=this.redoStack.splice(this.redoStack.length-t,t);return this.undoStack.push(...n),this.notify(),n}static STORAGE_KEY=`objectui:undo-history`;saveToStorage(){try{let t=JSON.stringify({undoStack:this.undoStack,redoStack:this.redoStack});localStorage.setItem(e.STORAGE_KEY,t)}catch{}}loadFromStorage(){try{if(typeof localStorage>`u`)return;let t=localStorage.getItem(e.STORAGE_KEY);if(!t)return;let n=JSON.parse(t);Array.isArray(n.undoStack)&&(this.undoStack=n.undoStack.filter(Nr)),Array.isArray(n.redoStack)&&(this.redoStack=n.redoStack.filter(Nr)),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.notify()}catch{}}notify(){this.listeners.forEach(e=>e())}},Pr=`type.actionType.name.label.description.confirmText.confirm.condition.disabled.api.endpoint.method.navigate.to.external.newTab.replace.onClick.reload.close.redirect.toast.successMessage.errorMessage.refreshAfter.undoable.params.actionParams.resultDialog.target.body.openIn.modal.chain.chainMode.onFailure.opensInNewTab.newTabUrl.locations.visible.requiredPermissions.icon.variant.order.component.objectName.ai.aria.bodyExtra.bodyShape.mode.recordIdField.recordIdParam.requiresFeature.onSuccess.shortcut.bulkEnabled`.split(`.`),Fr=`_lock._lockDocsUrl._lockReason._lockSource._packageId._packageVersion._provenance.ai.aria.body.bodyExtra.bodyShape.bulkEnabled.component.confirmText.description.disabled.errorMessage.execute.icon.label.locations.method.mode.name.newTabUrl.objectName.onSuccess.openIn.opensInNewTab.order.params.recordIdField.recordIdParam.refreshAfter.requiredPermissions.requiresFeature.resultDialog.shortcut.successMessage.target.type.undoable.variant.visible`.split(`.`),Ir=[`to`,`external`,`newTab`,`replace`],Lr=[`overrideNotice`],Rr={execute:"`execute` was removed in @objectstack/spec 17 (#3855) — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."},zr=new Set([...Pr,...Fr,...Ir,...Lr].filter(e=>!(e in Rr)));function Br(e){let t=[],n=[];if(!e||typeof e!=`object`)return{unknown:t,retired:n};for(let r of Object.keys(e))r in Rr?n.push(r):zr.has(r)||t.push(r);return{unknown:t,retired:n}}var H=new Set,Vr=()=>!1;function Hr(e,t=`ActionRunner`){if(!Vr())return;let{unknown:n,retired:r}=Br(e),i=e?.name??e?.type??`(unnamed)`;for(let e of r){let n=`retired:${String(i)}:${e}`;H.has(n)||(H.add(n),console.warn(`[${t}] action "${String(i)}" carries the retired key \`${e}\`. ${Rr[e]}`))}if(n.length===0)return;let a=`unknown:${String(i)}:${n.slice().sort().join(`,`)}`;H.has(a)||(H.add(a),console.warn(`[${t}] action "${String(i)}" carries ${n.length===1?`a key`:`keys`} no reader recognizes: \`${n.join("`, `")}\`. Nothing will read ${n.length===1?`it`:`them`} — check for a typo, or promote the key to an explicit field on \`ActionDef\` (packages/core/src/actions/ActionRunner.ts), adding it to \`ACTION_DEF_KEYS\` (packages/core/src/actions/actionKeys.ts) in the SAME commit — the pin test derives one from the other, so either edit alone goes red. Warned rather than rejected because \`tsc\` only sees actions authored in code: this one may have arrived as DATA, and stored \`sys_metadata\` rows reach the runner unparsed (objectstack#3903).`))}var Ur=new Set([`recordId`]),Wr=e=>!e.startsWith(`_`)&&!Ur.has(e);function Gr(e){if(!e||typeof e!=`object`)return!1;let{type:t,actionType:n,params:r}=e;return(t??n)!==`api`||!r||typeof r!=`object`||Array.isArray(r)?!1:Object.keys(r).some(Wr)}function Kr(e,t=`ActionRunner`){if(!Vr()||!Gr(e))return;let n=e?.name??`(unnamed)`,r=`deprecated-object-params:${String(n)}`;H.has(r)||(H.add(r),console.warn(`[${t}] action "${String(n)}" carries a static request payload in \`params\`. \`params\` is the parameter DEFINITION array (fields collected from the user before the action runs), never a payload map — put the payload in \`bodyExtra\` instead (objectstack#5777). Still read as the payload for one version window; the arm is removed at 18. \`bodyExtra\` is merged LAST, so it overrides anything left here.`))}function qr(e,t){let n=e,r=n?.error;if(typeof r==`string`&&r.length>0)return r;let i=r?.message;return typeof i==`string`&&i.length>0?i:typeof n?.message==`string`&&n.message.length>0?n.message:t}function Jr(e){return Xr(e)?e.data:e}var Yr=new Set([`success`,`data`,`error`,`code`,`fields`]);function Xr(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.success==`boolean`&&Object.keys(e).every(e=>Yr.has(e))}function Zr(e,t,n){let r=t?.data,i=Xr(r)&&r.success===!1;return!e.ok||t&&t.success===!1||i?{ok:!1,error:i?qr(r,`${n} failed`):qr(t,`${n} failed (HTTP ${e.status})`)}:{ok:!0,envelope:r,payload:Jr(r)}}function Qr(e){let t=e.user;if(t===void 0)return e;let n=e.os;return n&&typeof n==`object`&&n.user===t?e:{...e,os:{...n&&typeof n==`object`?n:{},user:t}}}var $r=`recordId`,ei=`recordObject`;function ti(e){let t=e.objectName;return typeof t==`string`&&t.trim()!==``?t.trim():void 0}function ni(e,t){return!t||!e.includes(`.`)?!1:!e.startsWith(`${t}.`)}var ri=class{handlers=new Map;scripts=new Map;evaluator;context;confirmHandler;toastHandler;modalHandler;navigationHandler;paramCollectionHandler;resultDialogHandler;builtinExecutors={script:e=>this.executeScript(e),url:e=>this.executeUrl(e),modal:e=>this.executeModal(e),flow:e=>this.executeFlow(e),api:e=>this.executeAPI(e),form:e=>this.executeForm(e),navigation:e=>this.executeNavigation(e)};constructor(e={}){this.context=Qr(e),this.evaluator=new rr(this.context),this.confirmHandler=async e=>window.confirm(e),this.toastHandler=null,this.modalHandler=null,this.navigationHandler=null,this.paramCollectionHandler=null,this.resultDialogHandler=null}setConfirmHandler(e){this.confirmHandler=e}setToastHandler(e){this.toastHandler=e}setModalHandler(e){this.modalHandler=e}setNavigationHandler(e){this.navigationHandler=e}setParamCollectionHandler(e){this.paramCollectionHandler=e}setResultDialogHandler(e){this.resultDialogHandler=e}registerHandler(e,t){this.handlers.set(e,t)}unregisterHandler(e){this.handlers.delete(e)}registerScript(e,t){this.scripts.set(e,t)}unregisterScript(e){this.scripts.delete(e)}async execute(e){try{Hr(e),Kr(e);let t=e.type||e.actionType||e.name||``;if(F(e.condition)&&!this.evaluator.evaluateCondition(e.condition))return{success:!1,error:`Action condition not met`};if(F(e.disabled)){let t=!1;try{t=this.evaluator.evaluateCondition(e.disabled)}catch{t=!1}if(t)return{success:!1,error:`Action is disabled`}}if(e.confirmText&&!await this.confirmHandler(this.evaluator.evaluate(e.confirmText)))return{success:!1,error:`Action cancelled by user`};let n=e.actionParams&&Array.isArray(e.actionParams)?e.actionParams:Array.isArray(e.params)?e.params:void 0;if(n&&n.length>0&&this.paramCollectionHandler){let t=await this.paramCollectionHandler(n,e);if(t===null)return{success:!1,error:`Action cancelled by user (params)`};let r=Array.isArray(e.params)?{}:e.params||{},i=r._rowRecord;e.params={...r,...t},i!==void 0&&(e.params._rowRecord=i)}if(t&&this.handlers.has(t)){let n=await this.handlers.get(t)(e,this.context);return await this.handlePostExecution(e,n),n}let r,i=t?this.builtinExecutors[t]:void 0;return i?r=await i(e):e.navigate?r=await this.executeNavigation(e):e.api||e.endpoint?r=await this.executeAPI(e):e.onClick?(await e.onClick(),r={success:!0}):r=await this.executeActionSchema(e),await this.handlePostExecution(e,r),r}catch(t){let n={success:!1,error:t.message};return await this.handlePostExecution(e,n),n}}async executeChain(e,t=`sequential`){if(e.length===0)return{success:!0};if(t===`parallel`){let t=await Promise.allSettled(e.map(e=>this.execute(e)));if(t.filter(e=>e.status===`rejected`||e.status===`fulfilled`&&!e.value.success).length>0)return{success:!1,error:t.find(e=>e.status===`fulfilled`&&!e.value.success)?.value?.error||`One or more parallel actions failed`};let n=t[t.length-1];return n.status===`fulfilled`?n.value:{success:!1,error:`Action failed`}}let n={success:!0};for(let t of e)if(n=await this.execute(t),!n.success)return n;return n}async handlePostExecution(e,t){let n=!!(e.resultDialog&&t.success);if(this.toastHandler){let r=e.toast??{showOnSuccess:!0,showOnError:!0},i=e.toast?.duration;if(t.success&&!n&&!t.silent&&r.showOnSuccess!==!1){let n=(t.data&&typeof t.data==`object`&&typeof t.data.message==`string`?String(t.data.message).trim():``)||e.successMessage||`Action completed successfully`;if(t.undo)try{V.push(t.undo)}catch{}this.toastHandler(n,{type:`success`,duration:i,undo:t.undo?{}:void 0})}if(!t.success&&r.showOnError!==!1&&t.error){let n=e.errorMessage||t.error,r=typeof n==`string`?n:n&&typeof n.message==`string`?n.message:`Action failed`;this.toastHandler(r,{type:`error`,duration:i})}}if(n){if(this.resultDialogHandler)try{await this.resultDialogHandler(e.resultDialog,t.data,e)}catch(e){console.warn(`[ActionRunner] resultDialog handler rejected; treating as acknowledged`,e)}else console.warn(`[ActionRunner] action.resultDialog set but no resultDialogHandler registered — the response value will not be shown to the user.`,{action:e.name,data:t.data})}if(e.refreshAfter&&t.success&&(t.reload=!0),e.chain&&e.chain.length>0&&t.success){let n=await this.executeChain(e.chain,e.chainMode||`sequential`);n.success||(t.success=!1,t.error=n.error),n.data&&(t.data=n.data),n.redirect&&(t.redirect=n.redirect),n.reload&&(t.reload=!0)}if(t.success&&e.onSuccess){let n=ii(e.onSuccess);n&&this.navigateOnSuccess(n,e,t)}if(!t.success&&e.onFailure){let t=Array.isArray(e.onFailure)?e.onFailure:[e.onFailure];await this.executeChain(t,`sequential`)}}navigateOnSuccess(e,t,n){let r=this.interpolateTarget(e.navigate,t,Jr(n.data));if(!this.isValidUrl(r)){console.warn(`[ActionRunner] onSuccess.navigate resolved to a URL this runner refuses to open (only http://, https:// and relative URLs are allowed) — no navigation performed.`,{action:t.name,navigate:e.navigate,resolved:r});return}let i=e.openIn===`newTab`,a=r.startsWith(`http://`)||r.startsWith(`https://`);if(this.navigationHandler){this.navigationHandler(r,{external:a,newTab:i});return}i?window.open(r,`_blank`,`noopener,noreferrer`):n.redirect=r}async executeScript(e){let t=e.target;if(!t)return e.body==null?typeof e.execute==`string`?{success:!1,error:"`execute` was removed in @objectstack/spec 17 — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."}:{success:!1,error:`No script provided for script action`}:{success:!1,error:"Action body must be executed server-side — this client runner does not interpret `body` (sandboxed JS needs an isolated VM; expression bodies use the formula engine). Register a `script` handler that POSTs to /api/v1/actions/{object}/{action} — build one with createServerActionHandler from @object-ui/core."};let n=this.scripts.get(t);if(n)try{return await n(e,this.context)}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}try{let e=this.evaluator.evaluate(`\${${t}}`);return e!=null&&typeof e.then==`function`&&(e=await e),{success:!0,data:e}}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}}async executeUrl(e){let t=e.target||e.redirect;return t?this.navigateTo(e,t,e):{success:!1,error:`No URL provided for url action`}}async navigateTo(e,t,n){let r=this.interpolateTarget(t,e),i=this.evaluator.evaluate(r);if(!this.isValidUrl(i))return{success:!1,error:`Invalid URL scheme. Only http://, https://, and relative URLs are allowed.`};let a=typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``;a&&/^\/(api|_auth|_account)\//.test(i)&&(i=`${a}${i}`);let o=!!n.external||i.startsWith(`http://`)||i.startsWith(`https://`);if(/\/(api|_auth|_account)\//.test(i)&&(o||i.startsWith(`/`)))return window.location.href=i,{success:!0};let s=n.openIn??e.openIn,c=s===`new-tab`?!0:s===`self`?!1:n.newTab??o,l=n.replace??e.replace;if(this.navigationHandler)return this.navigationHandler(i,{external:o,newTab:c,...l===void 0?{}:{replace:!!l}}),{success:!0};if(c)window.open(i,`_blank`,`noopener,noreferrer`);else return{success:!0,redirect:i};return{success:!0}}async executeModal(e){let t=e.modal||e.target||e.params?.schema;return t?this.modalHandler?await this.modalHandler(t,this.context):{success:!0,modal:t}:{success:!1,error:`No modal schema or target provided for modal action`}}async executeFlow(e){let t=e.target||e.name;return t?this.handlers.has(`flow`)?await this.handlers.get(`flow`)(e,this.context):{success:!1,error:`Flow handler not registered. Cannot execute flow: ${t}`}:{success:!1,error:`No flow target provided for flow action`}}async executeActionSchema(e){let t=!!(e.api||e.endpoint);if(!(t||e.onClick||e.redirect||e.reload===!0||e.close===!0))return{success:!1,error:`Action "${e.name||e.type||e.actionType||`action`}" is not executable: no handler is registered under that name and it declares no api, endpoint, navigate, redirect or onClick.`};let n={success:!0};if(t){let t=await this.executeAPI(e);if(!t.success)return t;n.data=t.data}return e.onClick&&await e.onClick(),n.reload=e.reload!==!1,n.close=e.close!==!1,e.redirect&&(n.redirect=this.evaluator.evaluate(e.redirect)),n}async executeForm(e){let t=this.evaluator.evaluate(e.target);if(!t||typeof t!=`string`)return{success:!1,error:`No form target (FormView name) provided for form action`};let n=(this.context.record&&this.context.record.id)??(this.context.data&&this.context.data.id),r=`/forms/${t}`,i=ti(this.context),a=n==null||ni(t,i)?r:`${r}?${$r}=${encodeURIComponent(String(n))}`+(i?`&${ei}=${encodeURIComponent(i)}`:``);return this.navigationHandler?(this.navigationHandler(a,{external:!1}),{success:!0}):{success:!0,redirect:a}}async executeNavigation(e){let t=e.navigate||e,n=t.to||t.target||t.redirect;return n?this.navigateTo(e,n,t):{success:!1,error:`No URL provided for navigation action`}}buildApiRequestBody(e){let t=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:void 0,n=t(e.bodyExtra),r=t(e.params)??this.context.data,i=e.bodyShape,a=i&&typeof i==`object`&&typeof i.wrap==`string`&&i.wrap?i.wrap:void 0;return a?{[a]:r??{},...n}:n?{...t(r),...n}:r??{}}async executeAPI(e){let t=e.api||e.endpoint||e.target;if(!t)return{success:!1,error:`No API endpoint provided`};try{let n,r,i={"Content-Type":`application/json`},a,o=`json`;if(typeof t==`string`)n=this.interpolateTarget(t,e),r=e.method||`POST`,a=JSON.stringify(this.buildApiRequestBody(e));else{let s=t;if(n=this.interpolateTarget(s.url,e),r=s.method||e.method||`POST`,i={...i,...s.headers},o=s.responseType||`json`,s.queryParams){let e=new URLSearchParams(s.queryParams);n=`${n}${n.includes(`?`)?`&`:`?`}${e.toString()}`}s.body?a=typeof s.body==`string`?s.body:JSON.stringify(s.body):r!==`GET`&&r!==`HEAD`&&(a=JSON.stringify(this.buildApiRequestBody(e)))}let s={method:r,headers:i};a&&r!==`GET`&&r!==`HEAD`&&(s.body=a);let c=await fetch(n,s);if(!c.ok)throw Error(`HTTP ${c.status}: ${c.statusText}`);let l;switch(o){case`text`:l=await c.text();break;case`blob`:l=await c.blob();break;default:l=await c.json()}return{success:!0,data:l}}catch(e){return{success:!1,error:e.message}}}isValidUrl(e){return typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)||e.startsWith(`./`))}interpolateTarget(e,t,n){if(typeof e!=`string`||e.indexOf("${")===-1)return e;let r={param:t.params&&typeof t.params==`object`&&!Array.isArray(t.params)?t.params:{},ctx:this.buildInterpolationContext()};n!==void 0&&(r.result=n);let i=RegExp(`\\$\\{(${Object.keys(r).join(`|`)})\\.([\\w.]+)\\}`,`g`);return e.replace(i,(e,t,n)=>{let i=ai(r[t],n);return i==null?``:encodeURIComponent(String(i))})}buildInterpolationContext(){let e={origin:typeof window<`u`?window.location.origin:``,apiBase:typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``,user:this.context.user??{},org:this.context.org??this.context.organization??{},recordId:this.context.record?.id??this.context.recordId,selection:{ids:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.map(e=>e?.id).filter(e=>e!=null).map(String):[],count:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.length:0}};return this.context.ctx&&typeof this.context.ctx==`object`&&Object.assign(e,this.context.ctx),e}updateContext(e){this.context=Qr({...this.context,...e}),this.evaluator.updateContext(this.context)}getContext(){return this.context}getEvaluator(){return this.evaluator}};function ii(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.navigate;return typeof t!=`string`||t===``?null:e}function ai(e,t){if(e!=null)return t.split(`.`).reduce((e,t)=>{if(e!=null)return e[t]},e)}function oi(e){return e.toLowerCase().split(`+`).map(e=>e.trim()).sort().join(`+`)}var si=new Set;function ci(e,t,n){let r=typeof t==`string`?t:t&&typeof t==`object`&&typeof t.source==`string`?t.source:String(t),i=`${String(e)}::${r}`;if(si.has(i))return;si.add(i);let a=n instanceof Error?n.message:String(n);console.warn(`[ActionEngine] action "${String(e)}" hidden: its \`visible\` predicate threw — ${a}. Predicate: ${r}. Action predicates evaluate against { record, recordId, objectName, user, os.user, … }; use \`record.<field>\` (not a bare field).`)}var li=class{actions=new Map;shortcuts=[];normalizedShortcutMap=new Map;runner;constructor(e={}){this.runner=e instanceof ri?e:new ri(e)}getRunner(){return this.runner}registerAction(e,t){let n=e.name||e.type||``;if(!n)throw Error(`Action must have a name or type`);this.actions.set(n,{action:e,locations:t?.locations||[],shortcut:t?.shortcut,bulkEnabled:t?.bulkEnabled??!1,priority:t?.priority??100}),t?.shortcut&&(this.shortcuts.push({keys:t.shortcut,actionName:n}),this.normalizedShortcutMap.set(oi(t.shortcut),n))}registerActions(e){for(let t of e)this.registerAction(t,{locations:t.locations})}unregisterAction(e){let t=this.actions.get(e);t?.shortcut&&this.normalizedShortcutMap.delete(oi(t.shortcut)),this.actions.delete(e),this.shortcuts=this.shortcuts.filter(t=>t.actionName!==e)}getActionsForLocation(e){let t=this.runner.getEvaluator();return Array.from(this.actions.values()).filter(t=>t.locations.includes(e)).filter(e=>{let t=e.action.requiredPermissions;if(!Array.isArray(t)||t.length===0)return!0;let n=this.runner.getContext()?.user?.systemPermissions;return!Array.isArray(n)||t.every(e=>n.includes(e))}).filter(e=>{let n=e.action.visible;if(!F(n))return!0;let r=qe(n);try{return t.evaluateCondition(r,{throwOnError:!0})}catch(t){return ci(e.action.name,n,t),!1}}).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getBulkActions(){return Array.from(this.actions.values()).filter(e=>e.bulkEnabled).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getShortcuts(){return[...this.shortcuts]}getAction(e){return this.actions.get(e)?.action}async executeAction(e,t){let n=this.actions.get(e);return n?(t&&this.runner.updateContext(t),this.runner.execute(n.action)):{success:!1,error:`Action not found: ${e}`}}async handleShortcut(e,t){let n=this.normalizedShortcutMap.get(oi(e));return n?this.executeAction(n,t):null}async executeBulk(e,t,n){let r=this.actions.get(e);if(!r)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action not found: ${e}`}]};if(!r.bulkEnabled)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action ${e} does not support bulk operations`}]};let i=[],a=0,o=0;if(n?.parallel){let e=t.map(e=>(this.runner.updateContext({record:e,selectedRecords:t}),this.runner.execute(r.action))),n=await Promise.allSettled(e);for(let e of n)e.status===`fulfilled`?(i.push(e.value),e.value.success?a++:o++):(i.push({success:!1,error:e.reason?.message||`Unknown error`}),o++)}else for(let e of t){this.runner.updateContext({record:e,selectedRecords:t});let s=await this.runner.execute(r.action);if(i.push(s),s.success)a++;else if(o++,!n?.continueOnError)break}return{total:t.length,succeeded:a,failed:o,results:i}}updateContext(e){this.runner.updateContext(e)}clear(){this.actions.clear(),this.shortcuts=[],this.normalizedShortcutMap.clear()}};async function ui(e,t){let{ids:n,allowBulk:r,offset:i,label:a=`bulk`}=e,o={succeeded:0,failed:0,errors:[]};if(r&&typeof t.bulkCall==`function`)try{let e=await t.bulkCall(n),r=Math.max(0,Math.min(e,n.length));o.succeeded+=r;let s=n.length-r;return s>0&&(o.failed+=s,o.errors.push({id:`batch_${i}`,error:`${s} record${s===1?``:`s`} failed in ${a}`})),o}catch{}return(await Promise.allSettled(n.map(e=>t.perRow(e)))).forEach((e,t)=>{e.status===`fulfilled`?o.succeeded+=1:(o.failed+=1,o.errors.push({id:n[t],error:e.reason instanceof Error?e.reason.message:String(e.reason)}))}),o}function di(e){let t=e.locations;return Array.isArray(t)?t.some(e=>e===`list_item`||e===`record_header`||e===`record_more`||e===`record_section`):!1}function fi(e,t){let n=e.params&&!Array.isArray(e.params)?e.params:{},r=n._rowRecord,i=e.recordIdField||`id`,a=n.recordId??r?.[i],o=Array.isArray(n._selectedIds);if(a==null&&!o){let n=Array.isArray(t?.selectedRecords)?t.selectedRecords:[];if(n.length===1)a=n[0]?.[i];else if(n.length>1)return{error:`This action runs on a single record — select exactly one row.`};else if(di(e))return{error:`This action runs on a single record — select a row first.`}}return{recordId:a??void 0}}function pi(e){let{fetch:t,resolveObject:n,onRefresh:r}=e,i=e.resolveRecordId??fi,a=new Set;return async function(o,s){let c=o.name;if(!c)return{success:!1,error:`Action has no name — a server action must declare one`};let l=o.params&&!Array.isArray(o.params)?{...o.params}:{};delete l._rowRecord;let u=i(o,s);if(u.error)return{success:!1,error:u.error};let d=u.recordId,f=`${c}:${d??``}`;if(a.has(f))return{success:!1,error:`Action already in progress`};a.add(f);try{let i=typeof e.baseUrl==`function`?e.baseUrl():e.baseUrl??``,a=o.objectName||n?.(o,s)||`global`,u=await t(`${i}/api/v1/actions/${encodeURIComponent(a)}/${encodeURIComponent(c)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:d,params:l})}),f=Zr(u,await u.json().catch(()=>null),`Action "${c}"`);if(!f.ok)return{success:!1,error:f.error};let p=o.refreshAfter!==!1;return p&&r?.(),{success:!0,data:f.envelope,reload:p}}catch(e){return{success:!1,error:e.message}}finally{a.delete(f)}}}function mi(e,t){let n=e?.recordIdParam;if(!n||!t||typeof t!=`object`)return{};let r=e?.recordIdField||`id`,i=e?.label||e?.name||n;if(!(r in t))return{error:`Action "${i}" identifies its record by "${r}", but that field is not present on the row. Add it to the view's columns, or check that it is readable — running without it would send a request that names no record.`};let a=t[r];return a==null?{error:`Action "${i}" identifies its record by "${r}", but this record has no value for it — running without it would send a request that names no record.`}:{value:a}}function hi(e,t,n){let r=e;if(t&&(r=r.replace(/\/+$/,``)+`/`+t.replace(/^\/+/,``)),n&&Object.keys(n).length>0){let e=new URLSearchParams;for(let[t,r]of Object.entries(n))r!=null&&e.set(t,String(r));let t=e.toString();t&&(r+=(r.includes(`?`)?`&`:`?`)+t)}return r}function gi(e){if(!e)return{};let t={};return e.$select?.length&&(t.$select=e.$select.join(`,`)),e.$filter&&Object.keys(e.$filter).length>0&&(t.$filter=JSON.stringify(e.$filter)),e.$orderby&&(t.$orderby=typeof e.$orderby==`string`?e.$orderby:Array.isArray(e.$orderby)?typeof e.$orderby[0]==`string`?e.$orderby.join(`,`):e.$orderby.map(e=>`${e.field} ${e.order||`asc`}`).join(`,`):Object.entries(e.$orderby).map(([e,t])=>`${e} ${t}`).join(`,`)),e.$skip!==void 0&&(t.$skip=e.$skip),e.$top!==void 0&&(t.$top=e.$top),e.$expand?.length&&(t.$expand=e.$expand.join(`,`)),e.$search&&(t.$search=e.$search),e.$count&&(t.$count=`true`),t}function _i(e,t){return{...e,...t}}var vi=class{readConfig;writeConfig;fetchFn;defaultHeaders;constructor(e){this.readConfig=e.read,this.writeConfig=e.write,this.fetchFn=e.fetch??globalThis.fetch.bind(globalThis),this.defaultHeaders=e.defaultHeaders??{}}async request(e,t={}){if(!e)throw Error(`ApiDataSource: No HTTP configuration provided for this operation. Ensure the ViewData has read/write configs.`);let n=t.method??e.method??`GET`,r={...e.params,...t.queryParams},i=hi(e.url,t.pathSuffix,r),a=_i(_i(this.defaultHeaders,e.headers),t.headers),o={method:n,headers:a};t.body!==void 0&&n!==`GET`&&(t.body instanceof FormData||t.body instanceof Blob?o.body=t.body:typeof t.body==`string`?(o.body=t.body,a[`Content-Type`]||=`text/plain`):(o.body=JSON.stringify(t.body),a[`Content-Type`]||=`application/json`));let s=await this.fetchFn(i,o);if(!s.ok){let e=await s.text().catch(()=>``);throw Error(`ApiDataSource: HTTP ${s.status} ${s.statusText} — ${e}`)}return(s.headers.get(`content-type`)??``).includes(`application/json`)?s.json():await s.text()}async find(e,t){let n=gi(t),r=await this.request(this.readConfig,{method:`GET`,queryParams:n});return this.normalizeQueryResult(r)}async findOne(e,t,n){try{let e=gi(n);return await this.request(this.readConfig,{pathSuffix:String(t),method:`GET`,queryParams:e})??null}catch{return null}}async create(e,t){let n=this.writeConfig??this.readConfig;return this.request(n,{method:`POST`,body:t})}async update(e,t,n,r){let i=this.writeConfig??this.readConfig;return this.request(i,{pathSuffix:String(t),method:`PATCH`,body:n,...r?.ifMatch?{headers:{"If-Match":String(r.ifMatch)}}:{}})}async delete(e,t,n){let r=this.writeConfig??this.readConfig;try{return await this.request(r,{pathSuffix:String(t),method:`DELETE`,...n?.ifMatch?{headers:{"If-Match":String(n.ifMatch)}}:{}}),!0}catch{return!1}}batchTransaction(e){return se(this,e)}async getObjectSchema(e){return{name:e,fields:{}}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let n={field:t.field,function:t.function,groupBy:t.groupBy};t.filter&&(n.filter=typeof t.filter==`string`?t.filter:JSON.stringify(t.filter));let r=await this.request(this.readConfig,{pathSuffix:`aggregate`,method:`GET`,queryParams:n});return Array.isArray(r)?r:r?.data&&Array.isArray(r.data)?r.data:r?.results&&Array.isArray(r.results)?r.results:[]}normalizeQueryResult(e){if(Array.isArray(e))return{data:e,total:e.length};if(e&&typeof e==`object`){if(Array.isArray(e.data)&&(`total`in e||`totalCount`in e))return{data:e.data,total:e.total??e.totalCount??e.data.length,hasMore:e.hasMore,cursor:e.cursor};for(let t of[`data`,`items`,`results`,`records`,`value`])if(Array.isArray(e[t]))return{data:e[t],total:e.total??e.totalCount??e.count??e[t].length,hasMore:e.hasMore??e.hasNextPage};return{data:[e],total:1}}return{data:[],total:0}}};l();function yi(e,t){return t?e[t]:e.id??e._id}function bi(e,t){return e.add(`[ObjectUI] ValueDataSource: ${t}. Rows are excluded rather than passed through.`),!1}function xi(e,t,n){let r=t[0],i=t[1],a=i===`not in`?`nin`:oe(i),o=e[r],s=t[2];switch(a){case`is_null`:return o==null;case`is_not_null`:return o!=null;case`=`:return o===s;case`!=`:return o!==s;case`>`:return o>s;case`>=`:return o>=s;case`<`:return o<s;case`<=`:return o<=s;case`in`:return Array.isArray(s)&&s.includes(o);case`nin`:return Array.isArray(s)&&!s.includes(o);case`contains`:case`icontains`:{let e=typeof o==`string`?o.toLowerCase():``;return typeof o==`string`&&e.includes(String(s).toLowerCase())}case`not_contains`:{let e=typeof o==`string`?o.toLowerCase():``;return typeof o==`string`&&!e.includes(String(s).toLowerCase())}case`starts_with`:{let e=typeof o==`string`?o.toLowerCase():``;return typeof o==`string`&&e.startsWith(String(s).toLowerCase())}case`ends_with`:{let e=typeof o==`string`?o.toLowerCase():``;return typeof o==`string`&&e.endsWith(String(s).toLowerCase())}case`between`:return Array.isArray(s)&&s.length===2&&o>=s[0]&&o<=s[1];default:return bi(n,`filter operator '${String(i)}' is not implemented by the in-memory matcher`)}}function Si(e,t,n){if(!Array.isArray(t))return bi(n,`filter node ${JSON.stringify(t)??String(t)} is not an array`);if(t.length===0)return!0;let r=t[0];if(typeof r==`string`){let i=r.toLowerCase();if(i===`and`||i===`or`){if(t.length<2)return bi(n,`'${i}' group carries no conditions`);let r=t.slice(1);return i===`and`?r.every(t=>Si(e,t,n)):r.some(t=>Si(e,t,n))}}return Array.isArray(r)?t.every(t=>Si(e,t,n)):typeof r==`string`&&typeof t[1]==`string`&&t.length<=3?xi(e,t,n):bi(n,`filter node ${JSON.stringify(t)} is not a shape the matcher reads`)}function Ci(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(r&&typeof r==`object`&&!Array.isArray(r))for(let[e,n]of Object.entries(r))switch(e){case`$gt`:if(!(t>n))return!1;break;case`$gte`:if(!(t>=n))return!1;break;case`$lt`:if(!(t<n))return!1;break;case`$lte`:if(!(t<=n))return!1;break;case`$ne`:if(t===n)return!1;break;case`$in`:if(!Array.isArray(n)||!n.includes(t))return!1;break;case`$contains`:if(typeof t!=`string`||!t.toLowerCase().includes(String(n).toLowerCase()))return!1}else if(t!==r)return!1}return!0}function wi(e,t){if(!t)return e;let n=[];return Array.isArray(t)?n=t.map(e=>typeof e==`string`?e.startsWith(`-`)?{field:e.slice(1),order:`desc`}:{field:e,order:`asc`}:{field:e.field,order:e.order??`asc`}):typeof t==`object`&&(n=Object.entries(t).map(([e,t])=>({field:e,order:t}))),n.length===0?e:[...e].sort((e,t)=>{for(let{field:r,order:i}of n){let n=e[r],a=t[r];if(n===a)continue;if(n==null)return i===`asc`?-1:1;if(a==null)return i===`asc`?1:-1;let o=n<a?-1:1;return i===`asc`?o:-o}return 0})}function Ti(e,t){if(!t||t.length===0)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var Ei=class{items;idField;mutationListeners=new Set;constructor(e){this.items=JSON.parse(JSON.stringify(e.items)),this.idField=e.idField}emitMutation(e){for(let t of this.mutationListeners)try{t(e)}catch(e){console.warn(`ValueDataSource: mutation listener error`,e)}}async find(e,t){let n=[...this.items];if(t?.$filter){if(Array.isArray(t.$filter)&&t.$filter.length>0){let e=new Set;n=n.filter(n=>Si(n,t.$filter,e));for(let t of e)console.warn(t)}else!Array.isArray(t.$filter)&&Object.keys(t.$filter).length>0&&(n=n.filter(e=>Ci(e,t.$filter)))}if(t?.$search){let e=t.$search.toLowerCase();n=n.filter(t=>Object.values(t).some(t=>typeof t==`string`&&t.toLowerCase().includes(e)))}let r=n.length;n=wi(n,t?.$orderby);let i=t?.$skip??0,a=t?.$top;return i>0&&(n=n.slice(i)),a!==void 0&&(n=n.slice(0,a)),t?.$select?.length&&(n=n.map(e=>Ti(e,t.$select))),{data:n,total:r,hasMore:i+(a??n.length)<r}}async findOne(e,t,n){let r=this.items.find(e=>String(yi(e,this.idField))===String(t));return r?n?.$select?.length?Ti(r,n.$select):{...r}:null}async create(e,t){let n={...t};if(!yi(n,this.idField)){let e=this.idField??`id`;n[e]=`auto_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}return this.items.push(n),this.emitMutation({type:`create`,resource:e,record:{...n}}),{...n}}async update(e,t,n){let r=this.items.findIndex(e=>String(yi(e,this.idField))===String(t));if(r===-1)throw Error(`ValueDataSource: Record with id "${t}" not found`);return this.items[r]={...this.items[r],...n},this.emitMutation({type:`update`,resource:e,id:t,record:{...this.items[r]}}),{...this.items[r]}}async delete(e,t){let n=this.items.findIndex(e=>String(yi(e,this.idField))===String(t));return n!==-1&&(this.items.splice(n,1),this.emitMutation({type:`delete`,resource:e,id:t}),!0)}async bulk(e,t,n){let r=[];for(let i of n)switch(t){case`create`:r.push(await this.create(e,i));break;case`update`:{let t=yi(i,this.idField);t!==void 0&&r.push(await this.update(e,t,i));break}case`delete`:{let t=yi(i,this.idField);t!==void 0&&await this.delete(e,t);break}}return r}batchTransaction(e){return se(this,e)}async getObjectSchema(e){if(this.items.length===0)return{name:e,fields:{}};let t=this.items[0],n={};for(let[e,r]of Object.entries(t))n[e]={type:typeof r};return{name:e,fields:n}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let{field:n,function:r,groupBy:i}=t,a={};for(let e of this.items){let t=String(e[i]??`Unknown`);a[t]||(a[t]=[]),a[t].push(e)}return Object.entries(a).map(([e,t])=>{let a=t.map(e=>Number(e[n])||0),o;switch(r){case`count`:o=t.length;break;case`avg`:o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:0;break;case`min`:o=a.length>0?Math.min(...a):0;break;case`max`:o=a.length>0?Math.max(...a):0;break;default:o=a.reduce((e,t)=>e+t,0)}return{[i]:e,[n]:o}})}onMutation(e){return this.mutationListeners.add(e),()=>{this.mutationListeners.delete(e)}}get count(){return this.items.length}getAll(){return JSON.parse(JSON.stringify(this.items))}};function Di(e,t,n){if(!e)return t??null;switch(e.provider){case`object`:return t??null;case`api`:return new vi({read:e.read,write:e.write,fetch:n?.fetch,defaultHeaders:n?.defaultHeaders});case`value`:return new Ei({items:e.items??[],idField:n?.idField});default:return t??null}}var U=`https://objectui.dev/docs/errors`,Oi={"OBJUI-001":{code:`OBJUI-001`,message:'Unknown component type: "${type}"',suggestion:`Ensure the component is registered via registry.register() before rendering. Check for typos in the component type name.`,docUrl:`${U}/OBJUI-001`},"OBJUI-002":{code:`OBJUI-002`,message:"Schema validation failed: ${reason}",suggestion:`Verify the schema against the ObjectUI JSON spec. Run the built-in schema validator for details.`,docUrl:`${U}/OBJUI-002`},"OBJUI-003":{code:`OBJUI-003`,message:"Expression evaluation failed: ${expression}",suggestion:`Check the expression syntax and ensure all referenced variables exist in the current data scope.`,docUrl:`${U}/OBJUI-003`},"OBJUI-004":{code:`OBJUI-004`,message:'Plugin dependency missing: "${dependency}"',suggestion:`Install the required dependency and register it before loading this plugin.`,docUrl:`${U}/OBJUI-004`},"OBJUI-005":{code:`OBJUI-005`,message:'Plugin already loaded: "${plugin}"',suggestion:`A plugin with the same name is already registered. Remove the duplicate or use a unique plugin name.`,docUrl:`${U}/OBJUI-005`},"OBJUI-006":{code:`OBJUI-006`,message:'Plugin not found: "${plugin}"',suggestion:`Verify the plugin name and ensure it has been registered before access.`,docUrl:`${U}/OBJUI-006`},"OBJUI-007":{code:`OBJUI-007`,message:'Registry namespace deprecated: "${namespace}"',suggestion:`Migrate to the new namespace format. See the migration guide for details.`,docUrl:`${U}/OBJUI-007`},"OBJUI-008":{code:`OBJUI-008`,message:'Read-only scope violation: "${scope}"',suggestion:`You are trying to mutate a read-only data scope. Use a writable scope or clone the data before modifying.`,docUrl:`${U}/OBJUI-008`},"OBJUI-009":{code:`OBJUI-009`,message:'Invalid field configuration: "${field}"',suggestion:`Check the field schema for required properties (type, name). Ensure the field widget is registered.`,docUrl:`${U}/OBJUI-009`},"OBJUI-010":{code:`OBJUI-010`,message:'Action execution failed: "${action}"',suggestion:`Verify the action handler is registered and that all required parameters are provided.`,docUrl:`${U}/OBJUI-010`}},ki=class extends Error{code;details;constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`ObjectUIError`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,details:this.details,stack:this.stack}}};function Ai(e){return e instanceof ki}var W=`__debug`;function ji(e){let t=e;if(t===void 0)try{t=typeof window<`u`?window.location.search:``}catch{t=``}let n=new URLSearchParams(t),r=n.has(W),i=n.has(`${W}_schema`),a=n.has(`${W}_perf`),o=n.has(`${W}_data`),s=n.has(`${W}_expr`),c=n.has(`${W}_events`),l=n.has(`${W}_registry`);return{enabled:r||i||a||o||s||c||l,...i&&{schema:i},...a&&{perf:a},...o&&{data:o},...s&&{expr:s},...c&&{events:c},...l&&{registry:l}}}function Mi(){try{if(typeof window<`u`)try{if(ji(window.location.search).enabled)return!0}catch{}let e=typeof globalThis<`u`&&globalThis.OBJECTUI_DEBUG;return e===!0||e===`true`||globalThis.process?.env?.OBJECTUI_DEBUG===`true`}catch{return!1}}function Ni(e,t,n){Mi()&&(n===void 0?console.log(`[ObjectUI Debug][${e}] ${t}`):console.log(`[ObjectUI Debug][${e}] ${t}`,n))}var Pi=new Map;function Fi(e){Mi()&&Pi.set(e,performance.now())}function Ii(e){if(!Mi())return;let t=Pi.get(e);if(t!==void 0){let n=(performance.now()-t).toFixed(2);console.log(`[ObjectUI Debug][perf] ${e}: ${n}ms`),Pi.delete(e)}}var Li=200,Ri=class e{static instance=null;entries=[];subscribers=new Set;static getInstance(){return e.instance||=new e,e.instance}static resetInstance(){e.instance=null}addPerf(e){this.push({kind:`perf`,data:e})}addExpr(e){this.push({kind:`expr`,data:e})}addEvent(e){this.push({kind:`event`,data:e})}getEntries(e){return e?this.entries.filter(t=>t.kind===e):this.entries.slice()}clear(){this.entries=[]}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}push(e){this.entries.push(e),this.entries.length>Li&&(this.entries=this.entries.slice(-200));for(let t of this.subscribers)try{t(e)}catch{}}},zi={medium:991,small:640,xsmall:479},Bi=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Vi=e=>Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>`${Bi(e)}: ${typeof t==`number`?String(t):t} !important;`).join(` `);function Hi(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!(t.large||t.medium||t.small||t.xsmall)}function Ui(e){return`os-s-${String(e).replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function Wi(e,t){let n=[];if(t.large){let r=Vi(t.large);r&&n.push(`${e} { ${r} }`)}for(let r of[`medium`,`small`,`xsmall`]){let i=t[r];if(!i)continue;let a=Vi(i);a&&n.push(`@media (max-width: ${zi[r]}px) { ${e} { ${a} } }`)}return n.join(`
|
|
3
|
+
`)}var Gi={"react-pages":!0},Ki=new Map,qi=!1;function Ji(){if(qi)return;qi=!0;let e=globalThis;if(Array.isArray(e.__OBJECTUI_CAPABILITIES__))for(let t of e.__OBJECTUI_CAPABILITIES__)typeof t==`string`&&!Ki.has(t)&&Ki.set(t,!0);if(Array.isArray(e.__OBJECTUI_CAPABILITIES_DISABLED__))for(let t of e.__OBJECTUI_CAPABILITIES_DISABLED__)typeof t==`string`&&Ki.set(t,!1)}function Yi(e){Ji();let t=Ki.get(e);return t===void 0?Gi[e]??!1:t}var Xi=`react-pages`,Zi=/\$\{event\.([a-zA-Z0-9_]+)\}/g;function Qi(e,t){return typeof e!=`string`||e.indexOf("${event.")===-1?e:e.replace(Zi,(e,n)=>{let r=t[n];return r==null?``:String(r)})}function $i(e,t){if(typeof e==`string`){let n=e.match(/^\$\{event\.([a-zA-Z0-9_]+)\}$/);if(n){let e=t[n[1]];return e===``||e===void 0?null:e}return Qi(e,t)}if(Array.isArray(e))return e.map(e=>$i(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=$i(i,t);return n}return e}function ea(e,t,n={}){if(e?.filter)return $i(e.filter,t);let r={},{rowField:i,columnField:a,groupByField:o}=n,s=t.scope??`cell`;return s===`total`?r:((s===`cell`||s===`row`)&&i&&`rowKey`in t&&(r[i]=t.rowKey===``?null:t.rowKey),(s===`cell`||s===`column`)&&a&&`colKey`in t&&(r[a]=t.colKey===``?null:t.colKey),o&&`category`in t&&(r[o]=t.category===``?null:t.category),r)}function ta(e,t,n=`Details`){if(e?.title){let n=Qi(e.title,t).trim();if(n)return n}let r=[];return t.rowLabel&&r.push(t.rowLabel),t.colLabel&&r.push(t.colLabel),t.categoryLabel?r.push(t.categoryLabel):t.category&&r.push(t.category),t.series&&r.push(t.series),r.length>0?r.join(` × `):n}function na(e){return e?e.enabled!==!1:!1}function ra(e,t=new Date){if(e==null)return e;let n=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},r=e=>{let t=n(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},i=e=>{let t=n(e),r=(t.getDay()+6)%7;return t.setDate(t.getDate()-r),t},a=e=>new Date(e.getFullYear(),e.getMonth(),1),o=e=>{let t=Math.floor(e.getMonth()/3);return new Date(e.getFullYear(),t*3,1)},s=e=>new Date(e.getFullYear(),0,1),c=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),l=(e,t)=>{let r=n(e);return r.setDate(r.getDate()+t),r},u=e=>l(c(a(e),1),-1),d=e=>l(i(e),6),f=e=>l(c(o(e),3),-1),p=e=>new Date(e.getFullYear(),11,31),m={today:()=>r(t),yesterday:()=>r(l(t,-1)),tomorrow:()=>r(l(t,1)),now:()=>t.toISOString(),current_week_start:()=>r(i(t)),current_week_end:()=>r(d(t)),current_month_start:()=>r(a(t)),current_month_end:()=>r(u(t)),current_quarter_start:()=>r(o(t)),current_quarter_end:()=>r(f(t)),current_year_start:()=>r(s(t)),current_year_end:()=>r(p(t)),last_week_start:()=>r(l(i(t),-7)),last_week_end:()=>r(l(i(t),-1)),last_month_start:()=>r(c(a(t),-1)),last_month_end:()=>r(l(a(t),-1)),last_quarter_start:()=>r(c(o(t),-3)),last_quarter_end:()=>r(l(o(t),-1)),last_year_start:()=>r(new Date(t.getFullYear()-1,0,1)),last_year_end:()=>r(new Date(t.getFullYear()-1,11,31)),next_week_start:()=>r(l(i(t),7)),next_month_start:()=>r(c(a(t),1)),next_quarter_start:()=>r(c(o(t),3)),next_year_start:()=>r(new Date(t.getFullYear()+1,0,1))};for(let[e,t]of Object.entries({week_start:`current_week_start`,week_end:`current_week_end`,month_start:`current_month_start`,month_end:`current_month_end`,quarter_start:`current_quarter_start`,quarter_end:`current_quarter_end`,year_start:`current_year_start`,year_end:`current_year_end`}))m[e]=m[t];let h=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,g=e=>{let n=e.match(h);if(!n)return null;let i=parseInt(n[1],10);if(!Number.isFinite(i))return null;let a=n[3]===`ago`?-1:1,o=n[2].replace(/s$/,``);if(o===`minute`)return new Date(t.getTime()+a*i*60*1e3).toISOString();if(o===`hour`)return new Date(t.getTime()+a*i*60*60*1e3).toISOString();if(o===`day`)return r(l(t,a*i));if(o===`week`)return r(l(t,a*i*7));if(o===`month`){let e=new Date(t.getFullYear(),t.getMonth()+a*i,t.getDate());return r(e)}if(o===`year`){let e=new Date(t.getFullYear()+a*i,t.getMonth(),t.getDate());return r(e)}return null},_=/\$?\{([a-zA-Z0-9_]+)\}/g,v=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(/^\$?\{([a-zA-Z0-9_]+)\}$/);if(t){let e=t[1];if(m[e])return m[e]();let n=g(e);if(n!=null)return n}let n=!1,r=e.replace(_,(e,t)=>{if(m[t])return n=!0,m[t]();let r=g(t);return r==null?e:(n=!0,r)});return n?r:e}if(Array.isArray(e))return e.map(v);if(typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=v(e[n]);return t}return e};return v(e)}l();var ia={current_user:`current_user_id`,current_user_email:`current_user_id`,user_id:`current_user_id`,userid:`current_user_id`,me:`current_user_id`,current_organization_id:`current_org_id`,org_id:`current_org_id`,organization_id:`current_org_id`,current_tenant_id:`current_org_id`},aa=/^\$?\{([a-zA-Z0-9_]+)\}$/;function oa(e){return b.includes(e)}function sa(e,t={}){if(e==null)return e;let{currentUserId:n,currentOrgId:r}=t,i=t.onUnresolved===null?()=>{}:t.onUnresolved??(e=>{console.warn(`[object-ui] ${e}`)}),a={current_user_id:n,current_org_id:r},o=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(aa);if(!t)return e;let n=t[1];if(oa(n)){let t=a[n];return t!=null&&t!==``?t:(i(`Filter placeholder "{${n}}" could not be resolved — no ${n===`current_user_id`?`signed-in user`:`active organization`} in scope. The filter will match no records.`),e)}let r=ia[n.toLowerCase()];return r&&i(`Filter placeholder "{${n}}" is not a recognised token — did you mean "{${r}}"? It is sent to the server as a literal string and will match no records.`),e}if(Array.isArray(e))return e.map(o);if(typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}return e};return o(e)}function ca(e,t={},n=new Date){return e==null?e:sa(ra(e,n),t)}var la=`dateRange`,ua=`created_at`,da={today:{from:`{today}`,to:`{today}`},yesterday:{from:`{yesterday}`,to:`{yesterday}`},this_week:{from:`{current_week_start}`,to:`{current_week_end}`},last_week:{from:`{last_week_start}`,to:`{last_week_end}`},this_month:{from:`{current_month_start}`,to:`{current_month_end}`},last_month:{from:`{last_month_start}`,to:`{last_month_end}`},this_quarter:{from:`{current_quarter_start}`,to:`{current_quarter_end}`},last_quarter:{from:`{last_quarter_start}`,to:`{last_quarter_end}`},this_year:{from:`{current_year_start}`,to:`{current_year_end}`},last_year:{from:`{last_year_start}`,to:`{last_year_end}`},last_7_days:{from:`{7_days_ago}`,to:`{today}`},last_30_days:{from:`{30_days_ago}`,to:`{today}`},last_90_days:{from:`{90_days_ago}`,to:`{today}`}};function fa(e){return da[e]}var pa=/^\d{4}-\d{2}-\d{2}(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/;function ma(e){return ra(e)!==e||pa.test(e)&&!Number.isNaN(Date.parse(e))}function ha(){return g.join(`, `)}function ga(e){typeof console<`u`&&console.warn(`[dashboard-filters] ${e}`)}var _a=()=>!1,va=new Set;function ya(e){let t=Vt(e);if(t===e)return e;let n=e?.name??e?.field??`?`,r=t?.defaultValue;return ga(`filter "${n}": \`defaultValue: { preset: ${JSON.stringify(r)} }\` is a LEGACY spelling (objectui#4165) and was lifted to the canonical bare preset name ${JSON.stringify(r)}. Rewrite the stored dashboard — the object form is refused by @objectstack/spec and its acceptance here ends with @object-ui/types 18.`),t}function ba(e,t){return e!==`date`&&e!==`dateRange`||typeof t!=`string`?t:t in da?{preset:t}:t}function xa(e,t){if(!Array.isArray(e)||e.length===0)return;let n=[],r=[];for(let t of e)if(t!=null){if(typeof t==`object`){let e=t.value;if(e==null)continue;let r=t.label,i=typeof r==`object`&&!!r&&!Array.isArray(r);n.push({value:String(e),label:typeof r==`string`&&r||i?r:String(e)})}else r.push(String(t)),n.push({value:String(t),label:String(t)})}return r.length>0&&Sa(t,r),n.length>0?n:void 0}function Sa(e,t){if(!_a())return;let n=`${e}:${t.join(`,`)}`;if(va.has(n))return;va.add(n);let r=t.map(e=>`{ value: ${JSON.stringify(e)}, label: ${JSON.stringify(e)} }`).join(`, `);ga(`filter "${e}": \`options\` carries the bare-string shorthand (${t.map(e=>JSON.stringify(e)).join(`, `)}), which @objectstack/spec's \`GlobalFilterSchema\` REFUSES at publish — a dashboard authored this way renders here and is rejected the moment it reaches the platform (objectui#4356). Rewrite the stored dashboard to the canonical pair form: [${r}]. Still lifted here for already-persisted dashboards; the lift is removed on the objectstack#7917 schedule.`)}function Ca(e){let t=new Map;if(e.dateRange){let n=e.dateRange.defaultRange;t.set(la,{name:la,field:e.dateRange.field||ua,type:`dateRange`,defaultValue:n&&n!==`custom`?{preset:n}:void 0,allowCustomRange:e.dateRange.allowCustomRange})}for(let n of e.globalFilters??[]){if(!n?.field)continue;let e=ya(n),r=e.name||e.field;t.has(r)&&typeof console<`u`&&console.warn(`[dashboard-filters] duplicate filter name "${r}" — the later definition wins`);let i=e.type??`text`;t.set(r,{name:r,field:e.field,label:e.label,type:i,options:xa(e.options,r),optionsFrom:e.optionsFrom,defaultValue:ba(i,e.defaultValue),targetWidgets:e.targetWidgets})}return Array.from(t.values())}function wa(e){return e.map(e=>({name:e.name,type:e.type===`dateRange`?`object`:`string`,defaultValue:e.defaultValue}))}function Ta(e,t){if(t==null||t===``)return!0;if(Array.isArray(t))return t.length===0;if(e.type===`dateRange`||e.type===`date`){let e=t;return typeof e==`object`&&!e.preset&&!e.from&&!e.to}return typeof t==`object`&&Object.keys(t).length===0}function Ea(e,t){if(!Ta(e,t)){if(e.type===`dateRange`||e.type===`date`){let n=t;if(typeof n==`object`){let t=typeof n.preset==`string`&&n.preset?n.preset:void 0,r=t?fa(t):void 0,i=r?.from??n.from,a=r?.to??n.to;return t&&!r&&ga(i||a?`filter "${e.name}": ignoring unknown date range preset "${t}" — using the explicit from/to bounds instead; known presets: ${ha()}`:`skipping filter "${e.name}": unknown date range preset "${t}" — expected one of: ${ha()}`),!i&&!a?void 0:{...i?{$gte:i}:{},...a?{$lte:a}:{}}}if(typeof n==`string`&&!ma(n)){ga(`skipping filter "${e.name}": value "${n}" is neither a known date range preset nor an ISO date — expected one of: ${ha()}, an ISO date (YYYY-MM-DD), or a date macro such as {today}`);return}return t}return e.type===`select`||e.type===`lookup`?Array.isArray(t)?{$in:t}:t:e.type===`text`?{$contains:t}:t}}function Da(e,t){let n=e.filterBindings?.[t.name];if(n!==!1){if(typeof n==`string`&&n)return n;if(!(t.targetWidgets&&t.targetWidgets.length>0&&(!e.id||!t.targetWidgets.includes(e.id))))return t.field}}function Oa(e,t,n,r){let i=[];for(let a of t){let t=n[a.name];if(Ta(a,t))continue;let o=Da(e,a);if(!o)continue;if(typeof e.filterBindings?.[a.name]!=`string`&&r&&!r.has(o)){typeof console<`u`&&console.warn(`[dashboard-filters] skipping filter "${a.name}" on widget "${e.id??`?`}": default field "${o}" does not exist on the widget's object — map it with filterBindings: { "${a.name}": "<field>" } or opt out with false`);continue}let s=Ea(a,t);s!==void 0&&i.push({[o]:s})}if(i.length!==0)return i.length===1?i[0]:{$and:i}}function ka(e,t){let n=e&&Object.keys(e).length>0,r=t&&Object.keys(t).length>0;if(n&&r)return{$and:[e,t]};if(n)return e;if(r)return t}var Aa={current_week_start:`last_week_start`,current_week_end:`last_week_end`,current_month_start:`last_month_start`,current_month_end:`last_month_end`,current_quarter_start:`last_quarter_start`,current_quarter_end:`last_quarter_end`,current_year_start:`last_year_start`,current_year_end:`last_year_end`,week_start:`last_week_start`,week_end:`last_week_end`,month_start:`last_month_start`,month_end:`last_month_end`,quarter_start:`last_quarter_start`,quarter_end:`last_quarter_end`,year_start:`last_year_start`,year_end:`last_year_end`,today:`yesterday`};function ja(e,t){if(e==null)return e;if(typeof e==`string`)return e.replace(/\$?\{([a-zA-Z0-9_]+)\}/g,(e,n)=>{let r=t[n];return r?`{${r}}`:e});if(Array.isArray(e))return e.map(e=>ja(e,t));if(typeof e==`object`){let n={};for(let r of Object.keys(e))n[r]=ja(e[r],t);return n}return e}function Ma(e,t,n=new Date){return t.kind===`previousYear`?ra(e,new Date(n.getFullYear()-1,n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds())):ra(ja(e,Aa),n)}function Na(e,t){if(e.kind===`previousYear`)return`vsLastYear`;let n=t?JSON.stringify(t):``;return/current_year_|year_start|year_end/.test(n)?`vsLastYear`:/current_quarter_|quarter_start|quarter_end/.test(n)?`vsLastQuarter`:/current_month_|month_start|month_end/.test(n)?`vsLastMonth`:/current_week_|week_start|week_end/.test(n)?`vsLastWeek`:/\btoday\b/.test(n)?`vsYesterday`:`vsPreviousPeriod`}var Pa=e=>e==null?null:String(e),Fa=e=>JSON.stringify(e),Ia=(e,t)=>JSON.stringify([e,t]),La=[`count`,`sum`,`avg`,`min`,`max`,`count_distinct`];function Ra(e){return typeof e==`string`&&La.includes(e)}function za(e,t){let n=e.builtinAggregate;if(Ra(n)){let e=t?.[n];if(typeof e==`string`&&e!==``)return e}return e.label??e.name}function G(e){return Fa([Pa(e)])}var Ba=`__bucketId`;function Va(e){if(!e||typeof e!=`object`)return;let t=e[Ba];return typeof t==`string`&&t!==``?t:void 0}function Ha(e,t){return K(e,t)&&e[t]==null}function K(e,t){return!!e&&typeof e==`object`&&t in e}function Ua(e){return e==null?``:String(e)}function Wa(e){let t=new Map;for(let{id:n,display:r}of e){let e=t.get(r);e||t.set(r,e=new Set),e.add(n)}let n=new Set;for(let[e,r]of t)r.size>1&&n.add(e);return n}function Ga(e,t,n){let r=e=>Ha(e,t)?n:e[t],i=Wa(e.filter(e=>K(e,t)).map(e=>({id:G(e[t]),display:Ua(r(e))}))),a=!1,o=e.map(e=>{if(!K(e,t))return e;let o=Ha(e,t),s=i.has(Ua(r(e)));return!o&&!s?e:(a=!0,{...e,...o?{[t]:n}:{},...s?{[Ba]:G(e[t])}:{}})});return a?o:e}function Ka(e,t,n,r){let i=new Map;for(let r of e){if(!K(r,t))continue;let e=G(r[t]);i.has(e)||i.set(e,{id:e,label:Ha(r,t)?n:String(r[t])})}let a=Array.from(i.values()),o=Wa(a.map(({id:e,label:t})=>({id:e,display:t}))),s=new Set([r,Ba]),c=new Set(a.map(({id:e})=>e));return a.map(({id:e,label:t})=>({id:e,label:t,dataKey:o.has(t)||s.has(t)||c.has(t)?e:t}))}function qa(e,t,n,r,i){let a=(t??[]).filter(Boolean),o=(n??[]).filter(Boolean),s=Array.isArray(e)?e:[],c=e=>{let t=(r??[]).find(t=>t.name===e);return t?za(t,i?.builtinAggregateLabels):e};if(a.length>=2&&o.length===1){let e=a[0],t=a[1],n=o[0],r=i?.nullCategoryLabel??`(None)`,c=Ka(s,t,r,e),l=new Map(c.map(({id:e,dataKey:t})=>[e,t])),u=new Map;for(let i of s){let a=i[e],o=G(a),s=u.get(o);s||u.set(o,s={}),K(i,e)&&!K(s,e)&&(s[e]=Ha(i,e)?r:a);let c=K(i,t)?l.get(G(i[t])):void 0;c!==void 0&&(s[c]=i[n])}let d=Wa(Array.from(u.entries()).map(([t,n])=>({id:t,display:Ua(n[e])})));return{data:Array.from(u.entries()).map(([t,n])=>d.has(Ua(n[e]))?{...n,[Ba]:t}:n),xAxisKey:e,series:c.map(({dataKey:e,label:t})=>({dataKey:e,label:t}))}}let l=a[0];return{data:l?Ga(s,l,i?.nullCategoryLabel??`(None)`):s,xAxisKey:l,series:o.map(e=>({dataKey:e,label:c(e)}))}}function Ja(e,t){let n=Array.isArray(e)?e:[];if(!t)return n;let r=Object.keys(t).filter(e=>t[e]&&Object.keys(t[e]).length>0);return r.length===0?n:n.map(e=>{let n=null;for(let i of r){let r=e[i];if(r==null)continue;let a=t[i][String(r)];a!=null&&a!==r&&(n||={...e},n[i]=a)}return n??e})}function Ya(e,t,n,r,i,a){let o=(t??[]).filter(Boolean),s=(n??[]).filter(Boolean),c=Array.isArray(e)?e:[],l=o[0];if(!l)return-1;let u=String(r??``),d=a?.nullCategoryLabel??`(None)`,f=a?.bucketId,p=typeof f==`string`&&f!==``?e=>G(e[l])===f:e=>(e[l]==null?d:String(e[l]))===u;if(o.length>=2&&s.length===1){let e=o[1],t=Ka(c,e,d,l).find(({dataKey:e})=>e===String(i??``))?.id;return t===void 0?-1:c.findIndex(n=>p(n)&&K(n,e)&&G(n[e])===t)}return c.findIndex(e=>p(e))}function Xa(e){if(!Array.isArray(e)||e.length===0)return null;let t={};for(let n of e)if(n&&typeof n==`object`){let e=n;typeof e.color==`string`&&e.color&&(e.value!=null&&(t[String(e.value)]=e.color),e.label!=null&&(t[String(e.label)]=e.color))}return Object.keys(t).length>0?t:null}function Za(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`){t.push(String(n));continue}if(n&&typeof n==`object`){let e=n;e.value!=null&&t.push(String(e.value)),e.label!=null&&String(e.label)!==String(e.value)&&t.push(String(e.label))}}return t.length>0?t:null}function Qa(e){if(!Array.isArray(e)||e.length===0)return null;let t=new Map;return e.forEach((e,n)=>{t.has(e)||t.set(e,n)}),t.size>0?t:null}function $a(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return{value:String(e),label:String(e)};if(e&&typeof e==`object`){let t=e;if(t.value!=null&&t.label!=null)return{value:String(t.value),label:String(t.label)}}return null}function eo(e,t){if(!t||!Array.isArray(e)||e.length===0)return e;let n=!1,r=e.map(e=>{let r=$a(e);if(!r)return e;let i=t(r.value,r.label);return i===r.label?e:(n=!0,e&&typeof e==`object`?{...e,label:i}:{value:r.value,label:i})});return n?r:e}function to(e,t){if(!Array.isArray(e)||e.length===0)return null;let n={},r={};for(let i of e){let e=$a(i);if(!e)continue;let a=t?t(e.value,e.label):e.label;a!==e.value&&(n[e.value]=a),a!==e.label&&(r[e.label]=a)}let i={...r,...n};return Object.keys(i).length>0?i:null}var no=new Set([`lookup`,`master_detail`,`masterdetail`,`master-detail`]);function ro(e){let t=e?.fields;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function io(e){if(!e||typeof e!=`object`)return;let t=e,n=typeof t.type==`string`?t.type.toLowerCase():``;if(!no.has(n))return;let r=t.reference;return typeof r==`string`&&r?r:void 0}async function ao(e,t,n){let r={},i=Array.from(new Set((t??[]).filter(e=>!!e)));if(i.length===0)return r;let a=new Map,o=e?.name;typeof o==`string`&&o&&a.set(o,Promise.resolve(e));let s=e=>{let t=a.get(e);return t||(t=Promise.resolve().then(()=>n(e)).catch(()=>null),a.set(e,t)),t};for(let t of i){let n=t.split(`.`),i=e,a=typeof o==`string`&&o?o:void 0,c=!0;for(let e=0;e<n.length-1;e+=1){let t=io(ro(i)?.[n[e]]);if(!t){c=!1;break}if(i=await s(t),!i){c=!1;break}let r=i.name;a=typeof r==`string`&&r?r:t}if(!c)continue;let l=n[n.length-1],u=ro(i)?.[l];u?.options!==void 0&&(r[t]={object:a,field:l,options:u.options})}return r}function oo(e,t){let n=e?.object;if(!n||!t)return;let r=e.field;return(e,i)=>t(n,r,e,i)}function so(e,t,n){if(!e||!t||t.length===0)return null;let r={};for(let{dim:i,path:a}of t){let t=e[a],o=to(t?.options,oo(t,n));o&&(r[i]=o)}return Object.keys(r).length>0?r:null}async function co(e,t,n){return ao(await e(t),n,e)}var lo=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function uo(e){if(typeof e==`string`&&e)return e;if(lo(e))return Object.values(e).find(e=>typeof e==`string`&&e)}function fo(e){let t={},n=e.type;(n===`bar`||n===`line`||n===`area`)&&(t.chartType=n),(e.yAxis===`left`||e.yAxis===`right`)&&(t.yAxis=e.yAxis);let r=uo(e.label);return r&&(t.label=r),typeof e.color==`string`&&e.color&&(t.color=e.color),typeof e.stack==`string`&&e.stack&&(t.stack=e.stack),(e.variant===`primary`||e.variant===`comparison`)&&(t.variant=e.variant),typeof e.dashArray==`string`&&e.dashArray&&(t.dashArray=e.dashArray),typeof e.opacity==`number`&&Number.isFinite(e.opacity)&&(t.opacity=e.opacity),t}function po(e){let t={};if(!lo(e))return t;let n=uo(e.title);return n&&(t.title=n),typeof e.format==`string`&&e.format&&(t.format=e.format),typeof e.min==`number`&&Number.isFinite(e.min)&&(t.min=e.min),typeof e.max==`number`&&Number.isFinite(e.max)&&(t.max=e.max),typeof e.stepSize==`number`&&Number.isFinite(e.stepSize)&&e.stepSize>0&&(t.stepSize=e.stepSize),typeof e.showGridLines==`boolean`&&(t.showGridLines=e.showGridLines),(e.position===`left`||e.position===`right`||e.position===`top`||e.position===`bottom`)&&(t.position=e.position),typeof e.logarithmic==`boolean`&&(t.logarithmic=e.logarithmic),t}function mo(e,t){let n=new Map;for(let e of Array.isArray(t)?t:[]){if(!lo(e))continue;let t=typeof e.name==`string`?e.name:void 0;t&&!n.has(t)&&n.set(t,e)}return e.map(e=>{let t=n.get(e.dataKey);return t?{...e,...fo(t)}:e})}function ho(e,t){let n=lo(t)?t:{},r=mo(e,n.series),i={},a=po(n.xAxis);Object.keys(a).length>0&&(i.xAxis=a);let o=Array.isArray(n.yAxis)?n.yAxis:n.yAxis===void 0?[]:[n.yAxis];return o.length>0&&(i.yAxis=o.map(po)),{series:r,axes:i}}function go(e,t){let n=lo(e)?e:{},r={},i=e=>typeof e==`string`&&e?e:void 0;typeof n.showLegend==`boolean`&&(r.showLegend=n.showLegend),typeof n.showDataLabels==`boolean`&&(r.showDataLabels=n.showDataLabels);let a=i(n.title);a&&(r.title=a);let o=i(n.subtitle);o&&(r.subtitle=o);let s=i(n.description);s&&(r.description=s),typeof n.height==`number`&&Number.isFinite(n.height)&&n.height>0&&(r.height=n.height),Array.isArray(n.annotations)&&n.annotations.length>0&&(r.annotations=n.annotations),n.interaction&&typeof n.interaction==`object`&&!Array.isArray(n.interaction)&&(r.interaction=n.interaction);let c=Array.isArray(n.colors)?n.colors.filter(e=>typeof e==`string`&&!!e):void 0;c?.length&&(r.colors=c);let l=n.colors&&typeof n.colors==`object`&&!Array.isArray(n.colors)?n.colors:void 0;return(t||l)&&(r.categoryColors={...t??{},...l??{}}),r}function _o(e,t){return t?!0:e!==0}function vo(e,t={}){let{locale:n,currency:r,scale:i,style:a,...o}=t,s={...o};a===`percentPoints`?(s.style=`unit`,s.unit=`percent`,s.unitDisplay=`narrow`):a&&(s.style=a),r&&(s.style=`currency`,s.currency=r,delete s.unit,delete s.unitDisplay),_o(i,r)||(s.useGrouping=!1);try{return new Intl.NumberFormat(n,s).format(e)}catch{return new Intl.NumberFormat(void 0,s).format(e)}}function yo(e,t){try{let n=new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(e,`day`);return n.charAt(0).toUpperCase()+n.slice(1)}catch{return e===0?`Today`:e===1?`Tomorrow`:e===-1?`Yesterday`:e>0?`In ${e} days`:`${Math.abs(e)} days ago`}}function bo(e,t){if(e==null||e===``)return`—`;let n=e instanceof Date?e:new Date(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;let r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime()-i.getTime(),o=Math.round(a/864e5);if(o<-7||o>7)return xo(n,void 0,t);if(o<-1&&t?.dueLike){let e=Math.abs(o),n=`fields.relativeDate.overdue`,r=t.t?.(n,{count:e});return r&&r!==n?r:`Overdue ${e}d`}return yo(o,t?.locale)}function xo(e,t,n){if(e==null||e===``)return`—`;let r=e instanceof Date?e:new Date(e);if(!(r instanceof Date)||isNaN(r.getTime()))return`—`;if(t===`short`)return`${r.toLocaleDateString(n?.locale,{month:`short`})} ${r.getDate()}, '${String(r.getFullYear()).slice(-2)}`;if(t===`relative`)return bo(r,n);let i=r.getFullYear()===new Date().getFullYear();return r.toLocaleDateString(n?.locale,{year:i?void 0:`numeric`,month:`short`,day:`numeric`})}function So(e,t){if(e==null||e===``)return null;let n=e instanceof Date?e:new Date(e);return!(n instanceof Date)||isNaN(n.getTime())?null:{date:n.toLocaleDateString(t?.locale,{month:`numeric`,day:`numeric`,year:`numeric`}),time:n.toLocaleTimeString(t?.locale,{hour:`numeric`,minute:`2-digit`,hour12:!0}).toLowerCase()}}function Co(e,t){if(e==null||e===``)return`—`;let n=e instanceof Date?e:new Date(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;if(t?.style===`compact`){let e=So(n,t);return e?`${e.date} ${e.time}`:`—`}return n.toLocaleDateString(t?.locale,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function wo(e){return e>-1&&e<1?e*100:e}function To(e,t,n){return vo(e,{...n,locale:t})}var Eo=/^\d{4}-\d{2}-\d{2}$/,Do=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function Oo(e,t,n){if(typeof e==`string`){if(Eo.test(e))return Number.isNaN(Date.parse(e))?void 0:xo(e,t,{locale:n});if(Do.test(e))return Number.isNaN(Date.parse(e))?void 0:Co(e,{locale:n})}}function ko(e,t,n,r,i){if(e==null)return`—`;if(typeof e!=`number`)return Oo(e,t,i)??String(e);let a=t?t.split(`.`)[1]?.match(/0/g)?.length??0:void 0;if(n)try{return To(e,i,{currency:n,minimumFractionDigits:a??0,maximumFractionDigits:a??2})}catch{}if(!t)return Number.isInteger(e)?String(e):To(e,i,{maximumFractionDigits:2});let o=t.includes(`%`);return`${t.includes(`$`)?`$`:``}${To(o?r?r===`fraction`?e*100:e:wo(e):e,i,{style:o?`percentPoints`:`decimal`,minimumFractionDigits:a??0,maximumFractionDigits:a??0})}`}function Ao(e,t){return e==null?`—`:typeof e==`number`?Number.isInteger(e)?String(e):To(e,t,{maximumFractionDigits:2}):String(e)}function jo(e,t,n,r){let i=new Map((e??[]).map(e=>[e.name,e])),a=e=>i.get(e);return{measureField:a,headerLabel:e=>{let i=a(e),o=i?za(i,r):e;return t&&n?n(t,e,o):o}}}function Mo(e,t,n,r,i){let a={};for(let r of t){let t=e?.[r];a[n[r]]=t===``||t===void 0?null:t}if(i)for(let e of Object.values(i))e&&e.field&&(a[e.field]={$gte:e.gte,$lt:e.lt});return r?{...r,...a}:a}var No=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function Po(e){return No.test(e)||e.startsWith(`rgb`)||e.startsWith(`hsl`)}function Fo(e){let t=e?.options;if(!Array.isArray(t))return{};let n={};for(let e of t)!e||typeof e!=`object`||e.value!=null&&typeof e.color==`string`&&e.color&&(n[String(e.value)]=e.color);return n}function Io(e){let t=Fo(e);return e=>{if(e==null||e===``)return;let n=String(e);return t[n]||(Po(n)?n:void 0)}}var Lo=/[\\/:*?"<>|\u0000-\u001f]+/g,Ro=80;function zo(e){return e?String(e).replace(Lo,`_`).replace(/\s+/g,` `).replace(/_{2,}/g,`_`).replace(/^[\s._-]+|[\s._-]+$/g,``).slice(0,Ro):``}function Bo(e,t={},n=new Date){let r=zo(t.prefix),i=r||zo(t.label)||zo(t.objectName)||`export`,a=zo(t.viewLabel);!r&&a&&a.toLowerCase()!==i.toLowerCase()&&(i=`${i}-${a}`.slice(0,Ro));let o=e=>String(e).padStart(2,`0`),s=`${n.getFullYear()}${o(n.getMonth()+1)}${o(n.getDate())}-${o(n.getHours())}${o(n.getMinutes())}${o(n.getSeconds())}`;return`${i}-${s}.${e}`}var Vo=new Set([`id`,`created_at`,`created_by`,`updated_at`,`updated_by`,`owner_id`,`organization_id`,`owning_business_unit_id`]);function Ho(e,t){return Vo.has(e)?!0:!!t&&typeof t==`object`&&e in t}var Uo=/\b(?:record|data)\.([A-Za-z_][A-Za-z0-9_]*)/g,Wo=/^[A-Za-z_][A-Za-z0-9_]*$/;function Go(e){if(typeof e==`string`)return e.trim()||null;if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t.trim()||null}return null}function Ko(e){let t=[],n=new Set;for(let r of e){let e=Go(r);if(e){Uo.lastIndex=0;for(let r=Uo.exec(e);r;r=Uo.exec(e)){let e=r[1];n.has(e)||(n.add(e),t.push(e))}}}return t}function qo(e){let t=[];for(let n of e.conditionalFormatting??[]){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.condition,e.expression),typeof e.field==`string`&&e.field&&t.push(`record.${e.field}`)}for(let n of[e.rowActionDefs,e.bulkActionDefs,e.objectActions])for(let e of n??[]){if(!e||typeof e!=`object`)continue;let n=e;t.push(n.visible,n.disabled),typeof n.recordIdField==`string`&&Wo.test(n.recordIdField)&&t.push(`record.${n.recordIdField}`)}for(let n of Object.values(e.userActions??{})){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.visibleWhen,e.disabledWhen)}return t}function Jo(e){let t=e?.fields;if(!Array.isArray(t))return[];let n=[],r=new Set;for(let e of t){let t=e?.field;if(typeof t!=`string`)continue;let i=t.trim();!i||r.has(i)||(r.add(i),n.push(i))}return n}var Yo={compact:`compact`,comfortable:`medium`,spacious:`tall`},Xo={compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`};function Zo(e){if(typeof e==`string`&&Object.prototype.hasOwnProperty.call(Xo,e))return Xo[e]}var Qo=e=>!!e&&typeof e==`object`&&!Array.isArray(e),$o={showSearch:`search`,showSort:`sort`,showFilters:`filter`,showDensity:`rowHeight`,showGroup:`group`,showHideFields:`hideFields`,showColor:`rowColor`},es={private:`personal`,team:`collaborative`,organization:`collaborative`,public:`collaborative`},ts={label:`ariaLabel`,describedBy:`ariaDescribedBy`},ns={grid:!0,kanban:!0,gallery:!0,calendar:!0,timeline:!0,gantt:!0,map:!0,chart:!0,tree:!0};function rs(e){if(typeof e==`string`)return Object.prototype.hasOwnProperty.call(ns,e)?e:void 0}var is={kanban:{groupField:`groupByField`,cardFields:`columns`},gallery:{imageField:`coverField`},timeline:{dateField:`startDateField`}};function as(e){if(!e||typeof e!=`object`)return e;let t=e,n=t.fields,r=Array.isArray(n),i=t.densityMode,a=typeof i==`string`&&i in Yo,o=t.filters,s=Array.isArray(o),c=Object.keys($o).filter(e=>typeof t[e]==`boolean`),l=typeof t.showDescription==`boolean`,u=Qo(t.aria)?t.aria:void 0,d=!!u&&Object.keys(ts).some(e=>u[e]!==void 0),f=Qo(t.sharing)?t.sharing:void 0,p=!!f&&(f.visibility!==void 0||f.enabled!==void 0),m=Qo(t.data)?t.data:void 0,h=m?.provider===`object`&&typeof m.object==`string`&&m.object?m.object:void 0,g=h!==void 0&&!(typeof t.objectName==`string`&&t.objectName),_=t.viewType,v=rs(t.specType)??rs(t.type),y=!_||_===`list`,b=Array.isArray(t.columns)?t.columns:r?n:void 0,x=Tt(b),S=x!==b,ee=Object.entries(is).map(([e,n])=>{let r=Qo(t[e])?t[e]:void 0;if(!r)return;let i=Object.keys(n).filter(e=>r[e]!==void 0);return i.length?{viewKey:e,aliases:n,cfg:r,legacyKeys:i}:void 0}).filter(e=>e!==void 0);if(!r&&!a&&!s&&!c.length&&!l&&!d&&!p&&!y&&!S&&!ee.length&&!g)return e;let C={...t};if(r&&(Array.isArray(C.columns)||(C.columns=n),delete C.fields),S&&(C.columns=x),a&&(typeof C.rowHeight!=`string`&&(C.rowHeight=Yo[i]),delete C.densityMode),s&&(Array.isArray(C.filter)||(C.filter=o),delete C.filters),c.length){let e={...Qo(C.userActions)?C.userActions:{}};for(let n of c){let r=$o[n];typeof e[r]!=`boolean`&&(e[r]=t[n]),delete C[n]}C.userActions=e}if(l){let e={...Qo(C.appearance)?C.appearance:{}};typeof e.showDescription!=`boolean`&&(e.showDescription=t.showDescription),delete C.showDescription,C.appearance=e}if(d&&u){let e={...u};for(let[t,n]of Object.entries(ts))e[n]===void 0&&u[t]!==void 0&&(e[n]=u[t]),delete e[t];C.aria=e}if(p&&f){let e={...f};if(e.type===void 0){let t=typeof f.visibility==`string`?f.visibility:void 0,n=t?es[t]:f.enabled===!0?`personal`:void 0;n&&(e.type=n)}delete e.visibility,delete e.enabled,C.sharing=e}for(let{viewKey:e,aliases:t,cfg:n,legacyKeys:r}of ee){let i={...n};for(let e of r){let r=t[e];i[r]===void 0&&(i[r]=n[e]),delete i[e]}C[e]=i}return g&&(C.objectName=h),y&&(C.viewType=v??`grid`),C}function os(e,t){return t?.provider===`object`?t.object:e?.objectName}function ss(e){return e.data?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}function cs(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var q=(0,I.createContext)(null),ls=({children:e,dataSource:t,debug:n,debugFlags:r,apiFetch:i})=>{let a=(0,I.useContext)(q),o=i??a?.apiFetch,s=(0,I.useMemo)(()=>({dataSource:t,debug:n,debugFlags:r,apiFetch:o}),[t,n,r,o]);return(0,L.jsx)(q.Provider,{value:s,children:e})},us=()=>{let e=(0,I.useContext)(q);if(!e)throw Error(`useSchemaContext must be used within a SchemaRendererProvider`);return e},ds=e=>{let t=(0,I.useContext)(q)?.dataSource;if(e&&t)return e.split(`.`).reduce((e,t)=>e&&e[t],t)},fs=I.createContext(null),ps=({children:e})=>{let t=I.useMemo(()=>{let e=new Map,t=vs,n=new Set,r=()=>{let r=new Set;for(let t of e.values())for(let e of t)r.add(e);if(r.size===t.size){let e=!0;for(let n of r)if(!t.has(n)){e=!1;break}if(e)return}t=r,n.forEach(e=>e())};return{getNames:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),register:(t,n)=>{let i=e.get(t);i&&i.length===n.length&&i.every((e,t)=>e===n[t])||(e.set(t,[...n]),r())},unregister:t=>{e.delete(t)&&r()}}},[]);return(0,L.jsx)(fs.Provider,{value:t,children:e})};function ms(){let e=I.useContext(fs);return I.useSyncExternalStore(e?e.subscribe:gs,e?e.getNames:_s,e?e.getNames:_s)}function hs(e,t){let n=I.useContext(fs),r=t.join(`|`);I.useEffect(()=>{if(n)return n.register(e,r.length===0?[]:r.split(`|`)),()=>n.unregister(e)},[n,e,r])}var gs=e=>()=>{},_s=()=>vs,vs=new Set,ys=I.createContext(null),bs=({children:e,...t})=>{let n=I.useMemo(()=>t,[t.objectName,t.recordId,t.dataSource,t.data,t.objectSchema,t.refresh,t.embedded,t.headerSystemActions,t.isFavorite,t.onToggleFavorite]);return(0,L.jsx)(ys.Provider,{value:n,children:e})};function xs(){return I.useContext(ys)}var Ss=(0,I.createContext)({});function Cs({scope:e,children:t}){return(0,I.createElement)(Ss.Provider,{value:e},t)}function ws(){return(0,I.useContext)(Ss)}function Ts(e){return(0,I.useMemo)(()=>{if(typeof e!=`object`||!e||Array.isArray(e))return{};let t=e;return{...t,record:t,data:t}},[e])}var Es=new Set;function Ds(e,t={},n){let r=ws();return(0,I.useMemo)(()=>{let i=t,a=i.record!=null&&typeof i.record==`object`&&i.record===i.data?i.record:void 0;if(a!==void 0){let t=typeof e==`string`?mr(e)?void 0:e:e&&typeof e==`object`&&e.dialect===`cel`?e.source:void 0;typeof t==`string`&&lr(t,a,!0,n?.label)}let o=new rr({...r,...t});if(n?.throwOnError)try{return o.evaluateCondition(e,{throwOnError:!0})}catch(t){let r=typeof e==`string`?e:String(e),i=`${n?.label??``}::${r}`;if(!Es.has(i)){Es.add(i);let e=t instanceof Error?t.message:String(t);console.warn(`[object-ui] ${n?.label??`a component`} was hidden/disabled: its predicate threw — ${e}. Predicate: ${r}.`)}return!1}return o.evaluateCondition(e)},[e,t,r,n?.throwOnError,n?.label])}function Os(e,t,n){let r=ws(),i=n?.fallback??!0,a=n?.fields;return(0,I.useMemo)(()=>typeof e==`boolean`?e:e==null||e===``?i:br(e,t??{},{fallback:i,scope:r,warnOnError:n?.warnOnError,label:n?.label,fields:a}),[e,t,r,i,n?.warnOnError,n?.label,a])}var ks=(0,I.createContext)(null);function As(e){if(!e||e.length===0)return{};let t={};for(let n of e)if(n.defaultValue!==void 0)t[n.name]=n.defaultValue;else switch(n.type){case`number`:t[n.name]=0;break;case`boolean`:t[n.name]=!1;break;case`object`:t[n.name]={};break;case`array`:t[n.name]=[];break;default:t[n.name]=``}return t}var js=({definitions:e,children:t})=>{let n=(0,I.useContext)(ks),[r,i]=(0,I.useState)(()=>As(e)),a=(0,I.useMemo)(()=>e??[],[e]),o=(0,I.useMemo)(()=>new Set(a.map(e=>e.name)),[a]),s=(0,I.useCallback)((e,t)=>{if(!o.has(e)&&n&&n.definitions.some(t=>t.name===e)){n.setVariable(e,t);return}i(n=>({...n,[e]:t}))},[o,n]),c=(0,I.useCallback)(e=>{for(let[t,n]of Object.entries(e))s(t,n)},[s]),l=(0,I.useCallback)(()=>{i(As(e))},[e]),u=(0,I.useMemo)(()=>n?{...n.variables,...r}:r,[n,r]),d=(0,I.useMemo)(()=>n?[...n.definitions.filter(e=>!o.has(e.name)),...a]:a,[n,a,o]),f=(0,I.useMemo)(()=>({variables:u,definitions:d,setVariable:s,setVariables:c,resetVariables:l}),[u,d,s,c,l]);return(0,L.jsx)(ks.Provider,{value:f,children:t})};js.displayName=`PageVariablesProvider`;function Ms(){return(0,I.useContext)(ks)??Ns}var Ns=Object.freeze({variables:Object.freeze({}),definitions:Object.freeze([]),setVariable:()=>{},setVariables:()=>{},resetVariables:()=>{}});function Ps(e){let{variables:t,definitions:n,setVariable:r}=Ms();return(0,I.useMemo)(()=>{if(!e)return null;let i=n.find(t=>t.source===e);return i?{name:i.name,value:t[i.name],setValue:e=>r(i.name,e)}:null},[e,n,t,r])}function Fs(e){if(e!=null)return typeof e==`string`?e:e.defaultValue||e.key}function J(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var Is=/\$\{([^}]+)\}/g;function Ls(e){let t=[];Is.lastIndex=0;let n=Is.exec(e);for(;n!==null;)t.push(n[0]),n=Is.exec(e);return t}function Rs(e,t,n,r){if(J(e))for(let[i,a]of Object.entries(e)){if(typeof a!=`string`||r?.(i,a))continue;let e=Ls(a);e.length>0&&n.push({key:i,channel:t,value:a,expressions:e})}}function zs(e,t,n){let r=[];Rs(t,`properties`,r);let i=J(t)?t:void 0;return Rs(e,`schema`,r,(e,t)=>i?.[e]===t),Rs(n,`props`,r),r}function Bs(e){switch(e.channel){case`properties`:return`properties.`+e.key;case`props`:return`props.`+e.key;default:return e.key}}function Vs(e,t,n){let r=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,i=typeof t==`string`&&t?` (id: "`+t+`")`:``,a=n.map(e=>` - `+Bs(e)+`: `+JSON.stringify(e.value)+` [`+e.expressions.join(`, `)+`]`);return`[ObjectUI] Unevaluated expression reached the DOM - node `+r+i+`
|
|
4
|
+
`+a.join(`
|
|
5
|
+
`)+`
|
|
6
|
+
The value above is placed VERBATIM: it is handed to the renderer, and spread
|
|
7
|
+
to the DOM, with its source text intact. Either SchemaRenderer does not
|
|
8
|
+
evaluate this key, or the expression threw and the evaluator returned the
|
|
9
|
+
source unchanged.
|
|
10
|
+
Channels that do evaluate and read back today: \`content\`, or resolve the
|
|
11
|
+
value in the host before handing the schema to SchemaRenderer.`}var Hs=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function Us(e,t,n,r,i,a){let o=zs(r,i,a);if(o.length===0)return o;if(e&&typeof e==`object`){if(Hs.has(e))return o;Hs.add(e)}return console.error(Vs(t,n,o)),o}var Ws=`element:`,Gs=new Set([`view:simple`]);function Ks(e){return typeof e!=`string`||e.length===0?!1:e.startsWith(Ws)?!0:Gs.has(e)}var qs="[ObjectUI] A `props` config bag was not read";function Js(e,t){return`${typeof e==`string`&&e?`\`${e}\``:`(untyped node)`}${typeof t==`string`&&t?` (id: '${t}')`:``}`}function Ys(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${qs} - node ${Js(e,t)}\n ${i?`Key`:`Keys`} under \`props\`: ${r}\n\`props\` is NOT hoisted onto the node — only \`properties.*\` is. It is spread as
|
|
12
|
+
React props on the created element, so \`schema.${n[0]}\` is undefined and a\nrenderer declared as \`({ schema })\` never sees ${i?`this key`:`these keys`}. Nothing throws and\nnothing is logged by the renderer: the node renders as if the bag were empty.
|
|
13
|
+
Write ${i?`it`:`them`} under \`properties\` instead (or at node level, where the node's\nschema declares the key). The \`element:*\` renderers merge both bags via
|
|
14
|
+
\`readProps()\`; every other renderer reads \`schema\`. (objectui#6708)`}var Xs=new Set;function Zs(e,t,n){if(Ks(e)||!J(t)||!J(n))return null;let r=Object.keys(n);return r.length>0?r:null}function Qs(e,t,n,r){let i=Zs(e,n,r);if(!i)return null;let a=Ys(e,t,i);return Xs.has(a)?null:(Xs.add(a),console.warn(a),a)}var $s=`[ObjectUI] A visibility predicate could not be evaluated`,ec=`[ObjectUI] An enablement predicate could not be evaluated`;function tc(e){if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t}return typeof e==`string`?e:String(e)}var nc={"page-component":"Page-component predicates bind `record` (the row on a record page),\n`current_user`, and page state as `page.<var>`. Check those roots and the\nCEL syntax.","app-shell":"App-shell predicates bind `current_user` - also spelled `user`, `ctx.user`\nand `os.user` - plus `app` and `features` (the deployment flags).\nNeither `record` nor `page.<var>` exists at this tier.\nCheck those roots and the CEL syntax."},rc={visibility:{prefix:$s,consequence:`The node was treated as its safe default, which on this surface means the
|
|
15
|
+
gate did NOT bite - a predicate that cannot be evaluated reads on screen
|
|
16
|
+
exactly like one that said yes.
|
|
17
|
+
`},concealment:{prefix:$s,consequence:`The node was treated as its safe default, which on THIS leg is the one
|
|
18
|
+
that BITES: \`hidden\` / \`hiddenOn\` are NOT negated, so that default
|
|
19
|
+
REMOVED the node - it is not on the page at all, and an absent node is
|
|
20
|
+
indistinguishable from metadata that meant to hide it. Nothing is broken
|
|
21
|
+
in the renderer: the block is missing because the predicate above could
|
|
22
|
+
not be evaluated.
|
|
23
|
+
`},enablement:{prefix:ec,consequence:`The node was treated as its safe default, which on THIS gate is the one
|
|
24
|
+
that BITES: the node renders DISABLED - on screen, greyed out, refusing
|
|
25
|
+
input - and that is indistinguishable from a gate the author meant to
|
|
26
|
+
close. No pixel says a predicate failed, so this line is the only thing
|
|
27
|
+
that will ever name the one that did it.
|
|
28
|
+
`}};function ic(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,c=typeof t==`string`&&t?` (id: "`+t+`")`:``,l=rc[o];return l.prefix+` - node `+s+c+`
|
|
29
|
+
`+n+`: `+JSON.stringify(tc(r))+`
|
|
30
|
+
Reason: `+i+`
|
|
31
|
+
`+l.consequence+nc[a]}var ac=new Set;function oc(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=i instanceof Error?i.message:String(i),c=JSON.stringify([e,n,tc(r)]);ac.has(c)||(ac.add(c),console.warn(ic(e,t,n,r,s,a,o)))}var sc={visibility:{prefix:"[ObjectUI] A visibility predicate resolved `data.*` against the data-source adapter",consequence:"At the node tier `data` is the DATA-SOURCE ADAPTER - the object\n`${data.total}` in a props bag reads - and it is NOT the row. The reads\nabove are undefined on it, so this predicate is a CONSTANT: it does not\ndepend on the row at all, and on this surface a constant `false` hides the\nnode on every row while looking exactly like a gate that said no.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."},enablement:{prefix:"[ObjectUI] An enablement predicate resolved `data.*` against the data-source adapter",consequence:"At the node tier `data` is the DATA-SOURCE ADAPTER - the object\n`${data.total}` in a props bag reads - and it is NOT the row. The reads\nabove are undefined on it, so this predicate is a CONSTANT: it does not\ndepend on the row at all, and on THIS gate the dangerous polarity is a\nconstant `true`: the node renders DISABLED - on screen, greyed out,\nrefusing input - on every row, in every build, while looking exactly\nlike a gate that said no. No pixel says the predicate is a constant, so\nthis line is the only thing that will ever name it.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."}};function cc(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,`''`)}var lc=/(^|[^A-Za-z0-9_$.])data\.([A-Za-z_$][A-Za-z0-9_$]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*)/g;function uc(e,t){let n=cc(e),r=[];lc.lastIndex=0;let i;for(;(i=lc.exec(n))!==null;){let e=i[2],n=t;try{for(let t of e.split(`.`)){if(n==null){n=void 0;break}n=n[t]}}catch{return[]}let a=`data.`+e;n===void 0&&r.indexOf(a)===-1&&r.push(a)}return r}function dc(e,t,n,r,i,a=`visibility`){let o=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,s=typeof t==`string`&&t?` (id: "`+t+`")`:``,c=sc[a];return c.prefix+` - node `+o+s+`
|
|
32
|
+
`+n+`: `+JSON.stringify(tc(r))+`
|
|
33
|
+
Undefined on the adapter: `+i.join(`, `)+`
|
|
34
|
+
`+c.consequence}function fc(e,t,n,r,i,a=`visibility`){let o=tc(r);if(o.indexOf(`data.`)===-1)return;let s=uc(o,i);if(s.length===0)return;let c=JSON.stringify([`adapter-only-data`,e,n,o]);ac.has(c)||(ac.add(c),console.warn(dc(e,t,n,r,s,a)))}var Y=(()=>{try{return!1}catch{return!0}})(),pc=typeof WeakMap<`u`?new WeakMap:{set(){},get(){},has(){return!1}},mc=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function hc(e){if(!Y||!e||typeof e!=`object`)return{valid:!0,messages:[]};let t=pc.get(e);if(t)return t;let n={valid:!0,messages:[]};try{let t=at(e);if(!t.valid){let r=t.errors.map(e=>`${e.path}: ${e.message}`);n={valid:!1,messages:r},mc.has(e)||(mc.add(e),console.warn(`[ObjectUI] Invalid schema detected:
|
|
35
|
+
`+r.join(`
|
|
36
|
+
`),e))}}catch(t){mc.has(e)||(mc.add(e),console.warn(`[ObjectUI] Schema validator threw:`,t))}return pc.set(e,n),n}function gc(e){let t={};return e.ariaLabel&&(t[`aria-label`]=Fs(e.ariaLabel)),e.ariaDescribedBy&&(t[`aria-describedby`]=e.ariaDescribedBy),e.role&&(t.role=e.role),t}var _c=new Set([`type`,`id`]);function vc(e,t){if(!J(e))return{};if(!J(t))return e;let n=null;for(let r of Object.keys(t))_c.has(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n||={...e},delete n[r]);return n??e}var yc=[`visibleWhen`,`visible`,`visibleOn`,`visibility`],bc=[`hidden`,`hiddenOn`],xc=e=>bc.includes(e)?`concealment`:`visibility`;function Sc(e){let t=e.properties,n=J(t),r=r=>n&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:e[r];for(let e of yc)if(r(e)!==void 0)return e;for(let e of bc)if(F(r(e)))return e}function Cc(e){if(typeof e!=`string`||e===``)return;let t=e.toLowerCase();for(let n of Ve.getKnownTypes())if(n!==e&&n.toLowerCase()===t)return n}var wc=class extends I.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidUpdate(e){this.state.hasError&&(e.componentType!==this.props.componentType||e.resetKey!==this.props.resetKey)&&this.setState({hasError:!1,error:null})}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError&&this.state.error){let e=this.state.error;return Ai(e),(0,L.jsxs)(`div`,{className:`p-4 border border-orange-400 rounded bg-orange-50 text-orange-700 my-2`,role:`alert`,children:[(0,L.jsxs)(`p`,{className:`font-medium`,children:[`Component`,this.props.componentType?` "${this.props.componentType}"`:``,` failed to render`]}),(0,L.jsx)(`p`,{className:`text-sm mt-1`,children:e.message}),!1,(0,L.jsx)(`button`,{type:`button`,onClick:this.handleRetry,className:`mt-2 text-sm underline hover:no-underline`,children:`Retry`})]})}return this.props.children}},Tc={},Ec=(0,I.forwardRef)(({schema:e,...t},n)=>{let i=(0,I.useContext)(q),a=i?.dataSource||Tc,o=ws(),s=xs()?.data,{variables:c}=Ms(),[,l]=(0,I.useReducer)(e=>e+1,0);(0,I.useEffect)(()=>{let e=Ve.subscribe(l);return l(),e},[]);let[u,d]=(0,I.useState)(null),f=I.useId(),p=(0,I.useMemo)(()=>{if(!e||typeof e!=`object`)return e;let t=new rr({...o,current_user:o?.user,...s&&typeof s==`object`&&!Array.isArray(s)?{record:s}:null,data:a,page:c}),n={...e},i=(e,r)=>{let i=xc(r);if(!Y)return t.evaluateCondition(e,{onFault:t=>oc(n.type,n.id,r,e,t,`page-component`,i)});try{let i=t.evaluateCondition(e,{throwOnError:!0});return fc(n.type,n.id,r,e,a),i}catch(t){return oc(n.type,n.id,r,e,t,`page-component`,i),!0}},l=(e,r)=>{let i=!1,o=t.evaluateCondition(e,{onFault:t=>{i=!0,oc(n.type,n.id,r,e,t,`page-component`,`enablement`)}});return Y&&!i&&fc(n.type,n.id,r,e,a,`enablement`),o},u=J(n.properties)?n.properties:void 0;if(u){let e={...u};for(let[n,r]of Object.entries(e))e[n]=t.evaluate(r);n.properties=e}if(Y){let e=Sc(n);if(e&&u&&Object.prototype.hasOwnProperty.call(u,e)){let t=u[e];typeof t==`string`&&t.includes("${")&&i(t,e)}}if(J(n.properties)){let e=n.type,t=n.id,r=n.properties;for(let[e,t]of Object.entries(r))e!==`type`&&e!==`id`&&(n[e]=t);e!==void 0&&(n.type=e),t!==void 0&&(n.id=t),n.properties=r}typeof n.content==`string`&&(n.content=t.evaluate(n.content));for(let e of r(typeof n.type==`string`?n.type:``))typeof n[e]==`string`&&(n[e]=t.evaluate(n[e]));if(J(n.props)){let e={...n.props};for(let[n,r]of Object.entries(e))e[n]=t.evaluate(r);n.props=e}return(n.visibleWhen===void 0?n.visible===void 0?n.visibleOn===void 0?n.visibility===void 0?F(n.hidden)?i(n.hidden,`hidden`):F(n.hiddenOn)&&i(n.hiddenOn,`hiddenOn`):!i(n.visibility,`visibility`):!i(n.visibleOn,`visibleOn`):!i(n.visible,`visible`):!i(n.visibleWhen,`visibleWhen`))&&(n._hidden=!0),(F(n.disabled)?l(n.disabled,`disabled`):F(n.disabledOn)&&l(n.disabledOn,`disabledOn`))&&(n._disabled=!0),n},[e,a,o,c,s]),m=(0,I.useMemo)(()=>{let e=p;if(!e||typeof e!=`object`)return{scopeClass:``,scopedCss:``,mergedClassName:void 0,schemaForComponent:e};let t=e.responsiveStyles;if(!Hi(t))return{scopeClass:``,scopedCss:``,mergedClassName:e.className,schemaForComponent:e};let n=Ui(e.id??f),r=[e.className,n].filter(Boolean).join(` `);return{scopeClass:n,scopedCss:Wi(`.${n}`,t),mergedClassName:r,schemaForComponent:{...e,className:r}}},[p,f]);if(!p)return null;if(typeof p==`string`)return(0,L.jsx)(L.Fragment,{children:p});if(typeof p!=`object`)return(0,L.jsx)(L.Fragment,{children:String(p)});if(p._hidden)return null;let h=Y?hc(e):{valid:!0,messages:[]};Ni(`schema`,`Rendering schema node`,{type:p.type,id:p.id});let g=Ve.get(p.type);if(!g){if(!u&&Ve.hasLazy(p.type)){let e=Ve.loadLazy(p.type);if(e)return e.catch(e=>{d(e instanceof Error?e:Error(String(e)))}),(0,L.jsxs)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-lazy-loading":p.type,children:[`Loading `,(0,L.jsx)(`code`,{children:p.type}),`…`]})}Ni(`schema`,`Component not found in registry`,{type:p.type}),Oi[`OBJUI-001`];let e=Cc(p.type);return(0,L.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,children:[(0,L.jsxs)(`p`,{className:`font-medium`,children:[`Unknown component type: `,(0,L.jsx)(`strong`,{children:p.type}),e===void 0?null:(0,L.jsxs)(L.Fragment,{children:[` — did you mean '`,(0,L.jsx)(`strong`,{children:e}),`'?`]})]}),u&&(0,L.jsxs)(`p`,{className:`text-xs mt-1`,children:[`Failed to load plugin: `,u.message]}),!1,(0,L.jsx)(`pre`,{className:`text-xs mt-2 overflow-auto`,children:JSON.stringify(p,null,2)})]})}let{type:_,children:v,body:y,schema:b,visible:x,visibleWhen:S,visibleOn:ee,visibility:C,hidden:te,hiddenOn:ne,disabled:re,disabledOn:ie,dataSource:ae,_hidden:oe,_disabled:se,responsiveStyles:ce,...le}=p;Y&&Us(e,p.type,p.id,le,p.properties,p.props);let ue=vc(p.props,p.properties);Y&&Qs(p.type,p.id,e?.props,ue);let{scopeClass:de,scopedCss:fe,mergedClassName:pe,schemaForComponent:me}=m,he=gc(p),w=i?.debug||i?.debugFlags?.enabled,T={};w&&(T[`data-debug-type`]=p.type,p.id&&(T[`data-debug-id`]=p.id)),Fi(`render:${p.type}:${p.id??`anon`}`);let ge=w?performance.now():0,_e=(0,L.jsxs)(wc,{componentType:p.type,resetKey:p.id??null,children:[fe?(0,L.jsx)(`style`,{"data-os-scope":de,dangerouslySetInnerHTML:{__html:fe}}):null,I.createElement(g,{schema:me,...le,...ue,...he,...T,disabled:se||void 0,className:pe,"data-obj-id":p.id,"data-obj-type":p.type,...Y&&!h.valid?{"data-obj-schema-invalid":`true`}:{},...t})]});if(Ii(`render:${p.type}:${p.id??`anon`}`),w&&ge){let e=performance.now()-ge;Ri.getInstance().addPerf({type:p.type,id:p.id,durationMs:e,timestamp:Date.now()})}return _e});Ec.displayName=`SchemaRenderer`;function Dc(e){return typeof e==`number`||typeof e==`boolean`?String(e):e}var Oc=(0,I.createContext)({});function kc({currentUserId:e,currentOrgId:t,children:n}){let r=(0,I.useMemo)(()=>({currentUserId:e,currentOrgId:t}),[e,t]);return(0,I.createElement)(Oc.Provider,{value:r},n)}function Ac(){return(0,I.useContext)(Oc)}function jc(e={}){let{context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s}=`context`in e?e:{context:e},[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),m=(0,I.useMemo)(()=>{let e=new ri(t);return n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),e},[JSON.stringify(t)]);return{execute:(0,I.useCallback)(async e=>{l(!0),d(null),p(null);try{let t=await m.execute(e);return p(t),t.success||d(t.error||`Action failed`),t}catch(e){let t=e.message;d(t);let n={success:!1,error:t};return p(n),n}finally{l(!1)}},[m]),loading:c,error:u,result:f,updateContext:(0,I.useCallback)(e=>{m.updateContext(e)},[m]),runner:m}}var Mc={sm:`min(92vw, 480px)`,md:`min(92vw, 720px)`,lg:`min(92vw, 960px)`,xl:`min(92vw, 1200px)`,full:`min(92vw, 1600px)`};function Nc(e){if(!e)return;if(e.width!==void 0)return e.width;let t=e.size;if(t&&t!==`auto`)return Mc[t]}function Pc(e){let{navigation:t,objectName:n,onNavigate:r,onRowClick:i}=e,[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),l=t?.mode??`page`,u=Nc(t),d=t?.view,f=l===`drawer`||l===`modal`||l===`split`||l===`popover`,p=(0,I.useCallback)(()=>{o(!1),c(null)},[]),m=(0,I.useCallback)(e=>{c(e),o(!0)},[]),h=(0,I.useCallback)((e,a)=>{if(i){i(e,a);return}if(a&&(a.metaKey||a.ctrlKey||a.button===1)){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}}if(!t){let t=e.id||e._id;r&&t!=null&&r(t,d??`view`);return}if(!(l===`none`||t.preventNavigation)){if(l===`new_window`||t.openNewTab){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}let i=encodeURIComponent(String(t)),a=n?`/${n}/record/${i}`:`/${i}`;window.open(a,`_blank`);return}if(l===`page`){let t=e.id||e._id;r&&t!=null&&r(t,d??`view`);return}if(f){c(e),o(!0);return}}},[i,t,l,n,r,f,d]);return(0,I.useMemo)(()=>({isOpen:a,selectedRecord:s,mode:l,close:p,open:m,setIsOpen:o,handleClick:h,width:u,view:d,isOverlay:f}),[a,s,l,p,m,h,u,d,f])}var Fc=(0,I.createContext)(!1),Ic=({value:e=!0,children:t})=>(0,L.jsx)(Fc.Provider,{value:e,children:t}),Lc=()=>(0,I.useContext)(Fc),Rc=(0,I.createContext)(null),zc=({children:e,context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s,handlers:c})=>{let[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(null),h=(0,I.useMemo)(()=>{let e=new ri({...t,ctx:t&&typeof t.ctx==`object`?{...t,...t.ctx}:{...t}});return n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),c&&Object.entries(c).forEach(([t,n])=>{e.registerHandler(t,n)}),e},[JSON.stringify(t)]),g=(0,I.useCallback)(async e=>{u(!0),f(null),m(null);try{let t=await h.execute(e);return m(t),t.success||f(t.error||`Action failed`),t}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[h]),_=(0,I.useCallback)(async(e,t)=>{u(!0),f(null),m(null);try{let n=await h.executeChain(e,t);return m(n),n.success||f(n.error||`Chain failed`),n}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[h]),v=(0,I.useCallback)(e=>{h.updateContext(e)},[h]),y=(0,I.useMemo)(()=>({execute:g,executeChain:_,loading:l,error:d,result:p,runner:h,updateContext:v}),[g,_,l,d,p,h,v]);return(0,L.jsx)(Rc.Provider,{value:y,children:e})};zc.displayName=`ActionProvider`;function Bc(){let e=(0,I.useContext)(Rc);if(!e){let e=new ri;return{execute:t=>e.execute(t),executeChain:(t,n)=>e.executeChain(t,n),loading:!1,error:null,result:null,runner:e,updateContext:t=>e.updateContext(t)}}return e}function Vc(){return(0,I.useContext)(Rc)!==null}(0,I.createContext)(null);var Hc={toast:{surface:`delegate`,transient:!0},snackbar:{surface:`snackbar`,transient:!0},banner:{surface:`banner`,transient:!1},alert:{surface:`alert`,transient:!1},inline:{surface:`inline`,transient:!1}};function Uc(e){return e===`modal`?`alert`:e&&e in Hc?e:`toast`}new Set(Object.keys(Hc));var Wc=new Set([`top_left`,`top_center`,`top_right`,`bottom_left`,`bottom_center`,`bottom_right`]);function Gc(e={}){return{defaultPosition:e.defaultPosition??e.position,defaultDuration:e.defaultDuration??5e3,maxVisible:e.stacking===!1?1:e.maxVisible??5,stackDirection:e.stackDirection??`down`,pauseOnHover:e.pauseOnHover??!0}}var Kc=0,qc=(()=>{try{return!1}catch{return!0}})(),Jc={delegate:"pass `onToast` to <NotificationProvider>",snackbar:`mount <NotificationSnackbar /> from @object-ui/components`,banner:`mount <NotificationBanners /> from @object-ui/components`,alert:`mount <NotificationAlerts /> from @object-ui/components`,inline:`mount <NotificationInline /> from @object-ui/components at the raising surface`},Yc=(0,I.createContext)(null),Xc=({children:e,config:t={},onToast:n})=>{let r=(0,I.useMemo)(()=>Gc(t),[JSON.stringify(t)]),[i,a]=(0,I.useState)([]),o=(0,I.useRef)(new Map),s=(0,I.useRef)(new Map),c=(0,I.useCallback)((e,t)=>{let n=setTimeout(()=>{s.current.delete(e),a(t=>t.filter(t=>t.id!==e))},t);s.current.set(e,{handle:n,endsAt:Date.now()+t,left:t})},[]),l=(0,I.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.set(e,{...t,left:Math.max(0,t.endsAt-Date.now())}))},[]),u=(0,I.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),c(e,t.left))},[c]);(0,I.useEffect)(()=>()=>{for(let{handle:e}of s.current.values())clearTimeout(e);s.current.clear()},[]);let d=(0,I.useCallback)(e=>{let t=o.current;return t.set(e,(t.get(e)??0)+1),()=>{let n=(t.get(e)??1)-1;n>0?t.set(e,n):t.delete(e)}},[]),f=(0,I.useCallback)(e=>{let t=`notification-${++Kc}`,i=Uc(e.displayType),{surface:s,transient:l}=Hc[i],u={...e,displayType:i,id:t,createdAt:new Date,read:!1};a(e=>[u,...e]),s===`delegate`&&n?.(u,r),qc&&s!==`delegate`&&(o.current.get(s)??0)===0&&console.warn(`[NotificationProvider] "${u.title}" declares displayType '${i}' but no ${i} surface is mounted, so it will not be shown. To present it, ${Jc[s]}.`);let d=e.duration??(l?r.defaultDuration:0);return d>0&&c(t,d),t},[r,n,c]),p=(0,I.useCallback)((e,t)=>f({title:e,message:t,severity:`info`}),[f]),m=(0,I.useCallback)((e,t)=>f({title:e,message:t,severity:`success`}),[f]),h=(0,I.useCallback)((e,t)=>f({title:e,message:t,severity:`warning`}),[f]),g=(0,I.useCallback)((e,t)=>f({title:e,message:t,severity:`error`}),[f]),_=(0,I.useCallback)(e=>{a(t=>t.map(t=>t.id===e?{...t,read:!0}:t))},[]),v=(0,I.useCallback)(()=>{a(e=>e.map(e=>({...e,read:!0})))},[]),y=(0,I.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.delete(e)),a(t=>t.filter(t=>t.id!==e))},[]),b=(0,I.useCallback)(()=>{a([])},[]),x=(0,I.useMemo)(()=>i.filter(e=>!e.read).length,[i]),S=(0,I.useMemo)(()=>({notifications:i,unreadCount:x,notify:f,info:p,success:m,warning:h,error:g,markAsRead:_,markAllAsRead:v,dismiss:y,clearAll:b,config:r,pauseAutoDismiss:l,resumeAutoDismiss:u,registerSurface:d}),[i,x,f,p,m,h,g,_,v,y,b,r,l,u,d]);return(0,L.jsx)(Yc.Provider,{value:S,children:e})};Xc.displayName=`NotificationProvider`;function Zc(){let e=(0,I.useContext)(Yc);if(!e)throw Error(`useNotifications must be used within a <NotificationProvider>. Wrap your app with <NotificationProvider> to use the notification system.`);return e}function Qc(){return(0,I.useContext)(Yc)!==null}function $c(e,t){let n=t.maxVisible>0?e.slice(0,t.maxVisible):e;return t.stackDirection===`up`?n:[...n].reverse()}function el(e,t){let n=e.position??t?.defaultPosition;if(!n)return;let r=n.replace(/-/g,`_`);return Wc.has(r)?r:void 0}function tl(e,t){let{notifications:n,registerSurface:r}=Zc(),{surface:i}=Hc[e];return(0,I.useEffect)(()=>r(i),[r,i]),(0,I.useMemo)(()=>n.filter(n=>Uc(n.displayType)===e&&(e!==`inline`||(n.scope??void 0)===t)),[n,e,t])}var nl=(0,I.createContext)(null);function rl(){let e=(0,I.useContext)(nl);if(!e)throw Error(`useDnd must be used within a <DndProvider>. Wrap your app with <DndProvider> to use the drag and drop system.`);return e}function il(){return(0,I.useContext)(nl)!==null}var al=(0,I.createContext)(null);function ol(){return(0,I.useContext)(al)}var sl=(0,I.createContext)(null),cl=Object.freeze([]),ll=Object.freeze({apps:cl,objects:cl,dashboards:cl,reports:cl,pages:cl,loading:!1,error:null,refresh:async()=>{},invalidate:()=>{},ensureType:async()=>[],getItem:async()=>null,getItemsByType:()=>[],getTypeStatus:()=>`ready`});function ul(){return(0,I.useContext)(sl)??ll}function dl(e,t){let{getItem:n}=ul(),[r,i]=(0,I.useState)({item:null,loading:!!t,error:null});return(0,I.useEffect)(()=>{if(!t){i(e=>e.item===null&&!e.loading&&e.error===null?e:{item:null,loading:!1,error:null});return}let r=!1;return i(e=>({...e,loading:!0,error:null})),n(e,t).then(e=>{r||i({item:e,loading:!1,error:null})}).catch(e=>{r||i({item:null,loading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!0}},[e,t,n]),r}var fl=I.createContext(null),pl=({canEdit:e=!0,locked:t=!1,approvalPending:n,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,children:o})=>{let s=n??t,[c,l]=I.useState(!1),[u,d]=I.useState({}),[f,p]=I.useState(null),[m,h]=I.useState(!1),[g,_]=I.useState(null),[v,y]=I.useState(null),b=I.useCallback(t=>{e&&(p(t??null),l(!0),_(null),y(null))},[e]),x=I.useCallback((e,t)=>{d(n=>({...n,[e]:t}))},[]),S=I.useCallback(()=>{d({}),l(!1),p(null),h(!1),_(null),y(null)},[]),ee=I.useMemo(()=>({editing:c,canEdit:e,locked:t,approvalPending:s,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,draft:u,autoFocusField:f,saving:m,error:g,fieldErrors:v,enter:b,setField:x,cancel:S,reset:S,setSaving:h,setError:_,setFieldErrors:y}),[c,e,t,s,r,i,a,u,f,m,g,v,b,x,S]);return(0,L.jsx)(fl.Provider,{value:ee,children:o})};function ml(){return I.useContext(fl)}var hl=I.createContext(null),gl=({children:e,...t})=>{let n=I.useMemo(()=>t,[t.items,t.onAddComment,t.onAddReply,t.onToggleReaction,t.mentionSuggestions,t.onUploadAttachments,t.loading,t.error]);return(0,L.jsx)(hl.Provider,{value:n,children:e})};function _l(){return I.useContext(hl)}var vl=(0,I.createContext)({}),yl=({value:e,children:t})=>(0,L.jsx)(vl.Provider,{value:e,children:t});function bl(){return(0,I.useContext)(vl)}var xl=(0,I.createContext)({}),Sl=({value:e,children:t})=>(0,L.jsx)(xl.Provider,{value:e,children:t});function Cl(){return(0,I.useContext)(xl)}var wl=(0,I.createContext)(null),Tl=({value:e,children:t})=>(0,L.jsx)(wl.Provider,{value:e,children:t});function El(){return(0,I.useContext)(wl)}function Dl(){let{variables:e}=Ms(),{updateContext:t}=Bc();return I.useEffect(()=>(t({pageVariables:e}),()=>{t({pageVariables:{}})}),[e,t]),null}Dl.displayName=`PageVariableActionBridge`;var Ol=e=>!!e&&typeof e==`object`;async function kl(e,t){let n=typeof e?.getObjectSchema==`function`,r=typeof e?.listViews==`function`;if(!n&&!r)return{capable:!1,views:{}};let i=n?e.getObjectSchema(t).then(e=>Ol(e)?e.listViews??e.list_views:void 0,()=>void 0):Promise.resolve(void 0),a=r?e.listViews(t).then(e=>e,()=>void 0):Promise.resolve(void 0),[o,s]=await Promise.all([i,a]);return{capable:!0,views:Oe(o,s)}}function Al(e,t){let n=(0,I.useContext)(q),r=t??n?.dataSource??null,i=(0,I.useMemo)(()=>{let t=Ol(e)?e.dataSource:void 0;return De(t)?t:void 0},[e]),a=i?.object,o=i?.view,s=a&&o?JSON.stringify([a,o]):``,[c,l]=(0,I.useState)(null);return(0,I.useEffect)(()=>{if(!a||!o)return;let e=!1;return kl(r,a).then(({capable:t,views:n})=>{if(e)return;if(!t){l({key:s,view:null,error:`dataSource.view "${o}" cannot be resolved: this data source cannot list the saved views of object "${a}".`});return}let r=ke(n,o,a);l(r?{key:s,view:r}:{key:s,view:null,error:Pe(a,o,Object.keys(n))})}),()=>{e=!0}},[r,a,o,s]),(0,I.useMemo)(()=>i?i.view?c?.key===s?c.view===null?{status:`missing`,config:i,error:c.error}:{status:`resolved`,config:i,view:c.view,composed:Ne(i,c.view)}:{status:`loading`,config:i}:{status:`ready`,config:i,composed:Ne(i)}:{status:`absent`},[i,c,s])}function jl(e){return!e||e.enabled!==!1&&e.handlerReady!==!1&&e.status!==`stub`&&e.status!==`unavailable`}[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);var Ml={compact:32,comfortable:40,spacious:52},Nl={compact:`py-1 px-2`,comfortable:`py-2 px-3`,spacious:`py-3 px-4`},Pl={compact:`text-xs`,comfortable:`text-sm`,spacious:`text-base`},Fl=[`compact`,`comfortable`,`spacious`];function Il(e=`comfortable`,t){let[n,r]=(0,I.useState)(e),i=t?.rowHeights??Ml,a=t?.paddingClasses??Nl,o=t?.fontSizeClasses??Pl,s=(0,I.useRef)(t?.onChange);(0,I.useEffect)(()=>{s.current=t?.onChange},[t?.onChange]);let c=(0,I.useRef)(e);(0,I.useEffect)(()=>{e!==c.current&&(c.current=e,r(e))},[e]);let l=(0,I.useCallback)(e=>{r(t=>t===e?t:(queueMicrotask(()=>s.current?.(e)),e))},[]),u=(0,I.useCallback)(()=>{r(e=>{let t=Fl[(Fl.indexOf(e)+1)%Fl.length];return queueMicrotask(()=>s.current?.(t)),t})},[]);return(0,I.useMemo)(()=>({mode:n,setMode:l,cycle:u,rowHeight:i[n],paddingClass:a[n],fontSizeClass:o[n]}),[n,l,u,i,a,o])}function Ll(e){return typeof window>`u`?()=>{}:(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)})}function Rl(){return typeof navigator<`u`?navigator.onLine:!0}function zl(){return!0}var Bl=`objectui-offline-queue`;function Vl(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(Bl);return e?JSON.parse(e):[]}catch{return[]}}function Hl(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(Bl,JSON.stringify(e))}catch{}}var Ul=0;function Wl(){return Ul+=1,`mut_${Date.now()}_${Ul}`}var Gl={enabled:!0,strategy:`network_first`,offlineIndicator:!0,offlineMessage:`You are currently offline. Changes will be synced when reconnected.`,queueMaxSize:100};function Kl(e={}){let{enabled:t=Gl.enabled,strategy:n=Gl.strategy,offlineIndicator:r=Gl.offlineIndicator,offlineMessage:i=Gl.offlineMessage,queueMaxSize:a=Gl.queueMaxSize,sync:o}=e,s=(0,I.useSyncExternalStore)(Ll,Rl,zl),[c,l]=(0,I.useState)(Vl),[u,d]=(0,I.useState)(`idle`),f=(0,I.useRef)(o);(0,I.useInsertionEffect)(()=>{f.current=o});let p=(0,I.useRef)(c);(0,I.useInsertionEffect)(()=>{p.current=c}),(0,I.useEffect)(()=>{Hl(c)},[c]),(0,I.useEffect)(()=>{t&&(s?u===`offline`&&d(`idle`):d(`offline`))},[s,t,u]);let m=(0,I.useCallback)(e=>{t&&l(t=>{let n={...e,id:Wl(),timestamp:Date.now()},r=[...t,n];return r.length>a?r.slice(r.length-a):r})},[t,a]),h=(0,I.useCallback)(()=>{l([])},[]),g=(0,I.useCallback)(async()=>{let e=p.current;if(!(!t||e.length===0)){d(`syncing`);try{let t=f.current?.batchSize??e.length,n=e.slice(0,t);await new Promise(e=>setTimeout(e,0)),l(e=>e.filter(e=>!n.some(t=>t.id===e.id))),d(`idle`)}catch{d(`error`)}}},[t]),_=c.length>0;return(0,I.useEffect)(()=>{if(!t||!s||!_)return;let e=setTimeout(()=>{g()},100);return()=>clearTimeout(e)},[s,t,_,g]),(0,I.useMemo)(()=>({isOnline:s,enabled:t,syncState:u,strategy:n,pendingCount:c.length,queueMutation:m,sync:g,clearQueue:h,showIndicator:r&&!s,offlineMessage:i}),[s,t,u,n,c.length,m,g,h,r,i])}function ql(){return{canUndo:V.canUndo,canRedo:V.canRedo,undoDescription:V.peekUndo()?.description,redoDescription:V.peekRedo()?.description,history:V.getHistory()}}function Jl(){return{canUndo:!1,canRedo:!1,undoDescription:void 0,redoDescription:void 0,history:[]}}var Yl=ql();function Xl(e){return V.subscribe(()=>{Yl=ql(),e()})}function Zl(){return Yl}function Ql(e={}){let t=(0,I.useRef)(e);(0,I.useInsertionEffect)(()=>{t.current=e});let n=(0,I.useSyncExternalStore)(Xl,Zl,Jl),r=(0,I.useCallback)(async(e,n,r)=>{let i=t.current.dataSource;if(!i)return;let a=r===`undo`?{create:`delete`,update:`update`,delete:`create`}[e.type]:e.type;a===`delete`?await i.delete(e.objectName,e.recordId):a===`update`?await i.update(e.objectName,e.recordId,n):await i.create(e.objectName,n)},[]),i=(0,I.useCallback)(async()=>{let e=V.popUndo();e&&(await r(e,e.undoData,`undo`),t.current.onUndo?.(e))},[r]),a=(0,I.useCallback)(async()=>{let e=V.popRedo();e&&(await r(e,e.redoData,`redo`),t.current.onRedo?.(e))},[r]);return(0,I.useEffect)(()=>{let e=e=>{!(e.ctrlKey||e.metaKey)||e.key.toLowerCase()!==`z`||(e.preventDefault(),e.shiftKey?a():i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,a]),(0,I.useMemo)(()=>({...n,undo:i,redo:a}),[n,i,a])}function $l(e={}){let{actions:t=[],context:n={}}=e,r=(0,I.useContext)(Rc)?.runner??null,i=(0,I.useMemo)(()=>{let e=n&&Object.keys(n).length>0?{...n,ctx:n.ctx&&typeof n.ctx==`object`?{...n,...n.ctx}:{...n}}:n,i=r?new li(r):new li(e);if(r&&n&&Object.keys(n).length>0){let e=i.getRunner(),t=e.getEvaluator().getContext().toObject(),r=t&&typeof t.ctx==`object`?t.ctx:{},a=n.ctx&&typeof n.ctx==`object`?n.ctx:n,o={...n,ctx:{...r,...a}};e.updateContext(o)}return i.registerActions(t),i},[r,JSON.stringify(t),JSON.stringify(n)]);return{getActionsForLocation:(0,I.useCallback)(e=>i.getActionsForLocation(e),[i]),getBulkActions:(0,I.useCallback)(()=>i.getBulkActions(),[i]),executeAction:(0,I.useCallback)((e,t)=>i.executeAction(e,t),[i]),handleShortcut:(0,I.useCallback)(e=>i.handleShortcut(e),[i]),engine:i}}function eu(){let{actionLabel:e,actionConfirm:t,actionSuccess:n}=me(),{language:r}=he();return(0,I.useMemo)(()=>((i,a,o)=>{if(!a||typeof a!=`object`)return a;let s=fe(a.label,r),c=typeof a.name==`string`&&a.name?a.name:void 0,l=s||c||o?.fallbackLabel||``;if(!c)return l===a.label?a:{...a,label:l};let u={...a,label:e(i,c,l)};return a.confirmText!==void 0&&(u.confirmText=t(i,c,a.confirmText)),a.successMessage!==void 0&&(u.successMessage=n(i,c,a.successMessage)),u}),[e,t,n,r])}function tu(){let e=(0,I.useContext)(Rc),t=ws(),n=e?.runner?.getContext?.()?.user;if(Array.isArray(n?.systemPermissions))return n.systemPermissions;let r=t?.user;if(Array.isArray(r?.systemPermissions))return r.systemPermissions}function nu(){let e=tu();return(0,I.useCallback)(t=>!Array.isArray(t)||t.length===0||!Array.isArray(e)||t.every(t=>typeof t==`string`&&e.includes(t)),[e])}function ru(e,t,n,r){let i=(0,I.useContext)(q)?.apiFetch,a=r?.enabled??!0,[o,s]=(0,I.useState)(null),c=(n??[]).filter(Boolean),l=[a?`1`:`0`,e??``,c.join(`,`),JSON.stringify(t??null)].join(`|`);return(0,I.useEffect)(()=>{if(!a||!e||c.length===0){s(null);return}let n=e=>t&&t[e]||e,r=!1;return(async()=>{try{let t=i??fetch,a=await co(async e=>{let n=await(await t(`/api/v1/meta/object/${encodeURIComponent(e)}`,{headers:{accept:`application/json`},credentials:`include`})).json().catch(()=>null);return n?.item??n?.data??n},e,c.map(n));r||s({metaByPath:a,relabel:c.map(e=>({dim:e,path:n(e)}))})}catch{r||s(null)}})(),()=>{r=!0}},[l,i]),o}function iu(e,t,n,r){let{fieldOptionLabel:i}=pe(),a=ru(e,t,n,r);return(0,I.useMemo)(()=>so(a?.metaByPath,a?.relabel,i),[a,i])}function au(e,t){return!0}function ou(e,t={}){let n=ul(),[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(null);(0,I.useEffect)(()=>{let e=!1;if(!n.ensureType){i(!0);return}return n.ensureType(`page`).then(()=>{e||(i(!0),o(null))}).catch(t=>{e||(o(t instanceof Error?t:Error(String(t))),i(!0))}),()=>{e=!0}},[n]);let s=(0,I.useMemo)(()=>{if(!e&&!t.pageName)return null;let r=Array.isArray(n.pages)?n.pages:[];if(!r.length)return null;if(t.pageName)return r.find(e=>e?.name===t.pageName)??null;let i=r.filter(n=>!n||(n.pageType??(n.type===`record`?`record`:void 0))!==`record`||n.object!==e?!1:au(n,t));return i.length?(i.sort((e,t)=>(t?.priority??0)-(e?.priority??0)),i[0]):null},[n.pages,e,t.pageName,t.recordType,t.profile,t.app,t.formFactor]),{page:c,slots:l}=(0,I.useMemo)(()=>s?s.kind===`slotted`?{page:null,slots:s.slots??{}}:{page:s,slots:null}:{page:null,slots:null},[s]);return{page:c,slots:l,loading:n.loading||!r,error:a??n.error??null}}function su(e,t,n){if(!e)return 0;let r=e.toLowerCase(),i=(t||``).toLowerCase();return(n||``).toLowerCase()===r?110:i===r?100:i.startsWith(r)?80:i.split(/[\s_\-/.,:;()[\]]+/).filter(Boolean).some(e=>e.startsWith(r))?60:i.includes(r)?40:0}function cu(e){let{query:t,objects:n,dataSource:r,objectNames:i,maxObjectsQueried:a=8,topPerObject:o=3,minLength:s=2,debounceMs:c=250,enabled:l=!0,getDisplayName:u=Bn}=e,[d,f]=(0,I.useState)([]),[p,m]=(0,I.useState)(!1),[h,g]=(0,I.useState)(void 0),_=(0,I.useMemo)(()=>{if(!Array.isArray(n)||n.length===0)return[];let e;if(Array.isArray(i)&&i.length>0){let t=new Map;for(let e of n){let n=e?.name;typeof n==`string`&&t.set(n,e)}e=i.map(e=>t.get(e)).filter(e=>e!=null)}else e=n.filter(e=>e?.searchable!==!1);return e},[n,i]),v=(0,I.useMemo)(()=>_.map(e=>String(e?.name)).join(`|`),[_]),y=(0,I.useRef)(0);return(0,I.useEffect)(()=>{if(!l||!r||_.length===0){f([]),m(!1),g(void 0);return}let e=(t??``).trim();if(e.length<s){f([]),m(!1),g(void 0);return}let n=++y.current;m(!0),g(void 0);let i=setTimeout(()=>{if(y.current!==n)return;let t=r.searchAll;if(typeof t==`function`){let i=new Map;for(let e of _)typeof e?.name==`string`&&i.set(e.name,e);Promise.resolve().then(()=>t.call(r,e,{limit:a*o,objects:Array.from(i.keys())})).then(t=>{if(y.current!==n)return;let r=Array.isArray(t?.hits)?t.hits:Array.isArray(t)?t:[],a=[];for(let t of r){let n=t?.object??t?.objectName;if(typeof n!=`string`||i.size>0&&!i.has(n))continue;let r=t?.id??t?.record?.id??t?.record?._id;if(r==null)continue;let o=i.get(n)??{name:n},s=(typeof t?.title==`string`&&t.title.trim()!==``?t.title.trim():``)||u(o,t?.record??{})||`Record #${r}`,c=typeof t?.snippet==`string`?t.snippet.trim():``;a.push({objectName:n,objectLabel:typeof o.label==`string`&&o.label.length>0?o.label:n,recordId:String(r),display:s,subtitle:c&&c!==s?c:void 0,icon:o?.icon,score:su(e,s,String(r)),raw:t?.record??t})}a.sort((e,t)=>(t.score===110)-+(e.score===110)),f(a),m(!1),g(void 0)}).catch(e=>{y.current===n&&(f([]),m(!1),g(e instanceof Error?e:Error(String(e))))});return}let i=_.slice(0,a).map(t=>Promise.resolve().then(()=>r.find(t.name,{$search:e,$top:o})).then(e=>({obj:t,res:e,err:null})).catch(e=>({obj:t,res:null,err:e})));Promise.allSettled(i).then(t=>{if(y.current!==n)return;let r=[],i;for(let n of t){if(n.status!==`fulfilled`)continue;let{obj:t,res:a,err:s}=n.value;if(s){let e=s?.httpStatus??s?.status;if(s?.code,e===404||ue(s,`OBJECT_NOT_FOUND`))continue;i=s instanceof Error?s:Error(String(s));continue}let c=Array.isArray(a?.data)?a.data:Array.isArray(a)?a:[];for(let n of c.slice(0,o)){let i=n?.id??n?._id;if(i==null)continue;let a=u(t,n);r.push({objectName:t.name,objectLabel:typeof t.label==`string`&&t.label.length>0?t.label:t.name,recordId:String(i),display:a,icon:t?.icon,score:su(e,a,String(i)),raw:n})}}r.sort((e,t)=>t.score-e.score),f(r),m(!1),g(i)})},c);return()=>{clearTimeout(i)}},[t,l,r,v,o,a,s,c,u]),{results:d,isSearching:p,error:h}}function lu(e,t){let[n,r]=(0,I.useState)(null);(0,I.useEffect)(()=>{let n=!0,i=e;return(async()=>{if(!t||!i||typeof t.getObjectSchema!=`function`){n&&r({key:i,def:null});return}try{let e=await t.getObjectSchema(i);n&&r({key:i,def:e})}catch(e){console.error(`[useSettledSchema] getObjectSchema failed for`,i,e),n&&r({key:i,def:null})}})(),()=>{n=!1}},[e,t]);let i=n!==null&&n.key===e;return{ready:i,def:i?n.def:null}}var uu=new Set,du=`objectui:related-changed`;function fu(e){for(let t of Array.from(uu))try{t(e)}catch{}typeof window<`u`&&window.dispatchEvent(new CustomEvent(du,{detail:{objectName:e.objectName,recordId:e.recordId}}))}function pu(e){return uu.add(e),()=>uu.delete(e)}function mu(e,t,n){return e.objectName===`*`?!0:e.objectName===t?n===void 0||e.recordId===void 0||e.recordId===n:!1}function hu(e,t){let[n,r]=(0,I.useState)(0);return(0,I.useEffect)(()=>{if(e)return pu(n=>{mu(n,e,t)&&r(e=>e+1)})},[e,t]),n}function gu(e){(0,I.useEffect)(()=>{let t=e;if(t?.onMutation)return t.onMutation(e=>{e?.resource&&fu({objectName:e.resource,recordId:e.id==null?void 0:String(e.id)})})},[e])}var _u=(e,t)=>t===`pagination.pageSize`?e.pagination?.pageSize:e[t],vu=(e,t,n,r)=>{if(n===`pagination.pageSize`){e.pagination={...t.pagination??{},pageSize:r};return}e[n]=r};function yu(e,t={},n){let r=Al(e,De(n)?void 0:n),{object:i=`objectName`,columns:a,filter:o,sort:s,limit:c,viewType:l}=t,u=I.useMemo(()=>{let t=r.composed;if(!t)return e;let n=e??{},u={...n};if(i!==!1&&(u[i]=t.object),a&&!(Array.isArray(n.columns)&&n.columns.length>0)&&t.columns!==void 0&&(u.columns=t.columns),o){let e=ce(n.filter,t.filter);e===void 0?delete u.filter:u.filter=e}return s&&t.sort!==void 0&&(r.config?.sort!==void 0||n.sort===void 0)&&(u.sort=t.sort),c&&t.limit!==void 0&&(r.config?.limit!==void 0||_u(n,c)===void 0)&&vu(u,n,c,t.limit),l&&t.viewType!==void 0&&n.viewType===void 0&&(u.viewType=t.viewType),u},[e,r.composed,r.config,i,a,o,s,c,l]);return I.useMemo(()=>({status:r.status,schema:u,config:r.config,error:r.error}),[r.status,r.config,r.error,u])}function bu({testId:e,title:t=`This component’s data source could not be resolved`,message:n}){return(0,L.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-datasource-error`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,L.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function xu({testId:e}){return(0,L.jsx)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-testid":`${e}-resolving-view`,children:`Loading view…`})}function Su(e){let t=I.useContext(q);return(De(e)?void 0:e)??t?.dataSource??void 0}function Cu(e,t){return`“${e}” has no data source, so it cannot read ${typeof t==`string`&&t.trim().length>0?`“${t}”`:`its object`}. Inject one from an ancestor — <SchemaRendererProvider dataSource={…}> from @object-ui/react — or hand this block a dataSource of its own.`}function wu({testId:e,title:t=`No data source resolved`,message:n}){return(0,L.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-no-data-source`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,L.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function Tu({schema:e,mapping:t,dataSource:n,testId:r,errorTitle:i,requiresDataSource:a,noDataSourceMessage:o,children:s}){let c=yu(e,t,n),l=Su(n);return a&&l==null?(0,L.jsx)(wu,{testId:r,message:o}):c.status===`missing`?(0,L.jsx)(bu,{testId:r,title:i,message:c.error}):c.status===`loading`?(0,L.jsx)(xu,{testId:r}):s(c.schema)}function Eu(...e){for(let t of e)if(typeof t==`string`&&t.trim())return t;return null}function Du(e){let t=e,n=t&&typeof t==`object`?Eu(t.details?.error,t.details?.message,t.error):null;if(!n){let r=e instanceof Error?e.message:typeof e==`string`?e:typeof t?.message==`string`?t.message:``,i=r.indexOf(`{`);if(i>=0)try{let e=JSON.parse(r.slice(i));n=Eu(e?.error,e?.message)}catch{}!n&&r.trim()&&(n=r)}return n&&n.replace(/^\[[^\]]+\]\s*/,``).replace(/^[A-Z][A-Z0-9_]+:\s*/,``).trim()||null}function Ou(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.userMessage==`string`&&t.userMessage.trim())return t.userMessage;let n=t.details;return n&&typeof n==`object`&&typeof n.userMessage==`string`&&n.userMessage.trim()?n.userMessage:null}function ku(e){let t=e;if(!t||typeof t!=`object`)return null;let n=Array.isArray(t.validationErrors)&&t.validationErrors||Array.isArray(t.details?.fields)&&t.details.fields||Array.isArray(t.fields)&&t.fields||null;if(!n||!Array.isArray(n))return null;let r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=Eu(t.field,t.name,t.path);if(!n)continue;let i=Eu(t.message,t.error,t.code)??``;r.push({field:n,message:i})}return r.length>0?r:null}function Au(e){let t=e;if(!t||typeof t!=`object`)return!1;if((t.httpStatus??t.status??t.statusCode)===403)return!0;let n=Eu(t.code,t.details?.code)??``;if(n===`PERMISSION_DENIED`||n===`FORBIDDEN`)return!0;let r=`${typeof t.message==`string`?t.message:``} ${t.details?.error??t.error??``}`;return/row-level security|access denied|permission denied|not permitted/i.test(r)}var ju=new Set([`INVALID_FILTER`,`UNSUPPORTED_QUERY_PARAM`,`INVALID_QUERY`]);function Mu(e){let t=e,n=[t?.httpStatus,t?.status,t?.statusCode].find(e=>typeof e==`number`);if(n===void 0){let e=/HTTP (\d{3})\b/.exec(String(t?.message??``));e&&(n=Number(e[1]))}let r=typeof t?.code==`string`?t.code.toUpperCase():``;return le(e)?`api-disabled`:n===403||r===`PERMISSION_DENIED`||r===`FORBIDDEN`?`forbidden`:n===401||r===`UNAUTHORIZED`||r===`UNAUTHENTICATED`?`unauthorized`:n===400||ju.has(r)?`rejected`:`network`}var Nu=2e3,Pu=2001;function Fu(e){let t=ht(e),n=e&&typeof e==`object`&&typeof e.total==`number`?e.total:void 0,r=t.length>Nu;return{rows:r?t.slice(0,Nu):t,total:n,truncated:r}}function Iu({drawn:e,total:t,truncated:n,className:r}){let{t:i}=he();if(!n)return null;let a=typeof t==`number`?i(`common.rowCeilingNote`,{shown:e,total:t,defaultValue:de.common.rowCeilingNote}):i(`common.rowCeilingNoteUnknownTotal`,{shown:e,defaultValue:de.common.rowCeilingNoteUnknownTotal});return(0,L.jsx)(`p`,{role:`note`,"data-row-ceiling-note":`non-grid`,className:r??`px-1 py-1 text-xs text-muted-foreground`,children:a})}var Lu=[{key:`indexed`,retiredBy:`objectui#4644`,specEquivalent:null,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`referenceTo`,retiredBy:`objectui#6041`,specEquivalent:`reference`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`formula`,retiredBy:`objectui#6043`,specEquivalent:`expression`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`isSystem`,retiredBy:`objectui#6044`,specEquivalent:`system`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`sortOrder`,retiredBy:`objectui#6045`,specEquivalent:null,defensive:!0,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!1}}];function Ru(e){return Lu.filter(t=>t.sites[e]).map(e=>e.key)}function X(e){return be({error:e}).optional().describe(e)}function Z(e,t,n){let r=t===`runtime-slot`?`\`${e}\` is a RUNTIME SLOT for a host-supplied function, not authorable metadata (objectui#6124): JSON has no function value, and no handler key consumes a declarative action object. A React host supplies it through the TypeScript interface / props, never through this validator, which refuses it by name.`:`\`${e}\` is RETIRED (objectui#6124, ADR-0049): JSON has no function value, and no renderer reads this key, so nothing could ever run it.`,i=`${n?`${n} — `:``}${r} Author behaviour as a NODE TYPE instead — e.g. { "type": "toast", ... } or an action:button node with a declared action, the spelling PR #6498 established.`;return Se(()=>!1,{error:i}).optional().describe(i)}function zu(e,t,n,r){let i=`Unrecognized key(s) on ${n}: \`${e}\`. Did you mean \`${e}\` → \`${t}\`? ${r}`;return be({error:i}).optional().describe(i)}var Bu=N([P(),T({dialect:P().optional(),source:P()})]),Vu=T({key:P().describe("Translation-bundle key, e.g. `dialog.close`"),defaultValue:P().optional().describe(`Rendered when the key is missing from the bundle`),params:M(P(),O()).optional().describe(`Interpolation values for the key's placeholders`)}),Q=ye(()=>N([Hu,P(),D(),E(),xe(),ge()])),Hu=T({type:P().describe(`Component type identifier`),id:P().optional().describe(`Unique component identifier`),name:P().optional().describe(`Component name`),label:ee.optional().describe(`Display label (plain string or inline locale map)`),description:ee.optional().describe(`Description text (plain string or inline locale map)`),placeholder:P().optional().describe(`Placeholder text`),className:P().optional().describe(`Tailwind CSS classes`),style:M(P(),N([P(),D()])).optional().describe(`Inline CSS styles`),data:O().optional().describe(`Custom data payload`),bind:P().optional().describe(`Data-scope binding path (resolved by useDataScope)`),body:N([Q,A(Q)]).optional().describe(`Child components`),children:N([Q,A(Q)]).optional().describe(`Child components (React-style)`),visible:N([E(),Bu]).optional().describe(`Visibility control (boolean, predicate expression string, or CEL envelope object)`),visibleWhen:P().optional().describe(`Canonical conditional-visibility predicate (ADR-0089)`),visibleOn:P().optional().describe(`[DEPRECATED → visibleWhen] Expression for conditional visibility`),hidden:N([E(),Bu]).optional().describe(`Hidden control (boolean, predicate expression string, or CEL envelope object)`),hiddenOn:P().optional().describe(`Expression for conditional hiding`),disabled:N([E(),Bu]).optional().describe(`Disabled state (boolean, predicate expression string, or CEL envelope object)`),disabledOn:P().optional().describe(`Expression for conditional disabling`),testId:P().optional().describe(`Test identifier`),ariaLabel:N([P(),Vu]).optional().describe(`Accessibility label (plain string or keyed i18n reference)`)}).passthrough(),$=Hu;function Uu(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)));return T(n).partial()}var Wu=j([`string`,`number`,`boolean`,`enum`,`array`,`object`,`color`,`date`,`code`,`file`,`slot`]),Gu=T({name:P().describe(`Property name`),type:N([Wu,A(Wu).min(1).refine(e=>new Set(e).size===e.length,{message:`Input control type arms must be distinct`})]).describe(`Input control type, or the arms of a union type`),label:P().optional().describe(`Display label`),defaultValue:O().optional().describe(`Default value`),required:E().optional().describe(`Required flag`),enum:N([A(P()),A(T({label:P(),value:O()}))]).optional().describe(`Enum options`),description:P().optional().describe(`Help text`),advanced:E().optional().describe(`Advanced option flag`),inputType:X("RETIRED (objectui#5905) — `ComponentInput.inputType` was never read, and never published: the manifest serializer forwards `name`/`type`/`required`/`enum`/`binding`/`description` and this is not one of them, so an authored value was silently dropped. Delete the key; put the control hint in `description`, which IS published."),min:X("RETIRED (objectui#5905) — `ComponentInput.min` was never read, and never published: the manifest serializer forwards `name`/`type`/`required`/`enum`/`binding`/`description` and this is not one of them, so an authored value was silently dropped. Delete the key; spell the numeric domain out in `description`, which IS published."),max:X("RETIRED (objectui#5905) — `ComponentInput.max` was never read, and never published: the manifest serializer forwards `name`/`type`/`required`/`enum`/`binding`/`description` and this is not one of them, so an authored value was silently dropped. Delete the key; spell the numeric domain out in `description`, which IS published."),step:X("RETIRED (objectui#5905) — `ComponentInput.step` was never read, and never published: the manifest serializer forwards `name`/`type`/`required`/`enum`/`binding`/`description` and this is not one of them, so an authored value was silently dropped. Delete the key; spell the numeric domain out in `description`, which IS published."),placeholder:X("RETIRED (objectui#5905) — `ComponentInput.placeholder` was never read, and never published: the manifest serializer forwards `name`/`type`/`required`/`enum`/`binding`/`description` and this is not one of them, so an authored value was silently dropped. Delete the key; put the hint in `description`, which IS published. `BaseSchema.placeholder`, the node-level prop, is a DIFFERENT key and is unaffected.")});T({label:P().optional().describe(`Display name`),icon:P().optional().describe(`Icon name or SVG`),category:P().optional().describe(`Component category`),inputs:A(Gu).optional().describe(`Configurable properties`),defaultProps:M(P(),O()).optional().describe(`Default property values`),examples:M(P(),O()).optional().describe(`Example configurations`),isContainer:E().optional().describe(`Can have children`),resizable:E().optional().describe(`Can be resized`),resizeConstraints:T({width:E().optional(),height:E().optional(),minWidth:D().optional(),maxWidth:D().optional(),minHeight:D().optional(),maxHeight:D().optional()}).optional().describe(`Resize constraints`),tags:A(P()).optional().describe(`Search tags`),description:P().optional().describe(`Component description`)}).extend({type:P().describe(`Component type identifier`),component:O().describe(`Component renderer`)}),M(P(),O()).describe(`HTML attributes`),M(P(),Ce()).describe(`Event handlers`),T({className:P().optional(),style:M(P(),N([P(),D()])).optional()}).describe(`className and inline style`);var Ku=$.extend({type:k(`alert`),title:P().optional().describe(`Alert title`),description:P().optional().describe(`Alert description`),variant:j([`default`,`destructive`]).optional().describe(`Alert variant`),icon:P().optional().describe(`Alert icon`),dismissible:E().optional().describe(`Whether alert can be dismissed`),onDismiss:Z(`onDismiss`,`retired`,`Dismiss handler`),children:N([Q,A(Q)]).optional()}),qu=$.extend({type:k(`statistic`),label:P().optional().describe(`Statistic label`),value:N([P(),D()]).describe(`Statistic value`),trend:j([`up`,`down`,`neutral`]).optional().describe(`Trend indicator`),description:P().optional().describe(`Description text`),icon:P().optional().describe(`Statistic icon`)}),Ju=$.extend({type:k(`badge`),label:P().optional().describe(`Badge label`),variant:j([`default`,`secondary`,`destructive`,`outline`]).optional().describe(`Badge variant`),icon:P().optional().describe(`Badge icon`),children:N([Q,A(Q)]).optional()}),Yu=$.extend({type:k(`avatar`),src:P().optional().describe(`Image source URL`),alt:P().optional().describe(`Alt text`),fallback:P().optional().describe(`Fallback text/initials`),size:j([`sm`,`default`,`lg`,`xl`]).optional().describe(`Avatar size`),shape:j([`circle`,`square`]).optional().describe(`Avatar shape`)}),Xu=T({id:P().optional().describe(`Item ID`),label:P().optional().describe(`Item label`),description:P().optional().describe(`Item description`),icon:P().optional().describe(`Item icon`),avatar:P().optional().describe(`Item avatar URL`),disabled:E().optional().describe(`Whether item is disabled`),onClick:Z(`onClick`,`retired`,`Click handler`),content:N([Q,A(Q)]).optional().describe(`Custom content`)}),Zu=$.extend({type:k(`list`),items:A(Xu).describe(`List items`),ordered:E().optional().describe(`Whether list is ordered`),dividers:E().optional().describe(`Show dividers between items`),dense:E().optional().describe(`Dense spacing`)}),Qu=T({header:P().describe(`Column header text`),accessorKey:P().describe(`Data accessor key`),className:P().optional().describe(`Column class name`),cellClassName:P().optional().describe(`Cell class name`),width:N([P(),D()]).optional().describe(`Column width`),minWidth:N([P(),D()]).optional().describe(`Minimum width`),align:j([`left`,`center`,`right`]).optional().describe(`Column alignment`),fixed:j([`left`,`right`]).optional().describe(`Fixed column position`),type:j(Ut).optional().describe(`Column type`),sortable:E().optional().describe(`Whether column is sortable`),filterable:E().optional().describe(`Whether column is filterable`),resizable:E().optional().describe(`Whether column is resizable`),editable:E().optional().describe(`Whether column is editable (for inline editing)`),cell:Ce().optional().describe(`Custom cell renderer`),headerIcon:O().optional().describe(`Icon node rendered into the header cell, before the header text`),fitContent:E().optional().describe(`Size the column to its own content (width:1% + nowrap) instead of a measured width`),format:P().optional().describe(`Field-meta override: display format pattern (e.g. "$0,0", "0%", "YYYY-MM-DD")`),options:A(T({value:O().describe(`Stored value the cell value is matched against`),label:P().describe(`Label rendered for the matched value`),color:P().optional().describe(`Badge/dot color for the matched value`)})).optional().describe(`Field-meta override: option list for select-flavoured columns`),currency:P().optional().describe(`Field-meta override: ISO 4217 currency code for currency-formatted cells`),wrap:E().optional().describe(`Allow text wrapping`)}),$u=T({header:P().describe(`Column header text`),accessorKey:P().describe(`Data accessor key`),className:P().optional().describe(`Column class name`),cellClassName:P().optional().describe(`Cell class name`),width:N([P(),D()]).optional().describe(`Column width`),minWidth:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),align:X(`RETIRED (objectui#5474) — never read by the static table; use data-table, or a cellClassName like text-right`),fixed:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),type:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),sortable:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),filterable:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),resizable:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),editable:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),cell:X(`RETIRED (objectui#5474) — never read by the static table; use data-table`),headerIcon:X(`NOT on the static table surface (objectui#6424) — declared on the rich TableColumn only; use data-table`),fitContent:X(`NOT on the static table surface (objectui#6424) — declared on the rich TableColumn only; use data-table`),format:X(`NOT on the static table surface (objectui#6425) — declared on the rich TableColumn only; use data-table`),options:X(`NOT on the static table surface (objectui#6425) — declared on the rich TableColumn only; use data-table`),currency:X(`NOT on the static table surface (objectui#6425) — declared on the rich TableColumn only; use data-table`),wrap:X(`NOT on the static table surface (objectui#6650) — declared on the rich TableColumn only; use data-table`)}),ed=$.extend({type:k(`table`),caption:P().optional().describe(`Table caption`),columns:A($u).describe(`Table columns (static subset — objectui#5474)`),data:A(O()).describe(`Table data`),footer:N([Q,A(Q)]).optional().describe(`Table footer`),hoverable:X(`RETIRED (objectui#5474) — the static table never implemented row hover; use data-table`),striped:X(`RETIRED (objectui#5474) — the static table never implemented striping; style rows via className, or use data-table`)}),td=$.extend({type:k(`data-table`),caption:P().optional().describe(`Table caption`),borderless:E().optional().describe(`Render the table without its outer rounded border (for embedding inside grouped rows or other containers).`),toolbar:X(`RETIRED (objectui#6881) — never mounted by the data-table renderer; use the built-in toolbar chrome (searchable / exportable), or compose nodes beside the table`),columns:A(Qu).describe(`Table columns`),data:A(O()).describe(`Table data`),pagination:E().optional().describe(`Enable pagination`),pageSize:D().optional().describe(`Default page size`),pageSizeOptions:A(D()).optional().describe(`Options for the rows-per-page selector (defaults to 5/10/20/50/100).`),searchable:E().optional().describe(`Enable search`),selectable:N([E(),j([`single`,`multiple`])]).optional().describe("Enable row selection — `true`/`multiple` = multi-select, `single` = replace-on-select with no select-all"),sortable:E().optional().describe(`Enable sorting`),exportable:E().optional().describe(`Enable data export`),rowActions:E().optional().describe(`Show the row actions column (edit/delete) — mirrors the boolean the renderer truthiness-tests (objectui#6940)`),resizableColumns:E().optional().describe(`Allow column resizing`),reorderableColumns:E().optional().describe(`Allow column reordering`),onRowEdit:Z(`onRowEdit`,`runtime-slot`,`Row edit handler`),onRowDelete:Z(`onRowDelete`,`runtime-slot`,`Row delete handler`),rowEditPredicates:T({visibleWhen:w().optional(),disabledWhen:w().optional()}).optional().describe(`Per-record CEL predicates for the built-in row Edit item (objectui#2614)`),rowDeletePredicates:T({visibleWhen:w().optional(),disabledWhen:w().optional()}).optional().describe(`Per-record CEL predicates for the built-in row Delete item (objectui#2614)`),onSelectionChange:Z(`onSelectionChange`,`runtime-slot`,`Selection change handler`),onColumnsReorder:Z(`onColumnsReorder`,`runtime-slot`,`Column reorder handler`),cellClassName:P().optional().describe("Extra classes folded into the utility body cells only — the selection, row-number and row-actions cells; data cells fold the per-column `cellClassName` instead, so row density has to be set on both (objectui#6882)"),renderCellEditor:Ce().optional().describe("Host-supplied inline cell editor; returning null falls through to the built-in text/number/date inputs (objectui#6882). Its context carries `row` (the persisted record) and `pendingRow` (that record with the row's staged, unsaved edits merged over it — objectui#7188); `z.function()` encodes no parameter shape, so the member on `DataTableSchema` is the authority for it"),frozenColumns:D().optional().describe(`Number of frozen columns`),showRowNumbers:E().optional().describe(`Show row numbers`),emptyAction:Q.optional().describe(`Optional schema node rendered inside the empty-state, e.g. an "Add record" button. Lets the empty state become an actionable invitation rather than a dead end.`)}),nd=$.extend({type:k(`markdown`),content:P().describe(`Markdown content`),sanitize:X(`RETIRED (objectui#6972) — sanitization is unconditional: rehype-sanitize is a fixed last link of the markdown renderer's rehype chain, and no value of this key ever switched it. There is no authored spelling that disables XSS sanitization; delete the key.`),components:X("RETIRED (objectui#6972) — never read: the markdown renderer forwards only `content` and `className`, and a map of React component overrides is not a JSON-authorable value. Delete the key; the fenced mermaid / metadata block overrides are the renderer's own fixed map, not an authoring surface.")}),rd=ye(()=>T({id:P().describe(`Node ID`),label:P().describe(`Node label`),icon:P().optional().describe(`Node icon`),defaultExpanded:E().optional().describe(`Default expanded state`),selectable:E().optional().describe(`Whether node is selectable`),children:A(rd).optional().describe(`Child nodes`),data:O().optional().describe(`Custom node data`)})),id=$.extend({type:k(`tree-view`),data:A(rd).optional().describe("Tree data, read THIRD as the fallback limb of `boundData || schema.nodes || schema.data || []` at renderers/data-display/tree-view.tsx:105. OPTIONAL since objectui#6939 — requiring a third-choice limb refused four catalog entries the renderer draws correctly. Kept DECLARED rather than deleted: `BaseSchema.data` is `z.any().optional()`, so removing this member would not reject the key, it would admit it unvalidated while the read stays"),nodes:A(rd).optional().describe("Tree data, read FIRST at renderers/data-display/tree-view.tsx:105 — the middle limb of `boundData || schema.nodes || schema.data || []`, so it wins over `data`. Declared by objectui#6150; a `nodes`-only document became LEGAL at objectui#6939, which relaxed `data` (the registration's own `inputs` and `defaultProps` spell it `nodes`, and the four catalog entries ARE those `defaultProps`)"),title:P().optional().describe(`Heading above the tree, read at renderers/data-display/tree-view.tsx:115 (presence gate) and :117 (the h3 body) (objectui#6150)`),defaultExpandedIds:A(P()).optional().describe(`Default expanded node IDs`),defaultSelectedIds:A(P()).optional().describe(`Default selected node IDs`),expandedIds:A(P()).optional().describe(`Controlled expanded node IDs`),selectedIds:A(P()).optional().describe(`Controlled selected node IDs`),multiSelect:E().optional().describe(`Allow multiple selection`),showLines:E().optional().describe(`Show connecting lines`),onSelectChange:Z(`onSelectChange`,`retired`,`Selection change handler`),onExpandChange:Z(`onExpandChange`,`retired`,`Expand change handler`)}),ad=u,od=T({name:P().optional().describe("Series name — also selects this series' column within each chart-level `data` row when `dataKey` is absent"),dataKey:P().optional().describe("Column this series plots within each chart-level `data` row — the internal spelling of `name`, and the one the renderer takes when both are written"),data:X("RETIRED (objectui#6896) — `ChartDataSeries.data` was never read: `normalizeChartSchema` takes rows from the chart node's chart-level `data` and picks a column with the series' `name`/`dataKey`, so an authored array was dropped in silence. Delete the key; put the rows on the chart-level `data` and the category axis on `xAxisKey`."),type:j([`bar`,`line`,`area`]).optional().describe(`Per-series chart family override (combo charts)`),chartType:zu(`chartType`,`type`,`this chart series`,"`chartType` is the renderer's INTERNAL spelling of the declared `type` (objectui#7694): `@objectstack/spec`'s `ChartSeriesSchema` lists it as an alias of `type` and refuses it the same way, and nothing on this authoring face writes it. Write `type` (`bar` | `line` | `area`) for a per-series family override. Until this refusal an authored `chartType` was STRIPPED in silence by this non-strict object, so the series drew in the chart's own family — precisely what the author was overriding."),color:P().optional().describe(`Series color`),label:ee.optional().describe(`Legend / tooltip name for this series — a plain string or an inline locale map; defaults to the column key`),variant:j([`primary`,`comparison`]).optional().describe("Visual role — `comparison` draws the muted period-over-period overlay; `primary` (the default) is the normal treatment. The spec pair: the renderer-internal `current` spelling is not a member (objectui#7682)"),opacity:D().optional().describe(`Stroke and fill opacity override — any finite number, the read's own domain; the spec bounds it to 0–1`),dashArray:P().optional().describe(`SVG stroke-dasharray override, e.g. "4 4" for a dashed line`),stack:P().optional().describe(`Stack group id — series sharing one id stack together`),yAxis:j([`left`,`right`]).optional().describe(`Which y-axis this series binds to on a dual-axis chart`)}).superRefine((e,t)=>{e.name===void 0&&e.dataKey===void 0&&t.addIssue({code:`custom`,path:[`name`],message:"A chart series must name the column it plots, with `name` or `dataKey` — `normalizeChartSchema` drops a series that resolves to neither."})});function sd(e){let t=e.xAxis;if(typeof t!=`string`)return e;let{xAxis:n,...r}=e;return r.xAxisKey===void 0?{...r,xAxisKey:t}:r}var cd=T({enabled:E().optional().describe(`Master switch — true, or any other key present, turns the drill on`),mode:j([`filter`,`record`]).optional().describe(`'filter' (the aggregate default) drills through to a filtered list; 'record' (the table / list default) opens the clicked record itself`),target:j([`drawer`,`dialog`,`navigate`]).optional().describe(`Where the drill lands: 'drawer' (default), 'dialog', or 'navigate' to the object's full list page (falls back to 'drawer' without host drill navigation)`),filter:M(P(),w()).optional().describe("Filter applied to the drilled list; values support ${event.*} interpolation"),title:P().optional().describe("Drawer / dialog title; supports ${event.*} interpolation"),report:N([T({name:P(),objectName:P(),type:j([`tabular`,`summary`,`matrix`,`joined`]).optional(),columns:A(w())}).catchall(w()),T({name:P()})]).optional().describe(`Drill into an analytical report instead of the record list: an inline SpecReport shape, or a named report reference`),columns:A(P()).optional().describe(`Column whitelist for the inline drill list`),maxRows:D().optional().describe(`Hard cap on rows fetched`)}),ld=$.extend({type:k(`chart`),chartType:ad.describe(`Chart type`),title:P().optional().describe(`Chart title`),description:P().optional().describe(`Chart description`),categories:A(P()).optional().describe("Alternative series list — column names to plot, used only when `series` is absent. NOT axis labels: the category axis comes from `xAxisKey`/`xAxis`."),series:A(od).describe(`Chart data series`),data:A(M(P(),O())).optional().describe("Rows to plot — one object per row, keyed by column name. `series[].name`/`dataKey` picks the column to plot within each row; `xAxisKey` names the category column."),xAxisKey:P().optional().describe("Row key holding the category (x) axis. The bare-string sibling spelling `xAxis: 'month'` folds onto this key at parse and does not survive it."),height:N([P(),D()]).optional().describe(`Chart height`),width:N([P(),D()]).optional().describe(`Chart width`),showLegend:E().optional().describe(`Show legend`),showGrid:E().optional().describe(`Show grid lines`),animate:E().optional().describe(`Enable animations`),config:M(P(),O()).optional().describe(`Additional chart configuration`),drillDown:cd.optional().describe(`Drill-down: clicking a chart segment opens a filtered list view (drawer / dialog)`)}).overwrite(sd),ud=T({id:P().optional().describe(`Event ID`),title:P().describe(`Event title`),description:P().optional().describe(`Event description`),date:N([P(),we()]).describe(`Event date`),icon:P().optional().describe(`Event icon`),color:P().optional().describe(`Event color`),content:N([Q,A(Q)]).optional().describe(`Custom content`)}),dd=j([`hour`,`day`,`week`,`month`,`quarter`,`year`]),fd=T({items:A(O()).optional().describe(`A gantt row's bars — an array when present`)}).passthrough(),pd=$.extend({type:k(`timeline`),variant:j([`vertical`,`horizontal`,`gantt`]).optional().describe(`Layout variant`),items:A(fd).optional().describe("Rows to draw — feed items, or gantt rows when variant is gantt; every element an object, and a gantt row's own `items` an array when present"),dateFormat:j([`short`,`long`,`iso`]).optional().describe(`How item dates are rendered`),scale:dd.optional().describe(`Gantt axis bucket size (canonical spelling — the spec key)`),timeScale:X(`RETIRED (objectui#6355) — author scale instead`),rowLabel:P().optional().describe(`Header label above the gantt row-label gutter`),minDate:P().optional().describe(`Override the auto-calculated gantt axis start (YYYY-MM-DD)`),maxDate:P().optional().describe(`Override the auto-calculated gantt axis end (YYYY-MM-DD)`),events:A(ud).optional().describe(`DEPRECATED — zero read points; renders an empty rail. Use items`),orientation:j([`vertical`,`horizontal`]).optional().describe(`DEPRECATED — zero read points. Use variant`),position:j([`left`,`right`,`alternate`]).optional().describe(`DEPRECATED — zero read points`)}),md=$.extend({type:k(`kbd`),label:P().optional().describe(`Key label`),keys:N([P(),A(P())]).optional().describe(`Key(s) to display`)}),hd=$.extend({type:k(`html`),html:P().describe(`HTML content`)}),gd=$.extend({type:k(`bar-chart`),data:A(M(P(),O())).optional().describe(`Rows to plot; one bar per row`),dataKey:P().optional().describe(`Row key holding the bar value (y axis)`),xAxisKey:P().optional().describe(`Row key holding the bar category (x axis)`),height:D().optional().describe(`Chart height in pixels`),color:P().optional().describe(`Bar fill colour`)});ve(`type`,[Ku,qu,Ju,Yu,Zu,ed,td,nd,id,ld,pd,md,hd,gd]);var _d=ie,vd=h,yd=p,bd=_,xd=T({field:P().describe(`Field to sort by`),order:j([`asc`,`desc`]).describe(`Sort order`)}),Sd=$.extend({type:k(`object-grid`),objectName:P().describe(`ObjectQL object name`),data:_d.optional().describe(`Data source configuration`),columns:N([A(P()),A(vd)]).optional().describe(`Columns configuration`),filter:A(O()).optional().describe(`Filter criteria`),sort:N([P(),A(xd)]).optional().describe(`Sort configuration`),searchableFields:A(P()).optional().describe(`Searchable fields`),resizable:E().optional().describe(`Enable column resizing`),showColumnTypeIcons:E().optional().describe(`Show column type icons (T/Tag/Calendar) in headers. Off by default — type is usually obvious from cell content; the icons add visual noise.`),selection:yd.optional().describe(`Selection configuration`),pagination:bd.optional().describe(`Pagination configuration`),bulkActions:A(P()).optional().describe(`Bulk action identifiers (spec-canonical key; batchActions is the legacy alias)`),fields:A(P()).optional(),staticData:A(O()).optional(),selectable:N([E(),j([`single`,`multiple`])]).optional(),pageSize:D().optional(),showSearch:E().optional(),showFilters:E().optional(),showPagination:E().optional(),defaultSort:T({field:P(),order:j([`asc`,`desc`])}).optional(),defaultFilters:M(P(),O()).optional(),title:P().optional().describe(`DEPRECATED, write label instead: legacy caption/export-file-title fallback, read only when label is absent`),operators:M(P(),O()).optional(),rowActions:A(P()).optional(),batchActions:A(P()).optional(),editable:E().optional(),keyboardNavigation:E().optional(),frozenColumns:D().optional()}),Cd=$.extend({type:k(`object-form`),objectName:P().describe(`ObjectQL object name`),mode:j([`create`,`edit`,`view`]).describe(`Form mode`),recordId:N([P(),D()]).optional().describe(`Record ID`),title:P().optional().describe(`Form title`),description:P().optional().describe(`Form description`),fields:A(P()).optional().describe(`Included fields`),customFields:A(O()).optional().describe(`Custom field configs`),initialData:M(P(),O()).optional().describe(`Initial data`),groups:A(T({title:P().optional(),description:P().optional(),fields:A(P()),collapsible:E().optional(),defaultCollapsed:E().optional()})).optional().describe(`Field groups`),layout:j([`vertical`,`horizontal`,`inline`,`grid`]).optional().describe(`Form layout`),columns:D().optional().describe(`Grid columns`),showSubmit:E().optional().describe(`Show submit button`),submitText:P().optional().describe(`Submit button text`),successMessage:P().optional().describe(`Success toast text after create/update when no onSuccess handler is given`),navigateOnSuccess:P().optional().describe(`DEPRECATED, write submitBehavior instead: navigate here after success (relative path only; {id}/{recordId} interpolated and URL-escaped); precedes the toast`),resetOnSuccess:E().optional().describe(`Reset the form after a successful create for another entry`),submitBehavior:N([T({kind:k(`thank-you`),title:P().optional(),message:P().optional()}),T({kind:k(`redirect`),url:P(),delayMs:D().optional()}),T({kind:k(`continue`)}),T({kind:k(`next-record`)})]).optional().describe(`Declarative post-submit behavior; takes precedence over successMessage/navigateOnSuccess/resetOnSuccess`),showCancel:E().optional().describe(`Show cancel button`),cancelText:P().optional().describe(`Cancel button text`),showReset:E().optional().describe(`Show reset button`),initialValues:M(P(),O()).optional().describe(`Initial values`),readOnly:E().optional().describe(`Read-only mode`)}),wd=$.extend({type:k(`object-view`),objectName:P().describe(`ObjectQL object name`),title:P().optional().describe(`View title`),description:P().optional().describe(`View description`),layout:j([`drawer`,`modal`,`page`]).optional().describe(`Layout mode`),table:ye(()=>Sd.omit({type:!0,objectName:!0}).partial()).optional().describe(`Table config`),form:ye(()=>Cd.omit({type:!0,objectName:!0,mode:!0}).partial()).optional().describe(`Form config`),showSearch:E().optional().describe(`Show search`),showFilters:E().optional().describe(`Show filters`),showSort:E().optional().describe(`Show sort controls`),showCreate:E().optional().describe(`Show create button`),showRefresh:E().optional().describe(`Show refresh button`),operations:T({create:E().optional(),read:E().optional(),update:E().optional(),delete:E().optional()}).optional().describe(`Enabled operations`)}),Td=T({label:P().describe(`Option display label`),value:N([P(),D(),E()]).describe(`Option value`),color:P().optional().describe(`Option badge color`)}),Ed=T({field:P().describe(`Field name to filter on`),label:P().optional().describe(`Display label`),type:j([`select`,`multi-select`,`boolean`,`date-range`,`text`]).optional().describe(`Filter input type`),options:A(Td).optional().describe(`Static options`),showCount:E().optional().describe(`Show record count per option`),defaultValues:A(N([P(),D(),E()])).optional().describe(`Default selected values`)}),Dd=T({field:P().describe(`Field name to filter on`),operator:P().describe(`Filter operator (equals, not_equals, contains, in, greater_than, less_than, …)`),value:O().optional().describe(`Filter value`)}),Od=T({name:P().optional().describe(`Unique tab identifier (snake_case)`),label:P().describe(`Tab display label`),filter:A(Dd).optional().describe(`Filter rules applied when this tab is active`),icon:P().optional().describe(`Lucide icon name`),isDefault:E().optional().describe(`Whether this tab is active by default`),id:P().optional().describe(`@deprecated use name`),filters:A(N([A(O()),P()])).optional().describe(`@deprecated use filter`),default:E().optional().describe(`@deprecated use isDefault`)}).refine(e=>!!(e.name||e.id),{message:`tab requires a name`}),kd=T({element:j([`dropdown`,`tabs`]).describe(`UI element type`),fields:A(Ed).optional().describe(`Field-level filters`),tabs:A(Od).optional().describe(`Named filter presets`),allowAddTab:E().optional().describe(`Allow adding new tabs`),showAllRecords:E().optional().describe(`Show All records tab`)}),Ad=[`type`,`columns`,`name`,`label`,`description`,`userFilters`,`userActions`,`aria`,`conditionalFormatting`,`exportOptions`,`kanban`,`calendar`,`gallery`,`timeline`],jd=te.partial().extend({groupField:P().optional().describe(`Deprecated alias for groupByField`),cardFields:A(P()).optional().describe(`Deprecated alias for columns`)}).passthrough(),Md=f.partial().extend({defaultView:j([`month`,`week`,`day`]).optional().describe(`Initial calendar view mode — 'month' | 'week' | 'day' ('agenda' was retired: objectui#5784)`)}).passthrough(),Nd=C.partial().extend({imageField:P().optional().describe(`Deprecated alias for coverField`)}).passthrough(),Pd=re.partial().extend({dateField:P().optional().describe(`Deprecated alias for startDateField`)}).passthrough(),Fd=x.shape.type.removeDefault(),Id=ae.extend({group:E().optional().describe(`Allow users to group records`),hideFields:E().optional().describe(`Allow users to show/hide columns`),rowColor:E().optional().describe(`Allow users to color rows by a field value`)}),Ld=$.extend(Uu(x.shape,Ad).shape).extend({type:k(`list-view`),objectName:P().describe(`Object Name`),viewType:Fd.optional().describe(`View Type`),columns:N([A(P()),A(vd)]).optional().describe(`Columns definition`),fields:A(P()).optional().describe(`Legacy alias for string[] columns`),filters:A(N([A(O()),P()])).optional().describe(`Filter conditions (legacy)`),showSearch:E().optional().describe(`Show search in toolbar`),showSort:E().optional().describe(`Show sort controls in toolbar`),showFilters:E().optional().describe(`Show filter controls in toolbar`),showHideFields:E().optional().describe(`Show hide-fields button in toolbar`),showGroup:E().optional().describe(`Show group button in toolbar`),showColor:E().optional().describe(`Show color button in toolbar`),showDensity:E().optional().describe(`Show density/row-height button in toolbar`),showDescription:E().optional().describe(`Show field descriptions`),allowExport:E().optional().describe(`Allow data export`),densityMode:j([`compact`,`comfortable`,`spacious`]).optional().describe(`Density mode`),color:P().optional().describe(`Color field for row/card coloring`),fieldTextColor:P().optional().describe(`Field for custom text color`),prefixField:P().optional().describe(`Prefix field before title`),wrapHeaders:E().optional().describe(`Wrap column headers`),clickIntoRecordDetails:E().optional().describe(`Navigate to detail on row click`),addRecordViaForm:E().optional().describe(`Add records via form dialog`),addDeleteRecordsInline:E().optional().describe(`Enable inline add/delete`),collapseAllByDefault:E().optional().describe(`Collapse all groups by default`),options:M(P(),O()).optional().describe(`Component overrides (legacy)`),operations:T({create:E().optional(),read:E().optional(),update:E().optional(),delete:E().optional(),export:E().optional(),import:E().optional()}).optional().describe(`Enabled operations`),userFilters:kd.optional().describe(`User filters configuration (accepts legacy tab shapes)`),userActions:Id.optional().describe(`User action toggles for the view toolbar`),aria:c.extend({live:j([`polite`,`assertive`,`off`]).optional().describe(`aria-live politeness for the list region (objectui-only — promote rather than grow this extension)`)}).optional().describe(`ARIA attributes`),conditionalFormatting:A(N([T({field:P(),operator:j([`equals`,`not_equals`,`contains`,`greater_than`,`less_than`,`in`]),value:O(),backgroundColor:P().optional(),textColor:P().optional(),borderColor:P().optional(),expression:P().optional()}),T({condition:P(),style:M(P(),P())})])).optional().describe(`Conditional formatting rules`),exportOptions:N([A(j([`csv`,`xlsx`,`json`,`pdf`])),T({formats:A(j([`csv`,`xlsx`,`json`,`pdf`])).optional(),maxRecords:D().optional(),includeHeaders:E().optional(),fileNamePrefix:P().optional()})]).optional().describe(`Export options`),kanban:jd.optional().describe(`Kanban-specific configuration`),calendar:Md.optional().describe(`Calendar-specific configuration`),gallery:Nd.optional().describe(`Gallery-specific configuration`),timeline:Pd.optional().describe(`Timeline-specific configuration`)}),Rd=T({latitudeField:P().optional().describe(`Field containing latitude`),longitudeField:P().optional().describe(`Field containing longitude`),locationField:P().optional().describe(`Field with a combined location value`),titleField:P().optional().describe(`Field used as the marker title`),descriptionField:P().optional().describe(`Field used as the marker description`),zoom:D().optional().describe(`Zoom level (1-20); declaring it opts out of the auto-fit`),center:_e([D(),D()]).optional().describe(`Center [lat, lng]; declaring it opts out of the auto-fit`),style:P().optional().describe(`MapLibre style URL/spec (overrides the public demo default)`)}),zd=[`data`,`staticData`,`objectName`];function Bd(e){return(t,n)=>{zd.some(e=>t[e]!==void 0)||n.addIssue({code:`custom`,path:[],params:{code:`RECORD_SOURCE_REQUIRED`},message:`\`${e}\` has no record source: declare one of \`data\`, \`staticData\` or \`objectName\``})}}var Vd=$.extend({type:k(`object-map`),objectName:P().optional().describe(`ObjectQL object name — the THIRD record source getDataConfig resolves, after data and staticData; one of the three must be present (objectui#6939)`),data:_d.optional().describe(`Data source configuration — read FIRST by getDataConfig`),staticData:A(O()).optional().describe(`Inline records — read SECOND by getDataConfig, wrapped into a { provider: value } config`),filter:A(O()).optional().describe(`Query filter, forwarded as $filter`),sort:N([P(),A(xd)]).optional().describe(`Sort configuration, forwarded as $orderby`),map:Rd.optional().describe(`Map configuration (the author face)`),enableClustering:E().optional().describe(`Group nearby markers into clusters`),navigation:ne.optional().describe(`Record navigation behaviour (drawer/dialog/page)`),locationField:P().optional().describe(`Location field (internal flat form; prefer map.locationField)`),titleField:P().optional().describe(`Title field (internal flat form; prefer map.titleField)`),mapStyle:P().optional().describe(`MapLibre style URL/spec (overrides the public demo default)`)}).superRefine(Bd(`object-map`)),Hd=$.extend({type:k(`object-tree`),objectName:P().describe(`ObjectQL object name`),parentField:P().optional().describe(`Single-parent pointer field (auto-detected when omitted)`),labelField:P().optional().describe(`Field rendered indented in the first column`),fields:A(P()).optional().describe(`Additional flat columns`),defaultExpandedDepth:D().optional().describe(`Default expansion depth (0 = roots only)`)}),Ud={borderColorField:P().optional().describe(`Record field carrying a per-task alert stroke colour`),lockField:P().optional().describe(`Record field marking a row view-only (truthy → locked)`),objectField:P().optional().describe(`Record field carrying the row's own object API name`),summaryExtent:j([`children`,`self`]).optional().describe(`How a summary bar's span is computed`),defaultCollapsedDepth:D().optional().describe(`Auto-collapse tree nodes at/below this 0-indexed depth`),dependencyTypes:E().optional().describe(`Whether the store persists dependency link TYPES (fs/ss/ff/sf)`),timeZone:P().optional().describe(`Business time zone (IANA name) the chart's calendar renders in`),exportFileName:P().optional().describe(`Base name for exported PNG/PDF files`),interactions:T({move:E().optional().describe(`Bar / subtree dragging`),resize:E().optional().describe(`Edge resize grips`),progress:E().optional().describe(`The progress drag handle`),link:E().optional().describe(`Dependency UI: drag-to-link dots and the create/delete menu`)}).optional().describe(`Per-interaction switches, each defaulting to true`),timeSegments:T({dayStart:P().optional().describe(`Clock time the shift-day begins, 'HH:mm'`),bands:A(T({key:P().optional().describe(`Stable band id`),label:P().describe(`Display label`),start:P().describe(`Band start, 'HH:mm'`),end:P().describe(`Band end, 'HH:mm'`),color:P().optional().describe(`Accent colour for the column tint`)})).describe(`Ordered bands covering the 24h shift-day`),showMidnight:E().optional().describe(`Draw the dashed calendar-midnight cue`)}).optional().describe(`Shift segmentation for the day-mode timeline`)},Wd=$.extend({type:k(`object-gantt`),objectName:P().optional().describe(`ObjectQL object name — the THIRD record source getDataConfig resolves, after data and staticData; one of the three must be present (objectui#6939)`),data:_d.optional().describe(`Data source configuration — read FIRST by getDataConfig; undeclared on either face until objectui#6939`),startDateField:P().optional().describe(`Start date field`),endDateField:P().optional().describe(`End date field`),titleField:P().optional().describe(`Title field`),dependencyField:P().optional().describe(`Deprecated alias for dependenciesField`),progressField:P().optional().describe(`Progress field`),viewMode:y.shape.viewMode.describe(`Initial timeline granularity, honoured by both renderer branches; when omitted, a persisted layout may seed it`),skipWeekends:E().optional().describe(`Skip weekends in duration / auto-schedule math (working calendar)`),holidays:A(P()).optional().describe(`Non-working dates for the working calendar, ISO 'yyyy-mm-dd' (UTC)`),persistLayout:E().optional().describe(`Opt OUT of layout persistence — only an explicit false disables it`),viewName:P().optional().describe("Layout-persistence scope; storage key is `objectName:viewName` (default 'default')"),navigation:ne.optional().describe(`Record navigation behaviour on task click (drawer/dialog/page)`),markers:A(T({date:P().describe(`Marker position, ISO date or datetime string`),label:P().optional().describe(`Text drawn against the line`),color:P().optional().describe(`Line colour — any CSS colour`)})).optional().describe(`Extra vertical reference lines drawn like the Today marker`),criticalPath:E().optional().describe(`Seed the critical-path highlight ON (toolbar toggle stays available)`),showBaselines:E().optional().describe(`Render planned-vs-actual baseline bars — defaults ON, only an explicit false disables`),readOnly:E().optional().describe(`Disable every write path and lock the record drawer`),mobileReadOnly:E().optional().describe(`Auto read-only on narrow viewports — defaults ON, only an explicit false disables`),colorField:y.shape.colorField,dependenciesField:y.shape.dependenciesField,parentField:y.shape.parentField,typeField:y.shape.typeField,tooltipFields:y.shape.tooltipFields,baselineStartField:y.shape.baselineStartField,baselineEndField:y.shape.baselineEndField,groupByField:y.shape.groupByField,resourceView:y.shape.resourceView,assigneeField:y.shape.assigneeField,effortField:y.shape.effortField,capacity:y.shape.capacity,quickFilters:y.shape.quickFilters,autoZoomToFilter:y.shape.autoZoomToFilter,...Ud,gantt:y.extend(Ud).optional().describe(`Nested gantt config block — the authoring face, and the winner over the flattened top-level keys whenever present`),staticData:A(O()).optional().describe(`Inline records, wrapped into a { provider: value } data config — read SECOND by getDataConfig`),filter:A(O()).optional().describe(`Query filter, forwarded verbatim as $filter`),sort:N([P(),A(xd)]).optional().describe(`Sort configuration, forwarded as $orderby`)}).superRefine(Bd(`object-gantt`)),Gd=$.extend({type:k(`object-calendar`),objectName:P().describe(`ObjectQL object name`),startDateField:P().optional().describe(`Start date field`),endDateField:P().optional().describe(`End date field`),titleField:P().optional().describe(`Title field`),defaultView:j([`month`,`week`,`day`]).optional().describe(`Default view — 'month' | 'week' | 'day', the renderer's rendered set ('agenda' was retired: objectui#5784)`)}),Kd=N([T({field:P().describe(`Field name to check`),operator:j([`equals`,`not_equals`,`contains`,`in`]).describe(`Comparison operator`),value:N([P(),A(P())]).describe(`Value to compare against`),backgroundColor:P().optional().describe(`Background color`),borderColor:P().optional().describe(`Border color`)}),T({condition:P().describe(`CEL predicate evaluated against the card record`),style:M(P(),P()).describe(`CSS styles applied when the condition is true`)})]),qd=$.extend({type:k(`object-kanban`),objectName:P().describe(`ObjectQL object name`),groupField:P().describe(`Group field`),titleField:P().optional().describe(`Title field`),cardFields:A(P()).optional().describe(`Card fields`),quickAdd:E().optional().describe(`Enable Quick Add button at column bottom`),coverImageField:P().optional().describe(`Field name for cover image on cards`),allowCollapse:E().optional().describe(`Allow columns to collapse/expand`),conditionalFormatting:A(Kd).optional().describe(`Card conditional formatting rules`)}),Jd=$.extend({type:k(`object-chart`),objectName:P().optional().describe(`ObjectQL object name (legacy inline path)`),chartType:j([`bar`,`column`,`horizontal-bar`,`line`,`area`,`pie`,`donut`,`scatter`]).describe(`Chart type`),xAxisField:P().optional().describe(`X axis field (legacy inline path)`),yAxisFields:A(P()).optional().describe(`Y axis fields (legacy)`),aggregation:j([`cardinality`,`sum`,`avg`,`min`,`max`]).optional().describe(`Aggregation (legacy)`),dataset:P().optional().describe(`Semantic-layer dataset name (ADR-0021)`),dimensions:A(P()).optional().describe(`Dataset dimension names`),values:A(P()).optional().describe(`Dataset measure names`),colors:N([A(P()),M(P(),P())]).optional().describe(`Positional palette (string[]) OR a value→color map ({ value: color }, kanban-style). Select/lookup option colors and explicit maps win over the palette per category.`)}),Yd=$.extend({type:k(`object-gallery`),objectName:P().optional().describe(`ObjectQL object name`),filter:w().optional().describe(`Query filter, forwarded verbatim as $filter`),data:A(M(P(),w())).optional().describe(`Inline records`),gallery:C.optional().describe(`Gallery configuration (@objectstack/spec GalleryConfig)`),navigation:ne.optional().describe(`Record navigation behaviour (drawer/dialog/page)`),grouping:m.optional().describe(`Grouping configuration for sectioned display`),imageField:P().optional().describe(`DEPRECATED — use gallery.coverField`),titleField:P().optional().describe(`DEPRECATED — use gallery.titleField`)}),Xd=$.extend({type:k(`object-data-table`),objectName:P().optional().describe(`ObjectQL object name`),dataProvider:T({provider:P(),object:P().optional()}).optional().describe(`Data-provider binding carried from the dashboard widget definition`),filter:O().optional().describe(`Query filter, resolved through the filter scope and forwarded as $filter`),data:A(O()).optional().describe(`Inline rows`),columns:A(O()).optional().describe(`Column definitions (names or column objects)`),searchable:E().optional().describe(`Forwarded to the rendered data-table`),pagination:E().optional().describe(`Forwarded to the rendered data-table`),drillDown:cd.optional().describe(`Drill-to-record: clicking a row opens that record in a detail drawer (DashboardRenderer defaults object-backed table widgets to { enabled: true, mode: record })`),onRowClick:Z(`onRowClick`,`runtime-slot`,`Row click handler (overrides drill-to-record)`)});N([Sd,Cd,wd,Vd,Hd,Wd,Gd,qd,Jd,Yd,Xd,Ld]);export{el as $,fr as $n,Ge as $r,Ao as $t,Kl as A,ca as An,Lt as Ar,xs as At,bl as B,pi as Bn,Ot as Br,Xo as Bt,ou as C,Na as Cn,qt as Cr,Ds as Ct,eu as D,wa as Dn,Gt as Dr,ps as Dt,nu as E,Oa as En,Yt as Er,Os as Et,Tl as F,Yi as Fn,At as Fr,us as Ft,al as G,Jr as Gn,pt as Gr,Ko as Gt,_l as H,fi as Hn,bt as Hr,Zo as Ht,El as I,ji as In,jt as Ir,cs as It,ul as J,Ar as Jn,ct as Jr,Bo as Jt,sl as K,qr as Kn,dt as Kr,Ho as Kt,Sl as L,Di as Ln,Nt as Lr,ss as Lt,jl as M,na as Mn,Rt as Mr,q as Mt,Al as N,ta as Nn,Pt as Nr,ls as Nt,$l as O,Ca as On,Ht as Or,bs as Ot,Dl as P,Xi as Pn,Ft as Pr,ds as Pt,Xc as Q,Tr as Qn,We as Qr,jo as Qt,Cl as R,Ei as Rn,Dt as Rr,os as Rt,cu as S,Pa as Sn,Xt as Sr,Cs as St,ru as T,ka as Tn,Kt as Tr,ws as Tt,pl as U,ui as Un,ht as Ur,Jo as Ut,gl as V,di as Vn,Et as Vr,as as Vt,ml as W,ii as Wn,mt as Wr,Vo as Wt,rl as X,br as Xn,F as Xr,Io as Xt,dl as Y,jr as Yn,lt as Yr,zo as Yt,il as Z,xr as Zn,qe as Zr,Mo as Zt,fu as _,co as _n,sn as _r,J as _t,Iu as a,vo as an,Vn as ar,zc as at,gu as b,Fa as bn,$t as br,Ps as bt,Ou as c,mo as cn,Ln as cr,Ic as ct,Au as d,qa as dn,un as dr,jc as dt,He as ei,ko as en,rr as er,Qc as et,bu as f,Xa as fn,pn as fr,kc as ft,Su as g,Ya as gn,on as gr,oc as gt,Cu as h,oo as hn,mn as hr,Ec as ht,Pu as i,Te as ii,So as in,Hn as ir,Rc as it,Il as j,ea as jn,It as jr,hs as jt,Ql as k,sa as kn,zt as kr,ms as kt,ku as l,Za as ln,In as lr,Lc as lt,xu as m,so as mn,hn as mr,Dc as mt,Ru as n,Le as ni,xo as nn,er as nr,tl as nt,Fu as o,go as on,kn as or,Bc as ot,Tu as p,Va as pn,dn as pr,Ac as pt,ol as q,Mr as qn,ot as qr,qo as qt,Nu as r,De as ri,Co as rn,Un as rr,$c as rt,Mu as s,ho as sn,Bn as sr,Vc as st,Rd as t,Ve as ti,wo as tn,z as tr,Zc as tt,Du as u,Qa as un,Sn as ur,Pc as ut,pu as v,eo as vn,en as vr,Fs as vt,iu as w,Ma as wn,Jt as wr,Ts as wt,lu as x,Ia as xn,Qt as xr,Ms as xt,hu as y,Ja as yn,an as yr,js as yt,yl as z,mi as zn,kt as zr,Yo as zt};
|