1import{eb as e,ad as xe,eB as P,eM as L,em as f,ag as W,aV as E,a8 as de,a4 as le,K as F,dj as _,ee as N,O as k,ar as J,cQ as pe,al as ue,bO as he,ao as fe,B as ge,ae as we,af as q,eG as je,f8 as ae,aq as Ne,au as H,f1 as re,ah as be,aa as ye,Z as ve,aW as Y,eW as M,_ as Se,M as ie,aF as ne,av as ce,cX as U,cJ as Ce,cI as ke,cC as I,cE as _e,cA as Te,cB as Ae,cD as Pe,f2 as Ee,bK as Le,bH as Z,aH as Me,bx as Oe,bI as Ie,bw as Re,bJ as De,ab as Ue,J as Fe,eC as Ve,k as Ke,i as z,h as X,cZ as R,o as Ge,p as Q,l as Be,m as $e,j as Je,u as Ye,cU as He,bc as ee,bd as se,cu as We}from"./index-NSyJWIAB.js";import{P as qe}from"./premiumPlanLogo-DBexUW0O.js";import{E as Ze}from"./elitePlanLogo-324cx57N.js";import{b as ze,T as Xe}from"./TickerAnalysisSingleNote-lq0R6G2v.js";import{F as oe,T as Qe}from"./FRIconTableColumns-BfCVrHy5.js";import"./FRIconGripLines-D05vaA96.js";const es=()=>e.jsx("div",{className:"z-10 absolute rounded-lg shadow-xl min-w-[32rem] border-1 border-custom-dark-light animate-enter bg-custom-dark bottom-16 right-0",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute h-0 w-0 border-x-8 border-x-transparent border-custom-dark-light border-t-8 -bottom-[8px] right-[30px]"}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"min-w-10 h-10 fill-custom-sixth bg-custom-sixth/20 p-2 m-2.5 mr-0 rounded-md ",children:e.jsx(xe,{})}),e.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[e.jsx("p",{className:"text-2xl text-left text-white font-bold",children:"Allow automatic discounts"}),e.jsx("p",{className:"text-xl text-left text-white opacity-70",children:"If this setting is enabled and you are eligible for a discount, the discount will be applied automatically during checkout."})]})]})]})}),ss=()=>{const{profile:t,setProfile:n}=P(),{setOpenSessionExpiredModal:a,logoutResetValues:r}=L(),[s,l]=f.useState(!1),[p,c]=f.useState(!1),[o,m]=f.useState({name:t.name,surname:t.surname,allowAutoDiscount:t?.allow_auto_discount??!1}),x=(i,u)=>{m({...o,[i]:u})},d=async()=>{try{if(!o.name)return;l(!0);const i={...o},u=await _.post("/update-profile",i);n({...t,name:o.name,surname:o.surname,allow_auto_discount:o.allowAutoDiscount}),N("success",u.data.msg),l(!1)}catch(i){i?.response?.data?.errorType==="sessionExpiredError"?(a(!0),r()):N("error",i?.response?.data?.msg??"There was an unexpected error"),l(!1)}};return e.jsxs("div",{className:"flex flex-col gap-6 bg-custom-dark-mid rounded-xl p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-2xl text-white font-medium",children:"Account Settings"}),e.jsx("p",{className:"text-white/60 text-lg mt-1",children:"Manage your personal information."})]}),e.jsx("div",{className:"basis-2/3",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col xl:flex-row gap-6 items-center",children:[e.jsxs("div",{className:"w-full xl:basis-1/2 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-6 h-6 fill-white/80",children:e.jsx(W,{})}),e.jsx("label",{htmlFor:"email",className:"text-white text-xl font-medium",children:"Name"})]}),e.jsx(E,{type:"text",id:"name",name:"name",value:o?.name,isError:!o.name,onChange:x})]}),e.jsxs("div",{className:"w-full xl:basis-1/2 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-6 h-6 fill-white/80",children:e.jsx(W,{})}),e.jsx("label",{htmlFor:"email",className:"text-white text-xl font-medium",children:"Surname"})]}),e.jsx(E,{type:"text",id:"surname",name:"surname",value:o?.surname,onChange:x})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-6 h-6 fill-white/80",children:e.jsx(de,{})}),e.jsx("label",{htmlFor:"email",className:"text-white text-xl font-medium",children:"Email"})]}),e.jsx(E,{type:"text",id:"email",name:"email",value:t?.email,isDisabled:!0})]}),e.jsxs("div",{className:"cursor-pointer w-fit flex gap-4 items-center ml-auto py-2 relative",onClick:()=>x("allowAutoDiscount",!o.allowAutoDiscount),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e.jsx("p",{className:"text-white text-xl font-medium px-2",children:"Allow automatic discounts during checkout"}),e.jsx("div",{className:`flex justify-center p-1 size-[1.6rem] rounded-[0.2rem] ${o.allowAutoDiscount?"bg-custom-sixth fill-white":"bg-custom-dark-extra-light fill-gray-400"}`,children:e.jsx(le,{})}),p&&e.jsx(es,{})]}),s?e.jsx("div",{className:"flex items-center ml-auto mr-16 size-[3.25rem] p-2",children:e.jsx(F,{})}):e.jsx("button",{className:"rounded-lg text-white text-xl font-medium py-3 px-8 w-fit ml-auto bg-custom-sixth hover:bg-opacity-80",onClick:d,children:"Save Settings"})]})})]})},ts="data:image/svg+xml,%3csvg%20width='480'%20height='985'%20viewBox='0%200%20480%20985'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M160.934%20582.984L286.667%20577.015C311.289%20575.846%20331.209%20556.569%20333.186%20531.999L341.794%20424.986L453.617%20419.677C473.404%20418.738%20486.371%20440.086%20476.417%20457.212L177.368%20971.736C163.992%20994.748%2
10128.7%20983.7%20130.834%20957.168L160.934%20582.984Z'%20fill='url(%23paint0_linear_17_9)'/%3e%3cpath%20d='M309.263%20530.075L317.625%20426.133Z'%20fill='url(%23paint1_linear_17_9)'/%3e%3cpath%20d='M26.8813%20565.322L285.529%20553.043C298.091%20552.446%20308.255%20542.611%20309.263%20530.075L349.665%2027.8306C351.799%201.29871%20316.506%20-9.74934%20303.131%2013.2635L4.08145%20527.787C-5.87235%20544.913%207.09519%20566.261%2026.8813%20565.322Z'%20fill='url(%23paint2_linear_17_9)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_17_9'%20x1='601.999'%20y1='762.999'%20x2='111.676'%20y2='485.783'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23C2970E'/%3e%3cstop%20offset='1'%20stop-color='%23F8C72C'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_17_9'%20x1='601.999'%20y1='762.999'%20x2='111.676'%20y2='485.783'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23C2970E'/%3e%3cstop%20offset='1'%20stop-color='%23F8C72C'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_17_9'%20x1='-121.5'%20y1='222'%20x2='368.823'%20y2='499.216'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFF3CC'/%3e%3cstop%20offset='1'%20stop-color='%23FFC50C'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ls="data:image/svg+xml,%3csvg%20width='480'%20height='985'%20viewBox='0%200%20480%20985'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M160.934%20582.985L286.667%20577.016C311.289%20575.847%20331.209%20556.57%20333.186%20532L341.794%20424.986L453.617%20419.678C473.404%20418.739%20486.371%20440.087%20476.417%20457.212L177.368%20971.736C163.992%20994.749%20128.7%20983.701%20130.834%20957.169L160.934%20582.985Z'%20fill='url(%23paint0_linear_17_2)'/%3e%3cpath%20d='M309.263%20530.075L317.625%20426.134Z'%20fill='url(%23paint1_linear_17_2)'/%3e%3cpath%20d='M26.8813%20565.322L285.529%20553.043C298.091%20552.446%20308.255%20542.611%20309.263%20530.075L349.665%2027.8306C351.799%201.29871%20316.506%20-9.74934%20303.131%2013.2635L4.08145%20527.787C-5.87235%20544.913%207.09519%20566.261%2026.8813%20565.322Z'%20fill='url(%23paint2_linear_17_2)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_17_2'%20x1='121.999'%20y1='416.999'%20x2='566.09'%20y2='644.956'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23556AF0'/%3e%3cstop%20offset='0.934935'%20stop-color='%233125BA'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_17_2'%20x1='121.999'%20y1='416.999'%20x2='566.09'%20y2='644.956'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23556AF0'/%3e%3cstop%20offset='0.934935'%20stop-color='%233125BA'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_17_2'%20x1='-257'%20y1='199'%20x2='310.696'%20y2='544.02'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2329D5D7'/%3e%3cstop%20offset='1'%20stop-color='%232762FB'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",as={free:ts,basic:ls,premium:qe,elite:Ze},te={free:{logoBg:"bg-yellow-500/20",gradient:"from-yellow-500/15",dot:"bg-yellow-400"},basic:{logoBg:"bg-custom-sixth/20",gradient:"from-custom-sixth/20",dot:"bg-custom-sixth"},premium:{logoBg:"bg-red-600/20",gradient:"from-red-500/15",dot:"bg-red-400"},elite:{logoBg:"bg-emerald-600/20",gradient:"from-emerald-500/20",dot:"bg-emerald-400"}},rs=t=>t<70?"#10b981dd":t<100?"#f59e0baa":"#ef4444cc",B=({icon:t,iconBg:n,iconFill:a,title:r,usage:s,limit:l})=>{const p=l===1/0,c=p?0:s/l*100,o=Math.min(Math.round(c),100),m=!p&&s>=l;return e.jsxs("div",{className:"basis-1/3 flex flex-col gap-5 bg-custom-dark-mid-light rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 shrink-0 rounded-md p-2 ${n} ${a}`,children:t}),e.jsx("p",{className:"text-white text-xl font-medium flex-1 leading-tight",children:r}),m&&e.jsx("div",{className:"w-7 h-7 p-1 fill-amber-500 shrink-0",title:"Limit reached",children:e.jsx(J,{})})]}),e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[p?e.jsx("span",{className:"text-4xl text-white font-medium",children:s}):e.jsxs("span",{className:"text-4xl text-white font-medium",children:[s,e.jsxs("span",{className:"text-white/40",children:[" / ",l]})]}),e.jsx("span",{className:"text-white/50 text-lg",children:"analysis"})]}),e.jsxs("div",{className:"relative h-8 w-full bg-custom-dark-extra-light/70 rounded-md overflow-hidden",children:[e.jsx("div",{className:"h-full rounded-md transition-[width] duration-500",style:{width:`${o}%`,backgroundColor:rs(c)}}),p?e.jsx("p",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-white/70 text-xl",children:"â"}):e.jsx("p",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-white text-xl font-medium",children:`${o} %`})]})]})},is=()=>{const[t,n]=f.useState(!1),{profile:a}=P(),{setOpenSessionExpiredModal:r,logoutResetValues:s}=L(),l=a?.subscription_plan,p=te[l]??te.free,c=pe[l],o=he[l],m=ge[l],x=!["free","trialing","active"].includes(a?.subscription_status),d=a?.subscription_ending_ts?k.fromSeconds(a.subscription_ending_ts).toISODate():null,i=!!a?.free_trial_used,u=a?.subscription_ending_ts?Math.max(0,Math.ceil(k.fromSeconds(a.subscription_ending_ts).diffNow("days").days)):null,b=u===1?"1 day left":`${u} days left`,V=l==="free"?"Upgrade your plan":i?"Upgrade now":"Manage subscription",K=async()=>{try{n(!0);const A=await _.post("/create-portal-session");N("success",A.data.msg),window.location.replace(A.data.portalURL)}catch(A){A?.response?.data?.errorType==="sessionExpiredError"?(r(!0),s()):window.open("//flash-research.com/pricing","_blank")}finally{n(!1)}};return e.jsxs("div",{className:"flex flex-col gap-6 bg-custom-dark-mid rounded-xl p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"text-2xl text-white font-medium",children:"Subscription settings"}),e.jsx("p",{className:"text-white/60 text-lg mt-1",children:"Your current plan and this period's usage."})]}),a?.beta_tester&&e.jsx("p",{className:"bg-amber-400/80 text-custom-dark font-medium text-xl px-4 py-0.5 rounded-md whitespace-nowrap",children:"beta tester"})]}),i&&e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-3 p-4 rounded-lg bg-emerald-500/10 border-1 border-emerald-500/30",children:[e.jsx("div",{className:"w-10 h-10 shrink-0 bg-emerald-500/20 rounded-md p-2 fill-emerald-500",children:e.jsx(J,{})}),e.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[e.jsx("p",{className:"text-xl text-white font-medium",children:"Your free trial is active"}),e.jsxs("p",{className:"text-white/75 text-lg",children:[d?`Your free trial ends on ${d} (${b}). `:"Your free trial is currently active. ","When it ends, your account will move to the Free plan automatically. Upgrade now to keep your Elite access."]})]})]}),e.jsxs("div",{className:"relative overflow-hidden flex flex-col sm:flex-row sm:items-center gap-5 p-5 rounded-xl bg-custom-dark-mid-light",children:[e.jsx("div",{className:`absolute inset-0 pointer-events-none bg-gradient-to-r ${p.gradient} to-transparent`}),e.jsxs("div",{className:"relative flex items-center gap-4 min-w-0",children:[e.jsx("img",{className:"w-14 h-14 shrink-0",src:as[l],alt:"Subscription plan logo"}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("p",{className:"text-2xl text-white font-medium capitalize",children:[l," plan"]}),i&&e.jsx("p",{className:"bg-emerald-400/90 text-custom-dark font-medium text-lg px-3 py-0.5 rounded-md whitespace-nowrap",children:"Free trial"})]}),!a?.flash_account&&d&&e.jsxs("p",{className:"text-white/60 text-lg mt-0.5",children:["Renews on ",d]})]})]}),e.jsx("div",{className:"relative sm:ml-auto",children:t?e.jsx("div",{className:"flex items-center justify-center size-[3.25rem] p-2",children:e.jsx(F,{})}):e.jsx("button",{className:"w-full sm:w-auto rounded-lg text-white text-xl font-medium py-3 px-6 bg-custom-sixth hover:bg-opacity-80 whitespace-nowrap",onClick:K,children:V})})]}),x&&e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-3 p-4 rounded-lg bg-amber-500/10 border-1 border-amber-500/30",children:[e.jsx("div",{className:"w-10 h-10 shrink-0 bg-amber-500/20 rounded-md p-2 fill-amber-500",children:e.jsx(J,{})}),e.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[e.jsx("p",{className:"text-xl text-white font-medium",children:"Subscription update required"}),e.jsx("p",{className:"text-white/75 text-lg",children:"There are some important actions to do regarding your subscription. Please take a moment to check and update your subscription settings to continue using Flash Research."}),e.jsx("p",{className:"text-white/60 text-base",children:"If you continue experiencing issues, please contact us at [email protected]"})]})]}),e.jsxs("div",{className:"flex gap-4 flex-col xl:flex-row",children:[e.jsx(B,{icon:e.jsx(ue,{}),iconBg:"bg-yellow-500/20",iconFill:"fill-yellow-500",title:"Ticker analysis usage",usage:a.ticker_analysis_usage,limit:c}
1),e.jsx(B,{icon:e.jsx(fe,{}),iconBg:"bg-emerald-600/20",iconFill:"fill-emerald-500",title:"Setup analysis usage",usage:a.gap_analysis_usage,limit:o}),e.jsx(B,{icon:e.jsx(we,{}),iconBg:"bg-custom-sixth/20",iconFill:"fill-custom-sixth",title:"Backtesting usage",usage:a.backtesting_usage,limit:m})]})]})},ns=()=>{const{setOpenSessionExpiredModal:t,logoutResetValues:n}=L(),[a,r]=f.useState(!1),[s,l]=f.useState({newPass:{showPass:!1,value:"",error:{isError:!1,msg:""}},confirmNewPass:{showPass:!1,value:"",error:{isError:!1,msg:""}}}),p=x=>x.length<8?{isError:!0,msg:"Password must be at least 8 characters"}:x.toUpperCase()==x?{isError:!0,msg:"Password must have at least 1 lowercase character"}:x.toLowerCase()==x?{isError:!0,msg:"Password must have at least 1 uppercase character"}:/\d/.test(x)?{isError:!1,msg:""}:{isError:!0,msg:"Password must have at least 1 number"},c=(x,d)=>x==d?{isError:!1,msg:""}:{isError:!0,msg:"Passwords do not match"},o=(x,d)=>{l({...s,[x]:{...s[x],value:d}})},m=async()=>{try{const x=p(s?.newPass?.value),d=c(s?.newPass?.value,s?.confirmNewPass?.value);if(l({newPass:{...s?.newPass,error:x},confirmNewPass:{...s?.confirmNewPass,error:d}}),x?.isError||d?.isError)return;r(!0);const i={newPass:s?.newPass?.value,confirmNewPass:s?.confirmNewPass?.value},u=await _.post("/update-password",i);l({newPass:{showPass:!1,value:"",error:{isError:!1,msg:""}},confirmNewPass:{showPass:!1,value:"",error:{isError:!1,msg:""}}}),N(u.data.isError?"error":"success",u.data.msg),r(!1)}catch(x){x?.response?.data?.errorType==="sessionExpiredError"?(t(!0),n()):N("error",x?.response?.data?.msg??"There was an unexpected error"),r(!1)}};return e.jsxs("div",{className:"flex flex-col gap-6 bg-custom-dark-mid rounded-xl p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx("p",{className:"text-2xl text-white font-medium",children:"Change password"}),e.jsx("p",{className:"text-white/60 text-lg mt-1",children:"Keep your account secure with a strong password."}),e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-white text-xl mt-6 ml-4",children:[e.jsxs("div",{className:"basis-[calc(50%-0.75rem)] flex items-center gap-4",children:[e.jsx("span",{className:"w-3 h-3 bg-custom-sixth rounded-full"}),e.jsx("p",{className:"opacity-70 whitespace-nowrap",children:"Min 8 characters"})]}),e.jsxs("div",{className:"basis-[calc(50%-0.75rem)] flex items-center gap-4",children:[e.jsx("span",{className:"w-3 h-3 bg-custom-sixth rounded-full"}),e.jsx("p",{className:"opacity-70 whitespace-nowrap",children:"At least 1 lowercase character"})]}),e.jsxs("div",{className:"basis-[calc(50%-0.75rem)] flex items-center gap-4",children:[e.jsx("span",{className:"w-3 h-3 bg-custom-sixth rounded-full"}),e.jsx("p",{className:"opacity-70 whitespace-nowrap",children:"At least 1 uppercase character"})]}),e.jsxs("div",{className:"basis-[calc(50%-0.75rem)] flex items-center gap-4",children:[e.jsx("span",{className:"w-3 h-3 bg-custom-sixth rounded-full"}),e.jsx("p",{className:"opacity-70 whitespace-nowrap",children:"At least 1 number"})]})]})]}),e.jsx("div",{className:"basis-2/3",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-6 h-6 fill-white/80",children:e.jsx(q,{})}),e.jsx("label",{htmlFor:"email",className:"text-white text-xl font-medium",children:"Password"})]}),e.jsx(E,{type:"password",id:"newPass",name:"newPass",value:s?.newPass?.value,isError:s?.newPass?.error?.isError,onChange:o}),s?.newPass?.error?.isError&&e.jsx("p",{className:"text-red-500 text-lg",children:s?.newPass?.error?.msg})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-6 h-6 fill-white/80",children:e.jsx(q,{})}),e.jsx("label",{htmlFor:"email",className:"text-white text-xl font-medium",children:"Repeat password"})]}),e.jsx(E,{type:"password",id:"confirmNewPass",name:"confirmNewPass",value:s?.confirmNewPass?.value,isError:s?.confirmNewPass?.error?.isError,onChange:o}),s?.confirmNewPass?.error?.isError&&e.jsx("p",{className:"text-red-500 text-lg",children:s?.confirmNewPass?.error?.msg})]}),a?e.jsx("div",{className:"flex items-center ml-auto mr-16 size-[3.25rem] p-2",children:e.jsx(F,{})}):e.jsx("button",{className:"rounded-lg text-white text-xl font-medium py-3 px-8 w-fit ml-auto bg-custom-sixth hover:bg-opacity-80",onClick:m,children:"Change Password"})]})})]})},cs=()=>{const{profile:t}=P();return e.jsxs("div",{className:"flex flex-col gap-4 max-w-[82rem] mx-auto w-full",children:[e.jsx("p",{className:"text-white text-4xl sm:text-5xl font-medium px-2",children:"Settings"}),e.jsxs("div",{className:"flex flex-col gap-4 mt-4",children:[e.jsx(ss,{}),e.jsx(is,{}),e.jsx(ns,{})]})]})},os=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:e.jsx("path",{d:"m16 17.06l4.72 4.72a.75.75 0 1 0 1.06-1.06L3.28 2.22a.75.75 0 0 0-1.06 1.06l4.722 4.723l-3.456 3.46a3.25 3.25 0 0 0 .004 4.596l4.462 4.455a3.255 3.255 0 0 0 4.596-.001L16 17.06Zm5.05-5.05L18.06 15L9.002 5.94l2.984-2.988a3.25 3.25 0 0 1 2.3-.953h5.465A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298ZM17 5.502a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3Z"})}),ms=()=>{const{setCurrentPage:t}=je(),{activeTicker:n,tickers:a,tickersInfo:r,tickersIntradayInfo:s,setActiveTicker:l,setTickers:p,setTickersInfo:c,setTickersIntradayInfo:o,setLoa
1dingTicker:m}=ae(),{profile:x,userTags:d,setUserTags:i}=P(),{setOpenSessionExpiredModal:u,logoutResetValues:b}=L(),V=h=>{let w=parseInt(h.substr(1,2),16),g=parseInt(h.substr(3,2),16),T=parseInt(h.substr(5,2),16);return .299*w+.587*g+.114*T>=128?"#0e0f15":"#fff"},K=async h=>{try{const w={tagName:h?.name};await _.post("/delete-ticker-tag",w),i(d?.filter(g=>g!==h))}catch(w){w?.response?.data?.errorType==="sessionExpiredError"?(u(!0),b()):N("error",w?.response?.data?.msg??"There was an unexpected error")}},A=async(h,w)=>{try{const g=d?.map(y=>y?.name===h.name?{color:y?.color,name:y?.name,tickers:y?.tickers?.filter(O=>O!==w)}:y),T={newTags:g.filter(y=>!d.includes(y))};await _.post("/ticker-tags",T),i(g)}catch(g){g?.response?.data?.errorType==="sessionExpiredError"?(u(!0),b()):N("error",g?.response?.data?.msg??"There was an unexpected error")}},me=async h=>{const w=n;if(a.includes(h.toUpperCase())){l(h.toUpperCase()),t("tickerAnalysisPage");return}try{m(!0),t("tickerAnalysisPage");const g=["basic","premium","elite"].includes(x.subscription_plan)?k.now().minus({years:5}).set({hour:0,minute:0,second:0,millisecond:0}).toISODate():k.now().minus({months:3}).set({hour:0,minute:0,second:0,millisecond:0}).toISODate(),T={gaps:{generalFilters:{minimumGapDayDate:g},gapFilters:[{label:"Gap value",value:"gapDayGapValue",min:20,max:"",type:"range",rangeType:"percentage"},{label:"Volume",value:"gapDayVolume",min:1e6,max:"",type:"range",rangeType:"volumeType"}]},runners:{generalFilters:{minimumRunnerDayDate:g},runnerFilters:[{label:"High spike",value:"runnerDayHighSpike",min:20,max:"",type:"range",rangeType:"percentage"},{label:"Volume",value:"runnerDayVolume",min:1e6,max:"",type:"range",rangeType:"volumeType"}]}},y=await _.post(`/ticker-info/${h.toUpperCase()}`,T);let O=[...a];O.push(h.toUpperCase());let G={...r};G={...G,[h.toUpperCase()]:{gapsUp:{...y.data.data.gaps,filters:{generalFilters:{minimumGapDayDate:["basic","premium","elite"].includes(x.subscription_plan)?k.now().minus({years:5}).set({hour:0,minute:0,second:0,millisecond:0}).toJSDate():k.now().minus({months:3}).set({hour:0,minute:0,second:0,millisecond:0}).toJSDate()},gapFilters:[{label:"Gap value",value:"gapDayGapValue",min:20,max:"",type:"range",rangeType:"percentage"},{label:"Volume",value:"gapDayVolume",min:1e6,max:"",type:"range",rangeType:"volumeType"}]}},runners:{...y.data.data.runners,filters:{generalFilters:{minimumRunnerDayDate:["basic","premium","elite"].includes(x.subscription_plan)?k.now().minus({years:5}).set({hour:0,minute:0,second:0,millisecond:0}).toJSDate():k.now().minus({months:3}).set({hour:0,minute:0,second:0,millisecond:0}).toJSDate()},runnerFilters:[{label:"High spike",value:"runnerDayHighSpike",min:20,max:"",type:"range",rangeType:"percentage"},{label:"Volume",value:"runnerDayVolume",min:1e6,max:"",type:"range",rangeType:"volumeType"}]}}}},l(h.toUpperCase()),p([...O]),c({...G}),o({...s,[h.toUpperCase()]:{isIntraday:!1,intradayDateClicked:null,showIntradayTab:!1,isAdjusted:!0}}),N("success","Ticker loaded successfully"),m(!1)}catch(g){g?.response?.data?.errorType==="sessionExpiredError"?(u(!0),b()):g?.response?.data?.errorType==="subscriptionUsageLimitError"?(N("warning","Ticker analysis limit reached",e.jsx(SubscriptionLimitPopupAlert,{msgContext:"tickerAnalysis"}),1/0),l(w),c({...r})):g?.response?.data?.errorType==="wrongTicker"?(N("warning",g?.response?.data?.msg),l(w),c({...r})):(N("error",g?.response?.data?.msg??"There was an unexpected error"),l(w),c({...r})),t("tickerAnalysisPage"),m(!1)}};return e.jsxs("div",{className:"min-h-[65rem] lg:w-1/2 flex flex-col bg-custom-dark-mid rounded-lg",children:[e.jsx("div",{className:"flex items-center border-b-1 border-custom-dark-light p-2 py-3",children:e.jsx("p",{className:"text-white text-2xl ml-4",children:"Your tags"})}),d?.length===0?e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-6",children:[e.jsx("div",{className:"w-24 h-24 fill-custom-dark-extra-extra-light",children:e.jsx(os,{})}),e.jsx("p",{className:"text-custom-dark-extra-extra-light text-5xl font-bold",children:"No tags"})]}):e.jsx("div",{className:"m-4 flex flex-col gap-4",children:d.map((h,w)=>e.jsxs("div",{className:"p-4 bg-custom-dark-mid-light border-1 border-custom-dark-light rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"w-fit text-xl px-4 py-1 rounded-md font-medium",style:{backgroundColor:h?.color,color:V(h?.color)},children:h?.name}),e.jsx("button",{onClick:()=>K(h),className:"w-8 h-8 fill-gray-400 rounded-md p-2 hover:bg-red-500 hover:fill-white ml-auto",children:e.jsx(Ne,{})})]}),e.jsxs("div",{className:"flex gap-3 flex-wrap items-center mt-4",children:[e.jsx("p",{className:"text-white text-xl",children:"Tickers:"}),h?.tickers?.map((g,T)=>e.jsxs("div",{className:"flex items-center overflow-hidden rounded-md bg-custom-dark-extra-light",children:[e.jsxs("button",{onClick:()=>me(g),className:"text-white text-xl font-medium px-3 py-1 hover:bg-custom-sixth",children:["$",g]}),e.jsx("button",{onClick:()=>A(h,g),className:"p-1.5 w-6 h-9 fill-white hover:bg-red-500 hover:fill-white",children:e.jsx(H,{})})]},`settings_tag_${w}_ticker_${T}`))]})]},`settings_tag_${w}`))})]})},xs=()=>{const[t,n]=f.useState(!1),{firstLoad:a,notes:r,setFirstLoad:s,setNotes:l}=re(),p=async()=>{try{n(!0);const c=await _.get("/user-notes");l(c.data.notes),s(!0),n(!1)}catch{n(!1),error?.response?.data?.errorType==="sessionExpiredError"?(setOpenSessionExpiredModal(!0),logoutResetValues()):N("error",error?.response?.data?.msg??"There was an unexpected error"),s(!0)}};return f.useEffect(()=>{!a&&p()},[]),e.jsxs("div",{className:"min-h-[65rem] lg:w-1/2 flex flex-col bg-custom-dark-mid rounded-lg",children:[e.jsxs("div",{className:"flex items-center border-b-1 border-custom-dark-light p-2",children:[e.jsx("p",{className:"text-white text-2xl ml-4",children:"Your notes"}),t?e.jsx("div",{className:"flex items-center ml-auto w-10 h-10",children:e.jsx(F,{})}):e.jsx("button",{onClick:p,className:"ml-auto w-10 h-10 p-2 rounded-md hover:bg-custom-dark-light fill-white",title:"reload",children:e.jsx(be,{})})]}),r?.length===0?e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-6",children:[e.jsx("div",{className:"w-24 h-24 fill-custom-dark-extra-extra-light",children:e.jsx(ye,{})}),e.jsx("p",{className:"text-custom-dark-extra-extra-light text-5xl font-bold",children:"No ticker notes"})]}):e.jsx("div",{className:"flex flex-col gap-6 m-4",children:r.map((c,o)=>e.jsx(ze,{note:c},`settings_note_${o}`))})]})},ds=()=>e.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[e.jsx("p",{className:"text-white text-4xl sm:text-5xl font-medium px-2",children:"Tags & Notes"}),e.jsxs("div",{className:"flex-1 flex gap-4 mt-4 flex-col lg:flex-row",children:[e.jsx(ms,{}),e.jsx(xs,{})]})]}),ps=()=>e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"relative overflow-hidden w-full max-w-[70rem] mx-auto rounded-2xl bg-custom-dark-mid border-1 border-custom-dark-mid-light px-10 py-20",children:[e.jsx("div",{"aria-hidden":!0,
1className:"pointer-events-none absolute -top-40 left-1/2 -translate-x-1/2 h-[40rem] w-[40rem] rounded-full bg-custom-third/10 blur-3xl"}),e.jsxs("div",{className:"relative flex flex-col items-center gap-8 text-center",children:[e.jsx("div",{className:"w-20 h-20 stroke-custom-third/60",children:e.jsx(ve,{})}),e.jsx("span",{className:"rounded-full bg-custom-third/15 text-custom-third px-6 py-2 text-xl font-medium",children:"Coming Soon"}),e.jsx("h2",{className:"text-5xl md:text-7xl font-bold bg-gradient-to-r from-white via-white to-custom-third bg-clip-text text-transparent leading-tight",children:"Affiliate Program"}),e.jsx("span",{className:"block h-2 w-12 bg-custom-dark-extra-light rounded-full"}),e.jsx("p",{className:"max-w-[50rem] text-2xl text-gray-400",children:"Something big is coming for the traders who spread the word. Details drop soon."})]})]})}),us=()=>e.jsx(ps,{}),j=({preferences:t,minKey:n,maxKey:a,setValue:r,valueFormat:s})=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1 flex gap-4 items-center",children:[e.jsx("p",{className:"text-white/70 text-xl",children:"Min:"}),e.jsx("div",{className:"flex-1 sm:w-[14rem]",children:e.jsx(Y,{className:"text-right w-full bg-custom-dark-light rounded-md px-4 py-1.5 text-white text-xl border-1 focus:outline-none focus:border-custom-second border-custom-dark-extra-light hover:border-custom-dark-extra-extra-light",value:t?.[n],onValueChange:l=>r(n,l?.floatValue??null),prefix:s==="currency"?"$":"",suffix:s==="percentage"?"%":"",thousandSeparator:!0})})]}),e.jsxs("div",{className:"flex-1 flex gap-4 items-center",children:[e.jsx("p",{className:"text-white/70 text-xl",children:"Max:"}),e.jsx("div",{className:"w-full sm:w-[14rem]",children:e.jsx(Y,{className:"text-right w-full bg-custom-dark-light rounded-md px-4 py-1.5 text-white text-xl border-1 focus:outline-none focus:border-custom-second border-custom-dark-extra-light hover:border-custom-dark-extra-extra-light",value:t?.[a],onValueChange:l=>r(a,l?.floatValue??null),prefix:s==="currency"?"$":"",suffix:s==="percentage"?"%":"",thousandSeparator:!0})})]})]}),hs=()=>{const{msPreferences:t,setMsPreferences:n}=M(),a=(r,s)=>{const l={...t,[r]:s};n({...l}),localStorage.setItem("flashresearch.marketSentimentPreferences",JSON.stringify(l))};return e.jsx("div",{className:"flex-1 px-4 flex justify-between gap-6",children:e.jsx("div",{className:"flex flex-col gap-6 w-full",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Days since last gap calendar filters"}),e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Days since last gap calendar gap value filter"}),e.jsx(j,{preferences:t,minKey:"msCalendarMinGapValue",maxKey:"msCalendarMaxGapValue",setValue:a,valueFormat:"percentage"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Days since last gap calendar volume filter"}),e.jsx(j,{preferences:t,minKey:"msCalendarMinVol",maxKey:"msCalendarMaxVol",setValue:a})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Days since last gap calendar price filter"}),e.jsx(j,{preferences:t,minKey:"msCalendarMinPrice",maxKey:"msCalendarMaxPrice",setValue:a,valueFormat:"currency"})]})]})]})})})},v=({prefKey:t,options:n=[],selectedOption:a,setSelectedOption:r})=>{const s=f.useRef(null),l=f.useRef(null),[p,c]=f.useState(!1),[o,m]=f.useState("bottom"),x=n.find(i=>i?.value===a)?.label;f.useEffect(()=>{const i=b=>{p&&s.current&&l.current&&!l.current.contains(b.target)&&!s.current.contains(b.target)&&c(!1)};return window.innerHeight-s.current?.getBoundingClientRect().bottom<300?m("bottom"):m("top"),document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)}
1,[p]);const d=i=>{r(t,i),c(!1)};return e.jsxs("div",{className:"relative w-full max-w-[18rem]",children:[e.jsxs("button",{ref:s,onClick:()=>c(!p),className:`w-full flex items-center justify-between bg-custom-dark-light rounded-md pl-4 pr-3 py-1.5 border-1 hover:border-custom-dark-extra-extra-light ${p?"!border-custom-second":"border-custom-dark-extra-light"}`,children:[e.jsx("p",{className:"text-left text-xl text-white",children:x}),e.jsx("div",{className:"size-7 stroke-white/70 rotate-90",children:e.jsx(Se,{})})]}),p&&e.jsx("div",{ref:l,className:"custom-select shadow-xl flex flex-col gap-2 absolute right-0 max-h-[35rem] overflow-auto bg-custom-dark border-1 border-custom-dark-light rounded-lg w-full p-2 z-10 animate-enter",style:{top:o==="top"?"3rem":null,bottom:o==="bottom"?"3rem":null},children:n?.map((i,u)=>e.jsx("button",{className:`text-left text-xl text-white w-full py-2 px-4 rounded-md ${i?.value===a?"bg-custom-sixth/80 font-medium":"hover:bg-custom-dark-mid-light"}`,onClick:()=>d(i?.value),children:i?.label},`monthly_avg_table_${i?.value}_${u}`))})]})},C=({columns:t,selectedColumns:n,setSelectedColumns:a,tooltipDescriptions:r})=>{const[s,l]=f.useState(!1);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"text-xl text-white/70",children:"Select colums:"}),e.jsx("button",{className:"w-[26px] h-[26px] aspect-square p-2.5 rounded-md fill-white border-1 border-custom-dark-extra-light bg-custom-dark-light hover:bg-custom-dark-light/80",onClick:()=>l(!0),children:e.jsx(oe,{})})]}),e.jsx(ie,{isOpen:s,setIsOpen:l,maxWidth:"max-w-[60rem]",height:"max-h-[70rem] h-[calc(100vh-2rem)]",children:e.jsxs("div",{className:"w-full h-full flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center p-4 border-b-1 border-custom-dark-light",children:[e.jsx("p",{className:"text-white text-2xl",children:"Select columns"}),e.jsx("button",{onClick:()=>l(!1),className:"h-full aspect-square p-2 rounded-[0.2rem] ml-auto fill-white hover:bg-red-600",children:e.jsx(H,{})})]}),e.jsx(Qe,{columns:t,selectedColumns:n,setSelectedColumns:a,tooltipDescriptions:r})]})})]})},D=({columns:t,selectedColumns:n,setSelectedColumns:a,metricKey:r})=>{const[s,l]=f.useState(!1);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"text-xl text-white/70",children:"Select colums:"}),e.jsx("button",{className:"w-[26px] h-[26px] aspect-square p-2.5 rounded-md fill-white border-1 border-custom-dark-extra-light bg-custom-dark-light hover:bg-custom-dark-light/80",onClick:()=>l(!0),children:e.jsx(oe,{})})]}),e.jsx(ie,{isOpen:s,setIsOpen:l,maxWidth:"max-w-[60rem]",height:"max-h-[70rem] h-[calc(100vh-2rem)]",children:e.jsxs("div",{className:"w-full h-full flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center p-4 border-b-1 border-custom-dark-light",children:[e.jsx("p",{className:"text-white text-2xl",children:"Select columns"}),e.jsx("button",{onClick:()=>l(!1),className:"h-full aspect-square p-2 rounded-[0.2rem] ml-auto fill-white hover:bg-red-600",children:e.jsx(H,{})})]}),e.jsx(Xe,{columns:t,selectedColumns:n,setSelectedColumns:a,metricKey:r})]})})]})},fs=()=>{const{financialsColumns:t,setFinancialsColumns:n,setGapTableColumns:a}=ae(),{taPreferences:r,setTaPreferences:s}=M(),l=(o,m)=>{const x={...r,[o]:m};s({...x}),localStorage.setItem("flashresearch.tickerAnalysisPreferences",JSON.stringify(x))},p=o=>{localStorage.setItem("flashresearch.tickerAnalysis.gapTableCols",JSON.stringify(o)),a(o)},c=(o,m)=>{localStorage.setItem("flashresearch.tickerAnalysis.financials.selectedMetrics",JSON.stringify({...t,[m]:o})),n({...t,[m]:o})};return e.jsx("div",{className:"flex-1 px-4 flex justify-between gap-6",children:e.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Gap statistics settings"}),e.jsx("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Gap statistics metric"}),e.jsx(v,{prefKey:"taStatsMetric",options:ne,selectedOption:r?.taStatsMetric,setSelectedOption:l})]})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Ticker gap list"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker gap list close direction"}),e.jsx(v,{prefKey:"taGapsCloseDir",options:ce,selectedOption:r?.taGapsCloseDir,setSelectedOption:l})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker gap list displayed columns"}),e.jsx(C,{columns:ke,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.tickerAnalysis.gapTableCols"))??Ce,setSelectedColumns:p,tooltipDescriptions:U})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker gap list gap value filter"}),e.jsx(j,{preferences:r,minKey:"taMinGapValue",maxKey:"taMaxGapValue",setValue:l,valueFormat:"percentage"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker gap list volume filter"}),e.jsx(j,{preferences:r,minKey:"taMinVol",maxKey:"taMaxVol",setValue:l})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Ticker financials"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker financial displayed statistics"}),e.jsx(D,{columns:_e,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.tickerAnalysis.financials.selectedMetrics"))?.statistics??I?.statistics,setSelectedColumns:c,metricKey:"statistics"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker balance sheet displayed metrics"}),e.jsx(D,{columns:Te,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.tickerAnalysis.financials.selectedMetrics"))?.balanceSheet??I?.balanceSheet,setSelectedColumns:c,metricKey:"balanceSheet"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker cash flow displayed metrics"}),e.jsx(D,{columns:Ae,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.tickerAnalysis.financials.selectedMetrics"))?.cashFlow??I?.cashFlow,setSelectedColumns:c,metricKey:"cashFlow"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Ticker income statements displayed metrics"}),e.jsx(D,{columns:Pe,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.tickerAnalysis.financials.selectedMetrics"))?.incomeStatement??I?.incomeStatement,setSelectedColumns:c,metricKey:"incomeStatement"})]})]})]})]})})},S=({prefKey:t,value:n,setValue:a})=>{const r=()=>{a(t,!n)};return e.jsx("div",{className:"h-[25px] flex items-center",children:e.jsx("div",{onClick:r,className:`curs
1or-pointer flex justify-center p-1 w-[1.6rem] h-[1.6rem] rounded-[0.2rem] ${n?"bg-custom-sixth fill-white":"bg-custom-dark-extra-light fill-gray-400"}`,children:e.jsx(le,{})})})},gs=()=>{const{setMonthlySummaryColumns:t,setSetupListTableColumns:n,setSetupListRunnerTableColumns:a}=Ee(),{gaPreferences:r,setGaPreferences:s}=M(),l=(m,x)=>{const d={...r,[m]:x};s({...d}),localStorage.setItem("flashresearch.gapAnalysisPreferences",JSON.stringify(d))},p=m=>{localStorage.setItem("flashresearch.gapAnalysis.monthlySummaryCols",JSON.stringify(m)),t(m)},c=m=>{localStorage.setItem("flashresearch.gapAnalysis.gapListCols",JSON.stringify(m)),n(m)},o=m=>{localStorage.setItem("flashresearch.gapAnalysis.runnerListCols",JSON.stringify(m)),a(m)};return e.jsx("div",{className:"flex-1 px-4 flex justify-between gap-6",children:e.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"General stats"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Setup stats close direction"}),e.jsx(v,{prefKey:"gaGapsCloseDir",options:ce,selectedOption:r?.gaGapsCloseDir,setSelectedOption:l})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Setup statistics metric"}),e.jsx(v,{prefKey:"gaStatsMetric",options:ne,selectedOption:r?.gaStatsMetric,setSelectedOption:l})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Historical stats"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Monthly overview column selector"}),e.jsx(C,{columns:Z,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.gapAnalysis.monthlySummaryCols"))??Le,setSelectedColumns:p,tooltipDescriptions:U})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Historical statistics chart series"}),e.jsx(v,{prefKey:"gaHistChartSeries",options:Z,selectedOption:r?.gaHistChartSeries,setSelectedOption:l})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Historical statistics chart type"}),e.jsx(v,{prefKey:"gaHistChartType",options:Me,selectedOption:r?.gaHistChartType,setSelectedOption:l})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Change from open monthly chart - Split by year"}),e.jsx(S,{prefKey:"gaPriceChgMonthlyYearSplit",value:r?.gaPriceChgMonthlyYearSplit,setValue:l})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Change from open monthly chart - Show premarket"}),e.jsx(S,{prefKey:"gaPriceChgMonthlyPremarket",value:r?.gaPriceChgMonthlyPremarket,setValue:l})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Change from open annual chart - Show premarket"}),e.jsx(S,{prefKey:"gaPriceChgAnnualPremarket",value:r?.gaPriceChgAnnualPremarket,setValue:l})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Gap list"}),e.jsx("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Gap list displayed columns"}),e.jsx(C,{columns:Ie,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.gapAnalysis.gapListCols"))??Oe,setSelectedColumns:c,tooltipDescriptions:U})]})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Runner list"}),e.jsx("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Runner list displayed columns"}),e.jsx(C,{columns:De,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.gapAnalysis.runnerListCols"))??Re,setSelectedColumns:o,tooltipDescriptions:U})]})})]})]})})},ws=({prefKey:t,options:n=[],selectedOptions:a=[],setSelectedOptions:r})=>
1{const s=f.useRef(null),l=f.useRef(null),[p,c]=f.useState(!1),[o,m]=f.useState("bottom");f.useEffect(()=>{const d=u=>{p&&s.current&&l.current&&!l.current.contains(u.target)&&!s.current.contains(u.target)&&c(!1)};return window.innerHeight-s.current?.getBoundingClientRect().bottom<300?m("bottom"):m("top"),document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[p]);const x=d=>{if(a?.includes(d)){const i=a?.filter(u=>u!==d);r(t,i)}else{const i=[...a,d];r(t,i)}};return e.jsxs("div",{className:"relative",children:[e.jsx("button",{ref:s,onClick:()=>c(!p),className:"flex ml-auto w-[26px] h-[26px] aspect-square p-2.5 rounded-md fill-white border-1 border-custom-dark-extra-light bg-custom-dark-light hover:bg-custom-dark-light/80",children:e.jsx(Ue,{})}),p&&e.jsx("div",{ref:l,className:"w-[20rem] custom-select flex flex-col gap-2 absolute right-0 max-h-[35rem] overflow-auto bg-custom-dark border-1 border-custom-dark-light rounded-xl p-2 z-10 animate-enter",style:{top:o==="top"?"3rem":null,bottom:o==="bottom"?"3rem":null},children:n.map(d=>e.jsx("button",{className:`flex items-center py-3 pr-8 pl-4 text-xl rounded-md ${a.includes(d)?"text-white font-medium bg-custom-sixth/80 hover:bg-custom-sixth/70":"text-white/70 hover:bg-custom-dark-mid"}`,onClick:()=>x(d),children:e.jsx("p",{className:"whitespace-nowrap",children:d})},`corporate_action_displayed_button_${d}`))})]})},js=()=>{const{calPreferences:t,setCalPreferences:n}=M(),a=(r,s)=>{const l={...t,[r]:s};n({...l}),localStorage.setItem("flashresearch.calendarPreferences",JSON.stringify(l))};return e.jsx("div",{className:"flex-1 px-4 flex justify-between gap-6",children:e.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Corporate actions"}),e.jsx("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Selected corporate actions"}),e.jsx(ws,{prefKey:"calCorpActions",options:Fe,selectedOptions:t?.calCorpActions,setSelectedOptions:a})]})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Gaps Up calendar filters"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Gap value filter"}),e.jsx(j,{preferences:t,minKey:"calGapsUpMinGapValue",maxKey:"calGapsUpMaxGapValue",setValue:a,valueFormat:"percentage"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Volume filter"}),e.jsx(j,{preferences:t,minKey:"calGapsUpMinVol",maxKey:"calGapsUpMaxVol",setValue:a})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Price filter"}),e.jsx(j,{preferences:t,minKey:"calGapsUpMinPrice",maxKey:"calGapsUpMaxPrice",setValue:a,valueFormat:"currency"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Range Movers calendar filters"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Range filter"}),e.jsx(j,{preferences:t,minKey:"calRangeMoversMinRange",maxKey:"calRangeMoversMaxRange",setValue:a,valueFormat:"percentage"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Volume filter"}),e.jsx(j,{preferences:t,minKey:"calRangeMoversMinVol",maxKey:"calRangeMoversMaxVol",setValue:a})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Price filter"}),e.jsx(j,{preferences:t,minKey:"calRangeMoversMinPrice",maxKey:"calRangeMoversMaxPrice",setValue:a,valueFormat:"currency"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Runners calendar filters"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"High spike filter"}),e.jsx(j,{preferences:t,minKey:"calRunnersMinHighSpike",maxKey:"calRunnersMaxHighSpike",setValue:a,valueFormat:"percentage"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Volume filter"}),e.jsx(j,{preferences:t,minKey:"calRunnersMinVol",maxKey:"calRunnersMaxVol",setValue:a})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Price filter"}),e.jsx(j,{preferences:t,minKey:"calRunnersMinPrice",maxKey:"calRunnersMaxPrice",setValue:a,valueFormat:"currency"})]})]})]})]})})},$=({preferences:t,valueKey:n,setValue:a,valueFormat:r})=>e.jsx("div",{className:"flex items-center gap-4",children:e.jsx("div",{className:"flex-1 max-w-[14rem]",children:e.jsx(Y,{className:"text-right w-full bg-custom-dark-light rounded-md px-4 py-1.5 text-white text-xl border-1 focus:outline-none focus:border-custom-second border-custom-dark-extra-light hover:border-custom-dark-extra-extra-light",value:t?.[n],onValueChange:s=>a(n,s?.floatValue??null),prefix:r==="currency"?"$":"",suffix:r==="percentage"?"%":"",thousandSeparator:!0})})}),Ns=()=>{const{setTradesTableColumns:t,setExcludedTradesTableColumns:n,setSavedTableColumns:a,setUnsavedTableColumns:r}=Ve(),{baPreferences:s,setBaPreferences:l}=M(),{profile:p}=P(),c=(i,u)=>{const b={...s,[i]:u};l({...b}),localStorage.setItem("flashresearch.backtestingPreferences",JSON.stringify(b))},o=i=>{localStorage.setItem("flashresearch.backtesting.tradeListColumns",JSON.stringify(i)),t(i)},m=i=>{localStorage.setItem("flashresearch.backtesting.excludedTradeListColumns",JSON.stringify(i)),n(i)},x=i=>{localStorage.setItem("flashresearch.backtesting.savedStrategiesCols",JSON.stringify(i)),a(i)},d=i=>{localStorage.setItem("flashresearch.backtesting.unsavedStrategiesCols",JSON.stringify(i)),r(i)};return e.jsx("div",{className:"flex-1 px-4 flex justify-between gap-6",children:e.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Strategy performance settings"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Monthly performance overview default serie"}),e.jsx(v,{prefKey:"baMonthlyOverviewSerie",options:Ke,selectedOption:s?.baMonthlyOverviewSerie,setSelectedOption:c})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show balance without commissions"}),e.jsx(S,{prefKey:"baBalanceWOCommission",value:s?.baBalanceWOCommission,setValue:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Drawdown chart type"}),e.jsx(v,{prefKey:"baDrawdownChartType",options:z,selectedOption:s?.baDrawdownChartType,setSelectedOption:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Drawdown source"}),e.jsx(v,{prefKey:"baDrawdownSource",options:X,selectedOption:s?.baDrawdownSource,setSelectedOption:c})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show max drawdown period"}),e.jsx(S,{prefKey:"baMaxDrawdownPeriod",value:s?.baMaxDrawdownPeriod,setValue:c})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show balance SMA"}),e.jsx(S,{prefKey:"baBalanceSMA",value:s?.baBalanceSMA,setValue:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Balance SMA period"}),e.jsx($,{preferences:s,valueKey:"baBalanceSMAPeriod",setValue:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Trades list displayed columns"}),e.jsx(C,{columns:Q,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.backtesting.tradeListColumns"))??Ge,setSelectedColumns:o,tooltipDescriptions:R})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Skipped trades list displayed columns"}),e.jsx(C,{columns:$e,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.backtesting.skippedTradeListColumns"))??Be,setSelectedColumns:o,tooltipDescriptions:R})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Excluded trades list displayed columns"}),e.jsx(C,{columns:Q?.filter(i=>i?.isExcludedTrades),selectedColumns:JSON.parse(localStorage.getItem("flashresearch.backtesting.excludedTradeListColumns"))??Je,setSelectedColumns:m,tooltipDescriptions:R})]})]})]}),p?.beta_tester&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("p",{className:"px-4 text-white text-xl font-medium flex items-center gap-2",children:["Strategy analysis settings ",e.jsx(Ye,{})]}),e.jsx("div",{className:"flex flex-col gap-6 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[{prefix:"baSharpe",title:"Sharpe ratio chart"},{prefix:"baWinRate",title:"Win rate chart"}].map(({prefix:i,title:u})=>e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2",children:[e.jsx("p",{className:"text-white/60 text-xl pl-2",children:u}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show SMA"}),e.jsx(S,{prefKey:`${i}SMA`,value:s?.[`${i}SMA`],setValue:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"SMA period"}),e.jsx($,{preferences:s,valueKey:`${i}SMAPeriod`,setValue:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Hide first trades"}),e.jsx($,{preferences:s,valueKey:`${i}Skip`,setValue:c})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show regression line"}),e.jsx(S,{prefKey:`${i}Regression`,value:s?.[`${i}Regression`],setValue:c})]})]},`analysis_prefs_${i}`))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-center",children:e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Strategy optimization settings"})}),e.jsxs("div",{className:"flex flex-col gap-4 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2",children:[e.jsx("p",{className:"px-2 text-white/80 text-lg font-medium",children:"Retester"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Drawdown chart type"}),e.jsx(v,{prefKey:"baRetesterDrawdownChartType",options:z,selectedOption:s?.baRetesterDrawdownChartType,setSelectedOption:c})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Drawdown source"}),e.jsx(v,{prefKey:"baRetesterDrawdownSource",options:X,selectedOption:s?.baRetesterDrawdownSource,setSelectedOption:c})]}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show original strategy balance"}),e.jsx(S,{prefKey:"baRetesterOriginalBalance",value:s?.baRetesterOriginalBalance,setValue:c})]})]}),e.jsx("span",{className:"h-[1px] bg-custom-dark-light w-full"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2",children:[e.jsx("p",{className:"px-2 text-white/80 text-lg font-medium",children:"Reorder trades"}),e.jsxs("div",{className:"flex gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Show original strategy balance"}),e.jsx(S,{prefKey:"baReorderTradesOriginalBalance",value:s?.baReorderTradesOriginalBalance,setValue:c})]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"px-4 text-white text-xl font-medium",children:"Your strategies"}),e.jsxs("div",{className:"flex flex-col gap-6 sm:gap-2 bg-custom-dark/40 rounded-lg border-1 border-custom-dark-light p-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Saved strategies list displayed columns"}),e.jsx(C,{columns:se,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.backtesting.savedStrategiesCols"))??ee,setSelectedColumns:x,tooltipDescriptions:He})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-between sm:items-center",children:[e.jsx("p",{className:"text-white text-xl min-w-[245px] sm:min-w-[unset] pl-2",children:"Unsaved strategies list displayed columns"}),e.jsx(C,{columns:se,selectedColumns:JSON.parse(localStorage.getItem("flashresearch.backtesting.unsavedStrategiesCols"))??ee,setSelectedColumns:d,tooltipDescriptions:R})]})]})]})]})})},bs=()=>{const[t,n]=f.useState("marketSentiment");return e.jsxs("div",{className:"flex flex-col mx-auto gap-4 flex-1 w-full max-w-[82rem]",children:[e.jsx("p",{className:"text-white text-4xl sm:text-5xl font-medium px-2",children:"Preferences"}),e.jsx("p",{className:"text-white/70 text-xl px-2",children:"These settings will be loaded when you open Flash Research."}),e.jsxs("div",{className:"flex-1 flex flex-col gap-4 mt-2 w-full bg-custom-dark-mid rounded-lg",children:[e.jsxs("div",{className:"scroll-page-header flex px-2 overflow-x-auto",children:[e.jsx("button
1",{className:`p-4 text-xl font-medium whitespace-nowrap border-b-2 ${t==="marketSentiment"?"border-custom-sixth text-white":"border-custom-dark-mid-light text-white/60"}`,onClick:()=>n("marketSentiment"),children:"Market Sentiment"}),e.jsx("button",{className:`p-4 text-xl font-medium whitespace-nowrap border-b-2 ${t==="tickerAnalysisTool"?"border-custom-sixth text-white":"border-custom-dark-mid-light text-white/60"}`,onClick:()=>n("tickerAnalysisTool"),children:"Ticker Analysis Tool"}),e.jsx("button",{className:`p-4 text-xl font-medium whitespace-nowrap border-b-2 ${t==="setupAnalysisTool"?"border-custom-sixth text-white":"border-custom-dark-mid-light text-white/60"}`,onClick:()=>n("setupAnalysisTool"),children:"Setup Analysis Tool"}),e.jsx("button",{className:`p-4 text-xl font-medium whitespace-nowrap border-b-2 ${t==="calendar"?"border-custom-sixth text-white":"border-custom-dark-mid-light text-white/60"}`,onClick:()=>n("calendar"),children:"Calendar"}),e.jsx("button",{className:`p-4 text-xl font-medium whitespace-nowrap border-b-2 ${t==="backtestingTool"?"border-custom-sixth text-white":"border-custom-dark-mid-light text-white/60"}`,onClick:()=>n("backtestingTool"),children:"Backtesting Tool"}),e.jsx("span",{className:"flex-1 text-xl font-medium border-b-2 border-custom-dark-mid-light"})]}),e.jsxs("div",{className:"pb-4 pt-2",children:[t==="marketSentiment"&&e.jsx(hs,{}),t==="tickerAnalysisTool"&&e.jsx(fs,{}),t==="setupAnalysisTool"&&e.jsx(gs,{}),t==="calendar"&&e.jsx(js,{}),t==="backtestingTool"&&e.jsx(Ns,{})]})]})]})},Ts=()=>{const[t,n]=f.useState(!1),{settingsPage:a}=re(),{setProfile:r,setUserTags:s,setProfileDefaultValues:l}=P(),{setOpenSessionExpiredModal:p,logoutResetValues:c}=L();return f.useLayoutEffect(()=>{(async()=>{try{n(!0);const m=await _.get("/profile");s(m.data.userTags),r(m.data.profile),n(!1)}catch(m){m?.response?.data?.errorType==="sessionExpiredError"?(p(!0),c()):l(),n(!1)}})()},[]),t?e.jsx("div",{className:"flex-1 flex items-center justify-center bg-custom-dark",children:e.jsx(We,{})}):e.jsx("div",{className:"flex-1 flex",children:e.jsxs("div",{className:"flex flex-col gap-4 mt-4 mx-auto w-full p-4",children:[a==="general"&&e.jsx(cs,{}),a==="tagsAndNotes"&&e.jsx(ds,{}),a==="affiliate"&&e.jsx(us,{}),a==="preferences"&&e.jsx(bs,{})]})})};export{Ts 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.