1import{r as D,j as e}from"./metal-fx-C6GZ_SKA.js";import{s as le}from"./CaretLeft.es-C4E89nBF.js";import{s as H}from"./CaretUp.es-CGhst6Hc.js";import{n as ne}from"./ShareNetwork.es-B0SiZeXF.js";import{n as re}from"./Star.es-D8RekT4X.js";import{c as ie}from"./TrendUp.es-1qHMLkId.js";import{j as ce,S as de,e as C,T as a,h,H as k,d as n,a as W,E as L,R as T}from"./shared-OtDZU4QY.js";import{u as xe}from"./useChartPointer-Dc8ejnc2.js";import{fm as me,eT as $}from"./index-D1yBc__G.js";import"./motion-BHwmuFpx.js";const pe=["1D","5D","1M","6M","YTD","1Y","5Y","MAX"],y=4600,X=296.8,V=172.9,K=151e9,u=(t,r)=>{let l=t,f=y;const N=[];for(let E=0;E<r;E++)l=l*48271%2147483647,f=Math.max(y*.93,Math.min(y*1.07,f*(1+(l/2147483647-.508)*.011))),N.push(f);return N},B={"1D":u(7,56),"5D":u(23,56),"1M":u(41,56),"6M":u(67,56),YTD:u(89,56),"1Y":u(113,56),"5Y":u(139,56),MAX:u(167,56)},d=(t,r=2)=>`Rp${t.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`,Z=t=>[Math.min(...t),Math.max(...t)],_=Z(B["1D"]),J=Z([...Object.values(B).flat()]),he=t=>{const r=t.slice(1).filter((l,f)=>l>t[f]).length;return Math.round(r/(t.length-1)*100)},ue=[{sym:"BUKA",name:"Bukalapak Tbk",price:276,chg:2.82},{sym:"BBRI",name:"Bank Rakyat Indonesia",price:4630,chg:.82},{sym:"SIDO",name:"PT Industri Jamu",price:740,chg:-1.34}],I=["6:00","10:00","14:00","18:00","22:00","2:00"],fe=t=>Math.round(60+Math.abs(Math.sin(t*12.9898)*43758.5453)%180),A=311,g=132,o={l:0,r:30,t:8,b:6},j=A-o.l-o.r;function be(){const t=me()||ce(),r=D.useId().replace(/:/g,""),[l,f]=D.useState("1D"),[N,E]=D.useState(!1),i=B[l],v=i.length,{ref:q,i:F,onMove:Q,onLeave:Y}=xe({n:v,W:A,padL:o.l,plotW:j}),c=D.useMemo(()=>{const s=Math.min(...i),p=Math.max(...i),M=p-s||1,R=S=>o.l+S/(v-1)*j,U=S=>o.t+(1-(S-s)/M)*(g-o.t-o.b),ae=i.map((S,oe)=>`${R(oe).toFixed(1)},${U(S).toFixed(1)}`);return{x:R,y:U,pts:ae,min:s,max:p,span:M}},[i,v]),b=i[v-1],P=b-y,O=P/y*100,w=P<0,x=w?W:n,m=F??v-1,ee=b*.9998,se=b*1.0002,z=he(i),G=100-z,te=[["Previous Close",d(y)],["Day Range",`${d(_[0])} â ${d(_[1])}`,"session low / high"],["Year Range",`${d(J[0])} â ${d(J[1])}`,"low / high across every window"],["Market Cap",`${(K*b/1e12).toFixed(2)}T IDR`,`${(K/1e9).toFixed(2)}B shares à last`],["AVG Volume","167.58M","shares / session, 30d"],["P/E Ratio",(b/X).toFixed(2),`last ÷ EPS ${d(X)}`],["Dividend Yield",`${(V/b*100).toFixed(2)}%`,`DPS ${d(V)} ÷ last`],["Primary Exchange","IDX"]];return e.jsxs("div",{className:"w-[375px] shrink-0 overflow-hidden rounded-[30px] border-[6px]",style:{borderColor:"color-mix(in srgb, var(--foreground) 14%, transparent)",background:C,fontFamily:de},children:[e.jsxs("div",{className:"flex h-[38px] items-center justify-between px-6 pt-2 text-[11px] font-semibold tabular-nums",style:{color:a},children:[e.jsx("span",{children:"9:41"}),e.jsx("span",{className:"flex items-center gap-1",style:{color:h},children:e.jsx("span",{className:"inline-block h-[9px] w-[16px] rounded-[2px] border",style:{borderColor:k}})})]}),e.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("button",{type:"button","aria-label":"Back",className:"grid h-6 w-6 place-items-center rounded-md transition-colors hover:bg-foreground
1/[0.06]",children:e.jsx(le,{size:18,color:a})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button","aria-label":N?"Remove from watchlist":"Add to watchlist",onClick:()=>E(s=>!s),className:"grid h-6 w-6 place-items-center rounded-md transition-colors hover:bg-foreground/[0.06]",children:e.jsx(re,{size:18,weight:N?"fill":"regular",color:N?n:a})}),e.jsx("button",{type:"button","aria-label":"Share",className:"grid h-6 w-6 place-items-center rounded-md transition-colors hover:bg-foreground/[0.06]",children:e.jsx(ne,{size:18,color:a})})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"grid h-6 w-6 shrink-0 place-items-center rounded-full text-[9px] font-bold",style:{background:`color-mix(in srgb, ${n} 22%, transparent)`,color:n},children:"G"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-[16px] font-bold leading-tight",style:{color:a},children:"GOTO"}),e.jsx("span",{className:"block truncate text-[12px]",style:{color:h},children:"GoTo Gojek Tokopedia"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[36px] font-semibold leading-none tracking-[-0.02em] tabular-nums",style:{color:a},children:d(b)}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex items-center gap-0.5 rounded-[4px] py-1 pl-0.5 pr-1.5 text-[12px] font-medium tabular-nums",style:{background:`color-mix(in srgb, ${x} 18%, transparent)`,color:x},children:[e.jsx(H,{size:12,weight:"bold",style:{transform:w?"rotate(180deg)":void 0}}),Math.abs(O).toFixed(2),"%"]}),e.jsxs("span",{className:"flex items-center gap-1 text-[12px] tabular-nums",children:[e.jsxs("span",{className:"font-medium",style:{color:x},children:[w?"â":"+",Math.abs(P).toFixed(2)]}),e.jsxs("span",{style:{color:a},children:["vs Rp",y.toLocaleString("en-US")," close"]})]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:pe.map(s=>e.jsxs("button",{type:"button",onClick:()=>{f(s),Y()},className:"relative px-2 py-1.5 text-[12px] transition-colors",style:{color:l===s?n:a,fontWeight:l===s?600:400},children:[s,l===s&&e.jsx($.span,{layoutId:`adm-tf-${r}`,className:"absolute inset-x-0 -bottom-px h-[1.5px] rounded-full",style:{background:n},transition:t?{duration:0}:{duration:.3,ease:L}})]},s))}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{ref:q,width:A,height:g,viewBox:`0 0 ${A} ${g}`,className:"block cursor-crosshair touch-none",onPointerMove:Q,onPointerLeave:Y,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`adm-fill-${r}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:x,stopOpacity:"0.22"}),e.jsx("stop",{offset:"100%",stopColor:x,stopOpacity:"0"})]})}),[0,.25,.5,.75,1].map(s=>{const p=o.t+s*(g-o.t-o.b);return e.jsxs("g",{children:[e.jsx("line",{x1:0,x2:j,y1:p,y2:p,stroke:"color-mix(in srgb, var(--foreground) 5%, transparent)",strokeDasharray:"2 4"}),e.jsx("text",{x:j+6,y:p+3,fontSize:9,fill:h,className:"tabular-nums",children:Math.round(c.max-s*c.span)})]},s)}),e.jsx($.path,{d:`M${c.pts.join(" L")} L ${j},${g-o.b} L 0,${g-o.b} Z`,fill:`url(#adm-fill-${r})`,initial:{opacity:t?1:0},animate:{opacity:1},transition:t?{duration:0}:{duration:.4,ease:L}},`${l}-a`),e.jsx($.path,{d:`M${c.pts.join(" L")}`,fill:"none",stroke:x,strokeWidth:1.6,initial:{pathLength:t?1:0},animate:{pathLength:1},transition:t?{duration:0}:{duration:.8,ease:L}},`${l}-l`),F!=null&&e.jsxs("g",{pointerEvents:"none",children:[e.jsx("line",{x1:c.x(m),x2:c.x(m),y1:o.t,y2:g-o.b,stroke:"color-mix(in srgb, var(--foreground) 22%, transparent)"}),e.jsx("circle",{cx:c.x(m),cy:c.y(i[m]),r:4,fill:x,stroke:C,strokeWidth:2})]})]}),F!=null&&e.jsxs("div",{className:"pointer-events-none absolute top-0 z-10 whitespace-nowrap rounded-[4px] px-1.5 py-1 text-[10px] leading-[1.35] shadow-lg",style:{left:Math.max(0,Math.min(j-96,c.x(m)-48)),background:a,color:C},role:"status",children:[e.jsxs("span",{className:"block font-bold tabular-nums",children:["Rp",i[m].toFixed(2)]}),e.jsxs("span",{className:"block opacity-60",children:["28 Okt 2022 · ",I[Math.floor(m/v*I.length)]]}),e.jsxs("span",{className:"block opacity-60",children:["Volume: ",fe(m),"K"]})]}),e.jsx("div",{className:"mt-1 flex justify-between text-[10px] tabular-nums",style:{width:j,color:h},children:I.map(s=>e.jsx("span",{children:s},s))})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("span",{className:"text-[16px] font-bold tracking-[-0.02em]",style:{color:a},children:"Compared to"}),e.jsx("div",{className:"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ue.map(s=>e.jsxs("div",{className:"flex w-[144px] shrink-0 flex-col gap-0.5 rounded-[6px] border p-2",style:{borderColor:k,background:"color-mix(in srgb, var(--foreground) 4%, transparent)"},children:[e.jsx("span",{className:"text-[12px] font-semibold",style:{color:a},children:s.sym}),e.jsx("span",{className:"truncate text-[10px]",style:{color:h},children:s.name}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[12px] font-medium tabular-nums",style:{color:a},children:d(s.price)}),e.jsxs("span",{className:"flex items-center gap-0.5 text-[11px] font-semibold tabular-nums",style:{color:s.chg>=0?n:W},children:[e.jsx(H,{size:10,weight:"bold",style:{transform:s.chg<0?"rotate(180deg)":void 0}}),Math.abs(s.chg).toFixed(2),"%"]})]})]},s.sym))})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("span",{className:"text-[16px] font-bold tracking-[-0.02em]",style:{color:a},children:"Keystats"}),e.jsx("div",{className:"flex flex-col rounded-[10px] border px-4",style:{borderColor:k,background:"color-mix(in srgb, var(--foreground) 4%, transparent)"},children:te.map(([s,p,M],R)=>e.jsxs("div",{className:"flex items-start justify-between gap-4 py-2.5 text-[12px]",style:{borderTop:R===0?void 0:`1p
1x solid ${k}`},children:[e.jsxs("span",{className:"flex min-w-0 flex-col",style:{color:h},children:[s,M&&e.jsx("span",{className:"text-[10px] text-foreground/30",children:M})]}),e.jsx("span",{className:"text-right font-semibold tabular-nums",style:{color:a},children:p})]},s))})]})]}),e.jsxs("div",{className:"mt-2 flex flex-col gap-6 rounded-t-2xl border-t px-4 pb-5 pt-4",style:{borderColor:k,background:"color-mix(in srgb, var(--foreground) 5%, transparent)"},children:[e.jsx("span",{className:"mx-auto h-1 w-10 rounded-full",style:{background:k}}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("span",{className:"flex flex-col gap-1 text-[12px] font-medium",children:[e.jsx("span",{style:{color:h},children:"09:00 AM"}),e.jsxs("span",{className:"tabular-nums",style:{color:T},children:[G,"% Sell"]})]}),e.jsxs("span",{className:"flex flex-col items-center gap-1",children:[e.jsx("span",{className:"text-[12px] font-bold",style:{color:a},children:"Current Trend"}),e.jsxs("span",{className:"flex items-center gap-1 text-[12px] font-medium tabular-nums",style:{color:x},children:[w?"â":"+",Math.abs(O).toFixed(2),"% (24h)",e.jsx(ie,{size:12,weight:"bold",style:{transform:w?"scaleY(-1)":void 0}})]})]}),e.jsxs("span",{className:"flex flex-col items-end gap-1 text-[12px] font-medium",children:[e.jsx("span",{style:{color:h},children:"02:00 PM"}),e.jsxs("span",{className:"tabular-nums",style:{color:n},children:[z,"% Buy"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"h-[3px] rounded-full",style:{width:`${G}%`,background:T}}),e.jsx("span",{className:"h-[3px] flex-1 rounded-full",style:{background:n}})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($.button,{type:"button",whileTap:t?void 0:{scale:.97},className:"flex-1 rounded-lg py-3 text-[12px] font-bold uppercase tracking-wide text-white",style:{background:T,boxShadow:`0 7px 9px color-mix(in srgb, ${T} 32%, transparent)`},children:["Sell ",ee.toFixed(2)]}),e.jsxs($.button,{type:"button",whileTap:t?void 0:{scale:.97},className:"flex-1 rounded-lg py-3 text-[12px] font-bold uppercase tracking-wide text-white",style:{background:n,boxShadow:`0 7px 9px color-mix(in srgb, ${n} 28%, transparent)`},children:["Buy ",se.toFixed(2)]})]})]})]})}function Ee(){return e.jsx("div",{className:"flex min-h-[520px] w-full items-center justify-center p-6",children:e.jsx(be,{})})}export{Ee as Demo,be 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.