@lobu/runtime-server 21.0.0 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/automations.json +0 -8
- package/dist/component.json +1 -1
- package/dist/connectors/github.ts +269 -194
- package/dist/connectors/google_calendar.ts +36 -132
- package/dist/connectors/jira.ts +13 -4
- package/dist/connectors/producthunt.ts +3 -1
- package/dist/connectors/reddit.ts +34 -4
- package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
- package/dist/dependencies.bun.lock +11 -11
- package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
- package/dist/owletto/dist/assets/{_-DrcppoWh.js → _-XlUwOWCI.js} +2 -2
- package/dist/owletto/dist/assets/{_agentId-HNcmgH56.js → _agentId-B2DrawIk.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-BCfrLnUS.js → _automationId-BLnqLtUv.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-126-iG9w.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-CywE9A3N.js → _connectorKey.index-C_yKycN_.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-CNETA_rY.js → _conversationId-CpuEvflw.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-CAVpXf8s.js → _deploymentId-BL9tnDFl.js} +1 -1
- package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
- package/dist/owletto/dist/assets/{_owner-D2eh4R90.js → _owner-Cg50UU6m.js} +1 -1
- package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
- package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
- package/dist/owletto/dist/assets/{_slug-DoIaJBbh.js → _slug-DbD-wv2m.js} +1 -1
- package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
- package/dist/owletto/dist/assets/{accept-invitation-BWRiEUsd.js → accept-invitation-BmQKbQem.js} +1 -1
- package/dist/owletto/dist/assets/{activity-route-view-rVdTeVXN.js → activity-route-view-BvtAoGVt.js} +1 -1
- package/dist/owletto/dist/assets/{agent-card-controls-JubkhcHt.js → agent-card-controls-bhTMPoVi.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-Btcy4Cu1.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-Chfqn8iL.js → agent-connect-pages-DkDlFVY5.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-BrOkwfg8.js → agent-editor-form-DwHD9j1Y.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-CHM7JbIl.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-DsiGx1fn.js → agent-loading-shells-BQLjzMPy.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-L_gFvSu1.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-D7tOJ8Pb.js → agent-skill-context-s42Q4Wjo.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-AylS-B9v.js → agent-skills-route-Cwq1QrhW.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-B7tCQ9zd.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-DOYh7WLW.js → agent-thread-D7AGGjRV.js} +1 -1
- package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-DOwn78eL.js → agents-workbench-Cl7FO7b3.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-fJ_RRn1Z.js → app._appId-CqYz3AOO.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-CMprQht5.js → automation-detail-content-CKSywvzE.js} +1 -1
- package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/{calendar-BbD1N97u.js → calendar-CHXehtu0.js} +1 -1
- package/dist/owletto/dist/assets/{callback-PELM84Lh.js → callback-DZ3YyXeV.js} +1 -1
- package/dist/owletto/dist/assets/{card-DpLjEqIc.js → card-4Ull9W6d.js} +1 -1
- package/dist/owletto/dist/assets/{claim-BLLvLOBM.js → claim-BGLCPLXq.js} +1 -1
- package/dist/owletto/dist/assets/{clients-Bd8WpHSV.js → clients-C7ubnFsS.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-DGJQDoHD.js → code-editor-BHiWR94J.js} +1 -1
- package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-BYGmFRCF.js → connected._clientId-7RU89sVW.js} +1 -1
- package/dist/owletto/dist/assets/{connection-B0O8OZuK.js → connection-CTaUGXl6.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-DZjtoEfm.js → connection-feed-detail-B1xieiEh.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-D_g9gGXU.js → connector-provenance-DRdUEmQ1.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-BiMMm_QQ.js → connectors-NBwCLuZg.js} +1 -1
- package/dist/owletto/dist/assets/{consent-CIzW-960.js → consent-fmhPPlpi.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-Ds4Nuq9d.js → core.esm-C-eNiUAl.js} +1 -1
- package/dist/owletto/dist/assets/{create-BvCaqhwK.js → create-8bBbQJGY.js} +1 -1
- package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
- package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
- package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
- package/dist/owletto/dist/assets/{create._connectorKey--qDi1h6S.js → create._connectorKey-CHAotlsF.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-h8_zIyZD.js → cronstrue-C5yTgk5z.js} +1 -1
- package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
- package/dist/owletto/dist/assets/{deployments-ICDss7yS.js → deployments-D1gbQwsy.js} +1 -1
- package/dist/owletto/dist/assets/{deployments-body-DulCUAMt.js → deployments-body-DycIGlnL.js} +1 -1
- package/dist/owletto/dist/assets/{device-kTL2l_cz.js → device-DyPnQkhO.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-BmD4pv_e.js → device-pin-tombstone-CwJitllC.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-BqudjhFu.js → device-rows-BBhW1C7Y.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-CsLJJ6jv.js → device._deviceId-XswfXHOc.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-ErxYvMDH.js → entity-options-utGBmFX0.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-CYRAwUGO.js → entity-page-BxwuqqWk.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-BlAizGlz.js → entity-type-page-BrWqk6so.js} +1 -1
- package/dist/owletto/dist/assets/{event-page-DTXPxc-E.js → event-page-LIm4EDmJ.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-L3c-LLiJ.js → events-feed-C4L8mQV7.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-BxcYpJXx.js → full-page-spinner-DsU-Cb3L.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
- package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
- package/dist/owletto/dist/assets/{index-13rywWam.js → index-1YrrvVJ4.js} +1 -1
- package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
- package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
- package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
- package/dist/owletto/dist/assets/{index--lEHrFE4.js → index-CQ4s6nzy.js} +1 -1
- package/dist/owletto/dist/assets/{index-DAv5S2aK.js → index-CpWKAAGX.js} +1 -1
- package/dist/owletto/dist/assets/{index-QcHQZI87.js → index-D2dcENg2.js} +1 -1
- package/dist/owletto/dist/assets/{index-CheCJomo.js → index-DCK0KhMM.js} +1 -1
- package/dist/owletto/dist/assets/{index-BRvT0VV9.js → index-DXqiRON3.js} +1 -1
- package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
- package/dist/owletto/dist/assets/{index-DdGjY1Hb.js → index-DtRfQcRH.js} +1530 -1530
- package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
- package/dist/owletto/dist/assets/{index-CFkj9iR_.js → index-DwtfHCHB.js} +1 -1
- package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
- package/dist/owletto/dist/assets/{index-B_-MLsof.js → index-nOYvNROJ.js} +1 -1
- package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
- package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
- package/dist/owletto/dist/assets/{json-diff-BV2STDGj.js → json-diff-DYeX-xLk.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-CT5n4ND_.js → list-skeleton-s4GPSJ8J.js} +1 -1
- package/dist/owletto/dist/assets/{login-DKsgABYt.js → login-Di5VF2F_.js} +1 -1
- package/dist/owletto/dist/assets/{logout-D_CP-emw.js → logout-BuaQGSnw.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-BTgmlfFJ.js → member-scope-gate-CJqJZk7T.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-FHaJC3ML.js → memory-browse-page-Bibfs2sK.js} +1 -1
- package/dist/owletto/dist/assets/{missing-view-Bve6pJP-.js → missing-view-CD4DOaG8.js} +1 -1
- package/dist/owletto/dist/assets/{model-selector-BLCEahny.js → model-selector-XC5CI2Et.js} +1 -1
- package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
- package/dist/owletto/dist/assets/{new-CirOK0Sw.js → new-BzkA1sq2.js} +1 -1
- package/dist/owletto/dist/assets/{new-DzapH2sV.js → new-C3f0BShb.js} +1 -1
- package/dist/owletto/dist/assets/{new-BAIGSdfp.js → new-DA5LF6iB.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-BF7jaswv.js → oauth-workspace-access-D6epOq0R.js} +1 -1
- package/dist/owletto/dist/assets/{organization-D9RPsWG-.js → organization-DOtBRqDQ.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-BlRONw-u.js → permissions-D8uJHINS.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-uskeFIUr.js → proposal-review-shell-C3K-JXjb.js} +1 -1
- package/dist/owletto/dist/assets/{recent-CmJ4Is6V.js → recent-CFcWceBl.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-Dyf4t8kR.js → renderer-1nRJFMGx.js} +1 -1
- package/dist/owletto/dist/assets/{reset-password-BVIeE1Zm.js → reset-password-9RTWhBEb.js} +1 -1
- package/dist/owletto/dist/assets/{runs-CzBeUzlQ.js → runs-_yVh6PPB.js} +1 -1
- package/dist/owletto/dist/assets/{runs-panel-D7l1uLGm.js → runs-panel-B2852xus.js} +1 -1
- package/dist/owletto/dist/assets/{runs-table-dATyiBg2.js → runs-table--dnFQatY.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-DgMkyVVE.js → schema-value-normalization-BspxVEGy.js} +1 -1
- package/dist/owletto/dist/assets/{settings-Co1wj_m6.js → settings-9lDASETT.js} +1 -1
- package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
- package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
- package/dist/owletto/dist/assets/{switch-DDkPrV3p.js → switch-CxDXvPGE.js} +1 -1
- package/dist/owletto/dist/assets/{use-applied-views-DELwQQh7.js → use-applied-views-DvMT3wap.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-CGA3AaKm.js → use-mention-search-CeTEE3oE.js} +1 -1
- package/dist/owletto/dist/assets/{view-frame-DDr-Xtet.js → view-frame-HoBawpT2.js} +1 -1
- package/dist/owletto/dist/index.html +1 -1
- package/dist/providers.json +0 -1
- package/dist/server-main.bundle.mjs +2365 -3969
- package/npm-shrinkwrap.json +41 -41
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +0 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
- package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
- package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
- package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
- package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +17 -0
- package/vendor/core/dist/contracts/worker/protocol.js +12 -1
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/provider-config-types.d.ts +0 -9
- package/vendor/core/dist/sdk-compat.d.ts +1 -1
- package/vendor/core/package.json +6 -1
- package/vendor/views/dist/api.d.ts +9 -4
- package/vendor/views/dist/api.js +6 -2
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-CwFknmeA.js +0 -1
- package/dist/owletto/dist/assets/_agentId-Cr57JKYx.js +0 -1
- package/dist/owletto/dist/assets/_name-BP7OlVxL.js +0 -1
- package/dist/owletto/dist/assets/_shape-BqV8tSfw.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-2xTjhL_C.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-8ePnWEg-.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-D8rjUFLV.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-DhVOkzYd.js +0 -1
- package/dist/owletto/dist/assets/agents-0ncYwbz6.js +0 -1
- package/dist/owletto/dist/assets/automations-0ncYwbz6.js +0 -1
- package/dist/owletto/dist/assets/connect-Cx49f4J0.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-BDFBqKSA.js +0 -1
- package/dist/owletto/dist/assets/create--fsxroj2.js +0 -1
- package/dist/owletto/dist/assets/create-BqL-ahEf.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-DN2w080o.js +0 -2
- package/dist/owletto/dist/assets/deployments-BROg1Te8.js +0 -1
- package/dist/owletto/dist/assets/guardrails-Dh4adTXY.js +0 -1
- package/dist/owletto/dist/assets/identity-B8lKn0je.js +0 -1
- package/dist/owletto/dist/assets/index-BUp24ZJr.js +0 -1
- package/dist/owletto/dist/assets/index-Bq-q4Y7E.js +0 -1
- package/dist/owletto/dist/assets/index-CgBgOElA.js +0 -1
- package/dist/owletto/dist/assets/index-CpiW66xK.js +0 -1
- package/dist/owletto/dist/assets/index-DBi2Xr3i.js +0 -1
- package/dist/owletto/dist/assets/index-DHOha5OJ.js +0 -1
- package/dist/owletto/dist/assets/index-Dkyl7l6E.js +0 -1
- package/dist/owletto/dist/assets/index-kq4537-S.js +0 -1
- package/dist/owletto/dist/assets/models-C4N7LQAW.js +0 -1
- package/dist/owletto/dist/assets/settings-BK1GHmzb.js +0 -1
- package/dist/owletto/dist/assets/skills-DF53JcYt.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,j as e,L as Q,dd as Oe,dy as be,cs as De,e2 as Fe,e3 as _e,e4 as Me,ap as Le,ai as ze,e5 as qe,t as Be,a3 as He,aG as me,as as Ue,y as Ve,ah as G,H as Je,cj as We,ck as Qe,B as k,cn as Ke,cG as Ge,cH as Ze,J as we,cI as Xe,e6 as ke,e7 as oe,cm as le,e8 as Ye,al as et,w as ee,M as Ce,e9 as tt,ea as nt,s as Y,eb as st,ec as rt,k as it,ed as at,bI as ot,F as lt,dF as dt,ee as ct,ef as ut,aR as mt,eg as pt,Z as xt,bS as ht,x as gt,v as ft,d1 as yt,d2 as jt,d9 as vt,da as Nt,eh as bt,ei as _t,S as wt,c2 as kt,bq as Ct,I as St,cU as ge,cW as fe,aZ as Rt,cX as ye,E as Se,ej as Re,ek as At}from"./index-DdGjY1Hb.js";import{u as Ae}from"./use-applied-views-DELwQQh7.js";import{u as Et}from"./clients-Bd8WpHSV.js";import{J as Tt}from"./renderer-Dyf4t8kR.js";function $t({onIntersect:n,enabled:t,rootMargin:s="400px"}){const r=j.useRef(null),i=j.useRef(n);return i.current=n,j.useEffect(()=>{const d=r.current;if(!d||!t)return;const c=new IntersectionObserver(o=>{o[0]?.isIntersecting&&i.current()},{rootMargin:s});return c.observe(d),()=>c.disconnect()},[t,s]),r}function Pt(n,t){const s=t.parentEntityType&&t.parentEntitySlug?[{entity_type:t.parentEntityType,slug:t.parentEntitySlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}];return be(n,s)}function It({ownerSlug:n,entity:t,className:s}){const r=Pt(n,t);return e.jsxs(Q,{to:r,className:`flex items-center gap-1 text-primary hover:underline group ${s??""}`,children:[e.jsx("span",{className:"font-medium",children:t.entityName}),e.jsx(Oe,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Ee(n,t,s){return{queryKey:["event-view-match",n,t.key,t.content_hash,s],queryFn:async()=>{try{return await De("open_view",{key:t.key,scope:{event:s}},{slug:n}),!0}catch(r){if(r instanceof Fe&&(r.status===400||r.status===404))return!1;throw r}},staleTime:6e4}}function hn(n,t){const s=Ae(n??{slug:null,organizationId:null}),r=n?.slug??null,i=j.useMemo(()=>r?_e(s.data??[]):[],[r,s.data]),d=Me({queries:i.map(c=>Ee(r,c,t))});return r?{views:i.filter((c,o)=>d[o]?.data===!0),isLoading:s.data===void 0?!s.isError:d.some(c=>c.isPending),isError:s.isError||d.some(c=>c.isError),refetch:()=>{s.refetch();for(const c of d)c.isError&&c.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function Ot(n,t,s,r){const i=await Promise.all(s.map(d=>n.fetchQuery(Ee(t,d,r))));return s.find((d,c)=>i[c])??null}async function Dt(n,t,s,r){const i=await Le(`${ze}/api/${encodeURIComponent(n)}/events/${t}/actions/${encodeURIComponent(s.action)}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:r})});return await qe(i,"Could not record interaction"),i.json()}function C(n){if(typeof n!="string")return;const t=n.trim();return t.length>0?t:void 0}function pe(n){return typeof n=="boolean"?n:void 0}function Ft(n,t,s){const r=(s??"").toLowerCase();return!!(r==="prepare_comment"||r==="verify_staged_comment"||r.includes("prepare_")||r.includes("verify_staged")||t?.prepared===!0||typeof t?.verified=="boolean"||C(t?.reason_preview)&&C(t?.message)||C(n?.body)&&(C(n?.post_url)||C(n?.activity_id)))}function Mt(n,t,s){if(!Ft(n,t,s))return null;const r=(s??"").toLowerCase(),i=C(t?.body)??C(n?.body),d=C(t?.reason_preview)??C(n?.reason),c=C(t?.post_url)??C(n?.post_url)??(C(n?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${C(n?.activity_id)}`:void 0),o=pe(t?.prepared),x=pe(t?.verified),m=pe(t?.banner_shown),g=C(t?.message),h=t?.match&&typeof t.match=="object"?t.match:null,T=C(h?.text_preview),l=C(h?.author);let p="generic";r==="verify_staged_comment"||r.includes("verify")||typeof x=="boolean"?p="verify":(r==="prepare_comment"||r.includes("prepare")||o===!0||i&&c)&&(p="prepare");const f=[];return o===!0&&f.push("Staged — not posted"),o===!1&&f.push("Not staged"),x===!0&&f.push("Verified posted"),x===!1&&f.push("Not verified as posted"),m===!0&&f.push("In-page banner"),m===!1&&f.push("No banner"),{kind:p,message:g,reason:d,body:i,postUrl:c,prepared:o,bannerShown:m,verified:x,matchPreview:T,matchAuthor:l,chips:f}}const Lt={};function se(n){return n.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}const zt={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function qt(n){return n.author_name?n.author_name:n.platform?se(n.platform):n.origin_type?zt[n.origin_type]??se(n.origin_type):null}function je(n){return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?String(n):Array.isArray(n)?n.length===0?"":n.every(t=>typeof t!="object")?n.map(t=>String(t)).join(", "):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)}):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)})}const xe=1e5;function Bt({value:n}){const t=JSON.stringify(n,null,2)??"null",s=t.length>xe;return e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?t.slice(0,xe):t}),s&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",xe.toLocaleString()," of"," ",t.length.toLocaleString()," characters."]})]})}function Ht(n){return Object.entries(n).filter(([,t])=>t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:typeof t=="object"?Object.keys(t).length>0:!0).sort(([t],[s])=>t.localeCompare(s))}function Ut({breakdown:n}){if(!n)return null;const t=[{label:"Engagement",value:n.engagement,max:100},{label:"Criticality",value:n.criticality,max:100},{label:"Depth",value:n.depth,max:100},{label:"Authority",value:n.authority,max:100},{label:"Recency",value:n.recency,max:100},{label:"Quality",value:n.quality,max:100}];return e.jsx("div",{className:"space-y-2 text-sm",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),e.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function Vt({slug:n,value:t,isManual:s}){return e.jsxs(G,{variant:"secondary",className:"text-xs",children:[n,": ",t,s&&e.jsx(ke,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Jt(n){if(n&&typeof n=="object"){const t=n;if(Array.isArray(t.values))return{values:t.values.map(s=>String(s)).filter(s=>s.length>0),isManual:t.is_manual===!0};if(t.value!==void 0&&t.value!==null)return{values:[String(t.value)],isManual:t.is_manual===!0};if(typeof t.values=="string"&&t.values.length>0)return{values:[t.values],isManual:t.is_manual===!0}}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?{values:[String(n)],isManual:!1}:{values:[],isManual:!1}}function Wt(n,t){if(n)switch(n){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return n}return t||"pending_approval"}function z(n){return!n||typeof n!="object"||Array.isArray(n)?null:n}function ve(n){return n==null||n===""?"Not set":typeof n=="string"?n:JSON.stringify(n,null,2)}function Qt(n){return n.replace(/\s+[—-]\s+pending approval$/i,"")}function Z(n){return n.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}function Te(n,t,s){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":t==="agent"?"an agent":s?`Automation ${s}`:"an Automation"}function Kt({initiator:n,clientName:t,fallback:s}){const{org:r}=ee(),i=r?.slug,d=n?.client_id??t,o=Et(void 0,{enabled:!!(i&&d)}).data?.find(h=>h.id===d)?.title,x=n&&n.kind!=="user"?Te(n,void 0,n.automation_id===void 0?void 0:String(n.automation_id)):s,m="font-medium text-foreground",g=`${m} underline-offset-4 hover:underline`;return i&&n?.kind==="automation"&&n.automation_id?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:i,automationId:String(n.automation_id)},search:{view:"definition",run_id:void 0},className:g,children:x}):i&&n?.kind==="agent_session"&&n.agent_id?e.jsx(Q,{to:"/$owner/agents/$agentId",params:{owner:i,agentId:String(n.agent_id)},className:g,children:x}):i&&d?e.jsxs(Q,{to:"/$owner/agents/connected/$clientId",params:{owner:i,clientId:d},className:`${g} inline-flex items-center gap-1 align-middle`,children:[e.jsx(ht,{name:o??t??d}),o??x]}):e.jsx("span",{className:m,children:x})}function Gt(n){const t=Object.keys(n.fields),s=t.map(Z).join(", ")||"field",r=t.length===1?"field":"fields";return`Update ${n.entityType?Z(n.entityType).toLowerCase():"entity"} ${r}: ${s}`}function Zt(n,t){const s=z(t.fields);if(!s||Object.keys(s).length===0||t.action_key!=="entity_field_change"&&t.tool!=="entity_field_change")return null;const r=z(t.current)??{},i=n;return{fields:s,current:r,reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??i.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function Xt(n){return!n||!Array.isArray(n.evidence)?[]:n.evidence.flatMap(t=>{const s=z(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]})}function Ne(n){return Array.isArray(n)?n.flatMap(t=>{const s=z(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]}):[]}function Yt(n){const t=z(n?.evidence_change);if(t&&!(!Array.isArray(t.dropped)||!Array.isArray(t.gained)))return{dropped:Ne(t.dropped),gained:Ne(t.gained)}}function L(n){return typeof n=="string"?n:void 0}function en(n){const t=z(n.current),s=z(n.proposal),r=z(t?.winner),i=z(t?.loser),d=Array.isArray(t?.duplicates)?t.duplicates.map(z):[],o=(d.length>0?d:i?[i]:[]).flatMap(l=>{const p=L(l?.name),f=l?.id;return p&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:p,slug:L(l?.slug),entityType:L(l?.entity_type),parentSlug:L(l?.parent_slug),parentEntityType:L(l?.parent_entity_type)}]:[]}),x=Array.isArray(s?.entity_ids)?s.entity_ids:[],m=Array.isArray(s?.names)?s.names.flatMap((l,p)=>{const f=x[p];return typeof l=="string"&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:l}]:[]}):[],g=L(s?.name),h=s?.entity_id,T=o.length>0?o:m.length>0?m:g&&(typeof h=="string"||typeof h=="number")?[{key:String(h),name:g}]:[];return{winnerName:L(r?.name)??L(s?.winner_name),winnerSlug:L(r?.slug),winnerEntityType:L(r?.entity_type),winnerParentSlug:L(r?.parent_slug),winnerParentEntityType:L(r?.parent_entity_type),losers:T,matchEvidence:Xt(s),evidenceChange:Yt(s)}}function tn(n){const t=n.entityType?Z(n.entityType).toLowerCase():"entity";if(n.operation==="merge"){const s=n.merge?.losers??[];return s.length>1?`Merge ${s.length} duplicate ${t}s`:`Merge duplicate ${t}`}return`${Z(n.operation)} ${t}`}function nn(n,t){if(t.action_key!=="entity_change"&&t.tool!=="entity_change")return null;const s=t.action;if(s!=="create"&&s!=="delete"&&s!=="merge")return null;const r=n;return{operation:s,merge:s==="merge"?en(t):void 0,proposal:z(t.proposal),current:z(t.current),reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,proposerRationale:typeof t.proposer_rationale=="string"?t.proposer_rationale:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function he(n,t){return!n||!t.entityType||!t.entitySlug?null:be(n,t.parentEntityType&&t.parentSlug?[{entity_type:t.parentEntityType,slug:t.parentSlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}])}function $e({runId:n,details:t}){const{org:s}=ee(),i=Ce(t.automationId,void 0,s?.id,{includeVersions:!1}).data?.automation,d=Te(t.initiator,t.attribution,t.automationId),c=i?.automation_name??t.automationName??d,o=s?.slug;return e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",o&&t.automationId?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:o,automationId:t.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:c}):e.jsx("span",{className:"font-medium text-foreground",children:c}),o&&n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" · "}),e.jsxs(Q,{to:"/$owner/events",params:{owner:o},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",n]})]})]})}function Pe({details:n}){const{org:t}=ee(),s=he(t?.slug,n);return n.entityName?e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:s?e.jsx(Q,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function Ie({label:n,before:t,after:s}){return e.jsxs("div",{className:"rounded-md border border-border/70 overflow-hidden",children:[e.jsx("div",{className:"border-b border-border/70 px-3 py-2 text-xs font-medium",children:n}),e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Current"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:ve(t)})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposed"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:ve(s)})]})]})]})}function sn({runId:n,details:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx($e,{runId:n,details:t}),e.jsx(Pe,{details:t}),Object.entries(t.fields).map(([s,r])=>e.jsx(Ie,{label:Z(s),before:t.current[s],after:r},s)),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function rn({merge:n,status:t}){const{org:s}=ee(),r=he(s?.slug,{entityType:n.winnerEntityType,entitySlug:n.winnerSlug,parentEntityType:n.winnerParentEntityType,parentSlug:n.winnerParentSlug}),i=n.losers.length,d=t==="rejected"||t==="failed",c=t==="completed";return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg border border-border/70 overflow-hidden",children:e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?"Would have kept":"Kept"}),e.jsx("div",{className:"text-sm font-medium leading-relaxed",children:n.winnerName?r?e.jsx(Q,{to:r,className:"underline-offset-4 hover:underline",children:n.winnerName}):n.winnerName:e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?i>1?`Kept separate (${i})`:"Kept separate":c?i>1?`Merged away (${i})`:"Merged away":i>1?`To merge away (${i})`:"To merge away"}),e.jsx("div",{className:"space-y-0.5 text-sm leading-relaxed",children:i>0?n.losers.map(o=>{const x=he(s?.slug,{entityType:o.entityType,entitySlug:o.slug,parentEntityType:o.parentEntityType,parentSlug:o.parentSlug}),m=c?"line-through decoration-muted-foreground/60":"";return e.jsx("div",{className:"break-words",children:x?e.jsx(Q,{to:x,className:`${m} underline-offset-4 hover:underline`,children:o.name}):e.jsx("span",{className:m,children:o.name})},o.key)}):e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]})]})}),n.evidenceChange&&e.jsxs("div",{className:n.evidenceChange.dropped.length>0?"rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2":"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.evidenceChange.dropped.length>0?"What changed since you reviewed this":"Evidence re-checked"}),e.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[n.evidenceChange.dropped.map(o=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-amber-700 dark:text-amber-400",children:"No longer proven"}),Z(o.kind),": ",o.identifier]},`dropped-${o.kind}:${o.identifier}`)),n.evidenceChange.gained.map(o=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-emerald-700 dark:text-emerald-400",children:"Newly proven"}),Z(o.kind),": ",o.identifier]},`gained-${o.kind}:${o.identifier}`)),n.evidenceChange.dropped.length===0&&n.evidenceChange.gained.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"The recorded match evidence did not change."})]})]}),n.matchEvidence.length>0&&e.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Match evidence"}),e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:n.matchEvidence.map(o=>e.jsxs(G,{variant:"outline",className:"text-[10px] font-normal",children:[Z(o.kind),": ",o.identifier]},`${o.kind}:${o.identifier}`))})]})]})}function an({runId:n,details:t,status:s}){const r=t.operation==="merge";return e.jsxs("div",{className:"space-y-3",children:[e.jsx($e,{runId:n,details:t}),r&&t.merge?e.jsx(rn,{merge:t.merge,status:s}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{details:t}),e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Change"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.operation==="create"?"Create a new entity after approval.":"Delete this entity after approval."})]})]}),!r&&t.proposal&&e.jsxs("div",{className:"rounded-md border border-border/70 p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposal"}),e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(t.proposal,null,2)})]}),t.proposerRationale&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.proposerRationale})]}),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:r?"Why this needs approval":"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function on({summary:n}){return e.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[n.chips.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.chips.map(t=>e.jsx(G,{variant:"outline",className:"text-[10px] font-normal",children:t},t))}),n.message&&e.jsx("p",{className:"leading-relaxed text-foreground",children:n.message}),n.reason&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),e.jsx("div",{className:"mt-0.5 leading-relaxed",children:n.reason})]}),n.body&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.kind==="verify"?"Expected comment":"Draft"}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:n.body})]}),n.matchPreview&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",n.matchAuthor?` · ${n.matchAuthor}`:""]}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:n.matchPreview})]}),n.postUrl&&e.jsxs("a",{href:n.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",e.jsx(we,{className:"h-3 w-3"})]})]})}function ln({content:n}){const t=n.metadata||{},s=n.run_id??void 0,r=Zt(n,t),i=nn(n,t),d=(r?Gt(r):i?tn(i):void 0)||t.operation_name||t.action_name||(n.title?Qt(n.title):void 0)||"Action",c=t.connection_name,o=t.operation_key||t.action_key||null,x=n.interaction_input_schema||t.input_schema||null,m=j.useMemo(()=>n.interaction_input||t.action_input||t.operation_input||Lt,[n.interaction_input,t.action_input,t.operation_input]),g=n.interaction_output||t.action_output||void 0,h=Mt(m,g??null,o),T=n.interaction_error||t.error_message||void 0,l=Wt(n.interaction_status,t.status),p=t.reviewed_by_name||t.reviewed_by_id||void 0,f=t.reject_reason||void 0,v=t.initiator,$=st(),S=rt(),q=it(n.id,at(x,m),x),{values:D,setValues:U}=q,[R,V]=j.useState(null),[F,M]=j.useState(!1),[B,u]=j.useState(""),P=l==="pending_approval",J=typeof t.source_run_id=="number";return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ot,{className:"h-4 w-4 text-yellow-500"}),e.jsx("span",{className:"font-medium",children:d}),c&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",c]}),l==="confirmed"&&e.jsxs(G,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:[e.jsx(Y,{size:"xs",className:"mr-1"}),"Executing"]}),l==="completed"&&e.jsx(G,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),l==="failed"&&e.jsx(G,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),l==="rejected"&&e.jsx(G,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!r&&!i&&(n.author_name||p)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&e.jsxs("span",{children:["Requested by"," ",e.jsx(Kt,{initiator:v,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&p&&e.jsx("span",{children:"·"}),p&&e.jsxs("span",{children:[l==="rejected"?"Rejected":"Approved"," by"," ",e.jsx("span",{className:"font-medium text-foreground",children:p})]})]}),r&&e.jsx(sn,{runId:s,details:r}),!r&&i&&e.jsx(an,{runId:s,details:i,status:l}),l==="rejected"&&f&&e.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",f]}),h&&e.jsx(on,{summary:h}),(P?q.revision:x)&&(P||Object.keys(m).length>0)&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:h?"Full input":"Input"}),P?e.jsxs(e.Fragment,{children:[e.jsx(lt,{visible:q.hasConflict,onReload:q.reset}),e.jsx(dt,{schema:q.revision,values:D,onValuesChange:U,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):h?e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),e.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}):e.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&!h&&e.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[e.jsx(ct,{className:"h-3.5 w-3.5"}),"Output"]}),e.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(g,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&h&&e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),e.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(g,null,2)})]}),l==="failed"&&T&&e.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[e.jsx(ut,{className:"h-3.5 w-3.5"}),"Error"]}),e.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:T})]}),R==="confirmed"&&e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-400 font-medium",children:[e.jsx(Y,{size:"md"}),"Confirmed — executing..."]}),e.jsx("p",{className:"text-xs text-blue-800 dark:text-blue-300 mt-1",children:"The worker will execute this action shortly. Redirecting..."})]}),R==="rejected"&&e.jsx(G,{variant:"outline",className:"text-muted-foreground text-xs",children:"Rejected — redirecting..."}),P&&!R&&J&&e.jsx("div",{className:"pt-1 text-xs text-muted-foreground",children:"Part of an Automation run — approve or reject it from the run's change-set above."}),P&&s&&!R&&!J&&e.jsx("div",{className:"flex items-center gap-2 pt-1",children:F?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"Reason (optional)",value:B,onChange:te=>u(te.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(k,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>S.mutate({run_id:s,reason:B||void 0},{onSuccess:()=>{V("rejected")}}),disabled:S.isPending,children:[S.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),e.jsx(k,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{M(!1),u("")},children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{size:"sm",className:"h-7 text-xs",onClick:()=>$.mutate({run_id:s,input:pt(D)},{onSuccess:()=>{V("confirmed")}}),disabled:!q.canSubmit||$.isPending||S.isPending,children:[$.isPending?e.jsx(Y,{size:"sm",className:"mr-1"}):e.jsx(mt,{className:"h-3 w-3 mr-1"}),"Confirm"]}),e.jsxs(k,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>M(!0),disabled:$.isPending||S.isPending,children:[e.jsx(xt,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function dn({content:n}){const t=n.metadata||{},s=t.kind,r=n.run_id??null,i=typeof t.automation_id=="number"?t.automation_id:null,{org:d}=ee(),c=d?.slug,m=Ce(i!=null?String(i):void 0,void 0,d?.id,{includeVersions:!1}).data?.automation?.automation_name??(i!=null?`Automation ${i}`:"An Automation"),g=tt(),h=nt(),[T,l]=j.useState(!1),[p,f]=j.useState(""),[v,$]=j.useState(null);if(s==="automation_batch_reject"){const u=t.reason||void 0;return e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),u&&e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:u}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const S=Array.isArray(t.changes)?t.changes:[],q=typeof t.created_count=="number"?t.created_count:S.filter(u=>u.kind==="created").length,D=typeof t.updated_count=="number"?t.updated_count:S.filter(u=>u.kind==="updated").length,U=typeof t.denied_count=="number"?t.denied_count:S.filter(u=>u.kind==="denied").length,R=S.filter(u=>u.kind==="denied"),V=S.filter(u=>u.kind==="updated"&&Object.keys(u.applied||{}).length>0),F=typeof t.pending_proposal_count=="number"?t.pending_proposal_count:null,M=F==null||F>0,B=M?"proposed":"applied";return e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[e.jsxs("div",{className:"text-sm font-medium",children:[B==="proposed"?"Proposed":"Applied"," ",q," ","new + ",D," updated",U>0&&e.jsxs(e.Fragment,{children:[" + ",U," denied"]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[c&&i!=null?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:c,automationId:String(i)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:m}):e.jsx("span",{className:"font-medium text-foreground",children:m}),r!=null&&e.jsxs("span",{children:[" · run #",r]}),F!=null&&F>0&&e.jsxs("span",{children:[" · ",F," pending"]})]})]}),V.length>0&&e.jsx("div",{className:"mt-3 space-y-2",children:V.map(u=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:u.name}),Object.entries(u.applied).map(([P,J])=>e.jsx(Ie,{label:P,before:J.old,after:J.new},P))]},u.entityId))}),R.length>0&&e.jsx("div",{className:"mt-3 space-y-1.5",children:R.map(u=>e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[e.jsxs("div",{className:"text-xs font-medium",children:[u.name," — not written"]}),u.denied&&e.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[u.denied.reason,e.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",u.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${u.entityId}-${u.name}`))}),r!=null&&v==null&&M&&e.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:T?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"What should the agent change?",value:p,onChange:u=>f(u.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(k,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>h.mutate({run_id:r,reason:p||void 0},{onSuccess:()=>$("rejected")}),disabled:h.isPending,children:[h.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Reject all"]}),e.jsx(k,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{l(!1),f("")},children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(k,{size:"sm",className:"h-7 text-xs",onClick:()=>g.mutate({run_id:r},{onSuccess:()=>$("approved")}),disabled:g.isPending||h.isPending,children:[g.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),e.jsx(k,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>l(!0),disabled:g.isPending||h.isPending,children:"Reject with feedback"})]})}),v==="approved"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),v==="rejected"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&v==null&&!M&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function ae({ownerSlug:n,content:t,isReply:s,showParentContext:r,connectorDefinitions:i}){const[d,c]=j.useState(!1),[o,x]=j.useState(!1),m=Be(),{currentOwner:g,allOrgs:h,isAuthenticated:T}=He(),l=n??g,p=l==="me"?null:l,f=j.useCallback(async a=>{if(!p){me.error("Open this event inside a workspace to interact with it.");return}try{await Dt(p,Number(t.id),a,crypto.randomUUID()),me.success("Recorded")}catch(N){me.error(N instanceof Error?N.message:"Could not record that interaction.")}},[t.id,p]),v=t.payload_data??{},$=t.semantic_type==="audit"&&t.origin_type==="tool_invocation",S=$&&(v.request!==void 0||v.request_status==="too_large"),D=$&&v.request_status==="complete"&&l?`/${l}/events?content_ids=${t.id}`:!l||l==="me"?null:t.run_id!=null?`/${l}/events?run_ids=${t.run_id}`:null,U=T?(h??[]).find(a=>a.slug===p):void 0,R=U?{slug:U.slug,organizationId:U.id}:null,V=Ae(R??{slug:null,organizationId:null}),F=R?.slug??null,M=j.useMemo(()=>F&&!$?_e(V.data??[],t.semantic_type):[],[F,$,V.data,t.semantic_type]),B=Ue(),u=!!(m&&R&&M.length>0),P=p&&t.run_id!=null?`/${p}/events?run_ids=${t.run_id}`:null,J=u||!!(m&&D&&Ve(D)),te=()=>{!m||!P||m.open({href:P,title:t.title??`Run #${t.run_id}`,runId:t.run_id??void 0})},re=()=>{if(u&&m&&R&&p){const a=Number(t.id);Ot(B,R.slug,M,a).catch(()=>null).then(N=>m.open({href:gt(p,a,N?.key),title:t.title??"Event"}));return}!m||!D||m.open({href:D,title:t.title??(t.run_id!=null?`Run #${t.run_id}`:"Event"),runId:t.run_id??void 0})},ie=a=>{const N=a.target;if(!(N instanceof Element))return!1;const y=N.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return y!==null&&y!==a.currentTarget},de=a=>{ie(a)||re()},ce=a=>{a.key!=="Enter"&&a.key!==" "||ie(a)||(a.preventDefault(),re())},W=t.metadata||{};if(t.semantic_type==="change_set")return e.jsx(dn,{content:t});if(t.interaction_type==="approval"||t.semantic_type==="operation"||W.status!=null||W.action_key!=null)return e.jsx(ln,{content:t});const b=Number.isFinite(t.score)?Math.round(t.score):"-",A=t.payload_type||"text",E=t.text_content||"",H=(A==="text"||A==="markdown")&&E.length>500,I=H&&!d?`${E.slice(0,500)}...`:E,K=W.thumbnail_url||W.thumbnail,O=W.media_url,X=Ht(W),ne=Object.entries(t.classifications||{}).flatMap(([a,N])=>{const y=Jt(N);return y.values.map(w=>({slug:a,value:w,isManual:y.isManual}))}),ue=(()=>{const a=t.metadata??{},N=t.platform||(typeof a.platform=="string"?a.platform:null),y=t.connection_id!=null?t.connection_id:a.source_connection_id!=null?Number(a.source_connection_id):null;return{...t,platform:N,connection_id:y!=null&&Number.isFinite(y)?y:null}})();return e.jsxs("div",{className:et(s?"border-l-2 border-l-muted pl-4":"",J&&"-mx-2 cursor-pointer rounded-lg px-2 py-1 transition-colors hover:bg-accent/40"),...J?{role:"button",tabIndex:0,onClick:de,onKeyDown:ce}:{},children:[r&&t.parent_context&&e.jsxs("div",{className:"mb-3 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Replying to:"}),e.jsx("div",{className:"font-medium",children:t.parent_context.author_name}),e.jsx("div",{className:"text-muted-foreground line-clamp-2",children:t.parent_context.text_content})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[t.title&&e.jsx("h4",{className:"font-medium line-clamp-2 mb-1",children:t.title}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:(()=>{const a=qt(t),N=!!t.platform&&a!==se(t.platform);return e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{className:"font-medium",children:a}),N&&e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{children:"·"}),e.jsx(G,{variant:"outline",className:"text-xs",children:t.platform})]})]})})()}),l?e.jsx(Je,{owner:l,source:ue,connectorDefinitions:i,className:"mt-0.5 text-xs"}):null]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.score_breakdown?e.jsxs(We,{children:[e.jsx(Qe,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2",children:e.jsx("span",{className:"font-medium",children:b})})}),e.jsx(Ke,{className:"w-64",align:"end",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),e.jsx(Ut,{breakdown:t.score_breakdown})]})})]}):e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!0,children:e.jsx("span",{className:"font-medium",children:b})}),u&&P&&e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs","data-testid":"event-card-open-run",onClick:te,children:"Open run"}),t.source_url&&e.jsxs(Ge,{children:[e.jsx(Ze,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"h-7 w-7",asChild:!0,children:e.jsx("a",{href:t.source_url,target:"_blank",rel:"noopener noreferrer",children:e.jsx(we,{className:"h-3.5 w-3.5"})})})}),e.jsx(Xe,{children:"View original"})]})]})]}),t.rating&&e.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(a=>e.jsx(ke,{className:`h-4 w-4 ${a<=Number(t.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},a))}),K&&e.jsx("a",{href:O||t.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:e.jsx("img",{src:K,alt:"",className:`rounded-md object-cover ${A==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),t.excerpt&&e.jsx("div",{className:"text-sm italic text-muted-foreground border-l-2 border-primary/40 pl-2 mb-1",children:t.excerpt}),(()=>{switch(A){case"markdown":if(I)return e.jsx("div",{className:"max-w-none text-sm space-y-2",children:e.jsx(Ye,{text:I})});break;case"json_template":{const a=t.payload_template;if(a?.root)return e.jsx(Tt,{template:{root:a.root},data:t.payload_data||{},onAction:f,interactions:a.interactions});if(I)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:I});break}case"media":return e.jsxs("div",{className:"space-y-3",children:[!K&&O&&e.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:O}),I&&e.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:I})]});case"empty":return e.jsxs("div",{className:"space-y-3",children:[S&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(k,{variant:"outline",size:"sm","aria-expanded":o,onClick:()=>x(a=>!a),children:[o?e.jsx(oe,{className:"h-3.5 w-3.5"}):e.jsx(le,{className:"h-3.5 w-3.5"}),"Request"]}),o&&(v.request_status==="too_large"?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof v.request_bytes=="number"?` (${v.request_bytes.toLocaleString()} bytes).`:"."]}):e.jsx(Bt,{value:v.request}))]}),X.length>0?e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:X.map(([a,N])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(a)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:je(N)})]},a))}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"})]});default:if(I)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:I});break}return e.jsxs("div",{className:"space-y-3",children:[O&&!K&&e.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:O}),X.length>0&&e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:X.map(([a,N])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(a)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:je(N)})]},a))})]})})(),H&&e.jsx(k,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>c(!d),children:d?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3 w-3 mr-1"})," Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3 w-3 mr-1"})," Show more"]})}),ne.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:ne.map(a=>e.jsx(Vt,{slug:a.slug,value:a.value||"",isManual:a.isManual},a.slug))})]})}function cn({occurredAt:n,isLast:t,children:s}){return e.jsxs("div",{className:"relative flex gap-4 pb-6",children:[e.jsxs("div",{className:"relative flex w-2.5 shrink-0 justify-center",children:[!t&&e.jsx("div",{className:"absolute top-1 bottom-[-1.5rem] left-1/2 w-px -translate-x-1/2 bg-border","aria-hidden":!0}),e.jsx("div",{className:"relative z-10 mt-1 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground/60"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[n&&e.jsx("time",{dateTime:new Date(n).toISOString(),title:Re(n),className:"mb-1 block text-xs leading-none text-muted-foreground",children:Se(n)}),s]})]})}function gn({organizationId:n,ownerSlug:t,entityId:s,filters:r,showEntityLinks:i=!1,emptyState:d,dense:c=!1}){const{isAuthenticated:o,isReady:x}=ft(),{isMember:m,isLoading:g}=ee(),h=t==="me",T=!h&&x&&o&&m,l=!h&&x&&(!o||!g&&!m),{data:p=[]}=yt(x&&T?n:null),{data:f=[]}=jt(l?t:null),v=T?p:f,$=vt(x&&T?n:null,s,r,t),S=Nt(l?t:null,s,r),q=l?S:$,{data:D,isLoading:U,error:R,fetchNextPage:V,hasNextPage:F,isFetchingNextPage:M}=q,B=j.useMemo(()=>D?.pages.flatMap(_=>_.content)??[],[D]),u=$t({onIntersect:()=>V(),enabled:!!F&&!M}),P=j.useMemo(()=>{const _=bt(B),b=_.map(H=>H.head),A=new Map(_.map(H=>[H.head.id,H])),E=_t(b);return Array.from(E.entries()).map(([H,I])=>{const K=I.root||I.replies[0],O=K?A.get(K.id):void 0;return{rootId:H,group:I,history:O?.history??[],runId:O?.runId??null}})},[B]),[J,te]=j.useState(new Set),[re,ie]=j.useState(new Set),[de,ce]=j.useState(new Set),W=(_,b)=>_(A=>{const E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});return U&&B.length===0?e.jsx("div",{className:"space-y-4",children:["s1","s2","s3"].map(_=>e.jsx(wt,{className:"h-32 rounded-lg"},_))}):R?e.jsx(kt,{label:"events"}):B.length===0?d??e.jsx(Ct,{icon:St,title:"Nothing here yet",description:"No events match this view."}):e.jsxs("div",{className:c?"":"pt-1",children:[P.map(({rootId:_,group:b,history:A,runId:E},H,I)=>{const K=b.replies.length>0,O=J.has(_),X=de.has(_),ne=re.has(_),ue=b.replies.filter(w=>w.depth<=3),a=b.replies.filter(w=>w.depth>3),N=!b.root&&b.replies.length>0,y=b.root||b.replies[0];return y?e.jsxs(cn,{occurredAt:y.occurred_at,isLast:H===I.length-1,children:[i&&t&&y.entity_name&&y.entity_type&&y.entity_slug&&e.jsx("div",{className:"mb-2",children:e.jsx(It,{ownerSlug:t,entity:{entityName:y.entity_name,entityType:y.entity_type,entitySlug:y.entity_slug}})}),e.jsx(ae,{ownerSlug:t,content:y,showParentContext:N&&!!y.parent_context,connectorDefinitions:v}),A.length>0&&e.jsxs(ge,{open:ne,children:[e.jsx(fe,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-1 h-7 gap-1 text-xs text-muted-foreground",onClick:()=>W(ie,_),children:[e.jsx(Rt,{className:"h-3.5 w-3.5"}),ne?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3.5 w-3.5"}),"Hide ",E!=null?`run #${E} `:"","history"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),E!=null?`Run #${E} · ${A.length===1?"1 earlier step":`${A.length} earlier steps`}`:A.length===1?"1 earlier state":`${A.length} earlier states`]})]})}),e.jsx(ye,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:A.map(w=>e.jsxs("div",{children:[e.jsx("time",{dateTime:new Date(w.occurred_at).toISOString(),title:Re(w.occurred_at),className:"mb-1 block text-xs text-muted-foreground",children:Se(w.occurred_at)}),e.jsx(ae,{ownerSlug:t,content:w,connectorDefinitions:v})]},w.id))})]}),K&&e.jsxs(ge,{open:O,children:[e.jsx(fe,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-2 ml-6 gap-1",onClick:()=>W(te,_),children:[e.jsx(At,{className:"h-3.5 w-3.5"}),O?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3.5 w-3.5"}),"Hide ",b.replies.length," replies"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Show ",b.replies.length," replies"]})]})}),e.jsxs(ye,{className:"space-y-2 mt-2",children:[ue.map(w=>e.jsx(ae,{ownerSlug:t,content:w,isReply:!0,connectorDefinitions:v},w.id)),a.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"sm",className:"ml-12",onClick:()=>W(ce,_),children:X?e.jsxs(e.Fragment,{children:["Hide ",a.length," nested replies"]}):e.jsxs(e.Fragment,{children:["Show ",a.length," nested replies"]})}),X&&a.map(w=>e.jsx(ae,{ownerSlug:t,content:w,isReply:!0,connectorDefinitions:v},w.id))]})]})]})]},_):null}),e.jsx("div",{ref:u,className:"h-1"}),M&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(Y,{size:"xl",className:"text-muted-foreground"})})]})}export{gn as E,hn as u};
|
|
1
|
+
import{r as j,j as e,L as Q,dd as Oe,dy as be,cs as De,e2 as Fe,e3 as _e,e4 as Me,ap as Le,ai as ze,e5 as qe,t as Be,a3 as He,aG as me,as as Ue,y as Ve,ah as G,H as Je,cj as We,ck as Qe,B as k,cn as Ke,cG as Ge,cH as Ze,J as we,cI as Xe,e6 as ke,e7 as oe,cm as le,e8 as Ye,al as et,w as ee,M as Ce,e9 as tt,ea as nt,s as Y,eb as st,ec as rt,k as it,ed as at,bI as ot,F as lt,dF as dt,ee as ct,ef as ut,aR as mt,eg as pt,Z as xt,bS as ht,x as gt,v as ft,d1 as yt,d2 as jt,d9 as vt,da as Nt,eh as bt,ei as _t,S as wt,c2 as kt,bq as Ct,I as St,cU as ge,cW as fe,aZ as Rt,cX as ye,E as Se,ej as Re,ek as At}from"./index-DtRfQcRH.js";import{u as Ae}from"./use-applied-views-DvMT3wap.js";import{u as Et}from"./clients-C7ubnFsS.js";import{J as Tt}from"./renderer-1nRJFMGx.js";function $t({onIntersect:n,enabled:t,rootMargin:s="400px"}){const r=j.useRef(null),i=j.useRef(n);return i.current=n,j.useEffect(()=>{const d=r.current;if(!d||!t)return;const c=new IntersectionObserver(o=>{o[0]?.isIntersecting&&i.current()},{rootMargin:s});return c.observe(d),()=>c.disconnect()},[t,s]),r}function Pt(n,t){const s=t.parentEntityType&&t.parentEntitySlug?[{entity_type:t.parentEntityType,slug:t.parentEntitySlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}];return be(n,s)}function It({ownerSlug:n,entity:t,className:s}){const r=Pt(n,t);return e.jsxs(Q,{to:r,className:`flex items-center gap-1 text-primary hover:underline group ${s??""}`,children:[e.jsx("span",{className:"font-medium",children:t.entityName}),e.jsx(Oe,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Ee(n,t,s){return{queryKey:["event-view-match",n,t.key,t.content_hash,s],queryFn:async()=>{try{return await De("open_view",{key:t.key,scope:{event:s}},{slug:n}),!0}catch(r){if(r instanceof Fe&&(r.status===400||r.status===404))return!1;throw r}},staleTime:6e4}}function hn(n,t){const s=Ae(n??{slug:null,organizationId:null}),r=n?.slug??null,i=j.useMemo(()=>r?_e(s.data??[]):[],[r,s.data]),d=Me({queries:i.map(c=>Ee(r,c,t))});return r?{views:i.filter((c,o)=>d[o]?.data===!0),isLoading:s.data===void 0?!s.isError:d.some(c=>c.isPending),isError:s.isError||d.some(c=>c.isError),refetch:()=>{s.refetch();for(const c of d)c.isError&&c.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function Ot(n,t,s,r){const i=await Promise.all(s.map(d=>n.fetchQuery(Ee(t,d,r))));return s.find((d,c)=>i[c])??null}async function Dt(n,t,s,r){const i=await Le(`${ze}/api/${encodeURIComponent(n)}/events/${t}/actions/${encodeURIComponent(s.action)}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:r})});return await qe(i,"Could not record interaction"),i.json()}function C(n){if(typeof n!="string")return;const t=n.trim();return t.length>0?t:void 0}function pe(n){return typeof n=="boolean"?n:void 0}function Ft(n,t,s){const r=(s??"").toLowerCase();return!!(r==="prepare_comment"||r==="verify_staged_comment"||r.includes("prepare_")||r.includes("verify_staged")||t?.prepared===!0||typeof t?.verified=="boolean"||C(t?.reason_preview)&&C(t?.message)||C(n?.body)&&(C(n?.post_url)||C(n?.activity_id)))}function Mt(n,t,s){if(!Ft(n,t,s))return null;const r=(s??"").toLowerCase(),i=C(t?.body)??C(n?.body),d=C(t?.reason_preview)??C(n?.reason),c=C(t?.post_url)??C(n?.post_url)??(C(n?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${C(n?.activity_id)}`:void 0),o=pe(t?.prepared),x=pe(t?.verified),m=pe(t?.banner_shown),g=C(t?.message),h=t?.match&&typeof t.match=="object"?t.match:null,T=C(h?.text_preview),l=C(h?.author);let p="generic";r==="verify_staged_comment"||r.includes("verify")||typeof x=="boolean"?p="verify":(r==="prepare_comment"||r.includes("prepare")||o===!0||i&&c)&&(p="prepare");const f=[];return o===!0&&f.push("Staged — not posted"),o===!1&&f.push("Not staged"),x===!0&&f.push("Verified posted"),x===!1&&f.push("Not verified as posted"),m===!0&&f.push("In-page banner"),m===!1&&f.push("No banner"),{kind:p,message:g,reason:d,body:i,postUrl:c,prepared:o,bannerShown:m,verified:x,matchPreview:T,matchAuthor:l,chips:f}}const Lt={};function se(n){return n.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}const zt={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function qt(n){return n.author_name?n.author_name:n.platform?se(n.platform):n.origin_type?zt[n.origin_type]??se(n.origin_type):null}function je(n){return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?String(n):Array.isArray(n)?n.length===0?"":n.every(t=>typeof t!="object")?n.map(t=>String(t)).join(", "):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)}):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)})}const xe=1e5;function Bt({value:n}){const t=JSON.stringify(n,null,2)??"null",s=t.length>xe;return e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?t.slice(0,xe):t}),s&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",xe.toLocaleString()," of"," ",t.length.toLocaleString()," characters."]})]})}function Ht(n){return Object.entries(n).filter(([,t])=>t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:typeof t=="object"?Object.keys(t).length>0:!0).sort(([t],[s])=>t.localeCompare(s))}function Ut({breakdown:n}){if(!n)return null;const t=[{label:"Engagement",value:n.engagement,max:100},{label:"Criticality",value:n.criticality,max:100},{label:"Depth",value:n.depth,max:100},{label:"Authority",value:n.authority,max:100},{label:"Recency",value:n.recency,max:100},{label:"Quality",value:n.quality,max:100}];return e.jsx("div",{className:"space-y-2 text-sm",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),e.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function Vt({slug:n,value:t,isManual:s}){return e.jsxs(G,{variant:"secondary",className:"text-xs",children:[n,": ",t,s&&e.jsx(ke,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Jt(n){if(n&&typeof n=="object"){const t=n;if(Array.isArray(t.values))return{values:t.values.map(s=>String(s)).filter(s=>s.length>0),isManual:t.is_manual===!0};if(t.value!==void 0&&t.value!==null)return{values:[String(t.value)],isManual:t.is_manual===!0};if(typeof t.values=="string"&&t.values.length>0)return{values:[t.values],isManual:t.is_manual===!0}}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?{values:[String(n)],isManual:!1}:{values:[],isManual:!1}}function Wt(n,t){if(n)switch(n){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return n}return t||"pending_approval"}function z(n){return!n||typeof n!="object"||Array.isArray(n)?null:n}function ve(n){return n==null||n===""?"Not set":typeof n=="string"?n:JSON.stringify(n,null,2)}function Qt(n){return n.replace(/\s+[—-]\s+pending approval$/i,"")}function Z(n){return n.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}function Te(n,t,s){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":t==="agent"?"an agent":s?`Automation ${s}`:"an Automation"}function Kt({initiator:n,clientName:t,fallback:s}){const{org:r}=ee(),i=r?.slug,d=n?.client_id??t,o=Et(void 0,{enabled:!!(i&&d)}).data?.find(h=>h.id===d)?.title,x=n&&n.kind!=="user"?Te(n,void 0,n.automation_id===void 0?void 0:String(n.automation_id)):s,m="font-medium text-foreground",g=`${m} underline-offset-4 hover:underline`;return i&&n?.kind==="automation"&&n.automation_id?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:i,automationId:String(n.automation_id)},search:{view:"definition",run_id:void 0},className:g,children:x}):i&&n?.kind==="agent_session"&&n.agent_id?e.jsx(Q,{to:"/$owner/agents/$agentId",params:{owner:i,agentId:String(n.agent_id)},className:g,children:x}):i&&d?e.jsxs(Q,{to:"/$owner/agents/connected/$clientId",params:{owner:i,clientId:d},className:`${g} inline-flex items-center gap-1 align-middle`,children:[e.jsx(ht,{name:o??t??d}),o??x]}):e.jsx("span",{className:m,children:x})}function Gt(n){const t=Object.keys(n.fields),s=t.map(Z).join(", ")||"field",r=t.length===1?"field":"fields";return`Update ${n.entityType?Z(n.entityType).toLowerCase():"entity"} ${r}: ${s}`}function Zt(n,t){const s=z(t.fields);if(!s||Object.keys(s).length===0||t.action_key!=="entity_field_change"&&t.tool!=="entity_field_change")return null;const r=z(t.current)??{},i=n;return{fields:s,current:r,reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??i.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function Xt(n){return!n||!Array.isArray(n.evidence)?[]:n.evidence.flatMap(t=>{const s=z(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]})}function Ne(n){return Array.isArray(n)?n.flatMap(t=>{const s=z(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]}):[]}function Yt(n){const t=z(n?.evidence_change);if(t&&!(!Array.isArray(t.dropped)||!Array.isArray(t.gained)))return{dropped:Ne(t.dropped),gained:Ne(t.gained)}}function L(n){return typeof n=="string"?n:void 0}function en(n){const t=z(n.current),s=z(n.proposal),r=z(t?.winner),i=z(t?.loser),d=Array.isArray(t?.duplicates)?t.duplicates.map(z):[],o=(d.length>0?d:i?[i]:[]).flatMap(l=>{const p=L(l?.name),f=l?.id;return p&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:p,slug:L(l?.slug),entityType:L(l?.entity_type),parentSlug:L(l?.parent_slug),parentEntityType:L(l?.parent_entity_type)}]:[]}),x=Array.isArray(s?.entity_ids)?s.entity_ids:[],m=Array.isArray(s?.names)?s.names.flatMap((l,p)=>{const f=x[p];return typeof l=="string"&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:l}]:[]}):[],g=L(s?.name),h=s?.entity_id,T=o.length>0?o:m.length>0?m:g&&(typeof h=="string"||typeof h=="number")?[{key:String(h),name:g}]:[];return{winnerName:L(r?.name)??L(s?.winner_name),winnerSlug:L(r?.slug),winnerEntityType:L(r?.entity_type),winnerParentSlug:L(r?.parent_slug),winnerParentEntityType:L(r?.parent_entity_type),losers:T,matchEvidence:Xt(s),evidenceChange:Yt(s)}}function tn(n){const t=n.entityType?Z(n.entityType).toLowerCase():"entity";if(n.operation==="merge"){const s=n.merge?.losers??[];return s.length>1?`Merge ${s.length} duplicate ${t}s`:`Merge duplicate ${t}`}return`${Z(n.operation)} ${t}`}function nn(n,t){if(t.action_key!=="entity_change"&&t.tool!=="entity_change")return null;const s=t.action;if(s!=="create"&&s!=="delete"&&s!=="merge")return null;const r=n;return{operation:s,merge:s==="merge"?en(t):void 0,proposal:z(t.proposal),current:z(t.current),reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,proposerRationale:typeof t.proposer_rationale=="string"?t.proposer_rationale:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function he(n,t){return!n||!t.entityType||!t.entitySlug?null:be(n,t.parentEntityType&&t.parentSlug?[{entity_type:t.parentEntityType,slug:t.parentSlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}])}function $e({runId:n,details:t}){const{org:s}=ee(),i=Ce(t.automationId,void 0,s?.id,{includeVersions:!1}).data?.automation,d=Te(t.initiator,t.attribution,t.automationId),c=i?.automation_name??t.automationName??d,o=s?.slug;return e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",o&&t.automationId?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:o,automationId:t.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:c}):e.jsx("span",{className:"font-medium text-foreground",children:c}),o&&n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" · "}),e.jsxs(Q,{to:"/$owner/events",params:{owner:o},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",n]})]})]})}function Pe({details:n}){const{org:t}=ee(),s=he(t?.slug,n);return n.entityName?e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:s?e.jsx(Q,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function Ie({label:n,before:t,after:s}){return e.jsxs("div",{className:"rounded-md border border-border/70 overflow-hidden",children:[e.jsx("div",{className:"border-b border-border/70 px-3 py-2 text-xs font-medium",children:n}),e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Current"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:ve(t)})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposed"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:ve(s)})]})]})]})}function sn({runId:n,details:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx($e,{runId:n,details:t}),e.jsx(Pe,{details:t}),Object.entries(t.fields).map(([s,r])=>e.jsx(Ie,{label:Z(s),before:t.current[s],after:r},s)),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function rn({merge:n,status:t}){const{org:s}=ee(),r=he(s?.slug,{entityType:n.winnerEntityType,entitySlug:n.winnerSlug,parentEntityType:n.winnerParentEntityType,parentSlug:n.winnerParentSlug}),i=n.losers.length,d=t==="rejected"||t==="failed",c=t==="completed";return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg border border-border/70 overflow-hidden",children:e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?"Would have kept":"Kept"}),e.jsx("div",{className:"text-sm font-medium leading-relaxed",children:n.winnerName?r?e.jsx(Q,{to:r,className:"underline-offset-4 hover:underline",children:n.winnerName}):n.winnerName:e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?i>1?`Kept separate (${i})`:"Kept separate":c?i>1?`Merged away (${i})`:"Merged away":i>1?`To merge away (${i})`:"To merge away"}),e.jsx("div",{className:"space-y-0.5 text-sm leading-relaxed",children:i>0?n.losers.map(o=>{const x=he(s?.slug,{entityType:o.entityType,entitySlug:o.slug,parentEntityType:o.parentEntityType,parentSlug:o.parentSlug}),m=c?"line-through decoration-muted-foreground/60":"";return e.jsx("div",{className:"break-words",children:x?e.jsx(Q,{to:x,className:`${m} underline-offset-4 hover:underline`,children:o.name}):e.jsx("span",{className:m,children:o.name})},o.key)}):e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]})]})}),n.evidenceChange&&e.jsxs("div",{className:n.evidenceChange.dropped.length>0?"rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2":"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.evidenceChange.dropped.length>0?"What changed since you reviewed this":"Evidence re-checked"}),e.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[n.evidenceChange.dropped.map(o=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-amber-700 dark:text-amber-400",children:"No longer proven"}),Z(o.kind),": ",o.identifier]},`dropped-${o.kind}:${o.identifier}`)),n.evidenceChange.gained.map(o=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-emerald-700 dark:text-emerald-400",children:"Newly proven"}),Z(o.kind),": ",o.identifier]},`gained-${o.kind}:${o.identifier}`)),n.evidenceChange.dropped.length===0&&n.evidenceChange.gained.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"The recorded match evidence did not change."})]})]}),n.matchEvidence.length>0&&e.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Match evidence"}),e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:n.matchEvidence.map(o=>e.jsxs(G,{variant:"outline",className:"text-[10px] font-normal",children:[Z(o.kind),": ",o.identifier]},`${o.kind}:${o.identifier}`))})]})]})}function an({runId:n,details:t,status:s}){const r=t.operation==="merge";return e.jsxs("div",{className:"space-y-3",children:[e.jsx($e,{runId:n,details:t}),r&&t.merge?e.jsx(rn,{merge:t.merge,status:s}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{details:t}),e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Change"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.operation==="create"?"Create a new entity after approval.":"Delete this entity after approval."})]})]}),!r&&t.proposal&&e.jsxs("div",{className:"rounded-md border border-border/70 p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposal"}),e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(t.proposal,null,2)})]}),t.proposerRationale&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.proposerRationale})]}),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:r?"Why this needs approval":"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function on({summary:n}){return e.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[n.chips.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.chips.map(t=>e.jsx(G,{variant:"outline",className:"text-[10px] font-normal",children:t},t))}),n.message&&e.jsx("p",{className:"leading-relaxed text-foreground",children:n.message}),n.reason&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),e.jsx("div",{className:"mt-0.5 leading-relaxed",children:n.reason})]}),n.body&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.kind==="verify"?"Expected comment":"Draft"}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:n.body})]}),n.matchPreview&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",n.matchAuthor?` · ${n.matchAuthor}`:""]}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:n.matchPreview})]}),n.postUrl&&e.jsxs("a",{href:n.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",e.jsx(we,{className:"h-3 w-3"})]})]})}function ln({content:n}){const t=n.metadata||{},s=n.run_id??void 0,r=Zt(n,t),i=nn(n,t),d=(r?Gt(r):i?tn(i):void 0)||t.operation_name||t.action_name||(n.title?Qt(n.title):void 0)||"Action",c=t.connection_name,o=t.operation_key||t.action_key||null,x=n.interaction_input_schema||t.input_schema||null,m=j.useMemo(()=>n.interaction_input||t.action_input||t.operation_input||Lt,[n.interaction_input,t.action_input,t.operation_input]),g=n.interaction_output||t.action_output||void 0,h=Mt(m,g??null,o),T=n.interaction_error||t.error_message||void 0,l=Wt(n.interaction_status,t.status),p=t.reviewed_by_name||t.reviewed_by_id||void 0,f=t.reject_reason||void 0,v=t.initiator,$=st(),S=rt(),q=it(n.id,at(x,m),x),{values:D,setValues:U}=q,[R,V]=j.useState(null),[F,M]=j.useState(!1),[B,u]=j.useState(""),P=l==="pending_approval",J=typeof t.source_run_id=="number";return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ot,{className:"h-4 w-4 text-yellow-500"}),e.jsx("span",{className:"font-medium",children:d}),c&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",c]}),l==="confirmed"&&e.jsxs(G,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:[e.jsx(Y,{size:"xs",className:"mr-1"}),"Executing"]}),l==="completed"&&e.jsx(G,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),l==="failed"&&e.jsx(G,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),l==="rejected"&&e.jsx(G,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!r&&!i&&(n.author_name||p)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&e.jsxs("span",{children:["Requested by"," ",e.jsx(Kt,{initiator:v,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&p&&e.jsx("span",{children:"·"}),p&&e.jsxs("span",{children:[l==="rejected"?"Rejected":"Approved"," by"," ",e.jsx("span",{className:"font-medium text-foreground",children:p})]})]}),r&&e.jsx(sn,{runId:s,details:r}),!r&&i&&e.jsx(an,{runId:s,details:i,status:l}),l==="rejected"&&f&&e.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",f]}),h&&e.jsx(on,{summary:h}),(P?q.revision:x)&&(P||Object.keys(m).length>0)&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:h?"Full input":"Input"}),P?e.jsxs(e.Fragment,{children:[e.jsx(lt,{visible:q.hasConflict,onReload:q.reset}),e.jsx(dt,{schema:q.revision,values:D,onValuesChange:U,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):h?e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),e.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}):e.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&!h&&e.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[e.jsx(ct,{className:"h-3.5 w-3.5"}),"Output"]}),e.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(g,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&h&&e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),e.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(g,null,2)})]}),l==="failed"&&T&&e.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[e.jsx(ut,{className:"h-3.5 w-3.5"}),"Error"]}),e.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:T})]}),R==="confirmed"&&e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-400 font-medium",children:[e.jsx(Y,{size:"md"}),"Confirmed — executing..."]}),e.jsx("p",{className:"text-xs text-blue-800 dark:text-blue-300 mt-1",children:"The worker will execute this action shortly. Redirecting..."})]}),R==="rejected"&&e.jsx(G,{variant:"outline",className:"text-muted-foreground text-xs",children:"Rejected — redirecting..."}),P&&!R&&J&&e.jsx("div",{className:"pt-1 text-xs text-muted-foreground",children:"Part of an Automation run — approve or reject it from the run's change-set above."}),P&&s&&!R&&!J&&e.jsx("div",{className:"flex items-center gap-2 pt-1",children:F?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"Reason (optional)",value:B,onChange:te=>u(te.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(k,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>S.mutate({run_id:s,reason:B||void 0},{onSuccess:()=>{V("rejected")}}),disabled:S.isPending,children:[S.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),e.jsx(k,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{M(!1),u("")},children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{size:"sm",className:"h-7 text-xs",onClick:()=>$.mutate({run_id:s,input:pt(D)},{onSuccess:()=>{V("confirmed")}}),disabled:!q.canSubmit||$.isPending||S.isPending,children:[$.isPending?e.jsx(Y,{size:"sm",className:"mr-1"}):e.jsx(mt,{className:"h-3 w-3 mr-1"}),"Confirm"]}),e.jsxs(k,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>M(!0),disabled:$.isPending||S.isPending,children:[e.jsx(xt,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function dn({content:n}){const t=n.metadata||{},s=t.kind,r=n.run_id??null,i=typeof t.automation_id=="number"?t.automation_id:null,{org:d}=ee(),c=d?.slug,m=Ce(i!=null?String(i):void 0,void 0,d?.id,{includeVersions:!1}).data?.automation?.automation_name??(i!=null?`Automation ${i}`:"An Automation"),g=tt(),h=nt(),[T,l]=j.useState(!1),[p,f]=j.useState(""),[v,$]=j.useState(null);if(s==="automation_batch_reject"){const u=t.reason||void 0;return e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),u&&e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:u}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const S=Array.isArray(t.changes)?t.changes:[],q=typeof t.created_count=="number"?t.created_count:S.filter(u=>u.kind==="created").length,D=typeof t.updated_count=="number"?t.updated_count:S.filter(u=>u.kind==="updated").length,U=typeof t.denied_count=="number"?t.denied_count:S.filter(u=>u.kind==="denied").length,R=S.filter(u=>u.kind==="denied"),V=S.filter(u=>u.kind==="updated"&&Object.keys(u.applied||{}).length>0),F=typeof t.pending_proposal_count=="number"?t.pending_proposal_count:null,M=F==null||F>0,B=M?"proposed":"applied";return e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[e.jsxs("div",{className:"text-sm font-medium",children:[B==="proposed"?"Proposed":"Applied"," ",q," ","new + ",D," updated",U>0&&e.jsxs(e.Fragment,{children:[" + ",U," denied"]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[c&&i!=null?e.jsx(Q,{to:"/$owner/automations/$automationId",params:{owner:c,automationId:String(i)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:m}):e.jsx("span",{className:"font-medium text-foreground",children:m}),r!=null&&e.jsxs("span",{children:[" · run #",r]}),F!=null&&F>0&&e.jsxs("span",{children:[" · ",F," pending"]})]})]}),V.length>0&&e.jsx("div",{className:"mt-3 space-y-2",children:V.map(u=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:u.name}),Object.entries(u.applied).map(([P,J])=>e.jsx(Ie,{label:P,before:J.old,after:J.new},P))]},u.entityId))}),R.length>0&&e.jsx("div",{className:"mt-3 space-y-1.5",children:R.map(u=>e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[e.jsxs("div",{className:"text-xs font-medium",children:[u.name," — not written"]}),u.denied&&e.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[u.denied.reason,e.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",u.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${u.entityId}-${u.name}`))}),r!=null&&v==null&&M&&e.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:T?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"What should the agent change?",value:p,onChange:u=>f(u.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(k,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>h.mutate({run_id:r,reason:p||void 0},{onSuccess:()=>$("rejected")}),disabled:h.isPending,children:[h.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Reject all"]}),e.jsx(k,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{l(!1),f("")},children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(k,{size:"sm",className:"h-7 text-xs",onClick:()=>g.mutate({run_id:r},{onSuccess:()=>$("approved")}),disabled:g.isPending||h.isPending,children:[g.isPending&&e.jsx(Y,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),e.jsx(k,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>l(!0),disabled:g.isPending||h.isPending,children:"Reject with feedback"})]})}),v==="approved"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),v==="rejected"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&v==null&&!M&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function ae({ownerSlug:n,content:t,isReply:s,showParentContext:r,connectorDefinitions:i}){const[d,c]=j.useState(!1),[o,x]=j.useState(!1),m=Be(),{currentOwner:g,allOrgs:h,isAuthenticated:T}=He(),l=n??g,p=l==="me"?null:l,f=j.useCallback(async a=>{if(!p){me.error("Open this event inside a workspace to interact with it.");return}try{await Dt(p,Number(t.id),a,crypto.randomUUID()),me.success("Recorded")}catch(N){me.error(N instanceof Error?N.message:"Could not record that interaction.")}},[t.id,p]),v=t.payload_data??{},$=t.semantic_type==="audit"&&t.origin_type==="tool_invocation",S=$&&(v.request!==void 0||v.request_status==="too_large"),D=$&&v.request_status==="complete"&&l?`/${l}/events?content_ids=${t.id}`:!l||l==="me"?null:t.run_id!=null?`/${l}/events?run_ids=${t.run_id}`:null,U=T?(h??[]).find(a=>a.slug===p):void 0,R=U?{slug:U.slug,organizationId:U.id}:null,V=Ae(R??{slug:null,organizationId:null}),F=R?.slug??null,M=j.useMemo(()=>F&&!$?_e(V.data??[],t.semantic_type):[],[F,$,V.data,t.semantic_type]),B=Ue(),u=!!(m&&R&&M.length>0),P=p&&t.run_id!=null?`/${p}/events?run_ids=${t.run_id}`:null,J=u||!!(m&&D&&Ve(D)),te=()=>{!m||!P||m.open({href:P,title:t.title??`Run #${t.run_id}`,runId:t.run_id??void 0})},re=()=>{if(u&&m&&R&&p){const a=Number(t.id);Ot(B,R.slug,M,a).catch(()=>null).then(N=>m.open({href:gt(p,a,N?.key),title:t.title??"Event"}));return}!m||!D||m.open({href:D,title:t.title??(t.run_id!=null?`Run #${t.run_id}`:"Event"),runId:t.run_id??void 0})},ie=a=>{const N=a.target;if(!(N instanceof Element))return!1;const y=N.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return y!==null&&y!==a.currentTarget},de=a=>{ie(a)||re()},ce=a=>{a.key!=="Enter"&&a.key!==" "||ie(a)||(a.preventDefault(),re())},W=t.metadata||{};if(t.semantic_type==="change_set")return e.jsx(dn,{content:t});if(t.interaction_type==="approval"||t.semantic_type==="operation"||W.status!=null||W.action_key!=null)return e.jsx(ln,{content:t});const b=Number.isFinite(t.score)?Math.round(t.score):"-",A=t.payload_type||"text",E=t.text_content||"",H=(A==="text"||A==="markdown")&&E.length>500,I=H&&!d?`${E.slice(0,500)}...`:E,K=W.thumbnail_url||W.thumbnail,O=W.media_url,X=Ht(W),ne=Object.entries(t.classifications||{}).flatMap(([a,N])=>{const y=Jt(N);return y.values.map(w=>({slug:a,value:w,isManual:y.isManual}))}),ue=(()=>{const a=t.metadata??{},N=t.platform||(typeof a.platform=="string"?a.platform:null),y=t.connection_id!=null?t.connection_id:a.source_connection_id!=null?Number(a.source_connection_id):null;return{...t,platform:N,connection_id:y!=null&&Number.isFinite(y)?y:null}})();return e.jsxs("div",{className:et(s?"border-l-2 border-l-muted pl-4":"",J&&"-mx-2 cursor-pointer rounded-lg px-2 py-1 transition-colors hover:bg-accent/40"),...J?{role:"button",tabIndex:0,onClick:de,onKeyDown:ce}:{},children:[r&&t.parent_context&&e.jsxs("div",{className:"mb-3 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Replying to:"}),e.jsx("div",{className:"font-medium",children:t.parent_context.author_name}),e.jsx("div",{className:"text-muted-foreground line-clamp-2",children:t.parent_context.text_content})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[t.title&&e.jsx("h4",{className:"font-medium line-clamp-2 mb-1",children:t.title}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:(()=>{const a=qt(t),N=!!t.platform&&a!==se(t.platform);return e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{className:"font-medium",children:a}),N&&e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{children:"·"}),e.jsx(G,{variant:"outline",className:"text-xs",children:t.platform})]})]})})()}),l?e.jsx(Je,{owner:l,source:ue,connectorDefinitions:i,className:"mt-0.5 text-xs"}):null]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.score_breakdown?e.jsxs(We,{children:[e.jsx(Qe,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2",children:e.jsx("span",{className:"font-medium",children:b})})}),e.jsx(Ke,{className:"w-64",align:"end",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),e.jsx(Ut,{breakdown:t.score_breakdown})]})})]}):e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!0,children:e.jsx("span",{className:"font-medium",children:b})}),u&&P&&e.jsx(k,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs","data-testid":"event-card-open-run",onClick:te,children:"Open run"}),t.source_url&&e.jsxs(Ge,{children:[e.jsx(Ze,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"h-7 w-7",asChild:!0,children:e.jsx("a",{href:t.source_url,target:"_blank",rel:"noopener noreferrer",children:e.jsx(we,{className:"h-3.5 w-3.5"})})})}),e.jsx(Xe,{children:"View original"})]})]})]}),t.rating&&e.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(a=>e.jsx(ke,{className:`h-4 w-4 ${a<=Number(t.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},a))}),K&&e.jsx("a",{href:O||t.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:e.jsx("img",{src:K,alt:"",className:`rounded-md object-cover ${A==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(A){case"markdown":if(I)return e.jsx("div",{className:"max-w-none text-sm space-y-2",children:e.jsx(Ye,{text:I})});break;case"json_template":{const a=t.payload_template;if(a?.root)return e.jsx(Tt,{template:{root:a.root},data:t.payload_data||{},onAction:f,interactions:a.interactions});if(I)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:I});break}case"media":return e.jsxs("div",{className:"space-y-3",children:[!K&&O&&e.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:O}),I&&e.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:I})]});case"empty":return e.jsxs("div",{className:"space-y-3",children:[S&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(k,{variant:"outline",size:"sm","aria-expanded":o,onClick:()=>x(a=>!a),children:[o?e.jsx(oe,{className:"h-3.5 w-3.5"}):e.jsx(le,{className:"h-3.5 w-3.5"}),"Request"]}),o&&(v.request_status==="too_large"?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof v.request_bytes=="number"?` (${v.request_bytes.toLocaleString()} bytes).`:"."]}):e.jsx(Bt,{value:v.request}))]}),X.length>0?e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:X.map(([a,N])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(a)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:je(N)})]},a))}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"})]});default:if(I)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:I});break}return e.jsxs("div",{className:"space-y-3",children:[O&&!K&&e.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:O}),X.length>0&&e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:X.map(([a,N])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(a)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:je(N)})]},a))})]})})(),H&&e.jsx(k,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>c(!d),children:d?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3 w-3 mr-1"})," Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3 w-3 mr-1"})," Show more"]})}),ne.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:ne.map(a=>e.jsx(Vt,{slug:a.slug,value:a.value||"",isManual:a.isManual},a.slug))})]})}function cn({occurredAt:n,isLast:t,children:s}){return e.jsxs("div",{className:"relative flex gap-4 pb-6",children:[e.jsxs("div",{className:"relative flex w-2.5 shrink-0 justify-center",children:[!t&&e.jsx("div",{className:"absolute top-1 bottom-[-1.5rem] left-1/2 w-px -translate-x-1/2 bg-border","aria-hidden":!0}),e.jsx("div",{className:"relative z-10 mt-1 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground/60"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[n&&e.jsx("time",{dateTime:new Date(n).toISOString(),title:Re(n),className:"mb-1 block text-xs leading-none text-muted-foreground",children:Se(n)}),s]})]})}function gn({organizationId:n,ownerSlug:t,entityId:s,filters:r,showEntityLinks:i=!1,emptyState:d,dense:c=!1}){const{isAuthenticated:o,isReady:x}=ft(),{isMember:m,isLoading:g}=ee(),h=t==="me",T=!h&&x&&o&&m,l=!h&&x&&(!o||!g&&!m),{data:p=[]}=yt(x&&T?n:null),{data:f=[]}=jt(l?t:null),v=T?p:f,$=vt(x&&T?n:null,s,r,t),S=Nt(l?t:null,s,r),q=l?S:$,{data:D,isLoading:U,error:R,fetchNextPage:V,hasNextPage:F,isFetchingNextPage:M}=q,B=j.useMemo(()=>D?.pages.flatMap(_=>_.content)??[],[D]),u=$t({onIntersect:()=>V(),enabled:!!F&&!M}),P=j.useMemo(()=>{const _=bt(B),b=_.map(H=>H.head),A=new Map(_.map(H=>[H.head.id,H])),E=_t(b);return Array.from(E.entries()).map(([H,I])=>{const K=I.root||I.replies[0],O=K?A.get(K.id):void 0;return{rootId:H,group:I,history:O?.history??[],runId:O?.runId??null}})},[B]),[J,te]=j.useState(new Set),[re,ie]=j.useState(new Set),[de,ce]=j.useState(new Set),W=(_,b)=>_(A=>{const E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});return U&&B.length===0?e.jsx("div",{className:"space-y-4",children:["s1","s2","s3"].map(_=>e.jsx(wt,{className:"h-32 rounded-lg"},_))}):R?e.jsx(kt,{label:"events"}):B.length===0?d??e.jsx(Ct,{icon:St,title:"Nothing here yet",description:"No events match this view."}):e.jsxs("div",{className:c?"":"pt-1",children:[P.map(({rootId:_,group:b,history:A,runId:E},H,I)=>{const K=b.replies.length>0,O=J.has(_),X=de.has(_),ne=re.has(_),ue=b.replies.filter(w=>w.depth<=3),a=b.replies.filter(w=>w.depth>3),N=!b.root&&b.replies.length>0,y=b.root||b.replies[0];return y?e.jsxs(cn,{occurredAt:y.occurred_at,isLast:H===I.length-1,children:[i&&t&&y.entity_name&&y.entity_type&&y.entity_slug&&e.jsx("div",{className:"mb-2",children:e.jsx(It,{ownerSlug:t,entity:{entityName:y.entity_name,entityType:y.entity_type,entitySlug:y.entity_slug}})}),e.jsx(ae,{ownerSlug:t,content:y,showParentContext:N&&!!y.parent_context,connectorDefinitions:v}),A.length>0&&e.jsxs(ge,{open:ne,children:[e.jsx(fe,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-1 h-7 gap-1 text-xs text-muted-foreground",onClick:()=>W(ie,_),children:[e.jsx(Rt,{className:"h-3.5 w-3.5"}),ne?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3.5 w-3.5"}),"Hide ",E!=null?`run #${E} `:"","history"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),E!=null?`Run #${E} · ${A.length===1?"1 earlier step":`${A.length} earlier steps`}`:A.length===1?"1 earlier state":`${A.length} earlier states`]})]})}),e.jsx(ye,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:A.map(w=>e.jsxs("div",{children:[e.jsx("time",{dateTime:new Date(w.occurred_at).toISOString(),title:Re(w.occurred_at),className:"mb-1 block text-xs text-muted-foreground",children:Se(w.occurred_at)}),e.jsx(ae,{ownerSlug:t,content:w,connectorDefinitions:v})]},w.id))})]}),K&&e.jsxs(ge,{open:O,children:[e.jsx(fe,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-2 ml-6 gap-1",onClick:()=>W(te,_),children:[e.jsx(At,{className:"h-3.5 w-3.5"}),O?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3.5 w-3.5"}),"Hide ",b.replies.length," replies"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Show ",b.replies.length," replies"]})]})}),e.jsxs(ye,{className:"space-y-2 mt-2",children:[ue.map(w=>e.jsx(ae,{ownerSlug:t,content:w,isReply:!0,connectorDefinitions:v},w.id)),a.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"sm",className:"ml-12",onClick:()=>W(ce,_),children:X?e.jsxs(e.Fragment,{children:["Hide ",a.length," nested replies"]}):e.jsxs(e.Fragment,{children:["Show ",a.length," nested replies"]})}),X&&a.map(w=>e.jsx(ae,{ownerSlug:t,content:w,isReply:!0,connectorDefinitions:v},w.id))]})]})]})]},_):null}),e.jsx("div",{ref:u,className:"h-1"}),M&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(Y,{size:"xl",className:"text-muted-foreground"})})]})}export{gn as E,hn as u};
|
package/dist/owletto/dist/assets/{full-page-spinner-BxcYpJXx.js → full-page-spinner-DsU-Cb3L.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as t,al as u}from"./index-
|
|
1
|
+
import{r,j as t,al as u}from"./index-DtRfQcRH.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,a2 as o}from"./index-DtRfQcRH.js";function a(){return t.jsx(o,{})}export{a as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hP as t,j as n}from"./index-DtRfQcRH.js";import{a as i}from"./agents-workbench-Cl7FO7b3.js";import"./agent-editor-form-DwHD9j1Y.js";import"./model-selector-XC5CI2Et.js";import"./proposal-review-shell-C3K-JXjb.js";import"./runs-_yVh6PPB.js";function d(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(i,{owner:o,agentId:r,tab:"identity",runId:e.run_id})}export{d as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aD as vr,aE as pr,r as u,aF as St,j as v,aG as Mt,aH as yt,aI as Er,aJ as On,aK as mr,aL as gr,aM as _r,aN as Or,aO as F,aP as Tn,aQ as Ut,Z as Tr,aR as Ar,aS as Ir,aT as Rr,aU as Sr}from"./index-DdGjY1Hb.js";function x(...e){return vr(pr(e))}function Be({error:e,localization:t,localizeErrors:n=!0}){var r;const a="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:a;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const o=e.error.code;if(t?.[o])return t[o]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||a}function An(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}var yr={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},Nr={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},Cr={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},wr={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},br={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},Dr={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},xr={...br,...Dr},Pr={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},Lr={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Mr={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ur={INVALID_SESSION_TOKEN:"Invalid session token"},kr={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},Fr={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Br={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},jr={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Hr={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},Vr={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},zr={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Wr={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...wr,...yr,...Nr,...Cr,...xr,...Pr,...Lr,...Mr,...Ur,...kr,...Fr,...Br,...jr,...Hr,...Vr,...zr},Gr={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},kt={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},Ft={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};const In=u.createContext({});function Yr(){return u.useContext(In)}var Xe,Bt;function Kr(){if(Bt)return Xe;Bt=1;var e=function(){};return Xe=e,Xe}var qr=Kr();const $r=St(qr);function Zr({async:e,appendTo:t,defer:n,id:r,nonce:a,src:o}){const c=document.createElement("script");e!==void 0&&(c.async=e),n!==void 0&&(c.defer=n),r&&(c.id=r),a&&c.setAttribute("nonce",a),c.src=o,(t==="head"?document.head:document.body).appendChild(c)}var Xr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let we=null,be=!1;const je=new Set,He=new Set,Qr=typeof window<"u",ye="___grecaptcha_cfg",Rn=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function Jr(){if(!Qr)return;function e(n){if(be)n();else{window[ye]||(window[ye]={});const r=window[ye];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){be=!0;for(const n of He)n();He.clear()}window[Rn]=t}function ea({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:a=!1}){const o=a?"recaptcha.net":"google.com",c=r?"enterprise.js":"api.js",s=new URLSearchParams({render:n});return t&&s.set("onload",t),e&&s.set("hl",e),`https://www.${o}/recaptcha/${c}?${s.toString()}`}function ta({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:a}){const o={id:"google-recaptcha-v3"},c=ea({language:e,onLoadCallbackName:Rn,render:t,useEnterprise:r,useRecaptchaNet:a});if(we){if(we!==c)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}we=c,Zr(Object.assign(Object.assign(Object.assign({},o),n),{src:c}))}function na(e){if(!window[ye])return;const t=window[ye];t.clients&&delete t.clients[e]}function ra(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,a=Xr(t,["onLoadCallback","onLoadCallbackName"]);if(je.size===0&&Jr(),ta(a),je.add(e),n&&(be?n():He.add(n)),r){let o=function(){if(!r)return;const c=window[r];typeof c=="function"&&c()};be?o():He.add(o)}}function aa(e){var t,n,r;je.delete(e),je.size===0&&(window.grecaptcha=void 0,window[ye]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${we}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),we=null,be=!1)}let jt=!1;function oa({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:a,useEnterprise:o,useRecaptchaNet:c}){var s,l,i,h,d,f,p;const E=u.useId(),[_,R]=u.useState(null),[g,S]=u.useState(null),O=u.useRef(!1);u.useEffect(()=>{function I(){var D;const C=o?(D=window.grecaptcha)===null||D===void 0?void 0:D.enterprise:window.grecaptcha;if(!C)throw new Error("reCAPTCHA not found");if(!C.ready)throw new Error("reCAPTCHA ready callback not found");C.ready(()=>{R(C)})}return ra(E,{language:n,onLoadCallback:I,onLoadCallbackName:a?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:a?.appendTo,async:a?.async,defer:a?.defer,id:a?.id,nonce:a?.nonce},useEnterprise:o,useRecaptchaNet:c}),()=>{aa(E),R(null)}},[e?.element,E,n,r,a?.appendTo,a?.async,a?.defer,a?.id,a?.nonce,a?.onLoadCallbackName,o,c]),u.useEffect(()=>{var I,D,C;if(!e?.element||!_?.render)return;const M={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},L=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!L)throw new Error("reCAPTCHA container element not found");const k=_.render(L,M);return!((D=e?.parameters)===null||D===void 0)&&D.hidden&&(jt||($r(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),jt=!0),(C=L.querySelector(".grecaptcha-badge"))===null||C===void 0||C.style.setProperty("display","none")),S(k),O.current=!0,()=>{S(null),O.current=!1,na(k),L.innerHTML=""}},[e?.element,(s=e?.parameters)===null||s===void 0?void 0:s.badge,(l=e?.parameters)===null||l===void 0?void 0:l.hidden,(i=e?.parameters)===null||i===void 0?void 0:i.callback,(h=e?.parameters)===null||h===void 0?void 0:h.errorCallback,(d=e?.parameters)===null||d===void 0?void 0:d.expiredCallback,(f=e?.parameters)===null||f===void 0?void 0:f.tabindex,(p=e?.parameters)===null||p===void 0?void 0:p.theme,_,r]);const A=!!e?.element,m=A?g:r,N=u.useMemo(()=>m!==null&&_?.execute?I=>{if(m===null||!_?.execute)throw new Error("reCAPTCHA has not been loaded");return A&&!O.current?(console.warn("Client ID not mounted"),null):_.execute(m,{action:I})}:void 0,[m,_,A]);return v.jsx(In.Provider,{value:{container:e?.element,executeRecaptcha:N,reCaptchaInstance:_},children:t})}var ia=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},te=new ia;function sa(){return()=>{}}function la(){return u.useSyncExternalStore(sa,()=>!0,()=>!1)}function ca(){const[e,t]=u.useState();return u.useEffect(()=>{const n=()=>{const a=document.documentElement.getAttribute("lang");t(a??void 0)};n();const r=new MutationObserver(a=>{for(const o of a)o.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function ua(){const[e,t]=u.useState("light");return u.useEffect(()=>{const n=()=>{var a;const o=document.documentElement.classList.contains("dark")||((a=document.documentElement.getAttribute("style"))==null?void 0:a.includes("color-scheme: dark"));t(o?"dark":"light")};n();const r=new MutationObserver(a=>{for(const o of a)(o.attributeName==="style"||o.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function da({children:e}){const t=la(),{captcha:n}=u.useContext(oe);return n?.provider!=="google-recaptcha-v3"?e:v.jsxs(oa,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&v.jsx("style",{children:`
|
|
1
|
+
import{aD as vr,aE as pr,r as u,aF as St,j as v,aG as Mt,aH as yt,aI as Er,aJ as On,aK as mr,aL as gr,aM as _r,aN as Or,aO as F,aP as Tn,aQ as Ut,Z as Tr,aR as Ar,aS as Ir,aT as Rr,aU as Sr}from"./index-DtRfQcRH.js";function x(...e){return vr(pr(e))}function Be({error:e,localization:t,localizeErrors:n=!0}){var r;const a="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:a;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const o=e.error.code;if(t?.[o])return t[o]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||a}function An(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}var yr={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},Nr={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},Cr={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},wr={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},br={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},Dr={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},xr={...br,...Dr},Pr={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},Lr={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Mr={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ur={INVALID_SESSION_TOKEN:"Invalid session token"},kr={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},Fr={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Br={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},jr={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Hr={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},Vr={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},zr={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Wr={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...wr,...yr,...Nr,...Cr,...xr,...Pr,...Lr,...Mr,...Ur,...kr,...Fr,...Br,...jr,...Hr,...Vr,...zr},Gr={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},kt={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},Ft={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};const In=u.createContext({});function Yr(){return u.useContext(In)}var Xe,Bt;function Kr(){if(Bt)return Xe;Bt=1;var e=function(){};return Xe=e,Xe}var qr=Kr();const $r=St(qr);function Zr({async:e,appendTo:t,defer:n,id:r,nonce:a,src:o}){const c=document.createElement("script");e!==void 0&&(c.async=e),n!==void 0&&(c.defer=n),r&&(c.id=r),a&&c.setAttribute("nonce",a),c.src=o,(t==="head"?document.head:document.body).appendChild(c)}var Xr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let we=null,be=!1;const je=new Set,He=new Set,Qr=typeof window<"u",ye="___grecaptcha_cfg",Rn=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function Jr(){if(!Qr)return;function e(n){if(be)n();else{window[ye]||(window[ye]={});const r=window[ye];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){be=!0;for(const n of He)n();He.clear()}window[Rn]=t}function ea({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:a=!1}){const o=a?"recaptcha.net":"google.com",c=r?"enterprise.js":"api.js",s=new URLSearchParams({render:n});return t&&s.set("onload",t),e&&s.set("hl",e),`https://www.${o}/recaptcha/${c}?${s.toString()}`}function ta({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:a}){const o={id:"google-recaptcha-v3"},c=ea({language:e,onLoadCallbackName:Rn,render:t,useEnterprise:r,useRecaptchaNet:a});if(we){if(we!==c)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}we=c,Zr(Object.assign(Object.assign(Object.assign({},o),n),{src:c}))}function na(e){if(!window[ye])return;const t=window[ye];t.clients&&delete t.clients[e]}function ra(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,a=Xr(t,["onLoadCallback","onLoadCallbackName"]);if(je.size===0&&Jr(),ta(a),je.add(e),n&&(be?n():He.add(n)),r){let o=function(){if(!r)return;const c=window[r];typeof c=="function"&&c()};be?o():He.add(o)}}function aa(e){var t,n,r;je.delete(e),je.size===0&&(window.grecaptcha=void 0,window[ye]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${we}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),we=null,be=!1)}let jt=!1;function oa({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:a,useEnterprise:o,useRecaptchaNet:c}){var s,l,i,h,d,f,p;const E=u.useId(),[_,R]=u.useState(null),[g,S]=u.useState(null),O=u.useRef(!1);u.useEffect(()=>{function I(){var D;const C=o?(D=window.grecaptcha)===null||D===void 0?void 0:D.enterprise:window.grecaptcha;if(!C)throw new Error("reCAPTCHA not found");if(!C.ready)throw new Error("reCAPTCHA ready callback not found");C.ready(()=>{R(C)})}return ra(E,{language:n,onLoadCallback:I,onLoadCallbackName:a?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:a?.appendTo,async:a?.async,defer:a?.defer,id:a?.id,nonce:a?.nonce},useEnterprise:o,useRecaptchaNet:c}),()=>{aa(E),R(null)}},[e?.element,E,n,r,a?.appendTo,a?.async,a?.defer,a?.id,a?.nonce,a?.onLoadCallbackName,o,c]),u.useEffect(()=>{var I,D,C;if(!e?.element||!_?.render)return;const M={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},L=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!L)throw new Error("reCAPTCHA container element not found");const k=_.render(L,M);return!((D=e?.parameters)===null||D===void 0)&&D.hidden&&(jt||($r(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),jt=!0),(C=L.querySelector(".grecaptcha-badge"))===null||C===void 0||C.style.setProperty("display","none")),S(k),O.current=!0,()=>{S(null),O.current=!1,na(k),L.innerHTML=""}},[e?.element,(s=e?.parameters)===null||s===void 0?void 0:s.badge,(l=e?.parameters)===null||l===void 0?void 0:l.hidden,(i=e?.parameters)===null||i===void 0?void 0:i.callback,(h=e?.parameters)===null||h===void 0?void 0:h.errorCallback,(d=e?.parameters)===null||d===void 0?void 0:d.expiredCallback,(f=e?.parameters)===null||f===void 0?void 0:f.tabindex,(p=e?.parameters)===null||p===void 0?void 0:p.theme,_,r]);const A=!!e?.element,m=A?g:r,N=u.useMemo(()=>m!==null&&_?.execute?I=>{if(m===null||!_?.execute)throw new Error("reCAPTCHA has not been loaded");return A&&!O.current?(console.warn("Client ID not mounted"),null):_.execute(m,{action:I})}:void 0,[m,_,A]);return v.jsx(In.Provider,{value:{container:e?.element,executeRecaptcha:N,reCaptchaInstance:_},children:t})}var ia=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},te=new ia;function sa(){return()=>{}}function la(){return u.useSyncExternalStore(sa,()=>!0,()=>!1)}function ca(){const[e,t]=u.useState();return u.useEffect(()=>{const n=()=>{const a=document.documentElement.getAttribute("lang");t(a??void 0)};n();const r=new MutationObserver(a=>{for(const o of a)o.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function ua(){const[e,t]=u.useState("light");return u.useEffect(()=>{const n=()=>{var a;const o=document.documentElement.classList.contains("dark")||((a=document.documentElement.getAttribute("style"))==null?void 0:a.includes("color-scheme: dark"));t(o?"dark":"light")};n();const r=new MutationObserver(a=>{for(const o of a)(o.attributeName==="style"||o.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function da({children:e}){const t=la(),{captcha:n}=u.useContext(oe);return n?.provider!=="google-recaptcha-v3"?e:v.jsxs(oa,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&v.jsx("style",{children:`
|
|
2
2
|
.grecaptcha-badge {
|
|
3
3
|
visibility: hidden;
|
|
4
4
|
border-radius: var(--radius) !important;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hR as r,j as e}from"./index-DtRfQcRH.js";import{A as m}from"./agent-skills-route-Cwq1QrhW.js";import"./agent-subpage-shell-DtzoRy6N.js";import"./agent-skill-context-s42Q4Wjo.js";import"./core.esm-C-eNiUAl.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-BQLjzMPy.js";import"./agent-card-controls-bhTMPoVi.js";import"./switch-CxDXvPGE.js";function R(){const{owner:t,agentId:o}=r.useParams();return e.jsx(m,{owner:t,agentId:o})}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a8 as t,j as i}from"./index-DtRfQcRH.js";import{A as m}from"./activity-route-view-BvtAoGVt.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-C7ubnFsS.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./events-feed-C4L8mQV7.js";import"./use-applied-views-DvMT3wap.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./calendar-CHXehtu0.js";import"./agent-loading-shells-BQLjzMPy.js";import"./member-scope-gate-CJqJZk7T.js";function y(){const{owner:o}=t.useParams(),r=t.useSearch();return i.jsx(m,{owner:o,search:r,attentionLens:!0})}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gH as t,j as s}from"./index-DtRfQcRH.js";import{D as e}from"./deployments-body-DycIGlnL.js";import"./deployments-D1gbQwsy.js";function p(){const{owner:o}=t.useParams();return s.jsx(e,{owner:o})}export{p as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{by as o,a4 as u,bz as i,r as c,j as g}from"./index-
|
|
1
|
+
import{by as o,a4 as u,bz as i,r as c,j as g}from"./index-DtRfQcRH.js";import{C as f}from"./agent-loading-shells-BQLjzMPy.js";function d(t,n,e){const a=t.find(r=>r.system)??t[0];return a?{to:"/$owner/chat/$agentId",params:{owner:n,agentId:a.agentId},search:e,replace:!0}:null}function h(){const{owner:t}=o.useParams(),n=o.useSearch(),e=u(),{data:a=[],isLoading:r}=i(),s=d(a,t,n);return c.useEffect(()=>{s&&e(s)},[e,s]),c.useEffect(()=>{r||a.length>0||e({to:"/$owner/agents",params:{owner:t},replace:!0})},[a.length,r,e,t]),g.jsx(f,{})}export{d as chatEntryTarget,h as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as A,bz as $,r as l,j as e,B as p,L as u,bQ as C,bq as S,aW as M,bR as W,bS as B,bT as E,aY as R}from"./index-
|
|
1
|
+
import{w as A,bz as $,r as l,j as e,B as p,L as u,bQ as C,bq as S,aW as M,bR as W,bS as B,bT as E,aY as R}from"./index-DtRfQcRH.js";import{A as T}from"./agent-client-setup-list-BBbq_2B1.js";import{L as O}from"./list-skeleton-s4GPSJ8J.js";import{u as _}from"./clients-C7ubnFsS.js";import{g as z,c as F}from"./client-rows-EJSKR6z1.js";const G={all:"All",managed:"Managed",connected:"Connected"};function P({owner:t,item:a,last:g}){const c=`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${g?"":"border-b"}`;if(a.kind==="managed"){const n=a.agent,d=[n.status==="active"?"Working":"Idle",`${n.connectionCount} ${n.connectionCount===1?"connection":"connections"}`,`${n.userCount} ${n.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return e.jsxs(u,{to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:n.agentId},search:{run_id:void 0},className:c,children:[e.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(W,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:n.name}),e.jsx("p",{className:"truncate text-xs",children:d})]}),n.status==="active"?e.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(a.kind==="connected"){const n=a.group;return e.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n.clientId},className:c,children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:e.jsx(B,{name:n.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:n.title}),e.jsxs("p",{className:"truncate text-xs",children:["Connected · ",F(n)]})]}),e.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}function q({owner:t,isWorkspaceLoading:a}){const{isMember:g,isLoading:c}=A(),n=g&&!c,{data:d=[],isLoading:y}=$({enabled:n}),{data:f=[]}=_(null),j=l.useMemo(()=>z(f).filter(s=>s.connected),[f]),i=l.useMemo(()=>{const s=d.map(r=>({kind:"managed",key:r.agentId,agent:{agentId:r.agentId,name:r.name,status:r.status,connectionCount:r.connectionCount,userCount:r.userCount}})),h=j.map(r=>({kind:"connected",key:r.key,group:r}));return[...s,...h]},[d,j]),w=l.useMemo(()=>i.length>0?["all","managed","connected"]:[],[i]),[N,v]=l.useState("all"),o=w.includes(N)?N:"all",x=l.useMemo(()=>i.filter(s=>o==="all"?!0:o==="managed"?s.kind==="managed":s.kind==="connected"),[i,o]),b=a||c||y,m=i.length>0,k=!b&&!m&&n,L=n?m?o==="managed"?"No managed agents yet":o==="connected"?"No connected agents yet":"No agents match this filter":"No agents yet":"Workspace membership required",I=n?m?o==="managed"?"Build a managed agent to add one here.":o==="connected"?"Bring an agent you already run to this workspace.":"Try another filter.":"Build a managed agent, or bring one you already run to this workspace.":"Only workspace members can manage agents here.";return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Who works here — your agents and the ones connected to this workspace."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[w.map(s=>e.jsx(p,{type:"button",variant:o===s?"secondary":"ghost","aria-pressed":o===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(s),children:G[s]},s)),k?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect an agent below or build one with Lobu."}):null]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:ml-auto sm:w-auto sm:shrink-0",children:[m?e.jsx(p,{asChild:!0,size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Connect an agent"]})}):null,e.jsx(p,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/new",params:{owner:t},search:{run_id:void 0},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Build a managed agent"]})})]})]}),b?e.jsx(O,{label:"Loading agents"}):x.length===0?k?e.jsx(T,{owner:t,dashed:!0}):e.jsx(S,{icon:M.agents.icon,title:L,description:I}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((s,h)=>e.jsx(P,{owner:t,item:s,last:h===x.length-1},s.key))})]})}function J(){const{owner:t}=E.useParams();return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(R,{owner:t,children:a=>e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:e.jsx(q,{owner:a.ownerSlug,isWorkspaceLoading:a.isWorkspaceLoading})})})})})}export{J as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gK as n,j as s,gL as r}from"./index-
|
|
1
|
+
import{gK as n,j as s,gL as r}from"./index-DtRfQcRH.js";function c(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{c as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a3 as $,a4 as I,a5 as C,r as R,a6 as y,a7 as S,j as v}from"./index-
|
|
1
|
+
import{a3 as $,a4 as I,a5 as C,r as R,a6 as y,a7 as S,j as v}from"./index-DtRfQcRH.js";import{F as U}from"./full-page-spinner-DsU-Cb3L.js";function g(t){return t?.trim().toLowerCase()||null}function L(t){return t?.methods??[]}function _(t,c){const e=g(c);if(!e)return null;for(const i of t){const o=L(i.auth_schema);if(!o.some(n=>n.type==="oauth"&&g(n.provider)===e&&Array.isArray(n.loginScopes)&&n.loginScopes.length>0))continue;const r=o.find(n=>n.type==="app_installation"&&g(n.provider)===e);if(r)return{connectorKey:i.key,provider:e,installShape:r.installShape??null}}return null}function b(){const{isAuthenticated:t,authReady:c,currentOwner:e,orgsReady:i}=$(),o=I(),l=C(),r=R.useRef(!1),n=new URLSearchParams(window.location.search).get("onboard_provider");return R.useEffect(()=>{if(c&&l.pathname==="/"){if(t&&e){const a=new URLSearchParams(window.location.hash.replace(/^#/,"")),d=a.get("agent")?.trim(),p=a.get("thread")?.trim(),f=a.get("message")?.trim()||a.get("message_id")?.trim(),s=a.get("run")?.trim(),h=a.get("worker")?.trim();if(!!d&&!!p||!!s&&/^\d+$/.test(s)||!!h){if(r.current)return;if(r.current=!0,window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}`),d&&p){const u=f?`?message_id=${encodeURIComponent(f)}`:"";window.location.replace(`/${encodeURIComponent(e)}/chat/${encodeURIComponent(d)}/c/${encodeURIComponent(p)}${u}`);return}if(s&&/^\d+$/.test(s)){const u=new URLSearchParams({run_ids:s,peek:"1",peek_run_id:s});window.location.replace(`/${encodeURIComponent(e)}/events?${u.toString()}`);return}if(h){window.location.replace(`/${encodeURIComponent(e)}/connectors/device/${encodeURIComponent(h)}`);return}}if(r.current)return;r.current=!0;const m=()=>void o({to:"/$owner",params:{owner:e},replace:!0});if(n){y(e).then(u=>{const w=_(u,n);if(w){window.location.assign(`/${encodeURIComponent(e)}/connectors/${encodeURIComponent(w.connectorKey)}`);return}m()}).catch(m);return}m();return}if(t){i&&o({to:"/account/settings",replace:!0});return}o({to:"/auth/login",search:S(),replace:!0})}},[c,e,t,i,o,l.pathname,n]),v.jsx("div",{"data-public-loading":"true",children:v.jsx(U,{delayMs:0,className:"min-h-0 py-16"})})}export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b9 as z,j as n,aY as H,ba as J,u as Q,bb as V,bc as X,bd as Z,be as ee,bf as ne,r as _,bg as se,a4 as oe,bh as te,bi as ae,bj as ce,bk as re,bl as ie,bm as K,bn as le,bo as de,S as O,B as U,bp as ue,bq as q,aW as G,br as me,bs as pe,bt as he,bu as fe,bv as xe,bw as ve,ah as be,L as D,bx as ge}from"./index-
|
|
1
|
+
import{b9 as z,j as n,aY as H,ba as J,u as Q,bb as V,bc as X,bd as Z,be as ee,bf as ne,r as _,bg as se,a4 as oe,bh as te,bi as ae,bj as ce,bk as re,bl as ie,bm as K,bn as le,bo as de,S as O,B as U,bp as ue,bq as q,aW as G,br as me,bs as pe,bt as he,bu as fe,bv as xe,bw as ve,ah as be,L as D,bx as ge}from"./index-DtRfQcRH.js";import{b as je,c as Ne,d as ye}from"./device-rows-BBhW1C7Y.js";function Ie(){const{owner:o}=z.useParams(),{filter:r}=z.useSearch();return n.jsx(H,{owner:o,children:a=>n.jsx(_e,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,isWorkspaceLoading:a.isWorkspaceLoading,requestedFilter:r})})}function _e({ownerSlug:o,organizationId:r,isWorkspaceLoading:a,requestedFilter:d}){const{data:u=[],isLoading:i}=J(r??""),{data:S=[],isLoading:C}=Q(r??""),{data:f=[]}=V(r,{}),{data:E=[],isLoading:R}=X(),{data:w=[]}=Z(),{data:x,isLoading:v}=ee(),{data:l=[]}=ne(),b=a||i||C||R||v,A=x?.sandboxes??[],m=_.useMemo(()=>l.filter(k=>k.organization_slug===o||k.connectors.some(L=>L.organization_slug===o)),[l,o]);return n.jsx(se,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ce,{ownerSlug:o,isContentLoading:b,groups:u,installedDefs:S,authProfiles:f,inferenceProviders:E,inferenceCatalog:w,sandboxes:A,devices:m,requestedFilter:d})})}function Ce({ownerSlug:o,isContentLoading:r,groups:a,installedDefs:d,authProfiles:u,inferenceProviders:i,inferenceCatalog:S,sandboxes:C,devices:f,requestedFilter:E}){const R=oe(),w=E??"all",x=_.useMemo(()=>{const s=new Map(a.map(e=>[e.connector_key,e])),t=new Map;for(const e of d)t.set(e.key,e);for(const e of a)t.has(e.connector_key)||t.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const N=te(i).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0})),p=ae(C).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!e.sandbox.connected,provider:void 0,sandbox:e.sandbox,device:void 0})),P=je(f,a,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device}));return[...Array.from(t.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!Ne(e)).map(e=>{const c=s.get(e.key),F=ce(e.auth_schema),I=u.reduce((j,$)=>($.connector_key!==e.key||(j[$.profile_kind]+=1),j),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),h=re(e,c),y=we(e,c,F,I);return{connector:e,group:c,profileCounts:I,facets:h,needsSetup:y,provider:void 0,sandbox:void 0,device:void 0}}),...N,...p,...P].sort((e,c)=>e.needsSetup&&!c.needsSetup?-1:!e.needsSetup&&c.needsSetup?1:e.connector.name.localeCompare(c.connector.name))},[o,u,f,a,d,i,C]),v=_.useMemo(()=>{const s=ie.filter(t=>t!=="all"&&x.some(N=>K(N,t)));return s.length>1?["all",...s]:[]},[x]),l=v.includes(w)?w:"all",b=_.useMemo(()=>x.filter(s=>K(s,l)),[x,l]),A=b.length,m=_.useMemo(()=>l==="all"?le(o,f,de()):[],[l,o,f]),k=A+m.length,L=n.jsx(U,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(D,{to:"/$owner/connectors/create",params:{owner:o},children:[n.jsx(ge,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:L}),n.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":"Loading connectors",children:Array.from({length:6}).map((s,t)=>n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${t===5?"":"border-b"}`,children:[n.jsx(O,{className:"h-7 w-7 shrink-0 rounded-md"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[n.jsx(O,{className:"h-4 w-40"}),n.jsx(O,{className:"h-3 w-24"})]})]},t))})]});const B=s=>{R({to:"/$owner/connectors",params:{owner:o},search:t=>({...t,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[v.map(s=>n.jsx(U,{type:"button",variant:l===s?"secondary":"ghost","aria-pressed":l===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>B(s),children:ue[s]},s)),v.length===0&&b.length===0&&m.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto shrink-0",children:L})]}),b.length===0?v.length>0?n.jsx(q,{icon:G.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>B("all")}):m.length>0?null:n.jsx(q,{icon:G.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map(({connector:s,group:t,facets:N,profileCounts:p,needsSetup:P,provider:g,sandbox:e,device:c},F)=>{const I=new Map(d.map(M=>[M.key,M])),h=me(s.key,I,{name:s.name,iconUrl:g?S.find(M=>M.slug===g.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??t?.favicon_domain??(e?pe(e.providerKind):void 0)}),y=p.oauth_account+p.browser_session,j=t?.connection_count??0,$=c?ye(c):g?[g.isDefault?"Default":null,g.status].filter(Boolean).join(" · "):e?[e.providerKind,e.connected?"Connected":"No credential"].join(" · "):[`${j} ${j===1?"connection":"connections"}`,y>0?`${y} ${y===1?"account":"accounts"}`:null,p.oauth_app>0?`${p.oauth_app} OAuth app${p.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),T=Y(F,k),W=n.jsxs(n.Fragment,{children:[c?n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(he,{platform:fe(c)})}):n.jsx(xe,{icon:h.icon,iconUrl:h.iconUrl,name:h.name,faviconDomain:h.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:h.name}),n.jsx(ve,{facets:N})]}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$})]}),P?n.jsx(be,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Needs setup"}):null]});return c?n.jsx(D,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:c.id},className:T,children:W},s.key):n.jsx(D,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},className:T,children:W},s.key)})}),m.length>0?n.jsx("div",{className:"overflow-hidden rounded-lg border border-dashed",children:m.map((s,t)=>n.jsxs(D,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},className:Y(t,m.length),children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-dashed",children:s.icon}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:s.name}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.tagline})]}),n.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},s.id))}):null]})}function Y(o,r){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${o===r-1?"":"border-b"}`}function we(o,r,a,d){const u=a.some(i=>i.type==="none");return!!(!u&&a.some(i=>i.type==="oauth")&&d.oauth_app===0||!u&&a.some(i=>i.type==="env_keys")&&d.env===0||!u&&a.some(i=>i.type==="app_installation")&&!r||o.required_capability&&!r)}export{Ie as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b8 as r,j as e}from"./index-DtRfQcRH.js";import{M as m}from"./memory-browse-page-Bibfs2sK.js";import"./switch-CxDXvPGE.js";import"./entity-type-page-BrWqk6so.js";import"./json-diff-DYeX-xLk.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-BHiWR94J.js";import"./schema-value-normalization-BspxVEGy.js";import"./calendar-CHXehtu0.js";import"./core.esm-C-eNiUAl.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./view-frame-HoBawpT2.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-CD4DOaG8.js";import"./use-applied-views-DvMT3wap.js";import"./member-scope-gate-CJqJZk7T.js";function S(){const{owner:t}=r.useParams(),o=r.useSearch();return e.jsx(m,{ownerSlug:t,create:!1,createType:o.create_type==="true"})}export{S as component};
|