PageSourceSearch

https://tradeintelx.com/assets/CommandPalette-DCO1HROv.js

js tradeintelx.com collected 2026-09-24 14:55:34 UTC 9,047 bytes, 7 lines download raw bytes

1import{o as T}from"./rolldown-runtime-ChpBd9eV.js";import{La as M,Ma as D,Ta as A,_r as L,da as C,ha as _,ja as V}from"./chat-page-evUfHQgD.js";import{Gu as q,Uu as H}from"./market-core-DitXLvJ-.js";import{Yr as I,dr as K,qr as O}from"./community-page-CrngAMw5.js";import{$ as P,C as R,Et as U,H as $,Jt as B,Rt as G,W as Y,Xt as z,Y as F,Zt as J,dt as Q,h as W,lt as X,o as Z}from"./react-icons-vendor-BRFUBoNn.js";import{Ht as b,qt as ee}from"./education-page-vD6yUpCZ.js";var r=T(M(),1),e=A(),te=(t,n,c,i,p)=>[{id:"new-trade",label:"New Trade",description:"Log a new trade",shortcut:"N",icon:I,category:"Actions",action:()=>t("/trade-logger?new=true"),keywords:["add","create","log","entry"]},{id:"search-trades",label:"Search Trades",description:"Search your trade history",icon:b,category:"Actions",action:()=>t("/trade-logger?search=true"),keywords:["find","filter","lookup"]},{id:"export-data",label:"Export Data",description:"Download your trades as CSV",icon:q,category:"Actions",action:()=>t("/trade-logger?export=true"),keywords:["download","csv","excel","backup"]},{id:"go-dashboard",label:"Dashboard",description:"Go to main dashboard",icon:X,category:"Navigation",action:()=>t("/"),keywords:["home","main","overview"]},{id:"go-trade-logger",label:"Trade Logger",description:"View and log trades",icon:H,category:"Navigation",action:()=>t("/trade-logger"),keywords:["trades","journal","log"]},{id:"go-analytics",label:"Analytics",description:"View performance analytics",shortcut:"A",icon:z,category:"Navigation",action:()=>t("/trade-analytics"),keywords:["stats","performance","metrics","reports"]},{id:"go-chat",label:"Chat",description:"Open chat hub",icon:F,category:"Navigation",action:()=>t("/chat"),keywords:["messages","talk","community"]},{id:"go-education",label:"Education",description:"Trading education hub",icon:ee,category:"Navigation",action:()=>t("/education"),keywords:["learn","courses","tutorials","lessons"]},{id:"go-news",label:"Trading Context",description:"Market news and analysis",icon:$,category:"Navigation",action:()=>t("/news"),keywords:["market","updates","headlines"]},{id:"go-community",label:"Community",description:"Trading community",icon:Z,category:"Navigation",action:()=>t("/community"),keywords:["social","traders","network"]},{id:"go-signals",label:"Signals",description:"Trading signals",icon:O,category:"Navigation",action:()=>t("/signals"),keywords:["alerts","ideas","recommendations"]},{id:"go-achievements",label:"Achievements",description:"View your achievements",icon:J,category:"Navigation",action:()=>t("/achievements"),keywords:["badges","rewards","progress"]},{id:"go-calendar",label:"Trading Calendar",description:"View trading calendar",icon:G,category:"Navigation",action:()=>t("/trading-calendar"),keywords:["schedule","history","dates"]},{id:"settings",label:"Settings",description:"Open settings",shortcut:",",icon:R,category:"Settings",action:()=>t("/settings"),keywords:["preferences","config","options"]},{id:"toggle-theme",label:i?"Switch to Light Mode":"Switch to Dark Mode",description:"Toggle dark/light theme",icon:i?W:Y,category:"Settings",action:c,keywords:["dark","light","theme","mode"]},{id:"notifications",label:"Notifications",description:"View notifications",icon:B,category:"Settings",action:()=>t("/notifications"),keywords:["alerts","updates"]},{id:"help",label:"Help & Support",description:"Get help",shortcut:"?",icon:Q,category:"Help",action:()=>t("/help"),keywords:["support","faq","guide"]},{id:"keyboard-shortcuts",label:"Keyboard Shortcuts",description:"View all shortcuts",icon:U,category:"Help",action:()=>{},keywords:["keys","hotkeys"]},{id:"sign-out",label:"Sign Out",description:"Sign out of your account",icon:P,category:"Account",action:async()=>{await p(),t("/signin")},keywords:["logout","exit"]}];function ce({isOpen:t,onClose:n}){const c=D(),i=V(),p=(0,r.useRef)(null),h=(0,r.useRef)(null),[m,y]=(0,r.useState)(""),[u,l]=(0,r.useState)(0),{isDarkMode:k,toggleTheme:N}=K(),{signOut:v}=L(),x=(0,r.useMemo)(()=>te(c,i,N,k,v),[c,i,N,k,v]),j=(0,r.useMemo)(()=>{if(!m.trim())return x;const a=m.toLowerCase().split(" ");return x.filter(s=>{const o=[s.label,s.description,s.category,...s.keywords||[]].join(" ").toLowerCase();return a.every(g=>o.includes(g))})},[x,m]),f=(0,r.useMemo)(()=>{const a={};
1return j.forEach(s=>{a[s.category]||(a[s.category]=[]),a[s.category].push(s)}),a},[j]),d=(0,r.useMemo)(()=>Object.values(f).flat(),[f]),w=(0,r.useCallback)(a=>{a.action(),n(),y(""),l(0)},[n]);return(0,r.useEffect)(()=>{if(!t)return;const a=s=>{switch(s.key){case"ArrowDown":s.preventDefault(),l(o=>Math.min(o+1,d.length-1));break;case"ArrowUp":s.preventDefault(),l(o=>Math.max(o-1,0));break;case"Enter":s.preventDefault(),d[u]&&w(d[u]);break;case"Escape":s.preventDefault(),n();break;case"Tab":s.preventDefault(),s.shiftKey?l(o=>Math.max(o-1,0)):l(o=>Math.min(o+1,d.length-1));break;default:break}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,d,u,w,n]),(0,r.useEffect)(()=>{t&&p.current&&p.current.focus()},[t]),(0,r.useEffect)(()=>{t||(y(""),l(0))},[t]),(0,r.useEffect)(()=>{l(0)},[m]),(0,r.useEffect)(()=>{if(h.current){const a=h.current.querySelector(`[data-index="${u}"]`);a&&a.scrollIntoView({block:"nearest"})}},[u]),(0,e.jsx)(_,{children:t&&(0,e.jsx)(C.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-[999] flex items-start justify-center pt-[15vh] bg-black/60 backdrop-blur-sm",onClick:n,children:(0,e.jsxs)(C.div,{initial:{scale:.95,y:-20,opacity:0},animate:{scale:1,y:0,opacity:1},exit:{scale:.95,y:-20,opacity:0},transition:{duration:.15},className:"w-full max-w-xl bg-slate-900 border border-slate-700/50 rounded-xl shadow-2xl overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("div",{className:"relative border-b border-slate-700/50",children:[(0,e.jsx)(b,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),(0,e.jsx)("input",{ref:p,type:"text",placeholder:"Type a command or search...",value:m,onChange:a=>y(a.target.value),className:"w-full py-4 pl-12 pr-4 bg-transparent text-white text-lg outline-none placeholder-slate-500"}),(0,e.jsx)("kbd",{className:"absolute right-4 top-1/2 -translate-y-1/2 px-2 py-0.5 bg-slate-800 rounded text-xs text-slate-400",children:"ESC"})]}),(0,e.jsx)("div",{ref:h,className:"max-h-[50vh] overflow-y-auto",children:d.length===0?(0,e.jsxs)("div",{className:"p-8 text-center text-slate-400",children:[(0,e.jsx)(b,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),(0,e.jsx)("p",{children:"No commands found"}),(0,e.jsx)("p",{className:"text-sm text-slate-500 mt-1",children:"Try a different search term"})]}):Object.entries(f).map(([a,s])=>(0,e.jsxs)("div",{className:"py-2",children:[(0,e.jsx)("div",{className:"px-4 py-1.5 text-xs font-medium text-slate-500 uppercase tracking-wider",children:a}),s.map(o=>{const g=d.indexOf(o),S=g===u,E=o.icon;return(0,e.jsxs)("div",{"data-index":g,className:`
2                            px-4 py-2.5 flex items-center gap-3 cursor-pointer transition-colors
3                            ${S?"bg-blue-500/20 text-white":"text-slate-300 hover:bg-slate-800/50"}
4                          `,onClick:()=>w(o),onMouseEnter:()=>l(g),children:[(0,e.jsx)("div",{className:`
5                            p-1.5 rounded-lg 
6                            ${S?"bg-blue-500/30":"bg-slate-800"}
7                          `,children:(0,e.jsx)(E,{className:"w-4 h-4"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"font-medium truncate",children:o.label}),(0,e.jsx)("div",{className:"text-xs text-slate-500 truncate",children:o.description})]}),o.shortcut&&(0,e.jsx)("kbd",{className:"flex-shrink-0 px-2 py-0.5 bg-slate-800 rounded text-xs text-slate-400 font-mono",children:o.shortcut})]},o.id)})]},a))}),(0,e.jsxs)("div",{className:"px-4 py-2.5 border-t border-slate-700/50 flex items-center gap-4 text-xs text-slate-500",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)("kbd",{className:"px-1.5 py-0.5 bg-slate-800 rounded",children:"↑"}),(0,e.jsx)("kbd",{className:"px-1.5 py-0.5 bg-slate-800 rounded",children:"↓"}),(0,e.jsx)("span",{className:"ml-1",children:"Navigate"})]}),(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)("kbd",{className:"px-1.5 py-0.5 bg-slate-800 rounded",children:"↵"}),(0,e.jsx)("span",{className:"ml-1",children:"Select"})]}),(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)("kbd",{className:"px-1.5 py-0.5 bg-slate-800 rounded",children:"Tab"}),(0,e.jsx)("span",{className:"ml-1",children:"Next"})]})]})]})})})}function le(){const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{const c=i=>{(i.metaKey||i.ctrlKey)&&i.key==="k"&&(i.preventDefault(),n(!0))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[]),{isOpen:t,open:()=>n(!0),close:()=>n(!1),toggle:()=>n(c=>!c)}}export{ce as default,le as useCommandPalette};

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.