1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8438],{98438:function(t,e,r){r.r(e),r.d(e,{default:function(){return L}});var i=r(47568),n=r(97582),o=r(85893),a=r(67294),c=r(4111),s=r(51438),l=r(52951),f=r(14924),u=r(88029),h=r(26042),d=r(69396),p=r(60460),k=r(34556),x=r(70838),y=r(32110),v=r(44717),b=r(77235),g=r(13724),m=r(67230),S=r(41213),T=r(21571),j=r(24357),w=r(80139),A=r(28637),Z={left:0,right:35,top:10,bottom:30},M={left:0,right:45,top:0,bottom:30},E={NORMAL:"#d2d2d2",NIGHT_MODE:"#464e65"};function C(t,e,r){var i=e.width,n=e.height;t.stroke,r.strokeStyle="#d2d2d2",r.fillStyle="#ffffff",r.beginPath(),r.rect(0,0,1.1*i,1.1*n),r.fill(),r.stroke()}var D=function(t){(0,u.Z)(r,t);var e=(0,p.Z)(r);function r(){var t;return(0,s.Z)(this,r),t=e.apply(this,arguments),(0,f.Z)((0,c.Z)(t),"tooltipCanvas",function(t,e,r){var i=t.fontFamily,n=t.fontSize,o=t.fontFill,a=10+.9*n;r.font="".concat(n,"px ").concat(i),r.fillStyle=o,r.textAlign="left",r.fillText(e.x,10,a);for(var c=0;c<e.y.length;c+=1){r.font="bold ".concat(n,"px ").concat(i);var s=e.y[c],l=a+n*((c+1)*1.3);r.fillStyle=s.stroke||o,r.fillText(s.label,10,l),r.fillStyle=o,r.fillText(": ",10+r.measureText(s.label).width,l),r.font="bold ".concat(n,"px ").concat(i),r.fillText("".concat(s.value),19+r.measureText(s.label).width,l)}}),t}return(0,l.Z)(r,[{key:"render",value:function(){var t=this.props,e=t.data,r=t.width,i=t.nightMode,n=t.currency,a=t.rate,c=t.isMobile,s={left:Z.left,top:Z.top,bottom:Z.bottom,right:Z.right};if(c&&(s={left:M.left,top:M.top,bottom:M.bottom,right:M.right}),0===e.length)return null;var l,f=c?200:440,u={innerTickSize:-1*(r-(s.left+s.right)),tickStrokeDasharray:"ShortDash",tickStrokeOpacity:.5,tickStrokeWidth:1},p={innerTickSize:-1*f,tickStrokeDasharray:"ShortDash",tickStrokeOpacity:.5,tickStrokeWidth:1},x=(0,v.m)()(e),D=b.Ry.inputDateAccessor(function(t){return t.date}),F=D(x),L=F.xScale,N=F.displayXAccessor,_=F.xAccessor;x=D(x).data;var z,G,B=i?"#ddd":"#263238",O=i?E.NIGHT_MODE:E.NORMAL,R=(0,T.createVerticalLinearGradient)([{stop:0,color:(0,T.hexToRGBA)("#2196f3",0)},{stop:.7,color:(0,T.hexToRGBA)("#2196f3",.2)},{stop:1,color:(0,T.hexToRGBA)("#2196f3",.5)}]);return(0,o.jsx)("div",{style:{position:"relative"},children:(0,o.jsxs)(k.UL,{ratio:1,width:r,height:f+s.top+s.bottom,margin:s,type:"hybrid",seriesName:"MSFT",panEvent:!1,zoomEvent:!1,data:x,xAccessor:_,xScale:L,displayXAccessor:N,xExtents:[_(x[x.length-1]),_(x[0])],children:[e[0]&&e[0].btc&&(0,o.jsx)(k.kL,{id:2,height:f,yExtents:function(t){return[1.1*t.btc,.9*t.btc]},children:(0,o.jsx)(m.eh,{yAccessor:function(t){return t.btc},strokeDasharray:"Solid",strokeWidth:1,stroke:"#ffa600cc"})}),(0,o.jsxs)(k.kL,{id:1,height:f,yExtents:function(t){return[t.close+5,t.close-5]},children:[(0,o.jsx)(m.f6,{yAccessor:function(t){return t.close},strokeDasharray:"Solid",strokeWidth:1,stroke:"rgba(33, 150, 243, 0.9)",opacity:.2,canvasGradient:R}),(0,o.jsx)(y.Mn,{stroke:B,className:"crosshair"}),(0,o.jsx)(S.B2,(0,d.Z)((0,h.Z)({axisAt:"right",orient:"right",ticks:c?4:6,tickPadding:10,scaleType:"log"},u),{fontSize:11,tickStroke:O,tickLabelFill:B,stroke:O,opacity:.3})),(0,o.jsx)(S.B2,(0,d.Z)((0,h.Z)({axisAt:"left",orient:"left",ticks:0},u),{fontSize:11,tickStroke:O,tickLabelFill:B,stroke:O,opacity:.3})),(0,o.jsx)(S.Kc,(0,d.Z)((0,h.Z)({axisAt:"top",orient:"top",ticks:0},p),{tickStroke:O,tickLabelFill:B,stroke:O,opacity:.3})),(0,o.jsx)(S.Kc,(0,d.Z)((0,h.Z)({axisAt:"bottom",orient:"bottom",ticks:c?4:6},p),{fontSize:11,tickStroke:O,tickLabelFill:B,stroke:O,opacity:.3})),(0,o.jsx)(y.xj,{itemType:"last",orient:"right",edgeAt:"right",fontSize:"11",opacity:"0.8",yAccessor:function(t){return t.close},fill:"#2196f3",arrowWidth:0,textFill:"#ffffff",displayFormat:function(t){return t}},"EdgeIndicator_MainChart")]}),(0,o.jsx)(g.MZ,{tooltipCanvas:this.tooltipCanvas,backgroundShapeCanvas:C,tooltipContent:(G=function(t){var e,r,i,o=(e=t.close,r="Extreme Fear",e>=0&&e<=24?r="Extreme Fear":e>=25&&e<=44?r="Fear":e>=45&&e<=55?r="Neutral":e>=56&&e<=74?r="Greed":e>=75&&e<=100&&(r="Extreme Greed"),r);return i=t.close,[{label:o,value:t.close,stroke:"#000000"},{label:"BTC's Price",value:t.btc?(0,j.sl)((0,w._k)(t.btc),n):null,
1stroke:"#ffa400"}]},function(t){var e=t.currentItem;return{x:(0,A.WU)(new Date(e.date),"yyyy MMM dd"),y:G(e).filter(function(t){return t.value})}}),fontSize:11,bgFill:"transparent"})]})})}}]),r}(a.Component),F=(0,x.xq)(D);function L(t){var e=t.fagList,r=t.rate,c=t.currency,s=t.nightMode,l=t.isMobile,f=(0,a.useState)(function(){var t=e.map(function(t){return{close:t.value,date:new Date(t.time)}});return t.reverse(),t.slice(t.length-180,t.length)}),u=f[0],h=f[1],d=(0,a.useState)(!0),p=d[0],k=d[1];return(0,a.useEffect)(function(){var t;(t=(0,i.Z)(function(){var t,i,o,a,c,s,l;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),i=(t=new Date(e[0].time).getTime()+36e5)-32832e6,[4,fetch("https://api-web.bitscreener.com/api/v4/graphs/ohlc/bitcoin?from=".concat(i,"&to=").concat(t,"&interval=1d"))];case 1:return[4,n.sent().json()];case 2:return(c=n.sent().close).reverse(),(s=e.map(function(t,e){return{close:t.value,date:new Date(t.time),btc:c[e]*r}})).reverse(),h(s.slice(s.length-180,s.length)),k(!1),[3,4];case 3:return l=n.sent(),console.error("Error fetching BTC data:",l),k(!1),[3,4];case 4:return[2]}})}),function(){return t.apply(this,arguments)})()},[e,r]),(0,o.jsx)("div",{id:"react-fag-chart",className:"flex w-full flex-column",children:(0,o.jsx)("div",{style:{position:"relative",width:"100%"},children:u.length>5?(0,o.jsx)(F,{data:u,currency:c,rate:r,nightMode:s,isMobile:l}):(0,o.jsx)("div",{className:"",children:p?"":"Chart is not available"})})})}},47568:function(t,e,r){function i(t,e,r,i,n,o,a){try{var c=t[o](a),s=c.value}catch(l){r(l);return}c.done?e(s):Promise.resolve(s).then(i,n)}function n(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,s,"next",t)}function s(t){i(a,n,o,c,s,"throw",t)}c(void 0)})}}r.d(e,{Z:function(){return n}})},51438:function(t,e,r){r.d(e,{Z:function(){return i}});function i(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}}}]);
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.