1import{k as h,e as w,r as i,j as e,N as d}from"./react-vendor-DlfacoUt.js";import{k as v,h as g,u as j}from"./views-CpdrNrKE.js";import N from"./HomeFeed-BNe-HWYQ.js";import{B as u}from"./index-B7ErYi-u.js";import{L as b,d as S}from"./icons-vendor-iDMXddrC.js";import"./publicUrl-2g-y0Hbp.js";import"./useFollowingFeed-BTLHh53B.js";import"./FeedPostCard-D5H-WVM9.js";import"./useBookmarks-BpZaMk8u.js";import"./bookmarkResearch-BZeNzdaZ.js";import"./avatar-Bl3shE1c.js";import"./radix-vendor-Bnc9sXGn.js";import"./supabase-vendor-BFpL0hm0.js";import"./badge-Bfx1cijQ.js";import"./query-vendor-BRUoyimQ.js";import"./dialog-D3QU6WBB.js";import"./IntroRequestForm-CzlcBtl4.js";import"./textarea-Dni_-p1y.js";import"./formatDistanceToNow-kv3x8eHy.js";import"./en-US-C5vD-bVu.js";import"./endOfMonth-B_ILu3ZT.js";import"./useLikeStatuses-C_m8HVs0.js";import"./FeedRaiseCard-DJICV3rD.js";import"./SourceCountBadge-CrCdYTIM.js";import"./formatMoney-B83mWdob.js";import"./AddToPipelineDialog-XopumkQM.js";import"./input-D46aJJ9k.js";import"./label-aBq373ll.js";import"./select-Dwg7O8SN.js";import"./SignUpPromptDialog-DqD4J54D.js";import"./CompanyLogo-BUKTjfRA.js";import"./getCompanyLogoUrl-DaGxGj66.js";import"./useWatch-DssCDY7X.js";import"./useWatchlist-uUyh5qib.js";import"./tabs-Bc40huyk.js";import"./uploadMedia-DAFZ_Ps8.js";import"./switch-DdFmRadd.js";import"./gate-B3VJKsZy.js";import"./dropdown-menu-Bsjfhlv7.js";import"./SavedViewChip-DqrgTvVd.js";import"./scroll-area-BOI3aX3g.js";import"./checkbox-Dn4U3HF9.js";import"./EditViewDialog-BJdbWYdx.js";import"./useSavedViews-Dc5GuGbX.js";import"./sheet-0USaZev0.js";import"./useExpeditionContext-T0G94kD5.js";import"./expeditionContext-C3DbC4Pw.js";import"./useExpeditionFiles-Ckh9ooOT.js";import"./artifactLibrary-C_PHGzAk.js";import"./useScreenReport-Y-8lvNTI.js";import"./screenReport-JV_wZSWZ.js";import"./useNetworkMembers-DTqq4hT9.js";function be(){const{id:o}=h(),p=w(),[t,x]=i.useState(null),[f,c]=i.useState(!0),[s,a]=i.useState(null);if(i.useEffect(()=>{(async()=>{if(!o){a("No view ID provided"),c(!1);return}try{const m=(await g()).find(l=>l.id===o);m?(x(m),j(m.id,{last_opened_at:new Date().toISOString()}).catch(l=>console.error("Failed to update last_opened_at:",l))):a("View not found")}catch(r){console.error("Error loading view:",r),a(r instanceof Error?r.message:"Failed to load view")}finally{c(!1)}})()},[o]),f)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx(b,{className:"h-8 w-8 animate-spin text-muted-foreground/70"})});if(s||!t)return e.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:s==="View not found"?"View Not Found":"Something Went Wrong"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:s||"This view could not be loaded. It may have been deleted."}),e.jsx(u,{onClick:()=>p("/app/views"),children:"Back to Views Library"})]})});if(t.scope==="agent"){const{search:n}=v(t);return e.jsx(d,{to:`/app/intel/agent${n?`?${n}`:""}`,replace:!0})}return t.scope==="pipeline"?e.jsx(d,{to:`/app/pipeline?view=${t.id}`,replace:!0}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-border flex items-center gap-4 bg-card/50 backdrop-blur-sm sticky top-0 z-30",children:[e.jsx(u,{variant:"ghost",size:"icon",onClick:()=>p("/app/views"),className:"flex-shrink-0",children:e.jsx(S,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground truncate",children:t.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Saved View ⢠",t.scope]})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"pt-6",children:e.jsx(N,{initialFilters:t.query||{rounds:[],sectors:[],stages:[],geographies:[],dealSizeMin:null,dealSizeMax:null},readOnly:!0,scope:t.scope})})})]})}export{be as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.