@lobu/runtime-server 24.6.0 → 24.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component.json +1 -1
- package/dist/owletto/dist/assets/_-CZgmjLR9.js +2 -0
- package/dist/owletto/dist/assets/_-Cm5OgtYD.js +3 -0
- package/dist/owletto/dist/assets/_agentId-Cci6NFc1.js +2 -0
- package/dist/owletto/dist/assets/_agentId-GhWTlPO2.js +2 -0
- package/dist/owletto/dist/assets/_automationId-KUlxSTK2.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-Zpy7Hvml.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-CYDRp9UX.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-NNqDdije.js +2 -0
- package/dist/owletto/dist/assets/_eventId-0BSX6VHj.js +2 -0
- package/dist/owletto/dist/assets/_owner-C-CD22NB.js +3 -0
- package/dist/owletto/dist/assets/_shape-CvXp4omb.js +2 -0
- package/dist/owletto/dist/assets/_slug-DgK7zpKA.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-cH54P0zY.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-m0B5j7L9.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CQZQ0wwC.js → accept-invitation-CX7Egv-p.js} +2 -2
- package/dist/owletto/dist/assets/activity-link-rXNpmppV.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-B0m7_g9q.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-CpUTAjXf.js → agent-client-setup-list-BmD3-_Ox.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-Br_ycC0z.js → agent-connect-pages-BtOTCsTU.js} +2 -2
- package/dist/owletto/dist/assets/agent-editor-form-CirqCpcM.js +2 -0
- package/dist/owletto/dist/assets/agent-list-row-SyACVYX7.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-_18OREnx.js → agent-loading-shells-DHvKiEUB.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-Dsc26dyW.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-1DBn7Xc_.js → agent-skill-context-DF5q0Dfr.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-Pi5cECga.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-FyEO-y44.js → agent-thread-B1ZepGZc.js} +4 -4
- package/dist/owletto/dist/assets/agents-D1FHZ0jR.js +2 -0
- package/dist/owletto/dist/assets/app._appId-01I0CJal.js +2 -0
- package/dist/owletto/dist/assets/{assist-composer-Mn9EfX4X.js → assist-composer-BD9msDk3.js} +2 -2
- package/dist/owletto/dist/assets/automation-detail-content-BFv1TglZ.js +2 -0
- package/dist/owletto/dist/assets/automation-row-CmTpAD4r.js +2 -0
- package/dist/owletto/dist/assets/{automation-source-list-Dhucq1sI.js → automation-source-list-D8ZSavQU.js} +2 -2
- package/dist/owletto/dist/assets/automations-D1FHZ0jR.js +2 -0
- package/dist/owletto/dist/assets/{callback-9xSHyA12.js → callback-Ckrxv0eo.js} +2 -2
- package/dist/owletto/dist/assets/{card-g4yxo4Hr.js → card-DT9mSjSp.js} +2 -2
- package/dist/owletto/dist/assets/{change-summary-DeuXQEpb.js → change-summary-CGrKEJ04.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B98IhDra.js → claim-Bzby28tT.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-BD2HBo-_.js → client-activity-scopes-DoIErdUy.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-x_CxeWkP.js → client-rows-BbVQy5Ti.js} +2 -2
- package/dist/owletto/dist/assets/{clients-Cmp0LmOp.js → clients-6aJvabvS.js} +2 -2
- package/dist/owletto/dist/assets/connect-BmDziBzI.js +2 -0
- package/dist/owletto/dist/assets/{connect-menu-CezOH3s7.js → connect-menu-Bs8mxsga.js} +2 -2
- package/dist/owletto/dist/assets/connect._clientId-t5aKu3aa.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DswMAw8l.js +2 -0
- package/dist/owletto/dist/assets/{connection-B6fM2KHN.js → connection-BOaMa324.js} +2 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BLCjhP-H.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-BAP_f77M.js +2 -0
- package/dist/owletto/dist/assets/{connector-page-shell-Di6XzkVo.js → connector-page-shell-ClOmVPJr.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-BrnasBW4.js → connector-provenance-wmYu5jwO.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-DnOUxX_U.js → connectors-D5F5rHxX.js} +2 -2
- package/dist/owletto/dist/assets/{consent-Byli4yMs.js → consent-RqHNkmm8.js} +2 -2
- package/dist/owletto/dist/assets/{copy-button-Ddf7lBjZ.js → copy-button-D6zpsZLi.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-BsXtvNoI.js → core.esm-BIE97rfo.js} +3 -3
- package/dist/owletto/dist/assets/create-BPxsKwk7.js +2 -0
- package/dist/owletto/dist/assets/{create-YdAnh3ml.js → create-GT8_yF0R.js} +2 -2
- package/dist/owletto/dist/assets/create-Yx2qBMBy.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-B12yTrmj.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-CzXqSkuI.js +2 -0
- package/dist/owletto/dist/assets/custom-guardrail-edits-B9plaLBN.js +2 -0
- package/dist/owletto/dist/assets/{definition-comparison-B5WgZILB.js → definition-comparison-C3k6Wa9B.js} +2 -2
- package/dist/owletto/dist/assets/detail-page-skeleton-I5_7FkKx.js +2 -0
- package/dist/owletto/dist/assets/{device-DdCoCj-Q.js → device-CadaiNF4.js} +2 -2
- package/dist/owletto/dist/assets/device-automation-Dp3faMvp.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-U7Bx05P6.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-DTZqj1HS.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-DyT_9iVE.js +2 -0
- package/dist/owletto/dist/assets/entity-options-CGTjLlcS.js +2 -0
- package/dist/owletto/dist/assets/entity-page-DHHMmA8V.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-eYbG2FDT.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-D0ghgRgq.js → entity-type-page-CjFqxSdL.js} +2 -2
- package/dist/owletto/dist/assets/event-card-BtTUuf2q.js +2 -0
- package/dist/owletto/dist/assets/event-detail-8xHiplt_.js +2 -0
- package/dist/owletto/dist/assets/events-feed-zFnTSE27.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-Dd5R2Etd.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B5xXnKtV.js → full-page-spinner-CCU4PkRv.js} +2 -2
- package/dist/owletto/dist/assets/home-stream-IVsNEkwp.js +2 -0
- package/dist/owletto/dist/assets/index-2oaMOFKe.js +2 -0
- package/dist/owletto/dist/assets/index-B-Ab8srM.js +7899 -0
- package/dist/owletto/dist/assets/index-B4RZgvvI.js +2 -0
- package/dist/owletto/dist/assets/{index-BDl1_w6U.js → index-B72KYdN1.js} +2 -2
- package/dist/owletto/dist/assets/index-BBZM53p8.js +2 -0
- package/dist/owletto/dist/assets/index-BOb0a5f9.js +2 -0
- package/dist/owletto/dist/assets/{index-BdNR51Ua.js → index-BYFDMIQC.js} +2 -2
- package/dist/owletto/dist/assets/index-BwnFQcMe.js +2 -0
- package/dist/owletto/dist/assets/index-CvYsWYlF.js +2 -0
- package/dist/owletto/dist/assets/{index-CkiyxW4w.js → index-DIXIvtnM.js} +2 -2
- package/dist/owletto/dist/assets/index-DLwokXHW.js +2 -0
- package/dist/owletto/dist/assets/index-_nlPHus1.js +2 -0
- package/dist/owletto/dist/assets/index-cwOgj4-i.js +2 -0
- package/dist/owletto/dist/assets/{index-TkPy_P_u.js → index-pmr1WUoG.js} +2 -2
- package/dist/owletto/dist/assets/index-pp4qmhkA.js +2 -0
- package/dist/owletto/dist/assets/index-tTbno-PX.css +1 -0
- package/dist/owletto/dist/assets/{json-diff-DtZtra_g.js → json-diff-B-1Swv_y.js} +2 -2
- package/dist/owletto/dist/assets/list-skeleton-BAqT0vxo.js +2 -0
- package/dist/owletto/dist/assets/{login-TWR0vF4_.js → login-D5bIjMtf.js} +2 -2
- package/dist/owletto/dist/assets/{logout-BA5kojS0.js → logout-JYZvxz8v.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-BQiRAqtx.js → member-scope-gate-Lj9m4RL2.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-rAKfVdQ_.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-B2cjCn0V.js → model-selector-onvGA9Ww.js} +2 -2
- package/dist/owletto/dist/assets/{new-Dc5Bbotb.js → new-B-Jd-vBl.js} +2 -2
- package/dist/owletto/dist/assets/new-BmehH1uR.js +2 -0
- package/dist/owletto/dist/assets/new-KDi15LWZ.js +2 -0
- package/dist/owletto/dist/assets/{organization-B9U1L-56.js → organization-B9bh20Xo.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-Bqus80Mq.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-BP3xHM2d.js → pending-seed-CoFPQ835.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BED-DO9C.js → proposal-review-shell-CnACXCUg.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-Dlh-eWz0.js +2 -0
- package/dist/owletto/dist/assets/record-activity-6CfR95Ul.js +2 -0
- package/dist/owletto/dist/assets/{record-session-DOFgdd43.js → record-session-Bpx4_LGk.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-CHPS-1vD.js → renderer-CgaQKMoG.js} +26 -26
- package/dist/owletto/dist/assets/{reset-password-BmNM-apc.js → reset-password-C-4Jnuqk.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-BvruBM5H.js +2 -0
- package/dist/owletto/dist/assets/{runs-BntGAKQG.js → runs-BMzp7j7j.js} +2 -2
- package/dist/owletto/dist/assets/runs-list-DVhrTr3v.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-v3nR2Oa2.js → schema-type-editor-panel-Bdeumkux.js} +2 -2
- package/dist/owletto/dist/assets/{schema-value-BFb7jCBo.js → schema-value-BUgC0Ro8.js} +2 -2
- package/dist/owletto/dist/assets/{settings-DubSpJfg.js → settings-DYYvrrZ4.js} +2 -2
- package/dist/owletto/dist/assets/skill-route-key-sF006xiz.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CBV9tsR3.js +2 -0
- package/dist/owletto/dist/assets/status-variants-DT61YfsU.js +2 -0
- package/dist/owletto/dist/assets/{table-DALHuXPE.js → table-B6yimlsZ.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-D9hKpufo.js → use-automations-II_YJWtN.js} +2 -2
- package/dist/owletto/dist/assets/{use-login-redirect-ciwfc-7A.js → use-login-redirect-BqtEilid.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-CJGCatFS.js → use-mention-search-Bxlpd6Dp.js} +3 -3
- package/dist/owletto/dist/assets/view-param-filters-DYlqBocg.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-CZ1fvAks.js → views-access-required-BVtMfgLh.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +84 -5
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-DT3E3BmS.js +0 -3
- package/dist/owletto/dist/assets/_-c1xy7bLu.js +0 -2
- package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DV8utajn.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +0 -2
- package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +0 -2
- package/dist/owletto/dist/assets/_name-CM1AMywz.js +0 -2
- package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +0 -3
- package/dist/owletto/dist/assets/_shape-DGAkETDp.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +0 -2
- package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +0 -2
- package/dist/owletto/dist/assets/_view-B5I7mmkl.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CZykJXQp.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-DuQJhtqp.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CN7vpC0X.js +0 -2
- package/dist/owletto/dist/assets/agent-list-row-BnP6r4pm.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-DSjidWHL.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-d5jh3oBR.js +0 -2
- package/dist/owletto/dist/assets/agent-tab-intro-DKrC3SQt.js +0 -2
- package/dist/owletto/dist/assets/agents-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-CDpJmUVN.js +0 -2
- package/dist/owletto/dist/assets/app._appId-DwNeXRJp.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +0 -2
- package/dist/owletto/dist/assets/automation-row-B5Q1B10y.js +0 -2
- package/dist/owletto/dist/assets/automations-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/connect-zUot_0kG.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DBNP2mZo.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-Ckq-qEbD.js +0 -2
- package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-BXsJqieG.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-CbqSFeVm.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-dQnZARCD.js +0 -2
- package/dist/owletto/dist/assets/create-B34eskZ_.js +0 -2
- package/dist/owletto/dist/assets/create-DLB9sXgU.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BkU_En_f.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +0 -2
- package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CmC-DVrK.js +0 -2
- package/dist/owletto/dist/assets/events-feed-CGzA1w3R.js +0 -2
- package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +0 -2
- package/dist/owletto/dist/assets/guardrails-DkXatmea.js +0 -2
- package/dist/owletto/dist/assets/identity-BwJy3ixB.js +0 -2
- package/dist/owletto/dist/assets/index-35ehGReZ.js +0 -2
- package/dist/owletto/dist/assets/index-B9hYiwBw.js +0 -2
- package/dist/owletto/dist/assets/index-BjcZVe7n.js +0 -7899
- package/dist/owletto/dist/assets/index-BqAVebvY.js +0 -2
- package/dist/owletto/dist/assets/index-BvK1fS1J.js +0 -2
- package/dist/owletto/dist/assets/index-CNEpTkgw.css +0 -1
- package/dist/owletto/dist/assets/index-CRc73k1t.js +0 -2
- package/dist/owletto/dist/assets/index-CYGaSD3y.js +0 -2
- package/dist/owletto/dist/assets/index-CfZGe-zn.js +0 -2
- package/dist/owletto/dist/assets/index-CzLDNB2E.js +0 -2
- package/dist/owletto/dist/assets/index-D-o5iOVd.js +0 -2
- package/dist/owletto/dist/assets/index-DjYVV1Ml.js +0 -2
- package/dist/owletto/dist/assets/index-VyAX-asP.js +0 -2
- package/dist/owletto/dist/assets/list-skeleton-CIHWCi2a.js +0 -2
- package/dist/owletto/dist/assets/manage-gear-C-0BAMbC.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +0 -74
- package/dist/owletto/dist/assets/model-C2q7WDcS.js +0 -2
- package/dist/owletto/dist/assets/models-CZkH5gtj.js +0 -2
- package/dist/owletto/dist/assets/nav-pill-Bam6s3jj.js +0 -2
- package/dist/owletto/dist/assets/new-BJst6K0b.js +0 -2
- package/dist/owletto/dist/assets/new-DgbivfDe.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +0 -2
- package/dist/owletto/dist/assets/permissions-BVlbeY4u.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CTLwq8s1.js +0 -2
- package/dist/owletto/dist/assets/run-activity-link-Dh1YyCfk.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-CCxNv0rK.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-BwTVaRsE.js +0 -2
- package/dist/owletto/dist/assets/runs-table-CYS1jDdL.js +0 -2
- package/dist/owletto/dist/assets/settings-DBgT60nY.js +0 -2
- package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-m8gECt82.js +0 -2
- package/dist/owletto/dist/assets/status-dot-BnQPFrcU.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BWCrmNIB.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aA as fs,j as e,r as b,c as V,w as ie,cO as ps,cP as hs,cQ as vs,L as Ge,a0 as ys,cR as gs,cS as xs,cG as bs,cT as It,cU as A,bj as ft,cV as js,cW as ks,ao as Cs,cX as Ss,an as Ns,cY as _s,cZ as ae,cn as Is,c_ as At,c$ as As,aq as Es,d0 as Ts,bb as Fs,d1 as Rs,aw as Ce,d2 as ws,d3 as Os,at as Et,aI as Tt,d4 as Ms,cB as Ps,d5 as Ls,d6 as Ft,d7 as $s,d8 as Ds,ct as Bs,b8 as Ks,bl as Gs,bm as Us,d9 as Vs,bn as Qs,bo as zs,bp as Ws,S as Hs,da as Ys,I as qs,i as Ne,X as Zs,B as W,db as Xs,dc as Js,dd as en,bQ as tn,de as sn,df as nn,dg as on,dh as Rt,di as pt,q as an,dj as cn,dk as Pe,dl as ht,cD as rn,dm as ln,l as dn,aH as un,dn as mn,dp as fn,dq as pn,dr as hn,ds as vn,dt as yn,du as gn,b_ as xn,dv as bn,aY as jn,b2 as vt,dw as yt,dx as wt,cp as Le,cN as Ot,dy as kn,dz as $e}from"./index-BjcZVe7n.js";import{S as B,F as Cn,d as Sn,o as ke,r as Nn,f as _n,a as In}from"./filter-bar-CQ_oE7a9.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as An,M as oe,a as En,c as Tn,f as Fn,b as Rn,s as wn}from"./manage-gear-C-0BAMbC.js";import{u as On}from"./runs-BntGAKQG.js";import{S as Mn}from"./source-record-panels-m8gECt82.js";import{u as Pn}from"./clients-Cmp0LmOp.js";import{u as Ln}from"./client-activity-scopes-BD2HBo-_.js";import{g as $n}from"./client-rows-x_CxeWkP.js";import{a as Dn,E as Bn}from"./events-feed-CGzA1w3R.js";import{L as Kn,u as Gn}from"./renderer-CHPS-1vD.js";import{E as Un}from"./agent-loading-shells-_18OREnx.js";import{M as Vn}from"./member-scope-gate-BQiRAqtx.js";const Ue=b.createContext(null);function Qn({organizationId:t,isWorkspaceLoading:s,children:o}){const{data:n=[],isLoading:a}=fs(t);return e.jsx(Ue.Provider,{value:{groups:n,isLoading:!!s||a},children:o})}function zn(){const t=b.useContext(Ue);if(!t)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return t}function Wn(){return b.useContext(Ue)}function Mt(t){const{parse:s,serialize:o,filterKeys:n,clearClassifications:a=!0,replace:i=!0,merge:m}=t,u=V(),d=ie(),r=b.useMemo(()=>{const g=new URLSearchParams;for(const[l,h]of Object.entries(d.search||{}))h!=null&&g.set(l,typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h):String(h));return s(g)},[d.search,s]),c=b.useCallback((g,l)=>{const h=m?m(r,g):{...r,...g},y=o(h),C={};for(const[S,x]of Object.entries(d.search||{}))x!=null&&(C[S]=x);for(const S of n)delete C[S];if(a)for(const S of Object.keys(C))S.startsWith("clf_")&&delete C[S];for(const[S,x]of Object.entries(y))x!==void 0&&(C[S]=x);u({to:d.pathname,search:C,replace:l?.replace??i})},[r,o,n,a,m,u,d,i]),f=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(d.search||{}))h!=null&&(n.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));u({to:d.pathname,search:g,replace:i})},[u,d.pathname,d.search,n,a,i]);return{filters:r,updateFilters:c,clearFilters:f}}function Hn(t){const{slug:s}=ps();return hs({queryKey:["schedules",s,t],queryFn:async()=>((await vs("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(n=>n.action_args?.agent_id===t),enabled:!!s&&!!t,staleTime:3e4})}function ye({id:t,label:s,value:o,sourceLink:n,details:a,onRemove:i}){return{id:t,label:s,op:"is",value:o,onRemove:i,editor:n||a?{kind:"custom",className:"w-80",render:()=>e.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[n?e.jsxs(Ge,{to:n.to,params:n.params,search:n.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[e.jsx("span",{className:"truncate",children:o}),e.jsx(ys,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):e.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function Yn({ownerSlug:t,clientIds:s,linkedUser:o,linkedUserEntitySlug:n}){const a=t&&n?gs(t,[{entity_type:"$member",slug:n}]):null;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:s.length===1?"Client ID":"Client IDs"}),s.map(i=>e.jsx("code",{className:"break-all text-foreground",children:i},i))]}),o?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?e.jsx(Ge,{to:a,className:"font-medium text-foreground hover:underline",children:o}):e.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ge(t,s,o){const n=new Set;for(const[a,i]of Object.entries(t.feeds_schema??{})){if(o&&!o.has(a))continue;const m=ee(ee(i)?.eventKinds);if(m)for(const[u,d]of Object.entries(m)){if(!s){n.add(u);continue}const r=ee(d)?.attributions;Array.isArray(r)&&r.some(c=>{const f=ee(ee(c)?.target);return typeof f?.entityType=="string"&&s.has(f.entityType)})&&n.add(u)}}return n}function qn({connectors:t,entityTypes:s,selectedPlatforms:o=[],selectedFeeds:n=[],selectedEntityTypes:a=[]}){const i=new Set,m=new Set(o),u=new Set(a),d=new Map;for(const r of n){const c=d.get(r.connectorKey)??new Set;c.add(r.feedKey),d.set(r.connectorKey,c)}if(d.size>0)for(const r of t){const c=d.get(r.key);if(c)for(const f of ge(r,void 0,c))i.add(f)}else if(m.size>0){for(const r of t)if(m.has(r.key))for(const c of ge(r))i.add(c)}else if(u.size>0){for(const r of s)if(u.has(r.slug))for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r,u))i.add(c)}else{for(const r of s)for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r))i.add(c)}return[...i].sort((r,c)=>r.localeCompare(c))}const De=["produced","analyzed"],Se=t=>t==="produced"?"Produced by":"Analyzed by";function Zn({enabled:t,...s}){const o=Xn(s,t);if(!t)return{fields:[],chips:[]};const n=Jn(s);return{fields:[o.field,n.field],chips:[...o.chips,...n.chips]}}function Xn({ownerSlug:t,filters:s,onFiltersChange:o},n){const a=An(t,n),i=a.data??[],m=c=>c==="produced"?s.producedByAutomationId:s.automationId,u=c=>i.find(f=>Number(f.automation_id)===c)?.name??`#${c}`,d=De.flatMap(c=>{const f=m(c);return f==null?[]:[{id:`automation-${c}`,field:"automation",label:Se(c),value:u(f),onRemove:()=>o(c==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),r={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:c=>e.jsxs(e.Fragment,{children:[De.map(f=>{const g=m(f),l=i.map(y=>({id:Number(y.automation_id),label:`${y.name}${y.status==="archived"?" (archived)":""}`}));g!=null&&!l.some(y=>y.id===g)&&l.unshift({id:g,label:`Automation #${g} (selected)`});const h=y=>{o(f==="produced"?{producedByAutomationId:y}:{automationId:y}),c()};return e.jsx(It,{heading:Se(f),children:l.map(y=>e.jsxs(A,{"aria-label":y.label,value:`${f} ${y.label} ${y.id}`,onSelect:()=>h(y.id),className:"group",children:[e.jsx(B,{selected:g===y.id}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),e.jsx(oe,{...En(t,String(y.id)),label:y.label})]},y.id))},f)}),a.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void a.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:d,field:{key:"automation",label:"Automation",group:"Scope",icon:e.jsx(xs,{className:"h-4 w-4"}),editor:r}}}function Jn(t){const{filters:s,onFiltersChange:o}=t,n=[];s.runIds?.length&&n.push({id:"run-produced",field:"run",label:"Produced by run",value:s.runIds.map(i=>`#${i}`).join(", "),onRemove:()=>o({runIds:null})}),s.runId!=null&&n.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${s.runId}`,onRemove:()=>o({runId:null})});const a={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(i,m)=>De.map(u=>e.jsx(eo,{...t,mode:u,query:m,close:i},u))};return{chips:n,field:{key:"run",label:"Run",group:"Scope",icon:e.jsx(bs,{className:"h-4 w-4"}),editor:a}}}function eo({ownerSlug:t,filters:s,onFiltersChange:o,mode:n,query:a,close:i}){const m=n==="produced"?s.producedByAutomationId:s.automationId,u=On({workspace:!0},{automationIds:m==null?void 0:[m],runTypes:n==="analyzed"?["automation"]:void 0,connectionIds:n==="produced"?s.connectionIds??void 0:void 0,feedIds:n==="produced"?s.feedIds??void 0:void 0},t),d=n==="produced"?s.runIds??[]:s.runId==null?[]:[s.runId],r=u.data?.pages.flatMap(l=>l.runs)??[],c=[...new Map(r.map(l=>[l.id,{id:l.id,label:`Run #${l.id} · ${l.feed_display_name??l.operation_key??l.run_type} · ${l.status}`}])).values()];for(const l of d)c.some(h=>h.id===l)||c.unshift({id:l,label:`Run #${l} (selected)`});const f=l=>{if(n==="produced"){const h=d.includes(l)?d.filter(y=>y!==l):[...d,l];o({runIds:h.length?h:null})}else o({runId:l}),i()},g=/^\d+$/.test(a.trim())?Number(a.trim()):0;return e.jsxs(It,{heading:Se(n),children:[c.map(l=>e.jsxs(A,{value:`${n} ${l.label}`,onSelect:()=>f(l.id),children:[e.jsx(B,{selected:d.includes(l.id)}),e.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!c.some(l=>l.id===g)?e.jsxs(A,{value:`${n} ${g}`,onSelect:()=>f(g),children:[Se(n)," run #",g]}):null,u.isLoading?e.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!c.length?e.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?e.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ve="Scope",Me="Source",z="h-4 w-4";function ce(){return ie().search??{}}function Pt(t){const{pathname:s}=ie(),o=s.startsWith(`/${t}/events/`),n=Cs(s,o?1:0),a=!!(n&&!o&&!Ss(n.split("/")[0]));return{pathname:s,embedded:a,recordPath:a?Ns(n)?.entityPath:o?n:void 0}}function Lt(t){const s=ce(),{recordPath:o,pathname:n,embedded:a}=Pt(t);return i=>{const m=ae(t,s,i,o);return a?{to:n,search:m.search}:m}}const xt=t=>new Set((t??"").split(",").map(s=>s.trim()).filter(Boolean));function to({ownerSlug:t,sourceRead:s=!1,filters:o,onFiltersChange:n}){const a=ce(),{recordPath:i,embedded:m}=Pt(t),u=i?i.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,r=(u?ft(u):void 0)??(d?ft(d):void 0),c=js(a),f=ks(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=so(t,r,!m),h=no(t,r,i,m),y=oo(t,c,!s),C=Zn({ownerSlug:t,filters:o,onFiltersChange:n,enabled:!s}),S=ao(t,f,g);return[l,h,y,C,S].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function so(t,s,o){const n=V(),a=ce(),{visible:i}=_s(t);if(!o)return{fields:[],chips:[]};const m=i.find(d=>d.slug===s),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>e.jsxs(e.Fragment,{children:[i.map(r=>e.jsxs(A,{onSelect:()=>{n(ae(t,a,{entity:void 0,create:void 0,type:r.slug})),d()},className:"group gap-2",children:[e.jsx(B,{selected:r.slug===s}),e.jsx(Ls,{icon:r.icon,className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),typeof r.entity_count=="number"?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.entity_count}):null,e.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:r.slug},label:r.name})]},r.id)),e.jsxs(A,{onSelect:()=>{n($s(t)),d()},className:"text-muted-foreground",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ve,icon:e.jsx(Is,{className:z}),editor:u}],chips:s?[{id:"type",label:"Entity type",op:"is",value:m?.name??s,onRemove:()=>void n(ae(t,a,{type:void 0}))}]:[]}}function no(t,s,o,n){const a=V(),i=ce(),[m,u]=b.useState(""),[d,r]=b.useState(0),c=At(m,250),f={slug:t},{data:g,isLoading:l,isError:h,refetch:y}=As(s??"",f,{search:c,offset:d,limit:30,enabled:!n&&!!s}),{data:C}=Es(o?`/${t}/${o}`:"",f),S=o?C?.entity:void 0,x=S?.name??(o?o.split("/").at(-1):void 0);if(n)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!s)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:l?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:O=>{u(O),r(0)},items:O=>e.jsxs(e.Fragment,{children:[h?e.jsx(A,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>e.jsxs(A,{value:I.slug,onSelect:()=>{const M=Ds([...I.parent_slug&&I.parent_entity_type?[{entity_type:I.parent_entity_type,slug:I.parent_slug}]:[],{entity_type:I.entity_type,slug:I.slug}]);a(ae(t,i,{type:s},M)),O()},children:[e.jsx(B,{selected:S?.slug===I.slug}),I.name]},I.slug)),d>0&&e.jsx(A,{onSelect:()=>r(Math.max(0,d-30)),children:"Previous entities"}),g?.metadata.has_more&&e.jsx(A,{disabled:l,onSelect:()=>r(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ve,icon:e.jsx(Ts,{className:z}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(t,i,{type:s}))}]:[]}}function oo(t,s,o){const n=V(),a=Lt(t),{data:i=[]}=Fs(),m=b.useMemo(()=>[...i].sort((r,c)=>r.name.localeCompare(c.name)),[i]);if(!o)return{fields:[],chips:[]};const u=m.find(r=>r.agentId===s),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:r=>m.map(c=>e.jsxs(A,{onSelect:()=>{n(a({agent:c.agentId,schedule:void 0})),r()},className:"gap-2",children:[e.jsx(B,{selected:c.agentId===s}),e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:c.name.trim().charAt(0).toUpperCase()||"?"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.name})]},c.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ve,icon:e.jsx(Rs,{className:z}),editor:d}],chips:s?[{id:"agent",label:"Agent",op:"is",value:u?.name??s,onRemove:()=>void n(a({agent:void 0,schedule:void 0}))}]:[]}}function ao(t,s,o){const n=V(),a=Lt(t),{groups:i}=zn(),m=ce(),u=Ce({platforms:String(m.platforms??m.platform??"")}).platforms??[],d=b.useMemo(()=>xt(s),[s]),r=b.useMemo(()=>xt(o),[o]),c=u.length===1?u[0]:ws(i,d),f=i.find(_=>_.connector_key===c),g=d.size===1?Number([...d][0]):void 0,l=Os(g),{org:h}=Et(),y=Tt(h?.id,{feedIds:[...r].map(Number),enabled:g==null&&r.size>0}),C=g==null?y:l,S=C.data??[],x={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},F={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:_=>e.jsxs(e.Fragment,{children:[i.map(k=>{const E=k.connector_name??k.connector_key;return e.jsxs(A,{disabled:k.connections.length===0,onSelect:()=>{n(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[e.jsx(B,{selected:k.connector_key===f?.connector_key}),e.jsx(Ks,{plain:!0,name:E,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:E}),k.connection_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,e.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:k.connector_key},label:E})]},k.connector_key)}),e.jsx(A,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:e.jsxs(Ge,{to:"/$owner/connectors/create",params:{owner:t},className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},O=[{key:"connector",label:"Connector",group:Me,icon:e.jsx(Bs,{className:z}),editor:F}],I=[],M=f?.connector_name??f?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(M&&I.push({id:"connector",label:"Connector",op:"is",value:M,onRemove:()=>void n(a(x))}),f){O.push({key:"connection",label:"Connection",group:Me,icon:e.jsx(Ms,{className:z}),editor:Q(f)});const _=d.size===1?f.connections.find(k=>d.has(String(k.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:gt({display_name:_.display_name,connector_name:f.connector_name,connector_key:f.connector_key}),onRemove:()=>void n(a({...x,platforms:f.connector_key}))})}if((g||o)&&O.push({key:"feed",label:"Feed",group:Me,icon:e.jsx(Ps,{className:z}),editor:H()}),r.size>0){const _=r.size===1?S.find(k=>r.has(String(k.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?xe(_):`#${o}`,onRemove:()=>void n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:O,chips:I};function Q(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:k=>_.connections.map(E=>{const L=gt({display_name:E.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return e.jsxs(A,{onSelect:()=>{n(a({connection_ids:String(E.id),feed_ids:void 0})),k()},className:"group gap-2",children:[e.jsx(B,{selected:d.has(String(E.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:L}),E.feed_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:E.feed_count}):null,e.jsx(oe,{...Tn(t,{id:E.id,connector_key:_.connector_key}),label:L})]},E.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>e.jsxs(A,{"aria-label":xe(k),onSelect:()=>{n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[e.jsx(B,{selected:r.has(String(k.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),e.jsx(oe,{...Fn(t,k),label:xe(k)})]},k.id))}}}function xe(t){return t.display_name?.trim()||t.feed_key}const io=["notification"],co=["note","summary","decision","observation","fact","change","preference","identity"],ro=[...io,...co],bt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],$t={value:"notifications",label:"Notifications"};function lo({value:t,onChange:s,withNotifications:o=!1}){const n=o?[$t,...bt]:bt,a=n.find(i=>i.value===t)?.label??"Newest first";return e.jsxs(Gs,{value:t,onValueChange:s,children:[e.jsxs(Us,{"aria-label":"Sort",className:"h-9 w-auto shrink-0 gap-2 bg-background px-2.5",children:[e.jsx(Vs,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Qs,{children:a})]}),e.jsx(zs,{align:"end",className:"min-w-40",children:n.map(i=>e.jsx(Ws,{value:i.value,children:i.label},i.value))})]})}const jt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],kt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],be=0,je=100,te="Event",se="h-4 w-4";function ne(t){const s=t.replace(/[_-]+/g," ").trim();return s.length>0?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:t}function uo(t,s,o){const n=t.semanticTypes??[],a=o.length>0?o:ro,i=[...new Set([...a,...n])].sort((f,g)=>ne(f).localeCompare(ne(g))).map(f=>({value:f,label:ne(f)})),m=t.engagementRange??[be,je],u=t.reviewStatus,d=t.interactionStatus,r=[{key:"date",label:"Date",group:te,icon:e.jsx(Js,{className:se}),editor:Sn({value:t.dateRange??void 0,onApply:f=>s({dateRange:f})})},{key:"kind",label:"Event kind",group:te,icon:e.jsx(en,{className:se}),editor:ke({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:i,selected:n,multiple:!0,onSelect:f=>{const g=n.includes(f)?n.filter(l=>l!==f):[...n,f];s({semanticTypes:g.length>0?g:void 0})}})},{key:"approval",label:"Approval",group:te,icon:e.jsx(tn,{className:se}),editor:ke({searchPlaceholder:"Search statuses...",options:[...kt],selected:d?[d]:[],onSelect:f=>s({interactionStatus:f})})},{key:"review",label:"Reviewed by",group:te,icon:e.jsx(sn,{className:se}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:u&&u!=="all"?[u]:[],onSelect:f=>s({reviewStatus:f})})},{key:"score",label:"Engagement score",group:te,icon:e.jsx(nn,{className:se}),editor:Nn({value:m,min:be,max:je,onApply:f=>s({engagementRange:f})})}],c=[];return t.dateRange&&c.push({id:"date",label:"Date",op:"is",value:_n(t.dateRange),onRemove:()=>s({dateRange:null})}),n.length&&c.push({id:"kind",label:"Event kind",op:n.length>1?"is any of":"is",value:n.length<=2?n.map(ne).join(", "):`${n.length} kinds`,title:n.map(ne).join(", "),onRemove:()=>s({semanticTypes:void 0})}),d&&c.push({id:"approval",label:"Approval",op:"is",value:kt.find(f=>f.value===d)?.label??d,onRemove:()=>s({interactionStatus:null})}),u&&u!=="all"&&c.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(f=>f.value===u)?.label??u,onRemove:()=>s({reviewStatus:void 0})}),(m[0]!==be||m[1]!==je)&&c.push({id:"score",label:"Engagement score",value:In(m,be,je),onRemove:()=>s({engagementRange:void 0})}),{fields:r,chips:c}}function Dt({filters:t,onFiltersChange:s,eventKinds:o=[],searchQuery:n,onSearchChange:a,scope:i,extraFields:m=[],drillChips:u=[],total:d,isListLoading:r=!1,isTotalLoading:c=!1,hasCursorInUrl:f=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=n.trim().length>0,F=h?{fields:[],chips:[]}:uo(t,s,o),O=[...i?.fields??[],...F.fields,...m],I=[...i?.chips??[],...u,...F.chips],M=I.length>0||x,Q=`${t.sortBy??"date"}-${t.sortOrder??"desc"}`,H=r||c?e.jsx(Hs,{className:"h-4 w-20"}):d==null?null:M?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return e.jsxs("div",{className:"w-full space-y-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!h&&e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx(Ys,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(qs,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:n,onChange:_=>a(_.target.value),className:Ne("bg-background pl-9",x&&"pr-9")}),x&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-0.5 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:e.jsx(Zs,{className:"h-3.5 w-3.5"})})]}),!h&&e.jsx(lo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===$t.value){l?.();return}const[k,E]=_.split("-");s({sortBy:k,sortOrder:E})}})]}),e.jsx(Cn,{label:"Event filters",fields:O,chips:I,meta:H,actions:C,trailing:e.jsxs(e.Fragment,{children:[y,!r&&f&&g&&e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",onClick:g,children:[e.jsx(Xs,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),onClearAll:S,hasClearableState:x})]})}function Bt({ownerSlug:t,...s}){const o=to({ownerSlug:t,sourceRead:s.sourceRead,filters:s.filters,onFiltersChange:s.onFiltersChange});return e.jsx(Dt,{...s,scope:o})}const Be=3600*1e3,Ct=24*Be;function St(t){const s=t instanceof Date?t:new Date(String(t));return Number.isNaN(s.getTime())?null:s}function Nt(t){return t.toISOString().split("T")[0]}function Ke(t){return t.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(t){const o=t[t.length-1].date.getTime()-t[0].date.getTime()>180*Ct,n=new Map;for(const a of t){const i=new Date(a.date);o&&i.setUTCDate(i.getUTCDate()-i.getUTCDay()),n.set(i.getTime(),(n.get(i.getTime())??0)+a.count)}return[...n.entries()].sort(([a],[i])=>a-i).map(([a,i])=>{const m=new Date(a);return{start:m,end:new Date(a+(o?7:1)*Ct),count:i,label:`${m.getUTCMonth()+1}/${m.getUTCDate()}`,tooltip:o?`Week of ${Ke(m)}`:Ke(m)}})}function fo(t){const s=m=>{const u=new Date(m);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const m of t)o.set(s(m),(o.get(s(m))??0)+1);const n=Math.min(...o.keys()),a=Math.max(...o.keys()),i=[];for(let m=n;m<=a;m+=Be){const u=new Date(m);i.push({start:u,end:new Date(m+Be),count:o.get(m)??0,label:pt(u,"HH:mm"),tooltip:pt(u,"MMM d, HH:mm")})}return i}function po({entityId:t,organizationId:s,ownerSlug:o,eventTimes:n,selectedRange:a,onSelectRange:i}){const{data:m,isLoading:u,error:d}=on(s,{entityId:t},{slug:o}),r=b.useMemo(()=>(m??[]).map(h=>{const y=St(h.date);return y?{date:y,count:h.count}:null}).filter(h=>h!==null).sort((h,y)=>h.date.getTime()-y.date.getTime()),[m]),c=b.useMemo(()=>{if(r.length===0)return[];if(r.length>1)return mo(r);const[h]=r,y=Nt(h.date),C=(n??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?fo(C):[]},[r,n]),f=b.useCallback(h=>{const y=c[h.dataIndex];y&&i&&i(y.start,y.end)},[c,i]),g=b.useCallback(h=>{if(i&&h.startValue!==void 0&&h.endValue!==void 0){const y=new Date(h.startValue),C=new Date(h.endValue);i(y,C)}},[i]),l=b.useMemo(()=>{if(c.length<2)return null;let h;if(a){const[y,C]=a,S=c.filter(x=>x.start<C&&x.end>y);S.length>0&&(h=[[{xAxis:S[0].label},{xAxis:S[S.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:y=>{const C=y[0];return`${c[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:c.map(y=>y.label)},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new Kn(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:c.map(y=>y.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:h?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:h}:void 0}]}},[c,a]);if(u||d)return e.jsx("div",{className:Ne(Rt,"p-4"),children:e.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?e.jsx(Un,{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(r.length===0)return null;if(!l){const[h]=r;return e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.count===1?"1 event":`All ${h.count} events`," on"," ",Ke(h.date),"."]})}return e.jsx(ho,{option:l,onClick:f,onDataZoom:g})}function ho({option:t,onClick:s,onDataZoom:o}){const{chartRef:n,setOption:a}=Gn({onClick:s,onDataZoom:o});return b.useEffect(()=>{a(t,!0)},[t,a]),e.jsx("div",{"data-testid":"events-timeline",className:Ne(Rt,"p-4 relative"),children:e.jsx("div",{ref:n,className:"h-48 w-full"})})}const _t="change";function vo({kinds:t,onFiltersChange:s}){const o=!t?.length,n=t?.length===1&&t[0]===_t,a=i=>Ne("h-7 px-2.5 text-xs",i?"bg-muted text-foreground":"text-muted-foreground");return e.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>s({semanticTypes:void 0}),children:"All"}),e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(n),"aria-pressed":n,onClick:()=>s({semanticTypes:[_t]}),children:"Changes"})]})}function yo({organizationId:t,ownerSlug:s,entityId:o,hideSourceFilter:n=!1,scopedEntityTypes:a,pinned:i,onShowNotifications:m,emptyState:u,changesShortcut:d=!1}){const{isAuthenticated:r,isReady:c}=an(),{isMember:f,isLoading:g}=Et(),l=c&&r&&f,h=c&&(!r||!g&&!f),y=V(),C=ie(),S=cn(),{filters:x,updateFilters:F,clearFilters:O}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),[I,M]=b.useState(x.searchQuery||""),[Q,H]=b.useState(Pe(x)||n&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,E=At(k,1e3),L=b.useRef(!1);b.useEffect(()=>S.history.subscribe(({location:p,action:v})=>{const N=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&L.current&&(N===(x.searchQuery??"")||N===(k??""))||(L.current=!1,M(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>ht({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),R=F;b.useEffect(()=>{L.current&&(x.searchQuery||void 0)!==E&&F({searchQuery:E})},[E,F,x.searchQuery]);const Qe=()=>{L.current=!1,M(""),n&&s?y({...$e(s,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${s}/events/`)?{to:C.pathname}:{}}):O()},re=Pe(ht(x)),_e=o===void 0,{data:Kt=[]}=rn(c&&l?t:null),{data:Gt=[]}=ln(h?s:null),ze=l?Kt:Gt,{data:We=[]}=dn(l&&t?{organizationId:t}:void 0),le=Wn(),de=j.connectionIds,Ie=(de?.length??0)>0,{data:He=[]}=un(c&&l?t??"":"",{connectionIds:de??void 0,enabled:!le&&c&&l&&Ie}),Ye=j.feedIds,Ae=(Ye?.length??0)>0,{data:qe=[]}=Tt(c&&l?t:null,{feedIds:Ye??void 0,enabled:c&&l&&Ae}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Ee=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Te=b.useMemo(()=>qe.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[qe]),Ut=b.useMemo(()=>Ie&&Ee.length===0||Ae&&Te.length===0?[]:qn({connectors:ze,entityTypes:We,selectedPlatforms:Ee,selectedFeeds:Te,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Ie,Ae,Ee,Te,We]),w=j.clientIds,ue=(w?.length??0)>0,{data:Xe=[]}=Pn(null,{enabled:c&&l&&ue}),me=b.useMemo(()=>{if(!w)return[];const p=new Set(w);return $n(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[w,Xe]),Je=b.useMemo(()=>{if(!ue||!w)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):w.length>1?`${w.length} client registrations`:"Client registration"},[me,w,ue]),fe=me.length===1?me[0]:null,Vt=s&&fe?Rn(s,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=Ln({enabled:c&&l&&ue&&!!pe,clientIds:w??[],limit:100}),tt=b.useMemo(()=>{if(!pe)return null;const p=et.find(N=>N.activityId===pe);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[pe,et]),Y=j.agentId,q=j.schedule,{data:st=[]}=Hn(Y??void 0),nt=b.useMemo(()=>!q||!Y?null:st.find(v=>v.id===q)?.description?.trim()||"Scheduled task",[Y,q,st]),{data:Qt}=mn(c&&l?t:null,o),{data:zt}=fn(h&&!_e?s:null,o),ot=l?Qt:zt,Fe=b.useMemo(()=>{const p=new Map;for(const v of ot||[]){const N=v.automation_name??"__global__";p.has(N)||p.set(N,{automationName:v.automation_name??null,classifiers:[]});const T=p.get(N),$=v.attribute_values||{},P=Object.keys($);let ve=null;const Z={};for(const[X,U]of Object.entries($))if(U.parent)for(const[Oe,J]of Object.entries(U.parent))ve=Oe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=T.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...P]);D.values=[...X];for(const[U,Oe]of Object.entries(Z)){D.valuesByParentValue[U]||(D.valuesByParentValue[U]=[]);const J=new Set([...D.valuesByParentValue[U],...Oe]);D.valuesByParentValue[U]=[...J]}ve&&(D.parentSlug=ve)}else T.classifiers.push({slug:v.slug,name:v.name,values:P,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,T)=>N.parentSlug===null&&T.parentSlug!==null?-1:N.parentSlug!==null&&T.parentSlug===null?1:0);return[...p.values()]},[ot]),Wt=pn(c&&l?t:null,o,j,s),Ht=hn(h?s:null,o,j),Yt=h?Ht:Wt,{data:K,isLoading:qt,error:Zt}=Yt,Xt=b.useMemo(()=>K?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[K]),at=K?.pages[0],it=(at?.content.length??0)>0,Jt=vn(c&&l?t:null,o,j,s),es=yn(h?s:null,o,j),Re=h?es:Jt,ts=Re.data?.total??void 0,ss=Re.data?.classification_stats,ns=Re.isLoading,os=!!(j.beforeOccurredAt||j.afterOccurredAt),ct=gn(j),rt=K?.pages[K.pages.length-1],G=rt?.content[rt.content.length-1];b.useEffect(()=>{!ct||!G||K?.pages.length===1||x.beforeOccurredAt===G.occurred_at&&x.beforeId===G.id||F({beforeOccurredAt:G.occurred_at,beforeId:G.id},{replace:!0})},[G?.id,ct,F,K?.pages.length,G,x.beforeOccurredAt,x.beforeId]);const as=b.useCallback(()=>{R({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[R]),is=(p,v)=>{R({dateRange:[p,v]})},lt=(p,v)=>{const N={...j.classificationFilters||{}};if(v.length>0)N[p]=v;else{delete N[p];for(const T of Fe)for(const $ of T.classifiers)$.parentSlug===p&&delete N[$.slug]}R({classificationFilters:N})},cs=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(T=>T!==v):[...N,v])},rs=p=>lt(p,[]);if(Zt)return e.jsx(xn,{label:"knowledge"});const we=!c||r&&g||l&&!t||qt,he={fields:[],chips:[]};for(const p of Fe)for(const v of p.classifiers){const N=j.classificationFilters?.[v.slug]??[],T=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,$=T?[...new Set(T.flatMap(P=>v.valuesByParentValue[P]??[]))]:v.values;$.length>0&&he.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:e.jsx(bn,{className:"h-4 w-4"}),editor:ke({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:$.map(P=>({value:P,label:P,count:ss?.[v.slug]?.[P]})),selected:N,multiple:!0,onSelect:P=>cs(v.slug,P)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=Fe.flatMap(T=>T.classifiers).find(T=>T.slug===p);he.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:N?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>rs(p)})}const ls=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>R({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>R({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:Vt,details:w&&w.length>0?e.jsx(Yn,{ownerSlug:s,clientIds:w,linkedUser:fe?.linkedUser,linkedUserEntitySlug:fe?.linkedUserEntitySlug}):void 0,onRemove:()=>R({clientIds:void 0})}):null,nt?ye({id:"schedule",label:"Schedule",value:nt,sourceLink:s&&Y&&q?wn(s,Y,q):void 0,onRemove:()=>R({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>R({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>R({resourceKind:void 0,resourceId:void 0})}]:[],...he.chips].filter(p=>p!=null),ds=!!(l&&o&&t),dt=i&&!re?i:void 0,ut={filterActions:d?e.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:R}):_e&&l?e.jsx("div",{className:"flex items-center gap-1",children:[["config","Configuration"],["deployment","Applies"]].map(([p,v])=>e.jsx(W,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>R({eventCategory:x.eventCategory===p?void 0:p,semanticTypes:x.eventCategory===p?void 0:["change"],resourceKind:void 0,resourceId:void 0}),children:v},p))}):void 0,filterTrailing:ds?e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":Q,onClick:()=>H(p=>!p),children:[e.jsx(kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Qe,onShowNotifications:m,filters:j,onFiltersChange:R,eventKinds:Ut,searchQuery:I,onSearchChange:p=>{L.current=!0,M(p)},extraFields:he.fields,drillChips:ls,total:ts,isListLoading:we,isTotalLoading:ns,hasCursorInUrl:os&&it,onGoToLatest:as},us=!we&&!!at&&!it&&!re,ms=r?l?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",mt=!!(l&&s);return e.jsx(jn,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:n?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:n&&s?e.jsx(Bt,{...ut,ownerSlug:s}):e.jsx(Dt,{...ut})}),Q&&l&&o&&t&&e.jsx(po,{entityId:o,organizationId:t,ownerSlug:s||"",eventTimes:Xt,selectedRange:j.dateRange||void 0,onSelectRange:is}),dt?.rows,we?e.jsx(Dn,{}):us?u??e.jsx(vt,{icon:yt,title:"No activity yet",description:ms,actionLabel:mt?"Add a connector":void 0,onAction:mt&&s?()=>void y({to:"/$owner/connectors/create",params:{owner:s}}):void 0}):e.jsx(Bn,{onFiltersChange:R,organizationId:t,ownerSlug:s,entityId:o,filters:j,showEntityLinks:_e,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:e.jsx(vt,{icon:yt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:re?"Clear filters":void 0,onAction:re?Qe:void 0})})]})})}function go({record:t,ownerSlug:s}){const o=ie(),n=V(),{filters:a,updateFilters:i}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),m=Pe({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{n({...$e(s,o.search??{}),...o.pathname.startsWith(`/${s}/events/`)?{}:{to:o.pathname}})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Bt,{ownerSlug:s,sourceRead:!0,filters:a,onFiltersChange:i,searchQuery:a.searchQuery??"",onSearchChange:d=>i({searchQuery:d}),onClearFilters:u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),m?e.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[e.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),e.jsx(W,{variant:"outline",size:"sm",onClick:()=>{const d=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),r={...$e(s,o.search??{}).search,...d};n({to:o.pathname,search:r})},children:"Clear unsupported filters"})]}):e.jsx(Mn,{record:t,orgContext:{slug:s},filters:a})]})}function wo({entity:t,organizationId:s,ownerSlug:o}){const n=t.is_derived?e.jsx(go,{ownerSlug:o,record:{type:t.entity_type,key:t.slug}}):e.jsx(yo,{organizationId:s,ownerSlug:o,entityId:typeof t.id=="number"?t.id:void 0,hideSourceFilter:!0,changesShortcut:!0});return e.jsx(Qn,{organizationId:s,children:t.entity_type==="$member"?e.jsx(Vn,{children:n}):n})}export{yo as E,Qn as M,$t as N,wo as R,lo as S};
|
|
2
|
-
//# sourceMappingURL=record-activity-CTLwq8s1.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as o,j as t,B as n,L as c,cG as u,gy as h,e2 as y}from"./index-BjcZVe7n.js";function f({owner:i,filters:a,name:e}){const r=o();return t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5",children:t.jsxs(c,{title:`View activity for ${e}`,to:"/$owner",params:{owner:i},search:y(a),onClick:s=>{!r||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),r.open({href:h(i,a),title:"Runs history"}))},children:[t.jsx(u,{className:"h-3.5 w-3.5"}),"View activity"]})})}export{f as R};
|
|
2
|
-
//# sourceMappingURL=run-activity-link-Dh1YyCfk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as k,eI as I,j as d,L as u,ed as h}from"./index-BjcZVe7n.js";import{u as j}from"./use-automations-D9hKpufo.js";import{u as b}from"./clients-Cmp0LmOp.js";function C(n,e,o){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":e==="agent"?"an agent":o?`Automation ${o}`:"an Automation"}function B({ownerSlug:n,initiator:e,clientName:o,fallback:_}){const t=e?.client_id??o,{allOrgs:m,isAuthenticated:p}=k(),r=p&&m?.some(s=>s.slug===n),c=b(void 0,{ownerSlug:n,enabled:!!(t&&r)}).data?.find(s=>s.id===t)?.title,l=r?m.find(s=>s.slug===n)?.id:void 0,f=e?.kind==="automation"&&e.automation_id?String(e.automation_id):void 0,v=j(f?l:void 0,void 0,{includeDetails:!1}).data?.find(s=>s.automation_id===f)?.name,{members:x}=I(e?.kind==="user"&&e.user_id?l:void 0),$=x.find(s=>s.userId===e?.user_id)?.user.name,a=e&&e.kind!=="user"?v??C(e,void 0,e.automation_id===void 0?void 0:String(e.automation_id)):$??_,g="font-medium text-foreground",i=`${g} underline-offset-4 hover:underline`;return e?.kind==="automation"&&e.automation_id?d.jsx(u,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(e.automation_id)},search:{view:"definition",run_id:void 0},className:i,children:a}):e?.kind==="agent_session"&&e.agent_id?d.jsx(u,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:String(e.agent_id)},className:i,children:a}):t?d.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:n,clientId:t},className:`${i} inline-flex items-center gap-1 align-middle`,children:[d.jsx(h,{name:c??o??t}),c??a]}):d.jsx("span",{className:g,children:a})}export{B as R,C as p};
|
|
2
|
-
//# sourceMappingURL=run-initiator-CCxNv0rK.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{at as P,aH as w,cD as B,j as o,ct as k,cU as g,d$ as E,i as M,e0 as C,cT as _,cS as U,cz as z,c as H,w as O,e1 as W,e2 as D,r as x,B as R,ab as G}from"./index-BjcZVe7n.js";import{u as q}from"./use-scroll-sentinel-BWCrmNIB.js";import{u as J}from"./runs-BntGAKQG.js";import{o as K,F as Q,S as V}from"./filter-bar-CQ_oE7a9.js";import{M as p,c as X,u as Y,a as Z}from"./manage-gear-C-0BAMbC.js";import{R as ee,a as ne}from"./runs-table-CYS1jDdL.js";function te(t){const{org:l}=P(t?.ownerSlug),h=w(t?l?.id:null),u=B(t?l?.id:null);if(!t)return{fields:[],chips:[]};const s=(h.data??[]).map(n=>({id:n.id,label:n.display_name||`Connection #${n.id}`,connectorKey:n.connector_key}));for(const n of t.connectionIds)s.some(a=>a.id===n)||s.unshift({id:n,label:`Connection #${n}`,connectorKey:t.connectorKey});const r=(u.data??[]).map(n=>({key:n.key,label:n.name}));t.connectorKey&&!r.some(n=>n.key===t.connectorKey)&&r.unshift({key:t.connectorKey,label:t.connectorKey});const i=n=>{const a=n==="connection"?h:u,d=K({searchPlaceholder:`Search ${n}s...`,emptyText:a.isLoading?"Loading...":`No ${n}s`,multiple:n==="connection",selected:n==="connection"?t.connectionIds.map(String):[t.connectorKey],options:n==="connection"?s.map(e=>({value:String(e.id),label:e.label,action:e.connectorKey?o.jsx(p,{...X(t.ownerSlug,{id:e.id,connector_key:e.connectorKey}),label:e.label}):null})):r.map(e=>({value:e.key,label:e.label,action:o.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:t.ownerSlug,connectorKey:e.key},label:e.label})})),onSelect:e=>n==="connection"?t.onChange({connectionIds:t.connectionIds.includes(Number(e))?t.connectionIds.filter(c=>c!==Number(e)):[...t.connectionIds,Number(e)]}):t.onChange({connectorKey:e})});return{...d,items:e=>o.jsxs(o.Fragment,{children:[d.items(e,""),a.isError?o.jsxs(g,{forceMount:!0,onSelect:()=>void a.refetch(),children:["Could not load ",n,"s. Retry"]}):null]})}};return{fields:[{key:"connection",label:"Connection",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connection")},{key:"connector",label:"Connector",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connector")}],chips:[...t.connectionIds.length?[{id:"connection",field:"connection",label:"Connection",op:"is",value:t.connectionIds.map(n=>s.find(a=>a.id===n)?.label??`#${n}`).join(", "),onRemove:()=>t.onChange({connectionIds:[]})}]:[],...t.connectorKey?[{id:"connector",field:"connector",label:"Connector",op:"is",value:r.find(n=>n.key===t.connectorKey)?.label??t.connectorKey,onRemove:()=>t.onChange({connectorKey:""})}]:[]]}}function oe({bucket:t,status:l,onBucketChange:h,onStatusChange:u,automation:s,source:r}){const i=te(r),n=Y(s?.ownerSlug??"",!!s),a=(n.data??[]).map(e=>({value:e.automation_id,label:`${e.name}${e.status==="archived"?" (archived)":""}`}));for(const e of s?.ids??[])a.some(c=>c.value===String(e))||a.unshift({value:String(e),label:`Automation #${e}`});const d=e=>a.find(c=>c.value===String(e))?.label??`#${e}`;return o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[o.jsx("div",{className:"inline-flex max-w-full flex-wrap rounded-md border bg-muted/30 p-0.5 text-sm",children:E.map(e=>o.jsx("button",{type:"button",onClick:()=>h(e.value),className:M("rounded px-3 py-1 transition-colors",t===e.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))}),o.jsx(Q,{label:"Run filters",className:"w-full min-w-0",fields:[...i.fields,...s?[{key:"automation",label:"Automation",icon:o.jsx(U,{className:"h-4 w-4"}),editor:{kind:"list",searchPlaceholder:"Search Automations...",emptyText:n.isLoading?"Loading Automations...":"No Automations",items:()=>o.jsxs(o.Fragment,{children:[o.jsx(_,{children:a.map(e=>{const c=Number(e.value);return o.jsxs(g,{value:`${e.label} ${c}`,"aria-label":e.label,className:"group",onSelect:()=>s.onChange(s.ids.includes(c)?s.ids.filter(f=>f!==c):[...s.ids,c]),children:[o.jsx(V,{selected:s.ids.includes(c)}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.label}),o.jsx(p,{...Z(s.ownerSlug,e.value),label:e.label})]},e.value)})}),n.isError?o.jsx(g,{forceMount:!0,onSelect:()=>void n.refetch(),children:"Could not load Automations. Retry"}):null]})}}]:[],{key:"status",label:"Status",icon:o.jsx(z,{className:"h-4 w-4"}),editor:K({searchPlaceholder:"Search statuses...",options:C,selected:l==="all"?[]:[l],onSelect:u})}],chips:[...i.chips,...l==="all"?[]:[{id:"status",label:"Status",op:"is",value:C.find(e=>e.value===l)?.label??l,onRemove:()=>u("all")}],...s?.ids.length?[{id:"automation",field:"automation",label:"Automation",op:"is",value:s.ids.map(d).join(", "),onRemove:()=>s.onChange([])}]:[]]})]})}function ue({ownerSlug:t}){const l=H(),{search:h}=O(),u=W(h);return o.jsx(se,{scope:{workspace:!0},ownerSlug:t,filterState:u,onFilterChange:s=>{l({search:(r=>({...r,...D(s)}))})}})}function se({scope:t,ownerSlug:l,filterState:h,onFilterChange:u}){const[s,r]=x.useState({bucket:"all",status:"all",automationIds:[],connectionIds:[],connectorKey:""}),i=h??s,{bucket:n,status:a,automationIds:d,connectionIds:e,connectorKey:c}=i,f=u??r,I=x.useMemo(()=>({runTypes:n==="all"?void 0:[n],status:a==="all"?void 0:a,...d.length?{automationIds:d}:{},...e.length?{connectionIds:e}:{}}),[n,a,d,e]),{data:y,isLoading:F,isError:b,hasNextPage:v,isFetching:j,isFetchingNextPage:$,fetchNextPage:S,refetch:A}=J(c?{connectorKey:c}:t,I,l),N=x.useMemo(()=>y?.pages.flatMap(m=>m.runs)??[],[y]),L={runType:n==="all",feed:!("workspace"in t)||n==="sync",connection:"deviceId"in t||"connectorKey"in t||"workspace"in t&&n!=="automation",startedBy:!0},T=q({onIntersect:()=>void S(),enabled:!!v&&!j&&!b,rootMargin:"200px"});return o.jsxs("div",{className:"space-y-3",children:[o.jsx(oe,{bucket:n,status:a,onBucketChange:m=>f({...i,bucket:m}),onStatusChange:m=>f({...i,status:m}),automation:"workspace"in t?{ownerSlug:l,ids:d,onChange:m=>f({...i,automationIds:m})}:void 0,source:"workspace"in t?{ownerSlug:l,connectionIds:e,connectorKey:c,onChange:m=>f({...i,...m})}:void 0}),F?o.jsx(ee,{}):b?o.jsxs("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:["Failed to load runs."," ",o.jsx(R,{variant:"ghost",size:"sm",onClick:()=>void A(),children:"Retry"})]}):N.length===0?o.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&a==="all"&&!d.length&&!e.length&&!c?"No runs yet.":"No runs match these filters."}):o.jsxs(o.Fragment,{children:[o.jsx(ne,{runs:N,ownerSlug:l,columns:L}),o.jsx("div",{ref:T,className:"h-1"}),v&&o.jsx(R,{variant:"ghost",size:"sm",disabled:j,onClick:()=>void S(),children:"Load more runs"}),$&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(G,{size:"lg",className:"text-muted-foreground"})})]})]})}export{se as R,ue as W};
|
|
2
|
-
//# sourceMappingURL=runs-panel-BwTVaRsE.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,i as p,S as c,bG as h,B as k,L as f,da as w,a$ as v,b0 as _,b1 as T,en as C,eo as S,u as R,ek as V,ec as L,V as B,ep as D,e9 as $,aj as A,ab as E,eq as I,r as j,dT as g,dV as y,dU as N}from"./index-BjcZVe7n.js";import{R as K}from"./run-initiator-CCxNv0rK.js";import{T as P,a as M,b as m,c as i,d as O,e as d}from"./table-DALHuXPE.js";function q({labels:t,className:r}){return e.jsx("div",{className:p("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",r),children:t.map((a,n)=>e.jsx("span",{className:n===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function F({rows:t=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(c,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:t}).map((r,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(c,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(c,{className:"h-3 w-20"}),e.jsx(c,{className:"h-3 w-16"}),e.jsx(c,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(c,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function ie({rows:t=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(q,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(F,{rows:t})]})}const H=h("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),U=h("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function z({className:t,status:r,showDot:a=!0,children:n,...o}){return e.jsxs("span",{className:p(H({status:r}),t),...o,children:[a&&e.jsx("span",{className:U({status:r})}),n]})}function G(t,r){switch(r.kind){case"connection":return S(t,r.id);case"feed":return C(t,r.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(r.id)}}}}function J({ownerSlug:t,scope:r,variant:a="outline",iconOnly:n=!1,label:o,className:s,title:x}){const l=G(t,r),b=x??o??"View in memory",u=e.jsx(k,{asChild:!0,variant:a,size:n?"icon":"sm",className:p(n&&"h-7 w-7",s),children:e.jsxs(f,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:p("h-3.5 w-3.5",!n&&"mr-1.5")}),!n&&(o??"View in memory")]})});return n?e.jsxs(v,{children:[e.jsx(_,{asChild:!0,children:u}),e.jsx(T,{children:b})]}):u}const W=new Set(["error","failed","revoked"]);function X(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":W.has(t)?"error":"default"}function Q({status:t}){return t==="completed"?e.jsx($,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(A,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(E,{className:"text-blue-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-muted-foreground"})}function Y({error:t}){const[r,a]=j.useState(!1);return t.length>80?e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(N,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function Z({checkpoint:t}){const[r,a]=j.useState(!1);return e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(N,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function ee(t){if(t.initiator_kind)return{kind:t.initiator_kind,...t.initiator_ref};if(t.automation_id)return{kind:"automation",automation_id:t.automation_id};if(t.created_by_user_id)return{kind:"user",user_id:t.created_by_user_id}}function te({run:t,ownerSlug:r}){const a=ee(t);return a?a.kind==="system"?e.jsx("span",{className:"text-muted-foreground",children:"System"}):e.jsx(K,{ownerSlug:r,initiator:a,clientName:void 0,fallback:"A person"}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}function se(t){return t.feed_display_name??t.feed_key??"—"}function de({runs:t,ownerSlug:r,columns:a={}}){const n=R(),o=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(P,{children:[e.jsx(M,{children:e.jsxs(m,{children:[e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"When"}),a.runType&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Type"}),a.connection&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Connection"}),a.feed&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Feed"}),a.startedBy&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Started by"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Version"}),o&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(O,{children:t.map(s=>{const x=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(m,{children:[e.jsx(d,{className:"py-1.5 px-3",children:e.jsx(Q,{status:s.status})}),e.jsxs(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:L(s.created_at),children:[e.jsxs(f,{to:"/$owner/events",params:{owner:r},search:{run_ids:String(s.id)},className:"block text-foreground hover:underline",onClick:l=>{!n||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),n.open({href:s.run_type==="automation"&&s.automation_id!=null?`/${r}/automations/${s.automation_id}?view=activity&run_id=${s.id}`:`/${r}/events?run_ids=${s.id}`,title:`Run #${s.id}`,runId:s.id}))},children:["Run #",s.id]}),V(s.created_at)]}),a.runType&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(B,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),a.connection&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),a.feed&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:se(s)}),a.startedBy&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(te,{run:s,ownerSlug:r})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(z,{status:X(s.status),children:s.status})}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:x!=null?D(x):"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),o&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(Z,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(Y,{error:s.error_message}):""}),e.jsx(d,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:r,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{F as R,z as S,J as V,de as a,ie as b,X as g};
|
|
2
|
-
//# sourceMappingURL=runs-table-CYS1jDdL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j2 as t,j as e}from"./index-BjcZVe7n.js";import{a as m}from"./agents-workbench-CDpJmUVN.js";import"./agent-editor-form-BXQBFHSv.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./model-selector-B2cjCn0V.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./nav-pill-Bam6s3jj.js";function h(){const{owner:o,agentId:r}=t.useParams(),i=t.useSearch();return e.jsx(m,{owner:o,agentId:r,tab:"settings",runId:i.run_id})}export{h as component};
|
|
2
|
-
//# sourceMappingURL=settings-DBgT60nY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j1 as r,j as t,O as s}from"./index-BjcZVe7n.js";import{A as e}from"./agent-skill-context-1DBn7Xc_.js";import"./core.esm-BsXtvNoI.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
2
|
-
//# sourceMappingURL=skills-DDoeRGhJ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as y,cP as b,f1 as v,j as e,B as j,f2 as R,S as _,bN as C,L,e4 as F,x as E}from"./index-BjcZVe7n.js";import{a as P,R as S,b as $}from"./event-card-CjA_dLzq.js";import{b as A}from"./events-feed-CGzA1w3R.js";function f({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function I({record:o,orgContext:c,filters:l}){const{orgContext:d}=y(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:x,isFetchingNextPage:s}=v(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:x,onRetry:()=>void g()}),e.jsx(A,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:x,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function B({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=y(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:x}=R(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(f,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=x instanceof C&&x.status===400;h&&!s||!i&&n?g():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx($,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void g(),children:a?"Loading…":"Load more"})]}):e.jsx(f,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{I as S,B as a};
|
|
2
|
-
//# sourceMappingURL=source-record-panels-m8gECt82.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,i as t}from"./index-BjcZVe7n.js";const s={live:"bg-green-500",amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function a({tone:r}){return e.jsx("span",{"aria-hidden":r===null,className:t("h-1.5 w-1.5 shrink-0 rounded-full",r===null?"bg-transparent":s[r])})}export{a as S};
|
|
2
|
-
//# sourceMappingURL=status-dot-BnQPFrcU.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./index-BjcZVe7n.js";function l({onIntersect:r,enabled:n,rootMargin:t="400px"}){const s=e.useRef(null),c=e.useRef(r);return c.current=r,e.useEffect(()=>{const u=s.current;if(!u||!n)return;const o=new IntersectionObserver(f=>{f[0]?.isIntersecting&&c.current()},{rootMargin:t});return o.observe(u),()=>o.disconnect()},[n,t]),s}export{l as u};
|
|
2
|
-
//# sourceMappingURL=use-scroll-sentinel-BWCrmNIB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g5 as wt,j as O,L as Ct,c as Tt,u as St,r as w,q as Ot,a3 as ce,Q as de,ge as Rt,p as Nt,gf as Et,i as At,gg as jt,gh as Zt}from"./index-BjcZVe7n.js";import{D as It,E as $t}from"./app-bridge-C4nPtae3.js";import{l as Vt}from"./renderer-CHPS-1vD.js";import{F as Mt,o as Lt,v as Pt}from"./filter-bar-CQ_oE7a9.js";var _;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var We;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(We||(We={}));const f=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class L extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof L))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}L.create=r=>new L(r);const je=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:_.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(r)}return{message:t}};let zt=je;function Dt(){return zt}const Ut=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function d(r,e){const t=Dt(),n=Ut({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===je?void 0:je].filter(s=>!!s)});r.common.issues.push(n)}class A{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return p;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return A.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const p=Object.freeze({status:"aborted"}),oe=r=>({status:"dirty",value:r}),I=r=>({status:"valid",value:r}),Je=r=>r.status==="aborted",Ye=r=>r.status==="dirty",Q=r=>r.status==="valid",ge=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class B{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xe=(r,e)=>{if(Q(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new L(r.common.issues);return this._error=t,this._error}}};function g(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:s}}class v{get description(){return this._def.description}_getType(e){return P(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ge(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Xe(n,s)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return Q(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Q(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ge(s)?s:Promise.resolve(s));return Xe(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new te({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return U.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M.create(this)}promise(){return ke.create(this,this._def)}or(e){return _e.create([this,e],this._def)}and(e){return xe.create(this,e,this._def)}transform(e){return new te({...g(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new $e({...g(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new lr({typeName:y.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ve({...g(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Le.create(this,e)}readonly(){return Me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bt=/^c[^\s-]{8,}$/i,Ft=/^[0-9a-z]+$/,qt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Wt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jt=/^[a-z0-9_-]{21}$/i,Yt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Gt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ht="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Re;const Qt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,er=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ft="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sr=new RegExp(`^${ft}$`);function ht(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ar(r){return new RegExp(`^${ht(r)}$`)}function ir(r){let e=`${ft}T${ht(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function or(r,e){return!!((e==="v4"||!e)&&Qt.test(r)||(e==="v6"||!e)&&er.test(r))}function cr(r,e){if(!Yt.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function dr(r,e){return!!((e==="v4"||!e)&&Kt.test(r)||(e==="v6"||!e)&&tr.test(r))}class D extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),p}const n=new A;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?d(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Gt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Re||(Re=new RegExp(Ht,"u")),Re.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Wt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Jt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Bt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ft.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")qt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),d(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ir(a).test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?sr.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ar(a).test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Xt.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?or(e.data,a.version)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?cr(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"jwt",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?dr(e.data,a.version)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"cidr",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?rr.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?nr.test(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{validation:"base64url",code:c.invalid_string,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...h.errToObj(n)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}D.create=r=>new D({checks:[],typeName:y.ZodString,coerce:r?.coerce??!1,...g(r)});function ur(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=Number.parseInt(r.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class K extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),p}let n;const s=new A;for(const a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?ur(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.not_finite,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,n,s){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}K.create=r=>new K({checks:[],typeName:y.ZodNumber,coerce:r?.coerce||!1,...g(r)});class ue extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let n;const s=new A;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,n,s){return new ue({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new ue({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ue.create=r=>new ue({checks:[],typeName:y.ZodBigInt,coerce:r?.coerce??!1,...g(r)});class Ge extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.boolean,received:n.parsedType}),p}return I(e.data)}}Ge.create=r=>new Ge({typeName:y.ZodBoolean,coerce:r?.coerce||!1,...g(r)});class ve extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),p}const n=new A;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):_.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ve({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ve.create=r=>new ve({checks:[],coerce:r?.coerce||!1,typeName:y.ZodDate,...g(r)});class He extends v{_parse(e){if(this._getType(e)!==f.symbol){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.symbol,received:n.parsedType}),p}return I(e.data)}}He.create=r=>new He({typeName:y.ZodSymbol,...g(r)});class Qe extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.undefined,received:n.parsedType}),p}return I(e.data)}}Qe.create=r=>new Qe({typeName:y.ZodUndefined,...g(r)});class Ke extends v{_parse(e){if(this._getType(e)!==f.null){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.null,received:n.parsedType}),p}return I(e.data)}}Ke.create=r=>new Ke({typeName:y.ZodNull,...g(r)});class et extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return I(e.data)}}et.create=r=>new et({typeName:y.ZodAny,...g(r)});class tt extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return I(e.data)}}tt.create=r=>new tt({typeName:y.ZodUnknown,...g(r)});class F extends v{_parse(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),p}}F.create=r=>new F({typeName:y.ZodNever,...g(r)});class rt extends v{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.void,received:n.parsedType}),p}return I(e.data)}}rt.create=r=>new rt({typeName:y.ZodVoid,...g(r)});class M extends v{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return d(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),p;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(d(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(d(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(d(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new B(t,i,t.path,o)))).then(i=>A.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new B(t,i,t.path,o)));return A.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new M({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new M({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new M({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}M.create=(r,e)=>new M({type:r,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...g(e)});function G(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=U.create(G(n))}return new b({...r._def,shape:()=>e})}else return r instanceof M?new M({...r._def,type:G(r.element)}):r instanceof U?U.create(G(r.unwrap())):r instanceof re?re.create(G(r.unwrap())):r instanceof Y?Y.create(r.items.map(e=>G(e))):r}class b extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const u=this._getOrReturnCtx(e);return d(u,{code:c.invalid_type,expected:f.object,received:u.parsedType}),p}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof F&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const m=a[u],S=s.data[u];l.push({key:{status:"valid",value:u},value:m._parse(new B(s,S,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof F){const u=this._def.unknownKeys;if(u==="passthrough")for(const m of o)l.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(u==="strict")o.length>0&&(d(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const m of o){const S=s.data[m];l.push({key:{status:"valid",value:m},value:u._parse(new B(s,S,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const m of l){const S=await m.key,N=await m.value;u.push({key:S,value:N,alwaysSet:m.alwaysSet})}return u}).then(u=>A.mergeObjectSync(n,u)):A.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new b({...this._def,catchall:e})}pick(e){const t={};for(const n of _.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new b({...this._def,shape:()=>t})}omit(e){const t={};for(const n of _.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new b({...this._def,shape:()=>t})}deepPartial(){return G(this)}partial(e){const t={};for(const n of _.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new b({...this._def,shape:()=>t})}required(e){const t={};for(const n of _.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof U;)a=a._def.innerType;t[n]=a}return new b({...this._def,shape:()=>t})}keyof(){return mt(_.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:F.create(),typeName:y.ZodObject,...g(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:F.create(),typeName:y.ZodObject,...g(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:F.create(),typeName:y.ZodObject,...g(e)});class _e extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new L(o.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},m=l._parseSync({data:t.data,path:t.path,parent:u});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new L(l));return d(t,{code:c.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}_e.create=(r,e)=>new _e({options:r,typeName:y.ZodUnion,...g(e)});function Ze(r,e){const t=P(r),n=P(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&n===f.object){const s=_.objectKeys(e),a=_.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=Ze(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===f.array&&n===f.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],l=Ze(i,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class xe extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Je(a)||Je(i))return p;const o=Ze(a.value,i.value);return o.valid?((Ye(a)||Ye(i))&&t.dirty(),{status:t.value,value:o.data}):(d(n,{code:c.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}xe.create=(r,e,t)=>new xe({left:r,right:e,typeName:y.ZodIntersection,...g(t)});class Y extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return d(n,{code:c.invalid_type,expected:f.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return d(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&n.data.length>this._def.items.length&&(d(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new B(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>A.mergeArray(t,i)):A.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Y({...this._def,rest:e})}}Y.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:r,typeName:y.ZodTuple,rest:null,...g(e)})};class nt extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return d(n,{code:c.invalid_type,expected:f.map,received:n.parsedType}),p;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,l],u)=>({key:s._parse(new B(n,o,n.path,[u,"key"])),value:a._parse(new B(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,m=await l.value;if(u.status==="aborted"||m.status==="aborted")return p;(u.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(u.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,m=l.value;if(u.status==="aborted"||m.status==="aborted")return p;(u.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(u.value,m.value)}return{status:t.value,value:o}}}}nt.create=(r,e,t)=>new nt({valueType:e,keyType:r,typeName:y.ZodMap,...g(t)});class le extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return d(n,{code:c.invalid_type,expected:f.set,received:n.parsedType}),p;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(d(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(d(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const u=new Set;for(const m of l){if(m.status==="aborted")return p;m.status==="dirty"&&t.dirty(),u.add(m.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>a._parse(new B(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new le({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new le({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}le.create=(r,e)=>new le({valueType:r,minSize:null,maxSize:null,typeName:y.ZodSet,...g(e)});class st extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}st.create=(r,e)=>new st({getter:r,typeName:y.ZodLazy,...g(e)});class Ie extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ie.create=(r,e)=>new Ie({value:r,typeName:y.ZodLiteral,...g(e)});function mt(r,e){return new ee({values:r,typeName:y.ZodEnum,...g(e)})}class ee extends v{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{expected:_.joinValues(n),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:n}),p}return I(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ee.create(e,{...this._def,...t})}exclude(e,t=this._def){return ee.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}ee.create=mt;class at extends v{_parse(e){const t=_.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=_.objectValues(t);return d(n,{expected:_.joinValues(s),received:n.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=_.objectValues(t);return d(n,{received:n.data,code:c.invalid_enum_value,options:s}),p}return I(e.data)}get enum(){return this._def.values}}at.create=(r,e)=>new at({values:r,typeName:y.ZodNativeEnum,...g(e)});class ke extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),p;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return I(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ke.create=(r,e)=>new ke({type:r,typeName:y.ZodPromise,...g(e)});class te extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{d(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?p:l.status==="dirty"||t.value==="dirty"?oe(l.value):l});{if(t.value==="aborted")return p;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?p:o.status==="dirty"||t.value==="dirty"?oe(o.value):o}}if(s.type==="refinement"){const i=o=>{const l=s.refinement(o,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Q(i))return p;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Q(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):p);_.assertNever(s)}}te.create=(r,e,t)=>new te({schema:r,typeName:y.ZodEffects,effect:e,...g(t)});te.createWithPreprocess=(r,e,t)=>new te({schema:e,effect:{type:"preprocess",transform:r},typeName:y.ZodEffects,...g(t)});class U extends v{_parse(e){return this._getType(e)===f.undefined?I(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(r,e)=>new U({innerType:r,typeName:y.ZodOptional,...g(e)});class re extends v{_parse(e){return this._getType(e)===f.null?I(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(r,e)=>new re({innerType:r,typeName:y.ZodNullable,...g(e)});class $e extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}$e.create=(r,e)=>new $e({innerType:r,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class Ve extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ge(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new L(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new L(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ve.create=(r,e)=>new Ve({innerType:r,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class it extends v{_parse(e){if(this._getType(e)!==f.nan){const n=this._getOrReturnCtx(e);return d(n,{code:c.invalid_type,expected:f.nan,received:n.parsedType}),p}return{status:"valid",value:e.data}}}it.create=r=>new it({typeName:y.ZodNaN,...g(r)});class lr extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Le extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),oe(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?p:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Le({in:e,out:t,typeName:y.ZodPipeline})}}class Me extends v{_parse(e){const t=this._def.innerType._parse(e),n=s=>(Q(s)&&(s.value=Object.freeze(s.value)),s);return ge(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}Me.create=(r,e)=>new Me({innerType:r,typeName:y.ZodReadonly,...g(e)});var y;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(y||(y={}));const ot=D.create,ct=K.create;F.create;M.create;const Ne=b.create,dt=_e.create;xe.create;Y.create;const fr=Ie.create,hr=ee.create;ke.create;U.create;re.create;function jr({viewKey:r,backTo:e,backLabel:t}){return O.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"missing-view",children:[O.jsxs("h2",{className:"text-lg font-semibold",children:["No view named “",r,"” here"]}),O.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"It may have been renamed or detached from this page."}),O.jsx(Ct,{to:e,className:"mt-4 text-sm font-medium underline underline-offset-4",children:t})]})}function Zr({error:r,onRetry:e}){const t=wt(r,{subject:"Views"});return O.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"views-unavailable",children:[O.jsx("h2",{className:"text-lg font-semibold",children:t.title}),O.jsx("p",{className:"text-muted-foreground mt-2 max-w-md text-sm",children:t.body}),t.retryable?O.jsx("button",{type:"button",onClick:e,className:"mt-4 text-sm font-medium underline underline-offset-4",children:"Try again"}):null]})}const mr="lobu/open-record";function pr(r,e){return r==="manage_entity"?e?.action==="list"||e?.action==="get"||e?.action==="list_links":r==="manage_automations"?e?.action==="list":r==="manage_agents"?e?.action==="get":r==="manage_connections"?e?.action==="list":r==="manage_catalog"?e?.action==="list_installed":r==="manage_entity_schema"&&e?.schema_type==="entity_type"&&(e.action==="list"||e.action==="get")}const ut=Ne({method:fr(mr),params:Ne({record:Ne({entity_id:dt([ct().int().positive().max(Number.MAX_SAFE_INTEGER),ot().min(1).max(1024)]),entity_type:dt([ot().min(1),ct().int().positive()]).optional()}),mode:hr(["peek","page"])})}),yr=new Set(["query_sql","query_sdk"]),gr=200;function vr(r,e){const t=r?.title;return typeof t=="string"&&t.trim()?r??{}:{...r,title:e.slice(0,gr)}}const Ee=new Map;function _r(r){const e=Ee.get(r);if(e)return e;const t=ce(`${de}/api/${r}/tools`,{method:"GET",credentials:"include",timeoutMs:15e3}).then(async n=>{if(!n.ok)throw new Error(`tool list failed: ${n.status}`);const s=await n.json();return new Set((s.tools??[]).flatMap(a=>typeof a.name=="string"&&a.annotations?.readOnlyHint===!0?[a.name]:[]))});return Ee.set(r,t),t.catch(()=>Ee.delete(r)),t}const xr=[["--color-background-primary","--background"],["--color-background-secondary","--card"],["--color-background-tertiary","--muted"],["--color-background-inverse","--foreground"],["--color-text-primary","--foreground"],["--color-text-secondary","--muted-foreground"],["--color-text-inverse","--background"],["--color-text-info","--primary"],["--color-text-danger","--destructive"],["--color-border-primary","--border"],["--color-border-secondary","--input"],["--color-border-danger","--destructive"],["--color-ring-primary","--ring"],["--font-mono","--font-mono"],["--border-radius-sm","--radius-sm"],["--border-radius-md","--radius-md"],["--border-radius-lg","--radius-lg"],["--border-radius-xl","--radius-xl"]];function Ae(r){const e=document.documentElement,t=getComputedStyle(e),n={};for(const[a,i]of xr){const o=t.getPropertyValue(i).trim();o&&(n[a]=o)}const s=document.body?getComputedStyle(document.body).fontFamily:"";return s&&(n["--font-sans"]=s),{theme:e.classList.contains("dark")?"dark":"light",displayMode:r.displayMode,availableDisplayModes:r.expandable?["inline","fullscreen"]:[r.displayMode],containerDimensions:{...r.width?{width:r.width}:{},...r.maxHeight?{maxHeight:r.maxHeight}:{}},platform:"web",styles:{variables:n}}}async function kr(r,e,t,n,s,a){if(s!=="invoke_view_action"){const S=yr.has(s);return!S&&!pr(s,a)&&!(await _r(r)).has(s)?{error:`Views can only call read tools and their declared actions; "${s}" is neither`}:{url:`${de}/api/${r}/${encodeURIComponent(s)}`,body:S?vr(a,t):a??{}}}const{view:i,action:o,value:l,interaction_id:u,scope:m}=a??{};return m!==void 0&&(typeof m!="object"||m===null||m.event!==n.event)?{error:"The event context changed. Reopen the event before submitting."}:i!==e?{error:`This frame hosts "${e}", not "${String(i)}"`}:typeof o!="string"||!o?{error:"action is required"}:{url:`${de}/api/${r}/views/${encodeURIComponent(e)}/actions/${encodeURIComponent(o)}`,body:{value:l??null,interaction_id:u,...n.event===void 0?{}:{scope:{event:n.event}}}}}const lt=24,z=new Map,H=new Map;function br(r,e){const t=`${r}\0${e}`,n=z.get(t);return n!==void 0&&(z.delete(t),z.set(t,n)),n}function wr(r,e,t){H.delete(r),H.set(r,{hash:e,html:t});for(const s of H.keys()){if(H.size<=lt)break;H.delete(s)}if(e===null)return;const n=`${r}\0${e}`;z.delete(n),z.set(n,t);for(const s of z.keys()){if(z.size<=lt)break;z.delete(s)}}const ye=new Map;function Cr(r,e,t,n){const s=ye.get(r);if(s)return s;const a=ce(e,{credentials:"include"}).then(async i=>n&&(i.status===401||i.status===403)?ce(t,{credentials:"include"}):i).then(async i=>{if(!i.ok)throw new Error(`shell ${i.status}`);return{html:await i.text(),hash:i.headers.get("X-Lobu-View-Hash")}});return ye.set(r,a),a.then(()=>ye.delete(r),()=>ye.delete(r)),a}const Ir=({orgSlug:r,viewKey:e,scope:t,params:n,onParamsChange:s,contentHash:a,title:i,minHeight:o=96,fixedHeight:l,displayMode:u="fullscreen",maxHeight:m,onRequestDisplayMode:S,className:N,onLoadError:q})=>{const fe=Tt(),Pe=St(),ne=w.useRef(Pe);ne.current=Pe;const be=w.useRef(fe);be.current=fe;const{session:pt,isReady:yt}=Ot(),we=yt&&!pt,Ce=w.useRef(null),he=w.useRef(null),[se,Te]=w.useState(null),[me,Se]=w.useState(null),[ze,gt]=w.useState(o),ae=w.useRef(null),X=w.useRef(null),De=w.useRef(o);De.current=o;const Ue=w.useRef(l);Ue.current=l;const $=w.useRef({scope:t,params:n,onParamsChange:s,onLoadError:q,onRequestDisplayMode:S,title:i});$.current={scope:t,params:n,onParamsChange:s,onLoadError:q,onRequestDisplayMode:S,title:i};const[Be,vt]=w.useState(void 0),ie=w.useRef({displayMode:u,expandable:!1});ie.current={displayMode:u,maxHeight:m,width:Be,expandable:S!==void 0};const V=jt(r,e);w.useEffect(()=>{let j=!1;if(V!==X.current&&(Te(null),X.current=null,ae.current=null),Se(null),a!=null&&a===ae.current&&V===X.current)return()=>{j=!0};const Z=a==null?H.get(V):(()=>{const x=br(V,a);return x===void 0?void 0:{hash:a,html:x}})();if(Z!==void 0)return ae.current=Z.hash??a??null,X.current=V,Te(Z.html),()=>{j=!0};const W=x=>`${de}/api/${r}${x?"/public":""}/views/${encodeURIComponent(e)}/shell`;return Cr(V,W(we),W(!0),!we).then(({html:x,hash:T})=>{wr(V,T,x),!j&&(T!==null&&T===ae.current&&V===X.current||(ae.current=T,X.current=V,Se(null),Te(x)))}).catch(x=>{j||(Se(x instanceof Error?x.message:String(x)),$.current.onLoadError?.())}),()=>{j=!0}},[V,r,e,a,we]);const _t=S!==void 0;w.useEffect(()=>{he.current?.setHostContext(Ae(ie.current))},[u,m,Be,_t]),w.useEffect(()=>{const j=Ce.current;if(!j||typeof ResizeObserver>"u")return;const Z=new ResizeObserver(([W])=>{const x=Math.round(W.contentRect.width);x>0&&vt(x)});return Z.observe(j),()=>Z.disconnect()},[se]);const xt=JSON.stringify(n),kt=JSON.stringify(t);if(w.useEffect(()=>{he.current?.sendToolInput({arguments:{scope:$.current.scope,params:$.current.params}})},[kt,xt]),w.useEffect(()=>{if(!se||me)return;const j=Ce.current;if(!j?.contentWindow)return;const Z=r,W=e;let x=!1;const T=new It(null,{name:"Lobu",version:"1.0.0"},{openLinks:{},serverTools:{},updateModelContext:{structuredContent:{}}},{hostContext:Ae(ie.current)});T.addEventListener("sizechange",({height:C})=>{Ue.current||typeof C=="number"&>(Math.max(De.current,Math.ceil(C)))}),T.setRequestHandler(ut,async C=>{const{params:k}=ut.parse(C);if(x)throw new Error("View unmounted");if(typeof k.record.entity_id=="string"&&!k.record.entity_type)throw new Error("String record keys require entity_type");const E=await ce(`${de}/api/${Z}/manage_entity`,{method:"POST",credentials:"include",timeoutMs:15e3,headers:{"Content-Type":"application/json"},body:JSON.stringify({...k.record,action:"get"})});if(!E.ok)throw new Error(`Could not open record (${E.status})`);const R=(await E.json()).entity;if(x)throw new Error("View unmounted");if(!R?.view_url)throw new Error("Record is unavailable");if(k.mode==="peek"&&ne.current){const J={ownerSlug:Z,orgContext:{slug:Z},name:R.name};return ne.current.open(Vt(typeof R.id=="number"?{...J,entityId:R.id}:{...J,record:{type:R.entity_type,key:R.slug}})),{mode:"peek"}}return await be.current({href:R.view_url}),{mode:"page"}}),T.oncalltool=async({name:C,arguments:k})=>{if(x)return{content:[{type:"text",text:"view unmounted"}],isError:!0};let E;try{E=await kr(Z,W,$.current.title??W,$.current.scope,C,k)}catch(J){return{content:[{type:"text",text:String(J)}],isError:!0}}if(x)return{content:[{type:"text",text:"view unmounted"}],isError:!0};if("error"in E)return{content:[{type:"text",text:E.error}],isError:!0};const pe=await ce(E.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(E.body),timeoutMs:3e4}),R=await pe.json().catch(()=>null);if(!pe.ok){const J=R&&typeof R.error=="string"&&R.error||`API error: ${pe.status}`;return{content:[{type:"text",text:J}],isError:!0,structuredContent:{error:{message:J,code:R?.code}}}}return{content:[{type:"text",text:JSON.stringify(R)}],structuredContent:R??{}}},T.onupdatemodelcontext=async({structuredContent:C})=>{if(x)return{};const k=C?.params;return k&&typeof k=="object"&&!Array.isArray(k)&&$.current.onParamsChange(k),{}},T.onopenlink=async({url:C})=>{if(x)return{};const k=new URL(C,window.location.href);return k.origin===window.location.origin?(k.pathname=Rt(k.pathname),Nt(k.href)?.owner===Z&&ne.current?ne.current.open({href:k.pathname+k.search+k.hash,title:"Details"}):await be.current({href:k.href})):window.open(k.href,"_blank","noopener,noreferrer"),{}},T.onrequestdisplaymode=async({mode:C})=>{const k=ie.current.displayMode,E=$.current.onRequestDisplayMode;return!x&&E&&C!==k&&(C==="inline"||C==="fullscreen")&&E(C),{mode:k}},T.addEventListener("initialized",()=>{T.sendToolInput({arguments:{scope:$.current.scope,params:$.current.params}})});const Oe=new $t(j.contentWindow,j.contentWindow);T.connect(Oe).catch(C=>{console.error("[view-frame] failed to initialize",C)}),he.current=T;const bt=Et(()=>{x||Oe.send({jsonrpc:"2.0",method:"lobu/notifications/data-changed",params:{}}).catch(()=>{})}),qe=new MutationObserver(()=>{T.setHostContext(Ae(ie.current))});return qe.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{x=!0,bt(),qe.disconnect(),he.current=null,Oe.close()}},[se,me,r,e]),me)return O.jsxs("div",{"data-testid":"view-frame-error",className:"text-sm text-destructive",children:["View failed to load: ",me]});const Fe=!l&&m!==void 0&&ze>m;return O.jsxs("div",{className:At(m!==void 0&&"relative overflow-hidden",N),style:m!==void 0?{maxHeight:m}:void 0,"data-testid":"view-frame","data-view":e,"data-clipped":Fe||void 0,children:[se?O.jsx("iframe",{ref:Ce,title:i??e,srcDoc:se,sandbox:"allow-scripts",style:{width:"100%",height:l??ze,border:"none",display:"block"}}):O.jsx("div",{className:"animate-pulse rounded-md bg-muted/40",style:{height:o}}),Fe?O.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-background to-transparent"}):null]})},Tr=[{value:!0,label:"Yes"},{value:!1,label:"No"}];function Sr(r,e,t){const n=[],s=[];for(const[a,i]of Object.entries(r??{})){const o=i.filter;if(!o)continue;const l=N=>t({...e,[a]:N}),u=o.options??(i.type==="boolean"?Tr:void 0),m=e[a],S=u?Lt({searchPlaceholder:`Search ${o.label.toLowerCase()}...`,options:u.map(N=>({value:String(N.value),label:N.label})),selected:m===void 0?[]:[String(m)],onSelect:N=>{const q=u.find(fe=>String(fe.value)===N);q&&l(q.value)}}):Pt({type:i.type==="number"?"number":"text",label:o.label,value:typeof m=="boolean"?void 0:m,onApply:l});n.push({key:`param:${a}`,label:o.label,group:"View",icon:O.jsx(Zt,{className:"h-4 w-4"}),editor:S}),m!==void 0&&s.push({id:`param:${a}`,label:o.label,op:"is",value:u?.find(N=>N.value===m)?.label??(m===""?"(empty)":String(m)),onRemove:()=>{const{[a]:N,...q}=e;t(q)}})}return{fields:n,chips:s}}function Or(r,e){const t={...e};for(const[n,s]of Object.entries(r??{}))s.filter&&delete t[n];return t}function $r({decls:r,params:e,onParamsChange:t}){const{fields:n,chips:s}=Sr(r,e,t);return n.length?O.jsx(Mt,{label:"View filters",className:"mb-3",fields:n,chips:s,onClearAll:()=>t(Or(r,e))}):null}export{jr as M,Zr as V,Ir as a,$r as b,Sr as v,Or as w};
|
|
2
|
-
//# sourceMappingURL=view-param-filters-CDvwie_f.js.map
|