@lobu/runtime-server 24.0.0 → 24.1.1
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/connectors/x-dm-adapter.js +65 -30
- package/dist/db/migrations/20261021010000_views_compile_config_hash.sql +16 -0
- package/dist/dependencies.bun.lock +1 -1
- package/dist/owletto/dist/assets/{_-CC8cTmRg.js → _-BorucF19.js} +3 -3
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +2 -0
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-DWUFSrVp.js → _agentId-DgRrCE2B.js} +2 -2
- package/dist/owletto/dist/assets/{_automationId-BnHqdXOC.js → _automationId-DSrZIYcs.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-CefXIqy2.js → _connectorKey._connectionId-DWxv1uoi.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey.index-C1QPGf9E.js → _connectorKey.index-BTP5ijdT.js} +2 -2
- package/dist/owletto/dist/assets/{_conversationId-DinuPCUp.js → _conversationId-98Y3RuRO.js} +2 -2
- package/dist/owletto/dist/assets/{_deploymentId-BeyzVjRm.js → _deploymentId-B1UWPY0i.js} +2 -2
- package/dist/owletto/dist/assets/{_eventId-3L_qeL_l.js → _eventId-BAnr8g8z.js} +2 -2
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +2 -0
- package/dist/owletto/dist/assets/{_owner-DbrKma4e.js → _owner-C79BwQ0I.js} +3 -3
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +2 -0
- package/dist/owletto/dist/assets/{_slug-ndDr_CUg.js → _slug-DbPdDc-5.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CRKbM2Xy.js → accept-invitation-UXU5Fx2G.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-CFLNukhD.js → activity-route-view-D7ORHntE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-Be1Okb2C.js → agent-card-controls-CplnPhbv.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-BA8dU_C6.js → agent-client-setup-list-BlXB4SE5.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-CAV-yXus.js → agent-connect-pages-BmknviTI.js} +2 -2
- package/dist/owletto/dist/assets/{agent-editor-form-Bi6WvYX-.js → agent-editor-form-DsSoeQeF.js} +2 -2
- package/dist/owletto/dist/assets/{agent-guardrails-route-DMOjG1D4.js → agent-guardrails-route-TdvvIc_J.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-De_2d8Lr.js → agent-loading-shells-B7v6Cffw.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-gZWl6mAe.js → agent-permissions-matrix-BkZu1LYE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-JLaTamGR.js → agent-skill-context-DFucg4c4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-DcK41PWj.js → agent-skills-route-B3vvvZZe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-BBJoyTuC.js → agent-subpage-shell-CZJvnjNC.js} +2 -2
- package/dist/owletto/dist/assets/agent-thread-D38STyeu.js +6 -0
- package/dist/owletto/dist/assets/agents-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/{agents-workbench-CqaKGggb.js → agents-workbench-DJ67GZ93.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-Cl1fTuIt.js → app._appId-Cp78oEZ9.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-BMLL4lxO.js → automation-detail-content-DSwbRpbx.js} +2 -2
- package/dist/owletto/dist/assets/automations-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/{callback-DTKKsfkz.js → callback-CBexCo3F.js} +2 -2
- package/dist/owletto/dist/assets/{card-yU0TmNRH.js → card-jzhQrMDP.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DJfTvlT2.js → claim-B-wq745Q.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows--FrZfJol.js → client-rows-BYbsXGy9.js} +2 -2
- package/dist/owletto/dist/assets/{clients-L4K1UT8c.js → clients-BhNl1tVq.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-U54Gwjit.js → code-editor-CEqoCky-.js} +2 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId.activity-DTpSW1Xy.js → connected._clientId.activity-BqprYeOX.js} +2 -2
- package/dist/owletto/dist/assets/{connected._clientId.index-h9X5H1x8.js → connected._clientId.index-DhRoSzBr.js} +2 -2
- package/dist/owletto/dist/assets/{connection-ByvKkyFm.js → connection-CNm2ukrI.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-DWM9lTao.js → connection-feed-detail-WcGCA6qY.js} +2 -2
- package/dist/owletto/dist/assets/{connections-browser-CEwYrYqt.js → connections-browser-CrtnAs0Q.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-BocTm__v.js → connector-provenance-D-ECOlMJ.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-OYDOydtz.js → connector-scope-lists-CRFEpSvk.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CyZpcE5f.js → connectors-CH4KBZyT.js} +2 -2
- package/dist/owletto/dist/assets/{consent-DdfINrVp.js → consent-C9ZpHb7V.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BSznfdYt.js → conversations-table-D_HOe1jN.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-Dr7tcIB-.js → core.esm-BupT3V0i.js} +2 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +2 -0
- package/dist/owletto/dist/assets/{create-CBGwASon.js → create-CCjZxIkK.js} +2 -2
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-9T5WnoUs.js → create-automation-form-Bpy92SM5.js} +2 -2
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-BWFEyy_P.js → cronstrue-CWImw-kf.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-wG_8QzOF.js → deployments-C5hvipQh.js} +2 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-2xKS8gRo.js → deployments-body-DGII20dQ.js} +2 -2
- package/dist/owletto/dist/assets/{device-6z-xgsoW.js → device-D-7WBe9E.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-Cwq88RMU.js → device-pin-tombstone-2U0UMu3_.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-BDerBfD9.js → device._deviceId-Bn37UpWH.js} +2 -2
- package/dist/owletto/dist/assets/{entity-avatar-Cc1CuI-0.js → entity-avatar-mdh7Kq5D.js} +2 -2
- package/dist/owletto/dist/assets/{entity-options-DHdMC1Lx.js → entity-options-Clz_WXK-.js} +2 -2
- package/dist/owletto/dist/assets/{entity-page--OkXmlNP.js → entity-page-D3e4iPle.js} +2 -2
- package/dist/owletto/dist/assets/{entity-type-page-89RoK_-P.js → entity-type-page-DebN1vCM.js} +2 -2
- package/dist/owletto/dist/assets/{event-detail-D4YZRtrA.js → event-detail-DV_zfWnC.js} +2 -2
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +2 -0
- package/dist/owletto/dist/assets/{filter-editors-B1_QUpg_.js → filter-editors-Bwhqj7lY.js} +2 -2
- package/dist/owletto/dist/assets/{full-page-spinner-Cqih-8IW.js → full-page-spinner-BVbcpW3R.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +2 -0
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +2 -0
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +2 -0
- package/dist/owletto/dist/assets/{index-DYCqXaMf.js → index-9YuSRymd.js} +4 -4
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +2 -0
- package/dist/owletto/dist/assets/{index-TgRS2v_F.js → index-B64PGxQm.js} +2 -2
- package/dist/owletto/dist/assets/{index-DfyDUpuI.js → index-BTlx9K_t.js} +2 -2
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +2 -0
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +2 -0
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +2 -0
- package/dist/owletto/dist/assets/{index-DYzWV5_z.js → index-CxF2XXzl.js} +2 -2
- package/dist/owletto/dist/assets/index-D3WHeGql.js +2 -0
- package/dist/owletto/dist/assets/{index-ZNlrDc_f.js → index-D7gHOpfg.js} +2 -2
- package/dist/owletto/dist/assets/{index-DKPwCasf.js → index-DB1iWI_a.js} +2 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +2 -0
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +2 -0
- package/dist/owletto/dist/assets/{index-DAOyXG1X.js → index-fgAJydgX.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DFvYINBT.js → json-diff-DIN5Jhfx.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-DFsEqLU1.js → list-skeleton-CepswBka.js} +2 -2
- package/dist/owletto/dist/assets/{login-DO0j-AYr.js → login-DxGYyE4n.js} +2 -2
- package/dist/owletto/dist/assets/{logout-BmNwoAf7.js → logout-Bkzc7J44.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-B2LrMWBU.js → member-scope-gate-DD4YBFn-.js} +2 -2
- package/dist/owletto/dist/assets/{memory-browse-page-Cjpl8EbB.js → memory-browse-page-D_UlBa27.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-TQcA93xm.js → model-selector-CDrAjH31.js} +2 -2
- package/dist/owletto/dist/assets/models-BAVeysNq.js +2 -0
- package/dist/owletto/dist/assets/{new-BMrFy5Qa.js → new-C2av0diq.js} +2 -2
- package/dist/owletto/dist/assets/{new-ByBhteWA.js → new-ktz9Cs_P.js} +2 -2
- package/dist/owletto/dist/assets/{new-DWp3deoW.js → new-snm1ctHn.js} +2 -2
- package/dist/owletto/dist/assets/{oauth-workspace-access-D_5uESuz.js → oauth-workspace-access-lZNZ9gul.js} +2 -2
- package/dist/owletto/dist/assets/{organization-DTFoYP4V.js → organization-Cb0W823y.js} +2 -2
- package/dist/owletto/dist/assets/{peek-pane-content-DF5iGC3c.js → peek-pane-content-BNR9ImQY.js} +2 -2
- package/dist/owletto/dist/assets/{permissions-C_auqxfP.js → permissions-Dv39zWKt.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-DsNiavG_.js → proposal-review-shell-CFhOqCLf.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +2 -0
- package/dist/owletto/dist/assets/{recent-3d99S2IE.js → recent-QhnLDU1_.js} +2 -2
- package/dist/owletto/dist/assets/{record-activity-C9KfBkXb.js → record-activity-ZJntBfN_.js} +2 -2
- package/dist/owletto/dist/assets/{record-field-peek-BBZcRuGT.js → record-field-peek-Brh1IQGy.js} +2 -2
- package/dist/owletto/dist/assets/{record-session-BizRugWs.js → record-session-Pbr5czGw.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-DqfcSn8M.js → reset-password-CzZw6RcC.js} +2 -2
- package/dist/owletto/dist/assets/{runs-panel-T1ZxTVz6.js → runs-panel-C0_DNTcq.js} +2 -2
- package/dist/owletto/dist/assets/{runs-table-D_8QlCCN.js → runs-table-B1APZv7d.js} +2 -2
- package/dist/owletto/dist/assets/{schema-value-normalization-CylKX3PK.js → schema-value-normalization-CKdPjdPC.js} +2 -2
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +2 -0
- package/dist/owletto/dist/assets/{settings-B_ClYztB.js → settings-VDNiffKU.js} +2 -2
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-Cg249m1S.js → source-record-panels-BdfOVPWn.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-BYbFvHbJ.js → use-mention-search-Dcunv4L0.js} +2 -2
- package/dist/owletto/dist/assets/{view-param-filters-DMSqkN2J.js → view-param-filters-B0quibBi.js} +2 -2
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +455 -201
- package/npm-shrinkwrap.json +8 -8
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +74 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +86 -0
- package/vendor/core/package.json +6 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-ksFp4zVf.js +0 -2
- package/dist/owletto/dist/assets/_agentId-MENLoohA.js +0 -2
- package/dist/owletto/dist/assets/_name-Dgedji78.js +0 -2
- package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +0 -6
- package/dist/owletto/dist/assets/agents-C-ReckCa.js +0 -2
- package/dist/owletto/dist/assets/automations-C-ReckCa.js +0 -2
- package/dist/owletto/dist/assets/connect-4zqtnDHb.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +0 -2
- package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +0 -2
- package/dist/owletto/dist/assets/create-CwThQtd3.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +0 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +0 -2
- package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +0 -2
- package/dist/owletto/dist/assets/identity-B0nH4yiC.js +0 -2
- package/dist/owletto/dist/assets/index-4TSkcsth.js +0 -2
- package/dist/owletto/dist/assets/index-BgkhXElB.js +0 -2
- package/dist/owletto/dist/assets/index-CoW4Bz3w.js +0 -2
- package/dist/owletto/dist/assets/index-Codw-Qqi.js +0 -2
- package/dist/owletto/dist/assets/index-DMyXd3bJ.js +0 -2
- package/dist/owletto/dist/assets/index-DYYZLcJ0.js +0 -2
- package/dist/owletto/dist/assets/index-Da6CrGEu.js +0 -2
- package/dist/owletto/dist/assets/index-DneshLbf.js +0 -2
- package/dist/owletto/dist/assets/models-D7aED5Sa.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +0 -2
- package/dist/owletto/dist/assets/settings-DgX1-xo7.js +0 -2
- package/dist/owletto/dist/assets/skills-Drw5tcZw.js +0 -2
package/dist/owletto/dist/assets/{record-activity-C9KfBkXb.js → record-activity-ZJntBfN_.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{au as gn,j as n,r as b,o as z,q as ce,cx as xn,ch as Tt,cy as At,L as Ie,cz as bn,cA as jn,n as kn,cB as Et,cC as Sn,b_ as Nn,cD as Cn,aj as _n,cE as Ft,cF as A,cG as In,bn as Tn,cH as An,cI as En,bo as Fn,cJ as On,cK as ae,ct as Rn,cL as Ot,cM as wn,ao as Mn,cN as Ln,a_ as Pn,bb as $n,ar as Ce,cO as Dn,cP as Bn,bh as Rt,ci as wt,cQ as Kn,cR as Gn,cS as Un,cT as Mt,cU as Vn,cs as Qn,cV as Wn,bf as zn,aW as Hn,S as Lt,cW as qn,I as Yn,Q as Te,X as Zn,B as ie,cX as Xn,bp as Jn,bq as es,br as ts,bs as ns,bt as ss,cY as os,cZ as as,bB as is,c_ as cs,c$ as rs,d0 as ls,af as Pt,d1 as ht,i as ds,d2 as us,d3 as $t,d4 as De,d5 as vt,cg as ms,d6 as fs,d7 as ps,d8 as hs,d9 as vs,da as ys,db as gs,dc as xs,dd as bs,de as js,df as ks,bM as Ss,dg as Ns,dh as Cs,aR as yt,di as gt,dj as Be,dk as Dt,dl as _s,dm as Ke}from"./index-DYCqXaMf.js";import{S as K,F as Is,d as Ts,o as Ne,r as As,f as Es,a as Fs}from"./filter-editors-B1_QUpg_.js";import{c as xt}from"./connection-label-BobuYiAG.js";import{S as Os}from"./source-record-panels-Cg249m1S.js";import{u as Rs}from"./clients-L4K1UT8c.js";import{g as ws}from"./client-rows--FrZfJol.js";import{E as Ms}from"./events-feed-DsrkV2ix.js";import{L as Ls,u as Ps}from"./schema-value-normalization-CylKX3PK.js";import{E as $s}from"./agent-loading-shells-De_2d8Lr.js";import{M as Ds}from"./member-scope-gate-B2LrMWBU.js";const Qe=b.createContext(null);function Bs({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:a}=gn(e);return n.jsx(Qe.Provider,{value:{groups:s,isLoading:!!t||a},children:o})}function Ks(){const e=b.useContext(Qe);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Gs(){return b.useContext(Qe)}function Bt(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:a=!0,replace:c=!0,merge:f}=e,u=z(),d=ce(),i=b.useMemo(()=>{const m=new URLSearchParams;for(const[h,y]of Object.entries(d.search||{}))y!=null&&m.set(h,typeof y=="object"&&!Array.isArray(y)?JSON.stringify(y):String(y));return t(m)},[d.search,t]),r=b.useCallback((m,h)=>{const y=f?f(i,m):{...i,...m},g=o(y),N={};for(const[j,x]of Object.entries(d.search||{}))x!=null&&(N[j]=x);for(const j of s)delete N[j];if(a)for(const j of Object.keys(N))j.startsWith("clf_")&&delete N[j];for(const[j,x]of Object.entries(g))x!==void 0&&(N[j]=x);u({to:d.pathname,search:N,replace:h?.replace??c})},[i,o,s,a,f,u,d,c]),l=b.useCallback(()=>{const m={};for(const[h,y]of Object.entries(d.search||{}))y!=null&&(s.includes(h)||a&&h.startsWith("clf_")||(m[h]=y));u({to:d.pathname,search:m,replace:c})},[u,d.pathname,d.search,s,a,c]);return{filters:i,updateFilters:r,clearFilters:l}}function Us(e){const{slug:t}=xn();return Tt({queryKey:["schedules",t,e],queryFn:async()=>((await At("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Vs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Qs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function Ws(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function zs(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Hs(e,t,o){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:o}}}function xe({id:e,label:t,value:o,sourceLink:s,details:a,onRemove:c}){return{id:e,label:t,op:"is",value:o,onRemove:c,editor:s||a?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(Ie,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:o}),n.jsx(bn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function qs({ownerSlug:e,clientIds:t,linkedUser:o,linkedUserEntitySlug:s}){const a=e&&s?jn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(c=>n.jsx("code",{className:"break-all text-foreground",children:c},c))]}),o?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?n.jsx(Ie,{to:a,className:"font-medium text-foreground hover:underline",children:o}):n.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function be(e,t,o){const s=new Set;for(const[a,c]of Object.entries(e.feeds_schema??{})){if(o&&!o.has(a))continue;const f=ee(ee(c)?.eventKinds);if(f)for(const[u,d]of Object.entries(f)){if(!t){s.add(u);continue}const i=ee(d)?.attributions;Array.isArray(i)&&i.some(r=>{const l=ee(ee(r)?.target);return typeof l?.entityType=="string"&&t.has(l.entityType)})&&s.add(u)}}return s}function Ys({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const c=new Set,f=new Set(o),u=new Set(a),d=new Map;for(const i of s){const r=d.get(i.connectorKey)??new Set;r.add(i.feedKey),d.set(i.connectorKey,r)}if(d.size>0)for(const i of e){const r=d.get(i.key);if(r)for(const l of be(i,void 0,r))c.add(l)}else if(f.size>0){for(const i of e)if(f.has(i.key))for(const r of be(i))c.add(r)}else if(u.size>0){for(const i of t)if(u.has(i.slug))for(const r of Object.keys(i.event_kinds??{}))c.add(r);for(const i of e)for(const r of be(i,u))c.add(r)}else{for(const i of t)for(const r of Object.keys(i.event_kinds??{}))c.add(r);for(const i of e)for(const r of be(i))c.add(r)}return[...c].sort((i,r)=>i.localeCompare(r))}function Zs(e){const{orgContext:t}=kn(),{data:o=[],isLoading:s}=Et(t);return{visible:b.useMemo(()=>o.filter(c=>!Sn(c)&&(!c.organization_slug||c.organization_slug===e)),[o,e]),isTypesLoading:s}}function oe({to:e,params:t,search:o,label:s}){return n.jsx(Ie,{to:e,params:t,search:o,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(Nn,{className:"h-3.5 w-3.5"})})}const Ge=["produced","analyzed"],_e=e=>e==="produced"?"Produced by":"Analyzed by";function Xs({enabled:e,...t}){const o=Js(t,e);if(!e)return{fields:[],chips:[]};const s=eo(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Js({ownerSlug:e,filters:t,onFiltersChange:o},s){const a=Tt({queryKey:["automations-list","activity",e],queryFn:async()=>{const r=await Promise.all(["active","archived"].map(l=>At("manage_automations",{action:"list",status:l,include_details:!1},{slug:e})));return[...new Map(r.flatMap(l=>l.automations).map(l=>[Number(l.automation_id),l])).values()].sort((l,m)=>l.name.localeCompare(m.name))},enabled:s&&!!e,staleTime:3e4}),c=a.data??[],f=r=>r==="produced"?t.producedByAutomationId:t.automationId,u=r=>c.find(l=>Number(l.automation_id)===r)?.name??`#${r}`,d=Ge.flatMap(r=>{const l=f(r);return l==null?[]:[{id:`automation-${r}`,field:"automation",label:_e(r),value:u(l),onRemove:()=>o(r==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),i={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:r=>n.jsxs(n.Fragment,{children:[Ge.map(l=>{const m=f(l),h=c.map(g=>({id:Number(g.automation_id),label:`${g.name}${g.status==="archived"?" (archived)":""}`}));m!=null&&!h.some(g=>g.id===m)&&h.unshift({id:m,label:`Automation #${m} (selected)`});const y=g=>{o(l==="produced"?{producedByAutomationId:g}:{automationId:g}),r()};return n.jsx(Ft,{heading:_e(l),children:h.map(g=>n.jsxs(A,{"aria-label":g.label,value:`${l} ${g.label} ${g.id}`,onSelect:()=>y(g.id),className:"group",children:[n.jsx(K,{selected:m===g.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:g.label}),n.jsx(oe,{...zs(e,String(g.id)),label:g.label})]},g.id))},l)}),a.isError?n.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:n.jsx(Cn,{className:"h-4 w-4"}),editor:i}}}function eo(e){const{filters:t,onFiltersChange:o}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(c=>`#${c}`).join(", "),onRemove:()=>o({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.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:(c,f)=>Ge.map(u=>n.jsx(to,{...e,mode:u,query:f,close:c},u))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(_n,{className:"h-4 w-4"}),editor:a}}}function to({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:a,close:c}){const f=s==="produced"?t.producedByAutomationId:t.automationId,u=In({workspace:!0},{automationIds:f==null?void 0:[f],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),d=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],i=u.data?.pages.flatMap(h=>h.runs)??[],r=[...new Map(i.map(h=>[h.id,{id:h.id,label:`Run #${h.id} · ${h.feed_display_name??h.operation_key??h.run_type} · ${h.status}`}])).values()];for(const h of d)r.some(y=>y.id===h)||r.unshift({id:h,label:`Run #${h} (selected)`});const l=h=>{if(s==="produced"){const y=d.includes(h)?d.filter(g=>g!==h):[...d,h];o({runIds:y.length?y:null})}else o({runId:h}),c()},m=/^\d+$/.test(a.trim())?Number(a.trim()):0;return n.jsxs(Ft,{heading:_e(s),children:[r.map(h=>n.jsxs(A,{value:`${s} ${h.label}`,onSelect:()=>l(h.id),children:[n.jsx(K,{selected:d.includes(h.id)}),n.jsx("span",{className:"truncate",children:h.label})]},h.id)),Number.isSafeInteger(m)&&m>0&&!r.some(h=>h.id===m)?n.jsxs(A,{value:`${s} ${m}`,onSelect:()=>l(m),children:[_e(s)," run #",m]}):null,u.isLoading?n.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?n.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!r.length?n.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?n.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const We="Scope",Pe="Source",H="h-4 w-4";function re(){return ce().search??{}}function Kt(e){const{pathname:t}=ce(),{_splat:o}=Fn({strict:!1}),s=!!(o&&!On(o.split("/")[0])&&!t.startsWith(`/${e}/events/`));return{pathname:t,embedded:s,recordPath:s||t.startsWith(`/${e}/events/`)?o:void 0}}function Gt(e){const t=re(),{recordPath:o,pathname:s,embedded:a}=Kt(e);return c=>{const f=ae(e,t,c,o);return a?{to:s,search:f.search}:f}}const bt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function no({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const a=re(),{recordPath:c,embedded:f}=Kt(e),u=c?c.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,i=u??(d?Tn(d):void 0),r=An(a),l=En(a),m=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,h=so(e,i,!f),y=oo(e,i,c,f),g=ao(e,r,!t),N=Xs({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),j=io(e,l,m);return[h,y,g,N,j].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function so(e,t,o){const s=z(),a=re(),{visible:c}=Zs(e);if(!o)return{fields:[],chips:[]};const f=c.find(d=>d.slug===t),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>n.jsxs(n.Fragment,{children:[c.map(i=>n.jsxs(A,{onSelect:()=>{s(ae(e,a,{entity:void 0,create:void 0,type:i.slug})),d()},className:"group gap-2",children:[n.jsx(K,{selected:i.slug===t}),n.jsx(Un,{icon:i.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),typeof i.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.entity_count}):null,n.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:i.slug},label:i.name})]},i.id)),n.jsxs(A,{onSelect:()=>{s(Vn(e)),d()},className:"text-muted-foreground",children:[n.jsx(Mt,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:We,icon:n.jsx(Rn,{className:H}),editor:u}],chips:t?[{id:"type",label:"Entity type",op:"is",value:f?.name??t,onRemove:()=>void s(ae(e,a,{type:void 0}))}]:[]}}function oo(e,t,o,s){const a=z(),c=re(),[f,u]=b.useState(""),[d,i]=b.useState(0),r=Ot(f,250),l={slug:e},{data:m,isLoading:h,isError:y,refetch:g}=wn(t??"",l,{search:r,offset:d,limit:30,enabled:!s&&!!t}),{data:N}=Mn(o?`/${e}/${o}`:"",l),j=o?N?.entity:void 0,x=j?.name??(o?o.split("/").at(-1):void 0);if(s)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!t)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:h?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:R=>{u(R),i(0)},items:R=>n.jsxs(n.Fragment,{children:[y?n.jsx(A,{onSelect:()=>void g(),children:"Could not load entities. Retry"}):m?.entities.map(I=>n.jsxs(A,{value:I.slug,onSelect:()=>{const L=Qn(Wn([...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(e,c,{type:t},L)),R()},children:[n.jsx(K,{selected:j?.slug===I.slug}),I.name]},I.slug)),d>0&&n.jsx(A,{onSelect:()=>i(Math.max(0,d-30)),children:"Previous entities"}),m?.metadata.has_more&&n.jsx(A,{disabled:h,onSelect:()=>i(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:We,icon:n.jsx(Ln,{className:H}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(e,c,{type:t}))}]:[]}}function ao(e,t,o){const s=z(),a=Gt(e),{data:c=[]}=Pn(),f=b.useMemo(()=>[...c].sort((i,r)=>i.name.localeCompare(r.name)),[c]);if(!o)return{fields:[],chips:[]};const u=f.find(i=>i.agentId===t),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:i=>f.map(r=>n.jsxs(A,{onSelect:()=>{s(a({agent:r.agentId,schedule:void 0})),i()},className:"gap-2",children:[n.jsx(K,{selected:r.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:r.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name})]},r.agentId))};return{fields:[{key:"agent",label:"Agent",group:We,icon:n.jsx($n,{className:H}),editor:d}],chips:t?[{id:"agent",label:"Agent",op:"is",value:u?.name??t,onRemove:()=>void s(a({agent:void 0,schedule:void 0}))}]:[]}}function io(e,t,o){const s=z(),a=Gt(e),{groups:c}=Ks(),f=re(),u=Ce({platforms:String(f.platforms??f.platform??"")}).platforms??[],d=b.useMemo(()=>bt(t),[t]),i=b.useMemo(()=>bt(o),[o]),r=u.length===1?u[0]:Dn(c,d),l=c.find(T=>T.connector_key===r),m=d.size===1?Number([...d][0]):void 0,h=Bn(m),{org:y}=Rt(),g=wt(y?.id,{feedIds:[...i].map(Number),enabled:m==null&&i.size>0}),N=m==null?g:h,j=N.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:T=>n.jsxs(n.Fragment,{children:[c.map(S=>{const _=S.connector_name??S.connector_key;return n.jsxs(A,{disabled:S.connections.length===0,onSelect:()=>{s(a({...x,platforms:S.connector_key})),T()},className:"group gap-2",children:[n.jsx(K,{selected:S.connector_key===l?.connector_key}),n.jsx(Hn,{plain:!0,name:_,faviconDomain:S.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:_}),S.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:S.connection_count}):null,n.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:S.connector_key},label:_})]},S.connector_key)}),n.jsx(A,{asChild:!0,onSelect:T,className:"text-muted-foreground",children:n.jsxs(Ie,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(Mt,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},R=[{key:"connector",label:"Connector",group:Pe,icon:n.jsx(zn,{className:H}),editor:F}],I=[],L=l?.connector_name??l?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(L&&I.push({id:"connector",label:"Connector",op:"is",value:L,onRemove:()=>void s(a(x))}),l){R.push({key:"connection",label:"Connection",group:Pe,icon:n.jsx(Kn,{className:H}),editor:P(l)});const T=d.size===1?l.connections.find(S=>d.has(String(S.id))):void 0;T&&I.push({id:"connection",label:"Connection",op:"is",value:xt({display_name:T.display_name,connector_name:l.connector_name,connector_key:l.connector_key}),onRemove:()=>void s(a({...x,platforms:l.connector_key}))})}if((m||o)&&R.push({key:"feed",label:"Feed",group:Pe,icon:n.jsx(Gn,{className:H}),editor:G()}),i.size>0){const T=i.size===1?j.find(S=>i.has(String(S.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:T?je(T):`#${o}`,onRemove:()=>void s(a({...m!=null?{connection_ids:String(m)}:{},feed_ids:void 0}))})}return{fields:R,chips:I};function P(T){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:S=>T.connections.map(_=>{const $=xt({display_name:_.display_name,connector_name:T.connector_name,connector_key:T.connector_key});return n.jsxs(A,{onSelect:()=>{s(a({connection_ids:String(_.id),feed_ids:void 0})),S()},className:"group gap-2",children:[n.jsx(K,{selected:d.has(String(_.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:$}),_.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:_.feed_count}):null,n.jsx(oe,{...Qs(e,{id:_.id,connector_key:T.connector_key}),label:$})]},_.id)})}}function G(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:N.isLoading?"Loading feeds...":"No feeds",items:T=>j.map(S=>n.jsxs(A,{"aria-label":je(S),onSelect:()=>{s(a({...m!=null?{connection_ids:String(m)}:{},feed_ids:String(S.id)})),T()},className:"group gap-2",children:[n.jsx(K,{selected:i.has(String(S.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:je(S)}),n.jsx(oe,{...Vs(e,S),label:je(S)})]},S.id))}}}function je(e){return e.display_name?.trim()||e.feed_key}const co=["notification"],ro=["note","summary","decision","observation","fact","change","preference","identity"],lo=[...co,...ro],jt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],$e={value:"notifications",label:"Notifications first"},kt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],St=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ke=0,Se=100,te="Event",ne="h-4 w-4";function se(e){const t=e.replace(/[_-]+/g," ").trim();return t.length>0?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e}function uo(e,t,o){const s=e.semanticTypes??[],a=o.length>0?o:lo,c=[...new Set([...a,...s])].sort((l,m)=>se(l).localeCompare(se(m))).map(l=>({value:l,label:se(l)})),f=e.engagementRange??[ke,Se],u=e.reviewStatus,d=e.interactionStatus,i=[{key:"date",label:"Date",group:te,icon:n.jsx(os,{className:ne}),editor:Ts({value:e.dateRange??void 0,onApply:l=>t({dateRange:l})})},{key:"kind",label:"Event kind",group:te,icon:n.jsx(as,{className:ne}),editor:Ne({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:c,selected:s,multiple:!0,onSelect:l=>{const m=s.includes(l)?s.filter(h=>h!==l):[...s,l];t({semanticTypes:m.length>0?m:void 0})}})},{key:"approval",label:"Approval",group:te,icon:n.jsx(is,{className:ne}),editor:Ne({searchPlaceholder:"Search statuses...",options:[...St],selected:d?[d]:[],onSelect:l=>t({interactionStatus:l})})},{key:"review",label:"Reviewed by",group:te,icon:n.jsx(cs,{className:ne}),editor:Ne({searchPlaceholder:"Search reviewers...",options:[...kt],selected:u&&u!=="all"?[u]:[],onSelect:l=>t({reviewStatus:l})})},{key:"score",label:"Engagement score",group:te,icon:n.jsx(rs,{className:ne}),editor:As({value:f,min:ke,max:Se,onApply:l=>t({engagementRange:l})})}],r=[];return e.dateRange&&r.push({id:"date",label:"Date",op:"is",value:Es(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&r.push({id:"kind",label:"Event kind",op:s.length>1?"is any of":"is",value:s.length<=2?s.map(se).join(", "):`${s.length} kinds`,title:s.map(se).join(", "),onRemove:()=>t({semanticTypes:void 0})}),d&&r.push({id:"approval",label:"Approval",op:"is",value:St.find(l=>l.value===d)?.label??d,onRemove:()=>t({interactionStatus:null})}),u&&u!=="all"&&r.push({id:"review",label:"Reviewed by",op:"is",value:kt.find(l=>l.value===u)?.label??u,onRemove:()=>t({reviewStatus:void 0})}),(f[0]!==ke||f[1]!==Se)&&r.push({id:"score",label:"Engagement score",value:Fs(f,ke,Se),onRemove:()=>t({engagementRange:void 0})}),{fields:i,chips:r}}function Ut({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:a,scope:c,extraFields:f=[],drillChips:u=[],total:d,isListLoading:i=!1,isTotalLoading:r=!1,hasCursorInUrl:l=!1,onGoToLatest:m,notificationsFirst:h,sourceRead:y=!1,filterTrailing:g,filterActions:N,onClearFilters:j}){const x=s.trim().length>0,F=y?{fields:[],chips:[]}:uo(e,t,o),R=[...c?.fields??[],...F.fields,...f],I=[...c?.chips??[],...u,...F.chips],L=I.length>0||x,P=h===void 0?jt:[$e,...jt],G=h?$e.value:`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,T=P.find(_=>_.value===G)?.label??"Newest first",S=i||r?n.jsx(Lt,{className:"h-4 w-20"}):d==null?null:L?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[!y&&n.jsxs("div",{className:"relative w-full min-w-48 flex-1 sm:max-w-xs",children:[n.jsx(qn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Yn,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:s,onChange:_=>a(_.target.value),className:Te("pl-9",x&&"pr-8")}),x&&n.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:n.jsx(Zn,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!i&&l&&m&&n.jsxs(ie,{variant:"ghost",size:"sm",className:"h-8 gap-1",onClick:m,children:[n.jsx(Xn,{className:"h-3.5 w-3.5"}),"Back to latest"]}),!y&&n.jsxs(Jn,{value:G,onValueChange:_=>{if(_===$e.value){t({sortBy:void 0,sortOrder:void 0});return}const[$,U]=_.split("-");t({sortBy:$,sortOrder:U})},children:[n.jsx(es,{"aria-label":"Sort",className:"h-9 w-[200px] px-2.5",children:n.jsx(ts,{children:n.jsxs("span",{className:"truncate",children:[n.jsx("span",{className:"text-muted-foreground",children:"Sort: "}),T]})})}),n.jsx(ns,{children:P.map(_=>n.jsx(ss,{value:_.value,children:_.label},_.value))})]})]})]}),n.jsx(Is,{label:"Event filters",fields:R,chips:I,meta:S,actions:N,trailing:g,onClearAll:j,hasClearableState:x})]})}function Vt({ownerSlug:e,...t}){const o=no({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Ut,{...t,scope:o})}const Ue=3600*1e3,Nt=24*Ue;function Ct(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function _t(e){return e.toISOString().split("T")[0]}function Ve(e){return e.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(e){const o=e[e.length-1].date.getTime()-e[0].date.getTime()>180*Nt,s=new Map;for(const a of e){const c=new Date(a.date);o&&c.setUTCDate(c.getUTCDate()-c.getUTCDay()),s.set(c.getTime(),(s.get(c.getTime())??0)+a.count)}return[...s.entries()].sort(([a],[c])=>a-c).map(([a,c])=>{const f=new Date(a);return{start:f,end:new Date(a+(o?7:1)*Nt),count:c,label:`${f.getUTCMonth()+1}/${f.getUTCDate()}`,tooltip:o?`Week of ${Ve(f)}`:Ve(f)}})}function fo(e){const t=f=>{const u=new Date(f);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const f of e)o.set(t(f),(o.get(t(f))??0)+1);const s=Math.min(...o.keys()),a=Math.max(...o.keys()),c=[];for(let f=s;f<=a;f+=Ue){const u=new Date(f);c.push({start:u,end:new Date(f+Ue),count:o.get(f)??0,label:ht(u,"HH:mm"),tooltip:ht(u,"MMM d, HH:mm")})}return c}function po({entityId:e,organizationId:t,ownerSlug:o,eventTimes:s,selectedRange:a,onSelectRange:c}){const{data:f,isLoading:u,error:d}=ls(t,{entityId:e},{slug:o}),i=b.useMemo(()=>(f??[]).map(y=>{const g=Ct(y.date);return g?{date:g,count:y.count}:null}).filter(y=>y!==null).sort((y,g)=>y.date.getTime()-g.date.getTime()),[f]),r=b.useMemo(()=>{if(i.length===0)return[];if(i.length>1)return mo(i);const[y]=i,g=_t(y.date),N=(s??[]).map(Ct).filter(j=>j!==null&&_t(j)===g);return N.length===y.count?fo(N):[]},[i,s]),l=b.useCallback(y=>{const g=r[y.dataIndex];g&&c&&c(g.start,g.end)},[r,c]),m=b.useCallback(y=>{if(c&&y.startValue!==void 0&&y.endValue!==void 0){const g=new Date(y.startValue),N=new Date(y.endValue);c(g,N)}},[c]),h=b.useMemo(()=>{if(r.length<2)return null;let y;if(a){const[g,N]=a,j=r.filter(x=>x.start<N&&x.end>g);j.length>0&&(y=[[{xAxis:j[0].label},{xAxis:j[j.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:g=>{const N=g[0];return`${r[N.dataIndex]?.tooltip}: ${N.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:r.map(g=>g.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 Ls(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:r.map(g=>g.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:y?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:y}:void 0}]}},[r,a]);if(u||d)return n.jsx("div",{className:Te(Pt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?n.jsx($s,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(i.length===0)return null;if(!h){const[y]=i;return n.jsxs("p",{className:"text-xs text-muted-foreground",children:[y.count===1?"1 event":`All ${y.count} events`," on"," ",Ve(y.date),"."]})}return n.jsx(ho,{option:h,onClick:l,onDataZoom:m})}function ho({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:a}=Ps({onClick:t,onDataZoom:o});return b.useEffect(()=>{a(e,!0)},[e,a]),n.jsx("div",{"data-testid":"events-timeline",className:Te(Pt,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}const It="change";function vo({kinds:e,onFiltersChange:t}){const o=!e?.length,s=e?.length===1&&e[0]===It,a=c=>Te("h-7 px-2.5 text-xs",c?"bg-muted text-foreground":"text-muted-foreground");return n.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[n.jsx(ie,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>t({semanticTypes:void 0}),children:"All"}),n.jsx(ie,{type:"button",variant:"ghost",size:"sm",className:a(s),"aria-pressed":s,onClick:()=>t({semanticTypes:[It]}),children:"Changes"})]})}function yo({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,notificationsFirst:c,emptyState:f,changesShortcut:u=!1}){const{isAuthenticated:d,isReady:i}=ds(),{isMember:r,isLoading:l}=Rt(),m=i&&d&&r,h=i&&(!d||!l&&!r),y=z(),g=ce(),N=us(),j=c!=null,{filters:x,updateFilters:F,clearFilters:R}=Bt({parse:Ce,serialize:Be,filterKeys:Dt,replace:!1,merge:b.useCallback((p,v)=>{const k=$t(p,v);return j&&p.sortBy==null&&p.sortOrder==null&&!("sortBy"in v)&&!("sortOrder"in v)&&(k.sortBy=void 0,k.sortOrder=void 0),k},[j])}),I=j&&x.sortBy==null&&x.sortOrder==null,[L,P]=b.useState(x.searchQuery||""),[G,T]=b.useState(De(x)||s&&(o!=null||!!a?.length)),S=L.trim(),_=S.length>=3?S:void 0,$=Ot(_,1e3),U=b.useRef(!1);b.useEffect(()=>N.history.subscribe(({location:p,action:v})=>{const k=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&U.current&&(k===(x.searchQuery??"")||k===(_??""))||(U.current=!1,P(k))}),[N.history,_,x.searchQuery]);const C=b.useMemo(()=>vt({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),w=F;b.useEffect(()=>{U.current&&(x.searchQuery||void 0)!==$&&F({searchQuery:$})},[$,F,x.searchQuery]);const ze=()=>{U.current=!1,P(""),s&&t?y({...Ke(t,g.search??{}),...o!==void 0&&!g.pathname.startsWith(`/${t}/events/`)?{to:g.pathname}:{}}):R()},le=De(vt(x)),He=o===void 0,{data:Qt=[]}=ms(i&&m?e:null),{data:Wt=[]}=fs(h?t:null),qe=m?Qt:Wt,{data:Ye=[]}=Et(m&&e?{organizationId:e}:void 0),de=Gs(),ue=C.connectionIds,Ae=(ue?.length??0)>0,{data:Ze=[]}=ps(i&&m?e??"":"",{connectionIds:ue??void 0,enabled:!de&&i&&m&&Ae}),Xe=C.feedIds,Ee=(Xe?.length??0)>0,{data:Je=[]}=wt(i&&m?e:null,{feedIds:Xe??void 0,enabled:i&&m&&Ee}),et=b.useMemo(()=>de?de.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}))):Ze,[Ze,de]),Fe=b.useMemo(()=>{const p=new Set(ue??[]);return[...new Set([...C.platforms??[],...et.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[ue,et,C.platforms]),Oe=b.useMemo(()=>Je.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[Je]),zt=b.useMemo(()=>Ae&&Fe.length===0||Ee&&Oe.length===0?[]:Ys({connectors:qe,entityTypes:Ye,selectedPlatforms:Fe,selectedFeeds:Oe,selectedEntityTypes:C.entityTypes}),[qe,C.entityTypes,Ae,Ee,Fe,Oe,Ye]),O=C.clientIds,me=(O?.length??0)>0,{data:tt=[]}=Rs(null,{enabled:i&&m&&me}),fe=b.useMemo(()=>{if(!O)return[];const p=new Set(O);return ws(tt).filter(v=>v.clientIds.some(k=>p.has(k)))},[O,tt]),nt=b.useMemo(()=>{if(!me||!O)return null;const p=fe.map(v=>v.title);return p.length>0?p.join(", "):O.length>1?`${O.length} client registrations`:"Client registration"},[fe,O,me]),pe=fe.length===1?fe[0]:null,Ht=t&&pe?Ws(t,pe.clientId):void 0,he=C.mcpActivityId??null,{data:st=[]}=hs({enabled:i&&m&&me&&!!he,clientIds:O??[],limit:100}),ot=b.useMemo(()=>{if(!he)return null;const p=st.find(k=>k.activityId===he);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[he,st]),q=C.agentId,Y=C.schedule,{data:at=[]}=Us(q??void 0),it=b.useMemo(()=>!Y||!q?null:at.find(v=>v.id===Y)?.description?.trim()||"Scheduled task",[q,Y,at]),{data:qt}=vs(i&&m?e:null,o),{data:Yt}=ys(h&&!He?t:null,o),ct=m?qt:Yt,Re=b.useMemo(()=>{const p=new Map;for(const v of ct||[]){const k=v.automation_name??"__global__";p.has(k)||p.set(k,{automationName:v.automation_name??null,classifiers:[]});const E=p.get(k),D=v.attribute_values||{},M=Object.keys(D);let ge=null;const Z={};for(const[X,W]of Object.entries(D))if(W.parent)for(const[Le,J]of Object.entries(W.parent))ge=Le,Z[J]||(Z[J]=[]),Z[J].push(X);const B=E.classifiers.find(X=>X.slug===v.slug);if(B){const X=new Set([...B.values,...M]);B.values=[...X];for(const[W,Le]of Object.entries(Z)){B.valuesByParentValue[W]||(B.valuesByParentValue[W]=[]);const J=new Set([...B.valuesByParentValue[W],...Le]);B.valuesByParentValue[W]=[...J]}ge&&(B.parentSlug=ge)}else E.classifiers.push({slug:v.slug,name:v.name,values:M,parentSlug:ge,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((k,E)=>k.parentSlug===null&&E.parentSlug!==null?-1:k.parentSlug!==null&&E.parentSlug===null?1:0);return[...p.values()]},[ct]),Zt=gs(i&&m?e:null,o,C,t),Xt=xs(h?t:null,o,C),Jt=h?Xt:Zt,{data:V,isLoading:en,error:tn}=Jt,nn=b.useMemo(()=>V?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[V]),rt=V?.pages[0],lt=(rt?.content.length??0)>0,sn=bs(i&&m?e:null,o,C,t),on=js(h?t:null,o,C),we=h?on:sn,an=we.data?.total??void 0,cn=we.data?.classification_stats,rn=we.isLoading,ln=!!(C.beforeOccurredAt||C.afterOccurredAt),dt=ks(C),ut=V?.pages[V.pages.length-1],Q=ut?.content[ut.content.length-1];b.useEffect(()=>{!dt||!Q||V?.pages.length===1||x.beforeOccurredAt===Q.occurred_at&&x.beforeId===Q.id||F({beforeOccurredAt:Q.occurred_at,beforeId:Q.id},{replace:!0})},[Q?.id,dt,F,V?.pages.length,Q,x.beforeOccurredAt,x.beforeId]);const dn=b.useCallback(()=>{w({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[w]),un=(p,v)=>{w({dateRange:[p,v]})},mt=(p,v)=>{const k={...C.classificationFilters||{}};if(v.length>0)k[p]=v;else{delete k[p];for(const E of Re)for(const D of E.classifiers)D.parentSlug===p&&delete k[D.slug]}w({classificationFilters:k})},mn=(p,v)=>{const k=C.classificationFilters?.[p]||[];mt(p,k.includes(v)?k.filter(E=>E!==v):[...k,v])},fn=p=>mt(p,[]);if(tn)return n.jsx(Ss,{label:"knowledge"});const Me=!i||d&&l||m&&!e||en,ve={fields:[],chips:[]};for(const p of Re)for(const v of p.classifiers){const k=C.classificationFilters?.[v.slug]??[],E=v.parentSlug?C.classificationFilters?.[v.parentSlug]??[]:void 0,D=E?[...new Set(E.flatMap(M=>v.valuesByParentValue[M]??[]))]:v.values;D.length>0&&ve.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:n.jsx(Ns,{className:"h-4 w-4"}),editor:Ne({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:D.map(M=>({value:M,label:M,count:cn?.[v.slug]?.[M]})),selected:k,multiple:!0,onSelect:M=>mn(v.slug,M)})})}for(const[p,v]of Object.entries(C.classificationFilters??{})){if(v.length===0)continue;const k=Re.flatMap(E=>E.classifiers).find(E=>E.slug===p);ve.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:k?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>fn(p)})}const pn=[C.contentIds?.length?xe({id:"contentIds",label:C.contentIds.length>1?"Events":"Event",value:`#${C.contentIds.join(", #")}`,onRemove:()=>w({contentIds:void 0})}):null,ot?xe({id:"mcpActivityId",label:"Conversation",value:ot,onRemove:()=>w({mcpActivityId:void 0})}):null,nt?xe({id:"clientIds",label:"Connected app",value:nt,sourceLink:Ht,details:O&&O.length>0?n.jsx(qs,{ownerSlug:t,clientIds:O,linkedUser:pe?.linkedUser,linkedUserEntitySlug:pe?.linkedUserEntitySlug}):void 0,onRemove:()=>w({clientIds:void 0})}):null,it?xe({id:"schedule",label:"Schedule",value:it,sourceLink:t&&q&&Y?Hs(t,q,Y):void 0,onRemove:()=>w({schedule:void 0,runIds:void 0})}):null,...ve.chips].filter(p=>p!=null),hn=!!(m&&o&&e),ye=c&&I&&!le?c:void 0,ft={filterActions:u||ye?.filterActions?n.jsxs(n.Fragment,{children:[u?n.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:w}):null,ye?.filterActions]}):void 0,filterTrailing:hn?n.jsxs(ie,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":G,onClick:()=>T(p=>!p),children:[n.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:ze,notificationsFirst:j?I:void 0,filters:C,onFiltersChange:w,eventKinds:zt,searchQuery:L,onSearchChange:p=>{U.current=!0,P(p)},extraFields:ve.fields,drillChips:pn,total:an,isListLoading:Me,isTotalLoading:rn,hasCursorInUrl:ln&<,onGoToLatest:dn},vn=!Me&&!!rt&&!lt&&!le,yn=d?m?"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",pt=!!(m&&t);return n.jsx(Cs,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(Vt,{...ft,ownerSlug:t}):n.jsx(Ut,{...ft})}),G&&m&&o&&e&&n.jsx(po,{entityId:o,organizationId:e,ownerSlug:t||"",eventTimes:nn,selectedRange:C.dateRange||void 0,onSelectRange:un}),ye?.pinned,Me?n.jsx("div",{className:"space-y-4",children:["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(p=>n.jsx(Lt,{className:"h-32 rounded-lg"},p))}):vn?f??n.jsx(yt,{icon:gt,title:"No activity yet",description:yn,actionLabel:pt?"Add a connector":void 0,onAction:pt&&t?()=>void y({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(Ms,{onFiltersChange:w,organizationId:e,ownerSlug:t,entityId:o,filters:C,showEntityLinks:He,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:ye?.hiddenApprovalRunIds,emptyState:n.jsx(yt,{icon:gt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:le?"Clear filters":void 0,onAction:le?ze:void 0})})]})})}function go({record:e,ownerSlug:t}){const o=ce(),s=z(),{filters:a,updateFilters:c}=Bt({parse:Ce,serialize:Be,filterKeys:Dt,replace:!1,merge:$t}),f=De({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{s({...Ke(t,o.search??{}),...o.pathname.startsWith(`/${t}/events/`)?{}:{to:o.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(Vt,{ownerSlug:t,sourceRead:!0,filters:a,onFiltersChange:c,searchQuery:a.searchQuery??"",onSearchChange:d=>c({searchQuery:d}),onClearFilters:u}),n.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."}),f?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx(ie,{variant:"outline",size:"sm",onClick:()=>{const d=Be({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),i={...Ke(t,o.search??{}).search,...d};s({to:o.pathname,search:i})},children:"Clear unsupported filters"})]}):n.jsx(Os,{record:e,orgContext:{slug:t},filters:a})]})}function Eo({entity:e,organizationId:t,ownerSlug:o}){const s=e.is_derived?n.jsx(go,{ownerSlug:o,record:{type:e.entity_type,key:e.slug}}):n.jsx(yo,{organizationId:t,ownerSlug:o,entityId:e.id,hideSourceFilter:!0,changesShortcut:!0});return n.jsx(Bs,{organizationId:t,children:e.entity_type==="$member"?n.jsx(Ds,{children:s}):s})}export{yo as E,Bs as M,Eo as R};
|
|
2
|
-
//# sourceMappingURL=record-activity-
|
|
1
|
+
import{au as gn,j as n,r as b,o as z,q as ce,cx as xn,ch as Tt,cy as At,L as Ie,cz as bn,cA as jn,n as kn,cB as Et,cC as Sn,b_ as Nn,cD as Cn,aj as _n,cE as Ft,cF as A,cG as In,bn as Tn,cH as An,cI as En,bo as Fn,cJ as On,cK as ae,ct as Rn,cL as Ot,cM as wn,ao as Mn,cN as Ln,a_ as Pn,bb as $n,ar as Ce,cO as Dn,cP as Bn,bh as Rt,ci as wt,cQ as Kn,cR as Gn,cS as Un,cT as Mt,cU as Vn,cs as Qn,cV as Wn,bf as zn,aW as Hn,S as Lt,cW as qn,I as Yn,Q as Te,X as Zn,B as ie,cX as Xn,bp as Jn,bq as es,br as ts,bs as ns,bt as ss,cY as os,cZ as as,bB as is,c_ as cs,c$ as rs,d0 as ls,af as Pt,d1 as ht,i as ds,d2 as us,d3 as $t,d4 as De,d5 as vt,cg as ms,d6 as fs,d7 as ps,d8 as hs,d9 as vs,da as ys,db as gs,dc as xs,dd as bs,de as js,df as ks,bM as Ss,dg as Ns,dh as Cs,aR as yt,di as gt,dj as Be,dk as Dt,dl as _s,dm as Ke}from"./index-9YuSRymd.js";import{S as K,F as Is,d as Ts,o as Ne,r as As,f as Es,a as Fs}from"./filter-editors-Bwhqj7lY.js";import{c as xt}from"./connection-label-BobuYiAG.js";import{S as Os}from"./source-record-panels-BdfOVPWn.js";import{u as Rs}from"./clients-BhNl1tVq.js";import{g as ws}from"./client-rows-BYbsXGy9.js";import{E as Ms}from"./events-feed-DO3IiJO2.js";import{L as Ls,u as Ps}from"./schema-value-normalization-CKdPjdPC.js";import{E as $s}from"./agent-loading-shells-B7v6Cffw.js";import{M as Ds}from"./member-scope-gate-DD4YBFn-.js";const Qe=b.createContext(null);function Bs({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:a}=gn(e);return n.jsx(Qe.Provider,{value:{groups:s,isLoading:!!t||a},children:o})}function Ks(){const e=b.useContext(Qe);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Gs(){return b.useContext(Qe)}function Bt(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:a=!0,replace:c=!0,merge:f}=e,u=z(),d=ce(),i=b.useMemo(()=>{const m=new URLSearchParams;for(const[h,y]of Object.entries(d.search||{}))y!=null&&m.set(h,typeof y=="object"&&!Array.isArray(y)?JSON.stringify(y):String(y));return t(m)},[d.search,t]),r=b.useCallback((m,h)=>{const y=f?f(i,m):{...i,...m},g=o(y),N={};for(const[j,x]of Object.entries(d.search||{}))x!=null&&(N[j]=x);for(const j of s)delete N[j];if(a)for(const j of Object.keys(N))j.startsWith("clf_")&&delete N[j];for(const[j,x]of Object.entries(g))x!==void 0&&(N[j]=x);u({to:d.pathname,search:N,replace:h?.replace??c})},[i,o,s,a,f,u,d,c]),l=b.useCallback(()=>{const m={};for(const[h,y]of Object.entries(d.search||{}))y!=null&&(s.includes(h)||a&&h.startsWith("clf_")||(m[h]=y));u({to:d.pathname,search:m,replace:c})},[u,d.pathname,d.search,s,a,c]);return{filters:i,updateFilters:r,clearFilters:l}}function Us(e){const{slug:t}=xn();return Tt({queryKey:["schedules",t,e],queryFn:async()=>((await At("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Vs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Qs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function Ws(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function zs(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Hs(e,t,o){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:o}}}function xe({id:e,label:t,value:o,sourceLink:s,details:a,onRemove:c}){return{id:e,label:t,op:"is",value:o,onRemove:c,editor:s||a?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(Ie,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:o}),n.jsx(bn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function qs({ownerSlug:e,clientIds:t,linkedUser:o,linkedUserEntitySlug:s}){const a=e&&s?jn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(c=>n.jsx("code",{className:"break-all text-foreground",children:c},c))]}),o?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?n.jsx(Ie,{to:a,className:"font-medium text-foreground hover:underline",children:o}):n.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function be(e,t,o){const s=new Set;for(const[a,c]of Object.entries(e.feeds_schema??{})){if(o&&!o.has(a))continue;const f=ee(ee(c)?.eventKinds);if(f)for(const[u,d]of Object.entries(f)){if(!t){s.add(u);continue}const i=ee(d)?.attributions;Array.isArray(i)&&i.some(r=>{const l=ee(ee(r)?.target);return typeof l?.entityType=="string"&&t.has(l.entityType)})&&s.add(u)}}return s}function Ys({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const c=new Set,f=new Set(o),u=new Set(a),d=new Map;for(const i of s){const r=d.get(i.connectorKey)??new Set;r.add(i.feedKey),d.set(i.connectorKey,r)}if(d.size>0)for(const i of e){const r=d.get(i.key);if(r)for(const l of be(i,void 0,r))c.add(l)}else if(f.size>0){for(const i of e)if(f.has(i.key))for(const r of be(i))c.add(r)}else if(u.size>0){for(const i of t)if(u.has(i.slug))for(const r of Object.keys(i.event_kinds??{}))c.add(r);for(const i of e)for(const r of be(i,u))c.add(r)}else{for(const i of t)for(const r of Object.keys(i.event_kinds??{}))c.add(r);for(const i of e)for(const r of be(i))c.add(r)}return[...c].sort((i,r)=>i.localeCompare(r))}function Zs(e){const{orgContext:t}=kn(),{data:o=[],isLoading:s}=Et(t);return{visible:b.useMemo(()=>o.filter(c=>!Sn(c)&&(!c.organization_slug||c.organization_slug===e)),[o,e]),isTypesLoading:s}}function oe({to:e,params:t,search:o,label:s}){return n.jsx(Ie,{to:e,params:t,search:o,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(Nn,{className:"h-3.5 w-3.5"})})}const Ge=["produced","analyzed"],_e=e=>e==="produced"?"Produced by":"Analyzed by";function Xs({enabled:e,...t}){const o=Js(t,e);if(!e)return{fields:[],chips:[]};const s=eo(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Js({ownerSlug:e,filters:t,onFiltersChange:o},s){const a=Tt({queryKey:["automations-list","activity",e],queryFn:async()=>{const r=await Promise.all(["active","archived"].map(l=>At("manage_automations",{action:"list",status:l,include_details:!1},{slug:e})));return[...new Map(r.flatMap(l=>l.automations).map(l=>[Number(l.automation_id),l])).values()].sort((l,m)=>l.name.localeCompare(m.name))},enabled:s&&!!e,staleTime:3e4}),c=a.data??[],f=r=>r==="produced"?t.producedByAutomationId:t.automationId,u=r=>c.find(l=>Number(l.automation_id)===r)?.name??`#${r}`,d=Ge.flatMap(r=>{const l=f(r);return l==null?[]:[{id:`automation-${r}`,field:"automation",label:_e(r),value:u(l),onRemove:()=>o(r==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),i={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:r=>n.jsxs(n.Fragment,{children:[Ge.map(l=>{const m=f(l),h=c.map(g=>({id:Number(g.automation_id),label:`${g.name}${g.status==="archived"?" (archived)":""}`}));m!=null&&!h.some(g=>g.id===m)&&h.unshift({id:m,label:`Automation #${m} (selected)`});const y=g=>{o(l==="produced"?{producedByAutomationId:g}:{automationId:g}),r()};return n.jsx(Ft,{heading:_e(l),children:h.map(g=>n.jsxs(A,{"aria-label":g.label,value:`${l} ${g.label} ${g.id}`,onSelect:()=>y(g.id),className:"group",children:[n.jsx(K,{selected:m===g.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:g.label}),n.jsx(oe,{...zs(e,String(g.id)),label:g.label})]},g.id))},l)}),a.isError?n.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:n.jsx(Cn,{className:"h-4 w-4"}),editor:i}}}function eo(e){const{filters:t,onFiltersChange:o}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(c=>`#${c}`).join(", "),onRemove:()=>o({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.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:(c,f)=>Ge.map(u=>n.jsx(to,{...e,mode:u,query:f,close:c},u))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(_n,{className:"h-4 w-4"}),editor:a}}}function to({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:a,close:c}){const f=s==="produced"?t.producedByAutomationId:t.automationId,u=In({workspace:!0},{automationIds:f==null?void 0:[f],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),d=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],i=u.data?.pages.flatMap(h=>h.runs)??[],r=[...new Map(i.map(h=>[h.id,{id:h.id,label:`Run #${h.id} · ${h.feed_display_name??h.operation_key??h.run_type} · ${h.status}`}])).values()];for(const h of d)r.some(y=>y.id===h)||r.unshift({id:h,label:`Run #${h} (selected)`});const l=h=>{if(s==="produced"){const y=d.includes(h)?d.filter(g=>g!==h):[...d,h];o({runIds:y.length?y:null})}else o({runId:h}),c()},m=/^\d+$/.test(a.trim())?Number(a.trim()):0;return n.jsxs(Ft,{heading:_e(s),children:[r.map(h=>n.jsxs(A,{value:`${s} ${h.label}`,onSelect:()=>l(h.id),children:[n.jsx(K,{selected:d.includes(h.id)}),n.jsx("span",{className:"truncate",children:h.label})]},h.id)),Number.isSafeInteger(m)&&m>0&&!r.some(h=>h.id===m)?n.jsxs(A,{value:`${s} ${m}`,onSelect:()=>l(m),children:[_e(s)," run #",m]}):null,u.isLoading?n.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?n.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!r.length?n.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?n.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const We="Scope",Pe="Source",H="h-4 w-4";function re(){return ce().search??{}}function Kt(e){const{pathname:t}=ce(),{_splat:o}=Fn({strict:!1}),s=!!(o&&!On(o.split("/")[0])&&!t.startsWith(`/${e}/events/`));return{pathname:t,embedded:s,recordPath:s||t.startsWith(`/${e}/events/`)?o:void 0}}function Gt(e){const t=re(),{recordPath:o,pathname:s,embedded:a}=Kt(e);return c=>{const f=ae(e,t,c,o);return a?{to:s,search:f.search}:f}}const bt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function no({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const a=re(),{recordPath:c,embedded:f}=Kt(e),u=c?c.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,i=u??(d?Tn(d):void 0),r=An(a),l=En(a),m=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,h=so(e,i,!f),y=oo(e,i,c,f),g=ao(e,r,!t),N=Xs({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),j=io(e,l,m);return[h,y,g,N,j].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function so(e,t,o){const s=z(),a=re(),{visible:c}=Zs(e);if(!o)return{fields:[],chips:[]};const f=c.find(d=>d.slug===t),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>n.jsxs(n.Fragment,{children:[c.map(i=>n.jsxs(A,{onSelect:()=>{s(ae(e,a,{entity:void 0,create:void 0,type:i.slug})),d()},className:"group gap-2",children:[n.jsx(K,{selected:i.slug===t}),n.jsx(Un,{icon:i.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),typeof i.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.entity_count}):null,n.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:i.slug},label:i.name})]},i.id)),n.jsxs(A,{onSelect:()=>{s(Vn(e)),d()},className:"text-muted-foreground",children:[n.jsx(Mt,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:We,icon:n.jsx(Rn,{className:H}),editor:u}],chips:t?[{id:"type",label:"Entity type",op:"is",value:f?.name??t,onRemove:()=>void s(ae(e,a,{type:void 0}))}]:[]}}function oo(e,t,o,s){const a=z(),c=re(),[f,u]=b.useState(""),[d,i]=b.useState(0),r=Ot(f,250),l={slug:e},{data:m,isLoading:h,isError:y,refetch:g}=wn(t??"",l,{search:r,offset:d,limit:30,enabled:!s&&!!t}),{data:N}=Mn(o?`/${e}/${o}`:"",l),j=o?N?.entity:void 0,x=j?.name??(o?o.split("/").at(-1):void 0);if(s)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!t)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:h?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:R=>{u(R),i(0)},items:R=>n.jsxs(n.Fragment,{children:[y?n.jsx(A,{onSelect:()=>void g(),children:"Could not load entities. Retry"}):m?.entities.map(I=>n.jsxs(A,{value:I.slug,onSelect:()=>{const L=Qn(Wn([...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(e,c,{type:t},L)),R()},children:[n.jsx(K,{selected:j?.slug===I.slug}),I.name]},I.slug)),d>0&&n.jsx(A,{onSelect:()=>i(Math.max(0,d-30)),children:"Previous entities"}),m?.metadata.has_more&&n.jsx(A,{disabled:h,onSelect:()=>i(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:We,icon:n.jsx(Ln,{className:H}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(e,c,{type:t}))}]:[]}}function ao(e,t,o){const s=z(),a=Gt(e),{data:c=[]}=Pn(),f=b.useMemo(()=>[...c].sort((i,r)=>i.name.localeCompare(r.name)),[c]);if(!o)return{fields:[],chips:[]};const u=f.find(i=>i.agentId===t),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:i=>f.map(r=>n.jsxs(A,{onSelect:()=>{s(a({agent:r.agentId,schedule:void 0})),i()},className:"gap-2",children:[n.jsx(K,{selected:r.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:r.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name})]},r.agentId))};return{fields:[{key:"agent",label:"Agent",group:We,icon:n.jsx($n,{className:H}),editor:d}],chips:t?[{id:"agent",label:"Agent",op:"is",value:u?.name??t,onRemove:()=>void s(a({agent:void 0,schedule:void 0}))}]:[]}}function io(e,t,o){const s=z(),a=Gt(e),{groups:c}=Ks(),f=re(),u=Ce({platforms:String(f.platforms??f.platform??"")}).platforms??[],d=b.useMemo(()=>bt(t),[t]),i=b.useMemo(()=>bt(o),[o]),r=u.length===1?u[0]:Dn(c,d),l=c.find(T=>T.connector_key===r),m=d.size===1?Number([...d][0]):void 0,h=Bn(m),{org:y}=Rt(),g=wt(y?.id,{feedIds:[...i].map(Number),enabled:m==null&&i.size>0}),N=m==null?g:h,j=N.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:T=>n.jsxs(n.Fragment,{children:[c.map(S=>{const _=S.connector_name??S.connector_key;return n.jsxs(A,{disabled:S.connections.length===0,onSelect:()=>{s(a({...x,platforms:S.connector_key})),T()},className:"group gap-2",children:[n.jsx(K,{selected:S.connector_key===l?.connector_key}),n.jsx(Hn,{plain:!0,name:_,faviconDomain:S.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:_}),S.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:S.connection_count}):null,n.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:S.connector_key},label:_})]},S.connector_key)}),n.jsx(A,{asChild:!0,onSelect:T,className:"text-muted-foreground",children:n.jsxs(Ie,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(Mt,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},R=[{key:"connector",label:"Connector",group:Pe,icon:n.jsx(zn,{className:H}),editor:F}],I=[],L=l?.connector_name??l?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(L&&I.push({id:"connector",label:"Connector",op:"is",value:L,onRemove:()=>void s(a(x))}),l){R.push({key:"connection",label:"Connection",group:Pe,icon:n.jsx(Kn,{className:H}),editor:P(l)});const T=d.size===1?l.connections.find(S=>d.has(String(S.id))):void 0;T&&I.push({id:"connection",label:"Connection",op:"is",value:xt({display_name:T.display_name,connector_name:l.connector_name,connector_key:l.connector_key}),onRemove:()=>void s(a({...x,platforms:l.connector_key}))})}if((m||o)&&R.push({key:"feed",label:"Feed",group:Pe,icon:n.jsx(Gn,{className:H}),editor:G()}),i.size>0){const T=i.size===1?j.find(S=>i.has(String(S.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:T?je(T):`#${o}`,onRemove:()=>void s(a({...m!=null?{connection_ids:String(m)}:{},feed_ids:void 0}))})}return{fields:R,chips:I};function P(T){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:S=>T.connections.map(_=>{const $=xt({display_name:_.display_name,connector_name:T.connector_name,connector_key:T.connector_key});return n.jsxs(A,{onSelect:()=>{s(a({connection_ids:String(_.id),feed_ids:void 0})),S()},className:"group gap-2",children:[n.jsx(K,{selected:d.has(String(_.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:$}),_.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:_.feed_count}):null,n.jsx(oe,{...Qs(e,{id:_.id,connector_key:T.connector_key}),label:$})]},_.id)})}}function G(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:N.isLoading?"Loading feeds...":"No feeds",items:T=>j.map(S=>n.jsxs(A,{"aria-label":je(S),onSelect:()=>{s(a({...m!=null?{connection_ids:String(m)}:{},feed_ids:String(S.id)})),T()},className:"group gap-2",children:[n.jsx(K,{selected:i.has(String(S.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:je(S)}),n.jsx(oe,{...Vs(e,S),label:je(S)})]},S.id))}}}function je(e){return e.display_name?.trim()||e.feed_key}const co=["notification"],ro=["note","summary","decision","observation","fact","change","preference","identity"],lo=[...co,...ro],jt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],$e={value:"notifications",label:"Notifications first"},kt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],St=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ke=0,Se=100,te="Event",ne="h-4 w-4";function se(e){const t=e.replace(/[_-]+/g," ").trim();return t.length>0?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e}function uo(e,t,o){const s=e.semanticTypes??[],a=o.length>0?o:lo,c=[...new Set([...a,...s])].sort((l,m)=>se(l).localeCompare(se(m))).map(l=>({value:l,label:se(l)})),f=e.engagementRange??[ke,Se],u=e.reviewStatus,d=e.interactionStatus,i=[{key:"date",label:"Date",group:te,icon:n.jsx(os,{className:ne}),editor:Ts({value:e.dateRange??void 0,onApply:l=>t({dateRange:l})})},{key:"kind",label:"Event kind",group:te,icon:n.jsx(as,{className:ne}),editor:Ne({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:c,selected:s,multiple:!0,onSelect:l=>{const m=s.includes(l)?s.filter(h=>h!==l):[...s,l];t({semanticTypes:m.length>0?m:void 0})}})},{key:"approval",label:"Approval",group:te,icon:n.jsx(is,{className:ne}),editor:Ne({searchPlaceholder:"Search statuses...",options:[...St],selected:d?[d]:[],onSelect:l=>t({interactionStatus:l})})},{key:"review",label:"Reviewed by",group:te,icon:n.jsx(cs,{className:ne}),editor:Ne({searchPlaceholder:"Search reviewers...",options:[...kt],selected:u&&u!=="all"?[u]:[],onSelect:l=>t({reviewStatus:l})})},{key:"score",label:"Engagement score",group:te,icon:n.jsx(rs,{className:ne}),editor:As({value:f,min:ke,max:Se,onApply:l=>t({engagementRange:l})})}],r=[];return e.dateRange&&r.push({id:"date",label:"Date",op:"is",value:Es(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&r.push({id:"kind",label:"Event kind",op:s.length>1?"is any of":"is",value:s.length<=2?s.map(se).join(", "):`${s.length} kinds`,title:s.map(se).join(", "),onRemove:()=>t({semanticTypes:void 0})}),d&&r.push({id:"approval",label:"Approval",op:"is",value:St.find(l=>l.value===d)?.label??d,onRemove:()=>t({interactionStatus:null})}),u&&u!=="all"&&r.push({id:"review",label:"Reviewed by",op:"is",value:kt.find(l=>l.value===u)?.label??u,onRemove:()=>t({reviewStatus:void 0})}),(f[0]!==ke||f[1]!==Se)&&r.push({id:"score",label:"Engagement score",value:Fs(f,ke,Se),onRemove:()=>t({engagementRange:void 0})}),{fields:i,chips:r}}function Ut({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:a,scope:c,extraFields:f=[],drillChips:u=[],total:d,isListLoading:i=!1,isTotalLoading:r=!1,hasCursorInUrl:l=!1,onGoToLatest:m,notificationsFirst:h,sourceRead:y=!1,filterTrailing:g,filterActions:N,onClearFilters:j}){const x=s.trim().length>0,F=y?{fields:[],chips:[]}:uo(e,t,o),R=[...c?.fields??[],...F.fields,...f],I=[...c?.chips??[],...u,...F.chips],L=I.length>0||x,P=h===void 0?jt:[$e,...jt],G=h?$e.value:`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,T=P.find(_=>_.value===G)?.label??"Newest first",S=i||r?n.jsx(Lt,{className:"h-4 w-20"}):d==null?null:L?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[!y&&n.jsxs("div",{className:"relative w-full min-w-48 flex-1 sm:max-w-xs",children:[n.jsx(qn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Yn,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:s,onChange:_=>a(_.target.value),className:Te("pl-9",x&&"pr-8")}),x&&n.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:n.jsx(Zn,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!i&&l&&m&&n.jsxs(ie,{variant:"ghost",size:"sm",className:"h-8 gap-1",onClick:m,children:[n.jsx(Xn,{className:"h-3.5 w-3.5"}),"Back to latest"]}),!y&&n.jsxs(Jn,{value:G,onValueChange:_=>{if(_===$e.value){t({sortBy:void 0,sortOrder:void 0});return}const[$,U]=_.split("-");t({sortBy:$,sortOrder:U})},children:[n.jsx(es,{"aria-label":"Sort",className:"h-9 w-[200px] px-2.5",children:n.jsx(ts,{children:n.jsxs("span",{className:"truncate",children:[n.jsx("span",{className:"text-muted-foreground",children:"Sort: "}),T]})})}),n.jsx(ns,{children:P.map(_=>n.jsx(ss,{value:_.value,children:_.label},_.value))})]})]})]}),n.jsx(Is,{label:"Event filters",fields:R,chips:I,meta:S,actions:N,trailing:g,onClearAll:j,hasClearableState:x})]})}function Vt({ownerSlug:e,...t}){const o=no({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Ut,{...t,scope:o})}const Ue=3600*1e3,Nt=24*Ue;function Ct(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function _t(e){return e.toISOString().split("T")[0]}function Ve(e){return e.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(e){const o=e[e.length-1].date.getTime()-e[0].date.getTime()>180*Nt,s=new Map;for(const a of e){const c=new Date(a.date);o&&c.setUTCDate(c.getUTCDate()-c.getUTCDay()),s.set(c.getTime(),(s.get(c.getTime())??0)+a.count)}return[...s.entries()].sort(([a],[c])=>a-c).map(([a,c])=>{const f=new Date(a);return{start:f,end:new Date(a+(o?7:1)*Nt),count:c,label:`${f.getUTCMonth()+1}/${f.getUTCDate()}`,tooltip:o?`Week of ${Ve(f)}`:Ve(f)}})}function fo(e){const t=f=>{const u=new Date(f);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const f of e)o.set(t(f),(o.get(t(f))??0)+1);const s=Math.min(...o.keys()),a=Math.max(...o.keys()),c=[];for(let f=s;f<=a;f+=Ue){const u=new Date(f);c.push({start:u,end:new Date(f+Ue),count:o.get(f)??0,label:ht(u,"HH:mm"),tooltip:ht(u,"MMM d, HH:mm")})}return c}function po({entityId:e,organizationId:t,ownerSlug:o,eventTimes:s,selectedRange:a,onSelectRange:c}){const{data:f,isLoading:u,error:d}=ls(t,{entityId:e},{slug:o}),i=b.useMemo(()=>(f??[]).map(y=>{const g=Ct(y.date);return g?{date:g,count:y.count}:null}).filter(y=>y!==null).sort((y,g)=>y.date.getTime()-g.date.getTime()),[f]),r=b.useMemo(()=>{if(i.length===0)return[];if(i.length>1)return mo(i);const[y]=i,g=_t(y.date),N=(s??[]).map(Ct).filter(j=>j!==null&&_t(j)===g);return N.length===y.count?fo(N):[]},[i,s]),l=b.useCallback(y=>{const g=r[y.dataIndex];g&&c&&c(g.start,g.end)},[r,c]),m=b.useCallback(y=>{if(c&&y.startValue!==void 0&&y.endValue!==void 0){const g=new Date(y.startValue),N=new Date(y.endValue);c(g,N)}},[c]),h=b.useMemo(()=>{if(r.length<2)return null;let y;if(a){const[g,N]=a,j=r.filter(x=>x.start<N&&x.end>g);j.length>0&&(y=[[{xAxis:j[0].label},{xAxis:j[j.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:g=>{const N=g[0];return`${r[N.dataIndex]?.tooltip}: ${N.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:r.map(g=>g.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 Ls(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:r.map(g=>g.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:y?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:y}:void 0}]}},[r,a]);if(u||d)return n.jsx("div",{className:Te(Pt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?n.jsx($s,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(i.length===0)return null;if(!h){const[y]=i;return n.jsxs("p",{className:"text-xs text-muted-foreground",children:[y.count===1?"1 event":`All ${y.count} events`," on"," ",Ve(y.date),"."]})}return n.jsx(ho,{option:h,onClick:l,onDataZoom:m})}function ho({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:a}=Ps({onClick:t,onDataZoom:o});return b.useEffect(()=>{a(e,!0)},[e,a]),n.jsx("div",{"data-testid":"events-timeline",className:Te(Pt,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}const It="change";function vo({kinds:e,onFiltersChange:t}){const o=!e?.length,s=e?.length===1&&e[0]===It,a=c=>Te("h-7 px-2.5 text-xs",c?"bg-muted text-foreground":"text-muted-foreground");return n.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[n.jsx(ie,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>t({semanticTypes:void 0}),children:"All"}),n.jsx(ie,{type:"button",variant:"ghost",size:"sm",className:a(s),"aria-pressed":s,onClick:()=>t({semanticTypes:[It]}),children:"Changes"})]})}function yo({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,notificationsFirst:c,emptyState:f,changesShortcut:u=!1}){const{isAuthenticated:d,isReady:i}=ds(),{isMember:r,isLoading:l}=Rt(),m=i&&d&&r,h=i&&(!d||!l&&!r),y=z(),g=ce(),N=us(),j=c!=null,{filters:x,updateFilters:F,clearFilters:R}=Bt({parse:Ce,serialize:Be,filterKeys:Dt,replace:!1,merge:b.useCallback((p,v)=>{const k=$t(p,v);return j&&p.sortBy==null&&p.sortOrder==null&&!("sortBy"in v)&&!("sortOrder"in v)&&(k.sortBy=void 0,k.sortOrder=void 0),k},[j])}),I=j&&x.sortBy==null&&x.sortOrder==null,[L,P]=b.useState(x.searchQuery||""),[G,T]=b.useState(De(x)||s&&(o!=null||!!a?.length)),S=L.trim(),_=S.length>=3?S:void 0,$=Ot(_,1e3),U=b.useRef(!1);b.useEffect(()=>N.history.subscribe(({location:p,action:v})=>{const k=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&U.current&&(k===(x.searchQuery??"")||k===(_??""))||(U.current=!1,P(k))}),[N.history,_,x.searchQuery]);const C=b.useMemo(()=>vt({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),w=F;b.useEffect(()=>{U.current&&(x.searchQuery||void 0)!==$&&F({searchQuery:$})},[$,F,x.searchQuery]);const ze=()=>{U.current=!1,P(""),s&&t?y({...Ke(t,g.search??{}),...o!==void 0&&!g.pathname.startsWith(`/${t}/events/`)?{to:g.pathname}:{}}):R()},le=De(vt(x)),He=o===void 0,{data:Qt=[]}=ms(i&&m?e:null),{data:Wt=[]}=fs(h?t:null),qe=m?Qt:Wt,{data:Ye=[]}=Et(m&&e?{organizationId:e}:void 0),de=Gs(),ue=C.connectionIds,Ae=(ue?.length??0)>0,{data:Ze=[]}=ps(i&&m?e??"":"",{connectionIds:ue??void 0,enabled:!de&&i&&m&&Ae}),Xe=C.feedIds,Ee=(Xe?.length??0)>0,{data:Je=[]}=wt(i&&m?e:null,{feedIds:Xe??void 0,enabled:i&&m&&Ee}),et=b.useMemo(()=>de?de.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}))):Ze,[Ze,de]),Fe=b.useMemo(()=>{const p=new Set(ue??[]);return[...new Set([...C.platforms??[],...et.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[ue,et,C.platforms]),Oe=b.useMemo(()=>Je.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[Je]),zt=b.useMemo(()=>Ae&&Fe.length===0||Ee&&Oe.length===0?[]:Ys({connectors:qe,entityTypes:Ye,selectedPlatforms:Fe,selectedFeeds:Oe,selectedEntityTypes:C.entityTypes}),[qe,C.entityTypes,Ae,Ee,Fe,Oe,Ye]),O=C.clientIds,me=(O?.length??0)>0,{data:tt=[]}=Rs(null,{enabled:i&&m&&me}),fe=b.useMemo(()=>{if(!O)return[];const p=new Set(O);return ws(tt).filter(v=>v.clientIds.some(k=>p.has(k)))},[O,tt]),nt=b.useMemo(()=>{if(!me||!O)return null;const p=fe.map(v=>v.title);return p.length>0?p.join(", "):O.length>1?`${O.length} client registrations`:"Client registration"},[fe,O,me]),pe=fe.length===1?fe[0]:null,Ht=t&&pe?Ws(t,pe.clientId):void 0,he=C.mcpActivityId??null,{data:st=[]}=hs({enabled:i&&m&&me&&!!he,clientIds:O??[],limit:100}),ot=b.useMemo(()=>{if(!he)return null;const p=st.find(k=>k.activityId===he);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[he,st]),q=C.agentId,Y=C.schedule,{data:at=[]}=Us(q??void 0),it=b.useMemo(()=>!Y||!q?null:at.find(v=>v.id===Y)?.description?.trim()||"Scheduled task",[q,Y,at]),{data:qt}=vs(i&&m?e:null,o),{data:Yt}=ys(h&&!He?t:null,o),ct=m?qt:Yt,Re=b.useMemo(()=>{const p=new Map;for(const v of ct||[]){const k=v.automation_name??"__global__";p.has(k)||p.set(k,{automationName:v.automation_name??null,classifiers:[]});const E=p.get(k),D=v.attribute_values||{},M=Object.keys(D);let ge=null;const Z={};for(const[X,W]of Object.entries(D))if(W.parent)for(const[Le,J]of Object.entries(W.parent))ge=Le,Z[J]||(Z[J]=[]),Z[J].push(X);const B=E.classifiers.find(X=>X.slug===v.slug);if(B){const X=new Set([...B.values,...M]);B.values=[...X];for(const[W,Le]of Object.entries(Z)){B.valuesByParentValue[W]||(B.valuesByParentValue[W]=[]);const J=new Set([...B.valuesByParentValue[W],...Le]);B.valuesByParentValue[W]=[...J]}ge&&(B.parentSlug=ge)}else E.classifiers.push({slug:v.slug,name:v.name,values:M,parentSlug:ge,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((k,E)=>k.parentSlug===null&&E.parentSlug!==null?-1:k.parentSlug!==null&&E.parentSlug===null?1:0);return[...p.values()]},[ct]),Zt=gs(i&&m?e:null,o,C,t),Xt=xs(h?t:null,o,C),Jt=h?Xt:Zt,{data:V,isLoading:en,error:tn}=Jt,nn=b.useMemo(()=>V?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[V]),rt=V?.pages[0],lt=(rt?.content.length??0)>0,sn=bs(i&&m?e:null,o,C,t),on=js(h?t:null,o,C),we=h?on:sn,an=we.data?.total??void 0,cn=we.data?.classification_stats,rn=we.isLoading,ln=!!(C.beforeOccurredAt||C.afterOccurredAt),dt=ks(C),ut=V?.pages[V.pages.length-1],Q=ut?.content[ut.content.length-1];b.useEffect(()=>{!dt||!Q||V?.pages.length===1||x.beforeOccurredAt===Q.occurred_at&&x.beforeId===Q.id||F({beforeOccurredAt:Q.occurred_at,beforeId:Q.id},{replace:!0})},[Q?.id,dt,F,V?.pages.length,Q,x.beforeOccurredAt,x.beforeId]);const dn=b.useCallback(()=>{w({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[w]),un=(p,v)=>{w({dateRange:[p,v]})},mt=(p,v)=>{const k={...C.classificationFilters||{}};if(v.length>0)k[p]=v;else{delete k[p];for(const E of Re)for(const D of E.classifiers)D.parentSlug===p&&delete k[D.slug]}w({classificationFilters:k})},mn=(p,v)=>{const k=C.classificationFilters?.[p]||[];mt(p,k.includes(v)?k.filter(E=>E!==v):[...k,v])},fn=p=>mt(p,[]);if(tn)return n.jsx(Ss,{label:"knowledge"});const Me=!i||d&&l||m&&!e||en,ve={fields:[],chips:[]};for(const p of Re)for(const v of p.classifiers){const k=C.classificationFilters?.[v.slug]??[],E=v.parentSlug?C.classificationFilters?.[v.parentSlug]??[]:void 0,D=E?[...new Set(E.flatMap(M=>v.valuesByParentValue[M]??[]))]:v.values;D.length>0&&ve.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:n.jsx(Ns,{className:"h-4 w-4"}),editor:Ne({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:D.map(M=>({value:M,label:M,count:cn?.[v.slug]?.[M]})),selected:k,multiple:!0,onSelect:M=>mn(v.slug,M)})})}for(const[p,v]of Object.entries(C.classificationFilters??{})){if(v.length===0)continue;const k=Re.flatMap(E=>E.classifiers).find(E=>E.slug===p);ve.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:k?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>fn(p)})}const pn=[C.contentIds?.length?xe({id:"contentIds",label:C.contentIds.length>1?"Events":"Event",value:`#${C.contentIds.join(", #")}`,onRemove:()=>w({contentIds:void 0})}):null,ot?xe({id:"mcpActivityId",label:"Conversation",value:ot,onRemove:()=>w({mcpActivityId:void 0})}):null,nt?xe({id:"clientIds",label:"Connected app",value:nt,sourceLink:Ht,details:O&&O.length>0?n.jsx(qs,{ownerSlug:t,clientIds:O,linkedUser:pe?.linkedUser,linkedUserEntitySlug:pe?.linkedUserEntitySlug}):void 0,onRemove:()=>w({clientIds:void 0})}):null,it?xe({id:"schedule",label:"Schedule",value:it,sourceLink:t&&q&&Y?Hs(t,q,Y):void 0,onRemove:()=>w({schedule:void 0,runIds:void 0})}):null,...ve.chips].filter(p=>p!=null),hn=!!(m&&o&&e),ye=c&&I&&!le?c:void 0,ft={filterActions:u||ye?.filterActions?n.jsxs(n.Fragment,{children:[u?n.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:w}):null,ye?.filterActions]}):void 0,filterTrailing:hn?n.jsxs(ie,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":G,onClick:()=>T(p=>!p),children:[n.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:ze,notificationsFirst:j?I:void 0,filters:C,onFiltersChange:w,eventKinds:zt,searchQuery:L,onSearchChange:p=>{U.current=!0,P(p)},extraFields:ve.fields,drillChips:pn,total:an,isListLoading:Me,isTotalLoading:rn,hasCursorInUrl:ln&<,onGoToLatest:dn},vn=!Me&&!!rt&&!lt&&!le,yn=d?m?"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",pt=!!(m&&t);return n.jsx(Cs,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(Vt,{...ft,ownerSlug:t}):n.jsx(Ut,{...ft})}),G&&m&&o&&e&&n.jsx(po,{entityId:o,organizationId:e,ownerSlug:t||"",eventTimes:nn,selectedRange:C.dateRange||void 0,onSelectRange:un}),ye?.pinned,Me?n.jsx("div",{className:"space-y-4",children:["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(p=>n.jsx(Lt,{className:"h-32 rounded-lg"},p))}):vn?f??n.jsx(yt,{icon:gt,title:"No activity yet",description:yn,actionLabel:pt?"Add a connector":void 0,onAction:pt&&t?()=>void y({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(Ms,{onFiltersChange:w,organizationId:e,ownerSlug:t,entityId:o,filters:C,showEntityLinks:He,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:ye?.hiddenApprovalRunIds,emptyState:n.jsx(yt,{icon:gt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:le?"Clear filters":void 0,onAction:le?ze:void 0})})]})})}function go({record:e,ownerSlug:t}){const o=ce(),s=z(),{filters:a,updateFilters:c}=Bt({parse:Ce,serialize:Be,filterKeys:Dt,replace:!1,merge:$t}),f=De({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{s({...Ke(t,o.search??{}),...o.pathname.startsWith(`/${t}/events/`)?{}:{to:o.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(Vt,{ownerSlug:t,sourceRead:!0,filters:a,onFiltersChange:c,searchQuery:a.searchQuery??"",onSearchChange:d=>c({searchQuery:d}),onClearFilters:u}),n.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."}),f?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx(ie,{variant:"outline",size:"sm",onClick:()=>{const d=Be({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),i={...Ke(t,o.search??{}).search,...d};s({to:o.pathname,search:i})},children:"Clear unsupported filters"})]}):n.jsx(Os,{record:e,orgContext:{slug:t},filters:a})]})}function Eo({entity:e,organizationId:t,ownerSlug:o}){const s=e.is_derived?n.jsx(go,{ownerSlug:o,record:{type:e.entity_type,key:e.slug}}):n.jsx(yo,{organizationId:t,ownerSlug:o,entityId:e.id,hideSourceFilter:!0,changesShortcut:!0});return n.jsx(Bs,{organizationId:t,children:e.entity_type==="$member"?n.jsx(Ds,{children:s}):s})}export{yo as E,Bs as M,Eo as R};
|
|
2
|
+
//# sourceMappingURL=record-activity-ZJntBfN_.js.map
|
package/dist/owletto/dist/assets/{record-field-peek-BBZcRuGT.js → record-field-peek-Brh1IQGy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,u as R,ez as S,ep as k,eq as I,er as N,es as b,ev as w,ew as F,B as v,dF as A,cT as P,a$ as z}from"./index-
|
|
2
|
-
//# sourceMappingURL=record-field-peek-
|
|
1
|
+
import{j as e,u as R,ez as S,ep as k,eq as I,er as N,es as b,ev as w,ew as F,B as v,dF as A,cT as P,a$ as z}from"./index-9YuSRymd.js";import{g as y,l as L,S as C,D as M}from"./schema-value-normalization-CKdPjdPC.js";import{R as O,s as B}from"./events-feed-DO3IiJO2.js";import{u as q}from"./record-session-Pbr5czGw.js";const D=3;function H(s,t,a,o){const d=$(s.schema,t),r=y(t,d??{});return{href:"",key:`record-field:${s.entity.id}:${t}${a===void 0?"":`:${a}`}`,title:a===void 0?r:o?`${r} ${a+1} of ${o}`:`${r} ${a+1}`,recordField:{entityId:s.entity.id,field:t,row:a}}}function $(s,t){return s?.properties?.[t]}function J({target:s}){const t=q(s.entityId),a=$(t?.schema,s.field);return t?a?e.jsx("div",{className:"space-y-3 px-5 py-4",children:s.row===void 0?e.jsx(V,{session:t,field:s.field,prop:a}):e.jsx(_,{session:t,field:s.field,prop:a,row:s.row})}):e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This field is no longer part of the record's type."}):e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This record is no longer open. Open it again to see this field."})}function V({session:s,field:t,prop:a}){const o=R(),{record:d,editing:r}=s,i=d.values.metadata[t],n=Array.isArray(i)?i:[],m=Object.entries(a.items?.properties??{}),h=(i==null||Array.isArray(i))&&m.length>0&&n.every(S),u=y(t,a),p=a.maxItems===void 0||n.length<a.maxItems,x=e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Field of ",s.entity.name," · ",n.length," ",n.length===1?"item":"items",h&&n.length>0?" · open an item for every field":""]});if(!h)return e.jsxs(e.Fragment,{children:[x,r?e.jsx(L,{fieldPath:`peek.${t}`,fieldKey:t,prop:a,value:i,onChange:l=>d.setMetadataField(t,l),isRequired:!1,readonly:!1,orgContext:s.orgContext,ariaLabel:u}):e.jsx("div",{className:"text-sm",children:e.jsx(C,{value:i,prop:a})})]});const j=m.slice(0,D),f=(l,c=n.length)=>o?.open(H(s,t,l,c));return e.jsxs(e.Fragment,{children:[x,n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No items yet."}):e.jsx("div",{className:"rounded-md border",children:e.jsxs(k,{children:[e.jsx(I,{children:e.jsxs(N,{children:[j.map(([l,c])=>e.jsx(b,{children:y(l,c)},l)),e.jsx(b,{className:"w-10",children:e.jsx("span",{className:"sr-only",children:"Open"})})]})}),e.jsx(w,{children:n.map((l,c)=>e.jsxs(N,{className:"cursor-pointer",onClick:()=>f(c),children:[j.map(([g,T])=>e.jsx(F,{className:"max-w-[10rem] truncate",children:e.jsx(C,{value:l[g],prop:T})},g)),e.jsx(F,{children:e.jsx(v,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":`Open ${u} ${c+1}`,onClick:g=>{g.stopPropagation(),f(c)},children:e.jsx(A,{className:"h-4 w-4"})})})]},c))})]})}),r?e.jsxs(v,{type:"button",variant:"outline",size:"sm",disabled:!p,onClick:()=>{d.setMetadataField(t,[...n,{}]),f(n.length,n.length+1)},children:[e.jsx(P,{className:"mr-1.5 h-4 w-4"}),"Add item"]}):null]})}function _({session:s,field:t,prop:a,row:o}){const d=R(),{record:r,editing:i}=s,n=r.values.metadata[t],m=Array.isArray(n)?n:[],h=m[o],u=a.minItems===void 0||m.length>a.minItems;return S(h)?i?e.jsxs(e.Fragment,{children:[e.jsx(M,{schema:a.items,values:h,onValuesChange:p=>r.setMetadataField(t,m.map((x,j)=>j===o?p:x)),orgContext:s.orgContext}),e.jsxs(v,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",disabled:!u,onClick:()=>{r.setMetadataField(t,m.filter((p,x)=>x!==o)),d?.back?.()},children:[e.jsx(z,{className:"mr-1.5 h-4 w-4"}),"Remove item"]})]}):e.jsx(O,{fields:B(a.items),values:h,context:{ownerSlug:s.ownerSlug,orgContext:s.orgContext}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"This item is no longer in the list."})}export{J as R,H as r};
|
|
2
|
+
//# sourceMappingURL=record-field-peek-Brh1IQGy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,j as c}from"./index-
|
|
2
|
-
//# sourceMappingURL=record-session-
|
|
1
|
+
import{r as s,j as c}from"./index-9YuSRymd.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
|
|
2
|
+
//# sourceMappingURL=record-session-Pbr5czGw.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as v,r as o,j as e,L as h,W as j,J as y,Y as N}from"./index-
|
|
2
|
-
//# sourceMappingURL=reset-password-
|
|
1
|
+
import{V as v,r as o,j as e,L as h,W as j,J as y,Y as N}from"./index-9YuSRymd.js";import{C as k,a as C,b as S,c as L}from"./card-jzhQrMDP.js";function R(){const{token:n,error:x}=v.useSearch(),[a,p]=o.useState(""),[i,f]=o.useState(""),[d,s]=o.useState(null),[l,c]=o.useState(!1),[u,g]=o.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(a.length<8){s("Password must be at least 8 characters.");return}if(a!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:a})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:a,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
2
|
+
//# sourceMappingURL=reset-password-CzZw6RcC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,Q as g,i7 as T,S as r,r as i,cG as w,a2 as A}from"./index-
|
|
2
|
-
//# sourceMappingURL=runs-panel-
|
|
1
|
+
import{j as e,Q as g,i7 as T,S as r,r as i,cG as w,a2 as A}from"./index-9YuSRymd.js";import{F,o as P}from"./filter-editors-Bwhqj7lY.js";import{R as E}from"./runs-table-B1APZv7d.js";const v=[{value:"all",label:"All"},{value:"sync",label:"Sync",runTypes:["sync"]},{value:"action",label:"Action",runTypes:["action"]},{value:"auth",label:"Auth",runTypes:["auth"]}];function B(s){return v.find(n=>n.value===s)?.runTypes}const h=[{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}];function I({bucket:s,status:n,onBucketChange:t,onStatusChange:l}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:v.map(a=>e.jsx("button",{type:"button",onClick:()=>t(a.value),className:g("rounded px-3 py-1 transition-colors",s===a.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))}),e.jsx(F,{label:"Run filters",className:"flex-1",fields:[{key:"status",label:"Status",icon:e.jsx(T,{className:"h-4 w-4"}),editor:P({searchPlaceholder:"Search statuses...",options:h,selected:n==="all"?[]:[n],onSelect:l})}],chips:n==="all"?[]:[{id:"status",label:"Status",op:"is",value:h.find(a=>a.value===n)?.label??n,onRemove:()=>l("all")}]})]})}function C({labels:s,className:n}){return e.jsx("div",{className:g("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",n),children:s.map((t,l)=>e.jsx("span",{className:l===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:t},t))})}function b({rows:s=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(r,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:s}).map((n,t)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(r,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(r,{className:"h-3 w-20"}),e.jsx(r,{className:"h-3 w-16"}),e.jsx(r,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(r,{className:"h-7 w-7 rounded-md shrink-0"})]},t))})]})}function U({rows:s=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(C,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(b,{rows:s})]})}function _({scope:s,ownerSlug:n}){const[t,l]=i.useState("all"),[a,j]=i.useState("all"),N=i.useMemo(()=>({runTypes:B(t),status:a==="all"?void 0:a}),[t,a]),{data:u,isLoading:y,isError:S,hasNextPage:d,isFetchingNextPage:c,fetchNextPage:x}=w(s,N,n),m=i.useMemo(()=>u?.pages.flatMap(o=>o.runs)??[],[u]),R={runType:t==="all",feed:!0,connection:"deviceId"in s||"connectorKey"in s},p=i.useRef(null);return i.useEffect(()=>{const o=p.current;if(!o||!d)return;const f=new IntersectionObserver(k=>{k[0]?.isIntersecting&&!c&&x()},{rootMargin:"200px"});return f.observe(o),()=>f.disconnect()},[d,c,x]),e.jsxs("div",{className:"space-y-3",children:[e.jsx(I,{bucket:t,status:a,onBucketChange:l,onStatusChange:j}),y?e.jsx(b,{}):S?e.jsx("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:"Failed to load runs."}):m.length===0?e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:t==="all"&&a==="all"?"No runs yet.":"No runs match these filters."}):e.jsxs(e.Fragment,{children:[e.jsx(E,{runs:m,ownerSlug:n,columns:R}),e.jsx("div",{ref:p,className:"h-1"}),c&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(A,{size:"lg",className:"text-muted-foreground"})})]})]})}export{_ as R,U as a};
|
|
2
|
+
//# sourceMappingURL=runs-panel-C0_DNTcq.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,Q as l,i8 as u,B as b,L as N,cW as w,dK as k,dL as v,dN as T,i9 as C,ia as _,ep as S,eq as V,er as p,es as n,ev as R,ew as i,bd as L,dY as D,P as B,ib as E,e1 as P,ab as I,a2 as M,be as O,r as h,dr as m,dt as g,ds as j}from"./index-
|
|
2
|
-
//# sourceMappingURL=runs-table-
|
|
1
|
+
import{j as e,Q as l,i8 as u,B as b,L as N,cW as w,dK as k,dL as v,dN as T,i9 as C,ia as _,ep as S,eq as V,er as p,es as n,ev as R,ew as i,bd as L,dY as D,P as B,ib as E,e1 as P,ab as I,a2 as M,be as O,r as h,dr as m,dt as g,ds as j}from"./index-9YuSRymd.js";const A=u("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"}}),F=u("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 H({className:t,status:a,showDot:r=!0,children:x,...s}){return e.jsxs("span",{className:l(A({status:a}),t),...s,children:[r&&e.jsx("span",{className:F({status:a})}),x]})}function W(t,a){switch(a.kind){case"connection":return _(t,a.id);case"feed":return C(t,a.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(a.id)}}}}function q({ownerSlug:t,scope:a,variant:r="outline",iconOnly:x=!1,label:s,className:c,title:f}){const d=W(t,a),y=f??s??"View in memory",o=e.jsx(b,{asChild:!0,variant:r,size:x?"icon":"sm",className:l(x&&"h-7 w-7",c),children:e.jsxs(N,{to:d.to,params:d.params,search:d.search,children:[e.jsx(w,{className:l("h-3.5 w-3.5",!x&&"mr-1.5")}),!x&&(s??"View in memory")]})});return x?e.jsxs(k,{children:[e.jsx(v,{asChild:!0,children:o}),e.jsx(T,{children:y})]}):o}const z=new Set(["error","failed","revoked"]);function J(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":z.has(t)?"error":"default"}function K({status:t}){return t==="completed"?e.jsx(P,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(I,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(M,{className:"text-blue-500"}):e.jsx(O,{className:"h-3.5 w-3.5 text-muted-foreground"})}function Q({error:t}){const[a,r]=h.useState(!1);return t.length>80?e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(j,{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 U({checkpoint:t}){const[a,r]=h.useState(!1);return e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(j,{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 X(t){return t.feed_display_name??t.feed_key??"—"}function $({runs:t,ownerSlug:a,columns:r={}}){const x=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(S,{children:[e.jsx(V,{children:e.jsxs(p,{children:[e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Version"}),x&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(R,{children:t.map(s=>{const c=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(p,{children:[e.jsx(i,{className:"py-1.5 px-3",children:e.jsx(K,{status:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:D(s.created_at),children:L(s.created_at)}),r.runType&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(B,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:X(s)}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(H,{status:J(s.status),children:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:c!=null?E(c):"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),x&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(U,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(Q,{error:s.error_message}):""}),e.jsx(i,{className:"py-1.5 px-3 text-right",children:e.jsx(q,{ownerSlug:a,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{$ as R,H as S,q as V,J as g};
|
|
2
|
+
//# sourceMappingURL=runs-table-B1APZv7d.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as ze,j as N,B as qr,cz as KI,ep as JI,eq as QI,er as zs,es as Sm,cX as bB,et as CB,eu as TB,ev as eL,ew as Ru,Q as Ks,C as AB,dF as MB,af as DB,dX as IB,ex as LB,d1 as Iv,z as xm,ee as PB,T as RB,bp as EB,bq as kB,br as OB,bs as NB,bt as BB,ey as VB,ez as ac,eA as Vx,eB as zB,eC as Cp,eD as FB,a$ as zx,cT as Fx,I as W_,bd as GB,dK as HB,dL as $B,bB as UB,dN as WB,cM as YB,dO as XB,eE as ZB,cF as Gx,eF as jB,dy as qB,eG as KB,dr as JB,dt as QB,eH as eV,ds as tV,dz as rV,L as nV}from"./index-
|
|
1
|
+
import{r as ze,j as N,B as qr,cz as KI,ep as JI,eq as QI,er as zs,es as Sm,cX as bB,et as CB,eu as TB,ev as eL,ew as Ru,Q as Ks,C as AB,dF as MB,af as DB,dX as IB,ex as LB,d1 as Iv,z as xm,ee as PB,T as RB,bp as EB,bq as kB,br as OB,bs as NB,bt as BB,ey as VB,ez as ac,eA as Vx,eB as zB,eC as Cp,eD as FB,a$ as zx,cT as Fx,I as W_,bd as GB,dK as HB,dL as $B,bB as UB,dN as WB,cM as YB,dO as XB,eE as ZB,cF as Gx,eF as jB,dy as qB,eG as KB,dr as JB,dt as QB,eH as eV,ds as tV,dz as rV,L as nV}from"./index-9YuSRymd.js";import{c as aV,d as iV,b as oV,a as sV,C as lV}from"./card-jzhQrMDP.js";const uV=r=>r!=null;function fV(r,e,t=uV){let n=r;for(const a of e.replace(/\[(\d+)\]/g,".$1").split(".")){if(!t(n))return;n=n[a]}return n}function cV(r,e,t){return typeof r!="string"?r:r.startsWith("@")?e?.[r.slice(1)]:r.startsWith("{{")&&r.endsWith("}}")&&r.indexOf("}}")===r.length-2?t(r.slice(2,-2).trim()):r.replace(/\{\{(.+?)\}\}/g,(n,a)=>{const i=t(a.trim());return i===void 0?"":String(i)})}const vV=new Set(["type","children","props","path","fallback","key"]);function hV(r,e){const t={};for(const[n,a]of Object.entries(r))vV.has(n)||(t[n]=a);return Object.assign(t,e)}const dV=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,pV=/^\d{4}-\d{2}-\d{2}$/;function gV(r){return dV.test(r)}function Zu(r){if(!/^https?:\/\//i.test(r))return!1;try{const e=new URL(r);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function tL(r){return r.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Hx(r){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:r>=1e3?"compact":"standard",maximumFractionDigits:r>=1e9?1:0}).format(r)}function $x(r){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(r)?0:2}).format(r)}function Ux(r){const e=new Date(pV.test(r)?`${r}T00:00:00`:r);return Number.isNaN(e.getTime())?r:e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function Wx(r){try{const e=new URL(r),t=e.hostname.replace(/^www\./i,""),n=e.pathname&&e.pathname!=="/"?e.pathname.replace(/\/$/,""):"";return`${t}${n}`}catch{return r}}function wm(r){return r==null?"":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(Cd(r)):Array.isArray(r)?r.some(e=>typeof e=="object"&&e!==null)?r.map((e,t)=>`${t+1}. ${wm(e)}`).join(`
|
|
2
2
|
`):JSON.stringify(r):typeof r=="object"?Object.entries(r).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${tL(t)}: ${wm(n)}`).join("; "):JSON.stringify(r)}function Cd(r,e){if(r==null)return"";if(typeof r=="boolean")return r?"Yes":"No";if(typeof r=="number")return e==="currency"?Hx(r):e===void 0||e==="text"?String(r):$x(r);if(typeof r!="string")return wm(r);switch(e){case"currency":return Hx(Number(r));case"date":return Ux(r);case"url":return Wx(r);case"enum":return tL(r);case"number":return $x(Number(r));case"auto":return Zu(r)?Wx(r):gV(r)?Ux(r):r;default:return r}}function yV(r){return r==null?null:typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):null}function rL(r,e){return typeof r!="string"||!r.startsWith("@")||r.length===1?null:{action:r.slice(1),value:yV(e)}}/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -94,4 +94,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
94
94
|
* @license MIT
|
|
95
95
|
*/function pm(r,e){return r?Vne(r)?ze.createElement(r,e):r:null}function Vne(r){return zne(r)||typeof r=="function"||Fne(r)}function zne(r){return typeof r=="function"&&(()=>{const e=Object.getPrototypeOf(r);return e.prototype&&e.prototype.isReactComponent})()}function Fne(r){return typeof r=="object"&&typeof r.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(r.$$typeof.description)}function Gne(r){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...r},[t]=ze.useState(()=>({current:Ene(e)})),[n,a]=ze.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...r,state:{...n,...r.state},onStateChange:o=>{a(o),r.onStateChange==null||r.onStateChange(o)}})),t.current}const $I=12;function gm(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function ym(r){return r.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Hne(r){try{return JSON.stringify(r,null,2)}catch{return String(r)}}function Yi(r){return r===null?"null":r===void 0?"—":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):Hne(r)}const UI=({value:r,openLink:e})=>{if(!Zu(r))return N.jsx("span",{className:"break-words",children:r});let t=r;try{const n=new URL(r);t=`${n.host}${n.pathname==="/"?"":n.pathname}`}catch{}return N.jsxs(qr,{type:"button",variant:"ghost",size:"sm",className:"h-auto max-w-full justify-start px-1 py-0 text-left font-normal text-xs",onClick:()=>e(r),children:[N.jsx(KI,{className:"mr-1 h-3 w-3 shrink-0"}),N.jsx("span",{className:"truncate",children:t})]})};function $ne({page:r,pageCount:e,onChange:t}){return N.jsxs("div",{className:"mt-2 flex items-center justify-end gap-1.5",children:[N.jsxs(qr,{type:"button",size:"sm",variant:"outline",disabled:r===0,onClick:()=>t(r-1),children:[N.jsx(AB,{className:"h-3.5 w-3.5"}),N.jsx("span",{className:"sr-only",children:"Previous page"})]}),N.jsxs("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",e]}),N.jsxs(qr,{type:"button",size:"sm",variant:"outline",disabled:r+1>=e,onClick:()=>t(r+1),children:[N.jsx(MB,{className:"h-3.5 w-3.5"}),N.jsx("span",{className:"sr-only",children:"Next page"})]})]})}function Une({rows:r,columns:e,openLink:t,stateKey:n="table",viewState:a,onViewStateChange:i,renderCell:o,renderStructuredValue:s,pageSize:l}){const u=ze.useMemo(()=>e?null:[...new Set(r.flatMap(L=>Object.keys(L)))],[e,r]),f=ze.useMemo(()=>e?.map(L=>L.name)??(u??[]).slice(0,$I),[e,u]),c=u?u.slice($I):[],v=a?.[`${n}.sort.column`],h=a?.[`${n}.sort.desc`],d=typeof v=="string"&&v?[{id:v,desc:h===!0}]:[],[p,g]=ze.useState(d),[y,m]=ze.useState(null);ze.useEffect(()=>{g(d)},[v,h]);function _(L){const I=new Set(f);return Object.keys(L).filter(P=>!I.has(P))}const S=ze.useMemo(()=>f.map(L=>({id:L,accessorFn:I=>I[L],header:ym(L),enableSorting:L!=="open",sortDescFirst:!1,sortingFn:(I,P,R)=>{const E=I.getValue(R),O=P.getValue(R);return typeof E=="number"&&typeof O=="number"?E-O:Yi(E).localeCompare(Yi(O),void 0,{numeric:!0,sensitivity:"base"})},cell:({getValue:I,row:P})=>{const R=I(),E=P.index===y;if(gm(R)||Array.isArray(R))return E?N.jsx("div",{className:"max-w-md break-words",children:s?s(R,t):Yi(R)}):N.jsx("span",{className:"text-muted-foreground",children:Array.isArray(R)?"[…]":"{…}"});const O=o?.(R,L);if(O!=null)return O;if(L==="open"&&typeof R=="string")return N.jsxs(qr,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2",onClick:z=>{z.stopPropagation(),t(R)},children:[N.jsx(KI,{className:"mr-1 h-3.5 w-3.5"}),"Open"]});if(typeof R=="string"&&Zu(R))return N.jsx(UI,{value:R,openLink:t});if(E)return N.jsx("span",{className:"break-words whitespace-pre-wrap",children:Yi(R)});const k=Yi(R);return N.jsx("span",{className:"block max-w-80 truncate",title:k,children:k})}})),[f,t,y,o,s]),x=a?.[`${n}.page`],[w,b]=ze.useState(typeof x=="number"?Math.max(0,x):0);ze.useEffect(()=>{b(typeof x=="number"?Math.max(0,x):0)},[x]);const T=l?Math.max(1,Math.ceil(r.length/l)):1,C=typeof x=="number"?Math.max(0,x):w,A=Math.min(C,T-1),M=Gne({data:r,columns:S,state:{sorting:p,...l?{pagination:{pageIndex:A,pageSize:l}}:{}},onSortingChange:L=>{const I=typeof L=="function"?L(p):L;g(I),i?.(`${n}.sort.column`,I[0]?.id??""),i?.(`${n}.sort.desc`,I[0]?.desc??!1)},getCoreRowModel:kne(),getSortedRowModel:Bne(),...l?{getPaginationRowModel:Nne(),onPaginationChange:L=>{const I=typeof L=="function"?L({pageIndex:A,pageSize:l}):L;b(I.pageIndex),i?.(`${n}.page`,I.pageIndex)}}:{}});return N.jsxs("div",{children:[N.jsx("div",{className:"overflow-hidden rounded-md border border-border/70",children:N.jsxs(JI,{className:"text-xs",children:[N.jsx(QI,{className:"bg-muted/50",children:M.getHeaderGroups().map(L=>N.jsx(zs,{className:"hover:bg-transparent",children:L.headers.map(I=>{const P=I.column.getIsSorted(),R=String(I.column.columnDef.header),E=I.column.getCanSort();return N.jsx(Sm,{"aria-sort":E?P==="asc"?"ascending":P==="desc"?"descending":"none":void 0,className:"h-8 whitespace-nowrap px-2",children:E?N.jsxs("button",{type:"button","aria-label":`Sort by ${R}`,className:"flex w-full items-center gap-1.5 text-left",onClick:I.column.getToggleSortingHandler(),children:[pm(I.column.columnDef.header,I.getContext()),P==="asc"?N.jsx(bB,{className:"h-3 w-3"}):P==="desc"?N.jsx(CB,{className:"h-3 w-3"}):N.jsx(TB,{className:"h-3 w-3 opacity-45"})]}):pm(I.column.columnDef.header,I.getContext())},I.id)})},L.id))}),N.jsx(eL,{children:M.getRowModel().rows.map(L=>{const I=L.index===y,P=_(L.original),R=P.length>0||f.some(E=>{const O=L.original[E];return gm(O)||Array.isArray(O)});return N.jsxs(ze.Fragment,{children:[N.jsx(zs,{className:Ks("transition-colors",R&&"cursor-pointer",I?"bg-muted/20":R&&"hover:bg-muted/30"),onClick:R?()=>m(I?null:L.index):void 0,children:L.getVisibleCells().map(E=>N.jsx(Ru,{className:"p-2 align-top",children:pm(E.column.columnDef.cell,E.getContext())},E.id))}),I&&P.length>0?N.jsx(zs,{className:"border-b last:border-b-0 bg-muted/10",children:N.jsx(Ru,{colSpan:L.getVisibleCells().length,className:"p-2",children:N.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:P.map(E=>{const O=L.original[E];return N.jsxs("div",{children:[N.jsxs("span",{className:"text-muted-foreground capitalize",children:[ym(E),":"]})," ",gm(O)||Array.isArray(O)?s?s(O,t):N.jsx("span",{className:"break-words whitespace-pre-wrap",children:Yi(O)}):(()=>{const k=o?.(O,E);return k??(typeof O=="string"&&Zu(O)?N.jsx(UI,{value:O,openLink:t}):N.jsx("span",{className:"break-words whitespace-pre-wrap",children:Yi(O)}))})()]},E)})})})}):null]},L.id)})})]})}),c.length>0?N.jsxs("p",{className:"mt-2 text-muted-foreground text-xs",children:[c.length," additional"," ",c.length===1?"column":"columns"," available in expanded rows:"," ",c.slice(0,4).map(ym).join(", "),c.length>4?`, +${c.length-4} more`:""]}):null,l&&T>1?N.jsx($ne,{page:A,pageCount:T,onChange:L=>M.setPageIndex(L)}):null]})}function Wne(r,e,t){const n=e[0];let a=t;if(n&&typeof n=="object"&&!Array.isArray(n)){const i=n,o=i.currentTarget&&typeof i.currentTarget=="object"?i.currentTarget:i.target&&typeof i.target=="object"?i.target:null;o&&o.value!==void 0&&(o.value!==""||t==null)&&(a=o.value)}else(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(a=n);return rL(r,a)}function mm(r,e,t){const n=r;return Array.isArray(n)?!e&&!t?n:n.map(a=>({label:String(a[e??"label"]??""),value:Number(a[t??"value"]??0)})):[]}function Yne(r,e,t){const n=r;return Array.isArray(n)?!e&&!t?n:n.map(a=>({name:String(a[e??"name"]??""),value:Number(a[t??"value"]??0)})):[]}const WI={div:({children:r,...e})=>N.jsx("div",{...e,children:r}),span:({children:r,...e})=>N.jsx("span",{...e,children:r}),p:({children:r,...e})=>N.jsx("p",{...e,children:r}),h1:({children:r,...e})=>N.jsx("h1",{...e,children:r}),h2:({children:r,...e})=>N.jsx("h2",{...e,children:r}),h3:({children:r,...e})=>N.jsx("h3",{...e,children:r}),h4:({children:r,...e})=>N.jsx("h4",{...e,children:r}),ul:({children:r,...e})=>N.jsx("ul",{...e,children:r}),ol:({children:r,...e})=>N.jsx("ol",{...e,children:r}),li:({children:r,...e})=>N.jsx("li",{...e,children:r}),table:({children:r,...e})=>N.jsx("table",{...e,children:r}),thead:({children:r,...e})=>N.jsx("thead",{...e,children:r}),tbody:({children:r,...e})=>N.jsx("tbody",{...e,children:r}),tr:({children:r,...e})=>N.jsx("tr",{...e,children:r}),th:({children:r,...e})=>N.jsx("th",{...e,children:r}),td:({children:r,...e})=>N.jsx("td",{...e,children:r}),card:({children:r,className:e,...t})=>N.jsx(lV,{className:e,...t,children:r}),"card-header":({children:r,className:e,...t})=>N.jsx(sV,{className:e,...t,children:r}),"card-title":({children:r,className:e,...t})=>N.jsx(oV,{asChild:!0,className:e,children:N.jsx("h3",{...t,children:r})}),"card-description":({children:r,className:e,...t})=>N.jsx(iV,{className:e,...t,children:r}),"card-content":({children:r,className:e,...t})=>N.jsx(aV,{className:e,...t,children:r}),badge:({children:r,className:e,variant:t="default",...n})=>{const a={default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"border border-input bg-background"},i=s=>typeof s=="string"?s.replace(/[_-]/g," ").replace(/\b\w/g,l=>l.toUpperCase()):typeof s=="number"||typeof s=="boolean"||s==null||LB.isValidElement(s)?s:Array.isArray(s)?s.map(i):String(s),o=i(r);return N.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold ${a[t]||a.default} ${e||""}`,...n,children:o})},button:({children:r,className:e,variant:t="default",type:n="button",label:a,...i})=>{const o={default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"};return N.jsx("button",{type:n,className:`inline-flex items-center justify-center rounded-md text-sm font-medium h-10 px-4 py-2 ${o[t]||o.default} ${e||""}`,...i,children:r??String(a??"")})},select:({className:r,label:e,placeholder:t,options:n,onChange:a,onSelect:i,...o})=>N.jsxs("label",{className:`flex flex-col gap-1 text-sm ${r||""}`,children:[e?N.jsx("span",{className:"font-medium",children:String(e)}):null,N.jsxs("select",{className:"h-10 rounded-md border border-input bg-background px-3",onChange:a??i,defaultValue:"",...o,children:[t?N.jsx("option",{value:"",disabled:!0,children:String(t)}):null,Array.isArray(n)?n.map(s=>{const l=s,u=String(l.value??l.label??"");return N.jsx("option",{value:u,children:String(l.label??u)},JSON.stringify(l))}):null]})]}),alert:({children:r,className:e,variant:t="default",...n})=>{const a={default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive"};return N.jsx("div",{role:"alert",className:`relative w-full rounded-lg border p-4 ${a[t]||a.default} ${e||""}`,...n,children:r})},"alert-title":({children:r,className:e,...t})=>N.jsx("h5",{className:`mb-1 font-medium leading-none tracking-tight ${e||""}`,...t,children:r}),"alert-description":({children:r,className:e,...t})=>N.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t,children:r}),progress:({className:r,value:e=0,label:t,...n})=>{const a=Math.round(e);return N.jsxs("div",{className:`flex items-center gap-2 ${r||""}`,...n,children:[N.jsx("div",{className:"relative h-4 flex-1 overflow-hidden rounded-full bg-secondary",children:N.jsx("div",{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-a}%)`}})}),N.jsx("span",{className:"text-xs font-medium tabular-nums text-muted-foreground shrink-0",children:t?String(t):`${a}%`})]})},strong:({children:r,...e})=>N.jsx("strong",{...e,children:r}),b:({children:r,...e})=>N.jsx("strong",{...e,children:r}),em:({children:r,...e})=>N.jsx("em",{...e,children:r}),link:({children:r,className:e,href:t,...n})=>{const a=String(t??""),i=/^https?:\/\//i.test(a);return N.jsx("a",{href:a,className:`text-primary underline underline-offset-2 hover:no-underline ${e||""}`,...i?{target:"_blank",rel:"noreferrer"}:{},...n,children:r})},a:({children:r,className:e,href:t,...n})=>N.jsx("a",{href:String(t??""),className:`text-primary underline underline-offset-2 hover:no-underline ${e||""}`,...n,children:r}),context:({children:r,className:e,...t})=>N.jsx("div",{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground ${e||""}`,...t,children:r}),fields:({children:r,className:e,...t})=>N.jsx("div",{className:`grid grid-cols-1 gap-x-6 gap-y-2 sm:grid-cols-2 ${e||""}`,...t,children:r}),field:({children:r,className:e,label:t,value:n,...a})=>N.jsxs("div",{className:`flex flex-col gap-0.5 ${e||""}`,...a,children:[N.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:String(t??"")}),N.jsx("span",{className:"text-sm break-words",children:r??(n==null?"—":String(n))})]}),separator:({className:r,...e})=>N.jsx("div",{className:`shrink-0 bg-border h-[1px] w-full ${r||""}`,...e}),markdown:({content:r,className:e})=>N.jsx("div",{className:`max-w-none text-sm space-y-2 ${e||""}`,children:N.jsx(IB,{text:String(r??"")})}),layout:({children:r,className:e,direction:t="vertical"})=>N.jsx("div",{className:`flex ${t==="horizontal"?"flex-row":"flex-col"} gap-4 ${e||""}`,children:r}),columns:({children:r,className:e})=>{const t=Array.isArray(r)?r.filter(n=>n!=null).length:r?1:0;return N.jsx("div",{className:`grid gap-4 ${e||""}`,style:{gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`},children:r})},metric:({label:r,value:e,className:t})=>N.jsxs("div",{className:Ks(DB,"p-4",t),children:[N.jsx("p",{className:"text-sm text-muted-foreground",children:String(r??"")}),N.jsx("p",{className:"mt-1 text-2xl font-bold",children:String(e??"")})]}),"bar-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>N.jsx($re,{data:mm(r,a,i),height:e,xLabel:t,yLabel:n}),"line-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>N.jsx(Ure,{data:mm(r,a,i),height:e,xLabel:t,yLabel:n}),"area-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>N.jsx(Hre,{data:mm(r,a,i),height:e,xLabel:t,yLabel:n}),"pie-chart":({data:r,height:e,showLabel:t,showLegend:n,radius:a,highlightName:i,nameField:o,valueField:s})=>N.jsx(Wre,{data:Yne(r,o,s),height:e,showLabel:t,showLegend:n,radius:a,highlightName:i}),sparkline:({data:r,height:e,width:t,color:n,trend:a})=>N.jsx(Yre,{data:r,height:e,width:t,color:n,trend:a}),"stacked-area-chart":({data:r,series:e,height:t,xLabel:n,yLabel:a,onSeriesClick:i,onDateRangeSelect:o})=>N.jsx(Xre,{data:r,series:e,height:t,xLabel:n,yLabel:a,onSeriesClick:i,onDateRangeSelect:o})},Xne=new Set(["urgency","severity","sentiment","trend","status","priority"]),Zne={critical:"bg-red-500/15 text-red-400 border-red-500/30",high:"bg-orange-500/15 text-orange-400 border-orange-500/30",medium:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",low:"bg-green-500/15 text-green-400 border-green-500/30"};function jne(r,e){if(r==null)return N.jsx("span",{className:"text-muted-foreground",children:"–"});const t=String(r);if(t.startsWith("http://")||t.startsWith("https://"))return N.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e==="url"?"↗ Link":t});if(e==="subreddit"&&typeof r=="string")return N.jsxs("a",{href:`https://reddit.com/r/${r}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:["r/",r]});if(Xne.has(e)&&typeof r=="string"){const n=Zne[r.toLowerCase()]??"bg-secondary text-secondary-foreground border-border",a=r.replace(/[_-]/g," ").replace(/\b\w/g,i=>i.toUpperCase());return N.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:a})}return typeof r=="number"?N.jsx("span",{className:"font-mono tabular-nums",children:r}):typeof r=="boolean"?N.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r?"bg-green-500/15 text-green-400 border-green-500/30":"bg-secondary text-secondary-foreground border-border"}`,children:r?"Yes":"No"}):N.jsx("span",{className:"whitespace-pre-wrap",children:t})}function qne({rows:r,columns:e,title:t}){return N.jsxs("div",{className:"space-y-2",children:[t&&N.jsx("h4",{className:"text-sm font-semibold",children:t}),N.jsx(Une,{rows:r,columns:e.map(n=>({name:n})),openLink:()=>{},renderCell:(n,a)=>jne(n,a)})]})}const Mv=fV;function Pu(r,e,t){if(r.type==="text")return r.content;if(r.type==="data"){const u=r,f=Mv(e.data,u.path),c=f!==void 0?f:u.fallback,v=Cd(c,u.format);if(v.length>100&&(v.includes(`
|
|
96
96
|
`)||/[#*-]/.test(v))){const h=WI.markdown;return h?N.jsx(h,{content:v}):v}return v}if(r.type==="if"){const u=r;return Mv(e.data,u.condition)?Pu(u.then,e,t):u.else?Pu(u.else,e,t):null}if(r.type==="each"){const u=r,f=Mv(e.data,u.items);return Array.isArray(f)?f.map((c,v)=>{const h=u.as,d={...e,data:{...e.data,[h]:c,[`${h}Index`]:v}};if(typeof u.render=="string"){const p=`{{${h}}}`,g=typeof c=="string"?c:JSON.stringify(c);return u.render.split(p).join(g)}return Pu(u.render,d,v)}):null}const n=r,a=e.components?.[n.type]??WI[n.type];if(!a)return console.warn(`Unknown component type: ${n.type}`),null;const i=u=>cV(u,e.actions,f=>Mv(e.data,f)),o=hV(r,n.props),s={};for(const[u,f]of Object.entries(o)){if(/^on[A-Z]/.test(u))continue;const c=i(f);s[u]=c}for(const[u,f]of Object.entries(o)){if(!/^on[A-Z]/.test(u))continue;let c=i(f);if(typeof c!="function"&&e.onAction){const v=rL(f,s.value);v&&e.interactions?.[v.action]&&(c=(...h)=>e.onAction?.(Wne(f,h,s.value)??v))}if(typeof c!="function"){f!==void 0&&console.warn(`Ignoring non-function handler for "${u}" (got ${typeof c}). Bind actions as "@actionName".`);continue}s[u]=c}if(n.type==="table"&&Array.isArray(s.data)&&Array.isArray(s.columns)){const u=s.data,f=s.columns,c=s.title;return N.jsx(qne,{rows:u,columns:f,title:c},t)}const l=n.children?.map((u,f)=>Pu(u,e,f));return N.jsx(a,{...s,children:l},t)}function Kne(r,e,t,n,a,i){const o={data:e,actions:t,onAction:n,interactions:a,components:i};return Pu(r.root,o)}function uae({template:r,data:e,actions:t,onAction:n,interactions:a,components:i}){return N.jsx(N.Fragment,{children:Kne(r,e,t,n,a,i)})}const Jne=/^\d{4}-\d{2}-\d{2}$/;function Bx(r){if(Jne.test(r)){const[e,t,n]=r.split("-").map(Number),a=new Date(0);return a.setHours(0,0,0,0),a.setFullYear(e,t-1,n),a}return new Date(r)}function _B(r,e){const t=Bx(r);return Number.isNaN(t.getTime())?r:e?t.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):Iv(t,"LLL dd, y")}function bd(r){return String(r??"").split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function nh(r,e){return e.title||e.description||bd(r)}function Qne(r){return r.title&&r.description&&r.description!==r.title?r.description:void 0}function SB(r){return r.replace(/[^a-zA-Z0-9_-]/g,"-")}function eae(r,e=!1){return r?_B(r,e):e?"Pick a date and time":"Pick a date"}function _m(r){if(!r)return"";const e=Bx(r);if(Number.isNaN(e.getTime()))return"";const t=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-t).toISOString().slice(0,16)}function YI(r){if(!r)return;const e=new Date(r);if(!Number.isNaN(e.getTime()))return e.toISOString()}function Dv(r,e){const t=e==="slug"?r.slug:r.metadata?.[e];return t==null?"":String(t)}function tae({control:r}){const e=[r.set_by,r.set_at?GB(r.set_at):null].filter(Boolean).join(" · ");return N.jsxs(HB,{children:[N.jsx($B,{asChild:!0,children:N.jsx("button",{type:"button",className:"shrink-0 text-emerald-600 hover:text-emerald-500 dark:text-emerald-400","aria-label":"Set by a person",children:N.jsx(UB,{className:"h-3 w-3"})})}),N.jsxs(WB,{className:"max-w-xs space-y-1",children:[N.jsx("div",{className:"text-xs font-medium",children:"Set by a person"}),N.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:"Automations ask for approval before changing it."}),r.note?N.jsx("div",{className:"text-xs text-primary-foreground/90",children:r.note}):null,e?N.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:e}):null]})]})}function XI({id:r,value:e,onChange:t,readonly:n,ariaLabel:a,ariaDescribedBy:i,includeTime:o=!1,clearable:s}){const l=e?Bx(e):void 0,[u,f]=ze.useState(()=>_m(e).slice(11));return ze.useEffect(()=>{f(_m(e).slice(11))},[e]),N.jsx("div",{className:"relative",children:N.jsxs(JB,{children:[N.jsx(QB,{asChild:!0,children:N.jsxs(qr,{id:r,"aria-label":a,"aria-describedby":i,type:"button",variant:"outline",disabled:n,className:Ks("w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!e&&"text-muted-foreground"),children:[N.jsx(eV,{className:"mr-2 h-4 w-4 shrink-0"}),N.jsx("span",{className:"truncate",children:eae(e,o)})]})}),N.jsxs(tV,{className:"w-auto space-y-3 p-0",align:"start",children:[N.jsx(rV,{mode:"single",selected:l,defaultMonth:l,onSelect:c=>{if(!c)return;if(!o){t(Iv(c,"yyyy-MM-dd"));return}const v=u||"00:00";t(YI(`${Iv(c,"yyyy-MM-dd")}T${v}`))},initialFocus:!0}),o?N.jsxs("div",{className:"border-t p-3 pt-0",children:[N.jsx(xm,{htmlFor:`${r}-time`,className:"text-xs text-muted-foreground",children:"Time"}),N.jsx(W_,{id:`${r}-time`,type:"time",value:u,onChange:c=>{f(c.target.value);const v=e?_m(e).slice(0,10):l?Iv(l,"yyyy-MM-dd"):"";v&&t(YI(`${v}T${c.target.value}`))},disabled:n})]}):null,s&&e?N.jsx("div",{className:"border-t p-2",children:N.jsx(qr,{type:"button",variant:"ghost",size:"sm",className:"w-full",onClick:()=>t(void 0),children:"Clear"})}):null]})]})})}function rae({id:r,value:e,onChange:t,readonly:n,ariaLabel:a,ariaDescribedBy:i,entityType:o,lookupField:s,numeric:l=!1,orgContext:u}){const f=p=>{if(p===void 0||p==="")return t(void 0);if(!l)return t(p);const g=Number(p);t(Number.isFinite(g)?g:p)},{data:c}=YB(o,u,{limit:XB}),v=(c?.entities??[]).filter(p=>Dv(p,s)!==""),h=e==null?"":String(e),d=v.find(p=>Dv(p,s)===h);return u?n?N.jsx("div",{className:"flex h-9 items-center rounded-md border border-input bg-muted px-3 text-sm",children:d?.name||h||"-"}):N.jsx(ZB,{contentClassName:"w-[320px]",searchPlaceholder:`Search ${bd(o).toLowerCase()}...`,emptyText:`No ${o} found.`,trigger:p=>N.jsxs(qr,{id:r,"aria-label":a,"aria-describedby":i,type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"w-full justify-between",children:[N.jsx("span",{className:Ks("truncate",!h&&"text-muted-foreground"),children:d?.name||h||`Select ${bd(o).toLowerCase()}`}),N.jsx(KB,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(p,g)=>{const y=g.trim(),m=y.length>0&&!v.some(_=>Dv(_,s)===y);return N.jsxs(N.Fragment,{children:[m?N.jsxs(Gx,{value:`use ${y}`,onSelect:()=>{f(y),p()},children:[N.jsx(jB,{className:"mr-2 h-3.5 w-3.5 opacity-60"}),N.jsxs("span",{className:"truncate",children:["Use ",N.jsx("span",{className:"font-medium",children:y})]})]}):null,v.map(_=>{const S=Dv(_,s),x=S===h;return N.jsxs(Gx,{value:`${_.name} ${_.slug} ${_.entity_type} ${S}`,onSelect:()=>{f(S||void 0),p()},children:[N.jsx(qB,{className:Ks("mr-2 h-4 w-4",x?"opacity-100":"opacity-0")}),N.jsxs("div",{className:"min-w-0",children:[N.jsx("div",{className:"truncate",children:_.name}),N.jsx("div",{className:"text-xs text-muted-foreground",children:_.slug})]})]},`${_.id}-${S}`)})]})}}):N.jsx(W_,{id:r,"aria-label":a,"aria-describedby":i,type:l?"number":"text",value:h,onChange:p=>f(p.target.value||void 0),disabled:n})}function xB({fieldPath:r,fieldKey:e,prop:t,value:n,onChange:a,isRequired:i,readonly:o,orgContext:s,ariaLabel:l,helpId:u}){const f=nh(e,t),c=SB(r),v=o||t.readOnly===!0,h=t.type==="object"||!!t.properties,d=t.type==="array"&&!!t.items&&(t.items?.type==="object"||!!t.items?.properties),p=t.type==="array"&&!!t.items&&(t.items?.type==="string"||t.items?.type==="number"||t.items?.type==="integer"||t.items?.type==="boolean");if(t.type==="boolean")return N.jsx(RB,{id:c,"aria-label":l,"aria-describedby":u,checked:n??!1,onCheckedChange:y=>a(y),disabled:v});let g;if(t.enum&&Array.isArray(t.enum))g=N.jsxs(EB,{value:n==null?"":String(n),onValueChange:y=>a(y===""?void 0:t.type==="number"||t.type==="integer"?Number(y):y),disabled:v,children:[N.jsx(kB,{id:c,"aria-label":l,"aria-describedby":u,children:N.jsx(OB,{placeholder:`Select ${f.toLowerCase()}`})}),N.jsx(NB,{children:t.enum.map(y=>{const m=String(y);return N.jsx(BB,{value:m,children:bd(m)},m)})})]});else if(t["x-link-entity-type"])g=N.jsx(rae,{id:c,value:n,onChange:a,readonly:v,ariaLabel:l,ariaDescribedBy:u,entityType:t["x-link-entity-type"],lookupField:t["x-link-lookup-field"]||"slug",numeric:t.type==="number"||t.type==="integer",orgContext:s});else if(t.type==="number"||t.type==="integer")g=N.jsx(VB,{id:c,ariaLabel:l,ariaDescribedBy:u,value:n,onChange:a,integer:t.type==="integer",placeholder:`Enter ${f.toLowerCase()}`,readOnly:v});else if(h){const y=Object.entries(t.properties??{}),m=new Set(t.required??[]),_=ac(n)?n:{};g=y.length===0||!ac(n)&&n!==void 0&&n!==null?N.jsx(Vx,{id:c,value:n,ariaLabel:`${f} JSON object`,ariaDescribedBy:u,readOnly:v,onChange:a}):N.jsx("fieldset",{"aria-label":l,"aria-labelledby":l?void 0:`${c}-label`,"aria-describedby":u,className:"space-y-3 rounded-md border p-3",children:y.map(([S,x])=>N.jsx(wB,{fieldPath:`${r}.${S}`,fieldKey:S,prop:x,value:_[S],onChange:w=>{const b={..._};w===void 0?delete b[S]:b[S]=w,a(b)},isRequired:m.has(S),readonly:v,orgContext:s},S))})}else if(p)g=n!=null&&!zB(n)?N.jsx(Cp,{id:c,value:n,ariaLabel:`${f} JSON array`,ariaDescribedBy:u,readOnly:v,itemType:t.items?.type,itemEnum:t.items?.enum,minItems:t.minItems,maxItems:t.maxItems,onChange:a}):N.jsx(FB,{id:c,value:n,itemType:t.items?.type,itemEnum:t.items?.enum,minItems:t.minItems,maxItems:t.maxItems,ariaLabel:l,ariaDescribedBy:u,readOnly:v,showHelp:!l,onChange:a});else if(d&&t.items){const y=Array.isArray(n)?n:[],m=Object.entries(t.items.properties??{}),_=new Set(t.items.required??[]),S=t.maxItems===void 0||y.length<t.maxItems,x=t.minItems===void 0||y.length>t.minItems;g=!Array.isArray(n)&&n!==void 0&&n!==null||m.length>0&&y.some(w=>!ac(w))?N.jsx(Cp,{id:c,value:n,ariaLabel:`${f} JSON array`,ariaDescribedBy:u,readOnly:v,itemType:"object",minItems:t.minItems,maxItems:t.maxItems,onChange:a}):m.length===0?N.jsxs("fieldset",{"aria-label":l,"aria-labelledby":l?void 0:`${c}-label`,"aria-describedby":u,className:"space-y-3",children:[y.length===0?N.jsx("p",{className:"text-sm text-muted-foreground",children:"No rows"}):y.map((w,b)=>N.jsxs("fieldset",{className:"space-y-2 rounded-md border p-3",children:[N.jsxs("legend",{className:"px-1 text-xs font-medium text-muted-foreground",children:["Row ",b+1]}),N.jsx(Vx,{id:`${c}-${b}-json`,value:w,ariaLabel:`${f} row ${b+1} JSON object`,readOnly:v,onChange:T=>{const C=[...y];C[b]=T,a(C)}}),v?null:N.jsxs(qr,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove row ${b+1}`,disabled:!x,onClick:()=>a(y.filter((T,C)=>C!==b)),children:[N.jsx(zx,{className:"mr-1.5 h-4 w-4"}),"Remove row"]})]},`${r}.${b}`)),v?null:N.jsxs(qr,{type:"button",variant:"outline",size:"sm",disabled:!S,onClick:()=>a([...y,{}]),children:[N.jsx(Fx,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]}):N.jsxs("fieldset",{"aria-label":l,"aria-labelledby":l?void 0:`${c}-label`,"aria-describedby":u,className:"space-y-3",children:[N.jsx("div",{className:"rounded-md border",children:N.jsxs(JI,{children:[N.jsx(QI,{children:N.jsxs(zs,{children:[m.map(([w,b])=>N.jsxs(Sm,{children:[nh(w,b),_.has(w)?N.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]},w)),v?null:N.jsx(Sm,{className:"w-12"})]})}),N.jsx(eL,{children:y.length===0?N.jsx(zs,{children:N.jsx(Ru,{colSpan:m.length+(v?0:1),className:"text-sm text-muted-foreground",children:"No rows"})}):y.map((w,b)=>{const T=ac(w)?w:{};return N.jsxs(zs,{children:[m.map(([C,A])=>N.jsx(Ru,{className:"align-top",children:N.jsx(xB,{fieldPath:`${r}.${b}.${C}`,fieldKey:C,prop:A,ariaLabel:nh(C,A),value:T[C],onChange:M=>{const L=[...y],I={...T};M===void 0?delete I[C]:I[C]=M,L[b]=I,a(L)},isRequired:_.has(C),readonly:v,orgContext:s})},C)),v?null:N.jsx(Ru,{className:"align-top",children:N.jsx(qr,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove row ${b+1}`,disabled:!x,onClick:()=>a(y.filter((C,A)=>A!==b)),children:N.jsx(zx,{className:"h-4 w-4"})})})]},`${r}.${b}`)})})]})}),v?null:N.jsxs(qr,{type:"button",variant:"outline",size:"sm",disabled:!S,onClick:()=>a([...y,{}]),children:[N.jsx(Fx,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]})}else if(t.type==="array")g=N.jsx(Cp,{id:c,value:n,ariaLabel:`${f} JSON array`,ariaDescribedBy:u,readOnly:v,itemType:t.items?.type,itemEnum:t.items?.enum,minItems:t.minItems,maxItems:t.maxItems,onChange:a});else if(t.format==="date")g=N.jsx(XI,{id:c,value:typeof n=="string"?n:void 0,onChange:a,readonly:v,ariaLabel:l,ariaDescribedBy:u,clearable:!i});else if(t.format==="date-time")g=N.jsx(XI,{id:c,value:typeof n=="string"?n:void 0,onChange:a,readonly:v,ariaLabel:l,ariaDescribedBy:u,includeTime:!0,clearable:!i});else{const y=t.format==="uri"||t.format==="url";g=N.jsx(W_,{id:c,"aria-label":l,"aria-describedby":u,type:y?"url":"text",value:n??"",onChange:m=>a(m.target.value||void 0),placeholder:y?"https://example.com":`Enter ${f.toLowerCase()}`,disabled:v})}return g}function wB({fieldPath:r,fieldKey:e,prop:t,value:n,onChange:a,isRequired:i,readonly:o,control:s,orgContext:l,customControl:u}){const f=nh(e,t),c=Qne(t),v=SB(r),h=c?`${v}-description`:void 0,d=c?N.jsx("p",{id:h,className:"text-xs text-muted-foreground",children:c}):null,p=s?N.jsx(tae,{control:s}):null,g=u??N.jsx(xB,{fieldPath:r,fieldKey:e,prop:t,value:n,onChange:a,isRequired:i,readonly:o,orgContext:l,helpId:h});if(t.type==="boolean"){const m=N.jsxs("div",{className:"flex items-center space-x-2 py-1",children:[g,N.jsxs(xm,{htmlFor:v,className:"flex items-center gap-1.5 font-normal",children:[f,p]})]});return d?N.jsxs("div",{className:"space-y-1",children:[m,d]}):m}const y=t.type==="object"||!!t.properties||t.type==="array"&&!!t.items&&(t.items?.type==="object"||!!t.items?.properties);return N.jsxs("div",{className:"space-y-1.5",children:[y?N.jsxs("p",{id:`${v}-label`,className:"flex items-center gap-1.5 text-sm font-medium",children:[N.jsxs("span",{children:[f,i?N.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),p]}):N.jsxs(xm,{htmlFor:v,className:"flex items-center gap-1.5",children:[N.jsxs("span",{children:[f,i?N.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),p]}),g,d]})}function nae(r){const e=PB(r);return e===null||e===""?void 0:e}function fae(r){const e={};for(const[t,n]of Object.entries(r)){const a=nae(n);a!==void 0&&(e[t]=a)}return e}function cae({schema:r,values:e,onValuesChange:t,readonly:n=!1,fieldControls:a,orgContext:i,renderControl:o}){const s=r,l=s?.properties,u=new Set(s?.required??[]),f=(c,v)=>{t({...e,[c]:v})};return!l||Object.keys(l).length===0?N.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"No additional fields required for this entity type."}):N.jsx("div",{className:"space-y-4",children:Object.entries(l).map(([c,v])=>"x-measure"in v||"x-dimension"in v?null:N.jsx(wB,{fieldPath:c,fieldKey:c,prop:v,value:e[c],onChange:h=>f(c,h),isRequired:u.has(c),readonly:n,control:a?.[c],orgContext:i,customControl:o?.(c,v,e[c])},c))})}function vae(r){return r.parent_id&&r.parent_slug&&r.parent_entity_type?[{entity_type:r.parent_entity_type,slug:r.parent_slug},{entity_type:r.entity_type,slug:r.slug}]:[{entity_type:r.entity_type,slug:r.slug}]}function hae(r){return typeof r=="string"?JSON.parse(r):r??{}}function ZI(r){return r?r["x-currency"]||r.format==="currency"?"currency":r.format==="uri"||r.format==="url"?"url":r.enum?.length?"enum":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":"auto":"auto"}function jI(r){return r==null||r===""||Array.isArray(r)&&r.length===0}function aae(r){return Array.isArray(r)&&r.some(e=>typeof e=="object"&&e!==null)}function iae(r,e,t){return typeof r=="string"&&(e?.format==="date"||e?.format==="date-time")?_B(r,e.format==="date-time"):Cd(r,t)}function qI({value:r,prop:e,format:t,resolveLink:n,className:a}){const i=String(r),o=n?.(i);if(o)return N.jsx(nV,{to:o.to,className:"text-primary hover:underline",onClick:u=>u.stopPropagation(),children:o.label});const s=typeof r=="string"&&Zu(r),l=t==="url"&&!s?i:iae(r,e,t);return s?N.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline [overflow-wrap:anywhere]",onClick:u=>u.stopPropagation(),children:l}):N.jsx("span",{className:a,children:l})}function dae({value:r,prop:e,format:t,resolveLink:n,empty:a="-",className:i}){if(jI(r))return N.jsx("span",{className:"text-muted-foreground",children:a});if(aae(r)){const o=r.length;return N.jsxs("span",{className:i,children:[o," ",o===1?"item":"items"]})}if(Array.isArray(r)){const o=r.filter(l=>!jI(l)),s=e?.items??e;return N.jsx("span",{className:Ks("inline-flex flex-wrap gap-x-1",i),children:o.map((l,u)=>N.jsxs("span",{children:[N.jsx(qI,{value:l,prop:s,format:t??ZI(s),resolveLink:n}),u<o.length-1&&","]},`${u}:${String(l)}`))})}return typeof r=="object"?N.jsx("span",{className:i,children:Cd(r)}):N.jsx(qI,{value:r,prop:e,format:t??ZI(e),resolveLink:n,className:i})}function oae(r,e){if(typeof r!="string"||!e||e.length===0)return r;const t=r.trim();if(e.includes(t))return t;try{const n=JSON.parse(t);if(typeof n=="string"&&e.includes(n))return n}catch{}return r}function pae(r,e){if(!r)return{};const t=e?.properties;return t?Object.fromEntries(Object.entries(r).map(([n,a])=>[n,oae(a,t[n]?.enum)])):{...r}}export{cae as D,tae as F,uae as J,Al as L,dae as S,Qne as a,fae as b,nae as c,oae as d,vae as e,Gne as f,nh as g,kne as h,pm as i,Ure as j,Yre as k,xB as l,pae as n,hae as p,Rx as u};
|
|
97
|
-
//# sourceMappingURL=schema-value-normalization-
|
|
97
|
+
//# sourceMappingURL=schema-value-normalization-CKdPjdPC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iL as t,j as r}from"./index-9YuSRymd.js";import{a as s}from"./agents-workbench-DJ67GZ93.js";import"./agent-editor-form-DsSoeQeF.js";import"./model-selector-CDrAjH31.js";import"./proposal-review-shell-CFhOqCLf.js";function g(){const{owner:o,agentId:e}=t.useParams(),n=t.useSearch();return r.jsx(s,{owner:o,agentId:e,tab:"settings",runId:n.run_id})}export{g as component};
|
|
2
|
+
//# sourceMappingURL=settings-CgZ5Z7wD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i,j as e,L as c,t as m,Q as t,af as n,B as l,Z as d}from"./index-
|
|
2
|
-
//# sourceMappingURL=settings-
|
|
1
|
+
import{i,j as e,L as c,t as m,Q as t,af as n,B as l,Z as d}from"./index-9YuSRymd.js";import{F as o}from"./full-page-spinner-BVbcpW3R.js";function h(){const{session:s,isReady:r}=i();if(!r)return e.jsx(o,{});if(!s||!s.user)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-md mx-auto text-center space-y-4",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not signed in"}),e.jsx("p",{className:"text-muted-foreground",children:"Please sign in to view your settings."}),e.jsx(c,{to:"/auth/login",search:m({intent:"sign-in"}),className:"inline-block px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Sign In"})]})});const a=async()=>{await d(),window.location.href="/"};return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings"})]}),e.jsxs("div",{className:t(n,"p-6 space-y-6"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Profile"}),e.jsxs("div",{className:"flex items-center gap-4",children:[s.user.image?e.jsx("img",{src:s.user.image,alt:s.user.name||"User",referrerPolicy:"no-referrer",className:"h-16 w-16 rounded-full object-cover"}):e.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xl font-medium text-primary",children:(s.user.name||s.user.email||"U")[0].toUpperCase()})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.user.name||"User"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.user.email})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Name"}),e.jsx("p",{className:"mt-1",children:s.user.name||"Not set"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Email"}),e.jsx("p",{className:"mt-1",children:s.user.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"User ID"}),e.jsx("p",{className:"mt-1 text-xs font-mono text-muted-foreground",children:s.user.id})]})]})]}),e.jsxs("div",{className:t(n,"p-6 space-y-4"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Account"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."}),e.jsx(l,{variant:"destructive",onClick:a,children:"Sign Out"})]})]})})}export{h as component};
|
|
2
|
+
//# sourceMappingURL=settings-VDNiffKU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iK as r,j as t,O as s}from"./index-9YuSRymd.js";import{A as e}from"./agent-skill-context-DFucg4c4.js";import"./core.esm-BupT3V0i.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-DgDGscm5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as y,ch as b,eI as _,j as e,B as j,eJ as v,S as L,by as C,L as R,dG as E,s as S}from"./index-
|
|
2
|
-
//# sourceMappingURL=source-record-panels-
|
|
1
|
+
import{n as y,ch as b,eI as _,j as e,B as j,eJ as v,S as L,by as C,L as R,dG as E,s as S}from"./index-9YuSRymd.js";import{a as F,b as P}from"./events-feed-DO3IiJO2.js";function f({failures:i,onRetry:c,isError:d=!1,isFetching:l=!1}){return i.length===0&&!d?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:[i.length<=1?"A source":`${i.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:l,children:"Retry"})]})}function M({record:i,orgContext:c,filters:d}){const{orgContext:l}=y(),t=c??l,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>S(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:o,isLoading:x,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:u,isFetchingNextPage:s}=_(i,t,d),N=o?.pages.flatMap(r=>r.events)??[],m=o?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:u,onRetry:()=>void g()}),e.jsx(F,{isLoading:x,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:u,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 k({record:i,ownerSlug:c,orgContext:d}){const{orgContext:l}=y(),{data:t,isLoading:p,isError:o,refetch:x,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:u}=v(i,d??l);return p?e.jsx(L,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{failures:t.failures,isError:o,isFetching:a,onRetry:()=>{if(a)return;const s=u instanceof C&&u.status===400;h&&!s||!o&&n?g():x()}}),t.links.length===0&&t.failures.length===0&&!n&&!o&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&n&&!o&&t.failures.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsx("ul",{className:"space-y-1",children:t.links.map(s=>e.jsx("li",{children:e.jsx(R,{to:E(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&&!o&&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 x()})}export{M as S,k as a};
|
|
2
|
+
//# sourceMappingURL=source-record-panels-BdfOVPWn.js.map
|