zframes 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +30 -18
  2. package/dist/index.js +170 -10
  3. package/package.json +4 -4
  4. package/runtime/assets/{bitcoin-dominance-DVZsIJ3y.js → bitcoin-dominance-DoQXKqiB.js} +1 -1
  5. package/runtime/assets/{breakeven-lskbHkqb.js → breakeven-C-RPYpuB.js} +1 -1
  6. package/runtime/assets/{breathing-BeUkCUAJ.js → breathing-y5-8SC9y.js} +1 -1
  7. package/runtime/assets/{btc-blocks-fXBgGo4z.js → btc-blocks-Sw7Iyo4-.js} +1 -1
  8. package/runtime/assets/{btc-difficulty-BwyxgI0e.js → btc-difficulty-BYmWqBxZ.js} +1 -1
  9. package/runtime/assets/{btc-fees-Bg1rcXtN.js → btc-fees-D8mISVeZ.js} +1 -1
  10. package/runtime/assets/{btc-hashrate-Xg8QNlTO.js → btc-hashrate-BEJQmdg9.js} +1 -1
  11. package/runtime/assets/{btc-mempool-8Mfa77fO.js → btc-mempool-1XmL6cRJ.js} +1 -1
  12. package/runtime/assets/{calculator-CiXyJA9p.js → calculator-DXo_2gkF.js} +1 -1
  13. package/runtime/assets/{checklist-D0dKSdmf.js → checklist-BdYa9ZOP.js} +1 -1
  14. package/runtime/assets/{clock-CNQTNh4L.js → clock-D-I4lQmb.js} +1 -1
  15. package/runtime/assets/{coin-movers-DulAF_oo.js → coin-movers-DOacvI6E.js} +1 -1
  16. package/runtime/assets/{countdown-BzZ2L6bw.js → countdown-BUHtC8Ve.js} +1 -1
  17. package/runtime/assets/{daily-analysis-RyI5KL4T.js → daily-analysis-CfKUC2nL.js} +1 -1
  18. package/runtime/assets/{day-meter-2bAj77Kz.js → day-meter-Bf2cGHVR.js} +1 -1
  19. package/runtime/assets/dex-volume-chart-61eDevFa.js +1 -0
  20. package/runtime/assets/dex-volume-treemap-DlwxBY_b.js +1 -0
  21. package/runtime/assets/{dice-wg979Skm.js → dice-Dl2uLedD.js} +1 -1
  22. package/runtime/assets/{dino-game-DlACWmE_.js → dino-game-Cx4Nc7AZ.js} +1 -1
  23. package/runtime/assets/{divider-Chz1UsWJ.js → divider-HYdZwv9D.js} +1 -1
  24. package/runtime/assets/{drawdy-Ce7P47cx.js → drawdy-C42tJRAO.js} +1 -1
  25. package/runtime/assets/editor-BMMobjrE.css +1 -0
  26. package/runtime/assets/editor-COIEaoVd.js +68 -0
  27. package/runtime/assets/{fear-greed-CENzXdIk.js → fear-greed-BkmVWoHA.js} +1 -1
  28. package/runtime/assets/{filings-feed-2aIKzUUY.js → filings-feed-ChiZiKYE.js} +1 -1
  29. package/runtime/assets/{financial-stress--ezsCpfR.js → financial-stress-BQJoviQU.js} +1 -1
  30. package/runtime/assets/{flappy-bird-DDe-IXt9.js → flappy-bird-DphWPPwp.js} +1 -1
  31. package/runtime/assets/{fundamentals-v8f81ZNS.js → fundamentals-D20TvQN_.js} +1 -1
  32. package/runtime/assets/funding-heatmap-DxH9NYjL.js +1 -0
  33. package/runtime/assets/{funding-rate-chart-CjDA4nj7.js → funding-rate-chart-BJ2jiIb4.js} +1 -1
  34. package/runtime/assets/fx-board-DXTpvuXF.js +1 -0
  35. package/runtime/assets/{heading-DMxdj9LK.js → heading-Cr4OaUt7.js} +1 -1
  36. package/runtime/assets/{holiday-calendar-DxB-fxG5.js → holiday-calendar-DHK0jzQc.js} +1 -1
  37. package/runtime/assets/{image-DLg33JpH.js → image-DVddTOkv.js} +1 -1
  38. package/runtime/assets/{index-DRTPEQtR.css → index-BqHx9BjX.css} +1 -1
  39. package/runtime/assets/index-DK7jWlTL.js +1 -0
  40. package/runtime/assets/index-DNLPQoS7.js +936 -0
  41. package/runtime/assets/inflation-pulse-NCyRMTQV.js +1 -0
  42. package/runtime/assets/{journal-log-BX5Z_yte.js → journal-log-C_W9xs_w.js} +1 -1
  43. package/runtime/assets/{journal-open-XFQGIRkw.js → journal-open-CVlbbryx.js} +1 -1
  44. package/runtime/assets/{journal-results-J1WCmyH2.js → journal-results-Bsk6nwKi.js} +1 -1
  45. package/runtime/assets/{journal-score-CKhBSfYY.js → journal-score-C6Aj9hWs.js} +1 -1
  46. package/runtime/assets/{journal-ui-Cogk2Wkt.js → journal-ui-DgGd2Foc.js} +1 -1
  47. package/runtime/assets/{labor-market-BV20Rl-4.js → labor-market-BvFWS_YO.js} +1 -1
  48. package/runtime/assets/{lightning-stats-h4fquhAg.js → lightning-stats-DyRwU2-5.js} +1 -1
  49. package/runtime/assets/{link-grid-a6NWj1Hu.js → link-grid-DxPMWWbo.js} +1 -1
  50. package/runtime/assets/live-tick-9Q3ubPF9.js +1 -0
  51. package/runtime/assets/liveline-bcaEuskN.js +1 -0
  52. package/runtime/assets/market-cap-treemap-LEDlsNnm.js +1 -0
  53. package/runtime/assets/{market-hours-6srwf0-r.js → market-hours-DlTlbyBC.js} +1 -1
  54. package/runtime/assets/{marquee-DDurk6bj.js → marquee-Ds-0N_-6.js} +1 -1
  55. package/runtime/assets/mini-line-chart-CHM5UBjJ.js +1 -0
  56. package/runtime/assets/{mining-pools-BPjCy4ZW.js → mining-pools-Dg55Tg1-.js} +1 -1
  57. package/runtime/assets/{mover-row-kQ9xt3Sp.js → mover-row-CunANlxa.js} +1 -1
  58. package/runtime/assets/{national-debt-DkOnmfd1.js → national-debt-G2V6-Lef.js} +1 -1
  59. package/runtime/assets/news-feed-RKSA0wsz.js +1 -0
  60. package/runtime/assets/note-CDlwRqhL.js +1 -0
  61. package/runtime/assets/{open-interest-fxHh_T-V.js → open-interest-Bs6LXeca.js} +1 -1
  62. package/runtime/assets/{options-iv-CDArg1Op.js → options-iv-BClv6xRB.js} +1 -1
  63. package/runtime/assets/{options-oi-strike-D_XIgUkk.js → options-oi-strike-DbhE95-7.js} +1 -1
  64. package/runtime/assets/{options-put-call-DG4RXjzD.js → options-put-call-C7tt191v.js} +1 -1
  65. package/runtime/assets/{pomodoro-B-Jk-51G.js → pomodoro-DpIO5pex.js} +1 -1
  66. package/runtime/assets/{portfolio-allocation-BJepNj1X.js → portfolio-allocation-DqSXNMYF.js} +1 -1
  67. package/runtime/assets/{portfolio-common-D5L06PNC.js → portfolio-common-CCGvaNdA.js} +1 -1
  68. package/runtime/assets/{portfolio-holdings-DSkAZALG.js → portfolio-holdings-Bxvf91Yo.js} +1 -1
  69. package/runtime/assets/portfolio-value-C6TFZyPZ.js +1 -0
  70. package/runtime/assets/price-chart-D4wf9Yju.js +1 -0
  71. package/runtime/assets/price-compare-B-mjV1jP.js +1 -0
  72. package/runtime/assets/price-liveline-K4S4XpSX.js +1 -0
  73. package/runtime/assets/{price-ticker-BXSeNYf9.js → price-ticker-BNDRtpS8.js} +1 -1
  74. package/runtime/assets/protocol-fees-treemap-vjLiXJ6x.js +1 -0
  75. package/runtime/assets/{protocol-tvl-chart-CEjUOIY5.js → protocol-tvl-chart-Dz8JtyuD.js} +1 -1
  76. package/runtime/assets/protocol-tvl-treemap-BrA0oXqV.js +1 -0
  77. package/runtime/assets/{quote-cehyepdm.js → quote-PcP5IX9V.js} +1 -1
  78. package/runtime/assets/{rates-board-Du4k0z1i.js → rates-board-BNAw2Iei.js} +1 -1
  79. package/runtime/assets/{returns-projector-DXnRFAES.js → returns-projector-BSTPBgMR.js} +1 -1
  80. package/runtime/assets/{risk-reward-DZWyCrbv.js → risk-reward-Dnp2JQr7.js} +1 -1
  81. package/runtime/assets/{rules-card-BXJjNTqj.js → rules-card-BNInaYxt.js} +1 -1
  82. package/runtime/assets/{session-progress-bA45Q3wk.js → session-progress-D1mhPWWM.js} +1 -1
  83. package/runtime/assets/{short-volume-C6cWknyR.js → short-volume-Dsm5jHLL.js} +1 -1
  84. package/runtime/assets/{snake-DYTa97hl.js → snake-CyxVfmbr.js} +1 -1
  85. package/runtime/assets/{spotify-embed-BaH6UHeG.js → spotify-embed-DcnZGDEz.js} +1 -1
  86. package/runtime/assets/{stopwatch-CS6n0bY9.js → stopwatch-ggIRtWfw.js} +1 -1
  87. package/runtime/assets/top-movers-CanKFls6.js +1 -0
  88. package/runtime/assets/{treasury-auctions-CGM8hAuU.js → treasury-auctions-BBHz7Mbe.js} +1 -1
  89. package/runtime/assets/treemap-leaf-DNIoJEK-.js +1 -0
  90. package/runtime/assets/tvl-treemap-D-LqgfI7.js +1 -0
  91. package/runtime/assets/{video-WCnvLwQ_.js → video-DqWW_aoH.js} +1 -1
  92. package/runtime/assets/{yield-curve-CpitTQ9L.js → yield-curve-Dpm8XDwi.js} +1 -1
  93. package/runtime/index.html +2 -2
  94. package/runtime/assets/dex-volume-chart-DDPf1YAN.js +0 -1
  95. package/runtime/assets/dex-volume-treemap-jZCgRREu.js +0 -1
  96. package/runtime/assets/editor-BlGZ_tel.js +0 -68
  97. package/runtime/assets/editor-CHAAJRb1.css +0 -1
  98. package/runtime/assets/funding-heatmap-DUoeFNGr.js +0 -1
  99. package/runtime/assets/fx-board-CmXYQZi4.js +0 -1
  100. package/runtime/assets/index-C_O7gp2F.js +0 -822
  101. package/runtime/assets/index-jnySFpSv.js +0 -1
  102. package/runtime/assets/inflation-pulse-gcw-84PM.js +0 -1
  103. package/runtime/assets/liveline-C5zt2WuS.js +0 -1
  104. package/runtime/assets/market-cap-treemap-CAi49oc_.js +0 -1
  105. package/runtime/assets/mini-line-chart-D-i1QqSe.js +0 -1
  106. package/runtime/assets/news-feed-CFWKKqrH.js +0 -1
  107. package/runtime/assets/note-_cGEXAru.js +0 -1
  108. package/runtime/assets/portfolio-value-BJw2csWV.js +0 -1
  109. package/runtime/assets/price-chart-khxI-9vJ.js +0 -1
  110. package/runtime/assets/price-compare-C-uEckke.js +0 -1
  111. package/runtime/assets/price-liveline-BDesEIbL.js +0 -1
  112. package/runtime/assets/protocol-fees-treemap-YtWbL1Kn.js +0 -1
  113. package/runtime/assets/protocol-tvl-treemap-b31QlpnS.js +0 -1
  114. package/runtime/assets/top-movers-CQNx9EH5.js +0 -1
  115. package/runtime/assets/treemap-leaf-DLQawrx4.js +0 -1
  116. package/runtime/assets/tvl-treemap-C3SUFzdj.js +0 -1
