1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,301110,e=>{"use strict";let t=(0,e.i(224589).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",()=>t],301110)},772786,e=>{"use strict";var t=e.i(228477),n=e.i(422178),r=e.i(914104),s=e.i(857750),a=e.i(887317),i=e.i(952425),l=e.i(741540);function o({coin:e,enabled:m=!0,limit:f=100,minNotional:h=0,since:x,stocksOnly:p=!1}={}){let{data:g=[]}=(0,t.usePerpMarkets)(),{categories:S,isPending:b}=(0,i.usePerpMarketCategories)(g),y=(0,s.useMemo)(()=>new Set((S.find(e=>"stocks"===e.key)?.markets??[]).flatMap(e=>[e.symbol,e.coin,u(e.symbol),u(e.coin)].map(d))),[S]),v=(0,r.useQuery)({queryKey:["official-smart-money",e??"all",p?"stocks":"all",h,x,f],queryFn:()=>(0,l.getSmartMoneyFeed)({...e?{coin:e}:{},minNotional:h,since:x,limit:100}),enabled:m,placeholderData:n.keepPreviousData,refetchOnWindowFocus:!1,staleTime:15e3}),j=function({coin:e,enabled:t,minNotional:n,onReady:r,since:i}
1){let[l,o]=(0,s.useState)([]),u=(0,s.useRef)(r);return(0,s.useEffect)(()=>{u.current=r},[r]),(0,s.useEffect)(()=>{if(!t)return;let r=new EventSource(function(e,t){let n=a.API_BASE_URL.startsWith("/"),r=new URL(`${a.API_BASE_URL.replace(/\/+$/,"")}${e}`,"http://localhost");for(let[e,n]of Object.entries(t))r.searchParams.set(e,n);return n?`${r.pathname}${r.search}`:r.toString()}("/smart-money/stream",{...e?{coin:e}:{},...n>0?{minNotional:String(n)}:{},...i?{since:i}:{}}));return r.addEventListener("ready",()=>void u.current()),r.addEventListener("trade.created",e=>{let t=function(e){if(!(e instanceof MessageEvent)||"string"!=typeof e.data)return null;try{return JSON.parse(e.data)}catch{return null}}(e);t&&o(e=>c([t,...e]).slice(0,100))}),()=>r.close()},[e,t,n,i]),l}({coin:e,enabled:m,minNotional:h,onReady:v.refetch,since:x}),w=(0,s.useMemo)(()=>c([...j,...v.data?.items??[]]).filter(e=>!p||y.has(d(e.coin))).filter(t=>!e||d(t.coin)===d(e)).filter(e=>e.notional>=h).filter(e=>!x||new Date(e.occurredAt)>=new Date(x)).sort((e,t)=>new Date(t.occurredAt).getTime()-new Date(e.occurredAt).getTime()).slice(0,f),[e,f,h,v.data?.items,x,y,p,j]);return{error:v.error,isError:v.isError,isPending:m&&(v.isPending||p&&b),items:w,status:v.data?.status}}function c(e){return[...new Map(e.map(e=>[e.id,e])).values()]}function u(e){return e.includes(":")?e.split(":").at(-1)??e:e}function d(e){return e.trim().toUpperCase()}e.s(["useOfficialSmartMoney",()=>o])},499100,e=>{"use strict";var t=e.i(898347),n=e.i(228477),r=e.i(422178),s=e.i(914104),a=e.i(373730),i=e.i(367744),l=e.i(301110),o=e.i(857750),c=e.i(103287),u=e.i(213028),d=e.i(466691),m=e.i(924911),f=e.i(423609),h=e.i(300033),x=e.i(534792),p=e.i(887317),g=e.i(195882),S=e.i(772786),b=e.i(952425),y=e.i(108400);let v="STOCKS",j={source:"ALL",coin:v,time:"24H",minNotional:1e4,minScore:70};function w(){let{data:e=[]}=(0,n.usePerpMarkets)(),[w,M]=(0,g.useLocalStorageState)("okie:monitor:official-filters",j,k),{source:D,coin:T,time:R,minNotional:C,minScore:P}=w,[I]=(0,o.useState)(()=>Date.now()),{categories:F,isPending:O}=(0,b.usePerpMarketCategories)(e),$="ALL"===R?void 0:new Date(I-({"1H":36e5,"24H":864e5,"7D":6048e5})[R]).toISOString(),U="ALL"===T||T===v?"":T,W=(0,o.useMemo)(()=>[...new Set(e.map(e=>e.symbol))].sort((e,t)=>E(e).localeCompare(E(t))),[e]),_=(0,o.useMemo)(()=>new Set((F.find(e=>"stocks"===e.key)?.markets??[]).flatMap(e=>[e.symbol,e.coin,E(e.symbol),E(e.coin)].map(L))),[F]),B=(0,S.useOfficialSmartMoney)({...U?{coin:U}:{},enabled:"NEWS"!==D,limit:100,minNotional:C,since:$,stocksOnly:T===v}),H=(0,s.useQuery)({queryKey:["official-monitor","news",T,P],queryFn:async()=>{let e=await (0,y.getNewsflashIntelligenceFeed)({...U?{asset:E(U)}:{},limit:"100",minScore:String(P)});if(200!==e.status)throw Error(e.data.message||"Unable to load news");return e.data.data},enabled:"TRADE"!==D,placeholderData:r.keepPreviousData,refetchOnWindowFocus:!1}),K=function(e){let[t,n]=(0,o.useState)([]),r=(0,o.useRef)(e);return(0,o.useEffect)(()=>{r.current=e},[e]),(0,o.useEffect)(()=>{let e=new EventSource(function(e,t){let n=p.API_BASE_URL.startsWith("/"),r=new URL(`${p.API_BASE_URL.replace(/\/+$/,"")}${e}`,"http://localhost");for(let[e,n]of Object.entries(t))r.searchParams.set(e,n);return n?`${r.pathname}${r.search}`:r.toString()}("/newsflash/intelligence/stream",{limit:"100"}));return e.addEventListener("ready",()=>{r.current()}),e.addEventListener("analysis.created",e=>{let t=function(e){if(!(e instanceof MessageEvent)||"string"!=typeof e.data)return null;try{return JSON.parse(e.data)}catch{return null}}(e);t&&n(e=>N([t,...e]).slice(0,100))}),()=>e.close()},[]),t}(H.refetch),V=(0,o.useMemo)(()=>[..."NEWS"===D?[]:B.items.map(e=>({id:`trade:${e.id}`,kind:"trade",timestamp:e.occurredAt,value:e})),..."TRADE"===D?[]:N([...K,...H.data??[]]).filter(e=>!$||new Date(e.news.publishedAt)>=new Date($)).filter(e=>(function(e,t,n){if("ALL"===t)return!0;if(t===v)return e.assets.some(e=>n.has(L(e.asset))||e.instruments?.some(e=>"stocks"===e.category.trim().toLowerCase()||[e.symbol,e.marketKey,e.baseSymbol].map(L).some(e=>n.has(e)))===!0);let r=L(E(t));return e.assets.some(e=>L(e.asset)===r||e.instruments?.some(e=>[e.symbol,e.marketKey,e.baseSymbol].map(e=>L(E(e))).includes(r))===!0)})(e,T,_)).filter(e=>e.score>=P).map(e=>({id:`news:${e.id}`,kind:"news",timestamp:e.news.publishedAt,value:e}))].sort((e,t)=>
1new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()),[T,P,H.data,$,D,_,K,B.items]),q=T===v&&O||"NEWS"!==D&&B.isPending||"TRADE"!==D&&H.isPending,z="NEWS"!==D&&B.isError||"TRADE"!==D&&H.isError;return(0,t.jsx)(f.ProductCardFrame,{children:(0,t.jsxs)("section",{className:"overflow-hidden rounded-3xl bg-card",children:[(0,t.jsx)("div",{className:"border-b border-foreground/[0.07] px-4 py-4 sm:px-5",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(h.Select,{value:D,onValueChange:e=>M(t=>({...t,source:e})),children:[(0,t.jsx)(h.SelectTrigger,{"aria-label":"Filter by event type",className:"h-9 bg-foreground/[0.04] text-xs",children:(0,t.jsx)(h.SelectValue,{})}),(0,t.jsxs)(h.SelectContent,{children:[(0,t.jsx)(h.SelectItem,{value:"ALL",children:"All events"}),(0,t.jsx)(h.SelectItem,{value:"TRADE",children:"Trades"}),(0,t.jsx)(h.SelectItem,{value:"NEWS",children:"News"})]})]}),(0,t.jsxs)(h.Select,{value:T,onValueChange:e=>M(t=>({...t,coin:e})),children:[(0,t.jsx)(h.SelectTrigger,{"aria-label":"Filter by token",className:"h-9 min-w-36 bg-foreground
1/[0.04] text-xs",children:(0,t.jsx)(h.SelectValue,{placeholder:"All tokens"})}),(0,t.jsxs)(h.SelectContent,{children:[(0,t.jsx)(h.SelectItem,{value:v,children:"Stocks"}),(0,t.jsx)(h.SelectItem,{value:"ALL",children:"All tokens"}),W.map(e=>(0,t.jsx)(h.SelectItem,{value:e,children:E(e)},e))]})]}),(0,t.jsxs)(h.Select,{value:R,onValueChange:e=>M(t=>({...t,time:e})),children:[(0,t.jsx)(h.SelectTrigger,{"aria-label":"Filter by time",className:"h-9 bg-foreground/[0.04] text-xs",children:(0,t.jsx)(h.SelectValue,{})}),(0,t.jsxs)(h.SelectContent,{children:[(0,t.jsx)(h.SelectItem,{value:"1H",children:"Last hour"}),(0,t.jsx)(h.SelectItem,{value:"24H",children:"Last 24 hours"}),(0,t.jsx)(h.SelectItem,{value:"7D",children:"Last 7 days"}),(0,t.jsx)(h.SelectItem,{value:"ALL",children:"All history"})]})]}),"NEWS"!==D?(0,t.jsxs)("label",{className:"flex h-9 items-center gap-1.5 rounded-full border border-input bg-foreground/[0.04] px-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"shrink-0",children:"Trade ⥠$"}),(0,t.jsx)(m.Input,{"aria-label":"Minimum trade size",className:"h-auto w-16 rounded-none border-0 bg-transparent p-0 text-xs shadow-none focus-visible:ring-0",min:0,step:1e3,type:"number",value:C,onChange:e=>M(t=>({...t,minNotional:Math.max(0,Number(e.target.value)||0)}))})]}):null,"TRADE"!==D?(0,t.jsxs)("label",{className:"flex h-9 items-center gap-1.5 rounded-full border border-input bg-foreground
1/[0.04] px-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"shrink-0",children:"News score â¥"}),(0,t.jsx)(m.Input,{"aria-label":"Minimum news score",className:"h-auto w-8 rounded-none border-0 bg-transparent p-0 text-xs shadow-none focus-visible:ring-0",max:100,min:0,step:5,type:"number",value:P,onChange:e=>M(t=>({...t,minScore:Math.min(100,Math.max(0,Number(e.target.value)||0))}))})]}):null,(0,t.jsxs)(d.Button,{variant:"ghost",size:"sm",className:"ml-auto h-7 gap-1.5 rounded-full px-2.5 text-[11px] text-muted-foreground",onClick:function(){M(j)},children:[(0,t.jsx)(l.RotateCcw,{className:"size-3"})," Reset"]})]})}),q?(0,t.jsx)("div",{className:"divide-y divide-foreground/[0.06]",children:Array.from({length:6}).map((e,n)=>(0,t.jsxs)("div",{className:"px-5 py-6",children:[(0,t.jsx)(x.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(x.Skeleton,{className:"mt-3 h-4 w-full"})]},n))}):z?(0,t.jsx)(A,{icon:(0,t.jsx)(i.Radio,{className:"size-7"}),title:"Live feed unavailable",detail:"The latest monitor events could not be loaded."}):0===V.length?(0,t.jsx)(A,{icon:(0,t.jsx)(a.Newspaper,{className:"size-7"}),title:"No matching events",detail:"Try widening the current filters."}
1):(0,t.jsx)("div",{className:"divide-y divide-foreground/[0.06]",children:V.map(e=>"trade"===e.kind?(0,t.jsx)(u.SmartMoneyEventRow,{compact:!1,event:e.value},e.id):(0,t.jsx)(c.IntelligenceFeedItem,{compact:!1,item:e.value},e.id))})]})})}function N(e){return[...new Map(e.map(e=>[e.id,e])).values()]}function A({detail:e,icon:n,title:r}){return(0,t.jsxs)("div",{className:"flex min-h-64 flex-col items-center justify-center px-6 text-center text-muted-foreground",children:[n,(0,t.jsx)("h3",{className:"mt-3 text-sm font-semibold text-foreground",children:r}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e})]})}function E(e){return e.includes(":")?e.split(":").at(-1)??e:e}function L(e){return e.trim().toUpperCase()}function k(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||!["ALL","TRADE","NEWS"].includes(t.source)||!["1H","24H","7D","ALL"].includes(t.time)||"string"!=typeof t.coin||!t.coin||"number"!=typeof t.minNotional||!Number.isFinite(t.minNotional)||"number"!=typeof t.minScore||!Number.isFinite(t.minScore))return null;return{source:t.source,coin:t.coin,time:t.time,minNotional:Math.max(0,t.minNotional),minScore:Math.min(100,Math.max(0,t.minScore))}}catch{return null}}e.s(["UnifiedMonitorFeed",()=>w])},35335,e=>{e.n(e.i(499100))}]);
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.