PageSourceSearch

https://bitcoinismore.org/_next/static/chunks/642.d6cedb0f1fae6f14.js

js bitcoinismore.org collected 2026-10-04 18:37:38 UTC 14,123 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[642],{97642:(e,t,a)=>{a.r(t),a.d(t,{default:()=>A});var s=a(57437),r=a(2265),l=a(71328),n=a(22379);function i(e){if(null==e)return{iso:"1970-01-01",display:"1 Jan"};let t=new Date(1e3*e);return{iso:t.toISOString().slice(0,10),display:"".concat(t.getDate()," ").concat(t.toLocaleString("en",{month:"short"}))}}function d(e,t,a){if(t<=0||a<=0||e<0)return 0;let s=e/t/a*31536e5;return isFinite(s)?s:0}function o(e){return e?e/1e8:0}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,[t,a]=(0,r.useState)(window.innerWidth<e);return(0,r.useEffect)(()=>{function t(){a(window.innerWidth<e)}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}let m=e=>{if(!e||0===e)return 1e-4;if(e<.1){let t=Math.pow(10,-Math.floor(Math.log10(e)));return Math.ceil(e*t)/t}return e<1?Math.ceil(10*e)/10:Math.ceil(e)};var u=a(66648),f=a(49354);let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("rounded-lg text-card-foreground",a),...r})});x.displayName="Card";let p=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("flex flex-col space-y-1.5 p-2",a),...r})});p.displayName="CardHeader";let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("text-2xl font-semibold leading-none tracking-tight",a),...r})});h.displayName="CardTitle",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("text-sm text-muted-foreground",a),...r})}).displayName="CardDescription";let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("p-6 pt-0",a),...r})});g.displayName="CardContent",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,f.cn)("flex items-center p-6 pt-0",a),...r})}).displayName="CardFooter";var y=a(48297),w=a(42421),v=a(14392),j=a(22468);let b=y.fC;y.ZA,y.B4;let N=r.forwardRef((e,t)=>{let{className:a,children:r,...l}=e;return(0,s.jsxs)(y.xz,{ref:t,className:(0,f.cn)("inline-flex items-center justify-between px-4 h-10 bg-[#111411] border border-neutral-800 text-neutral-500 rounded-md shadow-md","outline-none focus:outline-none focus-visible:outline-none","focus:!ring-0 focus-visible:!ring-0 focus:!ring-offset-0 focus-visible:!ring-offset-0",a),...l,children:[r,(0,s.jsx)(y.JO,{asChild:!0,children:(0,s.jsx)(w.Z,{className:"h-4 w-4 opacity-50"})})]})});N.displayName=y.xz.displayName;let k=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(y.u_,{ref:t,className:(0,f.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(v.Z,{className:"h-4 w-4"})})});k.displayName=y.u_.displayName;let C=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(y.$G,{ref:t,className:(0,f.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})});C.displayName=y.$G.displayName;let T=r.forwardRef((e,t)=>{let{className:a,children:r,position:l="popper",...n}=e;return(0,s.jsx)(y.h_,{children:(0,s.jsxs)(y.VY,{ref:t,className:(0,f.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:l,...n,children:[(0,s.jsx)(k,{}),(0,s.jsx)(y.l_,{className:(0,f.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,s.jsx)(C,{})]})})});T.displayName=y.VY.displayName,r.forwardRef((e,t)=>
1{let{className:a,...r}=e;return(0,s.jsx)(y.__,{ref:t,className:(0,f.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})}).displayName=y.__.displayName;let L=r.forwardRef((e,t)=>{let{className:a,children:r,...l}=e;return(0,s.jsxs)(y.ck,{ref:t,className:(0,f.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-700 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(y.wU,{children:(0,s.jsx)(j.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(y.eT,{children:r})]})});L.displayName=y.ck.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(y.Z0,{ref:t,className:(0,f.cn)("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=y.Z0.displayName;var R=a(89733),S=a(38401);function M(e){let{onUnitChange:t}=e,[a,l]=(0,r.useState)("percent"),n=e=>{e!==a&&(l(e),null==t||t(e))};return(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)(R.z,{variant:"ghost",size:"sm",onClick:()=>n("percent"),className:"px-4 md:px-5 h-8 md:h-10 rounded-md ".concat("percent"===a?"bg-sand-900 text-white hover:bg-sand-900 hover:text-white":"text-sand-500 hover:text-sand-300 hover:bg-sand-600"),children:[(0,s.jsx)(S.Z,{className:"h-3.5 w-3.5 mr-1"}),(0,s.jsx)("span",{className:"text-sm md:text-base",children:"APY"})]}),(0,s.jsxs)(R.z,{variant:"ghost",size:"sm",onClick:()=>n("sbtc"),className:"px-4 md:px-5 h-8 md:h-10 rounded-md ".concat("sbtc"===a?"bg-sand-900 text-white hover:bg-sand-900 hover:text-white":"text-sand-500 hover:text-sand-300 hover:bg-sand-600"),children:[(0,s.jsx)(u.default,{src:"/logo-sbtc-light.svg",width:20,height:20,alt:"sBTC",className:"".concat("sbtc"===a?"":"dark:invert-0 invert opacity-30"," mr-1")}),(0,s.jsx)("span",{className:"text-sm md:text-base",children:"sBTC"})]})]})}var D=a(35231),z=a(40477),_=a(54142),F=a(2842),I=a(85475),E=a(86991),P=a(9542);function V(e){let{data:t,unit:a,orientation:r,yAxisWidth:l,formatYAxis:n,formatXAxis:i,CustomTooltip:d,onMouseMove:o,onMouseLeave:c}=e;return(0,s.jsx)("div",{className:"h-[500px] w-full",children:(0,s.jsx)(D.h,{width:"100%",height:"100%",children:(0,s.jsxs)(z.T,{data:t,margin:{top:10,right:10,left:0,bottom:0},onMouseMove:o,onMouseLeave:c,children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"colorValue",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"5%",stopColor:"#ff5533",stopOpacity:.3}),(0,s.jsx)("stop",{offset:"95%",stopColor:"#ff5533",stopOpacity:0})]})}),(0,s.jsx)(_.q,{vertical:!1,stroke:"#888888",opacity:"50%"}),(0,s.jsx)(F.K,{dataKey:"display",tickFormatter:i,axisLine:!1,interval:"preserveStartEnd",tickLine:!1,tick:{fill:"#666666",fontSize:12,fontWeight:"semibold"},dy:10,minTickGap:30}),(0,s.jsx)(I.u,{content:(0,s.jsx)(d,{})}),(0,s.jsx)(E.u,{type:"monotone",dataKey:"value",stroke:"#ff5533",strokeWidth:2,fill:"url(#colorValue)",fillOpacity:1,activeDot:{r:10,fill:"#ff5533",stroke:"#ffffff"}}),(0,s.jsx)(P.B,{type:"number",scale:"linear",orientation:r,tickFormatter:n,domain:[0,e=>m(e)],axisLine:!1,tickLine:!1,tickCount:6,width:l,tick:{fill:"#666666",fontSize:"sbtc"===a?11:14,fontWeight:"bold"}})]})})})}function B(e){let{data:t,unit:a}=e,[l,n]=(0,r.useState)(null),i=c(500),d="percent"===a?i?0:2:8,o="sbtc"===a?i?70:120:i?40:50;return 0===t.length?(0,s.jsx)(V.EmptyState,{}):(0,s.jsx)(V,{data:t,unit:a,orientation:i?"left":"right",yAxisWidth:o,formatYAxis:e=>{let t=e.toLocaleString("en-US",{maximumFractionDigits:d,minimumFractionDigits:0});return"percent"===a?"".concat(t,"%"):"".concat(t," sBTC")},formatXAxis:e=>"0"===e?"0":e,CustomTooltip:e=>{var r;let{active:l,payload:n,label:i}=e;if(!l||!(null==n?void 0:n.length))return null;let d=t.find(e=>e.display===i),o=new Date(d?d.date:i),c="".concat(o.getMonth()+1,"/").concat(o.getDate(),"/").concat(o.getFullYear()),m=n[0].value,u=null!==(r=null==d?void 0:d.cycle)&&void 0!==r?r:"-";return(0,s.jsx)(V.TooltipContent,{value:m,unit:a,cycle:u,date:c})},onMouseMove:e=>{if(e.activePayload){var t;n({active:!0,payload:e.activePayload,label:null!==(t=e.activeLabel)&&void 0!==t?t:""})}},onMouseLeave:()=>n(null)})}function U(e){let{unit:t,period:a,title:r,summaryValue:l,summaryLabel:n,chartData:i,availablePerio
1ds:d,onUnitChange:o,onPeriodChange:c}=e;return(0,s.jsxs)("main",{className:"flex flex-col items-center justify-center bg-sand dark:bg-[#111411] py-12",children:[(0,s.jsx)("div",{className:"w-full sm:max-w-[74%] mb-[-3px] md:ml-12 z-10 flex justify-start",children:(0,s.jsx)(u.default,{src:"/stack-illustration^^.svg",alt:"Bitcoin",width:74,height:74,className:"ml-6"})}),(0,s.jsxs)(x,{className:"w-full sm:max-w-[74%] bg-sand-200 dark:bg-sand-900/10 border-neutral-500 text-white p-4 md:pt-8 relative",children:[(0,s.jsx)(p,{className:"pb-8",children:(0,s.jsxs)("div",{className:"flex justify-center flex-col lg:flex-row lg:justify-between items-center",children:[(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)(h,{className:"dark:text-sand-100 text-sand-600 font-normal md:text-2xl text-3xl tracking-normal mb-4",children:r}),(0,s.jsxs)("div",{className:"flex items-center sm:items-end w-full gap-4 ",children:[(0,s.jsx)("div",{className:"",children:(0,s.jsx)("p",{className:"text-orange-blood text-4xl tracking-wide font-extrabold ",children:l})}),(0,s.jsx)("p",{className:"text-sand-400 tracking-wide text-xl text-start",children:n})]})]}),(0,s.jsxs)("div",{className:"flex items-end gap-6 mr-8 mt-8 lg:mt-0",children:[(0,s.jsx)(M,{onUnitChange:o}),(0,s.jsxs)(b,{value:a.toString(),onValueChange:c,children:[(0,s.jsxs)(N,{className:"focus:!ring-0 focus:!ring-offset-0 focus-visible:!ring-0 focus-visible:!ring-offset-0 outline-none focus:outline-none h-10 px-4 text-base w-[120px] lg:w-[150px] bg-sand-100 text-sand-900 dark:bg-neutral-900 dark:text-sand-300 rounded-md dark:border-neutral-800 border-sand-400 shadow-lg",children:[a,"-day"]}),(0,s.jsx)(T,{className:"dark:bg-[#131313] dark:border-white/10",children:d.map(e=>(0,s.jsxs)(L,{value:e.toString(),children:["Last ",e," days"]},e))})]})]})]})}),(0,s.jsx)("div",{className:"mt-2 p-0 md:p-3",children:(0,s.jsx)(B,{data:i,unit:t})})]})]})}V.EmptyState=()=>(0,s.jsx)("div",{className:"text-center py-10",children:"No data to display"}),V.TooltipContent=e=>{let{value:t,unit:a,cycle:r,date:l}=e;return(0,s.jsx)(x,{className:"bg-sand-900/90 backdrop-blur border-sand-800 shadow-xl p-2 min-w-[160px]",children:(0,s.jsxs)(g,{className:"text-base flex flex-col gap-1 p-0",children:[(0,s.jsxs)("p",{className:"text-sand-100 font-bold text-lg flex items-center gap-1",children:[0===t?"-":"percent"===a?"".concat(t.toFixed(2),"%"):"".concat(t.toFixed(8)),"sbtc"===a&&(0,s.jsx)("span",{className:"text-sand-400 text-sm font-normal",children:"sBTC Reward"})]}),(0,s.jsxs)("div",{className:"flex justify-between w-full",children:[(0,s.jsxs)("p",{className:"text-sand-400 text-sm",children:["Cycle ",r]}),(0,s.jsx)("p",{className:"text-sand-400 text-sm",children:l})]})]})})};let Z=[15,30,90];function A(){let[e,t]=(0,r.useState)("percent"),[a,m]=(0,r.useState)(90),{data:u,isLoading:f,isError:x,wasEnrolled:p}=function(e,t){let a=(0,n.JQ)(n.L5),{data:s,isLoading:r,error:c}=(0,l.eb)(n.L5),{data:m,isLoading:u,error:f}=(0,l.Yi)(n.L5,a),x=(0,n.JQ)(n.L5)&&m&&m.length>0,p=x?function(e,t,a){if(!e||!t)return[];let s=new Map(t.map(e=>[e.cycleId,e])),r=e.map(e=>{let t;let r=s.get(e.cycleId);if(!(null==r?void 0:r.endTime))return console.warn("User stat for cycle ".concat(e.cycleId," skipped: Missing cycle data or end time.")),null;if(null==e.rewarded)return console.warn("User stat for cycle ".concat(e.cycleId," skipped: Missing reward data.")),null;if("percent"===a&&(0===e.snapshots.length||e.rewarded<=0)){let{iso:t,display:a}=i(r.endTime);return{date:t,display:a,value:0,cycle:e.cycleId}}let{iso:l,display:n}=i(r.endTime);if("sbtc"===a)t=o(e.rewarded);else{var c;let a=r.endTime-(null!==(c=r.startTime)&&void 0!==c?c:r.endTime),s=e.snapshots.reduce((e,t)=>e+t,0),l=e.snapshots.length>0?s/e.snapshots.length:0;t=d(e.rewarded,l,a)}return{date:l,display:n,value:t,cycle:e.cycleId}}).filter(e=>null!==e);return r.sort((e,t)=>e.date.localeCompare(t.date)),r}(m,s,e):function(e,t){if(!e)return[];let a=e.filter(e=>{let a=null!=e.endTime&&null!=e.totalRewarded&&null!=e.cycleTotal&&null!=e.startTime;return a||console.warn("General cycle ".concat(e.cycleId," skipped due to missing data (endTime, totalRewarded, cycleTotal, or startTime).")),"percent"!==t||e.totalRewarded&&e.totalRewarded,a}).map(e=>{let a;let{iso:s,display:r}=i(e.endTime);if("sbtc"===t)a=o(e.totalRewarded);else{let t=e.endTime-e.startTime,s=e.cycleTotal;a=d(e.totalRewarded,s,t)*e.snapshotsPerCycle}return{date:s,display:r,value:a,cycle:e.cycleId}});return a.sort((e,t)=>
1e.date.localeCompare(t.date)),a}(s,e),h=new Date;return h.setDate(h.getDate()-t+1),{data:function(e){let{startDate:t,endDate:a,lastN:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e;return(t||a)&&(r=r.filter(e=>(!t||!(e.date<t))&&(!a||!(e.date>a)))),null!=s&&r.length>s&&(r=r.slice(-s)),r}(p,{startDate:h.toISOString().slice(0,10)}),isLoading:r||u,isError:null!=f?f:c,wasEnrolled:x}}(e,a),{summaryValue:h,summaryLabel:g}=function(e,t,a,s,l){let n=c();return(0,r.useMemo)(()=>{if(s||l||0===e.length)return{summaryValue:"-",summaryLabel:""};let r=e.reduce((e,t)=>e+t.value,0);if("percent"!==t)return{summaryValue:"".concat(r.toLocaleString("en-US",{maximumFractionDigits:n?3:8})," sBTC"),summaryLabel:"".concat(a,"-Day Total Reward")};{let t=r/e.length;return{summaryValue:"".concat(t.toFixed(2),"%"),summaryLabel:"".concat(a,"-Day Average APY")}}},[e,t,a,s,l])}(u,e,a,f,x);return f||x?null:(0,s.jsx)(U,{unit:e,period:a,title:p?"User Rewards Performance":"Rewards Performance",summaryValue:h,summaryLabel:g,chartData:u,availablePeriods:Z,onUnitChange:e=>{t(e)},onPeriodChange:e=>{m(Number(e))}})}}}]);

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.