@@ -1 +1 @@
1
- import{j as s,r as m}from"./react-qoZPGuNy.js";import{f as d,i as n,A as x,h as f}from"./index-C_O7gp2F.js";import{f as i,b as h,a as p,c as u}from"./format-CfAcS4D8.js";import{P as b,u as g,a as j}from"./portfolio-common-D5L06PNC.js";import{s as N}from"./ui-Bq3RQsdJ.js";n.schema;function y(t){return t>=1e3?t.toLocaleString("en-US",{maximumFractionDigits:2}):t>=1?t.toFixed(4).replace(/\.?0+$/,""):t.toPrecision(4)}function v({portfolio:t,config:a}){const{priced:l,total:r}=g(t.holdings),c=m.useMemo(()=>[...l].sort((e,o)=>(o.value??0)-(e.value??0)),[l]);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline justify-between border-b border-white/[0.06] pb-1.5",children:[s.jsx(j,{portfolio:t,config:a,className:"caption text-soft"}),s.jsx("span",{className:"metric-sm text-strong",children:i(r)})]}),s.jsx("div",{className:N,children:s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{children:c.map(e=>{const o=r>0?(e.value??0)/r*100:0;return s.jsxs("tr",{className:"border-b border-white/[0.04]",children:[s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(x,{symbol:e.symbol,size:16}),s.jsx("span",{className:"text-normal font-semibold",children:f(e.symbol)})]})}),s.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:y(e.amount)}),s.jsx("td",{className:"text-normal py-1.5 text-right font-semibold tabular-nums",children:e.value!==void 0?i(e.value):"—"}),s.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:h(o,1)}),s.jsx("td",{className:"py-1.5 text-right tabular-nums",children:e.changePct24h!==void 0?s.jsx("span",{style:{color:u(e.changePct24h)},children:p(e.changePct24h)}):s.jsx("span",{className:"text-soft",children:"·"})})]},e.symbol)})})})})]})}function P({config:t}){return s.jsx(b,{config:t,loadingLabel:"loading holdings…",children:a=>s.jsx(v,{portfolio:a,config:t})})}const L=d({...n,component:P});export{L as portfolioHoldingsFrame};
1
+ import{j as s,r as m}from"./react-qoZPGuNy.js";import{f as d,i as n,A as x,h as f}from"./index-DNLPQoS7.js";import{f as i,b as h,a as p,c as u}from"./format-CfAcS4D8.js";import{P as b,u as g,a as j}from"./portfolio-common-CCGvaNdA.js";import{s as N}from"./ui-Bq3RQsdJ.js";n.schema;function y(t){return t>=1e3?t.toLocaleString("en-US",{maximumFractionDigits:2}):t>=1?t.toFixed(4).replace(/\.?0+$/,""):t.toPrecision(4)}function v({portfolio:t,config:a}){const{priced:l,total:r}=g(t.holdings),c=m.useMemo(()=>[...l].sort((e,o)=>(o.value??0)-(e.value??0)),[l]);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline justify-between border-b border-white/[0.06] pb-1.5",children:[s.jsx(j,{portfolio:t,config:a,className:"caption text-soft"}),s.jsx("span",{className:"metric-sm text-strong",children:i(r)})]}),s.jsx("div",{className:N,children:s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{children:c.map(e=>{const o=r>0?(e.value??0)/r*100:0;return s.jsxs("tr",{className:"border-b border-white/[0.04]",children:[s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(x,{symbol:e.symbol,size:16}),s.jsx("span",{className:"text-normal font-semibold",children:f(e.symbol)})]})}),s.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:y(e.amount)}),s.jsx("td",{className:"text-normal py-1.5 text-right font-semibold tabular-nums",children:e.value!==void 0?i(e.value):"—"}),s.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:h(o,1)}),s.jsx("td",{className:"py-1.5 text-right tabular-nums",children:e.changePct24h!==void 0?s.jsx("span",{style:{color:u(e.changePct24h)},children:p(e.changePct24h)}):s.jsx("span",{className:"text-soft",children:"·"})})]},e.symbol)})})})})]})}function P({config:t}){return s.jsx(b,{config:t,loadingLabel:"loading holdings…",children:a=>s.jsx(v,{portfolio:a,config:t})})}const L=d({...n,component:P});export{L as portfolioHoldingsFrame};
@@ -0,0 +1 @@
1
+ import{j as e,r as o}from"./react-qoZPGuNy.js";import{L as V}from"./liveline-bcaEuskN.js";import{f as N,a as L,c as D}from"./format-CfAcS4D8.js";import{u as I,o as F}from"./live-tick-9Q3ubPF9.js";import{P as H,u as W,a as _}from"./portfolio-common-CCGvaNdA.js";import{f as k,p as y}from"./index-DNLPQoS7.js";import"./ui-Bq3RQsdJ.js";const w=720,d=3,q={top:12,right:66,bottom:28,left:8};y.schema;function A(){return typeof document>"u"?"hsl(242 90% 66%)":`hsl(${getComputedStyle(document.documentElement).getPropertyValue("--zf-accent-hue").trim()||"242"} 90% 66%)`}function G({portfolio:a,config:c,windowSec:h}){var v;const{total:t}=W(a.holdings),p=o.useMemo(()=>A(),[]),{ref:P,visibleRef:x}=I(),u=o.useRef(!1),[s,M]=o.useState([]),b=o.useRef(t);o.useEffect(()=>{b.current=t},[t]);const i=o.useCallback(()=>{if(!x.current){u.current=!0;return}const n=b.current;if(!Number.isFinite(n)||n<=0)return;const l=Date.now()/1e3,S=u.current;u.current=!1,M(C=>{const r=S?[]:C,f=r[r.length-1];if(f&&Math.abs(l-f.time)<.5&&f.value===n)return r;const m=r.length===0?[{time:l-d,value:n},{time:l,value:n}]:[...r,{time:l,value:n}];return m.length>w?m.slice(-w):m})},[x]);o.useEffect(()=>{i()},[i,t]),o.useEffect(()=>F(i),[i]);const g=(v=s[0])==null?void 0:v.value,j=g&&t?(t/g-1)*100:0,E=o.useMemo(()=>s.length===0?[]:[{id:"equity",label:"Portfolio",color:p,data:s,value:t}],[s,t,p]),R=o.useMemo(()=>{if(s.length===0)return d;const n=s[s.length-1].time-s[0].time;return Math.min(h,Math.max(d,Math.ceil(n)))},[s,h]);return e.jsxs("div",{ref:P,className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"flex flex-none items-baseline justify-between border-b border-white/[0.06] pb-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_,{portfolio:a,config:c,className:"caption text-soft"}),e.jsx("span",{className:"metric-md text-strong",children:N(t)})]}),e.jsxs("span",{className:"body-sm font-semibold tabular-nums",style:{color:D(j)},children:[L(j)," ",e.jsx("span",{className:"caption text-soft",children:"session"})]})]}),e.jsx("div",{className:"min-h-0 flex-1 [&>div[style*='align-items']]:!hidden",children:e.jsx(V,{data:[],value:t,series:E,theme:"dark",window:R,grid:!0,loading:s.length<=1,scrub:!1,badge:!1,formatValue:N,padding:q,style:{width:"100%",height:"100%"}})})]})}function O({config:a}){return e.jsx(H,{config:a,loadingLabel:"loading portfolio…",children:c=>e.jsx(G,{portfolio:c,config:a,windowSec:a.windowSec})})}const K=k({...y,component:O});export{K as portfolioValueFrame};
@@ -0,0 +1 @@
1
+ import{j as i,r as o}from"./react-qoZPGuNy.js";import{L as T}from"./liveline-bcaEuskN.js";import{f as j,a1 as v,A as E,k as y,h as P,a2 as k}from"./index-DNLPQoS7.js";import{d as x}from"./format-CfAcS4D8.js";import{u as A}from"./live-tick-9Q3ubPF9.js";import{F as N}from"./ui-Bq3RQsdJ.js";const f={"1m":6e4,"5m":5*6e4,"15m":15*6e4,"1h":60*6e4,"4h":240*6e4,"1d":1440*6e4},w=60,F={top:12,right:56,bottom:28,left:12};v.schema;function I({config:t}){const s=f[t.interval],c=o.useMemo(()=>Date.now()-s*w,[s]),{candles:n,isLoading:p}=k(t.symbol,t.interval,c,Math.min(s,6e4)),a=y([t.symbol])[t.symbol],{ref:M,visibleRef:b}=A(),h=o.useRef(!1),[u,g]=o.useState([]);o.useEffect(()=>{if(a===void 0)return;if(!b.current){h.current=!0;return}const e=h.current;h.current=!1,g(m=>{const d=[...e?[]:m,{time:Date.now()/1e3,value:a}];return d.length>900?d.slice(-600):d})},[a,b]),o.useEffect(()=>g([]),[t.symbol]);const S=o.useMemo(()=>n.slice(0,-1).map(e=>({time:e.time/1e3,open:e.open,high:e.high,low:e.low,close:e.close})),[n]),r=n[n.length-1],C=o.useMemo(()=>{if(!r)return;const e=a??r.close;return{time:r.time/1e3,open:r.open,high:Math.max(r.high,e),low:Math.min(r.low,e),close:e}},[r,a]),D=a??(r==null?void 0:r.close)??0,L=o.useMemo(()=>s>=f["1d"]?e=>new Date(e*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric"}):s>=f["1h"]?e=>{const m=new Date(e*1e3);return`${m.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${String(m.getHours()).padStart(2,"0")}h`}:e=>new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),[s]),R=o.useMemo(()=>{const e=n.map(l=>({time:l.time/1e3,value:l.close}));if(u.length===0)return e;const m=u[0].time;return[...e.filter(l=>l.time<m),...u]},[n,u]);return p&&n.length===0?i.jsx(N,{loading:!0,children:"loading chart…"}):i.jsx("div",{ref:M,className:"h-full min-h-0",children:i.jsx(T,{mode:t.mode,data:R,value:D,candles:S,candleWidth:s/1e3,liveCandle:C,window:s/1e3*w,color:t.color,theme:"dark",loading:p,formatValue:x,formatTime:L,padding:F,showValue:!0,fill:!0,pulse:!0})})}function V({config:t}){const s=t.mode==="candle",c=y(s?[t.symbol]:[])[t.symbol];return i.jsxs(i.Fragment,{children:[P(t.symbol),s&&c!==void 0&&i.jsx("span",{style:{marginInlineStart:"0.5em",color:"rgba(255, 255, 255, 0.82)",fontVariantNumeric:"tabular-nums"},children:x(c)})]})}const W=j({...v,component:I,titleIcon:({config:t})=>i.jsx(E,{symbol:t.symbol,size:14}),titleContent:V});export{W as priceChartFrame};
@@ -0,0 +1 @@
1
+ import{j as t,r as p}from"./react-qoZPGuNy.js";import{f as v,a3 as f,h as d,a4 as L,a5 as O}from"./index-DNLPQoS7.js";import{a as g,d as F}from"./format-CfAcS4D8.js";import{F as u}from"./ui-Bq3RQsdJ.js";import{a as s,C as h}from"./chart-utils-BYIZMM9J.js";import{M as T}from"./index-DK7jWlTL.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const D={"24h":{ms:1440*60*1e3,interval:"15m",timeframe:s["24h"]},"7D":{ms:10080*60*1e3,interval:"1h",timeframe:s["7D"]},"1M":{ms:720*60*60*1e3,interval:"4h",timeframe:s["1M"]}};f.schema;function E({config:e}){const{ms:m,interval:C,timeframe:M}=D[e.lookback],x=p.useMemo(()=>Date.now()-m,[m]),{candles:o,isLoading:S}=L(e.symbols,C,x),i=p.useMemo(()=>e.symbols.map((r,j)=>{var c;const n=o[r]??[],l=(c=n[0])==null?void 0:c.close;return{id:r,name:d(r),iconImageUrl:O(r),color:h[j%h.length],data:n.map(a=>({date:new Date(a.time).toISOString(),value:e.normalize&&l?(a.close/l-1)*100:a.close}))}}),[e.symbols,e.normalize,o]);return S?t.jsx(u,{loading:!0,children:"loading prices…"}):i.every(r=>r.data.length===0)?t.jsx(u,{children:"no price data yet"}):t.jsx(T,{series:i,timeframe:M,height:250,formatValue:e.normalize?g:F})}function I({config:e}){return t.jsx(t.Fragment,{children:e.symbols.map(d).join(" vs ")})}const w=v({...f,component:E,titleContent:I});export{w as priceCompareFrame};
@@ -0,0 +1 @@
1
+ import{r as o,j as u}from"./react-qoZPGuNy.js";import{L as T}from"./liveline-bcaEuskN.js";import{f as V,a6 as L,k as W,v as $,h as N,A as B}from"./index-DNLPQoS7.js";import{d as k,a as E,c as G}from"./format-CfAcS4D8.js";import{u as K,o as U}from"./live-tick-9Q3ubPF9.js";import{C as j}from"./chart-utils-BYIZMM9J.js";import"./d3-xK4fOkBU.js";const _=720,D=3,X={top:12,right:58,bottom:28,left:8};L.schema;function O(i){return i!==void 0&&Number.isFinite(i)}function q(i,s,S,m){let x=!1;const b={...i};for(const p of s){const d=S[p];if(!O(d))continue;const l=b[p]??[],g=l[l.length-1];if(g&&Math.abs(m-g.time)<.5&&g.value===d)continue;const h=l.length===0?[{time:m-D,value:d},{time:m,value:d}]:[...l,{time:m,value:d}];b[p]=h.length>_?h.slice(-_):h,x=!0}return x?b:i}function z(i,s){return s===0?0:(i/s-1)*100}function J({config:i}){const s=i.symbols,S=s.join("|"),m=W(s),x=$(s),{ref:b,visibleRef:p}=K(),d=o.useRef(!1),[l,g]=o.useState({}),[h,C]=o.useState(()=>new Set),v=o.useMemo(()=>{var n;const e={};for(const t of s){const a=m[t]??((n=x[t])==null?void 0:n.markPx);O(a)&&(e[t]=a)}return e},[m,x,s]),P=o.useRef(v);o.useEffect(()=>{P.current=v},[v]),o.useEffect(()=>{const e=new Set(s);g(n=>{let t=!1;const a={};for(const[r,f]of Object.entries(n)){if(!e.has(r)){t=!0;continue}a[r]=f}return t?a:n}),C(n=>{const t=new Set([...n].filter(a=>e.has(a)));return t.size===n.size?n:t})},[S,s]);const F=o.useCallback(e=>{C(n=>{const t=new Set(n);return t.has(e)?(t.delete(e),t):s.length-t.size<=1?n:(t.add(e),t)})},[s]),y=o.useCallback(()=>{if(!p.current){d.current=!0;return}const e=P.current;if(Object.keys(e).length===0)return;const n=Date.now()/1e3,t=d.current;d.current=!1,g(a=>q(t?{}:a,s,e,n))},[S,s,p]);o.useEffect(()=>{y()},[y,v]),o.useEffect(()=>U(y),[y]);const R=o.useMemo(()=>s.flatMap((e,n)=>{var f,c;if(h.has(e))return[];const t=l[e]??[],a=(f=t[0])==null?void 0:f.value;if(!a||t.length===0)return[];const r=i.normalize?t.map(w=>({time:w.time,value:z(w.value,a)})):t;return[{id:e,label:N(e),color:j[n%j.length],data:r,value:((c=r[r.length-1])==null?void 0:c.value)??0}]}),[l,h,s,i.normalize]),H=o.useMemo(()=>{var a,r;let e=1/0,n=-1/0;for(const f of s){const c=l[f]??[];c.length!==0&&(e=Math.min(e,((a=c[0])==null?void 0:a.time)??1/0),n=Math.max(n,((r=c[c.length-1])==null?void 0:r.time)??-1/0))}const t=Number.isFinite(e)&&Number.isFinite(n)?n-e:0;return Math.min(i.windowSec,Math.max(D,Math.ceil(t)))},[l,s,i.windowSec]),A=R.some(e=>e.data.length>1);return u.jsxs("div",{ref:b,className:"flex h-full min-h-0 flex-col",children:[u.jsx("div",{className:"grid flex-none grid-cols-1 gap-x-3 gap-y-1.5 border-b border-white/[0.06] pb-2 sm:grid-cols-2",children:s.map((e,n)=>{var w,I;const t=v[e],a=(I=(w=l[e])==null?void 0:w[0])==null?void 0:I.value,r=t!==void 0&&a?z(t,a):void 0,f=j[n%j.length],c=h.has(e);return u.jsxs("button",{type:"button","aria-pressed":!c,title:`${c?"Show":"Hide"} ${N(e)}`,className:`caption grid min-w-0 grid-cols-[auto_auto_minmax(0,1fr)_auto] items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition ${c?"opacity-40 hover:opacity-70":"bg-white/[0.035] opacity-100 hover:bg-white/[0.06]"}`,onClick:M=>{M.stopPropagation(),F(e)},onPointerDown:M=>M.stopPropagation(),children:[u.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:f}}),u.jsx(B,{symbol:e,size:14}),u.jsx("span",{className:"truncate font-bold text-strong",children:N(e)}),u.jsxs("span",{className:"text-normal tabular-nums",children:[t!==void 0?k(t):"…",r!==void 0?u.jsx("span",{className:"ml-1 tabular-nums",style:{color:G(r)},children:E(r)}):null]})]},e)})}),u.jsx("div",{className:"min-h-0 flex-1 [&>div[style*='align-items']]:!hidden",children:u.jsx(T,{data:[],value:0,series:R,theme:"dark",window:H,grid:!0,loading:!A,scrub:!1,badge:!1,formatValue:i.normalize?E:k,padding:X,seriesToggleCompact:s.length>4,style:{width:"100%",height:"100%"}})})]})}const ae=V({...L,component:J});export{ae as priceLivelineFrame};
@@ -1 +1 @@
1
- import{j as i}from"./react-qoZPGuNy.js";import{f as d,a5 as c,a6 as l,a7 as x,h as g}from"./index-C_O7gp2F.js";import{M as f}from"./mover-row-kQ9xt3Sp.js";import{F as u,s as h}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";c.schema;function k({config:e}){const{mids:t,isLoading:m}=l(e.symbols),{stats:r,isLoading:n}=x(e.symbols),p=e.symbols.some(a=>{var s;return t[a]!==void 0||((s=r[a])==null?void 0:s.markPx)!==void 0});return(m||n)&&!p?i.jsx(u,{loading:!0,children:"loading prices…"}):i.jsx("div",{className:`flex flex-col gap-1.5 ${h}`,children:e.symbols.map(a=>{var s,o;return i.jsx(f,{symbol:a,label:g(a),price:t[a]??((s=r[a])==null?void 0:s.markPx),changePct:(o=r[a])==null?void 0:o.changePct,logoSize:18,gap:"gap-3"},a)})})}const L=d({...c,component:k});export{L as priceTickerFrame};
1
+ import{j as i}from"./react-qoZPGuNy.js";import{f as d,a7 as c,a8 as l,a9 as x,h as g}from"./index-DNLPQoS7.js";import{M as f}from"./mover-row-CunANlxa.js";import{F as u,s as h}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";c.schema;function k({config:e}){const{mids:t,isLoading:m}=l(e.symbols),{stats:r,isLoading:n}=x(e.symbols),p=e.symbols.some(a=>{var s;return t[a]!==void 0||((s=r[a])==null?void 0:s.markPx)!==void 0});return(m||n)&&!p?i.jsx(u,{loading:!0,children:"loading prices…"}):i.jsx("div",{className:`flex flex-col gap-1.5 ${h}`,children:e.symbols.map(a=>{var s,o;return i.jsx(f,{symbol:a,label:g(a),price:t[a]??((s=r[a])==null?void 0:s.markPx),changePct:(o=r[a])==null?void 0:o.changePct,logoSize:18,gap:"gap-3"},a)})})}const L=d({...c,component:k});export{L as priceTickerFrame};
@@ -0,0 +1 @@
1
+ import{r as c,j as s}from"./react-qoZPGuNy.js";import{f as i}from"./format-CfAcS4D8.js";import{f as p,au as n,av as f}from"./index-DNLPQoS7.js";import{T as l,a as u}from"./treemap-leaf-DNIoJEK-.js";import{F as m}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function h({width:t,height:a,data:o}){const r=i(o.fees24h);return s.jsx(u,{width:t,height:a,label:o.id,secondary:r,title:`${o.id} · ${r} 24h fees`})}function d({config:t}){const{entries:a,isLoading:o}=f(),r=c.useMemo(()=>a.slice(0,t.topN).map(e=>({id:e.name,value:e.fees24h,fees24h:e.fees24h,changePct:e.changePct??0})),[a,t.topN]);return o?s.jsx(m,{loading:!0,children:"loading protocol fees…"}):r.length===0?s.jsx(m,{children:"no protocol fee data"}):s.jsx(l,{data:r,LeafComponent:h,getColorValue:e=>e.changePct})}const L=p({...n,component:d});export{L as protocolFeesTreemapFrame};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./react-qoZPGuNy.js";import{p as C,f as M}from"./format-CfAcS4D8.js";import{f as S,aq as f,ar as T}from"./index-C_O7gp2F.js";import{F as p}from"./ui-Bq3RQsdJ.js";import{a,C as c}from"./chart-utils-BYIZMM9J.js";import{M as v}from"./index-jnySFpSv.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const x={"7D":{ms:10080*60*1e3,timeframe:a["7D"]},"1M":{ms:720*60*60*1e3,timeframe:a["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:a["3M"]}};f.schema;function L({config:o}){const{ms:m,timeframe:u}=x[o.lookback],s=n.useMemo(()=>Date.now()-m,[m]),{history:i,isLoading:h}=T(o.protocols),l=n.useMemo(()=>o.protocols.map((t,d)=>({id:t,name:C(t),color:c[d%c.length],data:(i[t]??[]).filter(r=>r.time>=s).map(r=>({date:new Date(r.time).toISOString(),value:r.value}))})),[o.protocols,i,s]);return h?e.jsx(p,{loading:!0,children:"loading protocol TVL…"}):l.every(t=>t.data.length===0)?e.jsx(p,{children:"no protocol TVL data yet"}):e.jsx(v,{series:l,timeframe:u,height:250,formatValue:t=>M(t)})}const I=S({...f,component:L});export{I as protocolTvlChartFrame};
1
+ import{r as n,j as e}from"./react-qoZPGuNy.js";import{p as C,f as M}from"./format-CfAcS4D8.js";import{f as S,as as f,at as T}from"./index-DNLPQoS7.js";import{F as p}from"./ui-Bq3RQsdJ.js";import{a,C as c}from"./chart-utils-BYIZMM9J.js";import{M as v}from"./index-DK7jWlTL.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const x={"7D":{ms:10080*60*1e3,timeframe:a["7D"]},"1M":{ms:720*60*60*1e3,timeframe:a["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:a["3M"]}};f.schema;function L({config:o}){const{ms:m,timeframe:u}=x[o.lookback],s=n.useMemo(()=>Date.now()-m,[m]),{history:i,isLoading:h}=T(o.protocols),l=n.useMemo(()=>o.protocols.map((t,d)=>({id:t,name:C(t),color:c[d%c.length],data:(i[t]??[]).filter(r=>r.time>=s).map(r=>({date:new Date(r.time).toISOString(),value:r.value}))})),[o.protocols,i,s]);return h?e.jsx(p,{loading:!0,children:"loading protocol TVL…"}):l.every(t=>t.data.length===0)?e.jsx(p,{children:"no protocol TVL data yet"}):e.jsx(v,{series:l,timeframe:u,height:250,formatValue:M})}const I=S({...f,component:L});export{I as protocolTvlChartFrame};
@@ -0,0 +1 @@
1
+ import{r as n,j as m}from"./react-qoZPGuNy.js";import{f as c}from"./format-CfAcS4D8.js";import{f as i,aq as l,ar as p}from"./index-DNLPQoS7.js";import{T as f,a as u}from"./treemap-leaf-DNIoJEK-.js";import{F as s}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";l.schema;function T({width:r,height:a,data:e}){const t=c(e.tvl);return m.jsx(u,{width:r,height:a,label:e.id,secondary:t,title:`${e.id} · ${t} TVL`})}function d({config:r}){const{entries:a,isLoading:e}=p(),t=n.useMemo(()=>a.slice(0,r.topN).map(o=>({id:o.name,value:o.tvl,tvl:o.tvl,changePct:o.changePct??0})),[a,r.topN]);return e?m.jsx(s,{loading:!0,children:"loading protocol TVL…"}):t.length===0?m.jsx(s,{children:"no protocol TVL data"}):m.jsx(f,{data:t,LeafComponent:T,getColorValue:o=>o.changePct})}const C=i({...l,component:d});export{C as protocolTvlTreemapFrame};
@@ -1 +1 @@
1
- import{r as s,j as t}from"./react-qoZPGuNy.js";import{f as u,aF as i}from"./index-C_O7gp2F.js";i.schema;const c="var(--color-highlight)";function d({config:a}){const e=a.quotes,[r,l]=s.useState(0);s.useEffect(()=>l(0),[a.quotes]),s.useEffect(()=>{if(a.intervalSec<=0||e.length<=1)return;const o=window.setInterval(()=>l(n=>(n+1)%e.length),a.intervalSec*1e3);return()=>window.clearInterval(o)},[a.intervalSec,e.length]);const m=e[Math.min(r,e.length-1)]??"";return t.jsx("div",{className:"flex h-full w-full items-center justify-center [container-type:size]",children:t.jsxs("figure",{className:"relative max-h-full overflow-auto px-3 text-center",children:[t.jsx("span",{"aria-hidden":!0,className:"block font-dmsans font-black leading-none",style:{fontSize:"clamp(1.5rem, 14cqmin, 3rem)",color:c},children:"“"}),t.jsx("blockquote",{className:"body-md text-normal -mt-[0.3em] whitespace-pre-wrap italic leading-snug",style:{fontSize:"clamp(0.85rem, 8cqmin, 1.25rem)"},children:m}),e.length>1&&t.jsx("figcaption",{className:"mt-2 flex justify-center gap-1.5","aria-hidden":!0,children:e.map((o,n)=>t.jsx("span",{className:"h-1 w-1 rounded-full transition-colors",style:{background:n===Math.min(r,e.length-1)?c:"var(--color-disabled)"}},n))})]})})}const x=u({...i,component:d});export{x as quoteFrame};
1
+ import{r as s,j as t}from"./react-qoZPGuNy.js";import{f as u,aH as i}from"./index-DNLPQoS7.js";i.schema;const c="var(--color-highlight)";function d({config:a}){const e=a.quotes,[r,l]=s.useState(0);s.useEffect(()=>l(0),[a.quotes]),s.useEffect(()=>{if(a.intervalSec<=0||e.length<=1)return;const o=window.setInterval(()=>l(n=>(n+1)%e.length),a.intervalSec*1e3);return()=>window.clearInterval(o)},[a.intervalSec,e.length]);const m=e[Math.min(r,e.length-1)]??"";return t.jsx("div",{className:"flex h-full w-full items-center justify-center [container-type:size]",children:t.jsxs("figure",{className:"relative max-h-full overflow-auto px-3 text-center",children:[t.jsx("span",{"aria-hidden":!0,className:"block font-dmsans font-black leading-none",style:{fontSize:"clamp(1.5rem, 14cqmin, 3rem)",color:c},children:"“"}),t.jsx("blockquote",{className:"body-md text-normal -mt-[0.3em] whitespace-pre-wrap italic leading-snug",style:{fontSize:"clamp(0.85rem, 8cqmin, 1.25rem)"},children:m}),e.length>1&&t.jsx("figcaption",{className:"mt-2 flex justify-center gap-1.5","aria-hidden":!0,children:e.map((o,n)=>t.jsx("span",{className:"h-1 w-1 rounded-full transition-colors",style:{background:n===Math.min(r,e.length-1)?c:"var(--color-disabled)"}},n))})]})})}const x=u({...i,component:d});export{x as quoteFrame};
@@ -1 +1 @@
1
- import{j as e}from"./react-qoZPGuNy.js";import{b as a,f as g}from"./format-CfAcS4D8.js";import{M as v}from"./metric-row-BVVhjsjK.js";import{f as j,a8 as f,a9 as R,aa as y}from"./index-C_O7gp2F.js";import{F as m}from"./ui-Bq3RQsdJ.js";f.schema;function b({config:t}){var c,d;const{rates:i,isLoading:x}=R(),{rates:o,isLoading:u}=y();if(x&&u)return e.jsx(m,{loading:!0,children:"loading official rates…"});if(!i.length&&!o.length)return e.jsx(m,{children:"no rates data yet"});const n=i.slice(0,t.maxReferenceRates),r=o.slice(0,t.maxTreasuryRates),l=(c=n[0])==null?void 0:c.date,h=(d=r[0])==null?void 0:d.date;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"official rates"}),e.jsx("div",{className:"body-sm text-normal",children:l?`as of ${l}`:"reference rates"})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n.map(s=>{const p=s.targetRateFrom!==void 0&&s.targetRateTo!==void 0?`target ${a(s.targetRateFrom)}-${a(s.targetRateTo)}`:s.volumeInBillions!==void 0?`${g(s.volumeInBillions*1e9)} volume`:s.source;return e.jsx(v,{label:s.label,value:a(s.rate),meta:p},s.code)})}),t.showTreasuryAverageRates&&r.length>0&&e.jsxs("div",{className:"border-t border-white/[0.08] pt-2",children:[e.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[e.jsx("span",{children:"Treasury average rates"}),e.jsx("span",{children:h})]}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:r.map(s=>e.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[e.jsx("div",{className:"caption text-soft truncate",children:s.security}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(s.rate)})]},`${s.date}-${s.security}`))})]})]})}const B=j({...f,component:b});export{B as ratesBoardFrame};
1
+ import{j as e}from"./react-qoZPGuNy.js";import{b as a,f as g}from"./format-CfAcS4D8.js";import{M as v}from"./metric-row-BVVhjsjK.js";import{f as j,aa as f,ab as R,ac as y}from"./index-DNLPQoS7.js";import{F as m}from"./ui-Bq3RQsdJ.js";f.schema;function b({config:t}){var l,d;const{rates:i,isLoading:x}=R(),{rates:o,isLoading:u}=y();if(x&&u)return e.jsx(m,{loading:!0,children:"loading official rates…"});if(!i.length&&!o.length)return e.jsx(m,{children:"no rates data yet"});const n=i.slice(0,t.maxReferenceRates),r=o.slice(0,t.maxTreasuryRates),c=(l=n[0])==null?void 0:l.date,h=(d=r[0])==null?void 0:d.date;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"official rates"}),e.jsx("div",{className:"body-sm text-normal",children:c?`as of ${c}`:"reference rates"})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n.map(s=>{const p=s.targetRateFrom!==void 0&&s.targetRateTo!==void 0?`target ${a(s.targetRateFrom)}-${a(s.targetRateTo)}`:s.volumeInBillions!==void 0?`${g(s.volumeInBillions*1e9)} volume`:s.source;return e.jsx(v,{label:s.label,value:a(s.rate),meta:p},s.code)})}),t.showTreasuryAverageRates&&r.length>0&&e.jsxs("div",{className:"border-t border-white/[0.08] pt-2",children:[e.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[e.jsx("span",{children:"Treasury average rates"}),e.jsx("span",{children:h})]}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:r.map(s=>e.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[e.jsx("div",{className:"caption text-soft truncate",children:s.security}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(s.rate)})]},`${s.date}-${s.security}`))})]})]})}const B=j({...f,component:b});export{B as ratesBoardFrame};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./react-qoZPGuNy.js";import{i as y}from"./content-shared-BZ1XzrJx.js";import{f as g,a as k,c as w}from"./format-CfAcS4D8.js";import{f as F,b7 as b}from"./index-C_O7gp2F.js";import{M as R}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";b.schema;function o({label:s,value:t,onChange:l}){return e.jsxs("label",{className:`flex flex-col gap-0.5 px-2 py-1 ${y}`,children:[e.jsx("span",{className:"caption text-soft truncate",children:s}),e.jsx("input",{type:"number",value:Number.isFinite(t)?t:0,onChange:a=>l(Number(a.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]})}function E({config:s}){const[t,l]=n.useState(s.principal),[a,j]=n.useState(s.ratePct),[c,v]=n.useState(s.periods),[i,N]=n.useState(s.contribution),{series:C,ending:P,contributed:p,gain:d}=n.useMemo(()=>{const M=a/100,S=Math.max(0,Math.min(600,Math.floor(c))),f=[{date:"0",value:t}];let r=t,m=t;for(let u=1;u<=S;u++)r=r*(1+M)+i,m+=i,f.push({date:String(u),value:r});return{series:f,ending:r,contributed:m,gain:r-m}},[t,a,c,i]),x=p>0?d/p*100:0,h=s.label.trim();return e.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[h&&e.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:h}),e.jsxs("div",{className:"shrink-0",children:[e.jsx("div",{className:"caption text-soft",children:"projected value"}),e.jsx("div",{className:"metric-lg text-strong",children:g(P)}),e.jsxs("div",{className:"body-sm",style:{color:w(x)},children:[k(x)," · ",g(d)," gain"]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(R,{data:C,width:260,height:48,variant:"green",className:"w-full"})}),e.jsxs("div",{className:"grid shrink-0 grid-cols-2 gap-1.5",children:[e.jsx(o,{label:"principal",value:t,onChange:l}),e.jsx(o,{label:"rate %/period",value:a,onChange:j}),e.jsx(o,{label:"periods",value:c,onChange:v}),e.jsx(o,{label:"contribution",value:i,onChange:N})]})]})}const D=F({...b,component:E});export{D as returnsProjectorFrame};
1
+ import{r as n,j as e}from"./react-qoZPGuNy.js";import{i as y}from"./content-shared-BZ1XzrJx.js";import{f as g,a as k,c as w}from"./format-CfAcS4D8.js";import{f as F,b9 as b}from"./index-DNLPQoS7.js";import{M as R}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";b.schema;function o({label:s,value:t,onChange:l}){return e.jsxs("label",{className:`flex flex-col gap-0.5 px-2 py-1 ${y}`,children:[e.jsx("span",{className:"caption text-soft truncate",children:s}),e.jsx("input",{type:"number",value:Number.isFinite(t)?t:0,onChange:a=>l(Number(a.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]})}function E({config:s}){const[t,l]=n.useState(s.principal),[a,j]=n.useState(s.ratePct),[c,v]=n.useState(s.periods),[i,N]=n.useState(s.contribution),{series:C,ending:P,contributed:p,gain:d}=n.useMemo(()=>{const M=a/100,S=Math.max(0,Math.min(600,Math.floor(c))),f=[{date:"0",value:t}];let r=t,m=t;for(let u=1;u<=S;u++)r=r*(1+M)+i,m+=i,f.push({date:String(u),value:r});return{series:f,ending:r,contributed:m,gain:r-m}},[t,a,c,i]),x=p>0?d/p*100:0,h=s.label.trim();return e.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[h&&e.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:h}),e.jsxs("div",{className:"shrink-0",children:[e.jsx("div",{className:"caption text-soft",children:"projected value"}),e.jsx("div",{className:"metric-lg text-strong",children:g(P)}),e.jsxs("div",{className:"body-sm",style:{color:w(x)},children:[k(x)," · ",g(d)," gain"]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(R,{data:C,width:260,height:48,variant:"green",className:"w-full"})}),e.jsxs("div",{className:"grid shrink-0 grid-cols-2 gap-1.5",children:[e.jsx(o,{label:"principal",value:t,onChange:l}),e.jsx(o,{label:"rate %/period",value:a,onChange:j}),e.jsx(o,{label:"periods",value:c,onChange:v}),e.jsx(o,{label:"contribution",value:i,onChange:N})]})]})}const D=F({...b,component:E});export{D as returnsProjectorFrame};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./react-qoZPGuNy.js";import{i as S}from"./content-shared-BZ1XzrJx.js";import{D as h,U as f,a as y,d as v}from"./format-CfAcS4D8.js";import{f as M,aJ as R}from"./index-C_O7gp2F.js";import{s as O}from"./ui-Bq3RQsdJ.js";R.schema;const P="var(--color-highlight)";function b(s){const a=Number(s);return Number.isFinite(a)?a:0}function g({label:s,value:a,onChange:n}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:s}),e.jsxs("span",{className:`flex items-center px-2 py-1.5 ${S}`,children:[e.jsx("span",{className:"body-sm text-soft",children:"$"}),e.jsx("input",{type:"number",inputMode:"decimal",value:a,onChange:c=>n(c.target.value),className:"body-sm text-normal min-w-0 flex-1 bg-transparent text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})]})]})}function L({value:s,onChange:a}){return e.jsx("div",{className:`flex gap-1 p-1 ${S}`,children:["long","short"].map(n=>{const c=n===s;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`caption flex-1 rounded px-2 py-1 text-center uppercase tracking-[0.12em] transition-colors ${c?"bg-white/[0.06] font-semibold":"text-soft"}`,style:c?{color:P}:void 0,children:n},n)})})}function T({config:s}){const[a,n]=l.useState(String(s.entry)),[c,j]=l.useState(String(s.stop)),[m,N]=l.useState(String(s.target)),[o,k]=l.useState(s.direction);l.useEffect(()=>n(String(s.entry)),[s.entry]),l.useEffect(()=>j(String(s.stop)),[s.stop]),l.useEffect(()=>N(String(s.target)),[s.target]),l.useEffect(()=>k(s.direction),[s.direction]);const t=l.useMemo(()=>{const r=b(a),p=b(c),x=b(m),i=Math.abs(r-p),d=Math.abs(x-r),D=i>0?d/i:0,E=r!==0?i/r*100:0,$=r!==0?d/r*100:0,u=i+d,U=u>0?i/u*100:50,F=o==="long"?p<r&&r<x:x<r&&r<p;return{riskPerUnit:i,rewardPerUnit:d,rr:D,riskPct:E,rewardPct:$,riskShare:U,hasRisk:i>0,hasData:u>0,valid:F}},[a,c,m,o]),C=t.hasData?t.hasRisk?`1 : ${t.rr.toFixed(t.rr>=10?0:1)}`:"∞":"—",w=s.label.trim();return e.jsxs("div",{className:`${O} flex flex-col gap-3`,children:[w&&e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:w}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(g,{label:"Entry",value:a,onChange:n}),e.jsx(g,{label:"Stop",value:c,onChange:j}),e.jsx(g,{label:"Target",value:m,onChange:N})]}),e.jsx(L,{value:o,onChange:k}),e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Risk : Reward"}),e.jsx("span",{className:"metric-md",style:{color:t.hasData?P:void 0},children:C})]}),e.jsxs("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-white/[0.06]",children:[e.jsx("span",{className:"h-full",style:{width:`${t.riskShare}%`,background:h}}),e.jsx("span",{className:"h-full",style:{width:`${100-t.riskShare}%`,background:f}})]}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:h},children:"Risk"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:h},children:y(-t.riskPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.riskPerUnit)," / unit"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-end text-right",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:f},children:"Reward"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:f},children:y(t.rewardPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.rewardPerUnit)," / unit"]})]})]}),t.hasData&&!t.valid&&e.jsxs("span",{className:"caption text-soft",children:["⚠ Prices don't bracket entry for a ",o," setup."]})]})]})}const z=M({...R,component:T});export{z as riskRewardFrame};
1
+ import{r as l,j as e}from"./react-qoZPGuNy.js";import{i as S}from"./content-shared-BZ1XzrJx.js";import{D as h,U as f,a as y,d as v}from"./format-CfAcS4D8.js";import{f as M,aL as R}from"./index-DNLPQoS7.js";import{s as O}from"./ui-Bq3RQsdJ.js";R.schema;const P="var(--color-highlight)";function b(s){const a=Number(s);return Number.isFinite(a)?a:0}function g({label:s,value:a,onChange:n}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:s}),e.jsxs("span",{className:`flex items-center px-2 py-1.5 ${S}`,children:[e.jsx("span",{className:"body-sm text-soft",children:"$"}),e.jsx("input",{type:"number",inputMode:"decimal",value:a,onChange:c=>n(c.target.value),className:"body-sm text-normal min-w-0 flex-1 bg-transparent text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})]})]})}function L({value:s,onChange:a}){return e.jsx("div",{className:`flex gap-1 p-1 ${S}`,children:["long","short"].map(n=>{const c=n===s;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`caption flex-1 rounded px-2 py-1 text-center uppercase tracking-[0.12em] transition-colors ${c?"bg-white/[0.06] font-semibold":"text-soft"}`,style:c?{color:P}:void 0,children:n},n)})})}function T({config:s}){const[a,n]=l.useState(String(s.entry)),[c,j]=l.useState(String(s.stop)),[m,N]=l.useState(String(s.target)),[o,k]=l.useState(s.direction);l.useEffect(()=>n(String(s.entry)),[s.entry]),l.useEffect(()=>j(String(s.stop)),[s.stop]),l.useEffect(()=>N(String(s.target)),[s.target]),l.useEffect(()=>k(s.direction),[s.direction]);const t=l.useMemo(()=>{const r=b(a),p=b(c),x=b(m),i=Math.abs(r-p),d=Math.abs(x-r),D=i>0?d/i:0,E=r!==0?i/r*100:0,$=r!==0?d/r*100:0,u=i+d,U=u>0?i/u*100:50,F=o==="long"?p<r&&r<x:x<r&&r<p;return{riskPerUnit:i,rewardPerUnit:d,rr:D,riskPct:E,rewardPct:$,riskShare:U,hasRisk:i>0,hasData:u>0,valid:F}},[a,c,m,o]),C=t.hasData?t.hasRisk?`1 : ${t.rr.toFixed(t.rr>=10?0:1)}`:"∞":"—",w=s.label.trim();return e.jsxs("div",{className:`${O} flex flex-col gap-3`,children:[w&&e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:w}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(g,{label:"Entry",value:a,onChange:n}),e.jsx(g,{label:"Stop",value:c,onChange:j}),e.jsx(g,{label:"Target",value:m,onChange:N})]}),e.jsx(L,{value:o,onChange:k}),e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Risk : Reward"}),e.jsx("span",{className:"metric-md",style:{color:t.hasData?P:void 0},children:C})]}),e.jsxs("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-white/[0.06]",children:[e.jsx("span",{className:"h-full",style:{width:`${t.riskShare}%`,background:h}}),e.jsx("span",{className:"h-full",style:{width:`${100-t.riskShare}%`,background:f}})]}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:h},children:"Risk"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:h},children:y(-t.riskPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.riskPerUnit)," / unit"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-end text-right",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:f},children:"Reward"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:f},children:y(t.rewardPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.rewardPerUnit)," / unit"]})]})]}),t.hasData&&!t.valid&&e.jsxs("span",{className:"caption text-soft",children:["⚠ Prices don't bracket entry for a ",o," setup."]})]})]})}const B=M({...R,component:T});export{B as riskRewardFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{f as m,bb as n}from"./index-C_O7gp2F.js";import{F as i,s as o}from"./ui-Bq3RQsdJ.js";n.schema;function c({config:l}){const r=l.rules.filter(e=>e.trim()),a=l.title.trim();return r.length===0?s.jsx(i,{children:"no rules yet"}):s.jsxs("div",{className:"flex h-full w-full flex-col",children:[a&&s.jsx("div",{className:"body-sm text-strong mb-1 shrink-0 font-semibold",children:a}),s.jsx("ol",{className:`min-h-0 flex-1 ${o}`,children:r.map((e,t)=>s.jsxs("li",{className:"flex gap-2 py-1",children:[s.jsx("span",{className:"caption text-highlight shrink-0 tabular-nums",children:t+1}),s.jsx("span",{className:"body-sm text-normal",children:e})]},t))})]})}const u=m({...n,component:c});export{u as rulesCardFrame};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{f as m,bd as n}from"./index-DNLPQoS7.js";import{F as i,s as o}from"./ui-Bq3RQsdJ.js";n.schema;function c({config:l}){const r=l.rules.filter(e=>e.trim()),a=l.title.trim();return r.length===0?s.jsx(i,{children:"no rules yet"}):s.jsxs("div",{className:"flex h-full w-full flex-col",children:[a&&s.jsx("div",{className:"body-sm text-strong mb-1 shrink-0 font-semibold",children:a}),s.jsx("ol",{className:`min-h-0 flex-1 ${o}`,children:r.map((e,t)=>s.jsxs("li",{className:"flex gap-2 py-1",children:[s.jsx("span",{className:"caption text-highlight shrink-0 tabular-nums",children:t+1}),s.jsx("span",{className:"body-sm text-normal",children:e})]},t))})]})}const u=m({...n,component:c});export{u as rulesCardFrame};
@@ -1 +1 @@
1
- import{r as d,j as e}from"./react-qoZPGuNy.js";import{E as u,e as w,f as h}from"./market-data-CvmpLFSo.js";import{f as N,aL as f}from"./index-C_O7gp2F.js";import{F as v}from"./ui-Bq3RQsdJ.js";f.schema;function x(s){const[o,r]=s.split(":").map(Number);return o*60+r}function b(s){return Math.min(1,Math.max(0,s))}function M({config:s}){const[o,r]=d.useState(()=>new Date);d.useEffect(()=>{const j=setInterval(()=>r(new Date),3e4);return()=>clearInterval(j)},[]);const n=u[s.exchange]??u.NYSE;if(!n)return e.jsx(v,{children:"unknown exchange"});const t=w(n,o),a=t.status==="open",c=s.label.trim(),l=x(t.close)-x(t.open),i=a&&l>0?b((l-t.nextChangeMin)/l):0,p=Math.round(i*100),g=t.status==="holiday"?"Holiday":a?`${p}%`:"Closed",m=a?`closes in ${h(t.nextChangeMin)}`:s.showCountdown?`opens in ${h(t.nextChangeMin)}`:null;return e.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2",children:[e.jsxs("div",{className:"caption text-soft flex items-center gap-1.5 uppercase tracking-[0.14em]",children:[e.jsx("span",{className:"text-normal font-semibold",children:n.mark}),e.jsx("span",{children:n.code}),c&&e.jsxs("span",{className:"text-disabled truncate tracking-normal normal-case",children:["· ",c]})]}),e.jsx("div",{className:`metric-md leading-none ${a?"text-strong":"text-soft"}`,children:g}),e.jsx("div",{className:"bg-surface h-2 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${i*100}%`,background:"var(--color-highlight)"}})}),m&&e.jsx("div",{className:"caption text-soft",children:m})]})}const $=N({...f,component:M});export{$ as sessionProgressFrame};
1
+ import{r as d,j as e}from"./react-qoZPGuNy.js";import{E as u,e as w,f as h}from"./market-data-CvmpLFSo.js";import{f as N,aN as f}from"./index-DNLPQoS7.js";import{F as v}from"./ui-Bq3RQsdJ.js";f.schema;function x(s){const[o,r]=s.split(":").map(Number);return o*60+r}function b(s){return Math.min(1,Math.max(0,s))}function M({config:s}){const[o,r]=d.useState(()=>new Date);d.useEffect(()=>{const j=setInterval(()=>r(new Date),3e4);return()=>clearInterval(j)},[]);const n=u[s.exchange]??u.NYSE;if(!n)return e.jsx(v,{children:"unknown exchange"});const t=w(n,o),a=t.status==="open",c=s.label.trim(),l=x(t.close)-x(t.open),i=a&&l>0?b((l-t.nextChangeMin)/l):0,p=Math.round(i*100),g=t.status==="holiday"?"Holiday":a?`${p}%`:"Closed",m=a?`closes in ${h(t.nextChangeMin)}`:s.showCountdown?`opens in ${h(t.nextChangeMin)}`:null;return e.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2",children:[e.jsxs("div",{className:"caption text-soft flex items-center gap-1.5 uppercase tracking-[0.14em]",children:[e.jsx("span",{className:"text-normal font-semibold",children:n.mark}),e.jsx("span",{children:n.code}),c&&e.jsxs("span",{className:"text-disabled truncate tracking-normal normal-case",children:["· ",c]})]}),e.jsx("div",{className:`metric-md leading-none ${a?"text-strong":"text-soft"}`,children:g}),e.jsx("div",{className:"bg-surface h-2 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${i*100}%`,background:"var(--color-highlight)"}})}),m&&e.jsx("div",{className:"caption text-soft",children:m})]})}const $=N({...f,component:M});export{$ as sessionProgressFrame};
@@ -1 +1 @@
1
- import{r as u,j as s}from"./react-qoZPGuNy.js";import{f as x,ad as h,ae as f,A as p}from"./index-C_O7gp2F.js";import{b,e as i}from"./format-CfAcS4D8.js";import{F as c,s as j}from"./ui-Bq3RQsdJ.js";h.schema;const d=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function y({symbol:e,entry:o}){const l=e.includes(":")?e:`xyz:${o.symbol}`,r=Math.max(0,Math.min(100,o.shortPct));return s.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[s.jsx(p,{symbol:l,size:20}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:o.symbol}),s.jsx("span",{className:"body-md text-strong font-bold tabular-nums",children:b(r,1)})]}),s.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:d(.85),boxShadow:`0 0 8px ${d(.5)}`}})}),s.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",i(o.shortVolume)," /"," ",i(o.totalVolume)]})]})]})}function v({config:e}){const{data:o,isLoading:l}=f(e.symbols),r=u.useMemo(()=>{const a=e.symbols.map(t=>({symbol:t,entry:o[t]})).filter(t=>!!t.entry);return a.sort((t,n)=>e.sort==="symbol"?t.entry.symbol.localeCompare(n.entry.symbol):e.sort==="volume"?n.entry.totalVolume-t.entry.totalVolume:n.entry.shortPct-t.entry.shortPct),a},[o,e.symbols,e.sort]);if(l)return s.jsx(c,{loading:!0,children:"loading short volume…"});if(r.length===0)return s.jsx(c,{children:"no FINRA short-volume data yet"});const m=r[0].entry.date;return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),s.jsx("div",{className:"body-sm text-normal",children:m?`FINRA · ${m}`:"FINRA"})]}),s.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",s.jsx("br",{}),"not short interest"]})]}),s.jsx("div",{className:j,children:r.map(({symbol:a,entry:t})=>s.jsx(y,{symbol:a,entry:t},a))})]})}const F=x({...h,component:v});export{F as shortVolumeFrame};
1
+ import{r as u,j as s}from"./react-qoZPGuNy.js";import{f as x,af as h,ag as f,A as p}from"./index-DNLPQoS7.js";import{b,e as i}from"./format-CfAcS4D8.js";import{F as c,s as j}from"./ui-Bq3RQsdJ.js";h.schema;const d=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function y({symbol:e,entry:o}){const l=e.includes(":")?e:`xyz:${o.symbol}`,r=Math.max(0,Math.min(100,o.shortPct));return s.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[s.jsx(p,{symbol:l,size:20}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:o.symbol}),s.jsx("span",{className:"body-md text-strong font-bold tabular-nums",children:b(r,1)})]}),s.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:d(.85),boxShadow:`0 0 8px ${d(.5)}`}})}),s.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",i(o.shortVolume)," /"," ",i(o.totalVolume)]})]})]})}function v({config:e}){const{data:o,isLoading:l}=f(e.symbols),r=u.useMemo(()=>{const a=e.symbols.map(t=>({symbol:t,entry:o[t]})).filter(t=>!!t.entry);return a.sort((t,n)=>e.sort==="symbol"?t.entry.symbol.localeCompare(n.entry.symbol):e.sort==="volume"?n.entry.totalVolume-t.entry.totalVolume:n.entry.shortPct-t.entry.shortPct),a},[o,e.symbols,e.sort]);if(l)return s.jsx(c,{loading:!0,children:"loading short volume…"});if(r.length===0)return s.jsx(c,{children:"no FINRA short-volume data yet"});const m=r[0].entry.date;return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),s.jsx("div",{className:"body-sm text-normal",children:m?`FINRA · ${m}`:"FINRA"})]}),s.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",s.jsx("br",{}),"not short interest"]})]}),s.jsx("div",{className:j,children:r.map(({symbol:a,entry:t})=>s.jsx(y,{symbol:a,entry:t},a))})]})}const F=x({...h,component:v});export{F as shortVolumeFrame};
@@ -1 +1 @@
1
- import{r as a,j as L}from"./react-qoZPGuNy.js";import{a as H,G as M,d as I}from"./game-ui-Dy_QYsPr.js";import{f as j,ay as z}from"./index-C_O7gp2F.js";import"./format-CfAcS4D8.js";const g=18,P=14,W=0,N={snakeHead:"rgba(255, 255, 255, 0.95)",food:"hsla(347, 100%, 62%, 1)"};function O(s,r,l,u,f){s.fillStyle=u,s.fillRect(r.originX+l.x*g+f,r.originY+l.y*g+f,g-f*2,g-f*2)}function q(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),O(r,l,l.food,N.food,3),l.snake.forEach((d,C)=>O(r,l,d,C===0?N.snakeHead:y,2)),I(s,r,u,f,y)}function X(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),r.textAlign="center",l==="idle"?(r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText("Arrow keys or swipe to start",s.width/2,s.height/2)):(r.fillStyle=M.gameOver,r.font='bold 20px "DM Sans", sans-serif',r.fillText("GAME OVER",s.width/2,s.height/2-30),r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText(`Score: ${u}`,s.width/2,s.height/2),r.fillStyle=M.textSoft,r.fillText("Press an arrow or tap to play again",s.width/2,s.height/2+28)),r.textAlign="left",I(s,r,u,f,y)}function v(){const s=a.useRef(null),r=a.useRef(null),[l,u]=a.useState("idle"),[f,y]=a.useState(0),[d,C]=a.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-snake-high-score");return e?parseInt(e,10):0}return 0}),[,K]=a.useState(!1),h=a.useRef(0),S=a.useRef(d),x=a.useRef(l),A=a.useRef(null),b=a.useRef(H(null));a.useEffect(()=>{S.current=d,d>0&&localStorage.setItem("zframes-snake-high-score",String(d))},[d]),a.useEffect(()=>{x.current=l},[l]);const w=a.useRef({snake:[],dir:{x:1,y:0},pendingDir:{x:1,y:0},food:{x:0,y:0},cols:0,rows:0,originX:0,originY:0,stepCounter:0}),D=a.useCallback(()=>{const e=w.current;if(e.cols<=0||e.rows<=0)return;let t,o=0;do t={x:Math.floor(Math.random()*e.cols),y:Math.floor(Math.random()*e.rows)},o++;while(e.snake.some(i=>i.x===t.x&&i.y===t.y)&&o<400);e.food=t},[]),T=a.useCallback(()=>{const e=w.current,t=Math.floor(e.cols/2),o=Math.floor(e.rows/2);e.snake=[{x:t,y:o},{x:t-1,y:o},{x:t-2,y:o}],e.dir={x:1,y:0},e.pendingDir={x:1,y:0},e.stepCounter=0,D(),h.current=0,y(0)},[D]),p=a.useCallback(()=>{w.current.cols<=0||(T(),u("playing"))},[T]),m=a.useCallback((e,t)=>{const o=w.current;o.dir.x===-e&&o.dir.y===-t||(o.pendingDir={x:e,y:t})},[]);a.useEffect(()=>{const e=o=>{const i=o.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)return;const c=x.current==="playing";let n=!0;switch(o.code){case"ArrowUp":case"KeyW":c?m(0,-1):p();break;case"ArrowDown":case"KeyS":c?m(0,1):p();break;case"ArrowLeft":case"KeyA":c?m(-1,0):p();break;case"ArrowRight":case"KeyD":c?m(1,0):p();break;case"Space":c||p();break;default:n=!1}n&&o.preventDefault()},t=r.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[m,p]),a.useLayoutEffect(()=>{const e=s.current;if(!e)return;const t=()=>{const i=e.parentElement;if(i&&i.clientWidth>0&&i.clientHeight>0){e.width=i.clientWidth,e.height=i.clientHeight-W,b.current=H(e);const c=w.current;c.cols=Math.max(5,Math.floor(e.width/g)),c.rows=Math.max(5,Math.floor(e.height/g)),c.originX=Math.floor((e.width-c.cols*g)/2),c.originY=Math.floor((e.height-c.rows*g)/2);const n=e.getContext("2d");n&&x.current!=="playing"&&X(e,n,x.current,h.current,S.current,b.current),K(E=>!E)}};t();const o=new ResizeObserver(t);return o.observe(e.parentElement),()=>o.disconnect()},[]),a.useEffect(()=>{if(l!=="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");if(!e||!t)return;let o;const i=()=>{h.current>S.current&&(S.current=h.current,C(h.current)),u("gameover")},c=()=>{const n=w.current;if(n.stepCounter++,n.stepCounter>=P){n.stepCounter=0,n.dir=n.pendingDir;const E=n.snake[0],k=E.x+n.dir.x,R=E.y+n.dir.y;if(k<0||R<0||k>=n.cols||R>=n.rows){i();return}const G=k===n.food.x&&R===n.food.y;if((G?n.snake:n.snake.slice(0,-1)).some(F=>F.x===k&&F.y===R)){i();return}n.snake.unshift({x:k,y:R}),G?(h.current+=1,y(h.current),D()):n.snake.pop()}q(e,t,n,h.current,S.current,b.current),o=requestAnimationFrame(c)};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[l]),a.useEffect(()=>{if(l==="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");!e||!t||X(e,t,l,f,d,b.current)},[l,f,d]);const U=e=>{const t=e.touches[0];t&&(A.current={x:t.clientX,y:t.clientY})},Y=e=>{var n;const t=A.current;A.current=null;const o=e.changedTouches[0];if((n=r.current)==null||n.focus(),x.current!=="playing"){p();return}if(!t||!o)return;const i=o.clientX-t.x,c=o.clientY-t.y;Math.abs(i)<12&&Math.abs(c)<12||(Math.abs(i)>Math.abs(c)?m(i>0?1:-1,0):m(0,c>0?1:-1))};return L.jsx("div",{ref:r,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onTouchStart:U,onTouchEnd:Y,onClick:()=>{var e;return(e=r.current)==null?void 0:e.focus()},role:"application","aria-label":"Snake game. Use the arrow keys or swipe to steer.",children:L.jsx("canvas",{ref:s,className:"h-full w-full"})})}const Q=j({...z,component:v});export{Q as snakeFrame};
1
+ import{r as a,j as L}from"./react-qoZPGuNy.js";import{a as H,G as M,d as I}from"./game-ui-Dy_QYsPr.js";import{f as j,aA as z}from"./index-DNLPQoS7.js";import"./format-CfAcS4D8.js";const g=18,P=14,W=0,N={snakeHead:"rgba(255, 255, 255, 0.95)",food:"hsla(347, 100%, 62%, 1)"};function O(s,r,l,u,f){s.fillStyle=u,s.fillRect(r.originX+l.x*g+f,r.originY+l.y*g+f,g-f*2,g-f*2)}function q(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),O(r,l,l.food,N.food,3),l.snake.forEach((d,C)=>O(r,l,d,C===0?N.snakeHead:y,2)),I(s,r,u,f,y)}function X(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),r.textAlign="center",l==="idle"?(r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText("Arrow keys or swipe to start",s.width/2,s.height/2)):(r.fillStyle=M.gameOver,r.font='bold 20px "DM Sans", sans-serif',r.fillText("GAME OVER",s.width/2,s.height/2-30),r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText(`Score: ${u}`,s.width/2,s.height/2),r.fillStyle=M.textSoft,r.fillText("Press an arrow or tap to play again",s.width/2,s.height/2+28)),r.textAlign="left",I(s,r,u,f,y)}function v(){const s=a.useRef(null),r=a.useRef(null),[l,u]=a.useState("idle"),[f,y]=a.useState(0),[d,C]=a.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-snake-high-score");return e?parseInt(e,10):0}return 0}),[,K]=a.useState(!1),h=a.useRef(0),S=a.useRef(d),x=a.useRef(l),A=a.useRef(null),b=a.useRef(H(null));a.useEffect(()=>{S.current=d,d>0&&localStorage.setItem("zframes-snake-high-score",String(d))},[d]),a.useEffect(()=>{x.current=l},[l]);const w=a.useRef({snake:[],dir:{x:1,y:0},pendingDir:{x:1,y:0},food:{x:0,y:0},cols:0,rows:0,originX:0,originY:0,stepCounter:0}),D=a.useCallback(()=>{const e=w.current;if(e.cols<=0||e.rows<=0)return;let t,o=0;do t={x:Math.floor(Math.random()*e.cols),y:Math.floor(Math.random()*e.rows)},o++;while(e.snake.some(i=>i.x===t.x&&i.y===t.y)&&o<400);e.food=t},[]),T=a.useCallback(()=>{const e=w.current,t=Math.floor(e.cols/2),o=Math.floor(e.rows/2);e.snake=[{x:t,y:o},{x:t-1,y:o},{x:t-2,y:o}],e.dir={x:1,y:0},e.pendingDir={x:1,y:0},e.stepCounter=0,D(),h.current=0,y(0)},[D]),p=a.useCallback(()=>{w.current.cols<=0||(T(),u("playing"))},[T]),m=a.useCallback((e,t)=>{const o=w.current;o.dir.x===-e&&o.dir.y===-t||(o.pendingDir={x:e,y:t})},[]);a.useEffect(()=>{const e=o=>{const i=o.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)return;const c=x.current==="playing";let n=!0;switch(o.code){case"ArrowUp":case"KeyW":c?m(0,-1):p();break;case"ArrowDown":case"KeyS":c?m(0,1):p();break;case"ArrowLeft":case"KeyA":c?m(-1,0):p();break;case"ArrowRight":case"KeyD":c?m(1,0):p();break;case"Space":c||p();break;default:n=!1}n&&o.preventDefault()},t=r.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[m,p]),a.useLayoutEffect(()=>{const e=s.current;if(!e)return;const t=()=>{const i=e.parentElement;if(i&&i.clientWidth>0&&i.clientHeight>0){e.width=i.clientWidth,e.height=i.clientHeight-W,b.current=H(e);const c=w.current;c.cols=Math.max(5,Math.floor(e.width/g)),c.rows=Math.max(5,Math.floor(e.height/g)),c.originX=Math.floor((e.width-c.cols*g)/2),c.originY=Math.floor((e.height-c.rows*g)/2);const n=e.getContext("2d");n&&x.current!=="playing"&&X(e,n,x.current,h.current,S.current,b.current),K(E=>!E)}};t();const o=new ResizeObserver(t);return o.observe(e.parentElement),()=>o.disconnect()},[]),a.useEffect(()=>{if(l!=="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");if(!e||!t)return;let o;const i=()=>{h.current>S.current&&(S.current=h.current,C(h.current)),u("gameover")},c=()=>{const n=w.current;if(n.stepCounter++,n.stepCounter>=P){n.stepCounter=0,n.dir=n.pendingDir;const E=n.snake[0],k=E.x+n.dir.x,R=E.y+n.dir.y;if(k<0||R<0||k>=n.cols||R>=n.rows){i();return}const G=k===n.food.x&&R===n.food.y;if((G?n.snake:n.snake.slice(0,-1)).some(F=>F.x===k&&F.y===R)){i();return}n.snake.unshift({x:k,y:R}),G?(h.current+=1,y(h.current),D()):n.snake.pop()}q(e,t,n,h.current,S.current,b.current),o=requestAnimationFrame(c)};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[l]),a.useEffect(()=>{if(l==="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");!e||!t||X(e,t,l,f,d,b.current)},[l,f,d]);const U=e=>{const t=e.touches[0];t&&(A.current={x:t.clientX,y:t.clientY})},Y=e=>{var n;const t=A.current;A.current=null;const o=e.changedTouches[0];if((n=r.current)==null||n.focus(),x.current!=="playing"){p();return}if(!t||!o)return;const i=o.clientX-t.x,c=o.clientY-t.y;Math.abs(i)<12&&Math.abs(c)<12||(Math.abs(i)>Math.abs(c)?m(i>0?1:-1,0):m(0,c>0?1:-1))};return L.jsx("div",{ref:r,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onTouchStart:U,onTouchEnd:Y,onClick:()=>{var e;return(e=r.current)==null?void 0:e.focus()},role:"application","aria-label":"Snake game. Use the arrow keys or swipe to steer.",children:L.jsx("canvas",{ref:s,className:"h-full w-full"})})}const Q=j({...z,component:v});export{Q as snakeFrame};
@@ -1 +1 @@
1
- import{r as s,j as l}from"./react-qoZPGuNy.js";import{f as p,bd as i}from"./index-C_O7gp2F.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c=["track","album","playlist","artist","episode","show"];function d(t){let a;try{a=new URL(t.trim())}catch{return null}if(a.hostname.replace(/^www\./,"")!=="open.spotify.com")return null;const r=a.pathname.split("/").filter(Boolean),e=r.findIndex(n=>c.includes(n));return e===-1||!r[e+1]?null:`https://open.spotify.com/embed/${r[e]}/${r[e+1]}`}function m({config:t}){const[a,r]=s.useState("loading"),e=s.useMemo(()=>d(t.url),[t.url]);return e?a==="error"?l.jsx(o,{children:"player unavailable"}):l.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[a==="loading"&&l.jsx("div",{className:"absolute inset-0 z-10",children:l.jsx(o,{loading:!0,children:"loading player…"})}),l.jsx("iframe",{src:e,title:"Spotify player",className:"w-full",height:t.compact?152:"100%",style:{border:0,height:t.compact?152:"100%"},loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",onLoad:()=>r("loaded"),onError:()=>r("error")},e+String(t.compact))]}):l.jsx(o,{children:"paste a Spotify track / album / playlist URL"})}const h=p({...i,component:m});export{h as spotifyEmbedFrame};
1
+ import{r as s,j as l}from"./react-qoZPGuNy.js";import{f as p,bf as i}from"./index-DNLPQoS7.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c=["track","album","playlist","artist","episode","show"];function d(t){let a;try{a=new URL(t.trim())}catch{return null}if(a.hostname.replace(/^www\./,"")!=="open.spotify.com")return null;const r=a.pathname.split("/").filter(Boolean),e=r.findIndex(n=>c.includes(n));return e===-1||!r[e+1]?null:`https://open.spotify.com/embed/${r[e]}/${r[e+1]}`}function m({config:t}){const[a,r]=s.useState("loading"),e=s.useMemo(()=>d(t.url),[t.url]);return e?a==="error"?l.jsx(o,{children:"player unavailable"}):l.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[a==="loading"&&l.jsx("div",{className:"absolute inset-0 z-10",children:l.jsx(o,{loading:!0,children:"loading player…"})}),l.jsx("iframe",{src:e,title:"Spotify player",className:"w-full",height:t.compact?152:"100%",style:{border:0,height:t.compact?152:"100%"},loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",onLoad:()=>r("loaded"),onError:()=>r("error")},e+String(t.compact))]}):l.jsx(o,{children:"paste a Spotify track / album / playlist URL"})}const h=p({...i,component:m});export{h as spotifyEmbedFrame};
@@ -1 +1 @@
1
- import{r as l,j as s}from"./react-qoZPGuNy.js";import{i as h}from"./content-shared-BZ1XzrJx.js";import{f as y,aK as f,m as S}from"./index-C_O7gp2F.js";f.schema;const p="var(--color-highlight)",x="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",i=t=>String(t).padStart(2,"0");function g(t){const e=Math.floor(Math.max(0,t)/1e3),c=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return c>0?`${c}:${i(n)}:${i(o)}`:`${i(n)}:${i(o)}`}function k({config:t}){const e=S(),[c,n]=l.useState({startedAt:t.startedAt,accumulatedMs:t.accumulatedMs}),o=e?t.startedAt:c.startedAt,w=e?t.accumulatedMs:c.accumulatedMs,a=o!==0,d=l.useCallback(r=>{e?e(r):n(m=>({...m,...r}))},[e]),[,b]=l.useState(0);l.useEffect(()=>{if(!a)return;const r=window.setInterval(()=>b(m=>m+1),250);return()=>window.clearInterval(r)},[a]);const u=w+(a?Date.now()-o:0),v=()=>d({startedAt:Date.now()}),M=()=>d({startedAt:0,accumulatedMs:u}),j=()=>d({startedAt:0,accumulatedMs:0});return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center",children:[t.label&&s.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[s.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:p,boxShadow:a?x:void 0}}),t.label]}),s.jsx("div",{className:"metric-lg text-strong leading-none",style:a?{color:p,textShadow:x}:void 0,children:g(u)}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("button",{type:"button",onClick:a?M:v,className:`caption text-normal px-3 py-1 uppercase tracking-[0.12em] ${h}`,style:a?void 0:{color:p},children:a?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,disabled:!a&&u===0,className:`caption text-soft px-3 py-1 uppercase tracking-[0.12em] transition-opacity disabled:opacity-40 ${h}`,children:"Reset"})]})]})}const E=y({...f,component:k});export{E as stopwatchFrame};
1
+ import{r as l,j as s}from"./react-qoZPGuNy.js";import{i as h}from"./content-shared-BZ1XzrJx.js";import{f as y,aM as f,m as S}from"./index-DNLPQoS7.js";f.schema;const p="var(--color-highlight)",x="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",i=t=>String(t).padStart(2,"0");function g(t){const e=Math.floor(Math.max(0,t)/1e3),c=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return c>0?`${c}:${i(n)}:${i(o)}`:`${i(n)}:${i(o)}`}function k({config:t}){const e=S(),[c,n]=l.useState({startedAt:t.startedAt,accumulatedMs:t.accumulatedMs}),o=e?t.startedAt:c.startedAt,w=e?t.accumulatedMs:c.accumulatedMs,a=o!==0,d=l.useCallback(r=>{e?e(r):n(m=>({...m,...r}))},[e]),[,M]=l.useState(0);l.useEffect(()=>{if(!a)return;const r=window.setInterval(()=>M(m=>m+1),250);return()=>window.clearInterval(r)},[a]);const u=w+(a?Date.now()-o:0),b=()=>d({startedAt:Date.now()}),v=()=>d({startedAt:0,accumulatedMs:u}),j=()=>d({startedAt:0,accumulatedMs:0});return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center",children:[t.label&&s.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[s.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:p,boxShadow:a?x:void 0}}),t.label]}),s.jsx("div",{className:"metric-lg text-strong leading-none",style:a?{color:p,textShadow:x}:void 0,children:g(u)}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("button",{type:"button",onClick:a?v:b,className:`caption text-normal px-3 py-1 uppercase tracking-[0.12em] ${h}`,style:a?void 0:{color:p},children:a?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,disabled:!a&&u===0,className:`caption text-soft px-3 py-1 uppercase tracking-[0.12em] transition-opacity disabled:opacity-40 ${h}`,children:"Reset"})]})]})}const E=y({...f,component:k});export{E as stopwatchFrame};
@@ -0,0 +1 @@
1
+ import{r as d,j as s}from"./react-qoZPGuNy.js";import{f as h,ah as m,a9 as g,h as l}from"./index-DNLPQoS7.js";import{M as i}from"./mover-row-CunANlxa.js";import{F as n}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";m.schema;const f=["xyz:*"];function u({config:t}){const{stats:c,isLoading:p}=g(f,6e4),{gainers:o,losers:x}=d.useMemo(()=>{const e=Object.entries(c).map(([a,r])=>({symbol:a,...r})).filter(a=>a.symbol.includes(":")&&a.markPx>0&&a.prevDayPx>0).sort((a,r)=>r.changePct-a.changePct);return{gainers:e.slice(0,t.count),losers:e.slice(-t.count).reverse()}},[c,t.count]);return p?s.jsx(n,{loading:!0,children:"loading movers…"}):o.length===0?s.jsx(n,{children:"no mover data yet"}):s.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"gainers"}),o.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"losers"}),x.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]})]})}const M=h({...m,component:u});export{M as topMoversFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{b as c}from"./format-CfAcS4D8.js";import{M as m}from"./metric-row-BVVhjsjK.js";import{f as u,P as a,Q as d}from"./index-C_O7gp2F.js";import{F as i,s as x}from"./ui-Bq3RQsdJ.js";a.schema;function f({auction:e}){const t=[e.securityTerm,e.securityType].filter(Boolean).join(" ");return s.jsx(m,{label:t||e.securityType,meta:e.auctionDate+(e.bidToCover!==null?` · ${e.bidToCover.toFixed(2)}× bid-to-cover`:""),value:e.rate!==null?c(e.rate):"—"})}function p({config:e}){const{auctions:t,isLoading:o}=d(e.count);if(o)return s.jsx(i,{loading:!0,children:"loading auctions…"});if(!t.length)return s.jsx(i,{children:"no auction data yet"});const n=t.slice(0,e.count);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"treasury auctions"}),s.jsx("div",{className:"body-sm text-normal",children:"high yield · bid-to-cover"})]}),s.jsx("div",{className:"caption text-soft text-right",children:"results"})]}),s.jsx("div",{className:x,children:n.map((r,l)=>s.jsx(f,{auction:r},`${r.auctionDate}-${r.securityType}-${r.securityTerm}-${l}`))})]})}const T=u({...a,component:p});export{T as treasuryAuctionsFrame};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{b as c}from"./format-CfAcS4D8.js";import{M as m}from"./metric-row-BVVhjsjK.js";import{f as u,Q as a,R as d}from"./index-DNLPQoS7.js";import{F as i,s as x}from"./ui-Bq3RQsdJ.js";a.schema;function f({auction:e}){const t=[e.securityTerm,e.securityType].filter(Boolean).join(" ");return s.jsx(m,{label:t||e.securityType,meta:e.auctionDate+(e.bidToCover!==null?` · ${e.bidToCover.toFixed(2)}× bid-to-cover`:""),value:e.rate!==null?c(e.rate):"—"})}function p({config:e}){const{auctions:t,isLoading:o}=d(e.count);if(o)return s.jsx(i,{loading:!0,children:"loading auctions…"});if(!t.length)return s.jsx(i,{children:"no auction data yet"});const n=t.slice(0,e.count);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"treasury auctions"}),s.jsx("div",{className:"body-sm text-normal",children:"high yield · bid-to-cover"})]}),s.jsx("div",{className:"caption text-soft text-right",children:"results"})]}),s.jsx("div",{className:x,children:n.map((r,l)=>s.jsx(f,{auction:r},`${r.auctionDate}-${r.securityType}-${r.securityTerm}-${l}`))})]})}const T=u({...a,component:p});export{T as treasuryAuctionsFrame};
@@ -0,0 +1 @@
1
+ import{R as P,r as d,j as T}from"./react-qoZPGuNy.js";import{c as $}from"./utils-DaT-yT0k.js";import{w as z,x as H,y as k}from"./d3-xK4fOkBU.js";const E="4px",S="4px",U=2.5,F=(b,v,y,m,B)=>{const R=b.children;if(!R||R.length===0)return;const I=(s,i,n,e,l)=>{if(e===0)return 1/0;const c=i/e*l;if(c===0)return 1/0;let r=0;for(const u of s){const o=(u.value||0)/i*n,x=c/o,h=Math.abs(x-U);r=Math.max(r,h)}return r},L=(s,i,n,e,l,c,r)=>{const u=i/n*l;let a=r;for(const o of s){const h=(o.value||0)/i*e;o.x0=c,o.y0=a,o.x1=c+u,o.y1=a+h,a+=h}return u},_=m-v,p=B-y,C=R.reduce((s,i)=>s+(i.value||0),0);if(C===0)return;let w=[...R],g=v,j=_,M=C;for(;w.length>0;){let s=[],i=0;for(let e=0;e<w.length;e++){const l=w[e],c=l.value||0,r=[...s,l],u=i+c;if(s.length===0)s=r,i=u;else{const a=I(s,i,p,M,j);if(I(r,u,p,M,j)<=a)s=r,i=u;else break}}const n=L(s,i,M,p,j,g,y);w=w.slice(s.length),g+=n,j-=n,M-=i}};function G({data:b,className:v,LeafComponent:y,getColorValue:m,tileMode:B="squarify"}){const R=d.useRef(null),I=d.useRef(null),L=d.useRef(null),_=d.useRef(null),p=d.useRef(null),C=d.useRef(null),[,w]=d.useTransition(),[g,j]=d.useState({width:0,height:0});d.useEffect(()=>{const n=R.current;if(n){const e=new ResizeObserver(()=>{w(()=>{j({width:n.offsetWidth,height:n.offsetHeight})})});return e.observe(n),()=>{e.disconnect()}}},[]),d.useEffect(()=>{const n=I.current;if(n){const e=n.children;let l=e[0],c=e[0],r=e[0],u=e[0];for(let a=0;a<e.length;a++){const o=e[a],{x,y:h}=o.getBoundingClientRect(),N=l.getBoundingClientRect(),W=c.getBoundingClientRect(),t=r.getBoundingClientRect(),f=u.getBoundingClientRect();x<=N.x&&h<=N.y&&(l=o),x<=W.x&&h>=W.y&&(c=o),x>=t.x&&h<=t.y&&(r=o),x>=f.x&&h>=f.y&&(u=o)}L.current&&(L.current.style.borderTopLeftRadius=E),L.current=l,L.current.style.borderTopLeftRadius=S,_.current&&(_.current.style.borderBottomLeftRadius=E),_.current=c,_.current.style.borderBottomLeftRadius=S,p.current&&(p.current.style.borderTopRightRadius=E),p.current=r,p.current.style.borderTopRightRadius=S,C.current&&(C.current.style.borderBottomRightRadius=E),C.current=u,C.current.style.borderBottomRightRadius=S}},[g]);const M=d.useMemo(()=>{switch(B){case"vertical-rectangle":return F;case"squarify":default:return z}},[B]),s=d.useMemo(()=>H().size([g.width,g.height]).tile(M).paddingInner(4)(k({id:"root",value:0,children:b}).sum(n=>n.value).sort((n,e)=>e.data.value-n.data.value)),[b,g.width,g.height,M]),i=d.useMemo(()=>{const n=s.leaves(),e=n.map(t=>m?m(t.data):t.data.value),l=e.filter(t=>t>=0),c=e.filter(t=>t<0),r=l.length>0?Math.min(...l):0,u=l.length>0?Math.max(...l):0,a=c.length>0?Math.min(...c):0,o=c.length>0?Math.max(...c):0,x=t=>t<0?o===a?1:(t-o)/(a-o):u===r?1:(t-r)/(u-r),h=(t,f)=>{if(f>=0){const q=Math.round(34+t*16);return`hsl(152 ${Math.round(42+t*20)}% ${q}%)`}const D=Math.round(36+t*15);return`hsl(350 ${Math.round(48+t*22)}% ${D}%)`},N=[...new Set(n.map(t=>t.x0))].sort((t,f)=>t-f),W=new Map(N.map((t,f)=>[t,f]));return n.map(t=>{const f=t.x1-t.x0,D=t.y1-t.y0,V=m?m(t.data):t.data.value,q=x(V),A=W.get(t.x0)??0,O=h(q,V);return T.jsx("div",{className:"group absolute cursor-pointer rounded-sm border border-transparent hover:bg-[radial-gradient(146.13%_118.42%_at_50%_-15.5%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_99.59%)] hover:bg-gradient-to-t",style:{left:t.x0,top:t.y0,width:f,height:D,borderRadius:E,backgroundColor:O},children:T.jsx(y,{width:f,height:D,data:t.data,columnIndex:A})},`${t.data.id}-box`)})},[s,y,m]);return T.jsx("div",{className:$("h-full w-full",v),ref:R,children:T.jsx("div",{className:"relative overflow-hidden rounded-lg",style:{height:g.height,width:g.width},ref:I,children:i})})}const K=P.memo(G);function Q({width:b,height:v,label:y,secondary:m,title:B}){if(b<48||v<30)return null;const R=b<70||v<44;return T.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center overflow-hidden p-1 text-center",title:B,children:[T.jsx("span",{className:"body-sm truncate font-bold text-strong",children:y}),!R&&m&&T.jsx("span",{className:"caption text-soft",children:m})]})}export{K as T,Q as a};
@@ -0,0 +1 @@
1
+ import{r as n,j as m}from"./react-qoZPGuNy.js";import{f as l}from"./format-CfAcS4D8.js";import{f as p,ai as i,aj as f}from"./index-DNLPQoS7.js";import{T as u,a as c}from"./treemap-leaf-DNIoJEK-.js";import{F as s}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";i.schema;function d({width:r,height:o,data:e}){const t=l(e.tvl);return m.jsx(c,{width:r,height:o,label:e.id,secondary:t,title:`${e.id} · ${t}`})}function v({config:r}){const{entries:o,isLoading:e}=f(),t=n.useMemo(()=>o.slice(0,r.topN).map(a=>({id:a.name,value:a.tvl,tvl:a.tvl})),[o,r.topN]);return e?m.jsx(s,{loading:!0,children:"loading TVL…"}):t.length===0?m.jsx(s,{children:"no TVL data"}):m.jsx(u,{data:t,LeafComponent:d,getColorValue:a=>a.tvl})}const F=p({...i,component:v});export{F as tvlTreemapFrame};
@@ -1 +1 @@
1
- import{r as l,j as o}from"./react-qoZPGuNy.js";import{f as u,aA as s}from"./index-C_O7gp2F.js";import{F as i}from"./ui-Bq3RQsdJ.js";s.schema;function c(a){let e;try{e=new URL(a.trim())}catch{return null}const r=e.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=e.pathname.slice(1).split("/")[0];return t?`https://www.youtube.com/embed/${t}`:null}if(r==="youtube.com"||r==="m.youtube.com"){if(e.pathname==="/watch"){const n=e.searchParams.get("v");return n?`https://www.youtube.com/embed/${n}`:null}const t=e.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null}if(r==="vimeo.com"){const t=e.pathname.split("/").filter(Boolean)[0];return t&&/^\d+$/.test(t)?`https://player.vimeo.com/video/${t}`:null}return r==="player.vimeo.com"||e.protocol==="https:"?e.toString():null}function m({config:a}){const[e,r]=l.useState("loading"),t=l.useMemo(()=>c(a.url),[a.url]);return l.useEffect(()=>r("loading"),[t]),t?e==="error"?o.jsx(i,{children:"video unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[e==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(i,{loading:!0,children:"loading video…"})}),o.jsx("iframe",{src:t,title:a.title,className:`h-full w-full border-0 transition-opacity duration-300 ${e==="loaded"?"opacity-100":"opacity-0"}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,onLoad:()=>r("loaded"),onError:()=>r("error")},t)]}):o.jsx(i,{children:"invalid video URL"})}const f=u({...s,component:m});export{f as videoFrame};
1
+ import{r as l,j as o}from"./react-qoZPGuNy.js";import{f as u,aC as s}from"./index-DNLPQoS7.js";import{F as i}from"./ui-Bq3RQsdJ.js";s.schema;function c(a){let e;try{e=new URL(a.trim())}catch{return null}const r=e.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=e.pathname.slice(1).split("/")[0];return t?`https://www.youtube.com/embed/${t}`:null}if(r==="youtube.com"||r==="m.youtube.com"){if(e.pathname==="/watch"){const n=e.searchParams.get("v");return n?`https://www.youtube.com/embed/${n}`:null}const t=e.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null}if(r==="vimeo.com"){const t=e.pathname.split("/").filter(Boolean)[0];return t&&/^\d+$/.test(t)?`https://player.vimeo.com/video/${t}`:null}return r==="player.vimeo.com"||e.protocol==="https:"?e.toString():null}function m({config:a}){const[e,r]=l.useState("loading"),t=l.useMemo(()=>c(a.url),[a.url]);return l.useEffect(()=>r("loading"),[t]),t?e==="error"?o.jsx(i,{children:"video unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[e==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(i,{loading:!0,children:"loading video…"})}),o.jsx("iframe",{src:t,title:a.title,className:`h-full w-full border-0 transition-opacity duration-300 ${e==="loaded"?"opacity-100":"opacity-0"}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,onLoad:()=>r("loaded"),onError:()=>r("error")},t)]}):o.jsx(i,{children:"invalid video URL"})}const f=u({...s,component:m});export{f as videoFrame};
@@ -1 +1 @@
1
- import{j as e}from"./react-qoZPGuNy.js";import{c as x,b as v}from"./format-CfAcS4D8.js";import{f as j,ai as p,aj as g}from"./index-C_O7gp2F.js";import{F as u}from"./ui-Bq3RQsdJ.js";p.schema;const h=(n=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${n})`;function y({rates:n}){const a=Math.min(...n),m=Math.max(...n),r=Math.max(.01,m-a),o=n.length,c=i=>100*i/(o-1),t=i=>4+32*(1-(i-a)/r),d=n.map((i,s)=>`${s?"L":"M"}${c(s).toFixed(2)},${t(i).toFixed(2)}`).join(" ");return e.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[e.jsx("path",{d:`${d} L100,40 L0,40 Z`,fill:h(.14)}),e.jsx("path",{d,fill:"none",stroke:h(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function N({config:n}){const{curve:a,isLoading:m}=g();if(m)return e.jsx(u,{loading:!0,children:"loading yield curve…"});if(!a||a.points.length<2)return e.jsx(u,{children:"no yield-curve data yet"});const r=s=>{var l;return(l=a.points.find(f=>f.label===s))==null?void 0:l.rate},o=r("2Y"),c=r("10Y"),t=o!=null&&c!=null?Math.round((c-o)*100):null,d=t!=null&&t<0,i=n.maturities;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),e.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",a.date]})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t!=null&&e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"metric-md leading-none",style:{color:x(t),textShadow:`0 0 24px ${x(t)}44`},children:[t>=0?"+":"",t," bps"]}),e.jsxs("span",{className:"caption text-soft",children:["2s10s · ",d?"inverted":"normal"]})]}),e.jsx(y,{rates:a.points.map(s=>s.rate)}),e.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${i.length}, minmax(0, 1fr))`},children:i.map(s=>{const l=r(s);return e.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[e.jsx("div",{className:"caption text-soft",children:s}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:l!=null?v(l):"—"})]},s)})})]})}const M=j({...p,component:N});export{M as yieldCurveFrame};
1
+ import{j as e}from"./react-qoZPGuNy.js";import{c as x,b as v}from"./format-CfAcS4D8.js";import{f as j,ak as p,al as g}from"./index-DNLPQoS7.js";import{F as u}from"./ui-Bq3RQsdJ.js";p.schema;const h=(n=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${n})`;function y({rates:n}){const a=Math.min(...n),m=Math.max(...n),i=Math.max(.01,m-a),o=n.length,c=r=>100*r/(o-1),t=r=>4+32*(1-(r-a)/i),d=n.map((r,s)=>`${s?"L":"M"}${c(s).toFixed(2)},${t(r).toFixed(2)}`).join(" ");return e.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[e.jsx("path",{d:`${d} L100,40 L0,40 Z`,fill:h(.14)}),e.jsx("path",{d,fill:"none",stroke:h(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function N({config:n}){const{curve:a,isLoading:m}=g();if(m)return e.jsx(u,{loading:!0,children:"loading yield curve…"});if(!a||a.points.length<2)return e.jsx(u,{children:"no yield-curve data yet"});const i=s=>{var l;return(l=a.points.find(f=>f.label===s))==null?void 0:l.rate},o=i("2Y"),c=i("10Y"),t=o!=null&&c!=null?Math.round((c-o)*100):null,d=t!=null&&t<0,r=n.maturities;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),e.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",a.date]})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t!=null&&e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"metric-md leading-none",style:{color:x(t),textShadow:`0 0 24px ${x(t)}44`},children:[t>=0?"+":"",t," bps"]}),e.jsxs("span",{className:"caption text-soft",children:["2s10s · ",d?"inverted":"normal"]})]}),e.jsx(y,{rates:a.points.map(s=>s.rate)}),e.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`},children:r.map(s=>{const l=i(s);return e.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[e.jsx("div",{className:"caption text-soft",children:s}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:l!=null?v(l):"—"})]},s)})})]})}const F=j({...p,component:N});export{F as yieldCurveFrame};
@@ -8,9 +8,9 @@
8
8
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
9
9
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
10
10
  <title>zframes runtime</title>
