PageSourceSearch

https://theory-a.com/_next/static/chunks/3101.87663d22c6c83d95.js

js theory-a.com collected 2026-10-04 02:19:25 UTC 47,970 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3101],{13560:(e,t,r)=>{r.d(t,{U:()=>o});let o={blue:{border:"#2b71c7",background:"rgba(43, 113, 199, 0.18)",lightBackground:"rgba(43, 113, 199, 0.05)"},green:{border:"#2e8b21",background:"rgba(32, 107, 62, 0.18)",lightBackground:"rgba(46, 139, 33, 0.05)"},red:{border:"#ed143d",background:"rgba(237, 20, 61, 0.18)",lightBackground:"rgba(237, 20, 61, 0.05)"}}},23101:(e,t,r)=>{r.r(t),r.d(t,{buildActivePurchaseDataset:()=>K,buildClosedPositionDatasets:()=>$,buildGrowthSlopeGuideDataset:()=>k.H,buildProjectedStockPriceDataset:()=>D.C,default:()=>Z,deriveDateBoundsFromDatasets:()=>A,filterMarketcapTooltipItems:()=>et,getClosedPositionLotColor:()=>z});var o=r(37876),a=r(49096),n=r.n(a),i=r(13560),l=r(20011),d=r(81047),s=r(14232),c=r(47389);r(86785);var u=r(44283),b=r(16087),m=r(5899);let p={display:!1,content:null,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:{display:!1,borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,margin:5,position:"auto",side:5,start:"50%"},color:"black",drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},g={gfc:{adjustScaleRange:!1,type:"box",xMin:"2007-12-01",xMax:"2009-06-01",yMin:0,backgroundColor:"#a3a3a333",borderWidth:0,label:p},covid:{adjustScaleRange:!1,type:"box",xMin:"2020-02-01",xMax:"2020-04-01",yMin:0,backgroundColor:"#a3a3a333",borderWidth:0,label:p}};var h=r(81256),f=r(83642),y=r(82851),v=r.n(y),x=r(38008),C=r(71700),D=r(84296),k=r(23411),S=r(31651);let E={id:"lineReadability",beforeDatasetDraw(e,t){e.ctx.save(),e.data.datasets[t.index].emaPeriod&&(e.ctx.globalAlpha*=S.Vz)},afterDatasetDraw(e){e.ctx.restore()}},F=e=>{let t=[...e].sort((e,t)=>e-t),r=Math.floor(t.length/2);return t.length%2?t[r]:(t[r-1]+t[r])/2};var N=r(51036),P=r(54668);let w=[52,64,84],R=[22,163,74],U=[220,38,38];function B(e){if(null===e||!Number.isFinite(e))return"rgb(".concat(w.join(", "),")");let t=e<0?R:U,r=Math.min(1,Math.abs(e)/2),o=w.map((e,o)=>Math.round(e+(t[o]-e)*r));return"rgb(".concat(o.join(", "),")")}d.m_.positioners.cursorFloat=function(e,t){var r,o;return{x:null!=(r=null==t?void 0:t.x)?r:0,y:null!=(o=null==t?void 0:t.y)?o:0}},d.m_.positioners.mobileTopFloat=function(e,t){var r,o;let a=null==(r=this.chart)?void 0:r.chartArea;return!!a&&{x:null!=(o=null==t?void 0:t.x)?o:(a.left+a.right)/2,y:a.top-6,yAlign:"bottom"}};let M={...u.SQ,afterDraw:void 0,afterDatasetsDraw:function(e,t,r){e&&e.crosshair&&u.SQ.afterDraw.call(this,e,t,r)}},j=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}if("string"==typeof e){let t=x.c9.fromISO(e).toMillis();return Number.isFinite(t)?t:null}return null},A=e=>{if(!e)return null;let t=[];if(e.forEach(e=>{!e.growthSlopeGuide&&Array.isArray(e.data)&&e.data.forEach(e=>{let r=j(null==e?void 0:e.x);null!==r&&t.push(r)})}),t.length<2)return null;let r=Math.min(...t),o=Math.max(...t);return Number.isFinite(r)&&Number.isFinite(o)&&!(r>=o)?{min:r,max:o}:null},W=(e,t)=>{var r,o,a;if(e&&!e._destroyed&&(null==(r=e.canvas)?void 0:r.ownerDocument)&&e.ctx&&(null==(a=e.options)||null==(o=a.scales)?void 0:o.x)){t&&Number.isFinite(t.min)&&Number.isFinite(t.max)?(e.options.scales.x.min=t.min,e.options.scales.x.max=t.max):(delete e.options.scales.x.min,delete e.options.scales.x.max);try{e.update("none")}catch(e){}}},L="rgba(148, 163, 184, 0.05)",T=[],I=[],H=[],O=[],G=[],Y="#f97316",z=e=>{let t=(210+137.508*Math.max(0,e))%360;return"hsla(".concat(t.toFixed(1),", 72%, 45%, 0.7)")},K=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();if(!e.length||!Number.isFinite(t)||t<=0||!r.length)return null;let a=r.map(e=>j(e.x)).filter(e=>null!==e);if(!a.length)return null;let n=Math.min(...a),i=x.c9.fromMillis(o).endOf("day").toMillis(),l=e.map(e=>{let r=j(e.entryDate);return null===r||r<n||r>i||!Number.isFinite(e.entryPrice)||e.entryPrice<=0||!Number.isFinite(e.shares)||e.shares<=0?null:{x:e.entryDate,y:e.entryPrice*t,...e}}).filter(e=>null!==e).sort((e,t)=>
1j(e.x)-j(t.x));return l.length?{label:"Active purchases",data:l,borderColor:Y,backgroundColor:Y,pointBackgroundColor:Y,pointBorderColor:"#fff",pointBorderWidth:1.5,pointRadius:3.5,pointHoverRadius:5,pointHitRadius:8,showLine:!1,fill:!1,order:-100,activePurchaseMarkers:!0}:null},$=(e,t,r,o)=>{if(!Number.isFinite(r)||r<=0||!o.length)return[];let a=o.map(e=>({...e,millis:j(e.x)})).filter(e=>null!==e.millis&&Number.isFinite(e.y)).sort((e,t)=>e.millis-t.millis);if(!a.length)return[];let n=a[0].millis,i=a[a.length-1].millis,l=(e,t)=>{let r=j(e),o=j(t);return null!==r&&null!==o&&r<=o&&r>=n&&o<=i},d=e=>{let t=j(e);if(null===t||t<n||t>i)return null;let o=a.findIndex(e=>e.millis>=t);if(o<0)return null;let l=a[o],d=a[Math.max(0,o-1)];if(l.millis===t||l.millis===d.millis)return{marketcap:l.y,price:l.y/r};let s=(t-d.millis)/(l.millis-d.millis),c=d.y+(l.y-d.y)*s;return{marketcap:c,price:c/r}},s=e.flatMap((e,t)=>{if(!l(e.entryDate,e.exitDate)||!Number.isFinite(e.entryPrice)||e.entryPrice<=0||!Number.isFinite(e.exitPrice)||e.exitPrice<0||!Number.isFinite(e.shares)||e.shares<=0)return[];let o=z(t),a={...e,closedPositionKind:"equity"},n=[{x:e.entryDate,y:e.entryPrice*r,...a,phase:"open",price:e.entryPrice},{x:e.exitDate,y:e.exitPrice*r,...a,phase:"close",price:e.exitPrice}];return[{label:"Closed equity lot ".concat(t+1),data:n,borderColor:o,backgroundColor:o,pointBackgroun
1dColor:[o,"transparent"],pointBorderColor:["#fff","transparent"],pointBorderWidth:[.75,0],pointRadius:[2,0],pointHoverRadius:[3,0],pointHitRadius:[9,9],pointStyle:["circle","circle"],borderWidth:1,tension:0,fill:!1,order:-110,closedPositionLot:!0,closedPositionKind:"equity",closedPositionLotColor:o}]}),c=e.length;return[...s,...t.flatMap((e,t)=>{if(!l(e.boughtDate,e.soldDate)||!Number.isFinite(e.boughtPrice)||e.boughtPrice<0||!Number.isFinite(e.soldPrice)||e.soldPrice<0||!Number.isFinite(e.strike)||e.strike<=0||!Number.isFinite(e.contracts)||e.contracts<=0)return[];let r=d(e.boughtDate),o=d(e.soldDate);if(!r||!o)return[];let a=z(c+t),n={...e,closedPositionKind:"option"},i=[{x:e.boughtDate,y:r.marketcap,...n,phase:"open",price:e.boughtPrice,underlyingPrice:r.price},{x:e.soldDate,y:o.marketcap,...n,phase:"close",price:e.soldPrice,underlyingPrice:o.price}];return[{label:"Closed ".concat(e.optionType," $").concat(e.strike," lot ").concat(t+1),data:i,borderColor:a,backgroundColor:a,pointBackgroundColor:[a,"transparent"],pointBorderColor:["#fff","transparent"],pointBorderWidth:[.75,0],pointRadius:[2,0],pointHoverRadius:[3,0],pointHitRadius:[9,9],pointStyle:["circle","circle"],borderWidth:1,borderDash:[2.5,1.5],tension:0,fill:!1,order:-110,closedPositionLot:!0,closedPositionKind:"option",closedPositionLotColor:a}]})]},V={id:"closedPositionExitMarkers",beforeDatasetDraw(e,t){let r=e.data.datasets[t.index];if(!(null==r?void 0:r.closedPositionLot)||!e.isDatasetVisible(t.index))return;let o=e.getDatasetMeta(t.index).data,a=null==o?void 0:o[0],n=null==o?void 0:o[1];if(!a||!n)return;let i="function"==typeof a.getProps?a.getProps(["x","y"],!0):a,l="function"==typeof n.getProps?n.getProps(["x","y"],!0):n;if(!Number.isFinite(i.x)||!Number.isFinite(i.y)||!Number.isFinite(l.x)||!Number.isFinite(l.y))return;let d=Number(r.borderWidth)||1;e.ctx.save(),e.ctx.beginPath(),e.ctx.moveTo(i.x,i.y),e.ctx.lineTo(l.x,l.y),e.ctx.strokeStyle="rgba(255, 255, 255, 0.7)",e.ctx.lineWidth=d+2,e.ctx.lineCap="butt",e.ctx.setLineDash(Array.isArray(r.borderDash)?r.borderDash:[]),e.ctx.stroke(),e.ctx.restore()},afterDatasetsDraw(e){let t=e.chartArea;t&&e.data.datasets.forEach((r,o)=>{var a;if(!r.closedPositionLot||!e.isDatasetVisible(o))return;let n=null==(a=e.getDatasetMeta(o).data)?void 0:a[1];if(!n)return;let{x:i,y:l}="function"==typeof n.getProps?n.getProps(["x","y"],!0):n;if(!Number.isFinite(i)||!Number.isFinite(l)||i<t.left||i>t.right||l<t.top||l>t.bottom)return;let d="string"==typeof r.closedPositionLotColor?r.closedPositionLotColor:"#374151",s=(t,r)=>{e.ctx.beginPath(),e.ctx.moveTo(i-2.75,l-2.75),e.ctx.lineTo(i+2.75,l+2.75),e.ctx.moveTo(i+2.75,l-2.75),e.ctx.lineTo(i-2.75,l+2.75),e.ctx.strokeStyle=t,e.ctx.lineWidth=r,e.ctx.stroke()};e.ctx.save(),e.ctx.lineCap="round",s("rgba(255, 255, 255, 0.7)",2.5),s(d,1.125),e.ctx.restore()})}},J=[{symbol:"NVDA",marketCap:5e12,color:"#76b900"},{symbol:"META",marketCap:16e11,color:"#1877f2"},{symbol:"BRK.B",marketCap:1e12,color:"#8b5cf6"},{symbol:"MCD",marketCap:22e10,color:"#d71920"},{symbol:"HOOD",marketCap:9e10,color:"#00c805"},{symbol:"RDDT",marketCap:3e10,color:"#ff4500"},{symbol:"GME",marketCap:13e9,color:"#111827"},{symbol:"BYND",marketCap:2e8,color:"#6b7280"}],_=e=>!!(null==e?void 0:e.scaleReference),q=(e,t,r)=>Math.max(t,Math.min(r,e)),X=e=>{let{currencyRates:t,currencyCode:r,onChange:a}=e,[n,i]=(0,s.useState)(!1);return n?(0,o.jsx)("h5",{onClick:()=>{i(!1),a(!1)},children:"Currency Conversion is Disabled"}):(0,o.jsxs)("h5",{className:"conversion-rate",title:"Data may be reported in foreign currency instead of USD, chart uses this conversion rate to convert to USD. Click to disable conversion.",onClick:()=>{i(!0),a(!0)},children:["1 USD : ",t[r].toFixed(2).toLocaleString()," ",r]})},Z=(0,s.memo)(function(e){var t,r;let{symbol:a,yearsOfHistory:i,multiplier:d,isLogScale:u=!1,showNegatives:p=!1,chartType:g=m.N.Earnings,useQuarters:y,optionChainData:x,medianOptionsPerExpiry:C=!1,onNegativeValuesDetected:F,estimateType:w,showEstimateFan:R=!1,showValuationDeviation:U=!1,customEstimates:B,projectedStockPrices:j=O,earningsPredictions:L=G,highlightedEvent:Y,floorPrice:z,ceilingPrice:Z,activePositions:ee=T,closedEquityPositions:et=I,closedOptionPositions:eo=H,showScaleReferences:ea=!1,dateWindow:en,onDateBoundsChange:ei,compactTooltip:el=!1,growthSlopeGuide:ed,emaPeriods:es=S.h6,vectorEnabled:ec,onVectorEnabledChange:eu,vector:eb,onVectorChange:em}=e,ep=(0,s.useRef)(null),eg=(0,s.useRef)(null),eh=(0,s.useRef)(en),ef=(0,s.useRef)({}
1),[ey,ev]=(0,s.useState)(!1),ex=null!=ec?ec:ey,[eC,eD]=(0,s.useState)(null),ek=void 0===eb?eC:eb,eS=(0,s.useRef)(!1);eS.current=ex;let eE=(0,s.useRef)(ek);eE.current=ek;let eF=e=>{eE.current=e,eD(e),null==em||em(e)},eN=e=>{eS.current=e,ev(e),null==eu||eu(e)};(0,s.useEffect)(()=>{eF(null),eN(!1)},[a]),(0,s.useEffect)(()=>{let e=eg.current;if(e){if(ex){var t;e.setActiveElements([]),null==(t=e.tooltip)||t.setActiveElements([],{x:0,y:0})}e.draw()}},[ex]),(0,s.useEffect)(()=>{var e;null==(e=eg.current)||e.draw()},[ek]);let eP=(0,c.gz)(a),ew=(()=>{let{data:e,error:t,isLoading:r}=(0,h.A)("CURRENCY_RATES_FETCH",async()=>await fetch("/api/supabase/fetch-currency-rates").then(e=>e.json()));return(0,s.useMemo)(()=>t||r?[]:e,[e,t,r])})(),[eR,eU]=(0,s.useState)(!1),eB=eP.country&&((null==(t=f.A[eP.country])?void 0:t.currencyCode)||"USD"),eM=eB&&!eR&&1/ew[eB]||1,ej=Math.round(eP.mktCap/eP.price),eA=(0,c.VY)(a,null),eW=(0,s.useMemo)(()=>{var e;return e=null!=eA?eA:[],Object.fromEntries(S.Xs.map(t=>[t,(0,S.ms)(e,t)]))},[eA]),eL=Q(a,{yearsOfHistory:i,multiplier:d*eM,shareCount:ej,chartType:g,useQuarters:y,optionChainData:x,medianOptionsPerExpiry:C,onNegativeValuesDetected:F,estimateType:w,showEstimateFan:R,showValuationDeviation:U,customEstimates:B}),eT=(0,s.useMemo)(()=>{var e,t,r,o;if(!eL)return null;let a=eL.find(e=>"Marketcap"===e.label),n=((e,t)=>{var r,o;if(!t||!e.length)return[];let a=null==(r=e[0])?void 0:r.x,n=null==(o=v().last(e))?void 0:o.x;return a&&n?v().compact(J.map(e=>{let{symbol:t,marketCap:r,color:o}=e;return!Number.isFinite(r)||r<=0?null:{label:"".concat("Scale: ").concat(t),data:[{x:a,y:r},{x:n,y:r}],borderColor:"rgba(0, 0, 0, 0)",backgroundColor:"rgba(0, 0, 0, 0)",borderWidth:0,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,fill:!1,order:-20,scaleReference:!0,scaleReferenceSymbol:t,scaleReferenceColor:o}})):[]})(null!=(e=null==a?void 0:a.data)?e:[],ea),i=K(ee,ej,null!=(t=null==a?void 0:a.data)?t:[]),l=$(et,eo,ej,null!=(r=null==a?void 0:a.data)?r:[]),s=(0,D.C)(j,ej),c=g===m.N.Earnings?(0,P._f)(L,d,y,ej,Object.fromEntries((null!=B?B:[]).map(e=>[e.date,e.estimatedNetIncomeAvg]))):null,u=(0,k.H)(ed,ej,d*eM);return[...eL,...function(e,t,r,o){if(!Number.isFinite(r)||r<=0||!o.length)return[];let a=o.map(e=>e.x).sort();return S.Xs.filter(e=>t.includes(e)).flatMap(t=>{var o;let n=(null!=(o=e[t])?o:[]).filter(e=>e.date>=a[0]&&e.date<=a[a.length-1]).map(e=>({...e,x:e.date,y:e.ema*r}));if(!n.length)return[];let i=S.HR[t];return[{label:"EMA ".concat(t,"D"),emaPeriod:t,data:n,borderColor:i.color,backgroundColor:i.color,borderWidth:i.width,borderDash:i.dash,borderCapStyle:"round",borderJoinStyle:"round",pointRadius:0,pointHoverRadius:0,fill:!1,tension:0,order:-.5}]})}(eW,es,ej,null!=(o=null==a?void 0:a.data)?o:[]),...n,...i?[i]:[],...l,...s?[s]:[],...c?[c]:[],...u?[u]:[]]},[ee,eL,eW,es,et,eo,eM,ed,d,y,j,L,B,g,ej,ea]);(0,s.useEffect)(()=>{ef.current={}},[g]),(0,s.useEffect)(()=>{eh.current=en,W(eg.current,en)},[en]),(0,s.useEffect)(()=>{eT&&(null==ei||ei(A(eT)))},[eT,ei]),(0,s.useEffect)(()=>{if(!eT)return;let e=ep.current,t=l.Ay.getChart(e);t&&t.destroy();let r=e.getContext("2d"),o=er(ej,u,p,d,ef,Y,z,Z,ea,(e=>{if(!e)return null;let t=e.filter(e=>_(e)).flatMap(e=>{var t;return null!=(t=e.data)?t:[]}).map(e=>null==e?void 0:e.y).filter(e=>"number"==typeof e&&Number.isFinite(e));return t.length?Math.max(...t):null})(eT),el),a={id:"highlightedEventLine",afterDatasetsDraw(e){if(!(null==Y?void 0:Y.startDate))return;let t=e.scales.x,r=e.chartArea;if(!t||!r)return;let o=function(e,t){if(!(null==e?void 0:e.startDate))return null;let r="function"==typeof t.parse?t.parse(e.startDate):Date.parse(e.startDate);return"number"==typeof r&&Number.isFinite(r)?r:null}(Y,t);if(null===o)return;let a=t.getPixelForValue(o);if(!Number.isFinite(a))return;let{ctx:n}=e;n.save(),n.beginPath(),n.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),n.clip(),n.strokeStyle="#4679db",n.lineWidth=1,n.setLineDash([6,4]),n.beginPath(),n.moveTo(a,r.top),n.lineTo(a,r.bottom),n.stroke(),n.restore()}},n={id:"cursorPriceGuide",afterEvent(e,t){let r=e.chartArea,o=t.event;if(!r||!o)return;let a=Number.isFinite(o.x)&&Number.isFinite(o.y)&&o.x>=r.left&&o.x<=r.right&&o.y>=r.top&&o.y<=r.bottom&&["mousemove","touchmove","touchstart","click"].includes(o.type)?o.y:null;e.cursorPriceGuideY!==a&&(e.cursorPriceGuideY=a,t.changed=!0)}
1,afterDraw(e){let t=e.chartArea,r=e.scales.y,o=e.cursorPriceGuideY;if(!t||!r||!Number.isFinite(o))return;let a=r.getValueForPixel(o);if(!Number.isFinite(a))return;let n=((e,t,r)=>{if(!Number.isFinite(t)||t<=0)return((e,t)=>{var r,o,a;let n=null==e||null==(o=e.options)||null==(r=o.ticks)?void 0:r.callback;if("function"==typeof n){let r=n.call(e,t,-1,null!=(a=e.ticks)?a:[]);if(Array.isArray(r))return r.join(" ");if(null!=r)return String(r)}return"$".concat((0,b.Av)(t))})(r,e);let o=e/t,a=Math.abs(o),n=a>=1e3?0:a>=100||a>=1?2:4;return o.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n})})(a,ej,r),i=Math.max(t.top+8,Math.min(t.bottom-8,o)),{ctx:l}=e;l.save(),l.beginPath(),l.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),l.clip(),l.strokeStyle="rgba(107, 114, 128, 0.9)",l.lineWidth=1,l.lineCap="round",l.setLineDash([2,5]),l.beginPath(),l.moveTo(t.left,o),l.lineTo(t.right,o),l.stroke(),l.restore(),l.save(),l.font="500 10px -apple-system, BlinkMacSystemFont, sans-serif",l.textAlign="right",l.textBaseline="middle",l.lineJoin="round",l.strokeStyle="rgba(255, 255, 255, 0.96)",l.lineWidth=3,l.strokeText(n,t.right-4,i),l.fillStyle="rgba(55, 65, 81, 0.95)",l.fillText(n,t.right-4,i),l.restore()},afterDestroy(e){delete e.cursorPriceGuideY}},i=(0,N.X8)({isEnabled:()=>eS.current,getVector:()=>eE.current,onChange:eF,onExit:()=>eN(!1)}),s=new l.Ay(r,{type:"line",data:{datasets:eT},options:o,plugins:[M,a,n,{id:"scaleReferenceGuides",afterDatasetsDraw(e){let t=e.chartArea,r=e.scales.y;if(!t||!r)return;let o=e.data.datasets.map((t,o)=>{var a,n;if(!_(t)||!e.isDatasetVisible(o))return null;let i=null==(n=t.data)||null==(a=n[0])?void 0:a.y;if(!Number.isFinite(i))return null;let l=r.getPixelForValue(i);return Number.isFinite(l)?{y:l,color:t.scaleReferenceColor,text:"".concat(t.scaleReferenceSymbol," $").concat((0,b.Av)(i))}:null}).filter(Boolean).sort((e,t)=>e.y-t.y);if(!o.length)return;let{ctx:a}=e,n=t.right;a.save(),a.lineCap="round",o.forEach(e=>{let r=q(e.y,t.top+1,t.bottom-1);a.setLineDash([6,5]),a.lineWidth=2,a.strokeStyle="rgba(255, 255, 255, 0.6)",a.beginPath(),a.moveTo(t.left,r),a.lineTo(n,r),a.stroke(),a.lineWidth=1,a.strokeStyle="".concat(e.color,"66"),a.beginPath(),a.moveTo(t.left,r),a.lineTo(n,r),a.stroke()}),a.restore();let i=t.top+8,l=t.bottom-8,d=o.map(e=>({...e,labelY:q(e.y,i,l)}));for(let e=1;e<d.length;e+=1)d[e].labelY=Math.max(d[e].labelY,d[e-1].labelY+16+2);for(let e=d.length-1;e>=0;e-=1){let t=d[e+1];d[e].labelY=t?Math.min(d[e].labelY,t.labelY-16-2):Math.min(d[e].labelY,l)}a.save(),a.font="600 10px -apple-system, BlinkMacSystemFont, sans-serif",a.textBaseline="middle",a.textAlign="left",d.forEach(e=>{let r=q(e.labelY,i,l),o=q(e.y,t.top+1,t.bottom-1),d=a.measureText(e.text).width,s=t.right+20,c=t.right+34,u=(e,t,i)=>{a.beginPath(),a.moveTo(n,o),a.lineTo(s,r),a.lineTo(c-5,r),a.strokeStyle=e,a.lineWidth=t,a.setLineDash(i),a.stroke()};u("rgba(255, 255, 255, 0.92)",4,[]),u("".concat(e.color,"66"),1,[4,3]),a.setLineDash([]),a.fillStyle="rgba(255, 255, 255, 0.88)",a.fillRect(c-4,r-8,d+8,16),a.fillStyle=e.color,a.fillText(e.text,c,r)}),a.restore()}},V,E,i]});return eT.forEach((e,t)=>{e.label&&Object.prototype.hasOwnProperty.call(ef.current,e.label)&&(s.getDatasetMeta(t).hidden=ef.current[e.label])}),Object.keys(ef.current).length>0&&s.update(),eg.current=s,W(s,eh.current),()=>{s&&(eg.current===s&&(eg.current=null),s.destroy())}},[a,eT,u,p,ej,d,Y,z,Z,ea,el]);let eI=ek?(0,N.ys)(ek):null,eH=null==eT?void 0:eT.find(e=>"Marketcap"===e.label),eO=null!=(r=null==eH?void 0:eH.valuationDeviationSampleCount)?r:0;return(0,o.jsxs)(o.Fragment,{children:[!eT&&(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"Loading..."}),(0,o.jsxs)("div",{className:"jsx-62d75ecc9fbb9e82 chart-metadata",children:[(0,o.jsxs)("div",{className:"jsx-62d75ecc9fbb9e82 chart-controls",children:[void 0===ec&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button","aria-pressed":ek?void 0:ex,disabled:!eT,onClick:()=>{if(ek){var e;eF(null),eN(!1),null==(e=eg.current)||e.draw()}else eN(!ex)},className:"jsx-62d75ecc9fbb9e82 vector-button",children:ek?"Clear vector":"↗ Draw vector"}),(0,o.jsx)("span",{role:ek?"status":void 0,className:"jsx-62d75ecc9fbb9e82 vector-help",children:ek&&eI?(0,o.jsxs)(o.Fragment,{children:["CAGR: ",(0,o.jsx)("strong",{className:"jsx-62d75ecc9fbb9e82",children:(0,N.Ci)(ek)}
1)," \xb7 ".concat(eI.days.toLocaleString("en-US",{maximumFractionDigits:1})," days"),ex?" \xb7 Drag either endpoint to adjust. Esc exits; Delete clears.":" \xb7 Clear to draw another."]}):ex?"Drag to draw. Drag either endpoint to adjust. Esc cancels; Delete clears.":"Draw on the chart to measure CAGR (%/year)."})]}),ew[eB]&&"USD"!==eB?(0,o.jsx)(X,{currencyRates:ew,currencyCode:eB,onChange:e=>{eU(e)}}):(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82"})]}),(0,o.jsx)("div",{className:"jsx-62d75ecc9fbb9e82 watermark",children:"theory-a.com"})]}),U&&(0,o.jsxs)("div",{role:"note",className:"jsx-62d75ecc9fbb9e82 deviation-key",children:[(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"Below selected valuation"}),(0,o.jsxs)("span",{className:"jsx-62d75ecc9fbb9e82 deviation-scale",children:[(0,o.jsx)("span",{"aria-hidden":"true",className:"jsx-62d75ecc9fbb9e82 deviation-gradient"}),(0,o.jsxs)("span",{className:"jsx-62d75ecc9fbb9e82 deviation-ticks",children:[(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"−2σ"}),(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"0"}),(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"+2σ"})]})]}),(0,o.jsx)("span",{className:"jsx-62d75ecc9fbb9e82",children:"Above selected valuation"}),(0,o.jsxs)("span",{className:"jsx-62d75ecc9fbb9e82 deviation-explanation",children:["Monthly historical gap spread",eO<12&&" \xb7 Need 12 months of positive valuation history",eO>=12&&(null==eH?void 0:eH.valuationDeviationStandardDeviation)==null&&" \xb7 No measurable historical variation"]})]}),(0,o.jsx)("div",{className:"jsx-62d75ecc9fbb9e82 chart-canvas",children:(0,o.jsx)("canvas",{ref:ep,tabIndex:ex?0:void 0,"aria-label":"".concat(a," analysis chart").concat(ex?". Drag to draw a vector or move its endpoints. Escape cancels; Delete clears.":""),className:"jsx-62d75ecc9fbb9e82"})}),(0,o.jsx)(n(),{id:"62d75ecc9fbb9e82",children:'.chart-canvas.jsx-62d75ecc9fbb9e82{position:relative;flex:1 1 0;min-width:0;min-height:0}.chart-metadata.jsx-62d75ecc9fbb9e82{display:flex;justify-content:space-between;align-items:center}.chart-controls.jsx-62d75ecc9fbb9e82{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.vector-button.jsx-62d75ecc9fbb9e82{padding:5px 9px;border:1px solid#d8e0ec;border-radius:6px;background:#fff;color:#536985;font-size:12px;cursor:pointer}.vector-button[aria-pressed="true"].jsx-62d75ecc9fbb9e82{color:#6d28d9;background:#f5f3ff;border-color:#c4b5fd}.vector-button.jsx-62d75ecc9fbb9e82:focus-visible{outline:2px solid#7c3aed;outline-offset:2px}.vector-button.jsx-62d75ecc9fbb9e82:disabled{opacity:.5;cursor:default}.vector-help.jsx-62d75ecc9fbb9e82{color:#64748b;font-size:11px}.vector-help.jsx-62d75ecc9fbb9e82 strong.jsx-62d75ecc9fbb9e82{color:#6d28d9;font-variant-numeric:tabular-nums}.deviation-key.jsx-62d75ecc9fbb9e82{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:5px 0;color:#64748b;font-size:11px}.deviation-scale.jsx-62d75ecc9fbb9e82{display:grid;gap:2px;width:130px}.deviation-gradient.jsx-62d75ecc9fbb9e82{width:130px;height:7px;border-radius:10px;background:linear-gradient(90deg,#16a34a,#344054 50%,#dc2626)}.deviation-ticks.jsx-62d75ecc9fbb9e82{display:flex;justify-content:space-between;font-variant-numeric:tabular-nums}.deviation-explanation.jsx-62d75ecc9fbb9e82{margin-left:4px}.watermark.jsx-62d75ecc9fbb9e82{color:lightgrey;text-align:right;position:relative;top:8px;left:-6px}'})]})}),Q=(e,t)=>{let{chartType:r,optionChainData:o,medianOptionsPerExpiry:a,multiplier:n,shareCount:l,useQuarters:d,yearsOfHistory:u,showEstimateFan:b,showValuationDeviation:p}=t,g=((e,t)=>{let{yearsOfHistory:r,multiplier:o,shareCount:a,useQuarters:n,chartType:i,onNegativeValuesDetected:l,estimateType:d,showEstimateFan:u}=t,{historicalData:b}=(0,c.L)(e,r,n),p=b?v().last(b).date:null,g=(0,c.VY)(e,p),h=(0,c.FE)(e,n),f=t.customEstimates||h,y=(0,s.useMemo)(()=>null==f?void 0:f.slice().reverse(),[f]),x=(0,s.useMemo)(()=>{if(!g||!a)return null;let e=g.map(e=>({x:e.date,y:e.close*a})).reverse();if(!b)return{formattedMarketcap:e};let t=b.map(e=>({x:e.date,y:e.netIncomePerShare*a*o}
1)).reverse(),r=b.map(e=>({x:e.date,y:e.revenuePerShare*a*o})).reverse(),n=b.map(e=>({x:e.date,y:e.bookValuePerShare*a*o})).reverse(),l=b.map(e=>({x:e.date,y:e.operatingCashFlowPerShare*a*o})).reverse(),s=b.map(e=>({x:e.date,y:e.freeCashFlowPerShare*a*o})).reverse(),c=u?"average":d||"average",p=(e,t)=>(null==y?void 0:y.length)&&e?[e,...y.map(e=>({x:e.date,y:t(e)}))]:[],h=p(v().last(t),e=>ea(e,c,"estimatedNetIncome")*o),f=p(v().last(t),e=>ea(e,"low","estimatedNetIncome")*o),x=p(v().last(t),e=>ea(e,"high","estimatedNetIncome")*o),C=b.map(e=>({x:e.date,y:e.netIncomePerShare*e.payoutRatio*a*o})).reverse(),D=v().take(b,8).map(e=>e.payoutRatio).filter(e=>e>0&&e<1),k=D.length>0?v().mean(D):0,S=(null==y?void 0:y.length)?[v().last(C),...y.map(e=>({x:e.date,y:ea(e,c,"estimatedEps")*k*a*o}))]:[],E=C.some(e=>e.y>0),F=b.map(e=>({x:e.date,y:e.netIncomePerShare*(1+e.payoutRatio)*a*o})).reverse(),N=(null==y?void 0:y.length)?[v().last(F),...y.map(e=>({x:e.date,y:ea(e,c,"estimatedNetIncome")*(1+k)*o}))]:[],P=p(v().last(F),e=>ea(e,"low","estimatedNetIncome")*(1+k)*o),w=p(v().last(F),e=>ea(e,"high","estimatedNetIncome")*(1+k)*o),R=p(v().last(r),e=>ea(e,c,"estimatedRevenue")*o),U=p(v().last(r),e=>ea(e,"low","estimatedRevenue")*o),B=p(v().last(r),e=>ea(e,"high","estimatedRevenue")*o),M=e=>p(v().last(l),t=>(ea(t,e,"estimatedEbitda")-(ea(t,e,"estimatedSgaExpense")||0))*o),j=M(c),A=M("low"),W=M("high"),L=(()=>{switch(i){case m.N.Earnings:return(null==t?void 0:t.some(e=>e.y<0))||(null==h?void 0:h.some(e=>e.y<0))||u&&(null==f?void 0:f.some(e=>e.y<0));case m.N.Sales:return(null==r?void 0:r.some(e=>e.y<0))||(null==R?void 0:R.some(e=>e.y<0))||u&&(null==U?void 0:U.some(e=>e.y<0));case m.N.BookValue:return null==n?void 0:n.some(e=>e.y<0);case m.N.CashFlow:return(null==l?void 0:l.some(e=>e.y<0))||(null==s?void 0:s.some(e=>e.y<0))||(null==j?void 0:j.some(e=>e.y<0))||u&&(null==A?void 0:A.some(e=>e.y<0));default:return!1}})();return{formattedEarnings:t,formattedEstimatedEarnings:h,formattedEstimatedEarningsLow:f,formattedEstimatedEarningsHigh:x,formattedMarketcap:e,formattedDividends:C,formattedDividendsEstimate:S,hasDividends:E,combinedEarningsAndDividends:F,combinedEarningsAndDividendsEstimate:N,combinedEarningsAndDividendsEstimateLow:P,combinedEarningsAndDividendsEstimateHigh:w,formattedSales:r,formattedBookValue:n,formattedFreeCashFlow:s,formattedOperatingCashFlow:l,estimatedPayoutRatio:k,formattedEstimatedSales:R,formattedEstimatedSalesLow:U,formattedEstimatedSalesHigh:B,formattedEstimatedOCF:j,formattedEstimatedOCFLow:A,formattedEstimatedOCFHigh:W,hasNegatives:L}},[b,o,g,a,y,i,d,u]);return(0,s.useEffect)(()=>{(null==x?void 0:x.hasNegatives)!==void 0&&l(x.hasNegatives)},[null==x?void 0:x.hasNegatives,l]),x})(e,t),{data:h}=(0,c.C0)(e);return(0,s.useMemo)(()=>{var e,t,s;if(!g)return null;let{formattedEarnings:c,formattedEstimatedEarnings:f,formattedEstimatedEarningsLow:y,formattedEstimatedEarningsHigh:D,formattedMarketcap:k,formattedDividends:S,formattedDividendsEstimate:E,hasDividends:N,combinedEarningsAndDividends:P,combinedEarningsAndDividendsEstimate:w,combinedEarningsAndDividendsEstimateLow:R,combinedEarningsAndDividendsEstimateHigh:U,formattedSales:M,formattedBookValue:j,formattedFreeCashFlow:A,formattedOperatingCashFlow:W,estimatedPayoutRatio:T,formattedEstimatedSales:I,formattedEstimatedSalesLow:H,formattedEstimatedSalesHigh:O,formattedEstimatedOCF:G,formattedEstimatedOCFLow:Y,formattedEstimatedOCFHigh:z}=g,K=r===m.N.Earnings?c:r===m.N.Sales?M:r===m.N.CashFlow?W:j,$=p?function(e,t){let r=t.filter(e=>Number.isFinite(Date.parse(e.x))&&Number.isFinite(e.y)).slice().sort((e,t)=>Date.parse(e.x)-Date.parse(t.x)),o=e.slice().sort((e,t)=>Date.parse(e.x)-Date.parse(t.x)),a=new Map,n=[],i=0,l=null,d=o.map(e=>{let t=Date.parse(e.x);for(;i<r.length&&Date.parse(r[i].x)<=t;)l=r[i].y>0?r[i].y:null,i++;let o=Number.isFinite(t)&&Number.isFinite(e.y)&&e.y>0&&null!==l?e.y/l:null,d=null!==o&&Number.isFinite(o)&&o>0,s=d?Math.log(o):null,c=null!==s&&Number.isFinite(s)?s:null;return n.push(c),null!==c&&Number.isFinite(c)&&a.set(e.x.slice(0,7),c),{...e,valuationBaseline:d?l:null,valuationGapPercent:d?(o-1)*100:null,deviationSigma:null}}),s=Array.from(a.values()),c=s.length?s.reduce((e,t)=>
1e+t,0)/s.length:0,u=s.length>1?s.reduce((e,t)=>e+(t-c)**2,0)/(s.length-1):0,b=s.length>=12&&u>1e-12?Math.sqrt(u):null;return{points:d.map((e,t)=>({...e,deviationSigma:null!==b&&null!==n[t]?n[t]/b:null})),standardDeviation:b,sampleCount:s.length}}(k,null!=K?K:[]):null,V=null==c?void 0:c.every(e=>e.y<0),J=null==M?void 0:M.every(e=>e.y<0),_=null==j?void 0:j.every(e=>e.y<0),q=null==A?void 0:A.every(e=>e.y<0),X=null==W?void 0:W.every(e=>e.y<0),Z=null==f?void 0:f.every(e=>e.y<0),Q=e=>{let{label:t,lowData:r,highData:o,borderColor:a,backgroundColor:n,order:i}=e;return b?[{label:"".concat(t," Low"),data:r,borderColor:a,borderWidth:1,borderDash:[3,4],pointRadius:0,fill:!1,estimateFanBoundary:!0,order:i},{label:"".concat(t," Range"),data:o,borderColor:a,backgroundColor:n,borderWidth:1,borderDash:[3,4],pointRadius:0,fill:"-1",estimateFanBoundary:!0,estimateFanLegend:!0,order:i}]:[]},ee=[{label:"Dividends",data:N&&S,borderColor:"#eee",borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:"#eee",order:1},{label:"Marketcap",data:null!=(e=null==$?void 0:$.points)?e:k,borderColor:$?B(null):"#344054",backgroundColor:"#344054",fill:!1,pointRadius:0,pointHoverRadius:2,borderWidth:$?2.4:1.1,segment:$?{borderColor:e=>{let t=e.p0.raw.deviationSigma,r=e.p1.raw.deviationSigma;return B(null!==t&&null!==r?(t+r)/2:null!=r?r:t)}}:void 0,valuationDeviation:!!$,valuationDeviationSampleCount:null!=(t=null==$?void 0:$.sampleCount)?t:0,valuationDeviationStandardDeviation:null!=(s=null==$?void 0:$.standardDeviation)?s:null,tension:0,borderDash:[],order:0}],et=Q({label:"Estimated Earnings",lowData:y,highData:D,borderColor:Z?i.U.red.border:i.U.green.border,backgroundColor:L,order:5}),er=T<1?Q({label:"Estimated Earnings & Dividends",lowData:R,highData:U,borderColor:i.U.blue.border,backgroundColor:L,order:6}):[],eo=v().compact([...er,T<1&&{label:"Estimated Earnings & Dividends",data:w,borderColor:i.U.blue.border,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroun
1dColor:"#fff",pointBorderColor:i.U.blue.border,backgroundColor:i.U.blue.lightBackground,borderDash:[5,5],fill:!0,order:6},...et,{label:"Estimated Earnings",data:f,borderColor:Z?i.U.red.border:i.U.green.border,backgroundColor:Z?i.U.red.lightBackground:i.U.green.lightBackground,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:Z?i.U.red.border:i.U.green.border,borderDash:[5,5],fill:!0,order:5},T<1&&{label:"Dividends Estimate",data:N&&E,borderColor:"#eee",borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:"#eee",borderDash:[5,5],order:4},{label:"Earnings + Dividends",data:P,borderColor:i.U.blue.border,borderWidth:1,pointRadius:0,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:i.U.blue.border,backgroundColor:i.U.blue.background,fill:!0,order:3},{label:"Earnings",data:c,borderColor:V?i.U.red.border:i.U.green.border,backgroundColor:V?i.U.red.background:i.U.green.background,borderWidth:1,pointRadius:0,pointBorderWidth:1,pointBackgroun
1dColor:"#fff",pointBorderColor:V?i.U.red.border:i.U.green.border,fill:!0,order:2}]),ea=[...Q({label:"Estimated Sales",lowData:H,highData:O,borderColor:J?i.U.red.border:i.U.green.border,backgroundColor:L,order:3}),{label:"Estimated Sales",data:I,borderColor:J?i.U.red.border:i.U.green.border,backgroundColor:J?i.U.red.lightBackground:i.U.green.lightBackground,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:J?i.U.red.border:i.U.green.border,borderDash:[5,5],fill:!0,order:3},{label:"Sales",data:M,borderColor:J?i.U.red.border:i.U.green.border,backgroundColor:J?i.U.red.background:i.U.green.background,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:J?i.U.red.border:i.U.green.border,fill:!0,order:2}],en=[...Q({label:"Est. Operating Cash Flow",lowData:Y,highData:z,borderColor:X?i.U.red.border:i.U.blue.border,backgroundColor:L,order:4}),{label:"Est. Operating Cash Flow",data:G,borderColor:X?i.U.red.border:i.U.blue.border,backgroundColor:i.U.blue.lightBackgroun
1d,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:X?i.U.red.border:i.U.blue.border,borderDash:[5,5],fill:!0,order:4},{label:"Operating Cash Flow",data:W,borderColor:X?i.U.red.border:i.U.blue.border,backgroundColor:X?i.U.red.background:i.U.blue.background,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:X?i.U.red.border:i.U.blue.border,fill:!0,order:3},{label:"Free Cash Flow",data:A,borderColor:q?i.U.red.border:i.U.green.border,backgroundColor:q?i.U.red.background:i.U.green.background,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:q?i.U.red.border:i.U.green.border,fill:!0,order:2}],ei=[{label:"Book Value",data:j,borderColor:_?i.U.red.border:i.U.green.border,backgroundColor:_?i.U.red.background:i.U.green.background,borderWidth:1,pointRadius:2,pointBorderWidth:1,pointBackgroundColor:"#fff",pointBorderColor:_?i.U.red.border:i.U.green.border,fill:!0,order:2}];if(r===m.N.Earnings?ee.unshift(...eo):r===m.N.Sales?ee.unshift(...ea):r===m.N.CashFlow?ee.unshift(...en):r===m.N.BookValue&&ee.unshift(...ei),null==o?void 0:o.length){let e=Math.max(1,C.jkA(o,e=>{var t;return(null==(t=e.day)?void 0:t.volume)||1})||1),t=Math.max(1,C.T9B(o,e=>{var t;return(null==(t=e.day)?void 0:t.volume)||1})||1),r=t>e?C.ZEH().domain([e,t]).range([.3,.9]).clamp(!0):()=>.6;(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[];for(let t of null!=e?e:[]){var o;if(!(null==t?void 0:t.details))continue;let{contract_type:e,expiration_date:a,strike_price:n}=t.details;if("call"!==e&&"put"!==e||!Number.isFinite(Date.parse(a))||!Number.isFinite(n)||!Number.isFinite(t.fmv))continue;let i=null==(o=t.day)?void 0:o.volume;r.push({type:e,expiry:a,breakeven:"call"===e?n+t.fmv:n-t.fmv,volume:Number.isFinite(i)&&i>0?i:0})}if(!t)return r;let a=new Map;for(let e of r){let t="".concat(e.expiry,":").concat(e.type),r=a.get(t);r?r.push(e):a.set(t,[e])}return Array.from(a.values(),e=>({type:e[0].type,expiry:e[0].expiry,breakeven:F(e.map(e=>e.breakeven)),volume:F(e.map(e=>e.volume))}))})(o,a).forEach(e=>{let t="call"===e.type,o=e.volume,a=o<=0?.15:r(o);ee.push({label:t?"Call Options":"Put Options",data:[{x:e.expiry,y:e.breakeven*l}],backgroundColor:t?"rgba(68, 113, 68, ".concat(a,")"):"rgba(158, 68, 68, ".concat(a,")"),pointRadius:2.8,pointStyle:"triangle",rotation:180*!t,showLine:!1,order:1})})}if((null==h?void 0:h.length)&&r===m.N.Earnings&&d){let e=Math.min(10,u||10),t=x.c9.now().minus({years:e}).toJSDate(),r=h.filter(e=>new Date(e.fiscalDateEnding)>=t&&(null!==e.eps||null!==e.epsEstimated)).flatMap(e=>{let t=[];if(null!==e.epsEstimated&&t.push({label:"Estimated Earnings",data:[{x:e.fiscalDateEnding,y:e.epsEstimated*l*n}],borderColor:"coral",pointRadius:4,pointStyle:"cross",showLine:!1,order:-1,z:100}),null!==e.eps&&null!==e.epsEstimated){let r=e.eps>e.epsEstimated;t.push({label:"Reported Earnings",data:[{x:e.fiscalDateEnding,y:e.eps*l*n}],backgroundColor:r?"aqua":"crimson",pointRadius:4,pointStyle:"triangle",rotation:180*!r,showLine:!1,order:-2,z:101})}return t});ee.push(...r)}if((null==h?void 0:h.length)&&r===m.N.Sales&&d){let e=Math.min(10,u||10),t=x.c9.now().minus({years:e}).toJSDate(),r=h.filter(e=>new Date(e.fiscalDateEnding)>=t&&(null!==e.revenue||null!==e.revenueEstimated)).flatMap(e=>{let t=[];if(null!==e.revenueEstimated&&t.push({label:"Estimated Revenue",data:[{x:e.fiscalDateEnding,y:e.revenueEstimated*n}],borderColor:"coral",pointRadius:4,pointStyle:"cross",showLine:!1,order:-1,z:100}),null!==e.revenue&&null!==e.revenueEstimated){let r=e.revenue>e.revenueEstimated;t.push({label:"Reported Revenue",data:[{x:e.fiscalDateEnding,y:e.revenue*n}],backgroundColor:r?"aqua":"crimson",pointRadius:4,pointStyle:"triangle",rotation:180*!r,showLine:!1,order:-2,z:101})}return t});ee.push(...r)}return ee},[g,r,o,a,n,l,d,u,h,b,p])},ee=e=>{var t,r;return!["Call Options","Put Options"].includes(null==(t=e.dataset)?void 0:t.label)&&!_(e.dataset)&&!(null==(r=e.dataset)?void 0:r.growthSlopeGuide)},et=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!ee(e)&&(!o||t===r.findIndex(ee))},er=function(e){var t,r,o;let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,u=arguments.length>8?arguments[8]:void 0,b=arguments.length>9?arguments[9]:void 0,m=arguments.length>10?arguments[10]:void 0,p=eo(e,a,n,i,d,s,c,u,b,m),g=null==(r=p.plugins)||null==(t=r.legend)?void 0:t.onClick;return{...p,plugins:{...p.plugins,legend:{...null==(o=p.plugins)?void 0:o.legend,onClick:function(e,t,r){let o=r.chart,a=t.datasetIndex,n=o.data.datasets[a];if(g)g.call(this,e,t,r);else{let e=o.getDatasetMeta(a);e.hidden=null===e.hidden?!o.data.datasets[a].hidden:null}if(null==n?void 0:n.label){let e=o.getDatasetMeta(a);l.current[n.label]=!0===e.hidden}o.update()}}}}},eo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0,s=arguments.length>9&&void 0!==arguments[9]&&arguments[9],c=((e,t,r)=>{let o={};return!Number.isFinite(e)||e<=0||("number"==typeof t&&Number.isFinite(t)&&(o.watchlistFloor={type:"line",yMin:t*e,yMax:t*e,borderColor:"rgba(34, 139, 34, 0.6)",borderWidth:1,borderDash:[5,4],label:{display:!0,content:"Floor $".concat(t),position:"start",backgroundColor:"rgba(34, 139, 34, 0.8)",color:"#fff",font:{size:9,weight:"bold"},padding:{top:1,bottom:1,left:4,right:4},yAdjust:10}}),"number"==typeof r&&Number.isFinite(r)&&(o.watchlistCeiling={type:"line",yMin:r*e,yMax:r*e,borderColor:"rgba(217, 48, 37, 0.6)",borderWidth:1,borderDash:[5,4],label:{display:!0,content:"Ceiling $".concat(r),position:"start",backgroundColor:"rgba(217, 48, 37, 0.8)",color:"#fff",font:{size:9,weight:"bold"},padding:{top:1,bottom:1,left:4,right:4},yAdjust:-10}})),o})(e,n,i);return{responsive:!0,maintainAspectRatio:!1,animation:!1,layout:{padding:{top:44*!!s,right:132*!!l,bottom:20}},scales:{x:{display:!0,type:"time",grid:{color:"#E9EDF2",lineWidth:1},border:{color:"#E9EDF2",width:1}},y:{display:!0,min:r?void 0:0,suggestedMax:l&&d?1.08*d:void 0,type:t?"logarithmic":"linear",grid:{color:"#E9EDF2",lineWidth:1},border:{color:"#E9EDF2",width:1},ticks:{callback:function(e){return"$"+(0,b.Av)(e)}}}},interaction:{mode:"nearest",axis:s?"xy":"x",intersect:!1},plugins:{filler:{drawTime:"beforeDatasetsDraw"},legend:{position:"bottom",align:"start",labels:{boxWidth:20,filter:(e,t)=>{let r=t.datasets[e.datasetIndex];return!(["Call Options","Put Options","Earnings Calendar","Reported Earnings","Estimated Revenue","Reported Revenue"].includes(e.text)||_(r))&&(null==r||!r.growthSlopeGuide)&&(null==r||!r.emaPeriod)&&
1(null==r||!r.closedPositionLot)&&(null==r||!r.estimateFanBoundary||!!(null==r?void 0:r.estimateFanLegend))&&("Estimated Earnings"!==e.text||(null==r?void 0:r.showLine)!==!1)&&!0}}},tooltip:{mode:"nearest",axis:s?"xy":"x",intersect:!1,position:s?"mobileTopFloat":"cursorFloat",yAlign:s?"bottom":void 0,caretSize:0,caretPadding:12*!s,backgroundColor:"rgba(17, 24, 39, 0.92)",borderColor:"rgba(148, 163, 184, 0.25)",borderWidth:1,cornerRadius:s?3:6,padding:s?{top:2,right:3,bottom:2,left:3}:{top:8,right:10,bottom:8,left:10},titleColor:"#9ca3af",titleFont:{size:s?8:10,lineHeight:s?1:1.2,weight:"500"},titleMarginBottom:s?1:6,bodyColor:"#f9fafb",bodyFont:{size:s?8:11,lineHeight:s?1:1.2,weight:"500"},bodySpacing:4*!s,displayColors:!0,boxWidth:8,boxHeight:8,boxPadding:4,filter:(e,t,r)=>{var o;return!(null==(o=e.dataset)?void 0:o.estimateFanBoundary)&&et(e,t,r,s)},callbacks:{labelColor:e=>{let t=e.dataset.emaPeriod,r=t?S.HR[t].color:e.dataset.borderColor;return{borderColor:r,backgroundColor:r,borderWidth:0}},label:t=>{if(t.dataset.emaPeriod)return function(e,t){let r=t.ema.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),o=(t.price/t.ema-1)*100,a=new Intl.DateTimeFormat("en-CA",{timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date),n=t.date===a?" \xb7 provisional":"";return"EMA ".concat(e,"D: ").concat(r," \xb7 price ").concat(o>=0?"+":"").concat(o.toFixed(1),"%").concat(n)}(t.dataset.emaPeriod,t.raw);if("Call Options"===t.dataset.label||"Put Options"===t.dataset.label||_(t.dataset))return null;if(t.dataset.activePurchaseMarkers){let e=t.raw,r=e.shares.toLocaleString("en-US",{maximumFractionDigits:6}),o=e.entryPrice.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});return s?["Purchased ".concat(r," shares"),"at ".concat(o)]:"Purchased ".concat(r," shares at ").concat(o)}if(t.dataset.closedPositionLot){let e=t.raw,r="open"===e.phase?"Opened":"Closed",o=e.price.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});if("equity"===e.closedPositionKind){let t=e.shares.toLocaleString("en-US",{maximumFractionDigits:6});return s?["".concat(r," ").concat(t," shares"),"at ".concat(o)]:"".concat(r," ").concat(t," shares at ").concat(o)}let a=e.contracts.toLocaleString("en-US"),n="".concat(e.orderType," ").concat(e.optionType," $").concat(e.strike),i=e.underlyingPrice.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});return s?["".concat(r," ").concat(a," ").concat(n),"".concat(o," premium \xb7 stock at ").concat(i)]:"".concat(r," ").concat(a," ").concat(n," at ").concat(o," premium (stock at ").concat(i,")")}if(t.dataset.predictedEarningsMarkers){let r=t.raw,o=t.dataset.annualizedEarnings?"Annualized predicted earnings":"Predicted earnings";return["".concat(o,": $").concat((0,b.Av)(r.earnings)),...e>0?["Implied price: $".concat((r.y/e).toFixed(2))]:[]]}if(t.dataset.projectedStockPriceMarkers){let e=t.raw.price.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});return s?["Price estimate:",e]:"Price estimate: ".concat(e)}if("Marketcap"===t.dataset.label){let r=t.parsed.y,a=r/e;if(t.dataset.valuationDeviation){let e=t.raw,o=["Mkt cap: $".concat((0,b.Av)(r)),"Price: $".concat(v().round(a,2))];return null!==e.valuationBaseline?(o.push("Selected valuation: $".concat((0,b.Av)(e.valuationBaseline))),o.push("Gap: ".concat(e.valuationGapPercent.toFixed(1),"%")),o.push(null!==e.deviationSigma?"Distance from valuation: ".concat(e.deviationSigma.toFixed(2),"σ"):"Deviation scale unavailable for this history")):o.push("Valuation unavailable before the first positive metric"),o}let n=t.chart.data.datasets.find(e=>"Earnings"===e.label||"Sales"===e.label);if(n&&n.data.length>0){let e,i=(e=t.parsed.x,n.data.reduce((t,r)=>Math.abs(x.c9.fromISO(r.x).toMillis()-e)<Math.abs(x.c9.fromISO(t.x).toMillis()-e)?r:t)),l="",d="";if(i&&0!==i.y){let e=r/(i.y/o);"Earnings"===n.label?(l=" (P/E: ".concat(e.toFixed(2),")"),d="P/E: ".concat(e.toFixed(2))):"Sales"===n.label&&(l=" (P/S: ".concat(e.toFixed(2),")"),d="P/S: ".concat(e.toFixed(2)))}
1return s?["Mkt cap: $".concat((0,b.Av)(r)),"Price: $".concat(v().round(a,2)),...d?[d]:[]]:"Marketcap: $".concat((0,b.Av)(r)," (Price: $").concat(v().round(a,2),")").concat(l)}}if(["Earnings","Estimated Earnings","Earnings + Dividends","Dividends Estimate","Estimated Earnings & Dividends","Estimated Sales","Operating Cash Flow","Est. Operating Cash Flow","Free Cash Flow"].includes(t.dataset.label)){let e=t.parsed.y/o;return s?["".concat(t.dataset.label,":"),"$".concat((0,b.Av)(e))]:"".concat(t.dataset.label,": $").concat((0,b.Av)(e))}return s?["".concat(t.dataset.label,":"),"$".concat((0,b.Av)(t.parsed.y))]:"".concat(t.dataset.label,": $").concat((0,b.Av)(t.parsed.y))}}},crosshair:{color:"#B8C2CF",width:1,zoom:{enabled:!1}},annotation:{annotations:{...function(e){if(!e)return g;let t=!e.endDate||e.endDate<e.startDate?e.startDate:e.endDate,r=t>e.startDate;return{...g,highlightedEventWindow:{adjustScaleRange:!1,type:"box",xMin:e.startDate,xMax:t,yMin:0,backgroundColor:"rgba(70, 121, 219, 0.12)",borderColor:"rgba(70, 121, 219, 0.32)",borderWidth:+!!r,label:p}}}(a),...c}}}}},ea=(e,t,r)=>e["".concat(r).concat("low"===t?"Low":"high"===t?"High":"Avg")]},23411:(e,t,r)=>{r.d(t,{H:()=>o});let o=(e,t,r)=>{if(!e||!Number.isFinite(t)||t<=0||!Number.isFinite(r)||r<=0||!e.start.date||!e.end.date||!Number.isFinite(Date.parse(e.start.date))||!Number.isFinite(Date.parse(e.end.date))||!Number.isFinite(e.start.value)||!Number.isFinite(e.end.value))return null;let o="number"==typeof e.periodDivisor&&Number.isFinite(e.periodDivisor)&&e.periodDivisor>0?e.periodDivisor:1,a="forward"===e.range?"#7c3aed":"#f59e0b";return{label:"".concat("forward"===e.range?"Forward":"Historical"," ").concat("revenue"===e.metric?"revenue":"EPS"," slope"),data:[e.start,e.end].map(e=>{let{date:a,value:n}=e;return{x:a,y:n/o*t*r}}),borderColor:a,backgroundColor:a,borderWidth:1,borderDash:"forward"===e.range?[7,4]:[],pointRadius:3,pointHoverRadius:3,pointBackgroun
1dColor:a,pointBorderColor:"#fff",pointBorderWidth:1.5,tension:0,fill:!1,order:-200,growthSlopeGuide:!0}}},83642:(e,t,r)=>{r.d(t,{A:()=>i});var o=r(82851),a=r.n(o);let n={AE:{name:"United Arab Emirates",currencyCode:"AED"},AR:{name:"Argentina",currencyCode:"ARS"},AU:{name:"Australia",currencyCode:"AUD"},BE:{name:"Belgium",currencyCode:"EUR"},BM:{name:"Bermuda",currencyCode:"BMD"},BR:{name:"Brazil",currencyCode:"BRL"},BS:{name:"Bahamas",currencyCode:"BSD"},CA:{name:"Canada",currencyCode:"CAD"},CH:{name:"Switzerland",currencyCode:"CHF"},CL:{name:"Chile",currencyCode:"CLP"},CN:{name:"China",currencyCode:"CNY"},CO:{name:"Colombia",currencyCode:"COP"},CR:{name:"Costa Rica",currencyCode:"CRC"},CY:{name:"Cyprus",currencyCode:"EUR"},DE:{name:"Germany",currencyCode:"EUR"},DK:{name:"Denmark",currencyCode:"DKK"},ES:{name:"Spain",currencyCode:"EUR"},FI:{name:"Finland",currencyCode:"EUR"},FR:{name:"France",currencyCode:"EUR"},GB:{name:"United Kingdom",currencyCode:"GBP"},GG:{name:"Guernsey",currencyCode:"GIP"},GI:{name:"Gibraltar",currencyCode:"EUR"},GR:{name:"Greece",currencyCode:"HKD"},HK:{name:"Hong Kong",currencyCode:"IDR"},ID:{name:"Indonesia",currencyCode:"IDR"},IE:{name:"Ireland",currencyCode:"EUR"},IL:{name:"Israel",currencyCode:"ILS"},IN:{name:"India",currencyCode:"INR"},IS:{name:"Iceland",currencyCode:"ISK"},IT:{name:"Italy",currencyCode:"EUR"},JE:{name:"Jersey",currencyCode:"GBP"},JO:{name:"Jordan",currencyCode:"JOD"},JP:{name:"Japan",currencyCode:"JPY"},KR:{name:"Korea",currencyCode:"KRW"},KY:{name:"Cayman Islands",currencyCode:"KYD"},LU:{name:"Luxembourg",currencyCode:"EUR"},MC:{name:"Monaco",currencyCode:"EUR"},MX:{name:"Mexico",currencyCode:"MXN"},MY:{name:"Malaysia",currencyCode:"MYR"},NL:{name:"Netherlands",currencyCode:"EUR"},NO:{name:"Norway",currencyCode:"NOK"},PA:{name:"Panama",currencyCode:"PAB"},PE:{name:"Peru",currencyCode:"PEN"},PH:{name:"Philippines",currencyCode:"PHP"},PR:{name:"Puerto Rico",currencyCode:"USD"},RU:{name:"Russian Federation",currencyCode:"RUB"},SE:{name:"Sweden",currencyCode:"SEK"},SG:{name:"Singapore",currencyCode:"SGD"},TH:{name:"Thailand",currencyCode:"THB"},TR:{name:"Turkey",currencyCode:"TRY"},TW:{name:"Taiwan",currencyCode:"TWD"},US:{name:"United States",currencyCode:"USD"},UY:{name:"Uruguay",currencyCode:"UYU"},ZA:{name:"South Africa",currencyCode:"ZAR"}},i=n;a().uniq(a().values(a().mapValues(n,e=>e.currencyCode)))},84296:(e,t,r)=>{r.d(t,{C:()=>a});let o="#7c3aed",a=(e,t)=>{if(!Number.isFinite(t)||t<=0)return null;let r=e.filter(e=>{let{date:t,price:r}=e;return Number.isFinite(new Date(t).getTime())&&Number.isFinite(r)&&r>0}).map(e=>{let{date:r,price:o}=e;return{x:r,y:o*t,price:o}}).sort((e,t)=>new Date(e.x).getTime()-new Date(t.x).getTime());return r.length?{label:"Projected Stock Price",data:r,borderColor:o,backgroundColor:o,pointBackgroun
1dColor:o,pointBorderColor:"#fff",pointBorderWidth:1.5,pointRadius:4,pointHoverRadius:6,pointHitRadius:8,showLine:!1,fill:!1,order:-100,projectedStockPriceMarkers:!0}:null}}}]);

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.