11
- <script type="module" crossorigin src="/assets/index-C_O7gp2F.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-DNLPQoS7.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/react-qoZPGuNy.js">
13
- <link rel="stylesheet" crossorigin href="/assets/index-DRTPEQtR.css">
13
+ <link rel="stylesheet" crossorigin href="/assets/index-BqHx9BjX.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{r as l,j as r}from"./react-qoZPGuNy.js";import{p as x,f as C}from"./format-CfAcS4D8.js";import{f as M,am as p,an as S}from"./index-C_O7gp2F.js";import{F as u}from"./ui-Bq3RQsdJ.js";import{a,C as f}from"./chart-utils-BYIZMM9J.js";import{M as D}from"./index-jnySFpSv.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const E={"7D":{ms:10080*60*1e3,timeframe:a["7D"]},"1M":{ms:720*60*60*1e3,timeframe:a["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:a["3M"]}};p.schema;function j({config:t}){const{ms:m,timeframe:c}=E[t.lookback],s=l.useMemo(()=>Date.now()-m,[m]),{history:i,isLoading:d}=S(t.protocols),n=l.useMemo(()=>t.protocols.map((e,h)=>({id:e,name:x(e),color:f[h%f.length],data:(i[e]??[]).filter(o=>o.time>=s).map(o=>({date:new Date(o.time).toISOString(),value:o.value}))})),[t.protocols,i,s]);return d?r.jsx(u,{loading:!0,children:"loading DEX volume…"}):n.every(e=>e.data.length===0)?r.jsx(u,{children:"no DEX volume data yet"}):r.jsx(D,{series:n,timeframe:c,height:250,formatValue:e=>C(e)})}const I=M({...p,component:j});export{I as dexVolumeChartFrame};
@@ -1 +0,0 @@
1
- import{r as l,j as t}from"./react-qoZPGuNy.js";import{f as u}from"./format-CfAcS4D8.js";import{f as i,ak as n,al as p}from"./index-C_O7gp2F.js";import{T as c,a as f}from"./treemap-leaf-DLQawrx4.js";import{F as s}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function d({width:m,height:r,data:o}){const a=u(o.volume24h);return t.jsx(f,{width:m,height:r,label:o.id,secondary:a,title:`${o.id} · ${a} 24h volume`})}function h({config:m}){const{entries:r,isLoading:o}=p(),a=l.useMemo(()=>r.slice(0,m.topN).map(e=>({id:e.name,value:e.volume24h,volume24h:e.volume24h,changePct:e.changePct??0})),[r,m.topN]);return o?t.jsx(s,{loading:!0,children:"loading DEX volume…"}):a.length===0?t.jsx(s,{children:"no DEX volume data"}):t.jsx(c,{data:a,LeafComponent:d,getColorValue:e=>e.changePct})}const D=i({...n,component:h});export{D as dexVolumeTreemapFrame};
@@ -1,68 +0,0 @@
1
- import{r,j as e,c as Es,a as Qt}from"./react-qoZPGuNy.js";import{G as es}from"./gridstack-BxxvPIFU.js";import{t as rt,u as Ts,F as ts,a as Fs,b as Is,c as Ls,d as $s,N as ss,e as as}from"./index-C_O7gp2F.js";const rs=[{key:"zframes",label:"zframes",description:"The signature indigo on near-black navy, DM Sans, soft rounded cards — the default look.",theme:{accentHue:242,accentSat:90,baseHue:233,baseSat:20},typography:{fontFamily:"sans",numericStyle:"proportional"},appearance:{radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}},{key:"terminal",label:"Terminal",description:"Phosphor green on black, monospaced, fixed-width digits, sharp dense flat cards — a trading-terminal feel.",theme:{accentHue:145,accentSat:85,baseHue:150,baseSat:16},typography:{fontFamily:"mono",numericStyle:"tabular"},appearance:{radius:4,borderStrength:.34,surfaceOpacity:1,density:.85,elevation:.4}},{key:"amber",label:"Amber",description:"Warm amber on charcoal, monospaced, tabular, slightly sharp cards — a retro CRT console.",theme:{accentHue:38,accentSat:95,baseHue:30,baseSat:18},typography:{fontFamily:"mono",numericStyle:"tabular"},appearance:{radius:6,borderStrength:.3,surfaceOpacity:1,density:.9,elevation:.6}},{key:"graphite",label:"Graphite",description:"Near-grayscale slate, faint rims, flat quiet cards, tabular numbers — calm and neutral.",theme:{accentHue:220,accentSat:8,baseHue:220,baseSat:4},typography:{fontFamily:"sans",numericStyle:"tabular"},appearance:{radius:14,borderStrength:.14,surfaceOpacity:1,density:1,elevation:.35}},{key:"synthwave",label:"Synthwave",description:"Hot magenta on deep violet-black, faintly glassy cards floating on a strong glow — vivid and nocturnal.",theme:{accentHue:320,accentSat:88,baseHue:280,baseSat:26},typography:{fontFamily:"sans",numericStyle:"proportional"},appearance:{radius:20,borderStrength:.3,surfaceOpacity:.9,density:1,elevation:1.7}},{key:"editorial",label:"Editorial",description:"A warm serif on soft charcoal-brown, roomy padding, gentle lift — reads like a financial broadsheet.",theme:{accentHue:22,accentSat:60,baseHue:28,baseSat:12},typography:{fontFamily:"serif",numericStyle:"proportional"},appearance:{radius:10,borderStrength:.18,surfaceOpacity:1,density:1.15,elevation:.8}}],Xe=[{key:"aurora",label:"Aurora",description:"The signature zframes scene — a slow indigo aurora drifting over near-black. The default backdrop.",projectId:"YrTzGatwjK7EoFpCSfgZ",swatch:"radial-gradient(120% 120% at 30% 20%, hsl(248 80% 60%) 0%, hsl(250 70% 22%) 45%, hsl(240 40% 6%) 100%)"},{key:"nebula",label:"Nebula",description:"A deeper violet nebula with brighter drifting cores — a touch more energy than Aurora.",projectId:"K42KSY4FXeXhjVOj9RgT",swatch:"radial-gradient(120% 120% at 70% 30%, hsl(280 75% 62%) 0%, hsl(262 65% 26%) 45%, hsl(250 45% 7%) 100%)"},{key:"ember",label:"Ember",description:"Warm ember tones drifting over charcoal.",projectId:"E4221P7lwTy049d7ISxc",swatch:"radial-gradient(120% 120% at 30% 25%, hsl(24 85% 58%) 0%, hsl(12 65% 28%) 45%, hsl(8 40% 7%) 100%)"},{key:"tide",label:"Tide",description:"Cool teal currents on deep blue-black.",projectId:"cYpXuEzDqm4r3fdp4TGx",swatch:"radial-gradient(120% 120% at 70% 25%, hsl(180 70% 55%) 0%, hsl(196 65% 26%) 45%, hsl(205 45% 7%) 100%)"},{key:"verdant",label:"Verdant",description:"Soft green light over near-black.",projectId:"PrFtFGDE5duemLmr2YKQ",swatch:"radial-gradient(120% 120% at 30% 25%, hsl(140 65% 55%) 0%, hsl(152 55% 24%) 45%, hsl(160 40% 6%) 100%)"},{key:"dusk",label:"Dusk",description:"Magenta-pink glow fading into dark.",projectId:"qpoj0wFWmgwRVXmzRMiL",swatch:"radial-gradient(120% 120% at 70% 30%, hsl(320 80% 62%) 0%, hsl(300 60% 28%) 45%, hsl(290 45% 7%) 100%)"}];/**
2
- * @license lucide-react v1.21.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ms=(...t)=>t.filter((a,n,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===n).join(" ").trim();/**
7
- * @license lucide-react v1.21.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Hs=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
12
- * @license lucide-react v1.21.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Os=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,d)=>d?d.toUpperCase():n.toLowerCase());/**
17
- * @license lucide-react v1.21.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const ns=t=>{const a=Os(t);return a.charAt(0).toUpperCase()+a.slice(1)};/**
22
- * @license lucide-react v1.21.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */var Ye={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
27
- * @license lucide-react v1.21.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const Ps=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},Bs=r.createContext({}),Gs=()=>r.useContext(Bs),Ds=r.forwardRef(({color:t,size:a,strokeWidth:n,absoluteStrokeWidth:d,className:v="",children:m,iconNode:h,...u},f)=>{const{size:p=24,strokeWidth:c=2,absoluteStrokeWidth:z=!1,color:N="currentColor",className:g=""}=Gs()??{},C=d??z?Number(n??c)*24/Number(a??p):n??c;return r.createElement("svg",{ref:f,...Ye,width:a??p??Ye.width,height:a??p??Ye.height,stroke:t??N,strokeWidth:C,className:ms("lucide",g,v),...!m&&!Ps(u)&&{"aria-hidden":"true"},...u},[...h.map(([T,A])=>r.createElement(T,A)),...Array.isArray(m)?m:[m]])});/**
32
- * @license lucide-react v1.21.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const me=(t,a)=>{const n=r.forwardRef(({className:d,...v},m)=>r.createElement(Ds,{ref:m,iconNode:a,className:ms(`lucide-${Hs(ns(t))}`,`lucide-${t}`,d),...v}));return n.displayName=ns(t),n};/**
37
- * @license lucide-react v1.21.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const _s=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ws=me("check",_s);/**
42
- * @license lucide-react v1.21.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const Us=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qs=me("chevron-down",Us);/**
47
- * @license lucide-react v1.21.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const Ks=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vs=me("plus",Ks);/**
52
- * @license lucide-react v1.21.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const Xs=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ys=me("search",Xs);/**
57
- * @license lucide-react v1.21.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const Zs=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Js=me("sliders-horizontal",Zs);/**
62
- * @license lucide-react v1.21.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const Qs=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ie=me("x",Qs),fs=["xyz:XYZ100","xyz:SP500","xyz:NVDA","xyz:TSLA","xyz:AAPL","xyz:MSFT","xyz:GOOGL","xyz:META","xyz:AMZN","xyz:MU","xyz:AMD","xyz:AVGO","xyz:ARM","xyz:TSM","xyz:SKHX","xyz:MSTR","xyz:COIN","xyz:HOOD","xyz:PLTR","xyz:SPCX","xyz:GOLD","xyz:SILVER","xyz:CL","xyz:BRENTOIL","xyz:COPPER","xyz:EUR","xyz:JPY","xyz:SMH","BTC","ETH","SOL","HYPE","BNB","XRP","DOGE","LINK","AVAX","SUI"],hs=new Map(fs.map((t,a)=>[t,a]));function ye(t){const a=t.indexOf(":");return(a===-1?t:t.slice(a+1)).toUpperCase()}function nt(t){return t.includes(":")?"Stock":"Crypto"}function ea(t){const a=t.indexOf(":");if(a!==-1){const n=t.slice(a+1);return`https://assets.parqet.com/logos/symbol/${encodeURIComponent(n)}?format=png`}return`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}function ta(t){const a=t.trim().replace(/\s+/g,"");if(!a)return"";const n=a.indexOf(":");return n===-1?a.toUpperCase():`${a.slice(0,n).toLowerCase()}:${a.slice(n+1).toUpperCase()}`}function et(t,a,n=hs.get(t)??1e4){return{symbol:t,ticker:ye(t),kind:nt(t),markPx:a==null?void 0:a.markPx,changePct:a==null?void 0:a.changePct,rank:n}}function ps(t){if(!Number.isFinite(t))return"";const a=t;return a>=1e3?`$${a.toLocaleString(void 0,{maximumFractionDigits:0})}`:a>=100?`$${a.toFixed(2)}`:a>=1?`$${a.toFixed(3)}`:`$${a.toPrecision(3)}`}function sa(t){if(!Number.isFinite(t))return"";const a=t;return`${a>=0?"+":""}${a.toFixed(2)}%`}function gs(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function $(t,a){return t!=null&&t.type?Array.isArray(t.type)?t.type.includes(a):t.type===a:!1}function bs(t){const a=t==null?void 0:t.items;return!!a&&$(t,"array")&&$(a,"string")}function aa(t){var a,n,d;try{const m=rt(t.schema,{io:"input"}).properties??{};if($(m.symbol,"string"))return{kind:"single"};if(bs(m.symbols))return{kind:"symbols",minItems:(a=m.symbols)==null?void 0:a.minItems,maxItems:(n=m.symbols)==null?void 0:n.maxItems};const h=m.holdings,u=((d=h==null?void 0:h.items)==null?void 0:d.properties)??{};if($(h,"array")&&$(u.symbol,"string"))return{kind:"holdings",minItems:h==null?void 0:h.minItems,maxItems:h==null?void 0:h.maxItems}}catch{}return t.name==="price-chart"?{kind:"single"}:["price-liveline","price-ticker","funding-rate-chart","funding-heatmap","price-compare"].includes(t.name)?{kind:"symbols"}:null}function ra(t,a){return t.kind==="single"?typeof a.symbol=="string"&&a.symbol?[a.symbol]:[]:t.kind==="symbols"?Array.isArray(a.symbols)?a.symbols.filter(n=>typeof n=="string"):[]:Array.isArray(a.holdings)?a.holdings.map(n=>gs(n)&&typeof n.symbol=="string"?n.symbol:"").filter(Boolean):[]}const na=new Set(["symbol","symbols","holdings"]);function it(t){const a=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):t}function ia(t){let a;try{a=rt(t.schema,{io:"input"})}catch{return[]}return Object.entries(a.properties??{}).filter(([n])=>!na.has(n)).map(([n,d])=>({key:n,label:it(n),shape:d}))}const is=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:SP500","xyz:GOLD","xyz:GOOGL","xyz:AMZN"];function la(t,a){return t==="symbol"?is[a%is.length]:t==="url"?"https://":t==="text"?"New note":t==="title"?"Heading":it(t)||"value"}function tt(t,a,n=0){var d;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0];if($(t,"string"))return la(a,n);if($(t,"number")||$(t,"integer"))return t.exclusiveMinimum!==void 0?t.exclusiveMinimum+1:t.minimum??0;if($(t,"boolean"))return!1;if($(t,"array")){const v=t.items??{},m=a==="symbols"?"symbol":a;return Array.from({length:t.minItems??0},(h,u)=>tt(v,m,u))}if($(t,"object")){const v={};for(const m of t.required??[]){const h=(d=t.properties)==null?void 0:d[m];h&&(v[m]=tt(h,m,n))}return v}return null}function oa(t){const a=t.schema.safeParse({});if(a.success)return a.data;let n;try{n=rt(t.schema,{io:"input"})}catch{return{}}const d={},v=new Set(n.required??[]);for(const[h,u]of Object.entries(n.properties??{}))v.has(h)&&(d[h]=tt(u,h));const m=t.schema.safeParse(d);return m.success?m.data:d}function ca(t,a){const n=r.useMemo(()=>t.find(f=>f.capabilities.includes("day-stats")),[t]),[d,v]=r.useState({}),[m,h]=r.useState(!1);return r.useEffect(()=>{if(!a||!(n!=null&&n.getDayStats)){h(!1);return}let f=!1;return h(!0),Promise.allSettled([n.getDayStats(),n.getDayStats(["xyz:*"])]).then(p=>{if(f)return;const c={};for(const z of p)z.status==="fulfilled"&&Object.assign(c,z.value);v(c)}).finally(()=>{f||h(!1)}),()=>{f=!0}},[a,n]),{options:r.useMemo(()=>{const f=new Map;return fs.forEach((p,c)=>{f.set(p,et(p,d[p],c))}),Object.entries(d).forEach(([p,c])=>{f.set(p,et(p,c,hs.get(p)??1e4))}),[...f.values()].sort((p,c)=>p.rank!==c.rank?p.rank-c.rank:p.kind!==c.kind?p.kind==="Stock"?-1:1:p.ticker.localeCompare(c.ticker))},[d]),loading:m}}function ua({instance:t,registry:a,instancesRef:n,symbolUniverse:d,accentHue:v,onApply:m,onClose:h}){const u=a.get(t.frame),f=r.useMemo(()=>u?aa(u):null,[u]),p=r.useMemo(()=>u?ia(u):[],[u]),[c,z]=r.useState(()=>({...t.config??{}})),[N,g]=r.useState(null),C=t.id,T=r.useCallback(j=>{if(z(j),u){const ce=u.schema.safeParse(j);if(!ce.success){g(ce.error.issues.map(fe=>`${fe.path.join(".")||"(root)"}: ${fe.message}`).join(`
67
- `));return}}g(null);const E=n.current.get(C);E&&(n.current.set(C,{...E,config:j}),m(C))},[u,C,n,m]);r.useEffect(()=>{const j=E=>{E.key==="Escape"&&h()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[h]);const A=(j,E)=>T({...c,[j]:E}),y=t.frame.replace(/-/g," ");return e.jsx("div",{className:"zf-dialog-backdrop",style:{"--zf-accent-hue":v},onMouseDown:j=>{j.target===j.currentTarget&&h()},children:e.jsxs("div",{className:"zf-dialog",role:"dialog","aria-modal":"true","aria-label":`Configure ${y}`,children:[e.jsxs("header",{className:"zf-dialog-head",children:[e.jsxs("h3",{className:"zf-dialog-title",children:["Configure · ",y]}),e.jsx("button",{type:"button",className:"zf-dialog-close",onClick:h,"aria-label":"Close",title:"Close",children:e.jsx(Ie,{size:16,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"zf-dialog-body",children:[f&&e.jsx(pa,{control:f,config:c,loading:d.loading,options:d.options,onChangeSymbol:j=>T({...c,symbol:j}),onChangeSymbols:j=>T({...c,symbols:j}),onChangeHoldings:j=>T({...c,holdings:j})}),p.map(j=>e.jsx(da,{field:j,value:c[j.key],onChange:E=>A(j.key,E)},j.key)),!f&&p.length===0&&e.jsx("p",{className:"zf-rail-empty",children:"This frame has no settings."}),N&&e.jsx("div",{className:"zf-config-error",children:N})]}),e.jsx("footer",{className:"zf-dialog-foot",children:e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:h,children:"Done"})})]})})}function da({field:t,value:a,onChange:n}){const{key:d,label:v,shape:m}=t,h=`zf-cfg-${d}`,u=m.description;if($(m,"boolean")){const p=typeof a=="boolean"?a:!!m.default;return e.jsxs("label",{className:"zf-checkbox",title:u,children:[e.jsx("input",{type:"checkbox",checked:p,onChange:c=>n(c.target.checked)}),v]})}const f=Array.isArray(m.enum)&&m.enum.every(p=>typeof p=="string")?m.enum:null;if(f&&f.length>0){const p=typeof m.default=="string"?m.default:f[0],c=typeof a=="string"&&f.includes(a)?a:p;return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:h,title:u,children:v}),e.jsx("select",{id:h,className:"zf-select",value:c,onChange:z=>n(z.target.value),children:f.map(z=>e.jsx("option",{value:z,children:it(z)},z))})]})}return $(m,"integer")||$(m,"number")?e.jsx(ma,{id:h,field:t,value:a,onChange:n}):bs(m)?e.jsx(ha,{id:h,field:t,value:a,onChange:n}):e.jsx(fa,{id:h,field:t,value:a,onChange:n})}function ma({id:t,field:a,value:n,onChange:d}){const{label:v,shape:m}=a,h=m.description,u=typeof m.minimum=="number"?m.minimum:void 0,f=typeof m.maximum=="number"?m.maximum:void 0,p=$(m,"integer"),c=p?1:"any",z=typeof m.default=="number"?m.default:u??0,N=typeof n=="number"&&Number.isFinite(n)?n:void 0;if(u!==void 0&&f!==void 0){const g=N??z;return e.jsxs("div",{className:"zf-field",children:[e.jsxs("div",{className:"zf-field-row",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),e.jsx("span",{className:"zf-field-num",children:g})]}),e.jsx("input",{id:t,type:"range",className:"zf-range",min:u,max:f,step:c,value:g,onChange:C=>d(p?Math.round(Number(C.target.value)):Number(C.target.value))})]})}return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),e.jsx("input",{id:t,type:"number",className:"zf-input",min:u,max:f,step:c,value:n==null?"":String(n),onChange:g=>d(g.target.value===""?"":Number(g.target.value))})]})}function fa({id:t,field:a,value:n,onChange:d}){const{key:v,label:m,shape:h}=a,u=h.description,f=typeof n=="string"?n:"",p=typeof h.default=="string"?h.default:"",c=typeof h.default=="string"&&/^#[0-9a-f]{6}$/i.test(h.default)?h.default:null;if(v==="color"||c){const z=/^#[0-9a-f]{6}$/i.test(f)?f:c??"#8b8df9";return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsxs("div",{className:"zf-color-row",children:[e.jsx("input",{type:"color",className:"zf-color",value:z,"aria-label":`${m} swatch`,onChange:N=>d(N.target.value)}),e.jsx("input",{id:t,className:"zf-input",value:f,placeholder:p,spellCheck:!1,onChange:N=>d(N.target.value)})]})]})}return v==="text"?e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsx("textarea",{id:t,className:"zf-textarea zf-textarea--prose",value:f,placeholder:p,onChange:z=>d(z.target.value)})]}):e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsx("input",{id:t,className:"zf-input",value:f,placeholder:p,spellCheck:!1,onChange:z=>d(z.target.value)})]})}function ha({id:t,field:a,value:n,onChange:d}){const{label:v,shape:m}=a,h=m.description,u=Array.isArray(n)?n.filter(g=>typeof g=="string"):[],[f,p]=r.useState(""),c=typeof m.maxItems=="number"?m.maxItems:void 0,z=c!==void 0&&u.length>=c,N=g=>{const C=g.trim().toUpperCase();p(""),!(!C||u.includes(C)||z)&&d([...u,C])};return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),u.length>0&&e.jsx("div",{className:"zf-taglist",children:u.map(g=>e.jsxs("span",{className:"zf-tag",children:[g,e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${g}`,onClick:()=>d(u.filter(C=>C!==g)),children:e.jsx(Ie,{size:12,"aria-hidden":"true"})})]},g))}),e.jsx("input",{id:t,className:"zf-input",value:f,disabled:z,spellCheck:!1,placeholder:z?"Maximum reached":"Type a code, Enter to add",onChange:g=>p(g.target.value),onBlur:()=>N(f),onKeyDown:g=>{g.key==="Enter"||g.key===","?(g.preventDefault(),N(f)):g.key==="Backspace"&&f===""&&u.length>0&&d(u.slice(0,-1))}})]})}function pa({control:t,config:a,loading:n,options:d,onChangeSymbol:v,onChangeSymbols:m,onChangeHoldings:h}){const u=ra(t,a);if(t.kind==="single"){const c=u[0]??"";return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Ticker",detail:c?ye(c):"None",loading:n}),c?e.jsx(at,{symbol:c,option:st(c,d)}):null,e.jsx(Je,{loading:n,options:d,selectedSymbols:c?[c]:[],placeholder:"Search TSLA, BTC...",onSelect:v})]})}if(t.kind==="symbols"){const c=typeof t.maxItems=="number"&&u.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Tickers",detail:ls(u.length,t),loading:n}),e.jsx(ga,{symbols:u,options:d,onRemove:z=>m(u.filter(N=>N!==z))}),e.jsx(Je,{disabled:c,loading:n,options:d,selectedSymbols:u,placeholder:c?"Maximum tickers added":"Add ticker",keepOpenOnSelect:!0,onSelect:z=>{u.includes(z)||c||m([...u,z])}})]})}const f=Array.isArray(a.holdings)?a.holdings.filter(gs):[],p=typeof t.maxItems=="number"&&f.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Holding tickers",detail:ls(f.length,t),loading:n}),e.jsx("div",{className:"zf-holding-list",children:f.map((c,z)=>{const N=typeof c.symbol=="string"?c.symbol:"";return e.jsxs("div",{className:"zf-holding-row",children:[e.jsxs("div",{className:"zf-holding-main",children:[N?e.jsx(at,{symbol:N,option:st(N,d),compact:!0}):e.jsx("span",{className:"zf-symbol-empty",children:"No ticker"}),typeof c.amount=="number"&&e.jsxs("span",{className:"zf-holding-amount",children:["x ",c.amount]})]}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${N||"holding"}`,onClick:()=>{h(f.filter((g,C)=>C!==z))},children:e.jsx(Ie,{size:13,"aria-hidden":"true"})})]},`${N}-${z}`)})}),e.jsx(Je,{disabled:p,loading:n,options:d,selectedSymbols:u,placeholder:p?"Maximum holdings added":"Add holding",keepOpenOnSelect:!0,onSelect:c=>{p||h([...f,{symbol:c,amount:1}])}})]})}function Ze({title:t,detail:a,loading:n}){return e.jsxs("div",{className:"zf-symbol-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"zf-symbol-label",children:t}),e.jsx("div",{className:"zf-symbol-detail",children:a})]}),e.jsx("span",{className:n?"zf-symbol-source is-loading":"zf-symbol-source",children:n?"Loading":"Live list"})]})}function ls(t,a){return typeof a.maxItems=="number"?`${t}/${a.maxItems}`:typeof a.minItems=="number"&&t<a.minItems?`${t}/${a.minItems}+`:String(t)}function st(t,a){return a.find(n=>n.symbol===t)??et(t)}function ga({symbols:t,options:a,onRemove:n}){return t.length===0?e.jsx("div",{className:"zf-symbol-empty",children:"No tickers selected"}):e.jsx("div",{className:"zf-symbol-chips",children:t.map(d=>e.jsxs("span",{className:"zf-symbol-chip",children:[e.jsx(at,{symbol:d,option:st(d,a),compact:!0}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${d}`,onClick:()=>n(d),children:e.jsx(Ie,{size:13,"aria-hidden":"true"})})]},d))})}function at({symbol:t,option:a,compact:n=!1}){return e.jsxs("span",{className:n?"zf-selected-symbol is-compact":"zf-selected-symbol",children:[e.jsx(ys,{symbol:t}),e.jsxs("span",{className:"zf-selected-symbol-text",children:[e.jsx("strong",{children:ye(t)}),!n&&e.jsx("em",{children:t})]}),!n&&a.markPx!==void 0&&e.jsx("span",{className:"zf-selected-symbol-price",children:ps(a.markPx)})]})}function Je({disabled:t=!1,loading:a,options:n,selectedSymbols:d,placeholder:v,keepOpenOnSelect:m=!1,onSelect:h}){const[u,f]=r.useState(""),[p,c]=r.useState(!1),z=r.useMemo(()=>new Set(d),[d]),N=r.useMemo(()=>new Set(n.map(y=>y.symbol)),[n]),g=ta(u),C=r.useMemo(()=>{const y=u.trim().toLowerCase();return(y?n.filter(E=>E.ticker.toLowerCase().includes(y)||E.symbol.toLowerCase().includes(y)):n.slice(0,28)).slice().sort((E,ce)=>os(E,y)-os(ce,y)).slice(0,36)},[n,u]),T=r.useMemo(()=>{if(!g)return[];const y=g.includes(":")?[g]:[`xyz:${g}`,g];return y.filter((j,E)=>y.indexOf(j)===E&&!N.has(j)&&!z.has(j))},[N,g,z]),A=y=>{!y||m&&z.has(y)||(h(y),f(""),c(m))};return e.jsxs("div",{className:"zf-symbol-combo",onBlur:y=>{y.currentTarget.contains(y.relatedTarget)||c(!1)},children:[e.jsxs("div",{className:t?"zf-symbol-search is-disabled":"zf-symbol-search",children:[e.jsx(Ys,{size:14,"aria-hidden":"true"}),e.jsx("input",{value:u,disabled:t,placeholder:v,"aria-label":v,role:"combobox","aria-expanded":p,onFocus:()=>c(!0),onChange:y=>{f(y.target.value),c(!0)},onKeyDown:y=>{var j;y.key==="Enter"&&(y.preventDefault(),A(((j=C[0])==null?void 0:j.symbol)??T[0]??g))}}),e.jsx(qs,{size:14,"aria-hidden":"true"})]}),p&&!t&&e.jsxs("div",{className:"zf-symbol-menu",role:"listbox",children:[a&&e.jsx("div",{className:"zf-symbol-menu-status",children:"Loading live universe..."}),C.map(y=>{const j=z.has(y.symbol);return e.jsxs("button",{type:"button",className:j?"zf-symbol-option is-selected":"zf-symbol-option",disabled:m&&j,role:"option","aria-selected":j,onMouseDown:E=>{E.preventDefault(),A(y.symbol)},onClick:E=>{E.detail===0&&A(y.symbol)},children:[e.jsx(ys,{symbol:y.symbol}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:y.ticker}),e.jsx("em",{children:y.symbol})]}),e.jsxs("span",{className:"zf-symbol-option-meta",children:[e.jsx("span",{children:ps(y.markPx)||y.kind}),y.changePct!==void 0&&e.jsx("span",{className:y.changePct>=0?"zf-symbol-change is-up":"zf-symbol-change is-down",children:sa(y.changePct)})]}),j&&e.jsx(Ws,{size:14,"aria-hidden":"true"})]},y.symbol)}),T.map(y=>e.jsxs("button",{type:"button",className:"zf-symbol-option zf-symbol-option--custom",onMouseDown:j=>{j.preventDefault(),A(y)},onClick:j=>{j.detail===0&&A(y)},children:[e.jsx("span",{className:"zf-symbol-custom-icon",children:e.jsx(Vs,{size:13,"aria-hidden":"true"})}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:ye(y)}),e.jsx("em",{children:y})]}),e.jsx("span",{className:"zf-symbol-option-meta",children:e.jsx("span",{children:nt(y)})})]},y)),!a&&C.length===0&&T.length===0&&e.jsx("div",{className:"zf-symbol-menu-status",children:"No matches"})]})]})}function os(t,a){if(!a)return t.rank;const n=t.ticker.toLowerCase(),d=t.symbol.toLowerCase();return n===a||d===a?-40+t.rank/1e4:n.startsWith(a)?-20+t.rank/1e4:d.startsWith(a)?-10+t.rank/1e4:t.rank}function ys({symbol:t}){const a=nt(t).toLowerCase(),[n,d]=r.useState(!1);return r.useEffect(()=>d(!1),[t]),n?e.jsx("span",{className:`zf-symbol-avatar zf-symbol-avatar--${a}`,children:ye(t).slice(0,2)}):e.jsx("img",{className:`zf-symbol-avatar zf-symbol-avatar--logo zf-symbol-avatar--${a}`,src:ea(t),alt:"","aria-hidden":"true",draggable:!1,loading:"lazy",onError:()=>d(!0)})}const ba=24;function cs(t,a){var n;return a==="flow-horizontal"?(n=t.layouts)==null?void 0:n["flow-horizontal"]:t.position}function us(t,a){const n=t.reduce((d,v)=>d+Math.max(1,v.position.w)*Math.min(Math.max(1,v.position.h),a),0);return Math.max(ba,Math.ceil(n/a*1.25)+8)}function ds(t,a,n){var h;const d=new Set,v=(u,f,p,c)=>{for(let z=0;z<p;z++)for(let N=0;N<c;N++){const g=u+z,C=f+N;g>=0&&C>=0&&d.add(`${g},${C}`)}},m=(u,f,p,c)=>{if(u+p>a||f+c>n)return!1;for(let z=0;z<p;z++)for(let N=0;N<c;N++)if(d.has(`${u+z},${f+N}`))return!1;return!0};for(const u of t){const f=(h=u.layouts)==null?void 0:h["flow-horizontal"];f&&v(f.x,f.y,f.w,Math.min(f.h,n))}return t.map(u=>{var z;if((z=u.layouts)!=null&&z["flow-horizontal"])return u;const f=Math.min(Math.max(1,u.position.w),a),p=Math.min(Math.max(1,u.position.h),n);let c={x:0,y:0,w:f,h:p};e:for(let N=0;N<=a-f;N++)for(let g=0;g<=n-p;g++)if(m(N,g,f,p)){c={x:N,y:g,w:f,h:p};break e}return v(c.x,c.y,c.w,c.h),{...u,layouts:{...u.layouts,"flow-horizontal":c}}})}const ya='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';function Qe(t){queueMicrotask(()=>t.unmount())}function va({spec:t,registry:a,onSave:n,customiseButtonTarget:d,onAccentHueChange:v,onAccentSatChange:m,onFontScaleChange:h,onUpColorChange:u,onDownColorChange:f,onModeChange:p,onBackgroundChange:c}){var Kt;const z=Ts(),N=r.useRef(null),g=r.useRef(null),C=r.useRef(!1),T=r.useRef(t.grid.mode),A=r.useRef(new Map),y=r.useRef(new Map),j=r.useRef(new Map),E=r.useRef([]),ce=r.useRef(t.theme.accentHue),fe=r.useRef(t.theme.accentSat),lt=r.useRef(t.theme.baseHue),ot=r.useRef(t.theme.baseSat),ct=r.useRef(t.theme.upColor),ut=r.useRef(t.theme.downColor),dt=r.useRef(t.grid.gap),mt=r.useRef(t.grid.mode),he=r.useRef(null),ft=r.useRef(t.appearance.radius),ht=r.useRef(t.appearance.borderStrength),pt=r.useRef(t.appearance.surfaceOpacity),gt=r.useRef(t.appearance.density),bt=r.useRef(t.appearance.elevation),yt=r.useRef(t.typography.fontFamily),xt=r.useRef(t.typography.numericStyle),zt=r.useRef(t.typography.scale),jt=r.useRef(t.background.type),Nt=r.useRef(t.background.projectId),vt=r.useRef(t.background.opacity),kt=r.useRef(t.background.color),wt=r.useRef(t.background.gradientFrom),St=r.useRef(t.background.gradientTo),Ct=r.useRef(t.background.gradientAngle),Rt=r.useRef(0),[F,Le]=r.useState(!1),xs=ca(z,F),[xa,pe]=r.useState(t.frames.length),[O,xe]=r.useState(t.theme.accentHue),[P,ze]=r.useState(t.theme.accentSat),[G,je]=r.useState(t.theme.baseHue),[D,Ne]=r.useState(t.theme.baseSat),[_,$e]=r.useState(t.theme.upColor),[W,He]=r.useState(t.theme.downColor),[L,At]=r.useState(t.grid.mode),[zs,Mt]=r.useState(!1),[U,Oe]=r.useState(t.grid.gap),[q,ve]=r.useState(t.appearance.radius),[K,ke]=r.useState(t.appearance.borderStrength),[V,we]=r.useState(t.appearance.surfaceOpacity),[X,Se]=r.useState(t.appearance.density),[Y,Ce]=r.useState(t.appearance.elevation),[se,Pe]=r.useState(t.typography.fontFamily),[ae,Be]=r.useState(t.typography.numericStyle),[Z,Ge]=r.useState(t.typography.scale),[B,Et]=r.useState(t.background.type),[re,Tt]=r.useState(t.background.projectId??Xe[0].projectId),[J,De]=r.useState(t.background.opacity),[Q,_e]=r.useState(t.background.color),[ne,Ft]=r.useState(t.background.gradientFrom),[ie,It]=r.useState(t.background.gradientTo),[ee,We]=r.useState(t.background.gradientAngle),js=r.useCallback(s=>{xe(s.theme.accentHue),ze(s.theme.accentSat),je(s.theme.baseHue),Ne(s.theme.baseSat),Pe(s.typography.fontFamily),Be(s.typography.numericStyle),ve(s.appearance.radius),ke(s.appearance.borderStrength),we(s.appearance.surfaceOpacity),Se(s.appearance.density),Ce(s.appearance.elevation)},[]),Lt=((Kt=rs.find(s=>s.theme.accentHue===O&&s.theme.accentSat===P&&s.theme.baseHue===G&&s.theme.baseSat===D&&s.typography.fontFamily===se&&s.typography.numericStyle===ae&&s.appearance.radius===q&&s.appearance.borderStrength===K&&s.appearance.surfaceOpacity===V&&s.appearance.density===X&&s.appearance.elevation===Y))==null?void 0:Kt.key)??null,[le,$t]=r.useState("frames"),[Ue,ue]=r.useState(null),Ht=r.useRef(null);Ht.current=Ue,r.useEffect(()=>{v==null||v(O)},[O,v]),r.useEffect(()=>{m==null||m(P)},[P,m]),r.useEffect(()=>{h==null||h(Z)},[Z,h]),r.useEffect(()=>{u==null||u(_)},[_,u]),r.useEffect(()=>{f==null||f(W)},[W,f]),r.useEffect(()=>{T.current=L,p==null||p(L)},[L,p]),r.useEffect(()=>{c==null||c({...t.background,type:B,projectId:re,opacity:J,color:Q,gradientFrom:ne,gradientTo:ie,gradientAngle:ee})},[B,re,J,Q,ne,ie,ee,t.background,c]),r.useEffect(()=>{var s;(s=g.current)==null||s.margin(U/2)},[U]);const Ot=r.useRef(z);Ot.current=z;const de=r.useRef(a);de.current=a;const Re=r.useMemo(()=>{const s=new Map;for(const l of a.values()){const x=l.category??"other",w=s.get(x);w?w.push(l):s.set(x,[l])}const o=ts.map(l=>l.key),i=ts.map(l=>({key:l.key,label:l.label,description:l.description,frames:s.get(l.key)??[]})),b=[...s.entries()].filter(([l])=>!o.includes(l)).flatMap(([,l])=>l);return b.length&&i.push({key:"other",label:"Other",description:"",frames:b}),i.filter(l=>l.frames.length>0).map(l=>({...l,frames:[...l.frames].sort((x,w)=>x.name.localeCompare(w.name))}))},[a]),[Pt,Ns]=r.useState(()=>new Set(Re[0]?[Re[0].key]:[])),vs=r.useCallback(s=>{Ns(o=>{const i=new Set(o);return i.has(s)?i.delete(s):i.add(s),i})},[]),ge=r.useCallback(s=>s?oa(s):{},[]),Ae=r.useCallback(s=>{let o=`${s}-${++Rt.current}`;for(;A.current.has(o);)o=`${s}-${++Rt.current}`;return o},[]),Me=r.useRef(null),te=r.useCallback(s=>{const o=j.current.get(s),i=A.current.get(s);if(!o||!i)return;let b=y.current.get(s);b||(o.innerHTML="",b=Es.createRoot(o),y.current.set(s,b)),b.render(e.jsx(Fs,{providers:Ot.current,children:e.jsx(Is.Provider,{value:l=>{var x;return(x=Me.current)==null?void 0:x.call(Me,s,l)},children:e.jsx(Ls,{instance:i,registry:de.current,className:"zf-fill"})})}))},[]),ks=r.useCallback((s,o)=>{const i=A.current.get(s);i&&(A.current.set(s,{...i,config:{...i.config,...o}}),te(s))},[te]);Me.current=ks;const Bt=r.useCallback(s=>{const o=g.current;if(!o)return;const i=s.getAttribute("gs-id");if(i){const b=y.current.get(i);b&&Qe(b),y.current.delete(i),j.current.delete(i),A.current.delete(i),Ht.current===i&&ue(null)}o.removeWidget(s,!0),pe(o.getGridItems().length)},[]),oe=r.useCallback(s=>{if(!s.querySelector(".zf-cfg-btn")){const o=document.createElement("button");o.className="zf-cfg-btn",o.type="button",o.title="Edit frame",o.setAttribute("aria-label","Edit frame"),o.innerHTML=ya,o.addEventListener("click",i=>{i.stopPropagation();const b=s.getAttribute("gs-id");b&&ue(b)}),s.appendChild(o)}if(!s.querySelector(".zf-del-btn")){const o=document.createElement("button");o.className="zf-del-btn",o.type="button",o.title="Remove frame",o.innerHTML="&times;",o.addEventListener("click",i=>{i.stopPropagation(),Bt(s)}),s.appendChild(o)}},[Bt]),Gt=r.useCallback(s=>{var o,i;(o=s.querySelector(".zf-cfg-btn"))==null||o.remove(),(i=s.querySelector(".zf-del-btn"))==null||i.remove()},[]),Ee=r.useCallback((s,o=!1)=>{const i=T.current,b=i==="flow-horizontal",l=cs(s,i),x=(l==null?void 0:l.w)??s.position.w,w=(l==null?void 0:l.h)??s.position.h,k=b?Math.min(w,t.grid.rows):w,M=de.current.get(s.frame),S=M==null?void 0:M.layout,R=document.createElement("div");R.className="grid-stack-item",R.setAttribute("gs-id",s.id),R.setAttribute("data-frame",s.frame),o||!l?R.setAttribute("gs-auto-position","true"):(R.setAttribute("gs-x",String(l.x)),R.setAttribute("gs-y",String(l.y))),R.setAttribute("gs-w",String(x)),R.setAttribute("gs-h",String(k)),S!=null&&S.minW&&R.setAttribute("gs-min-w",String(S.minW)),S!=null&&S.minH&&R.setAttribute("gs-min-h",String(S.minH)),S!=null&&S.maxW&&R.setAttribute("gs-max-w",String(S.maxW)),S!=null&&S.maxH&&R.setAttribute("gs-max-h",String(S.maxH));const I=document.createElement("div");return I.className="grid-stack-item-content",R.appendChild(I),j.current.set(s.id,I),R},[t.grid.rows]),be=r.useCallback(s=>{const o=g.current;if(o){y.current.forEach(Qe),y.current.clear(),j.current.clear(),A.current=new Map(s.map(i=>[i.id,i])),o.removeAll(!0),o.el.querySelectorAll(".grid-stack-item").forEach(i=>i.remove()),o.batchUpdate();for(const i of s){const b=Ee(i);o.el.appendChild(b),o.makeWidget(b),te(i.id)}o.batchUpdate(!1),pe(s.length)}},[Ee,te]),Dt=r.useCallback(s=>{var w,k;const o=g.current;if(!o)return;const i=de.current.get(s),b=Ae(s),l={id:b,frame:s,position:{x:0,y:0,w:((w=i==null?void 0:i.layout)==null?void 0:w.w)??4,h:((k=i==null?void 0:i.layout)==null?void 0:k.h)??3},config:ge(i)};A.current.set(b,l);const x=Ee(l,!0);o.el.appendChild(x),o.makeWidget(x),te(b),oe(x),pe(o.getGridItems().length),ue(b)},[Ee,oe,ge,te,Ae]),Te=r.useCallback(()=>{var b,l;const s=typeof window<"u"?window.innerHeight:800,o=((l=(b=N.current)==null?void 0:b.parentElement)==null?void 0:l.getBoundingClientRect().top)??120,i=s-o-56;return Math.max(80,Math.floor(i/t.grid.rows))},[t.grid.rows]),qe=r.useCallback(()=>{const s=g.current;if(!s)return;const o=s.el;s.off("dropped"),s.off("removed"),s.off("drag"),s.off("dragstart"),s.off("dragstop"),document.body.classList.remove("zf-dragging"),y.current.forEach(Qe),y.current.clear(),j.current.clear(),s.destroy(!1),o&&(o.querySelectorAll(".grid-stack-item").forEach(i=>i.remove()),o.style.width="",o.style.height=""),g.current=null},[]),Ke=r.useCallback((s,o)=>{const i=s==="flow-horizontal",b=i?Te():t.grid.rowHeight,l=es.init({column:i?o:t.grid.columns,cellHeight:b,margin:t.grid.gap/2,float:!0,...i?{maxRow:t.grid.rows,minRow:t.grid.rows}:{},animate:!0,acceptWidgets:!0,disableDrag:!0,disableResize:!0},N.current);return l.el.style.width=i?`${o*b}px`:"",l.on("dropped",(x,w,k)=>{var Zt,Jt;const M=k==null?void 0:k.el;if(!M)return;const S=M.querySelector(".grid-stack-item-content"),R=M.getAttribute("data-frame");if(!S||!R)return;const I=M.getAttribute("gs-id")||Ae(R);M.setAttribute("gs-id",I);const H=de.current.get(R),Vt=(k==null?void 0:k.w)??((Zt=H==null?void 0:H.layout)==null?void 0:Zt.w)??4,Xt=(k==null?void 0:k.h)??((Jt=H==null?void 0:H.layout)==null?void 0:Jt.h)??3,Yt={x:(k==null?void 0:k.x)??0,y:(k==null?void 0:k.y)??0,w:Vt,h:Xt},Ms=T.current==="flow-horizontal"?{id:I,frame:R,position:{x:0,y:0,w:Vt,h:Xt},layouts:{"flow-horizontal":Yt},config:ge(H)}:{id:I,frame:R,position:Yt,config:ge(H)};A.current.set(I,Ms),j.current.set(I,S),te(I),oe(M),pe(l.getGridItems().length),ue(I)}),l.on("removed",()=>pe(l.getGridItems().length)),l.on("dragstart",()=>document.body.classList.add("zf-dragging")),l.on("dragstop",()=>document.body.classList.remove("zf-dragging")),i&&l.on("drag",x=>{var R,I,H;const w=(R=N.current)==null?void 0:R.parentElement;if(!w)return;const k=w.getBoundingClientRect(),M=x.clientX??((H=(I=x.touches)==null?void 0:I[0])==null?void 0:H.clientX);if(M==null)return;const S=64;M<k.left+S?w.scrollLeft-=18:M>k.right-S&&(w.scrollLeft+=18)}),l},[Te,t.grid.columns,t.grid.rowHeight,t.grid.rows,t.grid.gap,Ae,ge,te,oe]);r.useEffect(()=>{if(!N.current||C.current)return;C.current=!0;const s=T.current==="flow-horizontal",o=s?us(t.frames,t.grid.rows):t.grid.columns;return g.current=Ke(T.current,o),be(s?ds(t.frames,o,t.grid.rows):t.frames),()=>{qe(),C.current=!1}},[]),r.useEffect(()=>{const s=g.current;s&&(s.enableMove(F),s.enableResize(F),F?s.getGridItems().forEach(oe):s.getGridItems().forEach(Gt))},[F,oe,Gt]),r.useEffect(()=>{const s=g.current;if(!s||T.current!=="flow-horizontal")return;const o=requestAnimationFrame(()=>{const i=Te();s.cellHeight(i),s.el.style.width=`${s.getColumn()*i}px`});return()=>cancelAnimationFrame(o)},[F,Te]),r.useEffect(()=>{!F||le!=="frames"||!g.current||es.setupDragIn(".zf-newwidget",{appendTo:"body",helper:s=>{var S;const i=(s.closest(".zf-newwidget")??s).dataset.frame??"",b=de.current.get(i),l=b==null?void 0:b.layout,x=document.createElement("div");x.className="grid-stack-item",x.setAttribute("data-frame",i),x.setAttribute("gs-w",String((l==null?void 0:l.w)??4)),x.setAttribute("gs-h",String((l==null?void 0:l.h)??3)),l!=null&&l.minW&&x.setAttribute("gs-min-w",String(l.minW)),l!=null&&l.minH&&x.setAttribute("gs-min-h",String(l.minH)),l!=null&&l.maxW&&x.setAttribute("gs-max-w",String(l.maxW)),l!=null&&l.maxH&&x.setAttribute("gs-max-h",String(l.maxH));const w=(S=N.current)==null?void 0:S.closest(".zf-editor");if(w){const R=getComputedStyle(w);for(const I of["--zf-accent-hue","--zf-accent-sat","--font-dmsans"]){const H=R.getPropertyValue(I).trim();H&&x.style.setProperty(I,H)}}const k=i.replace(/-/g," "),M=b!=null&&b.iconUrl?`<img class="zf-drag-ghost-icon" src="${b.iconUrl}" alt="" />`:"";return x.innerHTML=`<div class="grid-stack-item-content zf-drag-ghost" data-frame="${i}">${M}<span class="zf-drag-ghost-name">${k}</span></div>`,x}})},[F,le,Re,Pt]);const Fe=r.useCallback(()=>{const s=g.current,o=[];if(s)for(const i of s.getGridItems()){const b=i.getAttribute("gs-id");if(!b)continue;const l=A.current.get(b);if(!l)continue;const x=i.gridstackNode,w=cs(l,L)??l.position,k={x:(x==null?void 0:x.x)??w.x,y:(x==null?void 0:x.y)??w.y,w:(x==null?void 0:x.w)??w.w,h:(x==null?void 0:x.h)??w.h};o.push(L==="flow-horizontal"?{...l,layouts:{...l.layouts,"flow-horizontal":k}}:{...l,position:k})}return o.sort((i,b)=>i.position.y-b.position.y||i.position.x-b.position.x),{...t,grid:{...t.grid,gap:U,mode:L},background:{...t.background,type:B,projectId:re,opacity:J,color:Q,gradientFrom:ne,gradientTo:ie,gradientAngle:ee},theme:{...t.theme,accentHue:O,accentSat:P,baseHue:G,baseSat:D,upColor:_,downColor:W},typography:{...t.typography,fontFamily:se,numericStyle:ae,scale:Z},appearance:{...t.appearance,radius:q,borderStrength:K,surfaceOpacity:V,density:X,elevation:Y},frames:o}},[t,O,P,G,D,_,W,se,ae,Z,U,L,q,K,V,X,Y,B,re,J,Q,ne,ie,ee]),_t=r.useCallback(s=>{const o=new Blob([`${JSON.stringify(s,null,2)}
68
- `],{type:"application/json"}),i=URL.createObjectURL(o),b=document.createElement("a");b.href=i,b.download="dashboard.json",b.click(),setTimeout(()=>URL.revokeObjectURL(i),0)},[]),ws=r.useCallback(()=>{E.current=Fe().frames,ce.current=O,fe.current=P,lt.current=G,ot.current=D,ct.current=_,ut.current=W,dt.current=U,mt.current=L,ft.current=q,ht.current=K,pt.current=V,gt.current=X,bt.current=Y,yt.current=se,xt.current=ae,zt.current=Z,jt.current=B,Nt.current=re,vt.current=J,kt.current=Q,wt.current=ne,St.current=ie,Ct.current=ee,Le(!0)},[Fe,O,P,G,D,_,W,U,L,q,K,V,X,Y,se,ae,Z,B,re,J,Q,ne,ie,ee]),Ss=r.useCallback(()=>{be(E.current),xe(ce.current),ze(fe.current),je(lt.current),Ne(ot.current),$e(ct.current),He(ut.current),Oe(dt.current),At(mt.current),ve(ft.current),ke(ht.current),we(pt.current),Se(gt.current),Ce(bt.current),Pe(yt.current),Be(xt.current),Ge(zt.current),Et(jt.current),Tt(Nt.current??Xe[0].projectId),De(vt.current),_e(kt.current),Ft(wt.current),It(St.current),We(Ct.current),ue(null),Le(!1)},[be]),Cs=r.useCallback(async()=>{const s=Fe();Le(!1),ue(null),n?await n(s):_t(s)},[Fe,n,_t]),Rs=r.useCallback(()=>{var s;(s=g.current)==null||s.compact(T.current==="flow-horizontal"?"list":"compact")},[]),Wt=r.useCallback(()=>{const s=g.current;if(!s)return;const o=T.current;for(const i of s.getGridItems()){const b=i.getAttribute("gs-id");if(!b)continue;const l=A.current.get(b);if(!l)continue;const x=i.gridstackNode;if(!x)continue;const w={x:x.x??0,y:x.y??0,w:x.w??1,h:x.h??1};A.current.set(b,o==="flow-horizontal"?{...l,layouts:{...l.layouts,"flow-horizontal":w}}:{...l,position:w})}},[]),Ut=r.useCallback(s=>{var b;if(s===T.current)return;const o=()=>{Wt();const l=[...A.current.values()],x=F,w=s==="flow-horizontal",k=w?us(l,t.grid.rows):t.grid.columns;qe(),T.current=s,At(s);const M=Ke(s,k);g.current=M,be(w?ds(l,k,t.grid.rows):l),x&&(M.enableMove(!0),M.enableResize(!0),M.getGridItems().forEach(oe))};if(typeof window<"u"&&((b=window.matchMedia)==null?void 0:b.call(window,"(prefers-reduced-motion: reduce)").matches)){o();return}he.current&&clearTimeout(he.current),Mt(!0),he.current=setTimeout(()=>{o(),requestAnimationFrame(()=>Mt(!1))},150)},[F,Wt,qe,Ke,be,oe,t.grid.rows,t.grid.columns]);r.useEffect(()=>()=>{he.current&&clearTimeout(he.current)},[]);const qt=()=>e.jsx("button",{type:"button",className:"zf-btn zf-btn--icon",onClick:ws,"aria-label":"Customise",title:"Customise",children:e.jsx(Js,{size:18,"aria-hidden":"true"})}),Ve=F&&Ue?A.current.get(Ue):void 0,As=L==="flow-horizontal";return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:$s}),d&&!F?Qt.createPortal(qt(),d):null,e.jsxs("div",{className:F?"zf-editor zf-customise":"zf-editor","data-mode":L,style:{"--zf-accent-hue":O,"--zf-accent-sat":`${P}%`,"--zf-base-hue":G,"--zf-base-sat":`${D}%`,"--zf-up":_,"--zf-down":W,"--zf-font-family":as[se],"--zf-numeric":ss[ae],"--zf-frame-radius":`${q}px`,"--zf-border-alpha":K,"--zf-surface-opacity":V,"--zf-density":X,"--zf-elevation":Y},children:[(F||!d)&&e.jsxs("div",{className:"zf-editor-bar",children:[e.jsx("div",{className:"zf-editor-bar-spacer"}),F?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Rs,title:"Reclaim empty grid space",children:"Tidy"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Ss,children:"Cancel"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:Cs,children:"Save"})]}):qt()]}),e.jsxs("div",{className:"zf-editor-main",children:[e.jsx("div",{className:"zf-editor-grid","data-switching":zs,children:e.jsx("div",{ref:N,className:"grid-stack"})}),e.jsx("aside",{className:"zf-rail","aria-hidden":!F,inert:!F,children:e.jsxs("div",{className:"zf-rail-inner",children:[e.jsxs("div",{className:"zf-rail-tabs",role:"tablist","aria-label":"Customise",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":le==="frames",className:le==="frames"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>$t("frames"),children:"Frames"}),e.jsx("button",{type:"button",role:"tab","aria-selected":le==="cosmetics",className:le==="cosmetics"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>$t("cosmetics"),children:"Cosmetics"})]}),le==="cosmetics"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Presets"}),e.jsx("div",{className:"zf-presets",children:rs.map(s=>e.jsxs("button",{type:"button",className:Lt===s.key?"zf-preset is-active":"zf-preset",title:s.description,"aria-pressed":Lt===s.key,onClick:()=>js(s),children:[e.jsx("span",{className:"zf-preset-swatch",style:{background:`linear-gradient(135deg, hsl(${s.theme.baseHue} ${s.theme.baseSat}% 16%) 0 52%, hsl(${s.theme.accentHue} ${s.theme.accentSat}% 62%) 52% 100%)`}}),e.jsx("span",{className:"zf-preset-label",children:s.label})]},s.key))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Accent"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("span",{className:"zf-theme-val",children:[e.jsx("span",{className:"zf-theme-swatch"}),"Hue ",O,"°"]}),O!==242&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>xe(242),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:O,"aria-label":"Accent hue",onChange:s=>xe(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Saturation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[P!==90&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ze(90),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[P,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:P,"aria-label":"Accent saturation",onChange:s=>ze(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Surface"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("span",{className:"zf-theme-val",children:[e.jsx("span",{className:"zf-theme-swatch",style:{background:`hsl(${G} ${D}% 32%)`,boxShadow:"none"}}),"Tint ",G,"°"]}),G!==233&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>je(233),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:G,"aria-label":"Surface tint hue",onChange:s=>je(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Tint strength"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[D!==20&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ne(20),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[D,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:D,"aria-label":"Surface tint strength",onChange:s=>Ne(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Gain / Loss"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:_,"aria-label":"Gain (up) colour",onChange:s=>$e(s.target.value)}),"Up ",_]}),_.toLowerCase()!=="#3fd08f"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>$e("#3fd08f"),children:"Reset"})]}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:9},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:W,"aria-label":"Loss (down) colour",onChange:s=>He(s.target.value)}),"Down ",W]}),W.toLowerCase()!=="#ff6b81"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>He("#ff6b81"),children:"Reset"})]})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Background"}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Background style",children:["none","color","gradient","unicorn"].map(s=>e.jsx("button",{type:"button",className:B===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":B===s,onClick:()=>Et(s),children:s==="none"?"Glow":s==="color"?"Color":s==="gradient"?"Gradient":"Scene"},s))}),B==="color"&&e.jsxs("div",{className:"zf-theme-row",style:{marginTop:12},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:Q,"aria-label":"Background colour",onChange:s=>_e(s.target.value)}),Q]}),Q.toLowerCase()!=="#0a0a12"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>_e("#0a0a12"),children:"Reset"})]}),B==="gradient"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"zf-theme-row",style:{marginTop:12},children:e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:ne,"aria-label":"Gradient start colour",onChange:s=>Ft(s.target.value)}),"From ",ne]})}),e.jsx("div",{className:"zf-theme-row",style:{marginTop:9},children:e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:ie,"aria-label":"Gradient end colour",onChange:s=>It(s.target.value)}),"To ",ie]})}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Angle"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[ee!==160&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>We(160),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[ee,"°"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:360,value:ee,"aria-label":"Gradient angle",onChange:s=>We(Number(s.target.value))})]}),B==="unicorn"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"zf-presets",style:{marginTop:12},role:"group","aria-label":"Background scene",children:Xe.map(s=>e.jsxs("button",{type:"button",className:re===s.projectId?"zf-preset is-active":"zf-preset",title:s.description,"aria-pressed":re===s.projectId,onClick:()=>Tt(s.projectId),children:[e.jsx("span",{className:"zf-preset-swatch",style:{background:s.swatch}}),e.jsx("span",{className:"zf-preset-label",children:s.label})]},s.key))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Opacity"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[J!==.16&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>De(.16),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(J*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:.6,step:.02,value:J,"aria-label":"Background scene opacity",onChange:s=>De(Math.round(Number(s.target.value)*100)/100)})]})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Layout"}),e.jsx("div",{className:"zf-theme-row",children:e.jsx("span",{className:"zf-theme-val",children:"Direction"})}),e.jsxs("div",{className:"zf-mode-seg",role:"group","aria-label":"Dashboard layout direction",children:[e.jsx("button",{type:"button",className:L==="flow-vertical"?"zf-mode-seg-btn is-active":"zf-mode-seg-btn","aria-pressed":L==="flow-vertical",onClick:()=>Ut("flow-vertical"),children:"Vertical"}),e.jsx("button",{type:"button",className:L==="flow-horizontal"?"zf-mode-seg-btn is-active":"zf-mode-seg-btn","aria-pressed":L==="flow-horizontal",onClick:()=>Ut("flow-horizontal"),children:"Horizontal"}),e.jsx("button",{type:"button",className:"zf-mode-seg-btn",disabled:!0,title:"Infinite canvas — coming soon",children:"Canvas"})]}),As&&e.jsx("p",{className:"zf-mode-seg-hint",children:"Rows fill the height; the board scrolls sideways. Arrange it freely — this layout is saved separately from Vertical."}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Frame gap"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[U!==12&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Oe(12),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[U,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:12,value:U,"aria-label":"Frame gap",onChange:s=>Oe(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Appearance"}),e.jsxs("div",{className:"zf-theme-row",children:[e.jsx("span",{className:"zf-theme-val",children:"Corner radius"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[q!==18&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ve(18),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[q,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:32,value:q,"aria-label":"Corner radius",onChange:s=>ve(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Border"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[K!==.22&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ke(.22),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(K*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:1,step:.01,value:K,"aria-label":"Border strength",onChange:s=>ke(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Card opacity"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[V!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>we(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(V*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.3,max:1,step:.05,value:V,"aria-label":"Card opacity",onChange:s=>we(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Density"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[X!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Se(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(X*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.6,max:1.4,step:.05,value:X,"aria-label":"Card density",onChange:s=>Se(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Elevation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[Y!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ce(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Y.toFixed(1),"×"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:2,step:.1,value:Y,"aria-label":"Card elevation",onChange:s=>Ce(Math.round(Number(s.target.value)*10)/10)})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Typography"}),e.jsx("div",{className:"zf-theme-row",children:e.jsx("span",{className:"zf-theme-val",children:"Font"})}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Font family",children:["sans","mono","serif"].map(s=>e.jsx("button",{type:"button",className:se===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":se===s,style:{fontFamily:as[s]},onClick:()=>Pe(s),children:s==="sans"?"Sans":s==="mono"?"Mono":"Serif"},s))}),e.jsx("div",{className:"zf-theme-row",style:{marginTop:13},children:e.jsx("span",{className:"zf-theme-val",children:"Numbers"})}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Numeric style",children:["proportional","tabular"].map(s=>e.jsx("button",{type:"button",className:ae===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":ae===s,onClick:()=>Be(s),children:e.jsx("span",{style:{fontVariantNumeric:ss[s]},children:s==="proportional"?"Normal 1,071":"Tabular 1,071"})},s))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Text size"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[Z!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ge(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(Z*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.85,max:1.25,step:.05,value:Z,"aria-label":"Text size",onChange:s=>Ge(Math.round(Number(s.target.value)*100)/100)})]})]}),le==="frames"&&e.jsxs("section",{children:[e.jsx("h3",{className:"zf-rail-title",children:"Add a frame"}),e.jsx("p",{className:"zf-palette-hint",children:"Open a category, then click a frame to add it — or drag it onto the grid."}),e.jsx("div",{className:"zf-palette-cats",children:Re.map(s=>{const o=Pt.has(s.key);return e.jsxs("div",{className:o?"zf-palette-cat is-open":"zf-palette-cat",children:[e.jsxs("button",{type:"button",className:"zf-palette-cat-header","aria-expanded":o,onClick:()=>vs(s.key),children:[e.jsx("svg",{className:"zf-palette-cat-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"zf-palette-cat-label",children:s.label}),e.jsx("span",{className:"zf-palette-cat-count",children:s.frames.length})]}),o&&e.jsxs("div",{className:"zf-palette-cat-body",children:[s.description&&e.jsx("p",{className:"zf-palette-cat-desc",children:s.description}),e.jsx("div",{className:"zf-palette",children:s.frames.map(i=>{var b,l,x,w,k,M;return e.jsxs("div",{className:"grid-stack-item zf-newwidget","data-frame":i.name,"gs-w":((b=i.layout)==null?void 0:b.w)??4,"gs-h":((l=i.layout)==null?void 0:l.h)??3,"gs-min-w":(x=i.layout)==null?void 0:x.minW,"gs-min-h":(w=i.layout)==null?void 0:w.minH,"gs-max-w":(k=i.layout)==null?void 0:k.maxW,"gs-max-h":(M=i.layout)==null?void 0:M.maxH,role:"button",tabIndex:0,title:`Drag onto the board, or click to add ${i.name.replace(/-/g," ")}`,onClick:()=>Dt(i.name),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),Dt(i.name))},children:[i.iconUrl&&e.jsx("img",{className:"zf-newwidget-icon",src:i.iconUrl,alt:"",loading:"lazy",draggable:!1}),e.jsxs("div",{className:"zf-newwidget-copy",children:[e.jsx("div",{className:"zf-newwidget-name",children:i.name.replace(/-/g," ")}),e.jsx("div",{className:"zf-newwidget-desc",children:i.description})]})]},i.name)})})]})]},s.key)})})]})]})})]})]}),Ve?Qt.createPortal(e.jsx(ua,{instance:Ve,registry:a,instancesRef:A,symbolUniverse:xs,accentHue:O,onApply:s=>te(s),onClose:()=>ue(null)},Ve.id),document.body):null]})}export{va as DashboardEditor};