zframes 0.5.2 → 0.6.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.
- package/NOTICE +6 -2
- package/dist/index.js +614 -10
- package/package.json +2 -2
- package/runtime/assets/{bitcoin-dominance-CtnczH5N.js → bitcoin-dominance-CweHlZx7.js} +1 -1
- package/runtime/assets/{breakeven-zbCEQ5ag.js → breakeven-CG9rKwgE.js} +1 -1
- package/runtime/assets/{breathing-6Wmy_hqF.js → breathing-cDundHq6.js} +1 -1
- package/runtime/assets/{btc-blocks-D1xOLm2L.js → btc-blocks-Do_nySHd.js} +1 -1
- package/runtime/assets/{btc-difficulty-BTbKIqrl.js → btc-difficulty-vNbz5uRo.js} +1 -1
- package/runtime/assets/{btc-fees-5Geh2TSa.js → btc-fees-BmADLsmK.js} +1 -1
- package/runtime/assets/{btc-hashrate-DZfnxUsi.js → btc-hashrate-Wx2RAG-5.js} +1 -1
- package/runtime/assets/{btc-mempool-8oOMDiaW.js → btc-mempool-CTwbkMUR.js} +1 -1
- package/runtime/assets/{calculator-D91iI7KM.js → calculator-mvv6XpQC.js} +1 -1
- package/runtime/assets/{checklist-DNrOJw0w.js → checklist-CuEw3GpE.js} +1 -1
- package/runtime/assets/{clock-BzAIAbhU.js → clock-Cjnwi03W.js} +1 -1
- package/runtime/assets/{coin-movers-99W2EABZ.js → coin-movers-Bcx1XR0F.js} +1 -1
- package/runtime/assets/{countdown-ZAJmbykg.js → countdown-Cdi5gSSu.js} +1 -1
- package/runtime/assets/cycle-shared-BOGcJDzT.js +1 -0
- package/runtime/assets/cycle-signals-CS629ZDc.js +1 -0
- package/runtime/assets/{daily-analysis-CS5MqofA.js → daily-analysis-DX8bVq85.js} +1 -1
- package/runtime/assets/{day-meter-DzBvLcpd.js → day-meter-DDfTuhms.js} +1 -1
- package/runtime/assets/defi-revenue-CpeAGwhb.js +1 -0
- package/runtime/assets/{dex-volume-chart-BfnczfAT.js → dex-volume-chart-sHIuJACJ.js} +1 -1
- package/runtime/assets/{dex-volume-treemap-CLyIrkgU.js → dex-volume-treemap-rSTrzz7O.js} +1 -1
- package/runtime/assets/{dice-CAvRf0md.js → dice-BrFORdjN.js} +1 -1
- package/runtime/assets/{dino-game-gsyCpJ-0.js → dino-game-BOV8mV1d.js} +1 -1
- package/runtime/assets/{divider-DCTu-qNh.js → divider-C33tH1RU.js} +1 -1
- package/runtime/assets/{drawdy-CZWCFtog.js → drawdy-BIb36JN9.js} +1 -1
- package/runtime/assets/dxy-CRifEdp_.js +1 -0
- package/runtime/assets/editor-CZoWRTJC.css +1 -0
- package/runtime/assets/editor-Dnp1eXvY.js +68 -0
- package/runtime/assets/etf-flows-BV10E2R-.js +1 -0
- package/runtime/assets/etf-flows-chart-DHu8mkXm.js +1 -0
- package/runtime/assets/eth-staking-BqWeJq6F.js +1 -0
- package/runtime/assets/eth-supply-CF-MgHjn.js +1 -0
- package/runtime/assets/{fear-greed-DOcPswrx.js → fear-greed-DuDR56h2.js} +1 -1
- package/runtime/assets/{filings-feed-Cs--DpYl.js → filings-feed-BpfO2yF6.js} +1 -1
- package/runtime/assets/{financial-stress-BqnxLk2O.js → financial-stress-BfYJdlry.js} +1 -1
- package/runtime/assets/{flappy-bird-DaasqVGg.js → flappy-bird-Dbb2UQBv.js} +1 -1
- package/runtime/assets/{fundamentals-GseULnsD.js → fundamentals-CUnqjF--.js} +1 -1
- package/runtime/assets/funding-comparison-CMKxW1n-.js +1 -0
- package/runtime/assets/{funding-heatmap-2RvVLTPN.js → funding-heatmap-CZWnYF8Y.js} +1 -1
- package/runtime/assets/{funding-rate-chart-DCRKHp6g.js → funding-rate-chart-C-tpwid_.js} +1 -1
- package/runtime/assets/{fx-board-CVW6VmbY.js → fx-board-YAy44m5d.js} +1 -1
- package/runtime/assets/{heading-BaRMJq2t.js → heading-uIVBEE7K.js} +1 -1
- package/runtime/assets/{holiday-calendar-2OBfwbh-.js → holiday-calendar-DCj83hi2.js} +1 -1
- package/runtime/assets/{image-CuTXEV7Q.js → image-CITPAmp0.js} +1 -1
- package/runtime/assets/index-Bx7RmzY8.js +1 -0
- package/runtime/assets/index-CrmTiZaB.css +1 -0
- package/runtime/assets/index-DyvZokhk.js +1097 -0
- package/runtime/assets/indicators-CogwjDn9.js +1 -0
- package/runtime/assets/{inflation-pulse-B8E9uzQB.js → inflation-pulse-Bqa3-cuC.js} +1 -1
- package/runtime/assets/{journal-log-7APM_99k.js → journal-log-Bgjia8cQ.js} +1 -1
- package/runtime/assets/{journal-open-CcdGuysA.js → journal-open-Bm5gwWXz.js} +1 -1
- package/runtime/assets/{journal-results-CUTn4-kq.js → journal-results-cEWe2pbe.js} +1 -1
- package/runtime/assets/{journal-score-C31dg2yL.js → journal-score-vmfF-9bK.js} +1 -1
- package/runtime/assets/{journal-ui-C5ueSjZx.js → journal-ui-ApBNIq5_.js} +1 -1
- package/runtime/assets/{labor-market-DgvDQtFo.js → labor-market-azDXD-dR.js} +1 -1
- package/runtime/assets/{lightning-stats-CiUlm-e_.js → lightning-stats-nkyh2dOX.js} +1 -1
- package/runtime/assets/{link-grid-DlsY59eq.js → link-grid-BEo4b54T.js} +1 -1
- package/runtime/assets/ma-multiplier-BllDQMF5.js +1 -0
- package/runtime/assets/macro-calendar-Ck0dJk4p.js +1 -0
- package/runtime/assets/{market-cap-treemap-6vqLUgVk.js → market-cap-treemap-AxE2EYPO.js} +1 -1
- package/runtime/assets/{market-hours-BArlXOQB.js → market-hours-BSwXtU8c.js} +1 -1
- package/runtime/assets/{marquee-2Di2SqI2.js → marquee-1Zr5qDJP.js} +1 -1
- package/runtime/assets/mayer-multiple-DpBJNd4d.js +1 -0
- package/runtime/assets/{mining-pools-Bg02wm2V.js → mining-pools-B-jxdTot.js} +1 -1
- package/runtime/assets/{mover-row-C8040L85.js → mover-row-Dg96EIqq.js} +1 -1
- package/runtime/assets/mvrv-Dx_S0TwE.js +1 -0
- package/runtime/assets/{national-debt-BS57WjA3.js → national-debt-BKVBHaqm.js} +1 -1
- package/runtime/assets/{news-feed-oBCTiuoo.js → news-feed-C9itZmyp.js} +1 -1
- package/runtime/assets/{note-BLWlz52v.js → note-BtCnmuMo.js} +1 -1
- package/runtime/assets/nupl-aIjkc57m.js +1 -0
- package/runtime/assets/{open-interest-DxMqZcmu.js → open-interest-C0ulogv6.js} +1 -1
- package/runtime/assets/{options-iv-CgIIFdpN.js → options-iv-CdUder3x.js} +1 -1
- package/runtime/assets/{options-oi-strike-blRp4kmB.js → options-oi-strike-CvCZnMCR.js} +1 -1
- package/runtime/assets/{options-put-call-CyOwXBVQ.js → options-put-call-FuaDHJ-S.js} +1 -1
- package/runtime/assets/pi-cycle-BuCnLnIJ.js +1 -0
- package/runtime/assets/{pomodoro-BKJlh-bz.js → pomodoro-DDBVVcSR.js} +1 -1
- package/runtime/assets/{portfolio-allocation-Cat1vq2_.js → portfolio-allocation-DAnQk_h_.js} +1 -1
- package/runtime/assets/{portfolio-common-DeyRfuNV.js → portfolio-common-Bi16i0aA.js} +1 -1
- package/runtime/assets/{portfolio-holdings-DDDhMMFL.js → portfolio-holdings-MyAinCzt.js} +1 -1
- package/runtime/assets/{portfolio-value-D9qrGeZp.js → portfolio-value-BPURwKf8.js} +1 -1
- package/runtime/assets/prediction-markets-Bzy51qnV.js +1 -0
- package/runtime/assets/{price-chart-CQJNOBtu.js → price-chart-BOCD8ka3.js} +1 -1
- package/runtime/assets/{price-compare-DqBiHd7S.js → price-compare-DZlF-qhZ.js} +1 -1
- package/runtime/assets/{price-liveline-BlVGC2-R.js → price-liveline-Bl7qCd5-.js} +1 -1
- package/runtime/assets/{price-ticker-QdVoVaQh.js → price-ticker-D2W4T02y.js} +1 -1
- package/runtime/assets/{protocol-fees-treemap-39F-aE33.js → protocol-fees-treemap-DiIt4bfo.js} +1 -1
- package/runtime/assets/{protocol-tvl-chart-DZOgbMZu.js → protocol-tvl-chart-CmzANiR7.js} +1 -1
- package/runtime/assets/{protocol-tvl-treemap-DusQ6xL2.js → protocol-tvl-treemap-BjNPrrtL.js} +1 -1
- package/runtime/assets/puell-multiple-BGrJX43r.js +1 -0
- package/runtime/assets/{quote-Di049ggj.js → quote-CRM3bfI7.js} +1 -1
- package/runtime/assets/{rates-board-Dm3tb6-P.js → rates-board-Cb9rV0_-.js} +1 -1
- package/runtime/assets/realized-price-CYlrFa0m.js +1 -0
- package/runtime/assets/reserve-risk-Be98XUsD.js +1 -0
- package/runtime/assets/{returns-projector-BiMx_kSw.js → returns-projector-D67a_yvC.js} +1 -1
- package/runtime/assets/{risk-reward-1Q_Kt75s.js → risk-reward-C7WMz2od.js} +1 -1
- package/runtime/assets/rsi-momentum-IglnulkJ.js +1 -0
- package/runtime/assets/{rules-card-BkAX9PEq.js → rules-card-DJs3fDVN.js} +1 -1
- package/runtime/assets/scene-uwfOGek1.js +1 -0
- package/runtime/assets/sector-performance-DVMaleLY.js +1 -0
- package/runtime/assets/sector-treemap-B681nSi6.js +1 -0
- package/runtime/assets/{session-progress-D_1dzPzM.js → session-progress-CZO3LqUi.js} +1 -1
- package/runtime/assets/{short-volume-U-uFonb2.js → short-volume-l8_9Yoh3.js} +1 -1
- package/runtime/assets/{snake-Dp4E3Dcv.js → snake-CifbTGlZ.js} +1 -1
- package/runtime/assets/sopr-Dw_oz-mC.js +1 -0
- package/runtime/assets/{spotify-embed-Cw95WZjV.js → spotify-embed-BA0m1IRb.js} +1 -1
- package/runtime/assets/stablecoin-chains-Dd2LqqqY.js +1 -0
- package/runtime/assets/stablecoin-supply-DM4ogL4V.js +1 -0
- package/runtime/assets/{stopwatch-B2_iDkKK.js → stopwatch-Co72v-7u.js} +1 -1
- package/runtime/assets/{top-movers--vCUiTII.js → top-movers-CLmC2TNu.js} +1 -1
- package/runtime/assets/{treasury-auctions-BpzYivLg.js → treasury-auctions-Dl9fiRgf.js} +1 -1
- package/runtime/assets/{treemap-leaf-DNIoJEK-.js → treemap-leaf-Dn31k9S9.js} +1 -1
- package/runtime/assets/trending-coins-Cpx9T6cG.js +1 -0
- package/runtime/assets/{tvl-treemap-BYgD9bNy.js → tvl-treemap-e610jE8k.js} +1 -1
- package/runtime/assets/{video-D-nBm697.js → video-CeKjM-cE.js} +1 -1
- package/runtime/assets/volume-profile-CiMFsIBu.js +1 -0
- package/runtime/assets/{yield-curve-8IsrMS_9.js → yield-curve-DkB0u2_Q.js} +1 -1
- package/runtime/assets/yield-scanner-BP90untT.js +1 -0
- package/runtime/index.html +2 -2
- package/runtime/assets/editor-BMMobjrE.css +0 -1
- package/runtime/assets/editor-Ckt9OQ98.js +0 -68
- package/runtime/assets/index-BqHx9BjX.css +0 -1
- package/runtime/assets/index-CH54P4Cn.js +0 -936
- package/runtime/assets/index-DK7jWlTL.js +0 -1
- package/runtime/assets/unicorn-scene-DcohHRPZ.js +0 -1
|
@@ -0,0 +1,1097 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scene-uwfOGek1.js","assets/react-qoZPGuNy.js","assets/portfolio-value-BPURwKf8.js","assets/liveline-bcaEuskN.js","assets/format-CfAcS4D8.js","assets/live-tick-9Q3ubPF9.js","assets/portfolio-common-Bi16i0aA.js","assets/ui-Bq3RQsdJ.js","assets/portfolio-allocation-DAnQk_h_.js","assets/chart-utils-BYIZMM9J.js","assets/d3-xK4fOkBU.js","assets/portfolio-holdings-MyAinCzt.js","assets/bitcoin-dominance-CweHlZx7.js","assets/clock-Cjnwi03W.js","assets/use-countdown-BmcF-qdL.js","assets/daily-analysis-DX8bVq85.js","assets/journal-log-Bgjia8cQ.js","assets/content-shared-BZ1XzrJx.js","assets/journal-store-KCRoPnI_.js","assets/journal-open-Bm5gwWXz.js","assets/journal-ui-ApBNIq5_.js","assets/journal-results-cEWe2pbe.js","assets/journal-score-vmfF-9bK.js","assets/dino-game-BOV8mV1d.js","assets/game-ui-Dy_QYsPr.js","assets/fear-greed-DuDR56h2.js","assets/mini-line-chart-CHM5UBjJ.js","assets/utils-DaT-yT0k.js","assets/filings-feed-BpfO2yF6.js","assets/feed-row-mVg1d5Zj.js","assets/fundamentals-CUnqjF--.js","assets/financial-stress-BfYJdlry.js","assets/labor-market-azDXD-dR.js","assets/national-debt-BKVBHaqm.js","assets/treasury-auctions-Dl9fiRgf.js","assets/metric-row-BVVhjsjK.js","assets/funding-heatmap-CZWnYF8Y.js","assets/funding-rate-chart-C-tpwid_.js","assets/index-Bx7RmzY8.js","assets/index-XGtH5pVY.css","assets/heading-uIVBEE7K.js","assets/image-CITPAmp0.js","assets/inflation-pulse-Bqa3-cuC.js","assets/market-hours-BSwXtU8c.js","assets/market-data-CvmpLFSo.js","assets/news-feed-C9itZmyp.js","assets/note-BtCnmuMo.js","assets/price-chart-BOCD8ka3.js","assets/price-compare-DZlF-qhZ.js","assets/price-liveline-Bl7qCd5-.js","assets/price-ticker-D2W4T02y.js","assets/mover-row-Dg96EIqq.js","assets/rates-board-Cb9rV0_-.js","assets/fx-board-YAy44m5d.js","assets/short-volume-l8_9Yoh3.js","assets/top-movers-CLmC2TNu.js","assets/tvl-treemap-e610jE8k.js","assets/treemap-leaf-Dn31k9S9.js","assets/yield-curve-DkB0u2_Q.js","assets/dex-volume-treemap-rSTrzz7O.js","assets/dex-volume-chart-sHIuJACJ.js","assets/protocol-tvl-treemap-BjNPrrtL.js","assets/protocol-tvl-chart-CmzANiR7.js","assets/protocol-fees-treemap-DiIt4bfo.js","assets/market-cap-treemap-AxE2EYPO.js","assets/open-interest-C0ulogv6.js","assets/snake-CifbTGlZ.js","assets/flappy-bird-Dbb2UQBv.js","assets/video-CeKjM-cE.js","assets/drawdy-BIb36JN9.js","assets/countdown-Cdi5gSSu.js","assets/link-grid-BEo4b54T.js","assets/calculator-mvv6XpQC.js","assets/quote-CRM3bfI7.js","assets/divider-C33tH1RU.js","assets/marquee-1Zr5qDJP.js","assets/dice-BrFORdjN.js","assets/risk-reward-C7WMz2od.js","assets/stopwatch-Co72v-7u.js","assets/session-progress-CZO3LqUi.js","assets/btc-fees-BmADLsmK.js","assets/btc-shared-DeqDaCze.js","assets/btc-mempool-CTwbkMUR.js","assets/btc-blocks-Do_nySHd.js","assets/btc-hashrate-Wx2RAG-5.js","assets/btc-difficulty-vNbz5uRo.js","assets/mining-pools-B-jxdTot.js","assets/lightning-stats-nkyh2dOX.js","assets/options-put-call-FuaDHJ-S.js","assets/options-iv-CdUder3x.js","assets/options-oi-strike-CvCZnMCR.js","assets/coin-movers-Bcx1XR0F.js","assets/mvrv-Dx_S0TwE.js","assets/cycle-shared-BOGcJDzT.js","assets/indicators-CogwjDn9.js","assets/nupl-aIjkc57m.js","assets/sopr-Dw_oz-mC.js","assets/puell-multiple-BGrJX43r.js","assets/mayer-multiple-DpBJNd4d.js","assets/pi-cycle-BuCnLnIJ.js","assets/ma-multiplier-BllDQMF5.js","assets/rsi-momentum-IglnulkJ.js","assets/volume-profile-CiMFsIBu.js","assets/dxy-CRifEdp_.js","assets/cycle-signals-CS629ZDc.js","assets/stablecoin-supply-DM4ogL4V.js","assets/yield-scanner-BP90untT.js","assets/defi-revenue-CpeAGwhb.js","assets/funding-comparison-CMKxW1n-.js","assets/eth-supply-CF-MgHjn.js","assets/eth-staking-BqWeJq6F.js","assets/prediction-markets-Bzy51qnV.js","assets/etf-flows-BV10E2R-.js","assets/trending-coins-Cpx9T6cG.js","assets/sector-performance-DVMaleLY.js","assets/macro-calendar-Ck0dJk4p.js","assets/stablecoin-chains-Dd2LqqqY.js","assets/sector-treemap-B681nSi6.js","assets/etf-flows-chart-DHu8mkXm.js","assets/realized-price-CYlrFa0m.js","assets/reserve-risk-Be98XUsD.js","assets/holiday-calendar-DCj83hi2.js","assets/day-meter-DDfTuhms.js","assets/returns-projector-D67a_yvC.js","assets/breakeven-CG9rKwgE.js","assets/checklist-CuEw3GpE.js","assets/pomodoro-DDBVVcSR.js","assets/rules-card-DJs3fDVN.js","assets/breathing-cDundHq6.js","assets/spotify-embed-BA0m1IRb.js","assets/editor-Dnp1eXvY.js","assets/gridstack-BxxvPIFU.js","assets/gridstack-FIb_WQSt.css","assets/editor-CZoWRTJC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var xc=Object.defineProperty;var kc=(e,t,r)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var K=(e,t,r)=>kc(e,typeof t!="symbol"?t+"":t,r);import{r as A,j as w,a as Cc,c as _c}from"./react-qoZPGuNy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(a){if(a.ep)return;a.ep=!0;const o=r(a);fetch(a.href,o)}})();const Ac="modulepreload",Sc=function(e){return"/"+e},co={},E=function(t,r,n){let a=Promise.resolve();if(r&&r.length>0){let i=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));a=i(r.map(l=>{if(l=Sc(l),l in co)return;co[l]=!0;const u=l.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":Ac,u||(h.as="script"),h.crossOrigin="",h.href=l,c&&h.setAttribute("nonce",c),document.head.appendChild(h),u)return new Promise((d,m)=>{h.addEventListener("load",d),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return a.then(i=>{for(const s of i||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})},Wb=[{key:"markets",label:"Prices & Markets",description:"Live price charts, tickers, and market movers across stocks and crypto."},{key:"crypto",label:"Crypto & On-chain",description:"Crypto market structure and DeFi/on-chain activity — dominance, market caps, TVL, DEX volume, and fees."},{key:"bitcoin",label:"Bitcoin Network",description:"Bitcoin chain health — fees, mempool, blocks, hashrate, difficulty, mining pools, and Lightning."},{key:"onchain",label:"On-chain & Cycle",description:"Bitcoin valuation ratios and cycle timing — MVRV, NUPL, SOPR, Puell, Mayer Multiple, Pi Cycle, moving-average multipliers, RSI momentum, and cycle top/bottom signal checklists."},{key:"derivatives",label:"Derivatives & Options",description:"Perp funding, open interest, and options positioning and volatility."},{key:"macro",label:"Macro & Rates",description:"Official macro data — rates, the yield curve, inflation, jobs, debt, Treasury auctions, and financial stress."},{key:"equities",label:"Equities & Filings",description:"Single-company fundamentals, SEC filings, and short-sale volume."},{key:"sentiment",label:"Sentiment & News",description:"Market-mood gauges and news headline feeds."},{key:"portfolio",label:"Portfolio",description:"Your own holdings and their live allocation."},{key:"journal",label:"Decision Journal",description:"Your decision journal — log market calls, watch them play out, see them graded, and track how calibrated your judgment is over time."},{key:"tools",label:"Tools & Utility",description:"Clocks, countdowns, calculators, link grids, and the daily brief."},{key:"layout",label:"Layout & Media",description:"Structural and decorative frames — headings, dividers, notes, images, video, and quotes."},{key:"games",label:"Games",description:"Idle canvas games for when the market is quiet."}];function Gb(e){return e}var lo;function k(e,t,r){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const l=i.prototype,u=Object.keys(l);for(let f=0;f<u.length;f++){const h=u[f];h in s||(s[h]=l[h].bind(s))}}const a=(r==null?void 0:r.Parent)??Object;class o extends a{}Object.defineProperty(o,"name",{value:e});function i(s){var c;const l=r!=null&&r.Parent?new o:this;n(l,s),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>{var c,l;return r!=null&&r.Parent&&s instanceof r.Parent?!0:(l=(c=s==null?void 0:s._zod)==null?void 0:c.traits)==null?void 0:l.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Lr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Mi extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(lo=globalThis).__zod_globalConfig??(lo.__zod_globalConfig={});const Ra=globalThis.__zod_globalConfig;function $t(e){return Ra}function Di(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,a])=>t.indexOf(+n)===-1).map(([n,a])=>a)}function fa(e,t){return typeof t=="bigint"?t.toString():t}function Oa(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Na(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function zc(e,t){const r=e/t,n=Math.round(r),a=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<a?0:r-n}const uo=Symbol("evaluating");function Ne(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==uo)return n===void 0&&(n=uo,n=r()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function _r(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function dr(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function fo(e){return JSON.stringify(e)}function Tc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ri="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ec=Oa(()=>{var e;if(Ra.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function jr(e){if(xn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(xn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Oi(e){return jr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Pc=new Set(["string","number","symbol"]);function Nn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fr(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function X(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Mc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Dc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Rc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=dr(e._zod.def,{get shape(){const i={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=r.shape[s])}return _r(this,"shape",i),i},checks:[]});return fr(e,o)}function Oc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=dr(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return _r(this,"shape",i),i},checks:[]});return fr(e,o)}function Nc(e,t){if(!jr(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const a=dr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return _r(this,"shape",o),o}});return fr(e,a)}function Lc(e,t){if(!jr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=dr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return _r(this,"shape",n),n}});return fr(e,r)}function Ic(e,t){var n;if((n=e._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=dr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return _r(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fr(e,r)}function Fc(e,t,r){const a=t._zod.def.checks;if(a&&a.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=dr(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(r)for(const l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(const l in s)c[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return _r(this,"shape",c),c},checks:[]});return fr(t,i)}function Uc(e,t,r){const n=dr(t._zod.def,{get shape(){const a=t._zod.def.shape,o={...a};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:a[i]}))}else for(const i in a)o[i]=new e({type:"nonoptional",innerType:a[i]});return _r(this,"shape",o),o}});return fr(t,n)}function Mr(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function jc(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)===!1)return!0;return!1}function Dr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function un(e){return typeof e=="string"?e:e==null?void 0:e.message}function Qt(e,t,r){var c,l,u,f,h,d;const n=e.message?e.message:un((u=(l=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:u.call(l,e))??un((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??un((h=r.customError)==null?void 0:h.call(r,e))??un((d=r.localeError)==null?void 0:d.call(r,e))??"Invalid input",{inst:a,continue:o,input:i,...s}=e;return s.path??(s.path=[]),s.message=n,t!=null&&t.reportInput&&(s.input=i),s}function Ia(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xr(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Ni=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fa,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Li=k("$ZodError",Ni),Ii=k("$ZodError",Ni,{Parent:Error});function Hc(e,t=r=>r.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}function Bc(e,t=r=>r.message){const r={_errors:[]},n=(a,o=[])=>{for(const i of a.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>n({issues:s},[...o,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...o,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...o,...i.path]);else{const s=[...o,...i.path];if(s.length===0)r._errors.push(t(i));else{let c=r,l=0;for(;l<s.length;){const u=s[l];l===s.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(i))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return n(e),r}const Fa=e=>(t,r,n,a)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Lr;if(i.issues.length){const s=new((a==null?void 0:a.Err)??e)(i.issues.map(c=>Qt(c,o,$t())));throw Ri(s,a==null?void 0:a.callee),s}return i.value},Ua=e=>async(t,r,n,a)=>{const o=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new((a==null?void 0:a.Err)??e)(i.issues.map(c=>Qt(c,o,$t())));throw Ri(s,a==null?void 0:a.callee),s}return i.value},Ln=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Lr;return o.issues.length?{success:!1,error:new(e??Li)(o.issues.map(i=>Qt(i,a,$t())))}:{success:!0,data:o.value}},Vc=Ln(Ii),In=e=>async(t,r,n)=>{const a=n?{...n,async:!0}:{async:!0};let o=t._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>Qt(i,a,$t())))}:{success:!0,data:o.value}},Wc=In(Ii),Gc=e=>(t,r,n)=>{const a=n?{...n,direction:"backward"}:{direction:"backward"};return Fa(e)(t,r,a)},Yc=e=>(t,r,n)=>Fa(e)(t,r,n),Kc=e=>async(t,r,n)=>{const a=n?{...n,direction:"backward"}:{direction:"backward"};return Ua(e)(t,r,a)},qc=e=>async(t,r,n)=>Ua(e)(t,r,n),Jc=e=>(t,r,n)=>{const a=n?{...n,direction:"backward"}:{direction:"backward"};return Ln(e)(t,r,a)},Xc=e=>(t,r,n)=>Ln(e)(t,r,n),Zc=e=>async(t,r,n)=>{const a=n?{...n,direction:"backward"}:{direction:"backward"};return In(e)(t,r,a)},$c=e=>async(t,r,n)=>In(e)(t,r,n),Qc=/^[cC][0-9a-z]{6,}$/,el=/^[0-9a-z]+$/,tl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rl=/^[0-9a-vA-V]{20}$/,nl=/^[A-Za-z0-9]{27}$/,al=/^[a-zA-Z0-9_-]{21}$/,ol=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,il=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ho=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,sl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ll(){return new RegExp(cl,"u")}const ul=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fi=/^[A-Za-z0-9_-]*$/,ml=/^https?$/,gl=/^\+[1-9]\d{6,14}$/,Ui="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vl=new RegExp(`^${Ui}$`);function ji(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yl(e){return new RegExp(`^${ji(e)}$`)}function bl(e){const t=ji({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ui}T(?:${n})$`)}const wl=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xl=/^-?\d+$/,Hi=/^-?\d+(?:\.\d+)?$/,kl=/^(?:true|false)$/i,Cl=/^[^A-Z]*$/,_l=/^[^a-z]*$/,St=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Bi={number:"number",bigint:"bigint",object:"date"},Vi=k("$ZodCheckLessThan",(e,t)=>{St.init(e,t);const r=Bi[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,o=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wi=k("$ZodCheckGreaterThan",(e,t)=>{St.init(e,t);const r=Bi[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,o=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Al=k("$ZodCheckMultipleOf",(e,t)=>{St.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):zc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Sl=k("$ZodCheckNumberFormat",(e,t)=>{var i;St.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[a,o]=Dc[t.format];e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,c.minimum=a,c.maximum=o,r&&(c.pattern=xl)}),e._zod.check=s=>{const c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<a&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),zl=k("$ZodCheckMaxLength",(e,t)=>{var r;St.init(e,t),(r=e._zod.def).when??(r.when=n=>{const a=n.value;return!Na(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const i=Ia(a);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Tl=k("$ZodCheckMinLength",(e,t)=>{var r;St.init(e,t),(r=e._zod.def).when??(r.when=n=>{const a=n.value;return!Na(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const i=Ia(a);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),El=k("$ZodCheckLengthEquals",(e,t)=>{var r;St.init(e,t),(r=e._zod.def).when??(r.when=n=>{const a=n.value;return!Na(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=n=>{const a=n.value,o=a.length;if(o===t.length)return;const i=Ia(a),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Fn=k("$ZodCheckStringFormat",(e,t)=>{var r,n;St.init(e,t),e._zod.onattach.push(a=>{const o=a._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Pl=k("$ZodCheckRegex",(e,t)=>{Fn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ml=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Cl),Fn.init(e,t)}),Dl=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_l),Fn.init(e,t)}),Rl=k("$ZodCheckIncludes",(e,t)=>{St.init(e,t);const r=Nn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),Ol=k("$ZodCheckStartsWith",(e,t)=>{St.init(e,t);const r=new RegExp(`^${Nn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nl=k("$ZodCheckEndsWith",(e,t)=>{St.init(e,t);const r=new RegExp(`.*${Nn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ll=k("$ZodCheckOverwrite",(e,t)=>{St.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Il{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
3
|
+
`).filter(i=>i),a=Math.min(...n.map(i=>i.length-i.trimStart().length)),o=n.map(i=>i.slice(a)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,a=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,a.join(`
|
|
4
|
+
`))}}const Fl={major:4,minor:4,patch:3},Qe=k("$ZodType",(e,t)=>{var a;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fl;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,c,l)=>{let u=Mr(s),f;for(const h of c){if(h._zod.def.when){if(jc(s)||!h._zod.def.when(s))continue}else if(u)continue;const d=s.issues.length,m=h._zod.check(s);if(m instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Lr;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(u||(u=Mr(s,d)))});else{if(s.issues.length===d)continue;u||(u=Mr(s,d))}}return f?f.then(()=>s):s},i=(s,c,l)=>{if(Mr(s))return s.aborted=!0,s;const u=o(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Lr;return u.then(f=>e._zod.parse(f,l))}return e._zod.parse(u,l)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){const u=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(f=>i(f,s,c)):i(u,s,c)}const l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Lr;return l.then(u=>o(u,n,c))}return o(l,n,c)}}Ne(e,"~standard",()=>({validate:o=>{var i;try{const s=Vc(e,o);return s.success?{value:s.data}:{issues:(i=s.error)==null?void 0:i.issues}}catch{return Wc(e,o).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),ja=k("$ZodString",(e,t)=>{var r;Qe.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??wl(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ye=k("$ZodStringFormat",(e,t)=>{Fn.init(e,t),ja.init(e,t)}),Ul=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=il),Ye.init(e,t)}),jl=k("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ho(n))}else t.pattern??(t.pattern=ho());Ye.init(e,t)}),Hl=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=sl),Ye.init(e,t)}),Bl=k("$ZodURL",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{var n;try{const a=r.value.trim();if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===ml.source&&!/^https?:\/\//i.test(a)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=a;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Vl=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ll()),Ye.init(e,t)}),Wl=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=al),Ye.init(e,t)}),Gl=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qc),Ye.init(e,t)}),Yl=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=el),Ye.init(e,t)}),Kl=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tl),Ye.init(e,t)}),ql=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rl),Ye.init(e,t)}),Jl=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nl),Ye.init(e,t)}),Xl=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bl(t)),Ye.init(e,t)}),Zl=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vl),Ye.init(e,t)}),$l=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yl(t)),Ye.init(e,t)}),Ql=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ol),Ye.init(e,t)}),eu=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ul),Ye.init(e,t),e._zod.bag.format="ipv4"}),tu=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dl),Ye.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ru=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fl),Ye.init(e,t)}),nu=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=hl),Ye.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[a,o]=n;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Gi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const au=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=pl),Ye.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Gi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ou(e){if(!Fi.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gi(r)}const iu=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fi),Ye.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ou(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),su=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gl),Ye.init(e,t)});function cu(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}}const lu=k("$ZodJWT",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{cu(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Yi=k("$ZodNumber",(e,t)=>{Qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const a=r.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return r;const o=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...o?{received:o}:{}}),r}}),uu=k("$ZodNumberFormat",(e,t)=>{Sl.init(e,t),Yi.init(e,t)}),du=k("$ZodBoolean",(e,t)=>{Qe.init(e,t),e._zod.pattern=kl,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const a=r.value;return typeof a=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),fu=k("$ZodUnknown",(e,t)=>{Qe.init(e,t),e._zod.parse=r=>r}),hu=k("$ZodNever",(e,t)=>{Qe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function po(e,t,r){e.issues.length&&t.issues.push(...Dr(r,e.issues)),t.value[r]=e.value}const pu=k("$ZodArray",(e,t)=>{Qe.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const o=[];for(let i=0;i<a.length;i++){const s=a[i],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?o.push(c.then(l=>po(l,r,i))):po(c,r,i)}return o.length?Promise.all(o).then(()=>r):r}});function kn(e,t,r,n,a,o){const i=r in n;if(e.issues.length){if(a&&o&&!i)return;t.issues.push(...Dr(r,e.issues))}if(!i&&!a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function Ki(e){var n,a,o,i;const t=Object.keys(e.shape);for(const s of t)if(!((i=(o=(a=(n=e.shape)==null?void 0:n[s])==null?void 0:a._zod)==null?void 0:o.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=Mc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function qi(e,t,r,n,a,o){const i=[],s=a.keySet,c=a.catchall._zod,l=c.def.type,u=c.optin==="optional",f=c.optout==="optional";for(const h in t){if(h==="__proto__"||s.has(h))continue;if(l==="never"){i.push(h);continue}const d=c.run({value:t[h],issues:[]},n);d instanceof Promise?e.push(d.then(m=>kn(m,r,h,t,u,f))):kn(d,r,h,t,u,f)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const mu=k("$ZodObject",(e,t)=>{Qe.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=Oa(()=>Ki(t));Ne(e._zod,"propValues",()=>{const s=t.shape,c={};for(const l in s){const u=s[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const f of u.values)c[l].add(f)}}return c});const a=xn,o=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=n.value);const l=s.value;if(!a(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};const u=[],f=i.shape;for(const h of i.keys){const d=f[h],m=d._zod.optin==="optional",p=d._zod.optout==="optional",g=d._zod.run({value:l[h],issues:[]},c);g instanceof Promise?u.push(g.then(v=>kn(v,s,h,l,m,p))):kn(g,s,h,l,m,p)}return o?qi(u,l,s,c,n.value,e):u.length?Promise.all(u).then(()=>s):s}}),gu=k("$ZodObjectJIT",(e,t)=>{mu.init(e,t);const r=e._zod.parse,n=Oa(()=>Ki(t)),a=h=>{var x,P;const d=new Il(["shape","payload","ctx"]),m=n.value,p=C=>{const y=fo(C);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};d.write("const input = payload.value;");const g=Object.create(null);let v=0;for(const C of m.keys)g[C]=`key_${v++}`;d.write("const newResult = {};");for(const C of m.keys){const y=g[C],z=fo(C),D=h[C],N=((x=D==null?void 0:D._zod)==null?void 0:x.optin)==="optional",S=((P=D==null?void 0:D._zod)==null?void 0:P.optout)==="optional";d.write(`const ${y} = ${p(C)};`),N&&S?d.write(`
|
|
5
|
+
if (${y}.issues.length) {
|
|
6
|
+
if (${z} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${y}.value === undefined) {
|
|
15
|
+
if (${z} in input) {
|
|
16
|
+
newResult[${z}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${z}] = ${y}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):N?d.write(`
|
|
23
|
+
if (${y}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${y}.value === undefined) {
|
|
31
|
+
if (${z} in input) {
|
|
32
|
+
newResult[${z}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${z}] = ${y}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):d.write(`
|
|
39
|
+
const ${y}_present = ${z} in input;
|
|
40
|
+
if (${y}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${y}_present && !${y}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${z}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${y}_present) {
|
|
56
|
+
if (${y}.value === undefined) {
|
|
57
|
+
newResult[${z}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${z}] = ${y}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(C,y)=>b(h,C,y)};let o;const i=xn,s=!Ra.jitless,l=s&&Ec.value,u=t.catchall;let f;e._zod.parse=(h,d)=>{f??(f=n.value);const m=h.value;return i(m)?s&&l&&(d==null?void 0:d.async)===!1&&d.jitless!==!0?(o||(o=a(t.shape)),h=o(h,d),u?qi([],m,h,d,f,e):h):r(h,d):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function mo(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const a=e.filter(o=>!Mr(o));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>Qt(i,n,$t())))}),t)}const vu=k("$ZodUnion",(e,t)=>{Qe.init(e,t),Ne(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ne(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ne(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ne(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${n.map(a=>La(a.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,a)=>{if(r)return r(n,a);let o=!1;const i=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},a);if(c instanceof Promise)i.push(c),o=!0;else{if(c.issues.length===0)return c;i.push(c)}}return o?Promise.all(i).then(s=>mo(s,n,e,a)):mo(i,n,e,a)}}),yu=k("$ZodIntersection",(e,t)=>{Qe.init(e,t),e._zod.parse=(r,n)=>{const a=r.value,o=t.left._zod.run({value:a,issues:[]},n),i=t.right._zod.run({value:a,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,l])=>go(r,c,l)):go(r,o,i)}});function ha(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jr(e)&&jr(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),a={...e,...t};for(const o of n){const i=ha(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};a[o]=i.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=e[n],o=t[n],i=ha(a,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function go(e,t,r){const n=new Map;let a;for(const s of t.issues)if(s.code==="unrecognized_keys"){a??(a=s);for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(s);const o=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&a&&e.issues.push({...a,keys:o}),Mr(e))return e;const i=ha(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const bu=k("$ZodRecord",(e,t)=>{Qe.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!jr(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const s=new Set;for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);const u=t.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Qt(d,n,$t())),input:l,path:[l],inst:e});continue}const f=u.value,h=t.valueType._zod.run({value:a[l],issues:[]},n);h instanceof Promise?o.push(h.then(d=>{d.issues.length&&r.issues.push(...Dr(l,d.issues)),r.value[f]=d.value})):(h.issues.length&&r.issues.push(...Dr(l,h.issues)),r.value[f]=h.value)}let c;for(const l in a)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(a)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Hi.test(s)&&c.issues.length){const f=t.keyType._zod.run({value:Number(s),issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?r.value[s]=a[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>Qt(f,n,$t())),input:s,path:[s],inst:e});continue}const u=t.valueType._zod.run({value:a[s],issues:[]},n);u instanceof Promise?o.push(u.then(f=>{f.issues.length&&r.issues.push(...Dr(s,f.issues)),r.value[c.value]=f.value})):(u.issues.length&&r.issues.push(...Dr(s,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),wu=k("$ZodEnum",(e,t)=>{Qe.init(e,t);const r=Di(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(a=>Pc.has(typeof a)).map(a=>typeof a=="string"?Nn(a):a.toString()).join("|")})$`),e._zod.parse=(a,o)=>{const i=a.value;return n.has(i)||a.issues.push({code:"invalid_value",values:r,input:i,inst:e}),a}}),xu=k("$ZodTransform",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mi(e.constructor.name);const a=t.transform(r.value,r);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(i=>(r.value=i,r.fallback=!0,r));if(a instanceof Promise)throw new Lr;return r.value=a,r.fallback=!0,r}});function vo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ji=k("$ZodOptional",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const a=r.value,o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>vo(i,a)):vo(o,a)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ku=k("$ZodExactOptional",(e,t)=>{Ji.init(e,t),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Cu=k("$ZodNullable",(e,t)=>{Qe.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)}|null)$`):void 0}),Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_u=k("$ZodDefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>yo(o,t)):yo(a,t)}});function yo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Au=k("$ZodPrefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Su=k("$ZodNonOptional",(e,t)=>{Qe.init(e,t),Ne(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>bo(o,e)):bo(a,e)}});function bo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const zu=k("$ZodCatch",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Qt(i,n,$t()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(o=>Qt(o,n,$t()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Xi=k("$ZodPipe",(e,t)=>{Qe.init(e,t),Ne(e._zod,"values",()=>t.in._zod.values),Ne(e._zod,"optin",()=>t.in._zod.optin),Ne(e._zod,"optout",()=>t.out._zod.optout),Ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>dn(i,t.in,n)):dn(o,t.in,n)}const a=t.in._zod.run(r,n);return a instanceof Promise?a.then(o=>dn(o,t.out,n)):dn(a,t.out,n)}});function dn(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const Tu=k("$ZodPreprocess",(e,t)=>{Xi.init(e,t)}),Eu=k("$ZodReadonly",(e,t)=>{Qe.init(e,t),Ne(e._zod,"propValues",()=>t.innerType._zod.propValues),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),Ne(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(wo):wo(a)}});function wo(e){return e.value=Object.freeze(e.value),e}const Pu=k("$ZodCustom",(e,t)=>{St.init(e,t),Qe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(o=>xo(o,r,n,e));xo(a,r,n,e)}});function xo(e,t,r,n){if(!e){const a={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),t.issues.push(Xr(a))}}var ko;class Mu{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const a={...n,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Du(){return new Mu}(ko=globalThis).__zod_globalRegistry??(ko.__zod_globalRegistry=Du());const qr=globalThis.__zod_globalRegistry;function Ru(e,t){return new e({type:"string",...X(t)})}function Ou(e,t){return new e({type:"string",coerce:!0,...X(t)})}function Nu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...X(t)})}function Co(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...X(t)})}function Lu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...X(t)})}function Iu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...X(t)})}function Fu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...X(t)})}function Uu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...X(t)})}function ju(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...X(t)})}function Hu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...X(t)})}function Bu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...X(t)})}function Vu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...X(t)})}function Wu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...X(t)})}function Gu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...X(t)})}function Yu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...X(t)})}function Ku(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...X(t)})}function qu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...X(t)})}function Ju(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...X(t)})}function Xu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...X(t)})}function Zu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...X(t)})}function $u(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...X(t)})}function Qu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...X(t)})}function ed(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...X(t)})}function td(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...X(t)})}function rd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...X(t)})}function nd(e,t){return new e({type:"string",format:"date",check:"string_format",...X(t)})}function ad(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...X(t)})}function od(e,t){return new e({type:"string",format:"duration",check:"string_format",...X(t)})}function id(e,t){return new e({type:"number",checks:[],...X(t)})}function sd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...X(t)})}function cd(e,t){return new e({type:"boolean",...X(t)})}function ld(e){return new e({type:"unknown"})}function ud(e,t){return new e({type:"never",...X(t)})}function _o(e,t){return new Vi({check:"less_than",...X(t),value:e,inclusive:!1})}function $n(e,t){return new Vi({check:"less_than",...X(t),value:e,inclusive:!0})}function Ao(e,t){return new Wi({check:"greater_than",...X(t),value:e,inclusive:!1})}function Qn(e,t){return new Wi({check:"greater_than",...X(t),value:e,inclusive:!0})}function So(e,t){return new Al({check:"multiple_of",...X(t),value:e})}function Zi(e,t){return new zl({check:"max_length",...X(t),maximum:e})}function Cn(e,t){return new Tl({check:"min_length",...X(t),minimum:e})}function $i(e,t){return new El({check:"length_equals",...X(t),length:e})}function dd(e,t){return new Pl({check:"string_format",format:"regex",...X(t),pattern:e})}function fd(e){return new Ml({check:"string_format",format:"lowercase",...X(e)})}function hd(e){return new Dl({check:"string_format",format:"uppercase",...X(e)})}function pd(e,t){return new Rl({check:"string_format",format:"includes",...X(t),includes:e})}function md(e,t){return new Ol({check:"string_format",format:"starts_with",...X(t),prefix:e})}function gd(e,t){return new Nl({check:"string_format",format:"ends_with",...X(t),suffix:e})}function Br(e){return new Ll({check:"overwrite",tx:e})}function vd(e){return Br(t=>t.normalize(e))}function yd(){return Br(e=>e.trim())}function bd(){return Br(e=>e.toLowerCase())}function wd(){return Br(e=>e.toUpperCase())}function xd(){return Br(e=>Tc(e))}function kd(e,t,r){return new e({type:"array",element:t,...X(r)})}function Cd(e,t,r){return new e({type:"custom",check:"custom",fn:t,...X(r)})}function _d(e,t){const r=Ad(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Xr(a,n.value,r._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(Xr(o))}},e(n.value,n)),t);return r}function Ad(e,t){const r=new St({check:"custom",...X(t)});return r._zod.check=e,r}function _n(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??qr,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Fe(e,t,r={path:[],schemaPath:[]}){var u,f;var n;const a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const s=(f=(u=e._zod).toJSONSchema)==null?void 0:f.call(u);if(s)i.schema=s;else{const h={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{const m=i.schema,p=t.processors[a.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);p(e,t,m,h)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),Fe(d,t,h),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&bt(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function An(e,t){var i,s,c,l;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const u of e.seen.entries()){const f=(i=e.metadataRegistry.get(u[0]))==null?void 0:i.id;if(f){const h=n.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(f,u[0])}}const a=u=>{var p;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=(p=e.external.registry.get(u[0]))==null?void 0:p.id,v=e.external.uri??(x=>x);if(g)return{ref:v(g)};const b=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(u[1]===r)return{ref:"#"};const d=`#/${f}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},o=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:d}=a(u);f.def={...f.schema},d&&(f.defId=d);const m=f.schema;for(const p in m)delete m[p];m.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${(s=f.cycle)==null?void 0:s.join("/")}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){o(u);continue}if(e.external){const d=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&d){o(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){o(u);continue}if(f.cycle){o(u);continue}if(f.count>1&&e.reused==="ref"){o(u);continue}}}function Sn(e,t){var s,c,l,u;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=f=>{const h=e.seen.get(f);if(h.ref===null)return;const d=h.def??h.schema,m={...d},p=h.ref;if(h.ref=null,p){n(p);const v=e.seen.get(p),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(b)):Object.assign(d,b),Object.assign(d,m),f._zod.parent===p)for(const P in d)P==="$ref"||P==="allOf"||P in m||delete d[P];if(b.$ref&&v.def)for(const P in d)P==="$ref"||P==="allOf"||P in v.def&&JSON.stringify(d[P])===JSON.stringify(v.def[P])&&delete d[P]}const g=f._zod.parent;if(g&&g!==p){n(g);const v=e.seen.get(g);if(v!=null&&v.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const b in d)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(d[b])===JSON.stringify(v.def[b])&&delete d[b]}e.override({zodSchema:f,jsonSchema:d,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())n(f[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){const f=(c=e.external.registry.get(t))==null?void 0:c.id;if(!f)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(f)}Object.assign(a,r.def??r.schema);const o=(l=e.metadataRegistry.get(t))==null?void 0:l.id;o!==void 0&&a.id===o&&delete a.id;const i=((u=e.external)==null?void 0:u.defs)??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,i[h.defId]=h.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const f=JSON.parse(JSON.stringify(a));return Object.defineProperty(f,"~standard",{value:{...t["~standard"],jsonSchema:{input:zn(t,"input",e.processors),output:zn(t,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function bt(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return bt(n.element,r);if(n.type==="set")return bt(n.valueType,r);if(n.type==="lazy")return bt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return bt(n.innerType,r);if(n.type==="intersection")return bt(n.left,r)||bt(n.right,r);if(n.type==="record"||n.type==="map")return bt(n.keyType,r)||bt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:bt(n.in,r)||bt(n.out,r);if(n.type==="object"){for(const a in n.shape)if(bt(n.shape[a],r))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(bt(a,r))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(bt(a,r))return!0;return!!(n.rest&&bt(n.rest,r))}return!1}const Sd=(e,t={})=>r=>{const n=_n({...r,processors:t});return Fe(e,n),An(n,e),Sn(n,e)},zn=(e,t,r={})=>n=>{const{libraryOptions:a,target:o}=n??{},i=_n({...a??{},target:o,io:t,processors:r});return Fe(e,i),An(i,e),Sn(i,e)},zd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Qi=(e,t,r,n)=>{const a=r;a.type="string";const{minimum:o,maximum:i,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(a.minLength=o),typeof i=="number"&&(a.maxLength=i),s&&(a.format=zd[s]??s,a.format===""&&delete a.format,s==="time"&&delete a.format),l&&(a.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},es=(e,t,r,n)=>{const a=r,{minimum:o,maximum:i,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?a.type="integer":a.type="number";const f=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),h=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";f?d?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u:typeof o=="number"&&(a.minimum=o),h?d?(a.maximum=l,a.exclusiveMaximum=!0):a.exclusiveMaximum=l:typeof i=="number"&&(a.maximum=i),typeof c=="number"&&(a.multipleOf=c)},ts=(e,t,r,n)=>{r.type="boolean"},Td=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ed=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Pd=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Md=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Dd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},rs=(e,t,r,n)=>{r.not={}},Rd=(e,t,r,n)=>{},ns=(e,t,r,n)=>{},Od=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},as=(e,t,r,n)=>{const a=e._zod.def,o=Di(a.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},Nd=(e,t,r,n)=>{const a=e._zod.def,o=[];for(const i of a.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){const i=o[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),o.every(i=>typeof i=="boolean")&&(r.type="boolean"),o.every(i=>i===null)&&(r.type="null"),r.enum=o},Ld=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Id=(e,t,r,n)=>{const a=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=o.source},Fd=(e,t,r,n)=>{const a=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:c}=e._zod.bag;i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(a,o)):(Object.assign(a,o),a.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(a,o)},Ud=(e,t,r,n)=>{r.type="boolean"},os=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},jd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},is=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Hd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Bd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ss=(e,t,r,n)=>{const a=r,o=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(a.minItems=i),typeof s=="number"&&(a.maxItems=s),a.type="array",a.items=Fe(o.element,t,{...n,path:[...n.path,"items"]})},cs=(e,t,r,n)=>{var l;const a=r,o=e._zod.def;a.type="object",a.properties={};const i=o.shape;for(const u in i)a.properties[u]=Fe(i[u],t,{...n,path:[...n.path,"properties",u]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(u=>{const f=o.shape[u]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(a.required=Array.from(c)),((l=o.catchall)==null?void 0:l._zod.def.type)==="never"?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=Fe(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},ls=(e,t,r,n)=>{const a=e._zod.def,o=a.inclusive===!1,i=a.options.map((s,c)=>Fe(s,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},us=(e,t,r,n)=>{const a=e._zod.def,o=Fe(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=Fe(a.right,t,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(o)?o.allOf:[o],...s(i)?i.allOf:[i]];r.allOf=c},Vd=(e,t,r,n)=>{const a=r,o=e._zod.def;a.type="array";const i=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,d)=>Fe(h,t,{...n,path:[...n.path,i,d]})),l=o.rest?Fe(o.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(a.prefixItems=c,l&&(a.items=l)):t.target==="openapi-3.0"?(a.items={anyOf:c},l&&a.items.anyOf.push(l),a.minItems=c.length,l||(a.maxItems=c.length)):(a.items=c,l&&(a.additionalItems=l));const{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(a.minItems=u),typeof f=="number"&&(a.maxItems=f)},ds=(e,t,r,n)=>{const a=r,o=e._zod.def;a.type="object";const i=o.keyType,s=i._zod.bag,c=s==null?void 0:s.patterns;if(o.mode==="loose"&&c&&c.size>0){const u=Fe(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});a.patternProperties={};for(const f of c)a.patternProperties[f.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(a.propertyNames=Fe(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),a.additionalProperties=Fe(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const l=i._zod.values;if(l){const u=[...l].filter(f=>typeof f=="string"||typeof f=="number");u.length>0&&(a.required=u)}},fs=(e,t,r,n)=>{const a=e._zod.def,o=Fe(a.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=a.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},hs=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType},ps=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))},ms=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},gs=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType;let i;try{i=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},vs=(e,t,r,n)=>{const a=e._zod.def,o=a.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?a.out:a.in:a.out;Fe(i,t,n);const s=t.seen.get(e);s.ref=i},ys=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType,r.readOnly=!0},Wd=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType},Ha=(e,t,r,n)=>{const a=e._zod.def;Fe(a.innerType,t,n);const o=t.seen.get(e);o.ref=a.innerType},Gd=(e,t,r,n)=>{const a=e._zod.innerType;Fe(a,t,n);const o=t.seen.get(e);o.ref=a},zo={string:Qi,number:es,boolean:ts,bigint:Td,symbol:Ed,null:Pd,undefined:Md,void:Dd,never:rs,any:Rd,unknown:ns,date:Od,enum:as,literal:Nd,nan:Ld,template_literal:Id,file:Fd,success:Ud,custom:os,function:jd,transform:is,map:Hd,set:Bd,array:ss,object:cs,union:ls,intersection:us,tuple:Vd,record:ds,nullable:fs,nonoptional:hs,default:ps,prefault:ms,catch:gs,pipe:vs,readonly:ys,promise:Wd,optional:Ha,lazy:Gd};function Yb(e,t){if("_idmap"in e){const n=e,a=_n({...t,processors:zo}),o={};for(const c of n._idmap.entries()){const[l,u]=c;Fe(u,a)}const i={},s={registry:n,uri:t==null?void 0:t.uri,defs:o};a.external=s;for(const c of n._idmap.entries()){const[l,u]=c;An(a,u),i[l]=Sn(a,u)}if(Object.keys(o).length>0){const c=a.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:o}}return{schemas:i}}const r=_n({...t,processors:zo});return Fe(e,r),An(r,e),Sn(r,e)}const Yd=k("ZodISODateTime",(e,t)=>{Xl.init(e,t),Je.init(e,t)});function Kd(e){return rd(Yd,e)}const qd=k("ZodISODate",(e,t)=>{Zl.init(e,t),Je.init(e,t)});function Jd(e){return nd(qd,e)}const Xd=k("ZodISOTime",(e,t)=>{$l.init(e,t),Je.init(e,t)});function Zd(e){return ad(Xd,e)}const $d=k("ZodISODuration",(e,t)=>{Ql.init(e,t),Je.init(e,t)});function Qd(e){return od($d,e)}const ef=(e,t)=>{Li.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Bc(e,r)},flatten:{value:r=>Hc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,fa,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,fa,2)}},isEmpty:{get(){return e.issues.length===0}}})},Nt=k("ZodError",ef,{Parent:Error}),tf=Fa(Nt),rf=Ua(Nt),nf=Ln(Nt),af=In(Nt),of=Gc(Nt),sf=Yc(Nt),cf=Kc(Nt),lf=qc(Nt),uf=Jc(Nt),df=Xc(Nt),ff=Zc(Nt),hf=$c(Nt),To=new WeakMap;function en(e,t,r){const n=Object.getPrototypeOf(e);let a=To.get(n);if(a||(a=new Set,To.set(n,a)),!a.has(t)){a.add(t);for(const o in r){const i=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){const s=i.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}const et=k("ZodType",(e,t)=>(Qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:zn(e,"input"),output:zn(e,"output")}}),e.toJSONSchema=Sd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>tf(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nf(e,r,n),e.parseAsync=async(r,n)=>rf(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>af(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>of(e,r,n),e.decode=(r,n)=>sf(e,r,n),e.encodeAsync=async(r,n)=>cf(e,r,n),e.decodeAsync=async(r,n)=>lf(e,r,n),e.safeEncode=(r,n)=>uf(e,r,n),e.safeDecode=(r,n)=>df(e,r,n),e.safeEncodeAsync=async(r,n)=>ff(e,r,n),e.safeDecodeAsync=async(r,n)=>hf(e,r,n),en(e,"ZodType",{check(...r){const n=this.def;return this.clone(dr(n,{checks:[...n.checks??[],...r.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return fr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(nh(r,n))},superRefine(r,n){return this.check(ah(r,n))},overwrite(r){return this.check(Br(r))},optional(){return Ro(this)},exactOptional(){return Wf(this)},nullable(){return Oo(this)},nullish(){return Ro(Oo(this))},nonoptional(r){return Xf(this,r)},array(){return Ge(this)},or(r){return Uf([this,r])},and(r){return Hf(this,r)},transform(r){return No(this,ks(r))},default(r){return Kf(this,r)},prefault(r){return Jf(this,r)},catch(r){return $f(this,r)},pipe(r){return No(this,r)},readonly(){return th(this)},describe(r){const n=this.clone();return qr.add(n,{description:r}),n},meta(...r){if(r.length===0)return qr.get(this);const n=this.clone();return qr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){var r;return(r=qr.get(e))==null?void 0:r.description},configurable:!0}),e)),bs=k("_ZodString",(e,t)=>{ja.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Qi(e,n,a);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,en(e,"_ZodString",{regex(...n){return this.check(dd(...n))},includes(...n){return this.check(pd(...n))},startsWith(...n){return this.check(md(...n))},endsWith(...n){return this.check(gd(...n))},min(...n){return this.check(Cn(...n))},max(...n){return this.check(Zi(...n))},length(...n){return this.check($i(...n))},nonempty(...n){return this.check(Cn(1,...n))},lowercase(n){return this.check(fd(n))},uppercase(n){return this.check(hd(n))},trim(){return this.check(yd())},normalize(...n){return this.check(vd(...n))},toLowerCase(){return this.check(bd())},toUpperCase(){return this.check(wd())},slugify(){return this.check(xd())}})}),ws=k("ZodString",(e,t)=>{ja.init(e,t),bs.init(e,t),e.email=r=>e.check(Nu(pf,r)),e.url=r=>e.check(ju(mf,r)),e.jwt=r=>e.check(td(Pf,r)),e.emoji=r=>e.check(Hu(gf,r)),e.guid=r=>e.check(Co(Eo,r)),e.uuid=r=>e.check(Lu(fn,r)),e.uuidv4=r=>e.check(Iu(fn,r)),e.uuidv6=r=>e.check(Fu(fn,r)),e.uuidv7=r=>e.check(Uu(fn,r)),e.nanoid=r=>e.check(Bu(vf,r)),e.guid=r=>e.check(Co(Eo,r)),e.cuid=r=>e.check(Vu(yf,r)),e.cuid2=r=>e.check(Wu(bf,r)),e.ulid=r=>e.check(Gu(wf,r)),e.base64=r=>e.check($u(zf,r)),e.base64url=r=>e.check(Qu(Tf,r)),e.xid=r=>e.check(Yu(xf,r)),e.ksuid=r=>e.check(Ku(kf,r)),e.ipv4=r=>e.check(qu(Cf,r)),e.ipv6=r=>e.check(Ju(_f,r)),e.cidrv4=r=>e.check(Xu(Af,r)),e.cidrv6=r=>e.check(Zu(Sf,r)),e.e164=r=>e.check(ed(Ef,r)),e.datetime=r=>e.check(Kd(r)),e.date=r=>e.check(Jd(r)),e.time=r=>e.check(Zd(r)),e.duration=r=>e.check(Qd(r))});function W(e){return Ru(ws,e)}const Je=k("ZodStringFormat",(e,t)=>{Ye.init(e,t),bs.init(e,t)}),pf=k("ZodEmail",(e,t)=>{Hl.init(e,t),Je.init(e,t)}),Eo=k("ZodGUID",(e,t)=>{Ul.init(e,t),Je.init(e,t)}),fn=k("ZodUUID",(e,t)=>{jl.init(e,t),Je.init(e,t)}),mf=k("ZodURL",(e,t)=>{Bl.init(e,t),Je.init(e,t)}),gf=k("ZodEmoji",(e,t)=>{Vl.init(e,t),Je.init(e,t)}),vf=k("ZodNanoID",(e,t)=>{Wl.init(e,t),Je.init(e,t)}),yf=k("ZodCUID",(e,t)=>{Gl.init(e,t),Je.init(e,t)}),bf=k("ZodCUID2",(e,t)=>{Yl.init(e,t),Je.init(e,t)}),wf=k("ZodULID",(e,t)=>{Kl.init(e,t),Je.init(e,t)}),xf=k("ZodXID",(e,t)=>{ql.init(e,t),Je.init(e,t)}),kf=k("ZodKSUID",(e,t)=>{Jl.init(e,t),Je.init(e,t)}),Cf=k("ZodIPv4",(e,t)=>{eu.init(e,t),Je.init(e,t)}),_f=k("ZodIPv6",(e,t)=>{tu.init(e,t),Je.init(e,t)}),Af=k("ZodCIDRv4",(e,t)=>{ru.init(e,t),Je.init(e,t)}),Sf=k("ZodCIDRv6",(e,t)=>{nu.init(e,t),Je.init(e,t)}),zf=k("ZodBase64",(e,t)=>{au.init(e,t),Je.init(e,t)}),Tf=k("ZodBase64URL",(e,t)=>{iu.init(e,t),Je.init(e,t)}),Ef=k("ZodE164",(e,t)=>{su.init(e,t),Je.init(e,t)}),Pf=k("ZodJWT",(e,t)=>{lu.init(e,t),Je.init(e,t)}),xs=k("ZodNumber",(e,t)=>{Yi.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,a,o)=>es(e,n,a),en(e,"ZodNumber",{gt(n,a){return this.check(Ao(n,a))},gte(n,a){return this.check(Qn(n,a))},min(n,a){return this.check(Qn(n,a))},lt(n,a){return this.check(_o(n,a))},lte(n,a){return this.check($n(n,a))},max(n,a){return this.check($n(n,a))},int(n){return this.check(Po(n))},safe(n){return this.check(Po(n))},positive(n){return this.check(Ao(0,n))},nonnegative(n){return this.check(Qn(0,n))},negative(n){return this.check(_o(0,n))},nonpositive(n){return this.check($n(0,n))},multipleOf(n,a){return this.check(So(n,a))},step(n,a){return this.check(So(n,a))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function O(e){return id(xs,e)}const Mf=k("ZodNumberFormat",(e,t)=>{uu.init(e,t),xs.init(e,t)});function Po(e){return sd(Mf,e)}const Df=k("ZodBoolean",(e,t)=>{du.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ts(e,r,n)});function nt(e){return cd(Df,e)}const Rf=k("ZodUnknown",(e,t)=>{fu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ns()});function pa(){return ld(Rf)}const Of=k("ZodNever",(e,t)=>{hu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>rs(e,r,n)});function Nf(e){return ud(Of,e)}const Lf=k("ZodArray",(e,t)=>{pu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ss(e,r,n,a),e.element=t.element,en(e,"ZodArray",{min(r,n){return this.check(Cn(r,n))},nonempty(r){return this.check(Cn(1,r))},max(r,n){return this.check(Zi(r,n))},length(r,n){return this.check($i(r,n))},unwrap(){return this.element}})});function Ge(e,t){return kd(Lf,e,t)}const If=k("ZodObject",(e,t)=>{gu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>cs(e,r,n,a),Ne(e,"shape",()=>t.shape),en(e,"ZodObject",{keyof(){return re(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:pa()})},loose(){return this.clone({...this._zod.def,catchall:pa()})},strict(){return this.clone({...this._zod.def,catchall:Nf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Nc(this,r)},safeExtend(r){return Lc(this,r)},merge(r){return Ic(this,r)},pick(r){return Rc(this,r)},omit(r){return Oc(this,r)},partial(...r){return Fc(Cs,this,r[0])},required(...r){return Uc(_s,this,r[0])}})});function _(e,t){const r={type:"object",shape:e??{},...X(t)};return new If(r)}const Ff=k("ZodUnion",(e,t)=>{vu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ls(e,r,n,a),e.options=t.options});function Uf(e,t){return new Ff({type:"union",options:e,...X(t)})}const jf=k("ZodIntersection",(e,t)=>{yu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>us(e,r,n,a)});function Hf(e,t){return new jf({type:"intersection",left:e,right:t})}const Mo=k("ZodRecord",(e,t)=>{bu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ds(e,r,n,a),e.keyType=t.keyType,e.valueType=t.valueType});function Do(e,t,r){return!t||!t._zod?new Mo({type:"record",keyType:W(),valueType:e,...X(t)}):new Mo({type:"record",keyType:e,valueType:t,...X(r)})}const ma=k("ZodEnum",(e,t)=>{wu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,a,o)=>as(e,n,a),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,a)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ma({...t,checks:[],...X(a),entries:o})},e.exclude=(n,a)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new ma({...t,checks:[],...X(a),entries:o})}});function re(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ma({type:"enum",entries:r,...X(t)})}const Bf=k("ZodTransform",(e,t)=>{xu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>is(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mi(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Xr(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Xr(i))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=a,r.fallback=!0,r)}});function ks(e){return new Bf({type:"transform",transform:e})}const Cs=k("ZodOptional",(e,t)=>{Ji.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>Ha(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function Ro(e){return new Cs({type:"optional",innerType:e})}const Vf=k("ZodExactOptional",(e,t)=>{ku.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>Ha(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function Wf(e){return new Vf({type:"optional",innerType:e})}const Gf=k("ZodNullable",(e,t)=>{Cu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>fs(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function Oo(e){return new Gf({type:"nullable",innerType:e})}const Yf=k("ZodDefault",(e,t)=>{_u.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ps(e,r,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Kf(e,t){return new Yf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Oi(t)}})}const qf=k("ZodPrefault",(e,t)=>{Au.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ms(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new qf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Oi(t)}})}const _s=k("ZodNonOptional",(e,t)=>{Su.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>hs(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function Xf(e,t){return new _s({type:"nonoptional",innerType:e,...X(t)})}const Zf=k("ZodCatch",(e,t)=>{zu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>gs(e,r,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $f(e,t){return new Zf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const As=k("ZodPipe",(e,t)=>{Xi.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>vs(e,r,n,a),e.in=t.in,e.out=t.out});function No(e,t){return new As({type:"pipe",in:e,out:t})}const Qf=k("ZodPreprocess",(e,t)=>{As.init(e,t),Tu.init(e,t)}),eh=k("ZodReadonly",(e,t)=>{Eu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>ys(e,r,n,a),e.unwrap=()=>e._zod.def.innerType});function th(e){return new eh({type:"readonly",innerType:e})}const rh=k("ZodCustom",(e,t)=>{Pu.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,n,a)=>os(e,r)});function nh(e,t={}){return Cd(rh,e,t)}function ah(e,t){return _d(e,t)}function oh(e,t){return new Qf({type:"pipe",in:ks(e),out:t})}function ih(e){return Ou(ws,e)}const Lo=_({x:O().int().min(0).describe("Column offset, 0-based"),y:O().int().min(0).describe("Row offset, 0-based"),w:O().int().min(1).describe("Width in grid columns"),h:O().int().min(1).describe("Height in grid rows")}),sh=_({id:W().describe("Unique instance id within the dashboard"),frame:W().describe("Name of a registered frame"),title:W().optional().describe('Optional custom card title. Omit it to use the frame\'s own polished default label (its catalogue `label`, e.g. "OI by Strike") — that is the norm. Only set this for a genuinely instance-specific label the default can\'t know, e.g. the ticker on a price-chart ("TSLA") or which outlet a news-feed shows. Never abbreviate. Ignored by chrome-less frames like heading.'),position:Lo,layouts:Do(W(),Lo).optional().describe('Per-mode layout overrides keyed by grid.mode (e.g. "flow-horizontal"). `position` is the canonical flow-vertical layout; this holds the other modes\' placements so each layout mode keeps its own independent arrangement. Editor-managed — agents only need to set `position`.'),config:Do(W(),pa()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),ch=_({type:re(["none","color","gradient","unicorn"]).default("none").describe("Background style: 'none' (the signature dark indigo glow — the default), 'color' (a solid colour), 'gradient' (a custom two-colour linear gradient), or 'unicorn' (an animated Unicorn Studio scene)."),color:W().default("#0a0a12").describe("Solid background colour (any CSS colour). Used when type is 'color'."),gradientFrom:W().default("#1b1e4d").describe("Gradient start colour. Used when type is 'gradient'."),gradientTo:W().default("#07070c").describe("Gradient end colour. Used when type is 'gradient'."),gradientAngle:O().min(0).max(360).default(160).describe("Gradient angle in degrees (0 = upward, 90 = rightward, 180 = downward). Used when type is 'gradient'."),projectId:W().optional().describe("Unicorn Studio public project id — required when type is 'unicorn'."),scale:O().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:O().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:O().min(0).max(1).default(.16).describe("Opacity of the unicorn scene (0–1). Keep moderate (~0.15) so the animation reads as a living backdrop in the gutters without competing with the (opaque) dashboard cards.")}).describe("Visual background rendered behind the whole dashboard."),lh=_({accentHue:O().int().min(0).max(360).default(242).describe("Brand accent hue in degrees on the HSL color wheel (0–360). Rotates the dashboard's accent — card rims, title dots, chart highlights, loading states — across the spectrum. 242 is the default zframes indigo; rough anchors: 0 red, 35 orange, 50 amber, 150 green, 190 teal, 210 blue, 280 violet, 330 pink. Semantic up/down green/red, asset logos, and per-frame chart colors stay fixed."),accentSat:O().min(0).max(100).default(90).describe("Accent saturation as an HSL percentage (0–100). 90 is the default vivid zframes accent; lower it for muted/pastel rims and dots, 0 for a near-grayscale monochrome accent. Pairs with accentHue — hue picks the color, saturation picks how vivid it is."),baseHue:O().int().min(0).max(360).default(233).describe("Hue of the dark card surface itself, in degrees (0–360). 233 is the default near-black indigo-navy; rotate it to re-temperature every card — e.g. 30 warms toward charcoal-brown, 150 toward deep forest, 210 toward cool slate. The surface stays dark (lightness is fixed); only its tint moves. Independent of accentHue, which only colours rims/highlights."),baseSat:O().min(0).max(100).default(20).describe("Saturation of the dark card surface as an HSL percentage (0–100). 20 is the default subtle navy tint; raise it for a richer coloured-black surface, drop it toward 0 for a neutral graphite/black with no colour cast. Pairs with baseHue."),upColor:W().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #3fd08f").default("#3fd08f").describe("Semantic colour for gains / positive change / bullish (up). 6-digit hex; default #3fd08f (green). Tints every gain delta, mover row, up-candle, and 'long'/'call' marker. Set this and downColor to a non-green/red pair (e.g. blue/orange) for a colourblind-friendly dashboard. Distinct from the accent (which is brand colour, not meaning) and from the error red."),downColor:W().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #ff6b81").default("#ff6b81").describe("Semantic colour for losses / negative change / bearish (down). 6-digit hex; default #ff6b81 (red). The counterpart to upColor — tints every loss delta, mover row, down-candle, and 'short'/'put' marker.")}).describe("Dashboard-wide colour identity — accent (rims/highlights), the dark card-surface tint (base), and the semantic up/down (gain/loss) colours."),uh=_({fontFamily:re(["sans","mono","serif"]).default("sans").describe("Type family for all dashboard text. 'sans' is the default DM Sans (clean, modern); 'mono' switches to a monospaced system stack (a Bloomberg/terminal feel, numbers in fixed columns); 'serif' uses a system serif (editorial). Affects card titles, labels, and readouts alike."),numericStyle:re(["proportional","tabular"]).default("proportional").describe("How digits are spaced everywhere on the dashboard. 'proportional' is the default (natural widths); 'tabular' forces fixed-width figures (font-variant-numeric: tabular-nums) so live prices and tickers stop shifting sideways as digits change — recommended for number-dense dashboards. Hero stat numerals are always tabular regardless."),scale:O().min(.85).max(1.25).default(1).describe("Global text-size multiplier (0.85–1.25). 1 is the default. Scales all dashboard text together by setting the root font size, so chart labels, readouts, and titles grow or shrink as one — raise it for legibility on a large display, lower it to pack more in. Distinct from appearance.density, which scales card padding, not text. Grid cell heights are in pixels and stay fixed, so text can overflow a small card at high scale.")}).describe("Dashboard-wide typography — font family, numeric digit style, and global text scale."),dh={sans:'"DM Sans", sans-serif',mono:'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace',serif:'ui-serif, Georgia, "Times New Roman", serif'},fh={proportional:"normal",tabular:"tabular-nums"},hh=_({radius:O().min(0).default(18).describe("Frame corner radius in pixels, applied to every card via --zf-frame-radius. 0 squares the corners; the editor's Appearance rail exposes this as a slider."),borderStrength:O().min(0).max(1).default(.22).describe("Opacity of each card's accent rim (0–1) via --zf-border-alpha. 0 = borderless flat cards, 1 = a solid outlined rim; 0.22 is the default soft edge. Hover lifts it a notch automatically."),surfaceOpacity:O().min(.3).max(1).default(1).describe("Opacity of the card surface (0.3–1) via --zf-surface-opacity. 1 = opaque cards (default); lower it toward 0.5 for frosted/glassy cards that let the dashboard background show through. Kept ≥0.3 so card content stays legible."),density:O().min(.6).max(1.4).default(1).describe("Card padding scale (0.6–1.4) via --zf-density. 1 = the comfortable default; <1 tightens padding for information-dense dashboards, >1 gives roomier breathing space."),elevation:O().min(0).max(2).default(1).describe("Card shadow depth (0–2) via --zf-elevation. 0 = flat (no drop shadow), 1 = the default resting shadow, 2 = a heavier floating lift. Scales the card's drop shadow only.")}).describe("Card surface treatment — corners, border, opacity, padding density, and shadow depth. Distinct from `grid` (geometry) and `theme` (accent color)."),ph=oh(e=>{if(!e||typeof e!="object")return e;let t=e;const r=t.grid;if(r&&typeof r=="object"&&"radius"in r){const{radius:a,...o}=r;t={...t,grid:o,appearance:{radius:a,...t.appearance??{}}}}const n=t.background;return n&&typeof n=="object"&&n.type==="gradient"&&!("gradientFrom"in n)&&(t={...t,background:{...n,type:"none"}}),t},_({version:ih().default("1.0.0").describe('Spec version, a semver-style string like package.json\'s ("1.0.0"). A legacy numeric `1` from an older spec is coerced to "1".'),title:W().describe("Dashboard name, like package.json's name."),author:W().optional().describe(`Who made this dashboard — a free-form credit, like package.json's author ("You" or "You <you@example.com>"). Optional.`),grid:_({mode:re(["flow-vertical","flow-horizontal","canvas"]).default("flow-vertical").describe("Layout model. 'flow-vertical' (default): a fixed number of columns fill the viewport width; the board grows downward and scrolls vertically — the classic dashboard. 'flow-horizontal': a fixed number of rows fill the viewport height; the board grows rightward and scrolls horizontally — suited to ultrawide and wall displays. 'canvas': an unbounded pan/zoom plane (not yet implemented; rendered as flow-vertical for now)."),columns:O().int().min(1).default(12).describe("Number of columns the grid is divided into across the viewport width (flow-vertical). A frame's `position` x/w are in these column units."),rowHeight:O().min(8).default(96).describe("Pixel height of each grid row (flow-vertical). A frame's `position` y/h are in these row units."),rows:O().int().min(1).default(6).describe('Number of height-bounded rows the horizontal board (flow-horizontal) fills before it scrolls sideways. A frame\'s `layouts["flow-horizontal"]` y/h are in these row units. Ignored in flow-vertical.'),gap:O().min(0).default(12).describe("Pixels of space between frames (the grid gutter). 0 makes the cards flush; the editor's Layout rail exposes this as a slider."),paddingX:O().min(0).default(0).describe("Horizontal padding (px) inside the dashboard grid — the left/right gutter between the frames and the viewport edges (the x-axis inset). 0 (default) keeps the board flush to the edges; the editor's Layout rail exposes this as a slider.")}).default({mode:"flow-vertical",columns:12,rowHeight:96,rows:6,gap:12,paddingX:0}),background:ch.default({type:"none",color:"#0a0a12",gradientFrom:"#1b1e4d",gradientTo:"#07070c",gradientAngle:160,scale:1,dpi:1.5,opacity:.16}),theme:lh.default({accentHue:242,accentSat:90,baseHue:233,baseSat:20,upColor:"#3fd08f",downColor:"#ff6b81"}),typography:uh.default({fontFamily:"sans",numericStyle:"proportional",scale:1}),appearance:hh.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:Ge(sh)})),Kb=[{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},scene:"aurora"},{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},scene:"verdant"},{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},scene:"ember"},{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},scene:"aurora"},{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},scene:"dusk"},{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},scene:"ember"}],mh="YrTzGatwjK7EoFpCSfgZ",gh=[{key:"aurora",label:"Aurora",description:"The signature zframes scene — a slow indigo aurora drifting over near-black. The default backdrop.",projectId:mh,baseHue:242,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",baseHue:268,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",baseHue:24,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",baseHue:190,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",baseHue:150,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",baseHue:320,swatch:"radial-gradient(120% 120% at 70% 30%, hsl(320 80% 62%) 0%, hsl(300 60% 28%) 45%, hsl(290 45% 7%) 100%)"}],vh=242;function yh(e){const t=gh.find(r=>r.projectId===e);return t?t.baseHue:vh}const Ss=A.createContext(null),zs=A.createContext([]);function bh({providers:e,children:t}){const r=Array.isArray(e)?e:[e];return w.jsx(zs.Provider,{value:r,children:t})}function Un(){return A.useContext(zs)}function ee(e){return Un().find(r=>r.capabilities.includes(e))??null}function te(e,t,r,n){const[a,o]=A.useState(t),[i,s]=A.useState(!0),c=A.useContext(Ss);return A.useEffect(()=>{if(!e){s(!1);return}let l=!1;o(t),s(!0);const u=()=>{c&&!c.visibleRef.current||e().then(m=>{l||(o(m),s(!1))}).catch(()=>{l||s(!1)})};u();let f;const h=()=>{f=setTimeout(()=>{u(),h()},n*(.85+Math.random()*.3))};h();const d=c==null?void 0:c.subscribe(m=>{m&&!l&&u()});return()=>{l=!0,clearTimeout(f),d==null||d()}},r),{data:a,isLoading:i}}function wh(e){const t=ee("quote-stream"),[r,n]=A.useState({}),[a,o]=A.useState(!0),i=e.join(",");return A.useEffect(()=>{const s=i.split(",").filter(Boolean);if(n({}),!(t!=null&&t.subscribeMids)||s.length===0){o(!1);return}let c=!1,l=!1;o(!0);const u=setTimeout(()=>{!c&&!l&&o(!1)},8e3),f=t.subscribeMids(h=>{c||(l=!0,clearTimeout(u),o(!1),n(d=>{let m=!1;const p={};for(const g of s){const v=h[g];v!==void 0&&(p[g]=v,v!==d[g]&&(m=!0))}return Object.keys(d).length!==Object.keys(p).length&&(m=!0),m?p:d}))},s);return()=>{c=!0,clearTimeout(u),f()}},[t,i]),{mids:r,isLoading:a}}function qb(e){return wh(e).mids}function xh(e,t=3e4){const r=ee("day-stats"),n=e?[...e].sort().join(","):"*",a=n==="*"?void 0:n.split(",").filter(Boolean),{data:o,isLoading:i}=te(r!=null&&r.getDayStats?()=>r.getDayStats(a):null,{},[r,n,t],t);return{stats:o,isLoading:i}}function Io(e,t=3e4){return xh(e,t).stats}function Jb(e,t,r=5*6e4){const n=ee("funding-history"),a=e.join(","),o=a.split(",").filter(Boolean),{data:i,isLoading:s}=te(n!=null&&n.getFundingHistory&&o.length>0?()=>n.getFundingHistory(o,t):null,{},[n,a,t,r],r);return{history:i,isLoading:s}}function Xb(e,t,r,n=6e4){const a=ee("ohlcv"),{data:o,isLoading:i}=te(a!=null&&a.getCandles&&e?()=>a.getCandles(e,t,r):null,[],[a,e,t,r,n],n);return{candles:o,isLoading:i}}function Zb(e,t,r,n=6e4){const a=ee("ohlcv"),o=e.join(","),i=o.split(",").filter(Boolean),{data:s,isLoading:c}=te(a!=null&&a.getCandles&&i.length>0?async()=>{const l=await Promise.all(i.map(u=>a.getCandles(u,t,r).then(f=>[u,f]).catch(()=>[u,[]])));return Object.fromEntries(l)}:null,{},[a,o,t,r,n],n);return{candles:s,isLoading:c}}function $b(e=10*6e4){const t=ee("tvl"),{data:r,isLoading:n}=te(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:r,isLoading:n}}function Qb(e=10*6e4){const t=ee("dex-volume"),{data:r,isLoading:n}=te(t!=null&&t.getDexVolume?()=>t.getDexVolume():null,[],[t,e],e);return{entries:r,isLoading:n}}function e1(e,t=5*6e4){const r=ee("dex-volume"),n=e.join(","),a=n.split(",").filter(Boolean),{data:o,isLoading:i}=te(r!=null&&r.getDexVolumeHistory&&a.length>0?()=>r.getDexVolumeHistory(a):null,{},[r,n,t],t);return{history:o,isLoading:i}}function t1(e=10*6e4){const t=ee("protocol-tvl"),{data:r,isLoading:n}=te(t!=null&&t.getProtocolTvl?()=>t.getProtocolTvl():null,[],[t,e],e);return{entries:r,isLoading:n}}function r1(e,t=5*6e4){const r=ee("protocol-tvl"),n=e.join(","),a=n.split(",").filter(Boolean),{data:o,isLoading:i}=te(r!=null&&r.getProtocolTvlHistory&&a.length>0?()=>r.getProtocolTvlHistory(a):null,{},[r,n,t],t);return{history:o,isLoading:i}}function n1(e=10*6e4){const t=ee("protocol-fees"),{data:r,isLoading:n}=te(t!=null&&t.getProtocolFees?()=>t.getProtocolFees():null,[],[t,e],e);return{entries:r,isLoading:n}}function a1(e=10*6e4){const t=ee("coin-markets"),{data:r,isLoading:n}=te(t!=null&&t.getCoinMarkets?()=>t.getCoinMarkets():null,[],[t,e],e);return{entries:r,isLoading:n}}function o1(e=300,t=15*6e4){const r=ee("coin-movers"),{data:n,isLoading:a}=te(r!=null&&r.getCoinMovers?()=>r.getCoinMovers(e):null,[],[r,e,t],t);return{entries:n,isLoading:a}}function i1(e,t=3e4){const r=ee("open-interest"),n=e?[...e].sort().join(","):"*",a=n==="*"?void 0:n.split(",").filter(Boolean),{data:o,isLoading:i}=te(r!=null&&r.getOpenInterest?()=>r.getOpenInterest(a):null,[],[r,n,t],t);return{entries:o,isLoading:i}}function s1(e=15*6e4){const t=ee("global-market"),{data:r,isLoading:n}=te(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:r,isLoading:n}}function c1(e=30,t=60*6e4){const r=ee("sentiment"),{data:n,isLoading:a}=te(r!=null&&r.getFearGreed?()=>r.getFearGreed(e):null,[],[r,e,t],t);return{points:n,isLoading:a}}function l1(e=15*6e4){const t=ee("reference-rates"),{data:r,isLoading:n}=te(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function u1(e,t,r=60*6e4){const n=ee("fx-rates"),a=t.join(","),{data:o,isLoading:i}=te(n!=null&&n.getFxRates?()=>n.getFxRates(e,[...t]):null,[],[n,e,a,r],r);return{rates:o,isLoading:i}}function d1(e=360*6e4){const t=ee("treasury-rates"),{data:r,isLoading:n}=te(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function f1(e=360*6e4){const t=ee("yield-curve"),{data:r,isLoading:n}=te(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:r,isLoading:n}}function h1(e=8,t=360*6e4){const r=ee("treasury-auctions"),{data:n,isLoading:a}=te(r!=null&&r.getTreasuryAuctions?()=>r.getTreasuryAuctions(e):null,[],[r,e,t],t);return{auctions:n,isLoading:a}}function p1(e=180,t=360*6e4){const r=ee("national-debt"),{data:n,isLoading:a}=te(r!=null&&r.getNationalDebt?()=>r.getNationalDebt(e):null,null,[r,e,t],t);return{debt:n,isLoading:a}}function m1(e=360*6e4){const t=ee("financial-stress"),{data:r,isLoading:n}=te(t!=null&&t.getFinancialStress?()=>t.getFinancialStress():null,null,[t,e],e);return{stress:r,isLoading:n}}function g1(e,t,r,n=720*6e4){const a=ee("macro-series"),{data:o,isLoading:i}=te(a!=null&&a.getMacroSeries&&e?()=>a.getMacroSeries(e,t,r):null,null,[a,e,t,r,n],n);return{series:o,isLoading:i}}function v1(e,t=30*6e4){const r=ee("filings"),{data:n,isLoading:a}=te(r!=null&&r.getCompanyFilings&&e?()=>r.getCompanyFilings(e):null,null,[r,e,t],t);return{data:n,isLoading:a}}function y1(e,t=720*6e4){const r=ee("fundamentals"),{data:n,isLoading:a}=te(r!=null&&r.getCompanyFacts&&e?()=>r.getCompanyFacts(e):null,null,[r,e,t],t);return{data:n,isLoading:a}}function b1(e,t=360*6e4){const r=ee("short-volume"),n=e.join(","),a=n.split(",").filter(Boolean),{data:o,isLoading:i}=te(r!=null&&r.getShortVolume&&a.length>0?()=>r.getShortVolume(a):null,{},[r,n,t],t);return{data:o,isLoading:i}}function w1(e,t,r,n=5*6e4){const a=ee("news"),o=t?t.join(","):"",{data:i,isLoading:s}=te(a!=null&&a.getNews&&e?()=>a.getNews({feed:e,symbols:o?o.split(","):void 0,limit:r}):null,[],[a,e,o,r,n],n);return{items:i,isLoading:s}}function x1(e=3e4){const t=ee("btc-fees"),{data:r,isLoading:n}=te(t!=null&&t.getBtcFees?()=>t.getBtcFees():null,null,[t,e],e);return{fees:r,isLoading:n}}function k1(e=15e3){const t=ee("btc-mempool"),{data:r,isLoading:n}=te(t!=null&&t.getMempoolState?()=>t.getMempoolState():null,null,[t,e],e);return{state:r,isLoading:n}}function C1(e=8,t=3e4){const r=ee("btc-blocks"),{data:n,isLoading:a}=te(r!=null&&r.getBtcBlocks?()=>r.getBtcBlocks(e):null,[],[r,e,t],t);return{blocks:n,isLoading:a}}function _1(e="1y",t=30*6e4){const r=ee("btc-hashrate"),{data:n,isLoading:a}=te(r!=null&&r.getNetworkHashrate?()=>r.getNetworkHashrate(e):null,null,[r,e,t],t);return{data:n,isLoading:a}}function A1(e=6e4){const t=ee("btc-difficulty"),{data:r,isLoading:n}=te(t!=null&&t.getDifficultyAdjustment?()=>t.getDifficultyAdjustment():null,null,[t,e],e);return{adjustment:r,isLoading:n}}function S1(e="1w",t=5*6e4){const r=ee("mining-pools"),{data:n,isLoading:a}=te(r!=null&&r.getMiningPools?()=>r.getMiningPools(e):null,null,[r,e,t],t);return{pools:n,isLoading:a}}function z1(e=30*6e4){const t=ee("lightning-stats"),{data:r,isLoading:n}=te(t!=null&&t.getLightningStats?()=>t.getLightningStats():null,null,[t,e],e);return{stats:r,isLoading:n}}function T1(e,t=5*6e4){const r=ee("options-summary"),n=(e||"BTC").toUpperCase(),{data:a,isLoading:o}=te(r!=null&&r.getOptionsSummary?()=>r.getOptionsSummary(n):null,null,[r,n,t],t);return{summary:a,isLoading:o}}function E1(e,t=6e4){const r=Un(),n=e?r.find(s=>{var c;return!!s.getPortfolio&&s.capabilities.includes("portfolio")&&(((c=s.portfolioKinds)==null?void 0:c.includes(e.kind))??!0)})??null:null,a=e?`${e.kind}:${e.address??""}`:"",{data:o,isLoading:i}=te(n&&e?()=>n.getPortfolio(e):null,null,[n,a,t],t);return{portfolio:o,isLoading:i}}function P1(e,t,r=43200,n=10*6e4){const a=ee("volatility-index"),o=(e||"BTC").toUpperCase(),{data:i,isLoading:s}=te(a!=null&&a.getVolatilityIndex?()=>a.getVolatilityIndex(o,t,r):null,[],[a,o,t,r,n],n);return{points:i,isLoading:s}}function M1(e=180*6e4){const t=ee("onchain-valuation"),{data:r,isLoading:n}=te(t!=null&&t.getOnchainValuation?()=>t.getOnchainValuation():null,null,[t,e],e);return{valuation:r,isLoading:n}}function D1(e="btc",t=360*6e4){const r=ee("price-history-daily"),n=e.toLowerCase(),{data:a,isLoading:o}=te(r!=null&&r.getDailyCloseHistory?()=>r.getDailyCloseHistory(n):null,[],[r,n,t],t);return{history:a,isLoading:o}}function R1(e=720*6e4){const t=ee("onchain-cycle-extras"),{data:r,isLoading:n}=te(t!=null&&t.getOnchainExtras?()=>t.getOnchainExtras():null,null,[t,e],e);return{extras:r,isLoading:n}}function O1(e=60*6e4){const t=ee("dollar-index"),{data:r,isLoading:n}=te(t!=null&&t.getDollarIndex?()=>t.getDollarIndex():null,null,[t,e],e);return{dxy:r,isLoading:n}}function N1(e=60*6e4){const t=ee("stablecoins"),{data:r,isLoading:n}=te(t!=null&&t.getStablecoinSupply?()=>t.getStablecoinSupply():null,null,[t,e],e);return{supply:r,isLoading:n}}function L1(e=15*6e4){const t=ee("yields"),{data:r,isLoading:n}=te(t!=null&&t.getYieldPools?()=>t.getYieldPools():null,[],[t,e],e);return{pools:r,isLoading:n}}function I1(e=10*6e4){const t=ee("fees-overview"),{data:r,isLoading:n}=te(t!=null&&t.getFeesOverview?()=>t.getFeesOverview():null,null,[t,e],e);return{fees:r,isLoading:n}}function F1(e=5*6e4){const t=ee("funding-comparison"),{data:r,isLoading:n}=te(t!=null&&t.getFundingComparison?()=>t.getFundingComparison():null,[],[t,e],e);return{comparison:r,isLoading:n}}function U1(e=2*6e4){const t=ee("eth-supply"),{data:r,isLoading:n}=te(t!=null&&t.getEthSupply?()=>t.getEthSupply():null,null,[t,e],e);return{supply:r,isLoading:n}}function j1(e=12,t=5*6e4){const r=ee("prediction-markets"),{data:n,isLoading:a}=te(r!=null&&r.getPredictionMarkets?()=>r.getPredictionMarkets(e):null,[],[r,e,t],t);return{markets:n,isLoading:a}}function H1(e="btc",t=360*6e4){const r=ee("etf-flows"),n=e.toLowerCase(),{data:a,isLoading:o}=te(r!=null&&r.getEtfFlows?()=>r.getEtfFlows(n):null,null,[r,n,t],t);return{flows:a,isLoading:o}}function B1(e=10*6e4){const t=ee("trending-coins"),{data:r,isLoading:n}=te(t!=null&&t.getTrendingCoins?()=>t.getTrendingCoins():null,[],[t,e],e);return{coins:r,isLoading:n}}function V1(e=12*6e4){const t=ee("sector-performance"),{data:r,isLoading:n}=te(t!=null&&t.getSectorPerformance?()=>t.getSectorPerformance():null,[],[t,e],e);return{sectors:r,isLoading:n}}const kh=A.createContext(null);function W1(){return A.useContext(kh)}const Ch=`
|
|
66
|
+
.zf-grid {
|
|
67
|
+
display: grid;
|
|
68
|
+
gap: var(--zf-gap, 12px);
|
|
69
|
+
padding-inline: var(--zf-pad-x, 0);
|
|
70
|
+
grid-template-columns: repeat(var(--zf-cols, 12), minmax(0, 1fr));
|
|
71
|
+
grid-auto-rows: var(--zf-row-h, 96px);
|
|
72
|
+
/* Bridge the type family onto the dashboard subtree: redefine --font-dmsans
|
|
73
|
+
HERE (where --zf-font-family is set inline) so the chart utilities and frame
|
|
74
|
+
titles that read var(--font-dmsans) pick up the chosen family. Declaring it
|
|
75
|
+
on this container — not at :root — is what makes the var() substitution see
|
|
76
|
+
the inline --zf-font-family. (The editor mirrors this on .zf-editor.) */
|
|
77
|
+
--font-dmsans: var(--zf-font-family, "DM Sans", sans-serif);
|
|
78
|
+
}
|
|
79
|
+
/* flow-horizontal: the board is bounded to the viewport height as --zf-h-rows
|
|
80
|
+
equal bands and grows rightward, scrolling sideways. The vertical position
|
|
81
|
+
can't be honoured here (its y runs to 100+ rows), so each frame uses its own
|
|
82
|
+
stored horizontal layout instead: the renderer emits real --zf-col/row-start
|
|
83
|
+
for a frame that HAS a horizontal layout (explicit placement, via the base
|
|
84
|
+
.zf-frame rule), and OMITS them for one that doesn't (the auto var-fallback)
|
|
85
|
+
so grid-auto-flow: column dense packs it by w/h size — the fallback for
|
|
86
|
+
un-edited / agent-generated specs. Column tracks reuse the vertical row height
|
|
87
|
+
(--zf-row-h) so cells stay roughly square. Gated above the phone breakpoint so
|
|
88
|
+
phones keep the single-column reflow below. */
|
|
89
|
+
@media (min-width: 641px) {
|
|
90
|
+
.zf-grid.zf-flow-horizontal {
|
|
91
|
+
grid-template-columns: none;
|
|
92
|
+
grid-template-rows: repeat(var(--zf-h-rows, 6), minmax(0, 1fr));
|
|
93
|
+
grid-auto-flow: column dense;
|
|
94
|
+
grid-auto-columns: var(--zf-row-h, 96px);
|
|
95
|
+
height: var(--zf-h-height, calc(100vh - 220px));
|
|
96
|
+
min-height: 420px;
|
|
97
|
+
overflow-x: auto;
|
|
98
|
+
overflow-y: hidden;
|
|
99
|
+
align-content: stretch;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.zf-frame {
|
|
103
|
+
grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
|
|
104
|
+
grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
|
|
105
|
+
position: relative;
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
min-height: 0;
|
|
109
|
+
/* visible (not hidden) so the hover glow on ::after can bleed past the card
|
|
110
|
+
edge exactly like the original box-shadow did. The card itself has nothing
|
|
111
|
+
to clip — its surface/border are rounded by border-radius, and content lives
|
|
112
|
+
in .zf-frame-body which carries the interior clip below. */
|
|
113
|
+
overflow: visible;
|
|
114
|
+
padding: calc(16px * var(--zf-density, 1)) calc(18px * var(--zf-density, 1));
|
|
115
|
+
/* Digit spacing for everything inside the card. Default \`normal\` is a no-op;
|
|
116
|
+
spec.typography.numericStyle="tabular" sets --zf-numeric so live prices stop
|
|
117
|
+
jittering. Hero numerals carry their own tabular-nums regardless. */
|
|
118
|
+
font-variant-numeric: var(--zf-numeric, normal);
|
|
119
|
+
/* Card surface. The three dark stops are expressed off --zf-base-hue /
|
|
120
|
+
--zf-base-sat (spec.theme) with their lightness baked, so the default
|
|
121
|
+
hsl(233 20% …) reproduces the original navy to within ~1/255, while the base
|
|
122
|
+
knobs let the whole surface warm, cool, or desaturate toward black. */
|
|
123
|
+
background: var(--zf-frame-bg, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / calc(0.82 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / calc(0.86 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / calc(0.9 * var(--zf-surface-opacity, 1))) 100%));
|
|
124
|
+
border: 1px solid var(--zf-frame-border, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / var(--zf-border-alpha, 0.22)));
|
|
125
|
+
border-radius: var(--zf-frame-radius, 18px);
|
|
126
|
+
box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(18px * var(--zf-elevation, 1)) calc(44px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.9));
|
|
127
|
+
/* Hover animates only GPU-composited properties: \`transform\` is the lift,
|
|
128
|
+
\`border-color\` is a cheap 1px paint. The surface brightening + accent glow
|
|
129
|
+
are deliberately NOT transitioned here — animating the gradient \`background\`
|
|
130
|
+
and the large-blur \`box-shadow\` re-rasterized the whole translucent card
|
|
131
|
+
every frame over the animated backdrop, which is what made the hover lag.
|
|
132
|
+
Those now ride the opacity-faded ::after overlay defined below. */
|
|
133
|
+
transition:
|
|
134
|
+
border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
135
|
+
transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
136
|
+
/* Frames arrive in a soft top-down cascade on first paint. The translate
|
|
137
|
+
property (not transform) carries the motion, so the hover lift stays
|
|
138
|
+
independent; the backwards fill holds the hidden state through the stagger
|
|
139
|
+
delay, then hands transform back to :hover once the entrance settles. */
|
|
140
|
+
animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
|
|
141
|
+
animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
|
|
142
|
+
}
|
|
143
|
+
/* The brightened surface + accent glow that appear on hover live on this overlay
|
|
144
|
+
and cross-fade via \`opacity\` (GPU-composited) instead of transitioning the
|
|
145
|
+
card's own gradient/box-shadow — both re-rasterize the whole translucent card
|
|
146
|
+
every frame over the animated backdrop, which is what made the hover lag. The
|
|
147
|
+
card is overflow:visible (above), so this layer's OUTER accent shadow bleeds
|
|
148
|
+
past the edge exactly like the original hover did; the layer paints once, then
|
|
149
|
+
only its opacity animates. It sits above the base surface (z-index:0) and below
|
|
150
|
+
the card content (z-index:1) so text and charts stay crisp, and keeps the
|
|
151
|
+
--zf-frame-bg-hover override hook. Errors keep their own red hover (see
|
|
152
|
+
.zf-frame--error), so this is the non-error path. */
|
|
153
|
+
.zf-frame:not(.zf-frame--error)::after {
|
|
154
|
+
content: '';
|
|
155
|
+
position: absolute;
|
|
156
|
+
inset: 0;
|
|
157
|
+
z-index: 0;
|
|
158
|
+
border-radius: inherit;
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
opacity: 0;
|
|
161
|
+
background: var(--zf-frame-bg-hover, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 16.5% / calc(0.88 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 9% / calc(0.9 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 6.3% / calc(0.92 * var(--zf-surface-opacity, 1))) 100%));
|
|
162
|
+
/* The accent half of the original hover shadow, verbatim: brighter top inner
|
|
163
|
+
highlight, a 1px accent ring at the edge, and the soft accent glow pooling
|
|
164
|
+
below and around the card. */
|
|
165
|
+
box-shadow:
|
|
166
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.09),
|
|
167
|
+
0 0 0 1px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.12),
|
|
168
|
+
0 calc(20px * var(--zf-elevation, 1)) calc(60px * var(--zf-elevation, 1)) -28px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.4);
|
|
169
|
+
transition: opacity 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
170
|
+
}
|
|
171
|
+
/* Hover lift is pointer-only — on touch it would stick after a tap. The lift
|
|
172
|
+
(transform) + brighter border transition on the card itself; the surface
|
|
173
|
+
brightening + accent glow ride the ::after overlay's opacity above. */
|
|
174
|
+
@media (hover: hover) {
|
|
175
|
+
.zf-frame:hover {
|
|
176
|
+
border-color: var(--zf-frame-border-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / calc(var(--zf-border-alpha, 0.22) + 0.2)));
|
|
177
|
+
transform: translateY(-2px);
|
|
178
|
+
}
|
|
179
|
+
.zf-frame:not(.zf-frame--error):hover::after {
|
|
180
|
+
opacity: 1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/* Top edge sheen — inset past the corner radius so the bright line never
|
|
184
|
+
pokes outside the rounded border (which read as a clipped corner). */
|
|
185
|
+
.zf-frame::before {
|
|
186
|
+
content: '';
|
|
187
|
+
position: absolute;
|
|
188
|
+
top: 0;
|
|
189
|
+
left: 18px;
|
|
190
|
+
right: 18px;
|
|
191
|
+
height: 1px;
|
|
192
|
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
|
|
193
|
+
pointer-events: none;
|
|
194
|
+
z-index: 2;
|
|
195
|
+
}
|
|
196
|
+
.zf-frame-title {
|
|
197
|
+
position: relative;
|
|
198
|
+
z-index: 1;
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
gap: 7px;
|
|
202
|
+
margin-bottom: 12px;
|
|
203
|
+
font-family: var(--font-dmsans, inherit);
|
|
204
|
+
/* rem (not px) so spec.typography.scale — applied as the root font size by the
|
|
205
|
+
host — grows the card title along with the rem-based chart text it sits above.
|
|
206
|
+
0.625rem = 10px at the default root size, so scale 1 is a no-op. */
|
|
207
|
+
font-size: 0.625rem;
|
|
208
|
+
font-weight: 700;
|
|
209
|
+
letter-spacing: 0.14em;
|
|
210
|
+
text-transform: uppercase;
|
|
211
|
+
color: var(--zf-frame-title, rgba(255, 255, 255, 0.5));
|
|
212
|
+
flex: none;
|
|
213
|
+
}
|
|
214
|
+
.zf-frame-title::before {
|
|
215
|
+
content: '';
|
|
216
|
+
width: 5px;
|
|
217
|
+
height: 5px;
|
|
218
|
+
border-radius: 9999px;
|
|
219
|
+
background: var(--zf-frame-title-dot, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%));
|
|
220
|
+
box-shadow: 0 0 8px var(--zf-frame-title-dot-glow, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.9));
|
|
221
|
+
}
|
|
222
|
+
/* A title with a leading icon (e.g. an asset logo) drops the status dot — the
|
|
223
|
+
logo is the card's identity marker. */
|
|
224
|
+
.zf-frame-title--icon::before { display: none; }
|
|
225
|
+
/* The title label takes the remaining width and truncates so a long title
|
|
226
|
+
never shoves the source credit off the card. */
|
|
227
|
+
.zf-frame-title-text {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
text-overflow: ellipsis;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
}
|
|
233
|
+
/* Data-source credit — a clickable provider link pinned to the right of the
|
|
234
|
+
title row. Brand casing is preserved (text-transform reset) so DeFiLlama /
|
|
235
|
+
alternative.me read correctly against the uppercase title. */
|
|
236
|
+
.zf-frame-source {
|
|
237
|
+
margin-left: auto;
|
|
238
|
+
padding-left: 10px;
|
|
239
|
+
display: inline-flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 5px;
|
|
242
|
+
flex: none;
|
|
243
|
+
text-transform: none;
|
|
244
|
+
letter-spacing: 0;
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
}
|
|
247
|
+
.zf-frame-source a {
|
|
248
|
+
color: var(--zf-frame-source, rgba(255, 255, 255, 0.42));
|
|
249
|
+
text-decoration: none;
|
|
250
|
+
transition: color 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
251
|
+
white-space: nowrap;
|
|
252
|
+
}
|
|
253
|
+
@media (hover: hover) {
|
|
254
|
+
.zf-frame-source a:hover {
|
|
255
|
+
color: var(--zf-frame-source-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 80%));
|
|
256
|
+
text-decoration: underline;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
.zf-frame-source-sep { color: rgba(255, 255, 255, 0.22); }
|
|
260
|
+
.zf-frame-body {
|
|
261
|
+
position: relative;
|
|
262
|
+
z-index: 1;
|
|
263
|
+
flex: 1;
|
|
264
|
+
min-height: 0;
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
/* Holds the interior clip the card used to own (now overflow:visible so its
|
|
268
|
+
hover glow can escape). The body sits inside the card's padding, so its
|
|
269
|
+
square corners fall within the rounded card and this clip is invisible —
|
|
270
|
+
content/charts/scroll areas clip exactly as before. */
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
/* Skip rendering the (expensive) body — charts, canvases, long lists — while
|
|
273
|
+
the card is scrolled off-screen, so a dashboard with dozens of frames only
|
|
274
|
+
pays layout+paint for what's on screen. Applied to the BODY, not .zf-frame:
|
|
275
|
+
content-visibility implies paint containment, and putting it on the card
|
|
276
|
+
would clip the ::after hover glow that intentionally bleeds past the edge.
|
|
277
|
+
The card's height is fixed by the grid / GridStack (not its content), so
|
|
278
|
+
skipping the body never reflows the card — no scroll jank. contain-intrinsic
|
|
279
|
+
-size feeds a placeholder height for not-yet-rendered cards; the auto keyword
|
|
280
|
+
then remembers each body's real size once it has painted. A no-op for
|
|
281
|
+
on-screen cards. */
|
|
282
|
+
content-visibility: auto;
|
|
283
|
+
contain-intrinsic-size: auto var(--zf-cis-h, 240px);
|
|
284
|
+
}
|
|
285
|
+
.zf-frame-body > * {
|
|
286
|
+
flex: 1;
|
|
287
|
+
min-height: 0;
|
|
288
|
+
}
|
|
289
|
+
/* ── Error cards ────────────────────────────────────────────────────────────
|
|
290
|
+
Unknown frame / missing capability / invalid config / runtime crash all share
|
|
291
|
+
one centered empty-state: an alert glyph, a headline naming what's wrong, the
|
|
292
|
+
frame's name, then the specific detail. Centered (not top-left) so the card
|
|
293
|
+
reads as a deliberate state instead of a raw debug dump floating in a void —
|
|
294
|
+
and a faint red top-bloom signals "error" across the whole surface, not just
|
|
295
|
+
the 1px border. This is also the generating agent's feedback surface, so the
|
|
296
|
+
detail stays precise (field paths, the exact missing capability/provider). */
|
|
297
|
+
.zf-frame--error {
|
|
298
|
+
border-color: var(--zf-frame-error-border, rgba(242, 21, 83, 0.42));
|
|
299
|
+
background: var(
|
|
300
|
+
--zf-frame-error-bg,
|
|
301
|
+
radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
|
|
302
|
+
linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / 0.82) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / 0.86) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / 0.9) 100%)
|
|
303
|
+
);
|
|
304
|
+
/* Errors are a rare state and never hover-spammed, so they keep the original
|
|
305
|
+
background + box-shadow cross-fade (the GPU-only ::after path is reserved
|
|
306
|
+
for the common, non-error card). */
|
|
307
|
+
transition:
|
|
308
|
+
border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
309
|
+
background 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
310
|
+
box-shadow 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
311
|
+
transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
312
|
+
}
|
|
313
|
+
@media (hover: hover) {
|
|
314
|
+
.zf-frame--error:hover {
|
|
315
|
+
border-color: var(--zf-frame-error-border-hover, rgba(242, 21, 83, 0.6));
|
|
316
|
+
background: var(
|
|
317
|
+
--zf-frame-error-bg,
|
|
318
|
+
radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
|
|
319
|
+
linear-gradient(165deg, rgba(26, 27, 38, 0.82) 0%, rgba(14, 15, 22, 0.86) 60%, rgba(10, 11, 17, 0.9) 100%)
|
|
320
|
+
);
|
|
321
|
+
box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px -26px rgba(0, 0, 0, 0.9)), 0 0 0 1px rgba(242, 21, 83, 0.14), 0 20px 56px -30px rgba(242, 21, 83, 0.4);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/* The centered stack. flex:1 lets it claim the whole card; the inner content
|
|
325
|
+
stays its natural height and is centered around the card's middle, so a 2×1
|
|
326
|
+
card and a 6×4 card both read as composed rather than top-anchored. */
|
|
327
|
+
.zf-error {
|
|
328
|
+
flex: 1;
|
|
329
|
+
min-height: 0;
|
|
330
|
+
display: flex;
|
|
331
|
+
flex-direction: column;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
gap: 8px;
|
|
335
|
+
padding: 4px 2px;
|
|
336
|
+
text-align: center;
|
|
337
|
+
overflow: auto;
|
|
338
|
+
}
|
|
339
|
+
.zf-error-icon {
|
|
340
|
+
flex: none;
|
|
341
|
+
width: 38px;
|
|
342
|
+
height: 38px;
|
|
343
|
+
display: grid;
|
|
344
|
+
place-items: center;
|
|
345
|
+
border-radius: 12px;
|
|
346
|
+
color: var(--zf-frame-error-text, #ff8b9d);
|
|
347
|
+
background: rgba(242, 21, 83, 0.12);
|
|
348
|
+
box-shadow: inset 0 0 0 1px rgba(242, 21, 83, 0.32),
|
|
349
|
+
0 0 24px -8px rgba(242, 21, 83, 0.6);
|
|
350
|
+
}
|
|
351
|
+
.zf-error-icon svg {
|
|
352
|
+
display: block;
|
|
353
|
+
width: 20px;
|
|
354
|
+
height: 20px;
|
|
355
|
+
}
|
|
356
|
+
.zf-error-headline {
|
|
357
|
+
font-family: var(--font-dmsans, inherit);
|
|
358
|
+
font-size: 13px;
|
|
359
|
+
font-weight: 700;
|
|
360
|
+
letter-spacing: 0.01em;
|
|
361
|
+
color: var(--zf-frame-error-headline, rgba(255, 255, 255, 0.92));
|
|
362
|
+
}
|
|
363
|
+
.zf-error-frame {
|
|
364
|
+
margin-top: -3px;
|
|
365
|
+
font-size: 10px;
|
|
366
|
+
font-weight: 700;
|
|
367
|
+
letter-spacing: 0.14em;
|
|
368
|
+
text-transform: uppercase;
|
|
369
|
+
color: var(--zf-frame-error-text, #ff8b9d);
|
|
370
|
+
}
|
|
371
|
+
.zf-error-detail {
|
|
372
|
+
margin: 2px 0 0;
|
|
373
|
+
max-width: 44ch;
|
|
374
|
+
font-size: 12px;
|
|
375
|
+
line-height: 1.5;
|
|
376
|
+
color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.6));
|
|
377
|
+
}
|
|
378
|
+
.zf-error-detail code {
|
|
379
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
380
|
+
font-size: 0.92em;
|
|
381
|
+
}
|
|
382
|
+
/* Per-issue rows for invalid config: the field path as a code chip, the Zod
|
|
383
|
+
message beside it. Block-centered but left-aligned inside, so a one-field
|
|
384
|
+
error sits dead-centre and a multi-field one reads as a tidy list. */
|
|
385
|
+
.zf-error-issues {
|
|
386
|
+
list-style: none;
|
|
387
|
+
margin: 2px 0 0;
|
|
388
|
+
padding: 0;
|
|
389
|
+
max-width: 100%;
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-direction: column;
|
|
392
|
+
gap: 6px;
|
|
393
|
+
text-align: left;
|
|
394
|
+
}
|
|
395
|
+
.zf-error-issue {
|
|
396
|
+
display: flex;
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
align-items: baseline;
|
|
399
|
+
gap: 7px;
|
|
400
|
+
padding: 6px 10px;
|
|
401
|
+
border-radius: 9px;
|
|
402
|
+
background: rgba(0, 0, 0, 0.22);
|
|
403
|
+
border: 1px solid rgba(242, 21, 83, 0.18);
|
|
404
|
+
}
|
|
405
|
+
.zf-error-field {
|
|
406
|
+
flex: none;
|
|
407
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
408
|
+
font-size: 11px;
|
|
409
|
+
font-weight: 700;
|
|
410
|
+
color: var(--zf-frame-error-text, #ff8b9d);
|
|
411
|
+
background: rgba(242, 21, 83, 0.14);
|
|
412
|
+
padding: 1px 6px;
|
|
413
|
+
border-radius: 5px;
|
|
414
|
+
}
|
|
415
|
+
.zf-error-msg {
|
|
416
|
+
min-width: 0;
|
|
417
|
+
font-size: 12px;
|
|
418
|
+
line-height: 1.4;
|
|
419
|
+
color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.68));
|
|
420
|
+
}
|
|
421
|
+
/* Registered-frame list under an "unknown frame" card — quiet, it's reference. */
|
|
422
|
+
.zf-error-list {
|
|
423
|
+
margin-top: 4px;
|
|
424
|
+
font-size: 11px;
|
|
425
|
+
line-height: 1.5;
|
|
426
|
+
color: rgba(255, 255, 255, 0.4);
|
|
427
|
+
}
|
|
428
|
+
/* Bare frames (headings) divide a dashboard into zones — positioned slot,
|
|
429
|
+
no card chrome, no auto-title. */
|
|
430
|
+
.zf-bare {
|
|
431
|
+
grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
|
|
432
|
+
grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: flex-end;
|
|
435
|
+
min-height: 0;
|
|
436
|
+
overflow: hidden;
|
|
437
|
+
animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
|
|
438
|
+
animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
|
|
439
|
+
}
|
|
440
|
+
/* Phones: the absolute x/y/w grid can't shrink below ~30px columns, so collapse
|
|
441
|
+
to a single full-width column. Frames flow in spec order and keep their row
|
|
442
|
+
span (height), but ignore horizontal placement. */
|
|
443
|
+
@media (max-width: 640px) {
|
|
444
|
+
.zf-grid {
|
|
445
|
+
grid-template-columns: 1fr;
|
|
446
|
+
}
|
|
447
|
+
.zf-frame,
|
|
448
|
+
.zf-bare {
|
|
449
|
+
grid-column: 1 / -1;
|
|
450
|
+
grid-row: auto / span var(--zf-row-span, 1);
|
|
451
|
+
}
|
|
452
|
+
.zf-frame {
|
|
453
|
+
padding: calc(12px * var(--zf-density, 1)) calc(14px * var(--zf-density, 1));
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
/* Tablets / small laptops (641-1023px): the absolute grid built for --zf-cols
|
|
457
|
+
columns is too tight here, but a single column wastes the width. Reflow the
|
|
458
|
+
vertical board to two columns — frames auto-place in spec order (dense, so
|
|
459
|
+
gaps backfill), keep their row span, and a frame that spanned at least half
|
|
460
|
+
the design grid takes both columns (--zf-col-span-sm = 2, set by the
|
|
461
|
+
renderer), everything else takes one. flow-horizontal is excluded: it keeps
|
|
462
|
+
its own ≥641px side-scroller. Above 1023px the editable GridStack takes over
|
|
463
|
+
(editing is desktop-only) and the read-only renderer is only the fallback. */
|
|
464
|
+
@media (min-width: 641px) and (max-width: 1023px) {
|
|
465
|
+
.zf-grid:not(.zf-flow-horizontal) {
|
|
466
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
467
|
+
grid-auto-flow: row dense;
|
|
468
|
+
}
|
|
469
|
+
.zf-grid:not(.zf-flow-horizontal) .zf-frame,
|
|
470
|
+
.zf-grid:not(.zf-flow-horizontal) .zf-bare {
|
|
471
|
+
grid-column: auto / span var(--zf-col-span-sm, 1);
|
|
472
|
+
grid-row: auto / span var(--zf-row-span, 1);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
@keyframes zf-enter {
|
|
476
|
+
from { opacity: 0; translate: 0 10px; }
|
|
477
|
+
to { opacity: 1; translate: 0 0; }
|
|
478
|
+
}
|
|
479
|
+
/* Reduced-motion entrance: same timing + stagger, but a plain fade with no
|
|
480
|
+
positional movement (motion is what triggers vestibular discomfort). */
|
|
481
|
+
@keyframes zf-fade {
|
|
482
|
+
from { opacity: 0; }
|
|
483
|
+
to { opacity: 1; }
|
|
484
|
+
}
|
|
485
|
+
@media (prefers-reduced-motion: reduce) {
|
|
486
|
+
.zf-frame,
|
|
487
|
+
.zf-bare {
|
|
488
|
+
animation-name: zf-fade;
|
|
489
|
+
}
|
|
490
|
+
.zf-frame:hover {
|
|
491
|
+
transform: none;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/* Suspense fallback while a frame's component chunk loads (lazy registry). A
|
|
495
|
+
quiet pulsing fill sized to the card body — no layout shift since the grid
|
|
496
|
+
item already holds its slot. */
|
|
497
|
+
.zf-frame-skeleton {
|
|
498
|
+
width: 100%;
|
|
499
|
+
height: 100%;
|
|
500
|
+
border-radius: 8px;
|
|
501
|
+
background: rgba(255, 255, 255, 0.05);
|
|
502
|
+
animation: zf-skeleton-pulse 1.2s ease-in-out infinite;
|
|
503
|
+
}
|
|
504
|
+
@keyframes zf-skeleton-pulse {
|
|
505
|
+
0%, 100% { opacity: 0.45; }
|
|
506
|
+
50% { opacity: 0.85; }
|
|
507
|
+
}
|
|
508
|
+
@media (prefers-reduced-motion: reduce) {
|
|
509
|
+
.zf-frame-skeleton { animation: none; }
|
|
510
|
+
}
|
|
511
|
+
`,Ts=()=>w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[w.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),w.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),w.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function ea({outerClassName:e,style:t,headline:r,frame:n,children:a}){return w.jsx("div",{className:e,style:t,children:w.jsxs("div",{className:"zf-error",children:[w.jsx("span",{className:"zf-error-icon",children:w.jsx(Ts,{})}),w.jsx("div",{className:"zf-error-headline",children:r}),w.jsx("div",{className:"zf-error-frame",children:n}),a]})})}function _h({sources:e}){return e.length===0?null:w.jsx("span",{className:"zf-frame-source",children:e.map((t,r)=>w.jsxs(A.Fragment,{children:[r>0&&w.jsx("span",{className:"zf-frame-source-sep",children:"·"}),w.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer noopener",title:`Data source: ${t.name}`,onMouseDown:n=>n.stopPropagation(),onPointerDown:n=>n.stopPropagation(),children:t.name})]},t.url))})}class Fo extends A.Component{constructor(){super(...arguments);K(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?w.jsxs("div",{className:"zf-error",children:[w.jsx("span",{className:"zf-error-icon",children:w.jsx(Ts,{})}),w.jsx("div",{className:"zf-error-headline",children:"Frame crashed"}),w.jsx("p",{className:"zf-error-detail",children:this.state.error.message})]}):this.props.children}}const Rr=(...e)=>e.filter(Boolean).join(" ");function Ah({style:e,className:t,hasIcon:r,titleIcon:n,title:a,titleContent:o,sources:i,children:s}){const c=A.useRef(null),l=A.useRef(!0),u=A.useRef(null);u.current||(u.current=new Set);const f=A.useRef(null);if(!f.current){const h=u.current;f.current={visibleRef:l,subscribe:d=>(h.add(d),()=>{h.delete(d)})}}return A.useEffect(()=>{const h=c.current;if(!h||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(m=>{const p=m[0];if(!p)return;const g=p.isIntersecting;if(g!==l.current){l.current=g;for(const v of[...u.current])v(g)}},{rootMargin:"200px"});return d.observe(h),()=>d.disconnect()},[]),w.jsx(Ss.Provider,{value:f.current,children:w.jsxs("div",{ref:c,className:Rr("zf-frame",t),style:e,children:[w.jsxs("div",{className:Rr("zf-frame-title",r?"zf-frame-title--icon":""),children:[n,w.jsx("span",{className:"zf-frame-title-text",children:o??a}),w.jsx(_h,{sources:i})]}),w.jsx("div",{className:"zf-frame-body",children:s})]})})}function Sh({instance:e,registry:t,style:r,className:n=""}){const a=Un(),o=t.get(e.frame);if(!o)return w.jsxs(ea,{outerClassName:Rr("zf-frame","zf-frame--error",n),style:r,headline:"Unknown frame",frame:e.frame,children:[w.jsxs("p",{className:"zf-error-detail",children:[w.jsx("code",{children:e.frame})," isn’t a registered frame."]}),w.jsxs("p",{className:"zf-error-list",children:["Available: ",[...t.keys()].join(", ")]})]});const i=new Set(a.flatMap(d=>[...d.capabilities])),s=o.capabilities.filter(d=>!i.has(d));if(s.length>0)return w.jsx(ea,{outerClassName:Rr("zf-frame","zf-frame--error",n),style:r,headline:"No data source",frame:e.frame,children:w.jsxs("p",{className:"zf-error-detail",children:["No registered provider supplies"," ",s.map((d,m)=>w.jsxs(A.Fragment,{children:[m>0&&", ",w.jsx("code",{children:d})]},d)),"."]})});const c=o.schema.safeParse(e.config);if(!c.success)return w.jsx(ea,{outerClassName:Rr("zf-frame","zf-frame--error",n),style:r,headline:"Invalid configuration",frame:e.frame,children:w.jsx("ul",{className:"zf-error-issues",children:c.error.issues.map((d,m)=>w.jsxs("li",{className:"zf-error-issue",children:[w.jsx("code",{className:"zf-error-field",children:d.path.join(".")||"(root)"}),w.jsx("span",{className:"zf-error-msg",children:d.message.replace(/^Invalid input:\s*/i,"")})]},m))})});const l=o.component,u=o.titleIcon,f=o.titleContent,h=o.source?Array.isArray(o.source)?o.source:[o.source]:[];return o.chrome==="bare"?w.jsx("div",{className:Rr("zf-bare",n),style:r,children:w.jsx(Fo,{children:w.jsx(A.Suspense,{fallback:null,children:w.jsx(l,{config:c.data})})})}):w.jsx(Ah,{style:r,className:n,hasIcon:!!u,title:e.title??o.label,sources:h,titleIcon:u?w.jsx(A.Suspense,{fallback:null,children:w.jsx(u,{config:c.data})}):null,titleContent:e.title==null&&f?w.jsx(A.Suspense,{fallback:null,children:w.jsx(f,{config:c.data})}):void 0,children:w.jsx(Fo,{children:w.jsx(A.Suspense,{fallback:w.jsx("div",{className:"zf-frame-skeleton"}),children:w.jsx(l,{config:c.data})})})})}const zh=A.memo(Sh);function Th(e,t,r,n,a){var u;const o={"--zf-enter-i":t,"--zf-col-span-sm":e.position.w>=a/2?2:1};if(r){const f=(u=e.layouts)==null?void 0:u["flow-horizontal"];return f?{...o,"--zf-col-start":f.x+1,"--zf-col-span":f.w,"--zf-row-start":f.y+1,"--zf-row-span":Math.min(f.h,n)}:{...o,"--zf-col-span":e.position.w,"--zf-row-span":Math.min(e.position.h,n)}}const{x:i,y:s,w:c,h:l}=e.position;return{...o,"--zf-col-start":i+1,"--zf-col-span":c,"--zf-row-start":s+1,"--zf-row-span":l}}function Uo({spec:e,registry:t}){const r=e.grid.mode==="flow-horizontal",n=A.useMemo(()=>e.frames.map((a,o)=>Th(a,o,r,e.grid.rows,e.grid.columns)),[e.frames,r,e.grid.rows,e.grid.columns]);return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:Ch}),w.jsx("div",{className:r?"zf-grid zf-flow-horizontal":"zf-grid",style:{"--zf-cols":e.grid.columns,"--zf-row-h":`${e.grid.rowHeight}px`,"--zf-h-rows":e.grid.rows,"--zf-gap":`${e.grid.gap}px`,"--zf-pad-x":`${e.grid.paddingX}px`,"--zf-accent-hue":e.theme.accentHue,"--zf-accent-sat":`${e.theme.accentSat}%`,"--zf-base-hue":e.theme.baseHue,"--zf-base-sat":`${e.theme.baseSat}%`,"--zf-up":e.theme.upColor,"--zf-down":e.theme.downColor,"--zf-font-family":dh[e.typography.fontFamily],"--zf-numeric":fh[e.typography.numericStyle],"--zf-frame-radius":`${e.appearance.radius}px`,"--zf-border-alpha":e.appearance.borderStrength,"--zf-surface-opacity":e.appearance.surfaceOpacity,"--zf-density":e.appearance.density,"--zf-elevation":e.appearance.elevation},children:e.frames.map((a,o)=>w.jsx(zh,{instance:a,registry:t,style:n[o]},a.id))})]})}const Eh="/__zframes/dashboard.json",Ph="/__zframes/dashboard",Mh="/__zframes/dashboards",Dh="/__zframes/switch",Rh="/__zframes/proxy",Oh="/__zframes/account/portfolio",G1="/__zframes/account/credentials",Nh="/__zframes/agents",Lh="/__zframes/ask";class ne{constructor(t){K(this,"entries",new Map);K(this,"inflight",new Map);K(this,"namespace");K(this,"ttlMs");K(this,"persist");K(this,"staleOnError");K(this,"revive");this.namespace=t.namespace,this.ttlMs=t.ttlMs,this.persist=t.persist??!1,this.staleOnError=t.staleOnError??!0,this.revive=t.revive}get(t,r){const n=this.read(t);if(n&&Date.now()-n.at<this.ttlMs)return Promise.resolve(n.value);const a=this.inflight.get(t);if(a)return a;const o=r().then(i=>(this.write(t,i),i)).catch(i=>{if(this.staleOnError&&n)return n.value;throw i}).finally(()=>{this.inflight.delete(t)});return this.inflight.set(t,o),o}read(t){const r=this.entries.get(t);if(r)return r;if(!this.persist||typeof localStorage>"u")return null;try{const n=localStorage.getItem(this.storageKey(t));if(!n)return null;const a=JSON.parse(n);if(typeof(a==null?void 0:a.at)!="number")return null;let o;if(this.revive){const s=this.revive(a.value);if(s===null)return null;o=s}else o=a.value;const i={at:a.at,value:o};return this.entries.set(t,i),i}catch{return null}}write(t,r){const n={at:Date.now(),value:r};if(this.entries.set(t,n),!(!this.persist||typeof localStorage>"u"))try{localStorage.setItem(this.storageKey(t),JSON.stringify(n))}catch{}}storageKey(t){return`${this.namespace}:${t}`}}const Ih=new ne({namespace:"zframes:binance:portfolio",ttlMs:45e3,persist:!1});class Fh{constructor(){K(this,"name","Binance");K(this,"capabilities",["portfolio"]);K(this,"portfolioKinds",["binance"])}async getPortfolio(t){if(t.kind!=="binance")throw new Error(`BinanceProvider can't serve source: ${t.kind}`);return Ih.get("binance",async()=>{const r=await fetch(`${Oh}?source=binance`,{headers:{accept:"application/json"}});if(r.status===401)throw new Error("binance: not connected");if(!r.ok)throw new Error(`binance portfolio relay ${r.status}`);return await r.json()})}}const Uh=1e4,jh="zframes (+https://github.com/zentryhq/zframes)";async function Es(e,{timeoutMs:t=Uh,init:r,proxied:n}){const a=new Headers(r==null?void 0:r.headers);typeof document>"u"&&!a.has("User-Agent")&&a.set("User-Agent",jh);const o=n&&typeof document<"u"?`${Rh}?url=${encodeURIComponent(e)}`:e,i=await fetch(o,{...r,headers:a,signal:(r==null?void 0:r.signal)??AbortSignal.timeout(t)});if(!i.ok)throw new Error(`${e} failed: ${i.status}`);return i}async function ae(e,t,r={}){const a=await(await Es(e,r)).json();return t?t.parse(a):a}async function Zr(e,t={}){return(await Es(e,t)).text()}const Hh=["https://ethereum-rpc.publicnode.com","https://cloudflare-eth.com","https://1rpc.io/eth"],Bh="https://api.coingecko.com/api/v3/simple/price",Vh="0x70a08231",Wh=1,Gh={symbol:"ETH",address:null,decimals:18,cgId:"ethereum"},Tn=[Gh,{symbol:"USDC",address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,cgId:"usd-coin"},{symbol:"USDT",address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,cgId:"tether"},{symbol:"DAI",address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",decimals:18,cgId:"dai"},{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,cgId:"weth"},{symbol:"WBTC",address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",decimals:8,cgId:"wrapped-bitcoin"},{symbol:"LINK",address:"0x514910771AF9Ca656af840dff83E8264EcF986CA",decimals:18,cgId:"chainlink"},{symbol:"UNI",address:"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",decimals:18,cgId:"uniswap"},{symbol:"AAVE",address:"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",decimals:18,cgId:"aave"},{symbol:"LDO",address:"0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32",decimals:18,cgId:"lido-dao"},{symbol:"MKR",address:"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",decimals:18,cgId:"maker"},{symbol:"CRV",address:"0xD533a949740bb3306d119CC777fa900bA034cd52",decimals:18,cgId:"curve-dao-token"},{symbol:"SHIB",address:"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",decimals:18,cgId:"shiba-inu"},{symbol:"PEPE",address:"0x6982508145454Ce325dDbE47a25d4ec3d2311933",decimals:18,cgId:"pepe"}],jo=/^0x[0-9a-fA-F]{40}$/;async function Yh(e){const t=e.trim();if(jo.test(t))return t;try{const r=await ae(`https://api.ensideas.com/ens/resolve/${encodeURIComponent(t)}`);if(r.address&&jo.test(r.address))return r.address}catch{}throw new Error(`couldn't resolve address: ${t}`)}function Kh(e){return`${Vh}000000000000000000000000${e.slice(2).toLowerCase()}`}function qh(e,t){if(!e||e==="0x")return 0;try{return Number(BigInt(e))/10**t}catch{return 0}}async function Jh(e){var s;const t=Tn.map((c,l)=>c.address===null?{jsonrpc:"2.0",id:l,method:"eth_getBalance",params:[e,"latest"]}:{jsonrpc:"2.0",id:l,method:"eth_call",params:[{to:c.address,data:Kh(e)},"latest"]}),r=JSON.stringify(t);let n=null,a;for(const c of Hh)try{const l=await fetch(c,{method:"POST",headers:{"content-type":"application/json"},body:r,signal:AbortSignal.timeout(12e3)});if(!l.ok)throw new Error(`rpc ${l.status}`);const u=await l.json();if(!Array.isArray(u)){const h=((s=u==null?void 0:u.error)==null?void 0:s.message)??"non-array response";throw new Error(`rpc ${c}: ${h}`)}const f=u;if(!f.some(h=>typeof h.result=="string"))throw new Error(`rpc ${c}: no results (throttled?)`);n=f;break}catch(l){a=l}if(!n)throw new Error(`all RPC endpoints failed: ${String(a)}`);const o=new Map;for(const c of n)c.result&&o.set(c.id,c.result);const i=new Map;return Tn.forEach((c,l)=>{const u=qh(o.get(l),c.decimals);u>0&&i.set(c.symbol,u)}),i}const Xh=[...new Set(Tn.map(e=>e.cgId))],Zh=new ne({namespace:"zframes:wallet:prices",ttlMs:10*6e4,persist:!0});async function $h(){return Zh.get("all",async()=>{const e=`${Bh}?ids=${Xh.join(",")}&vs_currencies=usd&include_24hr_change=true`,t=await ae(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("coingecko simple/price: unexpected response shape");return t})}function Qh(e){return`${e.slice(0,6)}…${e.slice(-4)}`}const ep=new ne({namespace:"zframes:wallet:portfolio",ttlMs:12e4,persist:!1});class tp{constructor(){K(this,"name","On-chain wallet");K(this,"capabilities",["portfolio"]);K(this,"portfolioKinds",["wallet"])}async getPortfolio(t){if(t.kind!=="wallet"||!t.address)throw new Error("wallet provider needs a wallet source with an address");return ep.get(t.address,async()=>{const r=await Yh(t.address),n=await Jh(r),a=Tn.filter(c=>n.has(c.symbol)),o=a.length?await $h():{},i=a.map(c=>{var h,d;const l=n.get(c.symbol)??0,u=(h=o[c.cgId])==null?void 0:h.usd,f=u!==void 0?l*u:void 0;return{symbol:c.symbol,amount:l,valueUsd:f,changePct24h:(d=o[c.cgId])==null?void 0:d.usd_24h_change}}).filter(c=>c.valueUsd!==void 0&&c.valueUsd>=Wh).sort((c,l)=>(l.valueUsd??0)-(c.valueUsd??0)),s=i.reduce((c,l)=>c+(l.valueUsd??0),0);return{source:"wallet",label:Qh(r),holdings:i,totalUsd:s,asOf:Date.now()}})}}const rp="https://api.alternative.me/fng/",np=new ne({namespace:"zframes:alternativeme:fng",ttlMs:45*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});class ap{constructor(){K(this,"name","alternative.me");K(this,"capabilities",["sentiment"])}async getFearGreed(t=30){return np.get(String(t),async()=>{const r=await ae(`${rp}?limit=${t}`);if(!Array.isArray(r==null?void 0:r.data))throw new Error("alternative.me fng: unexpected response shape");return r.data.map(n=>({value:Number(n.value),classification:n.value_classification??"",time:Number(n.timestamp)*1e3})).filter(n=>Number.isFinite(n.value)&&Number.isFinite(n.time))})}}const ta="https://bitcoin-data.com/v1";function ra(e){if(!Array.isArray(e))return[];const t=[];for(const r of e){if(!r||typeof r!="object")continue;const n=r,a=Number(n.unixTs),o=Number.isFinite(a)?a*1e3:Date.parse(String(n.d));let i=NaN;for(const[s,c]of Object.entries(n)){if(s==="d"||s==="unixTs")continue;const l=Number(c);if(Number.isFinite(l)){i=l;break}}Number.isFinite(o)&&Number.isFinite(i)&&t.push({time:o,value:i})}return t.sort((r,n)=>r.time-n.time)}const na=e=>e.length?e[e.length-1].value:null;class op{constructor(){K(this,"name","bitcoin-data.com");K(this,"capabilities",["onchain-cycle-extras"]);K(this,"cache",new ne({namespace:"zframes:bitcoin-data:extras",ttlMs:1080*6e4,persist:!0}))}async getOnchainExtras(){return this.cache.get("latest",async()=>{var c,l,u;const[t,r,n]=await Promise.allSettled([ae(`${ta}/sopr`),ae(`${ta}/puell-multiple`),ae(`${ta}/reserve-risk`)]),a=t.status==="fulfilled"?ra(t.value).slice(-365):[],o=r.status==="fulfilled"?ra(r.value).slice(-365):[],i=n.status==="fulfilled"?ra(n.value).slice(-365):[];if(a.length===0&&o.length===0&&i.length===0)throw new Error("bitcoin-data: all metric fetches failed (likely rate-limited)");const s=Math.max(((c=a.at(-1))==null?void 0:c.time)??0,((l=o.at(-1))==null?void 0:l.time)??0,((u=i.at(-1))==null?void 0:u.time)??0);return{date:new Date(s).toISOString().slice(0,10),sopr:na(a),puell:na(o),reserveRisk:na(i),history:{sopr:a,puell:o,reserveRisk:i}}})}}const ip="https://api.bls.gov/publicAPI/v2/timeseries/data/",sp={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate",CES0000000001:"Nonfarm payrolls",CES0500000003:"Avg hourly earnings",LNS11300000:"Labor force participation"};function cp(e){const t=Number(e);return Number.isFinite(t)?t:null}function lp(e,t){const r=/^M(0[1-9]|1[0-2])$/.exec(t??""),n=Number(e);if(!r||!Number.isFinite(n))return null;const a=Number(r[1]);return Date.UTC(n,a-1,1)}function up(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const dp=new ne({namespace:"zframes:macro",ttlMs:360*6e4,persist:!0,revive:e=>e&&Array.isArray(e.points)?e:null});class fp{constructor(){K(this,"name","bls");K(this,"capabilities",["macro-series"])}async getMacroSeries(t,r,n){return dp.get(`${t}:${r}:${n}`,()=>this.fetchMacroSeries(t,r,n))}async fetchMacroSeries(t,r,n){var c,l,u;const a=`${ip}${encodeURIComponent(t)}?startyear=${r}&endyear=${n}`,o=await ae(a);if(o.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((c=o.message)==null?void 0:c.join(", "))||"request failed"}`);const i=(u=(l=o.Results)==null?void 0:l.series)==null?void 0:u[0];if(!(i!=null&&i.data))throw new Error("bls series: unexpected response shape");const s=i.data.map(f=>{const h=cp(f.value),d=lp(f.year,f.period);return h===null||d===null?null:{time:d,date:up(d),value:h,period:`${f.year}-${f.period}`}}).filter(f=>f!==null).sort((f,h)=>f.time-h.time);return{seriesId:i.seriesID??t,label:sp[t]??t,source:"BLS",points:s}}}const hp="https://api.coingecko.com/api/v3/global",pp="https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=50&page=1&sparkline=false&price_change_percentage=24h",mp="https://api.coingecko.com/api/v3/search/trending",gp="https://api.coingecko.com/api/v3/coins/categories",vp=new ne({namespace:"zframes:coingecko:global",ttlMs:12*6e4,persist:!0}),yp=new ne({namespace:"zframes:coingecko:markets",ttlMs:10*6e4,persist:!0}),bp=new ne({namespace:"zframes:coingecko:trending",ttlMs:10*6e4,persist:!0}),wp=new ne({namespace:"zframes:coingecko:categories",ttlMs:12*6e4,persist:!0});class xp{constructor(){K(this,"name","coingecko");K(this,"capabilities",["global-market","coin-markets","trending-coins","sector-performance"])}async getTrendingCoins(){return bp.get("trending",async()=>{const t=await ae(mp);if(!Array.isArray(t==null?void 0:t.coins))throw new Error("coingecko trending: unexpected response shape");return t.coins.map(({item:r})=>{var o,i,s;const n=Number((o=r.data)==null?void 0:o.price),a=Number((s=(i=r.data)==null?void 0:i.price_change_percentage_24h)==null?void 0:s.usd);return{id:r.id,name:r.name,symbol:(r.symbol??"").toUpperCase(),rank:Number.isFinite(r.market_cap_rank)?r.market_cap_rank:null,price:Number.isFinite(n)?n:null,changePct24h:Number.isFinite(a)?a:null}})})}async getSectorPerformance(){return wp.get("categories",async()=>{const t=await ae(gp);if(!Array.isArray(t))throw new Error("coingecko categories: unexpected response shape");return t.filter(r=>Number.isFinite(r.market_cap)&&(r.market_cap??0)>0).map(r=>({name:r.name,marketCap:r.market_cap,changePct24h:Number.isFinite(r.market_cap_change_24h)?r.market_cap_change_24h:0})).sort((r,n)=>n.marketCap-r.marketCap).slice(0,30)})}async getGlobalMarket(){return vp.get("global",async()=>{var n;const t=await ae(hp);if(!((n=t==null?void 0:t.data)!=null&&n.total_market_cap)||!t.data.market_cap_percentage)throw new Error("coingecko global: unexpected response shape");const r=Number(t.data.market_cap_change_percentage_24h_usd);return{totalMarketCapUsd:t.data.total_market_cap.usd??0,marketCapChangePct24h:Number.isFinite(r)?r:0,dominance:t.data.market_cap_percentage}})}async getCoinMarkets(){return yp.get("markets",async()=>{const t=await ae(pp);if(!Array.isArray(t))throw new Error("coingecko markets: unexpected response shape");return t.filter(r=>Number.isFinite(r.market_cap)&&r.market_cap>0).map(r=>({symbol:(r.symbol??"").toUpperCase(),name:r.name,marketCapUsd:r.market_cap,changePct24h:Number.isFinite(r.price_change_percentage_24h)?r.price_change_percentage_24h:void 0}))})}}const kp="https://community-api.coinmetrics.io/v4/timeseries/asset-metrics",Cp="PriceUSD,CapMrktCurUSD,SplyCur,CapMVRVCur";function _p(e){const t=[];for(const r of e){const n=Number(r.PriceUSD),a=Number(r.CapMrktCurUSD),o=Number(r.SplyCur),i=Number(r.CapMVRVCur),s=Date.parse(r.time);!Number.isFinite(n)||!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||i<=0||o<=0||t.push({time:s,price:n,marketCap:a,supply:o,mvrv:i})}return t.sort((r,n)=>r.time-n.time)}function Ap(e){const t=e.length;if(t===0)return 0;const r=e.reduce((a,o)=>a+o,0)/t,n=e.reduce((a,o)=>a+(o-r)**2,0)/t;return Math.sqrt(n)}class Sp{constructor(){K(this,"name","Coin Metrics");K(this,"capabilities",["onchain-valuation","price-history-daily"]);K(this,"cache",new ne({namespace:"zframes:coinmetrics:metrics",ttlMs:180*6e4,persist:!1}))}load(t){return this.cache.get(t,async()=>{const r=`${kp}?assets=${t}&metrics=${Cp}&frequency=1d&page_size=10000&start_time=2010-01-01`,n=await ae(r),a=_p(n.data??[]);if(a.length===0)throw new Error("coinmetrics: no usable rows in response");return a})}async getOnchainValuation(){const t=await this.load("btc"),r=Ap(t.map(u=>u.marketCap)),n=[],a=[],o=[],i=[],s=[];for(const u of t){const f=u.marketCap/u.mvrv;n.push({time:u.time,value:u.price}),a.push({time:u.time,value:u.mvrv}),o.push({time:u.time,value:r>0?(u.marketCap-f)/r:0}),i.push({time:u.time,value:1-1/u.mvrv}),s.push({time:u.time,value:f/u.supply})}const c=t[t.length-1],l=c.marketCap/c.mvrv;return{date:new Date(c.time).toISOString().slice(0,10),price:c.price,supply:c.supply,marketCap:c.marketCap,realizedCap:l,realizedPrice:l/c.supply,mvrv:c.mvrv,mvrvZScore:r>0?(c.marketCap-l)/r:0,nupl:1-1/c.mvrv,history:{price:n,mvrv:a,mvrvZScore:o,nupl:i,realizedPrice:s}}}async getDailyCloseHistory(t="btc"){return(await this.load(t.toLowerCase())).map(n=>({time:n.time,value:n.price}))}}const zp=300,Tp=e=>`https://api.coinpaprika.com/v1/tickers?quotes=USD&limit=${e}`,Ep=new ne({namespace:"zframes:coinpaprika:movers",ttlMs:12*6e4,persist:!0}),hn=e=>Number.isFinite(e)?e:0;class Pp{constructor(){K(this,"name","coinpaprika");K(this,"capabilities",["coin-movers"])}async getCoinMovers(t=zp){return Ep.get(`movers:${t}`,async()=>{const r=await ae(Tp(t));if(!Array.isArray(r))throw new Error("coinpaprika tickers: unexpected response shape");return r.filter(n=>{var a;return((a=n==null?void 0:n.quotes)==null?void 0:a.USD)&&Number.isFinite(n.quotes.USD.price)}).map(n=>{const a=n.quotes.USD;return{symbol:(n.symbol??"").toUpperCase(),name:n.name,rank:n.rank,priceUsd:a.price,marketCapUsd:a.market_cap,volume24hUsd:a.volume_24h,changePct:{"1h":hn(a.percent_change_1h),"24h":hn(a.percent_change_24h),"7d":hn(a.percent_change_7d),"30d":hn(a.percent_change_30d)}}})})}}const Mp="https://api.llama.fi/v2/chains",Dp="https://api.llama.fi/overview/dexs",Ho="https://api.llama.fi/overview/fees",Rp="https://api.llama.fi/protocols",Op="https://stablecoins.llama.fi/stablecoins?includePrices=true",Np="https://stablecoins.llama.fi/stablecoinchains",Lp="https://yields.llama.fi/pools",tn=8*6e4,Ps=30*6e4,Ip=new ne({namespace:"zframes:defillama:tvl",ttlMs:tn}),Fp=new ne({namespace:"zframes:defillama:dex-volume",ttlMs:tn}),Up=new ne({namespace:"zframes:defillama:protocol-tvl",ttlMs:tn}),jp=new ne({namespace:"zframes:defillama:protocol-fees",ttlMs:tn}),Hp=new ne({namespace:"zframes:defillama:dex-history",ttlMs:Ps}),Bp=new ne({namespace:"zframes:defillama:protocol-history",ttlMs:Ps}),Vp=new ne({namespace:"zframes:defillama:stablecoins",ttlMs:30*6e4,persist:!0}),Wp=new ne({namespace:"zframes:defillama:yields",ttlMs:12*6e4}),Gp=new ne({namespace:"zframes:defillama:fees-overview",ttlMs:tn}),Bo=e=>[...e].sort().join(",");function Vo(e){return Array.isArray(e)?e.map(([t,r])=>({time:t*1e3,value:Number(r)})).filter(t=>Number.isFinite(t.time)&&Number.isFinite(t.value)):[]}const aa=e=>Number.isFinite(e)?e:void 0;class Yp{constructor(){K(this,"name","defillama");K(this,"capabilities",["tvl","dex-volume","protocol-tvl","protocol-fees","stablecoins","yields","fees-overview"])}async getTvlByChain(){return Ip.get("chains",async()=>{const t=await ae(Mp);if(!Array.isArray(t))throw new Error("defillama chains: unexpected response shape");return t.filter(r=>Number.isFinite(r.tvl)&&r.tvl>0).sort((r,n)=>n.tvl-r.tvl).map(r=>({name:r.name,tvl:r.tvl}))})}async getDexVolume(){return Fp.get("overview",async()=>{const t=await ae(Dp),r=t==null?void 0:t.protocols;if(!Array.isArray(r))throw new Error("defillama dexs: unexpected response shape");return r.filter(n=>Number.isFinite(n.total24h)&&(n.total24h??0)>0).map(n=>({name:n.name,volume24h:n.total24h,changePct:aa(n.change_1d)})).sort((n,a)=>a.volume24h-n.volume24h)})}async getDexVolumeHistory(t){return Hp.get(Bo(t),async()=>{const r=await Promise.all(t.map(n=>ae(`https://api.llama.fi/summary/dexs/${encodeURIComponent(n)}?excludeTotalDataChartBreakdown=true`).then(a=>[n,Vo(a.totalDataChart)]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolTvl(){return Up.get("overview",async()=>{const t=await ae(Rp);if(!Array.isArray(t))throw new Error("defillama protocols: unexpected response shape");return t.filter(r=>Number.isFinite(r.tvl)&&(r.tvl??0)>0).map(r=>({name:r.name,tvl:r.tvl,category:r.category,changePct:aa(r.change_1d)})).sort((r,n)=>n.tvl-r.tvl)})}async getProtocolTvlHistory(t){return Bp.get(Bo(t),async()=>{const r=await Promise.all(t.map(n=>ae(`https://api.llama.fi/protocol/${encodeURIComponent(n)}`).then(a=>[n,(a.tvl??[]).map(o=>({time:o.date*1e3,value:Number(o.totalLiquidityUSD)})).filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.value))]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolFees(){return jp.get("overview",async()=>{const t=await ae(Ho),r=t==null?void 0:t.protocols;if(!Array.isArray(r))throw new Error("defillama fees: unexpected response shape");return r.filter(n=>Number.isFinite(n.total24h)&&(n.total24h??0)>0).map(n=>({name:n.name,fees24h:n.total24h,changePct:aa(n.change_1d)})).sort((n,a)=>a.fees24h-n.fees24h)})}async getStablecoinSupply(){return Vp.get("supply",async()=>{var h,d,m,p;const[t,r]=await Promise.all([ae(Op),ae(Np).catch(()=>[])]),n=t==null?void 0:t.peggedAssets;if(!Array.isArray(n))throw new Error("defillama stablecoins: unexpected response shape");let a=0,o=0,i=0,s=0;for(const g of n)g.pegType&&g.pegType!=="peggedUSD"||(a+=((h=g.circulating)==null?void 0:h.peggedUSD)??0,o+=((d=g.circulatingPrevDay)==null?void 0:d.peggedUSD)??0,i+=((m=g.circulatingPrevWeek)==null?void 0:m.peggedUSD)??0,s+=((p=g.circulatingPrevMonth)==null?void 0:p.peggedUSD)??0);if(a<=0)throw new Error("defillama stablecoins: empty aggregate");const c=g=>g>0?(a-g)/g*100:0,l=Date.now(),u=[{time:l-30*864e5,value:s},{time:l-7*864e5,value:i},{time:l-864e5,value:o},{time:l,value:a}].filter(g=>g.value>0),f=(Array.isArray(r)?r:[]).map(g=>{var v;return{name:g.name,usd:((v=g.totalCirculatingUSD)==null?void 0:v.peggedUSD)??0}}).filter(g=>g.usd>0).sort((g,v)=>v.usd-g.usd).slice(0,12);return{totalUsd:a,changePct1d:c(o),changePct7d:c(i),changePct30d:c(s),history:u,topChains:f}})}async getYieldPools(){return Wp.get("pools",async()=>{const t=await ae(Lp),r=t==null?void 0:t.data;if(!Array.isArray(r))throw new Error("defillama yields: unexpected response shape");return r.filter(n=>Number.isFinite(n.tvlUsd)&&(n.tvlUsd??0)>0&&Number.isFinite(n.apy)).map(n=>({pool:n.pool,chain:n.chain,project:n.project,symbol:n.symbol,tvlUsd:n.tvlUsd,apy:n.apy,apyBase:Number.isFinite(n.apyBase)?n.apyBase:null,apyReward:Number.isFinite(n.apyReward)?n.apyReward:null,apyPct7D:Number.isFinite(n.apyPct7D)?n.apyPct7D:null,stablecoin:!!n.stablecoin,ilRisk:n.ilRisk??"unknown"})).sort((n,a)=>a.tvlUsd-n.tvlUsd).slice(0,250)})}async getFeesOverview(){return Gp.get("overview",async()=>{const t=await ae(Ho);if(!t||!Number.isFinite(t.total24h))throw new Error("defillama fees-overview: unexpected response shape");return{total24h:t.total24h,total7d:Number.isFinite(t.total7d)?t.total7d:null,changePct:Number.isFinite(t.change_1d)?t.change_1d:null,history:Vo(t.totalDataChart)}})}}const Kp="https://api.sosovalue.xyz/openapi/v2/etf",Wo={btc:"us-btc-spot",eth:"us-eth-spot"},Tr=e=>{const t=Number(e==null?void 0:e.value);return Number.isFinite(t)?t:0};async function Go(e,t){return ae(`${Kp}/${e}`,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t})}})}class qp{constructor(){K(this,"name","SoSoValue");K(this,"capabilities",["etf-flows"]);K(this,"cache",new ne({namespace:"zframes:etf-flows",ttlMs:360*6e4,persist:!0}))}async getEtfFlows(t){const r=(t||"btc").toLowerCase(),n=Wo[r]??Wo.btc;return this.cache.get(r,async()=>{const[a,o]=await Promise.all([Go("historicalInflowChart",n),Go("currentEtfDataMetrics",n)]),s=(Array.isArray(a==null?void 0:a.data)?a.data:[]).map(f=>({time:Date.parse(String(f.date)),value:Number(f.totalNetInflow)})).filter(f=>Number.isFinite(f.time)&&Number.isFinite(f.value)).sort((f,h)=>f.time-h.time),c=o==null?void 0:o.data,l=(Array.isArray(c==null?void 0:c.list)?c.list:[]).map(f=>({ticker:f.ticker??"",institute:f.institute??"",dailyNetInflow:Tr(f.dailyNetInflow),netAssets:Tr(f.netAssets),cumNetInflow:Tr(f.cumNetInflow)})).filter(f=>f.ticker).sort((f,h)=>h.netAssets-f.netAssets);if(s.length===0&&l.length===0)throw new Error("etf-flows: empty response");const u=s.at(-1);return{asset:r,date:u?new Date(u.time).toISOString().slice(0,10):"",dailyTotalNetInflow:c!=null&&c.dailyNetInflow?Tr(c.dailyNetInflow):(u==null?void 0:u.value)??0,cumNetInflow:Tr(c==null?void 0:c.cumNetInflow),totalNetAssets:Tr(c==null?void 0:c.totalNetAssets),issuers:l,history:s}})}}const Jp="https://gamma-api.polymarket.com/markets";function Yo(e){if(typeof e!="string")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(String):[]}catch{return[]}}class Xp{constructor(){K(this,"name","Polymarket");K(this,"capabilities",["prediction-markets"]);K(this,"cache",new ne({namespace:"zframes:polymarket:markets",ttlMs:4*6e4,persist:!0}))}async getPredictionMarkets(t=12){const r=Math.min(Math.max(t,1),50);return this.cache.get(String(r),async()=>{const n=`${Jp}?closed=false&limit=${r}&order=volume&ascending=false`,a=await ae(n);if(!Array.isArray(a))throw new Error("polymarket markets: unexpected response shape");return a.map(o=>{const i=Yo(o.outcomes),s=Yo(o.outcomePrices);if(!o.question||i.length===0)return null;const c=i.map((l,u)=>({label:l,prob:Number(s[u])})).filter(l=>Number.isFinite(l.prob));return c.length===0?null:{question:o.question,outcomes:c,volume24h:Number.isFinite(o.volume24hr)?o.volume24hr:0,endDate:o.endDate??""}}).filter(o=>o!==null)})}}const pn="https://ultrasound.money/api/v2/fees",rr=e=>{const t=Number(e);return Number.isFinite(t)?t:0};class Zp{constructor(){K(this,"name","ultrasound.money");K(this,"capabilities",["eth-supply"]);K(this,"cache",new ne({namespace:"zframes:ultrasound:eth-supply",ttlMs:2*6e4,persist:!0}))}async getEthSupply(){return this.cache.get("latest",async()=>{var h,d,m,p,g,v,b,x,P,C,y,z;const[t,r,n,a]=await Promise.allSettled([ae(`${pn}/gauge-rates`),ae(`${pn}/validator-rewards`),ae(`${pn}/burn-rates`),ae(`${pn}/supply-over-time`)]);if(t.status!=="fulfilled"||!((h=t.value)!=null&&h.d1))throw new Error("ultrasound gauge-rates: unavailable");const o=t.value.d1,i=r.status==="fulfilled"?r.value:void 0,s=(rr((d=i==null?void 0:i.issuance)==null?void 0:d.apr)+rr((m=i==null?void 0:i.mev)==null?void 0:m.apr)+rr((p=i==null?void 0:i.tips)==null?void 0:p.apr))*100,c=n.status==="fulfilled"?rr((b=(v=(g=n.value)==null?void 0:g.d1)==null?void 0:v.rate)==null?void 0:b.eth_per_minute):0,u=(a.status==="fulfilled"?((x=a.value)==null?void 0:x.d30)??((P=a.value)==null?void 0:P.d7)??((C=a.value)==null?void 0:C.d1)??[]:[]).map(D=>({time:Date.parse(D.timestamp),value:Number(D.supply)})).filter(D=>Number.isFinite(D.time)&&Number.isFinite(D.value));return{supply:u.length?u[u.length-1].value:0,burnRateYearlyEth:rr((y=o.burn_rate_yearly)==null?void 0:y.eth),issuanceRateYearlyEth:rr((z=o.issuance_rate_yearly)==null?void 0:z.eth),supplyGrowthYearlyPct:rr(o.supply_growth_rate_yearly)*100,supplyGrowthYearlyPowPct:rr(o.supply_growth_rate_yearly_pow)*100,stakingAprPct:s,burnEthPerMin:c,history:u}})}}const Ko="https://www.deribit.com/api/v2/public",$p=new ne({namespace:"zframes:deribit:summary",ttlMs:4*6e4,persist:!0}),Qp=new ne({namespace:"zframes:deribit:dvol",ttlMs:9*6e4,persist:!0}),em={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},tm=/^[A-Z]+-(\d{1,2}[A-Z]{3}\d{2})-(\d+(?:\.\d+)?)-([CP])$/;function rm(e){const t=/^(\d{1,2})([A-Z]{3})(\d{2})$/.exec(e);if(!t)return Number.POSITIVE_INFINITY;const r=Number(t[1]),n=em[t[2]],a=2e3+Number(t[3]);return n===void 0?Number.POSITIVE_INFINITY:Date.UTC(a,n,r,8,0,0)}class nm{constructor(){K(this,"name","deribit");K(this,"capabilities",["options-summary","volatility-index"])}async getOptionsSummary(t){const r=t.toUpperCase();return $p.get(r,async()=>{const n=await ae(`${Ko}/get_book_summary_by_currency?currency=${r}&kind=option`),a=n==null?void 0:n.result;if(!Array.isArray(a)||a.length===0)throw new Error("deribit options: unexpected response shape");let o=0,i=0,s=0,c=0,l=0,u=0,f=0;const h=new Map;for(const v of a){const b=tm.exec(v.instrument_name);if(!b)continue;const[,x,P,C]=b,y=Number(P),z=v.open_interest??0,D=v.volume??0,N=C==="C";N?(o+=z,s+=D):(i+=z,c+=D),Number.isFinite(v.mark_iv)&&z>0&&(l+=v.mark_iv*z,u+=z),!f&&Number.isFinite(v.underlying_price)&&(f=v.underlying_price);let S=h.get(x);S||(S=new Map,h.set(x,S));let q=S.get(y);q||(q={callOi:0,putOi:0},S.set(y,q)),N?q.callOi+=z:q.putOi+=z}const d=Date.now(),m=[...h.keys()].map(v=>({expiry:v,expiryMs:rm(v)}));m.sort((v,b)=>v.expiryMs-b.expiryMs);const p=m.find(v=>v.expiryMs>d)??m[0]??null;let g={expiry:(p==null?void 0:p.expiry)??"",expiryMs:(p==null?void 0:p.expiryMs)??0,strikes:[]};if(p){const v=h.get(p.expiry);g={expiry:p.expiry,expiryMs:p.expiryMs,strikes:[...v.entries()].map(([b,x])=>({strike:b,callOi:x.callOi,putOi:x.putOi})).sort((b,x)=>b.strike-x.strike)}}return{currency:r,underlyingPrice:f,putCallRatioOi:o>0?i/o:0,putCallRatioVolume:s>0?c/s:0,callOi:o,putOi:i,callVolume:s,putVolume:c,avgIv:u>0?l/u:0,nearestExpiry:g,asOf:Date.now()}})}async getVolatilityIndex(t,r,n){const a=t.toUpperCase();return Qp.get(`${a}:${n}:${r}`,async()=>{var s;const o=await ae(`${Ko}/get_volatility_index_data?currency=${a}&start_timestamp=${r}&end_timestamp=${Date.now()}&resolution=${n}`),i=(s=o==null?void 0:o.result)==null?void 0:s.data;if(!Array.isArray(i))throw new Error("deribit dvol: unexpected response shape");return i.map(c=>({time:c[0],value:c[4]})).sort((c,l)=>c.time-l.time)})}}const am=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,om=7,im=60*6e4,sm=new ne({namespace:"zframes:finra:shortvol",ttlMs:im});function cm(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function lm(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function um(e){const t=e.split(/\r?\n/),r=new Map;let n="";for(let a=1;a<t.length;a++){const o=t[a].split("|");if(o.length<5)continue;const[i,s,c,l,u]=o;if(!s)continue;const f=Number(c),h=Number(u);!Number.isFinite(f)||!Number.isFinite(h)||(!n&&/^\d{8}$/.test(i)&&(n=`${i.slice(0,4)}-${i.slice(4,6)}-${i.slice(6,8)}`),r.set(s.toUpperCase(),{date:n||i,symbol:s,shortVolume:f,shortExemptVolume:Number(l)||0,totalVolume:h,shortPct:h>0?f/h*100:0}))}if(r.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:n,bySymbol:r}}class dm{constructor(){K(this,"name","finra");K(this,"capabilities",["short-volume"])}async getShortVolume(t){const r=await this.loadReport(),n={};for(const a of t){const o=r.bySymbol.get(cm(a).toUpperCase());o&&(n[a]=o)}return n}loadReport(){return sm.get("latest",()=>this.fetchLatest())}async fetchLatest(){const t=Date.now();for(let r=0;r<=om;r++){const n=new Date(t-r*864e5);try{return um(await Zr(am(lm(n)),{proxied:!0,timeoutMs:15e3}))}catch{}}throw new Error("finra: no recent short-volume file found")}}const qo="https://api.frankfurter.dev/v1",fm=50.14348112,Jo={EUR:.576,JPY:.136,GBP:.119,CAD:.091,SEK:.042,CHF:.036},hm=new ne({namespace:"zframes:fx",ttlMs:55*6e4,persist:!0}),pm=new ne({namespace:"zframes:fx:dxy",ttlMs:55*6e4,persist:!0}),Xo=40;function Zo(e){return new Date(Date.now()-e*864e5).toISOString().slice(0,10)}class mm{constructor(){K(this,"name","fx");K(this,"capabilities",["fx-rates","dollar-index"])}async getFxRates(t,r){const n=t.toUpperCase(),a=[...new Set(r.map(i=>i.toUpperCase()))].filter(i=>i&&i!==n);if(a.length===0)return[];const o=`${n}:${[...a].sort().join(",")}`;return hm.get(o,async()=>{const i=`${qo}/${Zo(Xo)}..?base=${n}&symbols=${a.join(",")}`,s=await ae(i);if(!(s!=null&&s.rates))throw new Error("frankfurter: unexpected response shape");const c=Object.keys(s.rates).sort();return a.map(l=>{var m;const u=[];for(const p of c){const g=(m=s.rates[p])==null?void 0:m[l];typeof g=="number"&&Number.isFinite(g)&&u.push({time:new Date(`${p}T00:00:00Z`).getTime(),value:g})}if(u.length===0)return null;const f=u[u.length-1].value,h=u.length>1?u[u.length-2].value:f,d=h>0?(f-h)/h*100:0;return{symbol:l,base:n,rate:f,changePct:d,history:u}}).filter(l=>l!==null)})}async getDollarIndex(){return pm.get("dxy",async()=>{const t=Object.keys(Jo),r=`${qo}/${Zo(Xo)}..?base=USD&symbols=${t.join(",")}`,n=await ae(r);if(!(n!=null&&n.rates))throw new Error("frankfurter dxy: unexpected response shape");const a=Object.keys(n.rates).sort(),o=[];for(const l of a){const u=n.rates[l];if(!u||!t.every(h=>typeof u[h]=="number"&&Number.isFinite(u[h])&&u[h]>0))continue;let f=fm;for(const[h,d]of Object.entries(Jo))f*=Math.pow(u[h],d);o.push({time:new Date(`${l}T00:00:00Z`).getTime(),value:f})}if(o.length===0)throw new Error("frankfurter dxy: no complete days in window");const i=o[o.length-1].value,s=o.length>1?o[o.length-2].value:i,c=s>0?(i-s)/s*100:0;return{value:i,changePct:c,history:o}})}}const gm="wss://api.hyperliquid.xyz/ws",vm="https://api.hyperliquid.xyz/info",ym={HlPerp:"Hyperliquid",BinPerp:"Binance",BybitPerp:"Bybit"},oa=e=>e.includes(":")?e.split(":")[0]:"";async function Kr(e){return ae(vm,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}const bm=new ne({namespace:"zframes:hyperliquid:daystats",ttlMs:25e3}),wm=new ne({namespace:"zframes:hyperliquid:oi",ttlMs:25e3}),xm=new ne({namespace:"zframes:hyperliquid:candles",ttlMs:55e3,persist:!0}),km=new ne({namespace:"zframes:hyperliquid:funding",ttlMs:4.5*6e4,persist:!0}),Cm=new ne({namespace:"zframes:hyperliquid:funding-comparison",ttlMs:5*6e4}),$o=e=>e?[...e].sort().join(","):"*";class _m{constructor(){K(this,"name","hyperliquid");K(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv","open-interest","funding-comparison"]);K(this,"ws",null);K(this,"listeners",new Set);K(this,"reconnectTimer",null);K(this,"closedByUser",!1);K(this,"wantedDexes",new Set([""]));K(this,"subscribedDexes",new Set);K(this,"mergedMids",{})}async getFundingComparison(){return Cm.get("all",async()=>{const t=await Kr({type:"predictedFundings"});if(!Array.isArray(t))throw new Error("hyperliquid predictedFundings: unexpected shape");const r=[];for(const n of t){if(!Array.isArray(n)||n.length<2)continue;const[a,o]=n;if(typeof a!="string"||!Array.isArray(o))continue;const i=[];for(const c of o){if(!Array.isArray(c)||c.length<2)continue;const[l,u]=c;if(!u)continue;const f=parseFloat(u.fundingRate);if(!Number.isFinite(f))continue;const h=Number(u.fundingIntervalHours),d=Number.isFinite(h)&&h>0?h:l==="HlPerp"?1:8;i.push({venue:ym[l]??l,rawRate:f,intervalHours:d,annualizedPct:f*(8760/d)*100})}if(i.length<2)continue;const s=i.map(c=>c.annualizedPct);r.push({coin:a,venues:i,spreadPct:Math.max(...s)-Math.min(...s)})}return r.sort((n,a)=>Math.abs(a.spreadPct)-Math.abs(n.spreadPct)).slice(0,80)})}subscribeMids(t,r){this.listeners.add(t);for(const n of r??[])this.wantedDexes.add(oa(n));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}getDayStats(t){return bm.get($o(t),()=>this.fetchDayStats(t))}async fetchDayStats(t){const r=new Set,n=new Set;if(!t)r.add("");else for(const i of t)i.endsWith(":*")?r.add(i.slice(0,-2)):n.add(i);const a=new Set(r);for(const i of n)a.add(oa(i));const o={};return await Promise.all([...a].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await Kr(s),u=r.has(i);c.universe.forEach((f,h)=>{if(!u&&!n.has(f.name))return;const d=l[h];if(!d)return;const m=Number(d.markPx),p=Number(d.prevDayPx);!Number.isFinite(m)||!Number.isFinite(p)||(o[f.name]={markPx:m,prevDayPx:p,changePct:p?(m-p)/p*100:0})})})),o}getOpenInterest(t){return wm.get($o(t),()=>this.fetchOpenInterest(t))}async fetchOpenInterest(t){const r=new Set,n=new Set;if(!t)r.add("");else for(const i of t)i.endsWith(":*")?r.add(i.slice(0,-2)):n.add(i);const a=new Set(r);for(const i of n)a.add(oa(i));const o=[];return await Promise.all([...a].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await Kr(s),u=r.has(i);c.universe.forEach((f,h)=>{if(!u&&!n.has(f.name))return;const d=l[h];if(!d)return;const m=Number(d.markPx),p=Number(d.openInterest);!Number.isFinite(m)||!Number.isFinite(p)||o.push({symbol:f.name,openInterestUsd:p*m})})})),o.sort((i,s)=>s.openInterestUsd-i.openInterestUsd)}getFundingHistory(t,r){return km.get(`${[...t].sort().join(",")}|${r}`,()=>this.fetchFundingHistory(t,r))}async fetchFundingHistory(t,r){const n=await Promise.all(t.map(async a=>{const i=(await Kr({type:"fundingHistory",coin:a,startTime:r})).map(s=>({time:s.time,fundingRate:Number(s.fundingRate)})).filter(s=>Number.isFinite(s.fundingRate)&&Number.isFinite(s.time));return[a,i]}));return Object.fromEntries(n)}getCandles(t,r,n){return xm.get(`${t}|${r}|${n}`,()=>this.fetchCandles(t,r,n))}async fetchCandles(t,r,n){return(await Kr({type:"candleSnapshot",req:{coin:t,interval:r,startTime:n}})).map(o=>({time:o.t,open:Number(o.o),high:Number(o.h),low:Number(o.l),close:Number(o.c),volume:Number(o.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(gm);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=r=>{var a;let n;try{n=JSON.parse(String(r.data))}catch{return}if(!(n.channel!=="allMids"||!((a=n.data)!=null&&a.mids))){for(const[o,i]of Object.entries(n.data.mids))this.mergedMids[o]=Number(i);for(const o of this.listeners)o(this.mergedMids)}},t.onclose=()=>{this.ws=null,!this.closedByUser&&this.listeners.size>0&&(this.reconnectTimer=setTimeout(()=>this.ensureSocket(),2e3))}}subscribeMissingDexes(){const t=this.ws;if(!(!t||t.readyState!==WebSocket.OPEN))for(const r of this.wantedDexes){if(this.subscribedDexes.has(r))continue;const n={type:"allMids"};r&&(n.dex=r),t.send(JSON.stringify({method:"subscribe",subscription:n})),this.subscribedDexes.add(r)}}teardown(){var t;this.closedByUser=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this.subscribedDexes=new Set,this.mergedMids={}}}const nr="https://mempool.space/api",Am=new ne({namespace:"zframes:mempool:fees",ttlMs:25e3,persist:!0}),Sm=new ne({namespace:"zframes:mempool:state",ttlMs:12e3,persist:!0}),zm=new ne({namespace:"zframes:mempool:blocks",ttlMs:25e3,persist:!0}),Tm=new ne({namespace:"zframes:mempool:hashrate",ttlMs:25*6e4,persist:!0}),Em=new ne({namespace:"zframes:mempool:difficulty",ttlMs:5e4,persist:!0}),Pm=new ne({namespace:"zframes:mempool:pools",ttlMs:4*6e4,persist:!0}),Mm=new ne({namespace:"zframes:mempool:lightning",ttlMs:25*6e4,persist:!0});class Dm{constructor(){K(this,"name","mempool");K(this,"capabilities",["btc-fees","btc-mempool","btc-blocks","btc-hashrate","btc-difficulty","mining-pools","lightning-stats"])}async getBtcFees(){return Am.get("latest",async()=>{const t=await ae(`${nr}/v1/fees/recommended`);if(!t||typeof t.fastestFee!="number")throw new Error("mempool fees: unexpected response shape");return{fastest:t.fastestFee,halfHour:t.halfHourFee,hour:t.hourFee,economy:t.economyFee,minimum:t.minimumFee}})}async getMempoolState(){return Sm.get("latest",async()=>{const[t,r]=await Promise.all([ae(`${nr}/mempool`),ae(`${nr}/v1/fees/mempool-blocks`)]);if(!t||typeof t.count!="number")throw new Error("mempool state: unexpected response shape");const n=(Array.isArray(r)?r:[]).map(a=>({medianFee:a.medianFee,feeRange:Array.isArray(a.feeRange)?a.feeRange:[],totalFees:a.totalFees,nTx:a.nTx,blockVSize:a.blockVSize}));return{count:t.count,vsize:t.vsize,totalFee:t.total_fee,projected:n}})}async getBtcBlocks(t=8){return zm.get(String(t),async()=>{const r=await ae(`${nr}/v1/blocks`);if(!Array.isArray(r))throw new Error("mempool blocks: unexpected response shape");return r.slice(0,t).map(n=>{var a,o,i,s,c,l;return{id:n.id,height:n.height,time:n.timestamp*1e3,txCount:n.tx_count,size:n.size,totalFees:((a=n.extras)==null?void 0:a.totalFees)??0,medianFee:((o=n.extras)==null?void 0:o.medianFee)??0,poolName:((s=(i=n.extras)==null?void 0:i.pool)==null?void 0:s.name)??"Unknown",poolSlug:((l=(c=n.extras)==null?void 0:c.pool)==null?void 0:l.slug)??"unknown"}})})}async getNetworkHashrate(t){return Tm.get(t,async()=>{const r=await ae(`${nr}/v1/mining/hashrate/${encodeURIComponent(t)}`);if(!r||!Array.isArray(r.hashrates))throw new Error("mempool hashrate: unexpected response shape");return{currentHashrate:r.currentHashrate,currentDifficulty:r.currentDifficulty,hashrates:r.hashrates.map(n=>({time:n.timestamp*1e3,hashrate:n.avgHashrate})),difficulty:(r.difficulty??[]).map(n=>({time:n.time*1e3,difficulty:n.difficulty}))}})}async getDifficultyAdjustment(){return Em.get("latest",async()=>{const t=await ae(`${nr}/v1/difficulty-adjustment`);if(!t||typeof t.progressPercent!="number")throw new Error("mempool difficulty: unexpected response shape");return{progressPercent:t.progressPercent,difficultyChange:t.difficultyChange,previousRetarget:t.previousRetarget,remainingBlocks:t.remainingBlocks,remainingTimeMs:t.remainingTime,estimatedRetargetDate:t.estimatedRetargetDate,nextRetargetHeight:t.nextRetargetHeight,avgBlockTimeMs:t.timeAvg}})}async getMiningPools(t){return Pm.get(t,async()=>{const r=await ae(`${nr}/v1/mining/pools/${encodeURIComponent(t)}`);if(!r||!Array.isArray(r.pools))throw new Error("mempool pools: unexpected response shape");const n=r.blockCount||0;return{window:t,totalBlocks:n,pools:r.pools.map(a=>({name:a.name,slug:a.slug,blockCount:a.blockCount,sharePct:n>0?a.blockCount/n*100:0,rank:a.rank}))}})}async getLightningStats(){return Mm.get("latest",async()=>{var n,a,o;const t=await ae(`${nr}/v1/lightning/statistics/latest`),r=t==null?void 0:t.latest;if(!r||typeof r.node_count!="number")throw new Error("mempool lightning: unexpected response shape");return{nodeCount:r.node_count,channelCount:r.channel_count,totalCapacity:r.total_capacity,torNodes:r.tor_nodes,clearnetNodes:r.clearnet_nodes,medCapacity:r.med_capacity,prevNodeCount:(n=t.previous)==null?void 0:n.node_count,prevChannelCount:(a=t.previous)==null?void 0:a.channel_count,prevTotalCapacity:(o=t.previous)==null?void 0:o.total_capacity}})}}const Rm={coindesk:{url:"https://www.coindesk.com/arc/outboundfeeds/rss/",source:"CoinDesk"},cointelegraph:{url:"https://cointelegraph.com/rss",source:"Cointelegraph"},decrypt:{url:"https://decrypt.co/feed",source:"Decrypt"},cnbc:{url:"https://www.cnbc.com/id/20910258/device/rss/rss.html",source:"CNBC Markets"},nasdaq:{url:"https://www.nasdaq.com/feed/rssoutbound?category=Markets",source:"Nasdaq"}},Om=e=>{const t=`(${e.join(" OR ")}) stock`;return`https://news.google.com/rss/search?q=${encodeURIComponent(t)}&hl=en-US&gl=US&ceid=US:en`},Qo={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function $r(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,r)=>{const n=r.toLowerCase();if(Qo[n])return Qo[n];if(r[0]==="#"){const a=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Number.isFinite(a)?String.fromCodePoint(a):t}return t})}const jn=e=>e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1");function ei(e){return $r(jn(e).replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function Et(e,t){const r=e.match(new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,"i"));return r?r[1]:void 0}function Nm(e){const t=[...e.matchAll(/<link\b[^>]*\bhref="([^"]+)"[^>]*>/gi)];if(t.length>0){const n=t.find(a=>/rel="alternate"/i.test(a[0]))??t.find(a=>!/\brel=/i.test(a[0]))??t[0];return $r(n[1]).trim()}const r=Et(e,"link");return r?$r(jn(r)).trim():void 0}function Er(e,t){const r=e.match(new RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`,"i"));return r?$r(r[1]).trim():void 0}const mn=e=>!!e&&/^https:\/\//i.test(e);function Lm(e){var a,o;const t=(a=e.match(/<media:thumbnail\b[^>]*>/i))==null?void 0:a[0];if(t){const i=Er(t,"url");if(mn(i))return i}for(const i of e.matchAll(/<media:content\b[^>]*>/gi)){const s=Er(i[0],"medium"),c=Er(i[0],"type"),l=s==="image"||!s&&!(c!=null&&c.match(/^(audio|video)\//i)),u=Er(i[0],"url");if(l&&mn(u))return u}for(const i of e.matchAll(/<enclosure\b[^>]*>/gi)){if(!((o=Er(i[0],"type"))!=null&&o.startsWith("image/")))continue;const s=Er(i[0],"url");if(mn(s))return s}const r=Et(e,"content:encoded")??Et(e,"description")??Et(e,"content")??Et(e,"summary"),n=r?jn(r).match(/<img\b[^>]*\bsrc="([^"]+)"/i):null;if(n){const i=$r(n[1]).trim();if(mn(i))return i}}function Im(e){const t=Et(e,"pubDate")??Et(e,"published")??Et(e,"updated")??Et(e,"dc:date");if(!t)return;const r=Date.parse(jn(t).trim());return Number.isFinite(r)?r:void 0}function ti(e,t,r){const n=[...e.matchAll(/<(item|entry)\b[\s\S]*?<\/\1>/gi)].map(o=>o[0]),a=[];for(const o of n){const i=Et(o,"title"),s=Nm(o);if(!i||!s)continue;const c=ei(i);if(!c)continue;const l=Et(o,"description")??Et(o,"summary")??Et(o,"content"),u=l?ei(l).slice(0,280):void 0,f=Im(o),h=Lm(o);a.push({title:c,url:s,source:t,...u?{summary:u}:{},...f?{publishedAt:f}:{},...h?{imageUrl:h}:{}})}return a.some(o=>o.publishedAt!==void 0)&&a.sort((o,i)=>(i.publishedAt??0)-(o.publishedAt??0)),a.slice(0,r)}class Fm{constructor(){K(this,"name","news");K(this,"capabilities",["news"])}async getNews({feed:t,symbols:r,limit:n=12}){if(t==="stocks"){const i=(r??[]).map(c=>(c.split(":").pop()??"").toUpperCase()).filter(Boolean);if(i.length===0)return[];const s=await Zr(Om(i),{proxied:!0,timeoutMs:12e3});return ti(s,"Google News",n)}const a=Rm[t];if(!a)throw new Error(`news: unknown feed "${t}"`);const o=await Zr(a.url,{proxied:!0,timeoutMs:12e3});return ti(o,a.source,n)}}const Um="https://markets.newyorkfed.org/api/rates/all/latest.json",jm={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},ri=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"],Hm=new ne({namespace:"zframes:nyfed:rates",ttlMs:12*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});function hr(e){const t=Number(e);return Number.isFinite(t)?t:null}function Bm(e,t){const r=ri.indexOf(e.code),n=ri.indexOf(t.code);return(r===-1?99:r)-(n===-1?99:n)}class Vm{constructor(){K(this,"name","nyfed");K(this,"capabilities",["reference-rates"])}async getReferenceRates(){return Hm.get("latest",async()=>{const t=await ae(Um);if(!Array.isArray(t==null?void 0:t.refRates))throw new Error("ny fed rates: unexpected response shape");return t.refRates.map(r=>{const n=String(r.type??""),a=hr(r.percentRate??r.average30day);if(!n||!r.effectiveDate||a===null)return null;const o={code:n,label:jm[n]??n,date:r.effectiveDate,rate:a,source:"New York Fed"},i=hr(r.volumeInBillions),s=hr(r.targetRateFrom),c=hr(r.targetRateTo),l=hr(r.average30day),u=hr(r.average90day),f=hr(r.average180day);return i!==null&&(o.volumeInBillions=i),s!==null&&(o.targetRateFrom=s),c!==null&&(o.targetRateTo=c),l!==null&&(o.average30Day=l),u!==null&&(o.average90Day=u),f!==null&&(o.average180Day=f),o}).filter(r=>r!==null).sort(Bm)})}}const Wm="https://www.financialresearch.gov/financial-stress-index/data/fsi.csv",Gm=60*6e4,Ym=new ne({namespace:"zframes:ofr:fsi",ttlMs:Gm}),Km=[[2,"Credit"],[3,"Equity valuation"],[4,"Safe assets"],[5,"Funding"],[6,"Volatility"]];function ni(e){const t=Number(e);return Number.isFinite(t)?t:null}function qm(e){const t=e.split(/\r?\n/),r=[];let n=null;for(let i=1;i<t.length;i++){const s=t[i].split(",");if(s.length<7)continue;const c=s[0],l=ni(s[1]),u=Date.parse(`${c}T00:00:00Z`);!c||l===null||!Number.isFinite(u)||(r.push({time:u,date:c,value:l}),n=s)}if(!n||r.length===0)throw new Error("ofr fsi: empty or unparseable CSV");const a=r[r.length-1],o=Km.map(([i,s])=>({label:s,value:ni(n[i])??0}));return{value:a.value,date:a.date,categories:o,trend:r.slice(-90),source:"OFR"}}class Jm{constructor(){K(this,"name","ofr");K(this,"capabilities",["financial-stress"])}async getFinancialStress(){return Ym.get("latest",()=>Zr(Wm,{proxied:!0}).then(qm))}}const Xm={A:1090872,AAPL:320193,ABBV:1551152,ABEV:1565025,ABNB:1559720,ABT:1800,ACGL:947484,ACN:1467373,ADBE:796343,ADI:6281,ADM:7084,ADP:8670,ADSK:769397,AEE:1002910,AEM:2809,AEP:4904,AFL:4977,AIG:5272,AJG:354190,ALAB:1736297,ALC:1167379,ALL:899051,ALNY:1178670,AMAT:6951,AMD:2488,AME:1037868,AMGN:318154,AMP:820027,AMRZ:2035989,AMT:1053507,AMX:1129137,AMZN:1018724,ANET:1596532,AON:315293,APD:2969,APH:820313,APO:1858681,APP:1751008,ARES:1176948,ARGX:1697862,ARM:1973239,ASML:937966,ASTS:1780312,ASX:1122411,ATEYY:1158838,ATO:731802,AU:1973832,AVGO:1730168,AXON:1069183,AXP:4962,AZN:901832,AZO:866787,B:756894,BA:12927,BABA:1577552,BAC:70858,BAESY:895564,BAM:1937926,BBD:1160330,BBVA:842180,BCS:312069,BDX:10795,BE:1664703,BHP:811809,BIDU:1329099,BIIB:875045,BKNG:1075531,BKR:1701605,BLK:2012383,BMO:927971,BMWKY:1446250,BMY:14272,BN:1001085,BNS:9631,BNY:1390777,BP:313807,"BRK-A":1067983,"BRK-B":1067983,BSBR:1471055,BSX:885725,BTI:1303523,BUD:1668717,BX:1393818,C:831001,CAH:721371,CARR:1783180,CAT:18230,CB:896159,CBOE:1374310,CBRE:1138118,CBRS:2021728,CCEP:1650107,CCI:1051470,CCJ:1009001,CCL:815097,CDNS:813672,CEG:1868275,CHT:1132924,CI:1739940,CIEN:936395,CKHGF:1469059,CL:21665,CLS:1030894,CM:1045520,CMCSA:1166691,CME:1156375,CMG:1058090,CMI:26172,CNC:1071739,CNI:16868,CNQ:1017413,COF:927628,COHR:820318,COIN:1679788,COP:1163165,COR:1140859,COST:909832,CP:16875,CPRT:900075,CQP:1383650,CRDO:1807794,CRH:849395,CRM:1108524,CRWD:1535527,CRWV:1769628,CSCO:858877,CSLLY:1274152,CSX:277948,CTAS:723254,CTVA:1755672,CVE:1475260,CVNA:1690820,CVS:64803,CVX:93410,CYATY:2070829,D:715957,DAL:27904,DASH:1792789,DB:1159508,DDOG:1561550,DE:315189,DELL:1571996,DEO:835403,DHI:882184,DHR:313616,DIA:1041130,DIS:1744489,DLMAY:2073893,DLR:1297996,DOV:29905,DTE:936340,DTEGY:946770,DUK:1326160,DVN:1090012,E:1002242,EA:712515,EBAY:1065088,EC:1444406,ECL:31462,ED:1047862,EIX:827052,EL:1001250,ELV:1156039,EME:105634,EMR:32604,ENB:895728,EOG:821189,EONGY:1136808,EPD:1061219,EQIX:1101239,EQNR:1140625,EQT:33213,ERIC:717826,ESLT:1027664,ET:1276187,ETN:1551182,ETR:65984,EW:1099800,EXC:1109357,EXR:1289490,F:37996,FANG:1539838,FAST:815556,FCX:831259,FDX:1048911,FER:1468522,FERG:2011641,FISV:798354,FITB:35527,FIX:1035983,FLEX:866374,FMX:1061736,FNV:1456346,FOX:1754301,FOXA:1754301,FRFHF:915191,FSLR:1274494,FTNT:1262039,FTS:1666175,GALDY:2021390,GD:40533,GE:40545,GEHC:1932393,GEV:1996810,GFI:1172724,GFS:1709048,GILD:882095,GLD:1222333,GLW:24741,GM:1467858,GOOG:1652044,GOOGL:1652044,GRMN:1121788,GS:886982,GSK:1131399,GWLIF:850918,GWW:277135,HAL:45012,HBAN:49196,HCA:860730,HD:354950,HDB:1144967,HEI:46619,HIG:874766,HLN:1900304,HLT:1585689,HMC:715153,HON:773840,HOOD:1783879,HPE:1645590,HSBC:1089113,HSY:47111,HTHIY:47710,HUM:49071,HWM:4281,IBKR:1381197,IBM:51143,IBN:1103838,ICE:1571949,IDXX:874716,IFNNY:1107457,IMO:49938,INFY:1067491,ING:1039765,INTC:50863,INTU:896878,IQV:1478242,IR:1699150,IRM:1020569,ISRG:1035267,ITUB:1132597,ITW:49826,IX:1070304,JBL:898293,JCI:833444,JD:1549802,JHPCY:2071868,JNJ:200406,JPM:19617,KB:1445930,KBGGY:1535759,KDP:1418135,KEYS:1601046,KGC:701818,KKR:1404912,KLAC:319201,KMB:55785,KMI:1506307,KO:21344,KR:56873,KVUE:1944048,KXIAY:2053383,LHX:202058,LIN:1707925,LITE:1633978,LLY:59478,LMT:936468,LNG:3570,LOW:60667,LRCX:707549,LSEGY:1842726,LVS:1300514,LYG:1160106,LYV:1335258,MA:1141391,MAR:1048286,MCD:63908,MCHP:827054,MCK:927653,MCO:1059556,MDLN:2046386,MDLZ:1103982,MDT:1613103,MELI:1099590,MET:1099219,META:1326801,MFC:1086888,MFG:1335730,MGCLY:2039784,MLM:916076,MMM:66740,MNST:865752,MO:764180,MPC:1510295,MPLX:1552e3,MPWR:1280452,MRK:310158,MRSH:62709,MRVL:1835632,MS:895421,MSCI:1408198,MSFT:789019,MSI:68505,MSTR:1050446,MT:1243429,MTB:36270,MTZ:15615,MU:723125,MUFG:67088,NBIS:1513845,NDAQ:1120193,NEE:753308,NEM:1164727,NET:1477333,NFLX:1065280,NGG:1004315,NKE:320187,NOC:1133421,NOK:924613,NOW:1373715,NSC:702165,NTAP:1002047,NTES:1110646,NTR:1725964,NTRA:1604821,NTRS:73124,NU:1691493,NUE:73309,NVDA:1045810,NVO:353278,NVS:1114448,NWG:844150,NWS:1564708,NWSA:1564708,NXPI:1413447,O:726728,ODFL:878927,OKE:1039684,ON:1097864,ORCL:1341439,ORLY:898173,OXY:797468,PANW:1327567,PAYX:723531,PBA:1546066,PBR:1119639,PCAR:75362,PCG:1004980,PDD:1737806,PEG:788784,PEP:77476,PFE:78003,PG:80424,PGR:80661,PH:76334,PLD:1045609,PLTR:1321655,PM:1413329,PNC:713676,PRU:1137774,PSA:1393311,PSX:1534701,PUK:1116578,PWR:1050915,PYPL:1633917,Q:2058873,QCOM:804328,QQQ:1067839,QSR:1618756,RACE:1648416,RBLX:1315098,RCL:884887,RDDT:1713445,REGN:872589,RELX:929869,RIO:863064,RJF:720005,RKLB:1819994,RKT:1805284,RMD:943819,ROK:1024478,ROP:882835,ROST:745732,RPRX:1802768,RSG:1060391,RSHGY:1447391,RTNTF:887028,RTX:101829,RVMD:1628171,RY:1000275,RYAAY:1038683,SAN:891478,SAP:1000184,SATS:1415404,SBUX:829224,SCCO:1001838,SCHW:316709,SCMWY:1069336,SE:1703399,SHEL:1306965,SHG:1263043,SHOP:1594805,SHW:89800,SLB:87347,SLF:1097362,SLV:1330568,SMERY:1830056,SMFG:1022837,SNDK:2023554,SNHIY:2098326,SNOW:1640147,SNPS:883241,SNY:1121404,SO:92122,SONY:313838,SPG:1063761,SPGI:64040,SPOT:1639920,SPY:884394,SRE:1032208,STLD:1022671,STM:932787,STT:93751,STX:1137789,SU:311337,SUNB:2083785,SYK:310764,SYY:96021,T:732717,TAK:1395064,TCOM:1269238,TD:947263,TDG:1260221,TECK:886986,TEL:1385157,TER:97210,TEVA:818686,TFC:92230,TGT:27419,TJX:109198,TKO:1973266,TM:1094517,TMO:97745,TMUS:1283699,TPR:1116132,TRGP:1389170,TRI:1075124,TRMOY:2071881,TRP:1232384,TRV:86312,TS:1190723,TSLA:1318605,TT:1466258,TTE:879764,TTWO:946581,TWLO:1447669,TXN:97476,TYHOY:2018139,UA:1336917,UAA:1336917,UAL:100517,UBER:1543151,UBS:1610520,UI:1511737,UL:217410,UMC:1033767,UNH:731766,UNP:100885,UPS:1090727,URI:1067701,USB:36104,V:1403161,VALE:917851,VG:2007855,VICI:1705696,VIK:1745201,VLO:1035002,VMC:1396009,VOD:839923,VRT:1674101,VRTX:875320,VST:1692819,VTR:740260,VZ:732712,WAB:943452,WAT:1000697,WBD:1437107,WCN:1318220,WDAY:1327811,WDC:106040,WEC:783325,WELL:766704,WFC:72971,WM:823768,WMB:107263,WMT:104169,WPM:1323404,XEL:72903,XOM:34088,XYZ:1512673,YUM:1041061,ZM:1585521,ZTS:1555280};function ga(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function ai(e){const t=e.trim(),r=/^cik[-\s]?(\d{1,10})$/i.exec(t)??/^(\d{1,10})$/.exec(t);if(r)return r[1].padStart(10,"0");const n=(t.includes(":")?t.slice(t.lastIndexOf(":")+1):t).toUpperCase().replace(/[^A-Z0-9.-]/g,""),a=Xm[n];return a===void 0?null:ga(a)}const Zm=e=>`https://data.sec.gov/submissions/CIK${e}.json`,$m=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,Ms=15*6e4,Qm=new ne({namespace:"zframes:sec:filings",ttlMs:Ms}),e0=new ne({namespace:"zframes:sec:facts",ttlMs:Ms});function t0(e,t,r){const n=String(Number(e)),a=t.replace(/-/g,""),o=`https://www.sec.gov/Archives/edgar/data/${n}/${a}`;return r?`${o}/${r}`:`${o}/`}const r0=[{label:"Revenue",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["RevenueFromContractWithCustomerExcludingAssessedTax","Revenues","SalesRevenueNet"]},{label:"Net income",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["NetIncomeLoss"]},{label:"Total assets",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["Assets"]},{label:"Shareholders' equity",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["StockholdersEquity"]},{label:"Diluted EPS",unit:"USD/shares",taxonomy:"us-gaap",kind:"flow",concepts:["EarningsPerShareDiluted","EarningsPerShareBasic"]},{label:"Shares outstanding",unit:"shares",taxonomy:"dei",kind:"instant",concepts:["EntityCommonStockSharesOutstanding"]}];function n0(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function a0(e,t){const r=e.filter(a=>a.end&&a.form&&Number.isFinite(a.val));return(t==="flow"&&r.some(a=>a.fp==="FY")?r.filter(a=>a.fp==="FY"):r).reduce((a,o)=>!a||o.end>a.end?o:a,null)}function o0(e){var r,n;if(!e)return[];const t=[];for(const a of r0){const o=e[a.taxonomy];if(!o)continue;let i=null;for(const s of a.concepts){const c=(n=(r=o[s])==null?void 0:r.units)==null?void 0:n[a.unit];if(!(c!=null&&c.length))continue;const l=a0(c,a.kind);l&&(!i||l.end>i.end)&&(i=l)}i&&t.push({label:a.label,value:i.val,unit:a.unit,end:i.end,fiscalPeriod:n0(i),form:i.form})}return t}class i0{constructor(t){K(this,"name","sec");K(this,"capabilities",["filings","fundamentals"]);this.contact=t}nodeInit(){return this.contact&&typeof document>"u"?{init:{headers:{"User-Agent":`zframes (${this.contact})`}}}:void 0}async getCompanyFacts(t){const r=ai(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return e0.get(r,()=>this.fetchCompanyFacts(r))}async fetchCompanyFacts(t){const r=await ae($m(t),void 0,{proxied:!0,...this.nodeInit()}),n=o0(r.facts);if(n.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:ga(r.cik??t),entityName:r.entityName??"",metrics:n}}async getCompanyFilings(t){const r=ai(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return Qm.get(r,()=>this.fetchFilings(r))}async fetchFilings(t){var i,s,c,l,u,f,h;const r=await ae(Zm(t),void 0,this.nodeInit()),n=(i=r.filings)==null?void 0:i.recent;if(!n||!Array.isArray(n.accessionNumber))throw new Error("sec submissions: unexpected response shape");const a=n.accessionNumber.length,o=[];for(let d=0;d<a;d++){const m=n.accessionNumber[d],p=(s=n.form)==null?void 0:s[d],g=(c=n.filingDate)==null?void 0:c[d];if(!m||!p||!g)continue;const v=(l=n.reportDate)==null?void 0:l[d],b=(u=n.primaryDocDescription)==null?void 0:u[d],x=(f=n.items)==null?void 0:f[d];o.push({form:p,filingDate:g,accessionNumber:m,url:t0(t,m,(h=n.primaryDocument)==null?void 0:h[d]),...v?{reportDate:v}:{},...b?{description:b}:{},...x?{items:x}:{}})}return{cik:ga(r.cik??t),name:r.name??"",tickers:r.tickers??[],exchanges:r.exchanges??[],filings:o,...r.sic?{sic:r.sic}:{},...r.sicDescription?{sicDescription:r.sicDescription}:{},...r.category?{category:r.category}:{},...r.fiscalYearEnd?{fiscalYearEnd:r.fiscalYearEnd}:{}}}}const s0="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",c0=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?sort=-record_date&page%5Bsize%5D=${e}&format=json`,l0=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?sort=-auction_date&filter=bid_to_cover_ratio:gt:0&fields=auction_date,security_type,security_term,high_yield,high_discnt_rate,high_investment_rate,bid_to_cover_ratio,offering_amt,total_accepted&page%5Bsize%5D=${e}&format=json`,u0=e=>`https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value_month=${e}`,Hn=180*6e4,d0=new ne({namespace:"zframes:treasury:yield-curve",ttlMs:Hn,persist:!0}),f0=new ne({namespace:"zframes:treasury:avg-rates",ttlMs:Hn,persist:!0}),h0=new ne({namespace:"zframes:treasury:national-debt",ttlMs:Hn,persist:!0}),p0=new ne({namespace:"zframes:treasury:auctions",ttlMs:Hn,persist:!0}),m0=[["BC_1MONTH","1M",1],["BC_2MONTH","2M",2],["BC_3MONTH","3M",3],["BC_4MONTH","4M",4],["BC_6MONTH","6M",6],["BC_1YEAR","1Y",12],["BC_2YEAR","2Y",24],["BC_3YEAR","3Y",36],["BC_5YEAR","5Y",60],["BC_7YEAR","7Y",84],["BC_10YEAR","10Y",120],["BC_20YEAR","20Y",240],["BC_30YEAR","30Y",360]];function Yt(e){const t=Number(e);return Number.isFinite(t)?t:null}function g0(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function v0(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let r=null;for(const a of t){const o=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(a);if(!o)continue;const i=o[1].slice(0,10);(!r||i>r.date)&&(r={date:i,raw:a})}if(!r)return null;const n=[];for(const[a,o,i]of m0){const s=new RegExp(`<d:${a}[^>]*>([^<]*)</d:${a}>`).exec(r.raw),c=s?Number(s[1]):NaN;Number.isFinite(c)&&n.push({label:o,months:i,rate:c})}return n.length?{date:r.date,points:n}:null}class y0{constructor(){K(this,"name","treasury");K(this,"capabilities",["treasury-rates","yield-curve","treasury-auctions","national-debt"])}async getYieldCurve(){return d0.get("latest",()=>this.fetchYieldCurve())}async fetchYieldCurve(){const t=new Date;for(let r=0;r<=1;r++){const n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-r,1)),a=await Zr(u0(g0(n)),{proxied:!0,timeoutMs:15e3}).catch(()=>""),o=v0(a);if(o)return o}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){return f0.get("latest",()=>this.fetchTreasuryAverageRates())}async fetchTreasuryAverageRates(){var n;const t=await ae(s0,void 0,{proxied:!0});if(!Array.isArray(t==null?void 0:t.data))throw new Error("treasury average rates: unexpected response shape");const r=(n=t.data.find(a=>a.record_date))==null?void 0:n.record_date;return r?t.data.filter(a=>a.record_date===r).map(a=>{const o=Yt(a.avg_interest_rate_amt);return o===null||!a.security_type_desc||!a.security_desc?null:{date:r,securityType:a.security_type_desc,security:a.security_desc,rate:o}}).filter(a=>a!==null):[]}async getNationalDebt(t=180){return h0.get(String(t),()=>this.fetchNationalDebt(t))}async fetchNationalDebt(t){const r=Math.max(2,Math.min(t,400)),n=await ae(c0(r),void 0,{proxied:!0});if(!Array.isArray(n==null?void 0:n.data)||n.data.length===0)throw new Error("treasury debt to the penny: unexpected response shape");const a=[];for(let i=n.data.length-1;i>=0;i--){const s=n.data[i],c=Yt(s.tot_pub_debt_out_amt),l=Date.parse(`${s.record_date}T00:00:00Z`);!s.record_date||c===null||!Number.isFinite(l)||a.push({time:l,date:s.record_date,total:c})}if(a.length===0)throw new Error("treasury debt to the penny: no usable rows");const o=n.data[0];return{date:o.record_date??a[a.length-1].date,total:Yt(o.tot_pub_debt_out_amt)??a[a.length-1].total,heldByPublic:Yt(o.debt_held_public_amt)??0,intragovernmental:Yt(o.intragov_hold_amt)??0,trend:a}}async getTreasuryAuctions(t=8){return p0.get(String(t),()=>this.fetchTreasuryAuctions(t))}async fetchTreasuryAuctions(t){const r=Math.max(1,Math.min(t,30)),n=await ae(l0(r),void 0,{proxied:!0});if(!Array.isArray(n==null?void 0:n.data))throw new Error("treasury auctions: unexpected response shape");return n.data.map(a=>{if(!a.auction_date||!a.security_type)return null;const o=Yt(a.high_yield)??Yt(a.high_investment_rate);return{auctionDate:a.auction_date,securityType:a.security_type,securityTerm:a.security_term??"",rate:o,bidToCover:Yt(a.bid_to_cover_ratio),offeringAmount:Yt(a.offering_amt),totalAccepted:Yt(a.total_accepted)}}).filter(a=>a!==null)}}function b0(){return[new _m,new Yp,new ap,new xp,new Pp,new Sp,new op,new Zp,new Xp,new qp,new Vm,new y0,new fp,new i0,new dm,new Jm,new mm,new Fm,new Dm,new nm]}const Ds="(prefers-reduced-motion: reduce)",Rs="(prefers-reduced-data: reduce)",Os="(pointer: coarse) and (max-width: 768px)";function w0(){var t;if(typeof window>"u")return!1;const e=navigator;return!!((t=e.connection)!=null&&t.saveData||window.matchMedia(Rs).matches||(e.deviceMemory??8)<=4||(e.hardwareConcurrency??8)<=4||window.matchMedia(Os).matches)}function Ns(e,t){const r=e.map(n=>window.matchMedia(n));for(const n of r)n.addEventListener("change",t);return()=>{for(const n of r)n.removeEventListener("change",t)}}const Ls=()=>!1,x0=e=>Ns([Rs,Os],e);function k0(){return A.useSyncExternalStore(x0,w0,Ls)}const C0=()=>typeof window<"u"&&window.matchMedia(Ds).matches,_0=e=>Ns([Ds],e);function A0(){return A.useSyncExternalStore(_0,C0,Ls)}const S0=A.lazy(()=>E(()=>import("./scene-uwfOGek1.js"),__vite__mapDeps([0,1]))),z0="/unicornStudio.umd.mjs",oi="invert(1) hue-rotate(180deg) saturate(1.25)",T0="opacity 0.5s var(--zf-ease-out), filter 0.5s var(--zf-ease-out)",E0=e=>Math.min(.42,e*2.4),P0=242,M0=242,D0=(e,t)=>{const r=((e-t)%360+360)%360;return r>180?r-360:r},Is=90,R0=e=>Math.round(e/Is*1e3)/1e3;function O0({background:e,active:t=!1,thinking:r=!1,accentHue:n=P0,accentSat:a=Is,sceneHue:o=M0}){const i=k0();if(e.type==="color"||e.type==="gradient"){const h=e.type==="color"?e.color:`linear-gradient(${e.gradientAngle}deg, ${e.gradientFrom}, ${e.gradientTo})`;return w.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,pointerEvents:"none",background:h}})}if(e.type!=="unicorn"||!e.projectId||i)return null;const s=D0(n,o),c=R0(a),l=[s===0?"":`hue-rotate(${s}deg)`,c===1?"":`saturate(${c})`].filter(Boolean).join(" "),u=l||"none",f=l?`${l} ${oi}`:oi;return w.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:w.jsx("div",{style:{position:"absolute",inset:0,opacity:t?E0(e.opacity):e.opacity,filter:t?f:u,transition:T0,willChange:t||r?"opacity, filter":"auto"},children:w.jsx("div",{className:r?"zf-bg-hue":void 0,style:{position:"absolute",inset:0},children:w.jsx("div",{className:r?"zf-bg-breathe":void 0,style:{position:"absolute",inset:0},children:w.jsx(A.Suspense,{fallback:null,children:w.jsx(S0,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:z0},e.projectId)})})})})})}function N0({currentTitle:e}){const[t,r]=A.useState(null),[n,a]=A.useState(!1),[o,i]=A.useState(null);A.useEffect(()=>{let u=!1;return fetch(Mh,{cache:"no-store"}).then(f=>f.ok?f.json():null).then(f=>{if(u||!f||typeof f!="object")return;const h=f;h.canSwitch===!0&&Array.isArray(h.dashboards)&&r({current:typeof h.current=="string"?h.current:null,dashboards:h.dashboards})}).catch(()=>{}),()=>{u=!0}},[]),A.useEffect(()=>{if(!n)return;const u=f=>{f.key==="Escape"&&a(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[n]);const s=w.jsx("span",{className:"body-sm text-soft",children:e});if(!t||t.dashboards.length<=1)return s;async function c(u){if(!(!t||o)){if(u===t.current){a(!1);return}i(u);try{const f=await fetch(Dh,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u})});if(!f.ok)throw new Error(`HTTP ${f.status}`);window.location.reload()}catch(f){console.error("zframes: failed to switch dashboard",f),window.alert("Couldn't switch dashboard — is `zframes serve` still running?"),i(null)}}}const l="hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%)";return w.jsxs(w.Fragment,{children:[w.jsxs("button",{type:"button",onClick:()=>a(!0),"aria-haspopup":"dialog","aria-expanded":n,className:"body-sm text-soft hover:text-strong flex items-center gap-1 rounded-md border border-white/[0.08] px-1.5 py-0.5 outline-none",children:[e,w.jsx("span",{"aria-hidden":!0,className:"text-[0.7em] opacity-70",children:"▾"})]}),n&&Cc.createPortal(w.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Choose a dashboard",onClick:u=>{u.target===u.currentTarget&&a(!1)},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-6 backdrop-blur-sm",children:w.jsxs("div",{className:"w-full max-w-2xl rounded-2xl border border-white/[0.08] bg-neutral-950/95 p-5 shadow-2xl",children:[w.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[w.jsx("h2",{className:"font-dmsans text-strong text-base font-extrabold",children:"Your dashboards"}),w.jsx("button",{type:"button",onClick:()=>a(!1),"aria-label":"Close",className:"text-soft hover:text-strong rounded-md px-2 py-0.5 text-lg leading-none outline-none",children:"×"})]}),w.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:t.dashboards.map(u=>{const f=u.name===t.current;return w.jsxs("button",{type:"button",disabled:o!==null,onClick:()=>void c(u.name),style:f?{borderColor:`${l} 60%)`}:void 0,className:`flex flex-col items-start gap-1 rounded-xl border p-4 text-left outline-none transition disabled:opacity-50 ${f?"bg-white/[0.04]":"border-white/[0.08] hover:border-white/25 hover:bg-white/[0.03]"}`,children:[w.jsx("span",{className:"font-dmsans text-strong text-sm font-bold",children:u.title??u.name}),w.jsx("span",{className:"caption text-soft font-mono",children:u.name}),w.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5",children:[u.isDefault&&w.jsx("span",{className:"caption text-soft rounded-full border border-white/[0.12] px-1.5 py-0.5 leading-none",children:"default"}),f&&w.jsx("span",{className:"caption text-strong rounded-full px-1.5 py-0.5 leading-none",style:{background:`${l} 30%)`},children:"current"}),o===u.name&&w.jsx("span",{className:"caption text-soft",children:"switching…"})]})]},u.name)})})]})}),document.body)]})}const L0={"portfolio-value":{load:()=>E(()=>import("./portfolio-value-BPURwKf8.js"),__vite__mapDeps([2,1,3,4,5,6,7])).then(e=>e.portfolioValueFrame)},"portfolio-allocation":{load:()=>E(()=>import("./portfolio-allocation-DAnQk_h_.js"),__vite__mapDeps([8,1,4,6,7,9,10])).then(e=>e.portfolioAllocationFrame)},"portfolio-holdings":{load:()=>E(()=>import("./portfolio-holdings-MyAinCzt.js"),__vite__mapDeps([11,1,4,6,7])).then(e=>e.portfolioHoldingsFrame)},"bitcoin-dominance":{load:()=>E(()=>import("./bitcoin-dominance-CweHlZx7.js"),__vite__mapDeps([12,1,4,7])).then(e=>e.bitcoinDominanceFrame)},clock:{load:()=>E(()=>import("./clock-Cjnwi03W.js"),__vite__mapDeps([13,1,7,14])).then(e=>e.clockFrame)},"daily-analysis":{load:()=>E(()=>import("./daily-analysis-DX8bVq85.js"),__vite__mapDeps([15,1,4,7])).then(e=>e.dailyAnalysisFrame)},"journal-log":{load:()=>E(()=>import("./journal-log-Bgjia8cQ.js"),__vite__mapDeps([16,1,17,4,18,7])).then(e=>e.journalLogFrame)},"journal-open":{load:()=>E(()=>import("./journal-open-Bm5gwWXz.js"),__vite__mapDeps([19,1,18,4,20,17,7])).then(e=>e.journalOpenFrame)},"journal-results":{load:()=>E(()=>import("./journal-results-cEWe2pbe.js"),__vite__mapDeps([21,1,18,4,20,17,7])).then(e=>e.journalResultsFrame)},"journal-score":{load:()=>E(()=>import("./journal-score-vmfF-9bK.js"),__vite__mapDeps([22,1,4,18,20,17])).then(e=>e.journalScoreFrame)},"dino-game":{load:()=>E(()=>import("./dino-game-BOV8mV1d.js"),__vite__mapDeps([23,1,24,4])).then(e=>e.dinoGameFrame)},"fear-greed":{load:()=>E(()=>import("./fear-greed-DuDR56h2.js"),__vite__mapDeps([25,1,7,26,10,27])).then(e=>e.fearGreedFrame)},"filings-feed":{load:()=>E(()=>import("./filings-feed-BpfO2yF6.js"),__vite__mapDeps([28,1,29,4,7])).then(e=>e.filingsFeedFrame)},fundamentals:{load:()=>E(()=>import("./fundamentals-CUnqjF--.js"),__vite__mapDeps([30,1,4,7])).then(e=>e.fundamentalsFrame)},"financial-stress":{load:()=>E(()=>import("./financial-stress-BfYJdlry.js"),__vite__mapDeps([31,1,4,7,26,10,27])).then(e=>e.financialStressFrame)},"labor-market":{load:()=>E(()=>import("./labor-market-azDXD-dR.js"),__vite__mapDeps([32,1,4,7,26,10,27])).then(e=>e.laborMarketFrame)},"national-debt":{load:()=>E(()=>import("./national-debt-BKVBHaqm.js"),__vite__mapDeps([33,1,4,7,26,10,27])).then(e=>e.nationalDebtFrame)},"treasury-auctions":{load:()=>E(()=>import("./treasury-auctions-Dl9fiRgf.js"),__vite__mapDeps([34,1,4,35,7])).then(e=>e.treasuryAuctionsFrame)},"funding-heatmap":{load:()=>E(()=>import("./funding-heatmap-CZWnYF8Y.js"),__vite__mapDeps([36,1,4,7,27])).then(e=>e.fundingHeatmapFrame)},"funding-rate-chart":{load:()=>E(()=>import("./funding-rate-chart-C-tpwid_.js"),__vite__mapDeps([37,1,4,7,9,10,38,27,39])).then(e=>e.fundingRateChartFrame)},heading:{load:()=>E(()=>import("./heading-uIVBEE7K.js"),__vite__mapDeps([40,1])).then(e=>e.headingFrame)},image:{load:()=>E(()=>import("./image-CITPAmp0.js"),__vite__mapDeps([41,1,7])).then(e=>e.imageFrame)},"inflation-pulse":{load:()=>E(()=>import("./inflation-pulse-Bqa3-cuC.js"),__vite__mapDeps([42,1,4,7,26,10,27])).then(e=>e.inflationPulseFrame)},"market-hours":{load:()=>E(()=>import("./market-hours-BSwXtU8c.js"),__vite__mapDeps([43,1,44,4,7])).then(e=>e.marketHoursFrame),titleIcon:!0},"news-feed":{load:()=>E(()=>import("./news-feed-C9itZmyp.js"),__vite__mapDeps([45,1,29,4,7])).then(e=>e.newsFeedFrame)},note:{load:()=>E(()=>import("./note-BtCnmuMo.js"),__vite__mapDeps([46,1,7])).then(e=>e.noteFrame)},"price-chart":{load:()=>E(()=>import("./price-chart-BOCD8ka3.js"),__vite__mapDeps([47,1,3,4,5,7])).then(e=>e.priceChartFrame),titleIcon:!0,titleContent:!0},"price-compare":{load:()=>E(()=>import("./price-compare-DZlF-qhZ.js"),__vite__mapDeps([48,1,4,7,9,10,38,27,39])).then(e=>e.priceCompareFrame),titleContent:!0},"price-liveline":{load:()=>E(()=>import("./price-liveline-Bl7qCd5-.js"),__vite__mapDeps([49,1,3,4,5,9,10])).then(e=>e.priceLivelineFrame)},"price-ticker":{load:()=>E(()=>import("./price-ticker-D2W4T02y.js"),__vite__mapDeps([50,1,51,4,7])).then(e=>e.priceTickerFrame)},"rates-board":{load:()=>E(()=>import("./rates-board-Cb9rV0_-.js"),__vite__mapDeps([52,1,4,35,7])).then(e=>e.ratesBoardFrame)},"fx-board":{load:()=>E(()=>import("./fx-board-YAy44m5d.js"),__vite__mapDeps([53,1,4,7,26,10,27])).then(e=>e.fxBoardFrame)},"short-volume":{load:()=>E(()=>import("./short-volume-l8_9Yoh3.js"),__vite__mapDeps([54,1,4,7])).then(e=>e.shortVolumeFrame)},"top-movers":{load:()=>E(()=>import("./top-movers-CLmC2TNu.js"),__vite__mapDeps([55,1,51,4,7])).then(e=>e.topMoversFrame)},"tvl-treemap":{load:()=>E(()=>import("./tvl-treemap-e610jE8k.js"),__vite__mapDeps([56,1,4,57,27,10,7])).then(e=>e.tvlTreemapFrame)},"yield-curve":{load:()=>E(()=>import("./yield-curve-DkB0u2_Q.js"),__vite__mapDeps([58,1,4,7])).then(e=>e.yieldCurveFrame)},"dex-volume-treemap":{load:()=>E(()=>import("./dex-volume-treemap-rSTrzz7O.js"),__vite__mapDeps([59,1,4,57,27,10,7])).then(e=>e.dexVolumeTreemapFrame)},"dex-volume-chart":{load:()=>E(()=>import("./dex-volume-chart-sHIuJACJ.js"),__vite__mapDeps([60,1,4,7,9,10,38,27,39])).then(e=>e.dexVolumeChartFrame)},"protocol-tvl-treemap":{load:()=>E(()=>import("./protocol-tvl-treemap-BjNPrrtL.js"),__vite__mapDeps([61,1,4,57,27,10,7])).then(e=>e.protocolTvlTreemapFrame)},"protocol-tvl-chart":{load:()=>E(()=>import("./protocol-tvl-chart-CmzANiR7.js"),__vite__mapDeps([62,1,4,7,9,10,38,27,39])).then(e=>e.protocolTvlChartFrame)},"protocol-fees-treemap":{load:()=>E(()=>import("./protocol-fees-treemap-DiIt4bfo.js"),__vite__mapDeps([63,1,4,57,27,10,7])).then(e=>e.protocolFeesTreemapFrame)},"market-cap-treemap":{load:()=>E(()=>import("./market-cap-treemap-AxE2EYPO.js"),__vite__mapDeps([64,1,4,57,27,10,7])).then(e=>e.marketCapTreemapFrame)},"open-interest":{load:()=>E(()=>import("./open-interest-C0ulogv6.js"),__vite__mapDeps([65,1,4,7])).then(e=>e.openInterestFrame)},snake:{load:()=>E(()=>import("./snake-CifbTGlZ.js"),__vite__mapDeps([66,1,24,4])).then(e=>e.snakeFrame)},"flappy-bird":{load:()=>E(()=>import("./flappy-bird-Dbb2UQBv.js"),__vite__mapDeps([67,1,24,4])).then(e=>e.flappyBirdFrame)},video:{load:()=>E(()=>import("./video-CeKjM-cE.js"),__vite__mapDeps([68,1,7])).then(e=>e.videoFrame)},drawdy:{load:()=>E(()=>import("./drawdy-BIb36JN9.js"),__vite__mapDeps([69,1,7])).then(e=>e.drawdyFrame)},countdown:{load:()=>E(()=>import("./countdown-Cdi5gSSu.js"),__vite__mapDeps([70,1,7,14])).then(e=>e.countdownFrame)},"link-grid":{load:()=>E(()=>import("./link-grid-BEo4b54T.js"),__vite__mapDeps([71,1,17,7])).then(e=>e.linkGridFrame)},calculator:{load:()=>E(()=>import("./calculator-mvv6XpQC.js"),__vite__mapDeps([72,1,17,7])).then(e=>e.calculatorFrame)},quote:{load:()=>E(()=>import("./quote-CRM3bfI7.js"),__vite__mapDeps([73,1])).then(e=>e.quoteFrame)},divider:{load:()=>E(()=>import("./divider-C33tH1RU.js"),__vite__mapDeps([74,1])).then(e=>e.dividerFrame)},marquee:{load:()=>E(()=>import("./marquee-1Zr5qDJP.js"),__vite__mapDeps([75,1])).then(e=>e.marqueeFrame)},dice:{load:()=>E(()=>import("./dice-BrFORdjN.js"),__vite__mapDeps([76,1,17,7])).then(e=>e.diceFrame)},"risk-reward":{load:()=>E(()=>import("./risk-reward-C7WMz2od.js"),__vite__mapDeps([77,1,17,4,7])).then(e=>e.riskRewardFrame)},stopwatch:{load:()=>E(()=>import("./stopwatch-Co72v-7u.js"),__vite__mapDeps([78,1,17])).then(e=>e.stopwatchFrame)},"session-progress":{load:()=>E(()=>import("./session-progress-CZO3LqUi.js"),__vite__mapDeps([79,1,44,7])).then(e=>e.sessionProgressFrame)},"btc-fees":{load:()=>E(()=>import("./btc-fees-BmADLsmK.js"),__vite__mapDeps([80,1,81,4,7])).then(e=>e.btcFeesFrame)},"btc-mempool":{load:()=>E(()=>import("./btc-mempool-CTwbkMUR.js"),__vite__mapDeps([82,1,81,4,7])).then(e=>e.btcMempoolFrame)},"btc-blocks":{load:()=>E(()=>import("./btc-blocks-Do_nySHd.js"),__vite__mapDeps([83,1,4,7])).then(e=>e.btcBlocksFrame)},"btc-hashrate":{load:()=>E(()=>import("./btc-hashrate-Wx2RAG-5.js"),__vite__mapDeps([84,1,4,7,26,10,27])).then(e=>e.btcHashrateFrame)},"btc-difficulty":{load:()=>E(()=>import("./btc-difficulty-vNbz5uRo.js"),__vite__mapDeps([85,1,4,7])).then(e=>e.btcDifficultyFrame)},"mining-pools":{load:()=>E(()=>import("./mining-pools-B-jxdTot.js"),__vite__mapDeps([86,1,4,57,27,10,7])).then(e=>e.miningPoolsFrame)},"lightning-stats":{load:()=>E(()=>import("./lightning-stats-nkyh2dOX.js"),__vite__mapDeps([87,1,4,7])).then(e=>e.lightningStatsFrame)},"options-put-call":{load:()=>E(()=>import("./options-put-call-FuaDHJ-S.js"),__vite__mapDeps([88,1,4,7])).then(e=>e.optionsPutCallFrame)},"options-iv":{load:()=>E(()=>import("./options-iv-CdUder3x.js"),__vite__mapDeps([89,1,4,7,26,10,27])).then(e=>e.optionsIvFrame)},"options-oi-strike":{load:()=>E(()=>import("./options-oi-strike-CvCZnMCR.js"),__vite__mapDeps([90,1,4,7])).then(e=>e.optionsOiStrikeFrame)},"coin-movers":{load:()=>E(()=>import("./coin-movers-Bcx1XR0F.js"),__vite__mapDeps([91,1,51,4,7])).then(e=>e.coinMoversFrame)},mvrv:{load:()=>E(()=>import("./mvrv-Dx_S0TwE.js"),__vite__mapDeps([92,1,93,94,26,10,27,4,7])).then(e=>e.mvrvFrame)},nupl:{load:()=>E(()=>import("./nupl-aIjkc57m.js"),__vite__mapDeps([95,1,93,94,26,10,27,4,7])).then(e=>e.nuplFrame)},sopr:{load:()=>E(()=>import("./sopr-Dw_oz-mC.js"),__vite__mapDeps([96,1,93,94,26,10,27,4,7])).then(e=>e.soprFrame)},"puell-multiple":{load:()=>E(()=>import("./puell-multiple-BGrJX43r.js"),__vite__mapDeps([97,1,93,94,26,10,27,4,7])).then(e=>e.puellMultipleFrame)},"mayer-multiple":{load:()=>E(()=>import("./mayer-multiple-DpBJNd4d.js"),__vite__mapDeps([98,1,93,94,26,10,27,4,7])).then(e=>e.mayerMultipleFrame)},"pi-cycle":{load:()=>E(()=>import("./pi-cycle-BuCnLnIJ.js"),__vite__mapDeps([99,1,93,94,26,10,27,4,7])).then(e=>e.piCycleFrame)},"ma-multiplier":{load:()=>E(()=>import("./ma-multiplier-BllDQMF5.js"),__vite__mapDeps([100,1,93,94,26,10,27,4,7])).then(e=>e.maMultiplierFrame)},"rsi-momentum":{load:()=>E(()=>import("./rsi-momentum-IglnulkJ.js"),__vite__mapDeps([101,1,93,94,26,10,27,4,7])).then(e=>e.rsiMomentumFrame)},"volume-profile":{load:()=>E(()=>import("./volume-profile-CiMFsIBu.js"),__vite__mapDeps([102,1,4,7])).then(e=>e.volumeProfileFrame)},dxy:{load:()=>E(()=>import("./dxy-CRifEdp_.js"),__vite__mapDeps([103,1,93,94,26,10,27,4,7])).then(e=>e.dxyFrame)},"cycle-signals":{load:()=>E(()=>import("./cycle-signals-CS629ZDc.js"),__vite__mapDeps([104,1,4,93,94,26,10,27,35,7])).then(e=>e.cycleSignalsFrame)},"stablecoin-supply":{load:()=>E(()=>import("./stablecoin-supply-DM4ogL4V.js"),__vite__mapDeps([105,1,93,94,26,10,27,4,7])).then(e=>e.stablecoinSupplyFrame)},"yield-scanner":{load:()=>E(()=>import("./yield-scanner-BP90untT.js"),__vite__mapDeps([106,1,4,35,7])).then(e=>e.yieldScannerFrame)},"defi-revenue":{load:()=>E(()=>import("./defi-revenue-CpeAGwhb.js"),__vite__mapDeps([107,1,93,94,26,10,27,4,7])).then(e=>e.defiRevenueFrame)},"funding-comparison":{load:()=>E(()=>import("./funding-comparison-CMKxW1n-.js"),__vite__mapDeps([108,1,4,35,7])).then(e=>e.fundingComparisonFrame)},"eth-supply":{load:()=>E(()=>import("./eth-supply-CF-MgHjn.js"),__vite__mapDeps([109,1,93,94,26,10,27,4,7])).then(e=>e.ethSupplyFrame)},"eth-staking":{load:()=>E(()=>import("./eth-staking-BqWeJq6F.js"),__vite__mapDeps([110,1,93,94,26,10,27,4,7])).then(e=>e.ethStakingFrame)},"prediction-markets":{load:()=>E(()=>import("./prediction-markets-Bzy51qnV.js"),__vite__mapDeps([111,1,4,35,7])).then(e=>e.predictionMarketsFrame)},"etf-flows":{load:()=>E(()=>import("./etf-flows-BV10E2R-.js"),__vite__mapDeps([112,1,4,35,7])).then(e=>e.etfFlowsFrame)},"trending-coins":{load:()=>E(()=>import("./trending-coins-Cpx9T6cG.js"),__vite__mapDeps([113,1,4,35,7])).then(e=>e.trendingCoinsFrame)},"sector-performance":{load:()=>E(()=>import("./sector-performance-DVMaleLY.js"),__vite__mapDeps([114,1,4,35,7])).then(e=>e.sectorPerformanceFrame)},"macro-calendar":{load:()=>E(()=>import("./macro-calendar-Ck0dJk4p.js"),__vite__mapDeps([115,1,35,7])).then(e=>e.macroCalendarFrame)},"stablecoin-chains":{load:()=>E(()=>import("./stablecoin-chains-Dd2LqqqY.js"),__vite__mapDeps([116,1,4,57,27,10,7])).then(e=>e.stablecoinChainsFrame)},"sector-treemap":{load:()=>E(()=>import("./sector-treemap-B681nSi6.js"),__vite__mapDeps([117,1,4,57,27,10,7])).then(e=>e.sectorTreemapFrame)},"etf-flows-chart":{load:()=>E(()=>import("./etf-flows-chart-DHu8mkXm.js"),__vite__mapDeps([118,1,4,7,9,10,38,27,39])).then(e=>e.etfFlowsChartFrame)},"realized-price":{load:()=>E(()=>import("./realized-price-CYlrFa0m.js"),__vite__mapDeps([119,1,4,94,7,9,10,38,27,39])).then(e=>e.realizedPriceFrame)},"reserve-risk":{load:()=>E(()=>import("./reserve-risk-Be98XUsD.js"),__vite__mapDeps([120,1,93,94,26,10,27,4,7])).then(e=>e.reserveRiskFrame)},"holiday-calendar":{load:()=>E(()=>import("./holiday-calendar-DCj83hi2.js"),__vite__mapDeps([121,1,44,35,7])).then(e=>e.holidayCalendarFrame)},"day-meter":{load:()=>E(()=>import("./day-meter-DDfTuhms.js"),__vite__mapDeps([122,1,44,7])).then(e=>e.dayMeterFrame)},"returns-projector":{load:()=>E(()=>import("./returns-projector-D67a_yvC.js"),__vite__mapDeps([123,1,17,4,26,10,27])).then(e=>e.returnsProjectorFrame)},breakeven:{load:()=>E(()=>import("./breakeven-CG9rKwgE.js"),__vite__mapDeps([124,1,17,4,7])).then(e=>e.breakevenFrame)},checklist:{load:()=>E(()=>import("./checklist-CuEw3GpE.js"),__vite__mapDeps([125,1,7])).then(e=>e.checklistFrame)},pomodoro:{load:()=>E(()=>import("./pomodoro-DDBVVcSR.js"),__vite__mapDeps([126,1,17])).then(e=>e.pomodoroFrame)},"rules-card":{load:()=>E(()=>import("./rules-card-DJs3fDVN.js"),__vite__mapDeps([127,1,7])).then(e=>e.rulesCardFrame)},breathing:{load:()=>E(()=>import("./breathing-cDundHq6.js"),__vite__mapDeps([128,1])).then(e=>e.breathingFrame)},"spotify-embed":{load:()=>E(()=>import("./spotify-embed-BA0m1IRb.js"),__vite__mapDeps([129,1,7])).then(e=>e.spotifyEmbedFrame)}},M=e=>`/widget-icons/${e}.png`,G={hyperliquid:{name:"Hyperliquid",url:"https://hyperliquid.xyz"},defillama:{name:"DeFiLlama",url:"https://defillama.com"},coingecko:{name:"CoinGecko",url:"https://www.coingecko.com"},alternativeMe:{name:"alternative.me",url:"https://alternative.me/crypto/fear-and-greed-index/"},bls:{name:"BLS",url:"https://www.bls.gov"},nyFed:{name:"NY Fed",url:"https://www.newyorkfed.org/markets/reference-rates"},treasury:{name:"U.S. Treasury",url:"https://fiscaldata.treasury.gov"},secEdgar:{name:"SEC EDGAR",url:"https://www.sec.gov/edgar"},finra:{name:"FINRA",url:"https://www.finra.org/finra-data/browse-catalog/short-sale-volume-data"},ofr:{name:"OFR",url:"https://www.financialresearch.gov/financial-stress-index/"},mempool:{name:"mempool.space",url:"https://mempool.space"},deribit:{name:"Deribit",url:"https://www.deribit.com"},coinpaprika:{name:"Coinpaprika",url:"https://coinpaprika.com"},frankfurter:{name:"Frankfurter (ECB)",url:"https://frankfurter.dev"},coinMetrics:{name:"Coin Metrics",url:"https://coinmetrics.io"},bitcoinData:{name:"bitcoin-data.com",url:"https://bitcoin-data.com"},ultrasound:{name:"ultrasound.money",url:"https://ultrasound.money"},polymarket:{name:"Polymarket",url:"https://polymarket.com"},sosovalue:{name:"SoSoValue",url:"https://sosovalue.com"}},I0={name:"clock",label:"Clock",category:"tools",iconUrl:M("clock"),layout:{w:3,h:2,minW:2,minH:1},description:"Digital clock showing the current time, ticking every second. Configurable IANA timezone (defaults to the viewer's local zone), 12/24-hour format, optional seconds and date, the timezone abbreviation, and a caption label. Drop several with different timezones for a trading-desk world clock. Needs no data provider.",capabilities:[],schema:_({timezone:W().default("").describe(`IANA timezone, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", "UTC". Empty = the viewer's local timezone.`),label:W().default("").describe('Caption under the time, e.g. "New York" or "Local". Empty hides it.'),hour12:nt().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:nt().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:nt().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:nt().default(!1).describe("Show the weekday and date under the time."),showTimezone:nt().default(!0).describe('Show the timezone abbreviation (e.g. "EST", "GMT+7", "UTC") in the caption. Combines with the label when set, e.g. "New York · EST".')})},F0={name:"market-hours",label:"Market Hours",category:"tools",iconUrl:M("market-hours"),layout:{w:4,h:4,minW:3,minH:3},description:"Which world stock exchanges are open right now — each row shows an open / closed / holiday status dot and a live countdown to the next open or close. Computed entirely client-side from each exchange's timezone and regular trading hours (no API); a bundled 2026 holiday list keeps the major Western exchanges accurate on market holidays. Intraday lunch breaks and half-day early closes are not modelled. Needs no data provider.",capabilities:[],schema:_({exchanges:Ge(W()).default([]).describe('Exchange codes to show, e.g. ["NYSE","LSE","TSE","HKEX","SET"]. Empty = a global default set. Known codes: NYSE, NASDAQ, TSX, B3, LSE, XETRA, EURONEXT, SIX, TSE, HKEX, SSE, NSE, KRX, SGX, SET, ASX, JSE, TADAWUL.'),sort:re(["region","status","name"]).default("region").describe("Order rows by world region (Americas → Europe → Asia-Pacific → Middle East/Africa), by status (open first), or alphabetically by name.")})},U0={name:"fear-greed",label:"Fear & Greed",category:"sentiment",iconUrl:M("fear-greed"),layout:{w:3,h:3,minW:2,minH:2},description:"Crypto Fear & Greed index (0 = extreme fear, 100 = extreme greed) with a recent-history sparkline. A one-number market mood gauge from alternative.me.",capabilities:["sentiment"],source:G.alternativeMe,schema:_({sparklineDays:O().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},j0={name:"funding-rate-chart",label:"Funding Rate Chart",category:"derivatives",iconUrl:M("funding-rate-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart comparing hourly perp funding rates across symbols over a configurable lookback window. Positive funding = longs pay shorts. Useful for spotting crowded trades.",capabilities:["funding-history"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:re(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},H0={name:"note",label:"Note",category:"layout",iconUrl:M("note"),layout:{w:4,h:3,minW:2,minH:2},description:"Free-form text note pinned to the dashboard — trading plans, reminders, watch levels. Needs no data provider.",capabilities:[],schema:_({text:W().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:re(["left","center"]).default("left").describe("Text alignment inside the card.")})},B0={name:"price-chart",label:"Price Chart",category:"markets",iconUrl:M("price-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Live animated price chart (candlestick or line) for one symbol — canvas-rendered at 60fps via liveline, streaming live off the Hyperliquid WebSocket. Works for any HIP-3 perp — stocks (xyz:TSLA), indices (xyz:SP500), commodities (xyz:GOLD) — and crypto (BTC). The centerpiece frame.",capabilities:["ohlcv","quote-stream"],source:G.hyperliquid,schema:_({symbol:W().min(1).describe('Hyperliquid symbol to chart. HIP-3 cross-asset: stocks "xyz:TSLA"/"xyz:NVDA", indices "xyz:SP500"/"xyz:XYZ100", commodities "xyz:GOLD"/"xyz:CL", FX "xyz:EUR". Crypto: "BTC", "ETH".'),interval:re(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:re(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:W().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},V0={name:"price-liveline",label:"Price Liveline",category:"markets",iconUrl:M("price-liveline"),layout:{w:6,h:3,minW:4,minH:2},description:"Multi-asset live price liveline — several Hyperliquid symbols streaming in one canvas chart. Defaults to normalized % movement so stocks and crypto can share one axis, while the legend still shows each asset's live raw price. Use when the dashboard needs one compact live race view instead of several single-symbol charts.",capabilities:["quote-stream","day-stats"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(2).max(8).describe('Hyperliquid symbols to stream together — great cross-asset (the normalized view races a stock vs the index vs gold vs crude), e.g. ["xyz:NVDA", "xyz:SP500", "xyz:GOLD", "xyz:CL"], or all-equity ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"], or crypto ["BTC", "ETH", "SOL"]. 2 to 8.'),windowSec:O().int().min(10).max(300).default(30).describe("Rolling live window in seconds. 30 mirrors the zhive liveline view; use 60–300 for slower dashboards."),normalize:nt().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},W0={name:"price-ticker",label:"Price Ticker",category:"markets",iconUrl:M("price-ticker"),layout:{w:3,h:3,minW:2,minH:2},description:"Live watchlist streaming mid prices over the Hyperliquid WebSocket with 24h change per symbol. The bread-and-butter frame for any dashboard.",capabilities:["quote-stream","day-stats"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(1).describe('Hyperliquid symbols to track — mix asset classes, e.g. ["xyz:NVDA", "xyz:SP500", "xyz:GOLD", "xyz:EUR"] or all-equity ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"]. Crypto works too: "BTC", "ETH".')})},G0={name:"top-movers",label:"Top Movers",category:"markets",iconUrl:M("top-movers"),layout:{w:5,h:3,minW:3,minH:3},description:"Today's biggest stock and commodity HIP-3 gainers and losers (no bare crypto), side by side with current price and 24h change.",capabilities:["day-stats"],source:G.hyperliquid,schema:_({count:O().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},Y0={name:"tvl-treemap",label:"TVL Treemap",category:"crypto",iconUrl:M("tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of total value locked (TVL) across the largest blockchain ecosystems, sized by TVL. Data from DeFiLlama. Good single-glance answer to 'where does on-chain capital live right now'.",capabilities:["tvl"],source:G.defillama,schema:_({topN:O().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},K0={name:"bitcoin-dominance",label:"Bitcoin Dominance",category:"crypto",iconUrl:M("bitcoin-dominance"),layout:{w:4,h:2,minW:3,minH:2},description:"BTC / ETH / Others market-cap dominance as a segmented bar, with optional total marketcap line. Shifts in BTC dominance hint at where the market rotates next.",capabilities:["global-market"],source:G.coingecko,schema:_({showTotalMarketCap:nt().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},q0={name:"rates-board",label:"Rates Board",category:"macro",iconUrl:M("rates-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Official US rates board from free public APIs: New York Fed reference rates (SOFR, effective fed funds, repo rates) plus Treasury average interest rates by security class. Daily/reference data, not a real-time stock quote feed.",capabilities:["reference-rates","treasury-rates"],source:[G.nyFed,G.treasury],schema:_({maxReferenceRates:O().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:nt().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:O().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},J0={name:"fx-board",label:"FX Board",category:"macro",iconUrl:M("fx-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Foreign-exchange board from the ECB's free daily reference rates (via Frankfurter, no key): each currency's latest rate vs a base, its day-over-day change, and a short trend sparkline. Daily reference data with broader currency coverage than the handful of FX perps — not a live intraday quote feed.",capabilities:["fx-rates"],source:G.frankfurter,schema:_({base:W().length(3).default("USD").describe('Base currency (ISO 4217 code) each rate is quoted against, e.g. "USD". One unit of the base buys the shown amount of each listed currency.'),symbols:Ge(W().length(3)).min(1).max(12).default(["EUR","GBP","JPY","CHF","CAD","AUD"]).describe('Currencies to show (ISO 4217 codes), e.g. ["EUR","GBP","JPY"]. The ECB publishes ~30; a code equal to the base is skipped.'),showSparkline:nt().default(!0).describe("Show a small ~30-day trend sparkline next to each rate.")})},X0={name:"inflation-pulse",label:"Inflation Pulse",category:"macro",iconUrl:M("inflation-pulse"),layout:{w:4,h:3,minW:3,minH:2},description:"BLS CPI pulse from the public no-key API: latest CPI-U all-items index with month-over-month and year-over-year changes plus a small trend sparkline. Monthly macro context for stock dashboards; not a live price feed.",capabilities:["macro-series"],source:G.bls,schema:_({months:O().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},Z0={name:"financial-stress",label:"Financial Stress",category:"macro",iconUrl:M("financial-stress"),layout:{w:4,h:3,minW:3,minH:2},description:"The OFR Financial Stress Index — a daily, market-based gauge of systemic financial stress from the U.S. Office of Financial Research. One headline value where 0 is the long-run average (positive = elevated stress, negative = calmer than normal), an optional breakdown of the five contributing categories (credit, equity valuation, safe assets, funding, volatility), and a trend line. Keyless official data, updated each business day; needs the zframes runtime's data proxy (ships with `zframes serve` / `vite dev`). Not a price feed.",capabilities:["financial-stress"],source:G.ofr,schema:_({trendDays:O().int().min(20).max(90).default(60).describe("How many recent daily readings to plot in the trend line."),showCategories:nt().default(!0).describe("Show the five category contributions (credit, equity valuation, safe assets, funding, volatility) under the headline.")})},$0={name:"national-debt",label:"National Debt",category:"macro",iconUrl:M("national-debt"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. total public debt outstanding from the Treasury's keyless 'Debt to the Penny' dataset — the headline total in trillions, the change over the chosen window, an optional split into debt held by the public vs intragovernmental holdings, and a trend line. Official data updated each business day; CORS-safe (no proxy needed). Macro context, not a live price feed.",capabilities:["national-debt"],source:G.treasury,schema:_({trendDays:O().int().min(30).max(365).default(180).describe("How many business days of history to load for the trend and the change figure."),showSplit:nt().default(!0).describe("Show the debt-held-by-the-public vs intragovernmental-holdings split.")})},Q0={name:"labor-market",label:"Labor Market",category:"macro",iconUrl:M("labor-market"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. labor-market snapshot from the BLS keyless public API: the headline unemployment rate, the latest monthly change in nonfarm payrolls (jobs added or lost), the total payroll level, and an unemployment-rate trend line. Monthly macro context for stock dashboards; updates on the BLS jobs-report schedule, not a live feed.",capabilities:["macro-series"],source:G.bls,schema:_({months:O().int().min(13).max(36).default(18).describe("How many monthly observations to show in the trend.")})},eg={name:"treasury-auctions",label:"Treasury Auctions",category:"macro",iconUrl:M("treasury-auctions"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent completed U.S. Treasury auctions from the keyless Fiscal Data API — each row shows the security (bill/note/bond + term), the high awarded yield, and the bid-to-cover ratio (demand: total bids ÷ amount accepted; higher = stronger). Newest first. Official market-plumbing data, CORS-safe; updates as auctions settle, not a live price feed.",capabilities:["treasury-auctions"],source:G.treasury,schema:_({count:O().int().min(3).max(20).default(8).describe("How many recent auctions to list (newest first).")})},tg={name:"filings-feed",label:"Filings Feed",category:"equities",iconUrl:M("filings-feed"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent SEC EDGAR filings for one US-listed company — each row shows the form type (10-K, 10-Q, 8-K, Form 4…), a plain-English label, the filing date, and a click-through to the document on sec.gov, under a header with the company name, exchange, and filer category. Official data from SEC's free, CORS-safe submissions endpoint; event-driven (updates when the company files), not a price feed. Resolve by ticker (a bundled snapshot of the ~500 largest US issuers) or by raw SEC CIK for anything else.",capabilities:["filings"],source:G.secEdgar,schema:_({symbol:W().min(1).describe('Company to show filings for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:TSLA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.'),forms:re(["important","all","insider"]).default("important").describe('Which filings to surface: "important" = periodic & material reports (10-K, 10-Q, 8-K, S-1, proxies, 13D/G…); "insider" = ownership forms (3/4/5/144); "all" = unfiltered. Always newest first.'),count:O().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},rg={name:"yield-curve",label:"Yield Curve",category:"macro",iconUrl:M("yield-curve"),layout:{w:4,h:3,minW:3,minH:3},description:"The U.S. Treasury daily par yield curve — a line from 1-month to 30-year yields, the headline 2s10s spread (10Y minus 2Y; negative = inverted, the classic recession signal), and a configurable row of key maturities. Keyless official data from the U.S. Treasury, updated each business day; not a live intraday feed.",capabilities:["yield-curve"],source:G.treasury,schema:_({maturities:Ge(re(["1M","2M","3M","4M","6M","1Y","2Y","3Y","5Y","7Y","10Y","20Y","30Y"])).min(2).max(8).default(["3M","2Y","5Y","10Y","30Y"]).describe("Maturities to show as labelled cells under the curve (the full curve line always shows every maturity).")})},ng={name:"fundamentals",label:"Fundamentals",category:"equities",iconUrl:M("fundamentals"),layout:{w:4,h:4,minW:3,minH:3},description:"Headline financials for one US-listed company from SEC EDGAR XBRL company facts — revenue, net income, total assets, shareholders' equity, diluted EPS, and shares outstanding, each labelled with its fiscal period. Income-statement figures are the latest full fiscal year; balance-sheet figures are the latest reported quarter. Keyless official data that updates only when the company files (annual/quarterly), not a live feed. Requires the zframes runtime's data proxy (it ships with `zframes serve` / `vite dev`); resolve by ticker (bundled top-500 map) or raw SEC CIK.",capabilities:["fundamentals"],source:G.secEdgar,schema:_({symbol:W().min(1).describe('Company to show financials for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:NVDA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.')})},ag={name:"short-volume",label:"Short Volume",category:"equities",iconUrl:M("short-volume"),layout:{w:5,h:4,minW:3,minH:3},description:"Daily reported short-sale volume for a watchlist of US-listed stocks, from FINRA's free consolidated file — each row shows the % of the day's reported volume that was sold short, with a bar and the raw short/total share counts. IMPORTANT: this is reported short volume (sell-side short flow, which includes market-maker hedging), NOT short interest (outstanding short positions), and is not a directional signal on its own. Daily data published the next business day; not a live feed. US equities only.",capabilities:["short-volume"],source:G.finra,schema:_({symbols:Ge(W()).min(1).max(12).describe('US-listed stock tickers to show, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Crypto has no SEC/FINRA short-volume and is ignored.'),sort:re(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},og={name:"funding-heatmap",label:"Funding Heatmap",category:"derivatives",iconUrl:M("funding-heatmap"),layout:{w:6,h:3,minW:4,minH:3},description:"Heatmap of perp funding rates — symbols as rows, daily average over the last 7 days as columns, green positive / red negative. Spots persistent funding regimes at a glance.",capabilities:["funding-history"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(2).max(8).describe('Hyperliquid symbols as heatmap rows — at least 2, since the heatmap compares funding across symbols, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"].')})},ig={name:"dino-game",label:"Dino Game",category:"games",iconUrl:M("dino-game"),layout:{w:4,h:3,minW:3,minH:3},description:"Chrome-dino style runner game on canvas — jump cacti with SPACE or tap. High score persists locally. For when the market is boring. Needs no data provider.",capabilities:[],schema:_({})},sg={name:"image",label:"Image",category:"layout",iconUrl:M("image"),layout:{w:3,h:3,minW:1,minH:1},description:"Displays an image from a URL — logos, memes, chart screenshots, banners. Needs no data provider.",capabilities:[],schema:_({url:W().min(1).describe("Image URL (https)."),alt:W().default("").describe("Alt text for accessibility."),fit:re(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},cg={name:"heading",label:"Heading",category:"layout",iconUrl:M("heading"),layout:{w:12,h:1,minW:2,minH:1,maxH:1},description:"Section divider that titles a region of the dashboard ('Markets', 'On-chain', 'Desk'). Renders as a label with a hairline rule — no card. Use to group frames into zones: place full-width (w: 12) and 1 row tall (h: 1) above each group. Needs no data provider.",capabilities:[],chrome:"bare",schema:_({title:W().min(1).describe("The heading text."),subtitle:W().optional().describe("Smaller supporting line under the title.")})},lg={name:"daily-analysis",label:"Daily Analysis",category:"tools",iconUrl:M("daily-analysis"),layout:{w:6,h:3,minW:3,minH:2},description:"Daily market brief written by the /zframes-brief loop — a dated analysis of the symbols on your dashboard, the calls it is making today, and how yesterday's calls scored (with a running hit-rate). Reads a local log file the loop appends to; needs no market data provider. Add one per dashboard.",capabilities:[],schema:_({src:W().default("/daily-analysis.json").describe("URL of the analysis log the loop writes, served from the app's public/ dir. Leave as the default unless you renamed the file."),entries:O().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:O().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},ug={name:"journal-log",label:"Journal · Log",category:"journal",iconUrl:M("journal-log"),layout:{w:4,h:5,minW:3,minH:4},source:G.hyperliquid,description:"Log a market read in seconds: pick a supported ticker (with its live Hyperliquid price), Long or Short, the reason (a quick pick + optional note), and how sure you are (a slider). That's it — a falsifiable call, captured at the live price, that the Open/Results frames then track and grade. The simple front door to your decision journal; pairs with the zAI orb for conversational capture. Add one alongside Journal · Open and Journal · Results.",capabilities:["quote-stream","day-stats"],schema:_({})},dg={name:"journal-open",label:"Journal · Open",category:"journal",iconUrl:M("journal-open"),layout:{w:4,h:4,minW:3,minH:3},description:"Your open calls from the decision journal, each marking to the live Hyperliquid price — direction, confidence, unrealized % return, a live entry→target track, and a countdown. Calls auto-grade at their horizon (or close one early). The 'watch it play out' frame. Reads the journal you write with Journal · Log.",source:G.hyperliquid,capabilities:["quote-stream"],schema:_({max:O().int().min(1).max(20).default(8).describe("How many open calls to show (newest first).")})},fg={name:"journal-results",label:"Journal · Results",category:"journal",iconUrl:M("journal-results"),layout:{w:4,h:4,minW:3,minH:3},description:"Your resolved calls from the decision journal, graded on TWO axes: did it hit, AND did the thesis actually play out — so a lucky hit reads differently from earned skill, and a near-miss from a clean miss. The reflection frame. Reads the journal you write with Journal · Log.",capabilities:[],schema:_({max:O().int().min(1).max(20).default(8).describe("How many resolved calls to show (newest first).")})},hg={name:"journal-score",label:"Journal · Scoreboard",category:"journal",iconUrl:M("journal-score"),layout:{w:4,h:3,minW:3,minH:3},description:"The decision-journal scoreboard — a story, not a spreadsheet: where your judgment has an edge, where it leaks, and how calibrated your confidence is, plus a one-line read from zAI. Aggregates the calls logged via Journal · Log.",capabilities:[],schema:_({})},pg={name:"price-compare",label:"Price Compare",category:"markets",iconUrl:M("price-compare"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart overlaying the price history of several symbols over a lookback window — see how TSLA, NVDA and BTC moved against each other. Normalized by default to % change from the window start so symbols at very different price levels (BTC vs a $20 stock) stay comparable on one axis. Candles from Hyperliquid.",capabilities:["ohlcv"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:re(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:nt().default(!0).describe("Rebase each series to % change from the window start (recommended — lets symbols at different price levels share one axis). Off = raw price, only sensible when comparing similarly-priced symbols.")})},Ba={source:re(["binance","wallet"]).default("binance").describe('Where the holdings come from: "binance" (a connected Binance account — a read-only API key is entered in-app and stored locally, never in this file) or "wallet" (a public on-chain address, keyless).'),address:W().default("").describe('For source "wallet": the public Ethereum address (0x…) or ENS name to track. Public on-chain data, no keys. Ignored for "binance".')},mg={name:"portfolio-value",label:"Portfolio Value",category:"portfolio",iconUrl:M("portfolio-value"),layout:{w:5,h:4,minW:3,minH:3},description:"Your connected portfolio's total USD value as a live equity line, ticking with the market. Source is a connected Binance account (read-only key, entered in-app) or a public on-chain wallet address. Shows total value + session change. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:_({...Ba,windowSec:O().int().positive().default(300).describe("Seconds of live history the equity line shows; it accumulates from when the dashboard opens.")})},gg={name:"portfolio-allocation",label:"Portfolio Allocation",category:"portfolio",iconUrl:M("portfolio-allocation"),layout:{w:4,h:4,minW:3,minH:3},description:"Donut of your connected portfolio's allocation — each slice sized by live USD value, total in the center. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:_({...Ba})},vg={name:"portfolio-holdings",label:"Portfolio Holdings",category:"portfolio",iconUrl:M("portfolio-holdings"),layout:{w:4,h:4,minW:3,minH:3},description:"Table of your connected portfolio's positions — asset, amount, live USD value, share of total, 24h change. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:_({...Ba})},yg={name:"news-feed",label:"News Feed",category:"sentiment",iconUrl:M("news-feed"),layout:{w:4,h:4,minW:3,minH:3},description:'Scrolling feed of the latest news headlines from a chosen outlet — each row is a clickable headline with its publish time, newest first. Free, keyless RSS sources: crypto press (CoinDesk, Cointelegraph, Decrypt), broad markets/macro (CNBC, Nasdaq), or — source "stocks" — per-company headlines (via Google News) scoped to the specific tickers in `symbols`. IMPORTANT: news feeds are CORS-blocked, so this frame reads them through the zframes runtime\'s data proxy (it ships with `zframes serve` / `vite dev`); on a fully static host with no runtime it shows an empty state.',capabilities:["news"],schema:_({source:re(["coindesk","cointelegraph","decrypt","cnbc","nasdaq","stocks"]).default("coindesk").describe('Which feed to show. Crypto press: "coindesk", "cointelegraph", "decrypt". Markets/macro: "cnbc", "nasdaq". "stocks" = per-company headlines (Google News) for the tickers in `symbols`.'),symbols:Ge(W()).default([]).describe('Only used when source is "stocks": stock tickers to pull headlines for, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Ignored for the other sources.'),count:O().int().min(3).max(20).default(8).describe("How many headlines to list (newest first).")})},bg={name:"dex-volume-treemap",label:"DEX Volume Treemap",category:"crypto",iconUrl:M("dex-volume-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of decentralized-exchange (DEX) protocols sized by trailing-24h trading volume, tiles colored green/red by 1-day change. Data from DeFiLlama. One-glance read on where on-chain trading flow is concentrated right now.",capabilities:["dex-volume"],source:G.defillama,schema:_({topN:O().int().min(3).max(30).default(12).describe("How many of the highest-volume DEX protocols to show.")})},wg={name:"dex-volume-chart",label:"DEX Volume Chart",category:"crypto",iconUrl:M("dex-volume-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of daily DEX trading volume for several protocols over a lookback window — compare how Uniswap, PancakeSwap, Aerodrome etc. trend against each other. Data from DeFiLlama (daily granularity).",capabilities:["dex-volume"],source:G.defillama,schema:_({protocols:Ge(W()).min(1).max(6).describe('DeFiLlama DEX protocol slugs (lowercase, hyphenated), e.g. ["uniswap", "pancakeswap", "aerodrome-slipstream"]. 1 to 6.'),lookback:re(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},xg={name:"protocol-tvl-treemap",label:"Protocol TVL Treemap",category:"crypto",iconUrl:M("protocol-tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of DeFi protocols sized by current total value locked (TVL), tiles colored green/red by 1-day change. Data from DeFiLlama. Unlike tvl-treemap (which groups by blockchain), this ranks individual protocols (Lido, Aave, EigenLayer…).",capabilities:["protocol-tvl"],source:G.defillama,schema:_({topN:O().int().min(3).max(30).default(12).describe("How many of the largest protocols by TVL to show.")})},kg={name:"protocol-tvl-chart",label:"Protocol TVL Chart",category:"crypto",iconUrl:M("protocol-tvl-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of total value locked (TVL) for several DeFi protocols over a lookback window. Data from DeFiLlama (daily granularity).",capabilities:["protocol-tvl"],source:G.defillama,schema:_({protocols:Ge(W()).min(1).max(6).describe('DeFiLlama protocol slugs (lowercase, hyphenated), e.g. ["lido", "aave", "eigenlayer"]. 1 to 6.'),lookback:re(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},Cg={name:"protocol-fees-treemap",label:"Protocol Fees Treemap",category:"crypto",iconUrl:M("protocol-fees-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of protocols sized by the fees they generated in the last 24h, tiles colored green/red by 1-day change. Data from DeFiLlama. Shows where on-chain users are actually paying for blockspace and services right now.",capabilities:["protocol-fees"],source:G.defillama,schema:_({topN:O().int().min(3).max(30).default(12).describe("How many of the highest fee-earning protocols to show.")})},_g={name:"market-cap-treemap",label:"Market Cap Treemap",category:"crypto",iconUrl:M("market-cap-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of the largest cryptocurrencies sized by market capitalisation, tiles colored green/red by 24h price change. Data from CoinGecko (free tier). A heat-map of the whole crypto market at a glance.",capabilities:["coin-markets"],source:G.coingecko,schema:_({topN:O().int().min(5).max(50).default(12).describe("How many of the largest coins by market cap to show (up to 50).")})},Ag={name:"open-interest",label:"Open Interest",category:"derivatives",iconUrl:M("open-interest"),layout:{w:4,h:3,minW:3,minH:2},description:'Live open interest across a watchlist of Hyperliquid perps — each symbol is a horizontal bar sized by USD notional, largest first, refreshed on a ~30s poll. Single-venue (Hyperliquid only), so read it as a relative gauge across your symbols, not a market-wide total. Stocks (HIP-3, e.g. "xyz:TSLA") and crypto both work.',capabilities:["open-interest"],source:G.hyperliquid,schema:_({symbols:Ge(W()).min(1).max(20).describe(`Hyperliquid symbols to compare open interest for, e.g. ["BTC", "ETH", "xyz:TSLA"]. A "<dex>:*" wildcard (e.g. "xyz:*") pulls that dex's entire universe.`)})},Sg={name:"snake",label:"Snake",category:"games",iconUrl:M("snake"),layout:{w:4,h:4,minW:3,minH:3},description:"Classic snake game on canvas — steer with the arrow keys (or swipe), eat dots to grow, avoid the walls and your own tail. High score persists locally. For when the market is flat. Needs no data provider.",capabilities:[],schema:_({})},zg={name:"flappy-bird",label:"Flappy Bird",category:"games",iconUrl:M("flappy-bird"),layout:{w:4,h:4,minW:3,minH:3},description:"Flappy-bird style game on canvas — tap or press SPACE to flap through the gaps between pipes. High score persists locally. Needs no data provider.",capabilities:[],schema:_({})},Tg={name:"video",label:"Video",category:"layout",iconUrl:M("video"),layout:{w:4,h:3,minW:2,minH:2},description:"Embeds a video from a YouTube or Vimeo link (or any direct embed URL) as an iframe — a livestream, a market-news clip, a focus playlist. Needs no data provider.",capabilities:[],schema:_({url:W().min(1).describe("Video URL — a YouTube watch/share link, a Vimeo link, or a direct embeddable URL (https)."),title:W().default("Video").describe("Accessible title for the embedded player (iframe title).")})},Eg={name:"drawdy",label:"Drawdy",category:"layout",iconUrl:M("drawdy"),layout:{w:8,h:6,minW:2,minH:2},description:"Embeds drawdy.io as an interactive whiteboard canvas. No configuration needed.",capabilities:[],schema:_({})},Pg={name:"countdown",label:"Countdown",category:"tools",iconUrl:M("countdown"),layout:{w:3,h:2,minW:2,minH:1},description:"Live countdown to a target date and time — FOMC decisions, CPI prints, options expiry, earnings, a token unlock, the next market open. Counts down in days / hours / minutes / seconds, ticking every second, and flips to a 'reached' state once the moment passes. Needs no data provider.",capabilities:[],schema:_({target:W().default("").describe(`The moment to count down to, as an ISO 8601 string. Add a timezone for an unambiguous instant, e.g. "2026-07-30T18:00:00-04:00" or "2026-12-31T23:59:59Z"; a bare "2026-07-30T18:00" is read in the viewer's local timezone. Empty shows a "set a target" prompt.`),label:W().default("").describe('Caption above the countdown, e.g. "FOMC Decision". Empty hides it.'),showTarget:nt().default(!0).describe("Show the formatted target date and time under the countdown.")})},Mg={name:"link-grid",label:"Quick Links",category:"tools",iconUrl:M("link-grid"),layout:{w:3,h:2,minW:2,minH:1},description:"A grid of quick-launch tiles linking to your favourite sites — TradingView, exchanges, news, docs, your own dashboards. Each tile opens in a new tab and shows the destination site's favicon by default (fetched keyless from a public favicon service), with an optional per-link icon override and a first-letter fallback. Needs no data provider.",capabilities:[],schema:_({links:Ge(_({label:W().min(1).describe('Tile caption, e.g. "TradingView".'),url:W().min(1).describe("Destination URL (https). Opens in a new tab."),icon:W().default("").describe(`Optional icon override: an emoji (e.g. "📈") or an https image URL. Empty uses the destination site's favicon, falling back to the label's first letter.`)})).min(1).default([{label:"TradingView",url:"https://www.tradingview.com",icon:"📈"},{label:"Hyperliquid",url:"https://app.hyperliquid.xyz",icon:"⚡"}]).describe("The links to show as tiles. At least one."),columns:O().int().min(1).max(4).default(2).describe("How many tiles per row.")})},Dg={name:"calculator",label:"Position Calculator",category:"tools",iconUrl:M("calculator"),layout:{w:3,h:3,minW:2,minH:2},description:"Position-size & risk calculator. Enter account size, risk-per-trade %, entry and stop price; it computes the dollars at risk, the per-unit risk, the position size (units) that respects that risk budget, the resulting position value, and whether the setup is long or short. All math runs client-side — no data provider. Inputs are editable live; the configured values are the starting point.",capabilities:[],schema:_({account:O().positive().default(1e4).describe("Account size used as the risk base, in the quote currency."),riskPct:O().positive().max(100).default(1).describe("Percent of the account risked on the trade, e.g. 1 = 1%."),entry:O().positive().default(100).describe("Entry price."),stop:O().positive().default(95).describe("Stop-loss price. Its distance from entry sets the per-unit risk; below entry = long, above = short."),currency:W().default("$").describe("Currency symbol shown next to money values.")})},Rg={name:"quote",label:"Quote",category:"layout",iconUrl:M("quote"),layout:{w:4,h:2,minW:2,minH:1},description:'Displays a market or trading quote, centered — set one or rotate through several. A calm bit of wall-art for the dashboard: trading maxims, reminders of your own rules, mantras. Write any attribution into the text itself (e.g. "… — Buffett"). Needs no data provider.',capabilities:[],schema:_({quotes:Ge(W().min(1)).min(1).default(["Be fearful when others are greedy, and greedy when others are fearful. — Warren Buffett","The trend is your friend until the end when it bends.","Plan the trade, trade the plan."]).describe("One or more quotes. With more than one, the frame rotates through them."),intervalSec:O().int().min(0).default(12).describe("Seconds between rotations when there are multiple quotes. 0 shows the first quote, fixed.")})},Og={name:"divider",label:"Divider",category:"layout",iconUrl:M("divider"),layout:{w:12,h:1,minW:1,minH:1},description:"A plain rule that separates regions of the dashboard, with an optional centered label. Renders chrome-less (no card) — lighter than a heading. Use a horizontal divider full-width between stacked zones, or set orientation to vertical for a 1-column-wide column separator. Needs no data provider.",capabilities:[],chrome:"bare",schema:_({label:W().default("").describe("Optional text shown in the middle of the rule. Empty = a clean line."),orientation:re(["horizontal","vertical"]).default("horizontal").describe("Horizontal rule (spans the width) or vertical rule (spans the height)."),style:re(["solid","dashed","dotted"]).default("solid").describe("Line style.")})},Ng={name:"dice",label:"Dice",category:"tools",iconUrl:M("dice"),layout:{w:2,h:2,minW:1,minH:1},description:"A click-to-decide widget — a random decision-maker with no data provider. Flip a coin (heads/tails), roll a die (1–6), or pick at random from your own list of options. Click the surface to re-roll. Use it to break a tie, pick what to trade, or settle any small decision.",capabilities:[],schema:_({mode:re(["coin","dice","list"]).default("coin").describe("coin = heads/tails, dice = 1–6, list = random pick from options."),options:Ge(W()).default(["Yes","No"]).describe("Choices used in list mode."),label:W().default("").describe("Optional caption, e.g. the question being decided.")})},Lg={name:"risk-reward",label:"Risk / Reward",category:"tools",iconUrl:M("risk-reward"),layout:{w:3,h:3,minW:2,minH:2},description:"Risk:reward planner. Enter entry, stop-loss and profit-target prices; it computes the per-unit risk and reward, their percentages of entry, and the resulting R:R ratio, shown large above a two-segment bar (red risk leg vs green reward leg, sized to scale). Pure client-side math — no data provider. Complements the calculator frame by adding the target/reward leg the position sizer leaves out.",capabilities:[],schema:_({entry:O().default(100).describe("Planned entry price."),stop:O().default(95).describe("Stop-loss price."),target:O().default(115).describe("Profit target price."),direction:re(["long","short"]).default("long").describe("Trade direction. Long expects stop < entry < target; short expects target < entry < stop — used for labels and to flag a mismatched setup."),label:W().default("").describe("Optional caption.")})},Ig={name:"marquee",label:"Marquee",category:"layout",iconUrl:M("marquee"),layout:{w:6,h:1,minW:2,minH:1},description:"A chrome-less scrolling banner that glides custom text continuously right-to-left across the frame (think stadium ticker / news crawl). Renders with no card — it fills the whole frame. Use for a slogan, a reminder, or a hype line. Needs no data provider.",capabilities:[],chrome:"bare",schema:_({text:W().default("LFG").describe("The text that scrolls across the banner."),speed:re(["slow","normal","fast"]).default("normal").describe("Scroll speed."),accent:nt().default(!0).describe("Tint the text with the dashboard accent color.")})},Fg={name:"stopwatch",label:"Stopwatch",layout:{w:3,h:2,minW:2,minH:1},category:"tools",iconUrl:M("stopwatch"),description:"A count-up stopwatch — time-in-trade, a focus session, how long a setup has been live. Start / Pause / Reset, ticking up in H:MM:SS, and it persists across reloads (the running state is saved into the dashboard, so it keeps counting where it left off). Runs entirely client-side — needs no data provider.",capabilities:[],schema:_({label:W().default("Session").describe("Caption above the timer."),startedAt:O().default(0).describe("Epoch ms when the timer was last started; 0 = paused. Persisted automatically by the frame."),accumulatedMs:O().default(0).describe("Milliseconds banked before the current run. Persisted automatically by the frame.")})},Ug={name:"session-progress",label:"Session Progress",category:"tools",iconUrl:M("session-progress"),layout:{w:3,h:2,minW:2,minH:1},description:"A horizontal progress bar showing how far through today's trading session an exchange is — fills from open to close with a percent readout, and a 'closes in …' / 'opens in …' countdown. Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); sessions are computed client-side from the exchange's timezone and hours, so it needs no data provider.",capabilities:[],schema:_({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),label:W().default("").describe("Optional caption shown by the exchange code."),showCountdown:nt().default(!0).describe("Show the time-to-open / time-to-close countdown.")})},jg={name:"holiday-calendar",label:"Holiday Calendar",category:"tools",iconUrl:M("holiday-calendar"),layout:{w:3,h:4,minW:2,minH:2},description:"Upcoming market holidays (full closures) for a chosen exchange — the next few dates with their weekday and a countdown ('in 9d'). Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); dates come from a bundled holiday table and are computed client-side, so it needs no data provider. Note: the bundled table currently covers 2026.",capabilities:[],schema:_({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),count:O().int().min(1).max(20).default(5).describe("How many upcoming holidays to list."),label:W().default("").describe("Optional caption shown above the list.")})},Hg={name:"day-meter",label:"Day Meter",category:"tools",iconUrl:M("day-meter"),layout:{w:4,h:2,minW:2,minH:1},description:"A strip of the current week's days for a chosen exchange — today highlighted, market holidays flagged in amber, and (optionally) non-trading days greyed. Computed client-side from the exchange's trading days + a bundled holiday table; needs no data provider.",capabilities:[],schema:_({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),weekdaysOnly:nt().default(!0).describe("Show only the exchange's trading days; off shows the full 7-day week with weekends greyed."),label:W().default("").describe("Optional caption shown by the strip.")})},Bg={name:"returns-projector",label:"Returns Projector",category:"tools",iconUrl:M("returns-projector"),layout:{w:3,h:4,minW:2,minH:3},description:"A compound-growth projector — enter a starting principal, a percent return per period, the number of periods, and an optional per-period contribution; it charts the projected balance curve and shows the ending value and total gain. Pure client-side math, no data provider; complements the position-size/risk `calculator`.",capabilities:[],schema:_({principal:O().default(1e3).describe("Starting balance."),ratePct:O().default(5).describe("Return per period, in percent (e.g. 5 = 5%)."),periods:O().int().min(1).max(600).default(12).describe("Number of compounding periods to project."),contribution:O().default(0).describe("Amount added at the end of each period."),label:W().default("").describe("Optional caption.")})},Vg={name:"breakeven",label:"Break-even",category:"tools",iconUrl:M("breakeven"),layout:{w:3,h:4,minW:2,minH:2},description:"A break-even / average-cost calculator — add your fills (price + size) and it computes the size-weighted average entry; set an optional current price to see the unrealized P&L %. Pure client-side math, no data provider.",capabilities:[],schema:_({fills:Ge(_({price:O().describe("Fill price."),size:O().describe("Fill size, in units.")})).default([{price:100,size:1}]).describe("Your entry fills; their size-weighted average is the break-even."),currentPrice:O().default(0).describe("Optional current price; greater than 0 shows the unrealized P&L %."),label:W().default("").describe("Optional caption.")})},Wg={name:"checklist",label:"Checklist",category:"tools",iconUrl:M("checklist"),layout:{w:3,h:3,minW:2,minH:2},description:"A tickable checklist — a pre-trade routine, a daily ritual, anything. Tap items to check them off; the checked state persists across reloads (saved into the dashboard). Client-side only, no data provider.",capabilities:[],schema:_({title:W().default("Pre-trade checklist").describe("Heading shown above the list."),items:Ge(W()).default(["Trend & bias aligned","Stop level set","Risk sized correctly"]).describe("The checklist items, top to bottom."),checked:Ge(nt()).default([]).describe("Per-item checked state (by index); persisted automatically by the frame.")})},Gg={name:"pomodoro",label:"Pomodoro",category:"tools",iconUrl:M("pomodoro"),layout:{w:3,h:3,minW:2,minH:2},description:"A Pomodoro focus timer — alternating work and break intervals with Start / Pause / Reset and a cycle counter, counting down in MM:SS. Runs entirely client-side with no data provider; timer state is in-session (not persisted).",capabilities:[],schema:_({workMin:O().min(1).max(180).default(25).describe("Work interval length, in minutes."),breakMin:O().min(1).max(120).default(5).describe("Break interval length, in minutes."),cycles:O().int().min(1).max(20).default(4).describe("Work/break cycles before the counter loops."),label:W().default("").describe("Optional caption.")})},Yg={name:"rules-card",label:"Rules",category:"layout",iconUrl:M("rules-card"),layout:{w:3,h:3,minW:2,minH:2},description:"A pinned, auto-numbered list of your trading rules (or any principles) — always fully visible, unlike the rotating `quote` frame. Static text, client-side, no data provider.",capabilities:[],schema:_({title:W().default("My rules").describe("Heading shown above the list."),rules:Ge(W()).default(["Cut losers fast, let winners run","No trade without a stop","One setup at a time"]).describe("The rules, in order; rendered as a numbered list.")})},Kg={name:"breathing",label:"Breathing",category:"layout",iconUrl:M("breathing"),chrome:"bare",layout:{w:2,h:2,minW:1,minH:1},description:"A chrome-less breathing pacer — a circle that expands and contracts through configurable inhale / hold / exhale / hold phases to steady your breathing between trades. Renders with no card; client-side only, no data provider.",capabilities:[],schema:_({inhale:O().min(1).max(60).default(4).describe("Inhale seconds."),hold:O().min(0).max(60).default(4).describe("Hold-after-inhale seconds."),exhale:O().min(1).max(60).default(4).describe("Exhale seconds."),holdAfter:O().min(0).max(60).default(4).describe("Hold-after-exhale seconds.")})},qg={name:"spotify-embed",label:"Spotify",category:"layout",iconUrl:M("spotify-embed"),layout:{w:3,h:4,minW:2,minH:2},description:"Embeds a Spotify track, album, playlist, artist, or show from its public open.spotify.com share link (same embed approach as the `video` frame), using Spotify's official keyless iframe player. Needs an internet connection to play.",capabilities:[],schema:_({url:W().default("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M").describe("A Spotify share URL (open.spotify.com/track|album|playlist|artist/…)."),compact:nt().default(!1).describe("Use Spotify's compact (single-row) player height.")})},Jg={name:"btc-fees",label:"BTC Fees",category:"bitcoin",iconUrl:M("btc-fees"),layout:{w:3,h:3,minW:2,minH:3},description:"Recommended Bitcoin on-chain fee rates (sat/vB) from mempool.space — the next-block ('fastest'), ~30-minute, ~1-hour, economy, and minimum tiers, as a compact gauge. Live mempool data, keyless; updates every ~30s.",capabilities:["btc-fees"],source:G.mempool,schema:_({tiers:Ge(re(["fastest","halfHour","hour","economy","minimum"])).min(1).max(5).default(["fastest","halfHour","hour","economy"]).describe('Which fee tiers to show, in order. "fastest" = next block, "halfHour"/"hour" = within ~30/60 min, "economy"/"minimum" = cheapest relayable.')})},Xg={name:"btc-mempool",label:"BTC Mempool",category:"bitcoin",iconUrl:M("btc-mempool"),layout:{w:5,h:3,minW:3,minH:2},description:"Bitcoin mempool congestion at a glance — unconfirmed transaction count, total pending vsize, and a row of projected ('template') blocks the network will likely mine next, each labelled with its median fee rate (sat/vB) and tx count. Live mempool data from mempool.space, keyless.",capabilities:["btc-mempool"],source:G.mempool,schema:_({projectedBlocks:O().int().min(1).max(8).default(5).describe("How many projected (yet-to-be-mined) blocks to show, next-to-mine first.")})},Zg={name:"btc-blocks",label:"BTC Blocks",category:"bitcoin",iconUrl:M("btc-blocks"),layout:{w:5,h:4,minW:3,minH:3},description:"Feed of the most recently mined Bitcoin blocks — each row shows the height, how long ago it was mined, transaction count, the mining pool that found it, total fees (BTC), and size. Live data from mempool.space, keyless; newest first.",capabilities:["btc-blocks"],source:G.mempool,schema:_({count:O().int().min(3).max(15).default(8).describe("How many recent blocks to list (newest first).")})},$g={name:"btc-hashrate",label:"BTC Hashrate",category:"bitcoin",iconUrl:M("btc-hashrate"),layout:{w:6,h:3,minW:3,minH:2},description:"Bitcoin network hashrate over time as a line chart, with the current hashrate (EH/s) and difficulty as headline figures. Shows the long-run security trend of the network. Data from mempool.space (daily granularity), keyless.",capabilities:["btc-hashrate"],source:G.mempool,schema:_({window:re(["1y","2y","3y"]).default("1y").describe("History window for the hashrate line.")})},Qg={name:"btc-difficulty",label:"BTC Difficulty",category:"bitcoin",iconUrl:M("btc-difficulty"),layout:{w:4,h:3,minW:3,minH:2},description:"Countdown to the next Bitcoin difficulty adjustment — a progress bar through the current 2016-block epoch, the estimated change (+ = mining gets harder), blocks remaining, and the estimated retarget date. Also shows the previous adjustment. Data from mempool.space, keyless.",capabilities:["btc-difficulty"],source:G.mempool,schema:_({showPrevious:nt().default(!0).describe("Also show the percentage change applied at the previous retarget.")})},ev={name:"mining-pools",label:"Mining Pools",category:"bitcoin",iconUrl:M("mining-pools"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of Bitcoin mining-pool dominance over a window — each tile is a pool sized by the share of blocks it mined, so you can see how concentrated hashpower is right now (Foundry, AntPool, ViaBTC…). Data from mempool.space, keyless.",capabilities:["mining-pools"],source:G.mempool,schema:_({window:re(["24h","3d","1w","1m"]).default("1w").describe("Window over which to measure each pool's block share."),topN:O().int().min(3).max(25).default(12).describe("How many of the largest pools to show; the rest fold into 'Other'.")})},tv={name:"lightning-stats",label:"Lightning Network",category:"bitcoin",iconUrl:M("lightning-stats"),layout:{w:4,h:3,minW:3,minH:2},description:"Bitcoin Lightning Network snapshot — public node count, channel count, and total network capacity (BTC), with a day-over-day delta and the Tor/clearnet node split. Data from mempool.space, keyless; updates roughly daily.",capabilities:["lightning-stats"],source:G.mempool,schema:_({showSplit:nt().default(!0).describe("Show the Tor vs clearnet node split under the headline stats.")})},rv={name:"options-put-call",label:"Put / Call Ratio",category:"derivatives",iconUrl:M("options-put-call"),layout:{w:4,h:3,minW:3,minH:2},description:"Deribit options put/call ratio for BTC or ETH — the headline ratio (by open interest or 24h volume), a call-vs-put open-interest split bar, and the open-interest-weighted average implied volatility. A ratio above 1 means puts outweigh calls (defensive positioning). Keyless Deribit market data.",capabilities:["options-summary"],source:G.deribit,schema:_({currency:re(["BTC","ETH"]).default("BTC").describe("Which Deribit options book to summarise — BTC or ETH (the only deeply liquid books)."),basis:re(["oi","volume"]).default("oi").describe('Headline put/call ratio basis: "oi" = by open interest (positioning), "volume" = by 24h traded volume (flow). The other is shown smaller.')})},nv={name:"options-iv",label:"Implied Volatility",category:"derivatives",iconUrl:M("options-iv"),layout:{w:6,h:3,minW:3,minH:2},description:"Deribit DVOL implied-volatility index for BTC or ETH over time — the crypto equivalent of the VIX, as a line chart with the current reading and its change over the window. Rising DVOL = the market is pricing bigger expected swings. Keyless Deribit market data.",capabilities:["volatility-index"],source:G.deribit,schema:_({currency:re(["BTC","ETH"]).default("BTC").describe("Which DVOL volatility index to plot — BTC or ETH."),lookback:re(["7D","1M","3M"]).default("1M").describe("History window for the volatility-index line.")})},av={name:"options-oi-strike",label:"OI by Strike",category:"derivatives",iconUrl:M("options-oi-strike"),layout:{w:6,h:4,minW:4,minH:3},description:"Open interest by strike for the nearest Deribit options expiry (BTC or ETH) — a grouped histogram of call vs put open interest across strikes, with the current spot marked. Surfaces the strike 'walls' where positioning is concentrated. Keyless Deribit market data.",capabilities:["options-summary"],source:G.deribit,schema:_({currency:re(["BTC","ETH"]).default("BTC").describe("Which Deribit options book — BTC or ETH."),strikes:O().int().min(6).max(30).default(14).describe("How many strikes nearest the current spot to show (centered on the underlying price).")})},ov={name:"coin-movers",label:"Coin Movers",category:"markets",iconUrl:M("coin-movers"),layout:{w:5,h:4,minW:3,minH:3},description:"Broad-market crypto gainers and losers across the top ~300 coins by market cap, over a selectable window (1h / 24h / 7d / 30d) — the biggest movers side by side with price and % change. Unlike a top-coins heatmap, this surfaces mid- and small-caps that ripped or dumped, not just the megacaps. Keyless data from Coinpaprika. Crypto only.",capabilities:["coin-movers"],source:G.coinpaprika,schema:_({window:re(["1h","24h","7d","30d"]).default("24h").describe("Which price-change window ranks the movers: 1h (intraday momentum), 24h (daily), 7d (weekly), 30d (monthly)."),count:O().int().min(3).max(15).default(6).describe("How many gainers and how many losers to list (each side)."),minRank:O().int().min(20).max(300).default(150).describe("Only consider coins ranked at or above this market-cap rank — a liquidity floor that keeps illiquid micro-cap dust (which posts absurd % moves on no volume) out of the list. Lower = stricter (megacaps only); higher = includes more small-caps.")})},iv={name:"mvrv",label:"MVRV Ratio",category:"onchain",iconUrl:M("mvrv"),layout:{w:3,h:3,minW:2,minH:2},description:"Bitcoin MVRV ratio — market cap ÷ realized cap. Above ~3 historically marks cycle tops (overvalued); below ~1 marks deep value near bottoms. Shows the current ratio, its valuation zone, the MVRV Z-score, and a history sparkline. Keyless on-chain data from Coin Metrics.",capabilities:["onchain-valuation"],source:G.coinMetrics,schema:_({window:re(["1Y","2Y","4Y","all"]).default("all").describe("How much history the sparkline shows.")})},sv={name:"nupl",label:"NUPL",category:"onchain",iconUrl:M("nupl"),layout:{w:3,h:3,minW:2,minH:2},description:"Net Unrealized Profit/Loss — the share of Bitcoin's market cap held in unrealized profit. Maps to cycle sentiment phases: Capitulation (<0), Hope/Fear (0–25%), Optimism (25–50%), Belief (50–75%), Euphoria/Greed (>75%). Derived from MVRV; keyless Coin Metrics data.",capabilities:["onchain-valuation"],source:G.coinMetrics,schema:_({window:re(["1Y","2Y","4Y","all"]).default("all").describe("How much history the sparkline shows.")})},cv={name:"sopr",label:"SOPR",category:"onchain",iconUrl:M("sopr"),layout:{w:3,h:3,minW:2,minH:2},description:"Spent Output Profit Ratio — whether coins moving on-chain are, on average, being sold in profit (>1) or loss (<1). Sustained dips below 1 mark capitulation; resets to ~1 in bull markets are healthy. Keyless full-history data from bitcoin-data.com (polled once daily).",capabilities:["onchain-cycle-extras"],source:G.bitcoinData,schema:_({window:re(["90D","180D","1Y"]).default("1Y").describe("How much history the sparkline shows.")})},lv={name:"puell-multiple",label:"Puell Multiple",category:"onchain",iconUrl:M("puell-multiple"),layout:{w:3,h:3,minW:2,minH:2},description:"Puell Multiple — daily miner issuance in USD ÷ its 365-day average. High values (>4) mark cycle tops where miner revenue is stretched; low values (≤0.5) mark miner capitulation near bottoms. Keyless data from bitcoin-data.com (polled once daily).",capabilities:["onchain-cycle-extras"],source:G.bitcoinData,schema:_({window:re(["90D","180D","1Y"]).default("1Y").describe("How much history the sparkline shows.")})},uv={name:"mayer-multiple",label:"Mayer Multiple",category:"onchain",iconUrl:M("mayer-multiple"),layout:{w:3,h:3,minW:2,minH:2},description:"Mayer Multiple — BTC price ÷ its 200-day moving average. Above ~2.4 has historically been overheated; below ~0.8 marks value zones. Computed in-browser from a keyless long daily price series (Coin Metrics).",capabilities:["price-history-daily"],source:G.coinMetrics,schema:_({window:re(["1Y","2Y","4Y","all"]).default("2Y").describe("How much history the sparkline shows.")})},dv={name:"pi-cycle",label:"Pi Cycle Top",category:"onchain",iconUrl:M("pi-cycle"),layout:{w:3,h:3,minW:2,minH:2},description:"Pi Cycle Top indicator — the ratio of the 111-day MA to 2× the 350-day MA. When it crosses 1 (the 111DMA overtakes 2×350DMA) it has historically pinpointed cycle tops within days. Computed in-browser from a keyless long daily price series (Coin Metrics).",capabilities:["price-history-daily"],source:G.coinMetrics,schema:_({window:re(["1Y","2Y","4Y","all"]).default("2Y").describe("How much history the sparkline shows.")})},fv={name:"ma-multiplier",label:"MA Multiplier",category:"onchain",iconUrl:M("ma-multiplier"),layout:{w:3,h:3,minW:2,minH:2},description:"Long moving-average multiplier — BTC price ÷ its multi-year moving average (2-year or 4-year). The 2Y band flags a buy zone below ÷1.5 and sell tiers at ×2–×5; the 4Y multiple marks tops above ~3.5×. Computed in-browser from a keyless long daily price series (Coin Metrics).",capabilities:["price-history-daily"],source:G.coinMetrics,schema:_({years:re(["2","4"]).default("2").describe("Moving-average window in years."),window:re(["2Y","4Y","all"]).default("all").describe("How much history the sparkline shows.")})},hv={name:"rsi-momentum",label:"RSI Momentum",category:"markets",iconUrl:M("rsi-momentum"),layout:{w:3,h:3,minW:2,minH:2},description:"Wilder RSI on BTC daily closes with a 55/45 momentum regime: above 55 = risk-on, below 45 = risk-off, in between = neutral. Also flags classic overbought (≥80) / oversold (≤30) extremes. Computed in-browser from a keyless long daily price series (Coin Metrics).",capabilities:["price-history-daily"],source:G.coinMetrics,schema:_({period:O().int().min(2).max(50).default(14).describe("RSI lookback period in days."),window:re(["90D","180D","1Y","2Y"]).default("180D").describe("How much history the sparkline shows.")})},pv={name:"volume-profile",label:"Volume Profile",category:"markets",iconUrl:M("volume-profile"),layout:{w:4,h:4,minW:3,minH:3},description:"Volume-by-price histogram over a lookback window — the Point of Control (POC, highest-volume price) and the 70% Value Area (VAH/VAL) that frame support/resistance. Computed in-browser from OHLCV candles. Pass any tradable symbol (crypto or a HIP-3 equity like 'xyz:TSLA').",capabilities:["ohlcv"],source:G.hyperliquid,schema:_({symbol:W().default("BTC").describe("Symbol to profile, e.g. 'BTC', 'ETH', or a HIP-3 equity 'xyz:TSLA'."),interval:re(["1h","4h","1d"]).default("1d").describe("Candle interval."),lookbackDays:O().int().min(7).max(365).default(90).describe("How many days of candles to build the profile from."),bins:O().int().min(8).max(48).default(24).describe("Number of price buckets in the histogram.")})},mv={name:"dxy",label:"Dollar Index (DXY)",category:"macro",iconUrl:M("dxy"),layout:{w:3,h:3,minW:2,minH:2},description:"US Dollar Index (DXY) — the dollar's strength vs a basket of six major currencies. A rising DXY is a macro headwind for risk assets (incl. BTC); a falling DXY a tailwind. Computed as the ICE-weighted geometric mean of keyless ECB reference rates (daily granularity).",capabilities:["dollar-index"],source:G.frankfurter,schema:_({})},gv={name:"cycle-signals",label:"Cycle Signals",category:"onchain",iconUrl:M("cycle-signals"),layout:{w:4,h:5,minW:3,minH:3},description:"A cycle top- or bottom-signal checklist — MVRV, MVRV Z-score, NUPL, Mayer Multiple, Puell, RSI, and Pi Cycle each checked against its historical extreme, with a live 'X of N firing' tally. A capstone that aggregates the on-chain and cycle metrics into one 'how late in the cycle are we' read. Keyless (Coin Metrics + bitcoin-data.com).",capabilities:["onchain-valuation","onchain-cycle-extras","price-history-daily"],source:[G.coinMetrics,G.bitcoinData],schema:_({mode:re(["peak","bottom"]).default("peak").describe("Which checklist to show: cycle-top ('peak') or cycle-bottom ('bottom') signals.")})},vv={name:"stablecoin-supply",label:"Stablecoin Supply",category:"crypto",iconUrl:M("stablecoin-supply"),layout:{w:3,h:3,minW:2,minH:2},description:"Total USD-stablecoin circulating supply — a market-wide liquidity gauge. Rising supply = fresh capital entering crypto (risk-on dry powder); contraction = risk-off. Shows the total, 1d/7d/30d change, and the largest chains. Keyless (DeFiLlama).",capabilities:["stablecoins"],source:G.defillama,schema:_({})},yv={name:"yield-scanner",label:"Yield Scanner",category:"crypto",iconUrl:M("yield-scanner"),layout:{w:5,h:4,minW:3,minH:3},description:"Top DeFi yield pools ranked by APY, across every chain and protocol — the 'where's the yield' board. Filter to stablecoin pools or a TVL floor. Shows APY (base + reward), TVL, chain, and IL risk. Keyless (DeFiLlama yields).",capabilities:["yields"],source:G.defillama,schema:_({limit:O().int().min(3).max(20).default(8).describe("How many pools to list."),stablecoinOnly:nt().default(!1).describe("Only show stablecoin pools (lower impermanent-loss risk)."),minTvlUsd:O().min(0).default(1e6).describe("Minimum pool TVL in USD — a liquidity floor to hide dust.")})},bv={name:"defi-revenue",label:"DeFi Fees & Revenue",category:"crypto",iconUrl:M("defi-revenue"),layout:{w:3,h:3,minW:2,minH:2},description:"Aggregate DeFi protocol fees across all of crypto — trailing-24h total with a daily trend. A read on real on-chain economic activity. Keyless (DeFiLlama).",capabilities:["fees-overview"],source:G.defillama,schema:_({})},wv={name:"funding-comparison",label:"Cross-Venue Funding",category:"derivatives",iconUrl:M("funding-comparison"),layout:{w:5,h:4,minW:3,minH:3},description:"Predicted perpetual funding rates compared across venues (Hyperliquid vs Binance vs Bybit), annualized, per coin — ranked by the cross-venue spread. A large spread flags a funding-arbitrage or crowded-positioning signal. Keyless (Hyperliquid predicted fundings).",capabilities:["funding-comparison"],source:G.hyperliquid,schema:_({limit:O().int().min(3).max(20).default(8).describe("How many coins (by funding spread) to show.")})},xv={name:"eth-supply",label:"ETH Ultrasound",category:"crypto",iconUrl:M("eth-supply"),layout:{w:4,h:3,minW:2,minH:2},description:"Ethereum supply economics — EIP-1559 burn vs PoS issuance and the resulting net annual supply growth. Negative growth = deflationary ('ultrasound money'). Shows the net rate, burn/issuance, and vs the counterfactual PoW issuance. Keyless (ultrasound.money).",capabilities:["eth-supply"],source:G.ultrasound,schema:_({})},kv={name:"eth-staking",label:"ETH Staking APR",category:"crypto",iconUrl:M("eth-staking"),layout:{w:3,h:3,minW:2,minH:2},description:"Ethereum staking yield — total validator APR broken into consensus issuance, MEV, and priority tips. The 'risk-free' ETH rate. Keyless (ultrasound.money).",capabilities:["eth-supply"],source:G.ultrasound,schema:_({})},Cv={name:"prediction-markets",label:"Prediction Markets",category:"sentiment",iconUrl:M("prediction-markets"),layout:{w:4,h:4,minW:3,minH:3},description:"Live Polymarket odds — the highest-volume open prediction markets with their market-implied probabilities (macro, rates, crypto, politics). A real-money sentiment gauge. Keyless (Polymarket Gamma API).",capabilities:["prediction-markets"],source:G.polymarket,schema:_({limit:O().int().min(3).max(20).default(6).describe("How many markets (by volume) to show.")})},_v={name:"etf-flows",label:"Spot ETF Flows",category:"crypto",iconUrl:M("etf-flows"),layout:{w:4,h:4,minW:3,minH:3},description:"Spot Bitcoin or Ethereum ETF daily net flows — per-issuer (IBIT, FBTC, GBTC, …) plus the total, with a recent trend. The biggest institutional-demand signal. Keyless (SoSoValue); best-effort, may show empty if the source is unavailable.",capabilities:["etf-flows"],source:G.sosovalue,schema:_({asset:re(["btc","eth"]).default("btc").describe("Which spot-ETF complex to show."),limit:O().int().min(3).max(15).default(8).describe("How many issuers to list.")})},Av={name:"trending-coins",label:"Trending Coins",category:"crypto",iconUrl:M("trending-coins"),layout:{w:3,h:4,minW:2,minH:3},description:"The coins with the most search interest right now on CoinGecko — a retail-attention gauge. Shows rank, price, and 24h change. Keyless (CoinGecko).",capabilities:["trending-coins"],source:G.coingecko,schema:_({limit:O().int().min(3).max(15).default(7).describe("How many trending coins to show.")})},Sv={name:"sector-performance",label:"Sector Performance",category:"crypto",iconUrl:M("sector-performance"),layout:{w:4,h:4,minW:3,minH:3},description:"Crypto sector rotation — market categories (L1s, DeFi, AI, memes, RWA, …) ranked by 24h market-cap change. Shows where capital is rotating. Keyless (CoinGecko categories).",capabilities:["sector-performance"],source:G.coingecko,schema:_({limit:O().int().min(4).max(30).default(10).describe("How many sectors to show.")})},zv={name:"macro-calendar",label:"Macro Calendar",category:"macro",iconUrl:M("macro-calendar"),layout:{w:4,h:4,minW:3,minH:2},description:"Countdown to upcoming scheduled macro events — defaults to the 2026 FOMC rate decisions, fully editable. No data feed; the dates are known in advance.",capabilities:[],schema:_({limit:O().int().min(1).max(12).default(5).describe("How many upcoming events to show."),events:Ge(_({date:W().describe("Event date, ISO YYYY-MM-DD."),label:W().describe("Event name, e.g. 'FOMC decision'.")})).default([{date:"2026-07-29",label:"FOMC decision"},{date:"2026-09-16",label:"FOMC decision"},{date:"2026-10-28",label:"FOMC decision"},{date:"2026-12-09",label:"FOMC decision"},{date:"2027-01-27",label:"FOMC decision"}]).describe("Scheduled events (date + label). Defaults to the 2026 FOMC meetings; edit to add CPI/NFP/earnings dates.")})},Tv={name:"stablecoin-chains",label:"Stablecoin Chains",category:"crypto",iconUrl:M("stablecoin-chains"),layout:{w:5,h:4,minW:4,minH:3},description:"Where stablecoin liquidity sits — a treemap of the largest chains by stablecoin circulating supply. Complements the Stablecoin Supply total with the cross-chain distribution. Keyless (DeFiLlama).",capabilities:["stablecoins"],source:G.defillama,schema:_({limit:O().int().min(4).max(16).default(12).describe("How many chains to show in the treemap.")})},Ev={name:"sector-treemap",label:"Sector Treemap",category:"crypto",iconUrl:M("sector-treemap"),layout:{w:6,h:4,minW:4,minH:3},description:"Crypto sector rotation as a treemap — each category sized by market cap and colored by 24h change (green up / red down). The at-a-glance view of where capital is flowing. Keyless (CoinGecko categories).",capabilities:["sector-performance"],source:G.coingecko,schema:_({limit:O().int().min(6).max(30).default(16).describe("How many sectors to show.")})},Pv={name:"etf-flows-chart",label:"ETF Flows Chart",category:"crypto",iconUrl:M("etf-flows-chart"),layout:{w:6,h:3,minW:3,minH:3},description:"Spot BTC or ETH ETF daily net flows over time — the inflow/outflow trend as a line, complementing the per-issuer snapshot. Keyless (SoSoValue); best-effort, may be empty if the source is unavailable.",capabilities:["etf-flows"],source:G.sosovalue,schema:_({asset:re(["btc","eth"]).default("btc").describe("Which spot-ETF complex to chart."),lookback:re(["1M","3M","6M"]).default("3M").describe("History window for the flow chart.")})},Mv={name:"realized-price",label:"Realized Price",category:"onchain",iconUrl:M("realized-price"),layout:{w:6,h:3,minW:4,minH:3},description:"Bitcoin market price vs realized price — the on-chain cost basis of all coins. Market above realized = aggregate profit; crossing below realized has marked cycle bottoms. Keyless (Coin Metrics).",capabilities:["onchain-valuation"],source:G.coinMetrics,schema:_({window:re(["1Y","2Y","4Y","all"]).default("2Y").describe("How much history the chart shows.")})},Dv={name:"reserve-risk",label:"Reserve Risk",category:"onchain",iconUrl:M("reserve-risk"),layout:{w:3,h:3,minW:2,minH:2},description:"Reserve Risk — long-term-holder conviction relative to price. Low values = strong conviction at a low price (attractive risk/reward, cycle-bottom territory); high values = conviction spent into a high price. Keyless (bitcoin-data.com).",capabilities:["onchain-cycle-extras"],source:G.bitcoinData,schema:_({window:re(["90D","180D","1Y"]).default("1Y").describe("How much history the sparkline shows.")})},Rv=[yg,mg,gg,vg,K0,I0,lg,ig,U0,tg,ng,Z0,Q0,$0,eg,og,j0,cg,sg,X0,F0,H0,B0,pg,V0,W0,q0,J0,ag,G0,Y0,rg,bg,wg,xg,kg,Cg,_g,Ag,Sg,zg,Tg,Eg,Pg,Mg,Dg,Rg,Og,Jg,Xg,Zg,$g,Qg,ev,tv,rv,nv,av,ov,iv,sv,cv,lv,uv,dv,fv,hv,pv,mv,gv,vv,yv,bv,wv,xv,kv,Cv,_v,Av,Sv,zv,Tv,Ev,Pv,Mv,Dv],Ov=[...Rv,Vg,Kg,Wg,Hg,Ng,jg,ug,dg,fg,hg,Ig,Gg,Bg,Lg,Yg,Ug,qg,Fg],ii=()=>null;function Nv(){const e=new Map;for(const t of Ov){const r=L0[t.name];if(!r){console.warn(`[zframes] frame "${t.name}" has metadata but no lazy loader — it won't render`);continue}let n=null;const a=()=>n??(n=r.load().catch(c=>{throw n=null,c})),o=A.lazy(()=>a().then(c=>({default:c.component}))),i=r.titleIcon?A.lazy(()=>a().then(c=>(c.titleIcon||console.warn(`[zframes] frame "${t.name}" is flagged titleIcon but its module exports none`),{default:c.titleIcon??ii}))):void 0,s=r.titleContent?A.lazy(()=>a().then(c=>(c.titleContent||console.warn(`[zframes] frame "${t.name}" is flagged titleContent but its module exports none`),{default:c.titleContent??ii}))):void 0;e.set(t.name,{...t,component:o,titleIcon:i,titleContent:s})}return e}function Bn(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Fs(e){return e.includes(":")}function Lv(e){const t=Bn(e);return Fs(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const si=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function Iv(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)|0;return si[Math.abs(t)%si.length]}function Fv({symbol:e,size:t=18,className:r=""}){const n=Bn(e),a=Fs(e),[o,i]=A.useState(!1);A.useEffect(()=>i(!1),[e]);const s=a?"rounded-[5px]":"rounded-full",c={width:t,height:t};return o?w.jsx("span",{"aria-hidden":!0,className:`inline-flex shrink-0 items-center justify-center font-bold leading-none text-white ${s} ${r}`,style:{...c,background:Iv(n),fontSize:Math.round(t*.42)},children:n.slice(0,2).toUpperCase()}):w.jsx("img",{src:Lv(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>i(!0),className:`shrink-0 object-contain ${s} ${a?"bg-white p-px":""} ${r}`,style:c})}const Uv=["xyz:*"],jv=200,Hv="var(--zf-up, #3fd08f)",Bv="var(--zf-down, #ff6b81)";function ci(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const Vv=`
|
|
512
|
+
.zf-tape {
|
|
513
|
+
position: fixed;
|
|
514
|
+
left: 0;
|
|
515
|
+
right: 0;
|
|
516
|
+
bottom: 0;
|
|
517
|
+
z-index: 30;
|
|
518
|
+
height: 36px;
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
overflow: hidden;
|
|
522
|
+
background: rgba(10, 11, 17, 0.86);
|
|
523
|
+
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
524
|
+
font-family: var(--font-dmsans, system-ui, sans-serif);
|
|
525
|
+
-webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
|
|
526
|
+
mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
|
|
527
|
+
}
|
|
528
|
+
.zf-tape-track {
|
|
529
|
+
display: flex;
|
|
530
|
+
flex-shrink: 0;
|
|
531
|
+
align-items: center;
|
|
532
|
+
white-space: nowrap;
|
|
533
|
+
will-change: transform;
|
|
534
|
+
animation-name: zf-tape-scroll;
|
|
535
|
+
animation-timing-function: linear;
|
|
536
|
+
animation-iteration-count: infinite;
|
|
537
|
+
}
|
|
538
|
+
.zf-tape:hover .zf-tape-track { animation-play-state: paused; }
|
|
539
|
+
.zf-tape-item {
|
|
540
|
+
display: inline-flex;
|
|
541
|
+
align-items: center;
|
|
542
|
+
gap: 7px;
|
|
543
|
+
padding: 0 15px;
|
|
544
|
+
border-right: 1px solid rgba(255, 255, 255, 0.06);
|
|
545
|
+
font-size: 12px;
|
|
546
|
+
line-height: 1;
|
|
547
|
+
}
|
|
548
|
+
.zf-tape-sym { font-weight: 700; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.02em; }
|
|
549
|
+
.zf-tape-px { color: rgba(255, 255, 255, 0.58); font-variant-numeric: tabular-nums; }
|
|
550
|
+
.zf-tape-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
551
|
+
@keyframes zf-tape-scroll {
|
|
552
|
+
from { transform: translateX(0); }
|
|
553
|
+
to { transform: translateX(-50%); }
|
|
554
|
+
}
|
|
555
|
+
@media (prefers-reduced-motion: reduce) {
|
|
556
|
+
.zf-tape { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
|
|
557
|
+
.zf-tape-track { animation: none; }
|
|
558
|
+
}
|
|
559
|
+
`;function Wv(){const e=Io(Uv,6e4),t=Io(void 0,6e4),{symbols:r,stats:n}=A.useMemo(()=>{const l=f=>Object.entries(f).filter(([,h])=>h.markPx>0&&h.prevDayPx>0).map(([h])=>h).sort();return{symbols:[...l(e),...l(t)].slice(0,jv),stats:{...t,...e}}},[e,t]),a=ee("quote-stream"),o=A.useRef(null),i=r.join(",");if(A.useEffect(()=>{const l=o.current;if(!l||!(a!=null&&a.subscribeMids)||r.length===0)return;let u={};const f=()=>{for(const p of l.querySelectorAll("[data-zf-px]")){const g=u[p.dataset.zfPx??""];if(g===void 0)continue;const v=ci(g);p.textContent!==v&&(p.textContent=v)}},h=a.subscribeMids(p=>{u=p},r),d=window.setTimeout(f,400),m=window.setInterval(f,1500);return()=>{h(),clearTimeout(d),clearInterval(m)}},[a,i]),r.length===0)return null;const s=Math.max(40,r.length*2.2),c=l=>r.map(u=>{const f=n[u];if(!f)return null;const h=f.changePct>=0?Hv:Bv,d=f.changePct>=0?"+":"";return w.jsxs("span",{className:"zf-tape-item",children:[w.jsx(Fv,{symbol:u,size:15}),w.jsx("span",{className:"zf-tape-sym",children:Bn(u)}),w.jsx("span",{className:"zf-tape-px","data-zf-px":u,children:ci(f.markPx)}),w.jsxs("span",{className:"zf-tape-chg",style:{color:h},children:[d,f.changePct.toFixed(2),"%"]})]},`${l}-${u}`)});return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:Vv}),w.jsx("div",{className:"zf-tape","aria-label":"live ticker tape",children:w.jsxs("div",{ref:o,className:"zf-tape-track",style:{animationDuration:`${s}s`},children:[c("a"),w.jsx("span",{"aria-hidden":!0,style:{display:"contents"},children:c("b")})]})})]})}const li="(min-width: 1024px)";function Gv(){const[e,t]=A.useState(()=>window.matchMedia(li).matches);return A.useEffect(()=>{const r=window.matchMedia(li),n=()=>t(r.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}const Yv="/unicornStudio.legacy.umd.mjs";let Pr=null;function Kv(){return typeof window>"u"||typeof document>"u"?Promise.reject(new Error("UnicornStudio needs a browser")):Pr||(Pr=(async()=>{const t=`const module={exports:{}};const exports=module.exports;
|
|
560
|
+
`+await fetch(Yv).then(n=>{if(!n.ok)throw new Error(`failed to load UnicornStudio (${n.status})`);return n.text()})+`
|
|
561
|
+
export default module.exports;`,r=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const a=(await import(r)).default;if(!(a!=null&&a.addScene))throw new Error("UnicornStudio engine missing addScene");return a}finally{URL.revokeObjectURL(r)}})(),Pr.catch(()=>{Pr=null}),Pr)}class qv{constructor(t){K(this,"_url");this._raw=t;const r=URL.createObjectURL(new Blob([JSON.stringify(this._raw)],{type:"application/json"}));this._url=r}get url(){return this._url}}const ui=new qv({history:[{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"gradient",usesPingPong:!1,speed:.25,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
562
|
+
precision highp float;in vec2 vTextureCoord;uniform vec2 uMousePos;vec3 getColor(int index) { switch(index) { case 0: return vec3(1, 1, 1); case 1: return vec3(0, 0, 0); case 2: return vec3(0, 0, 0); case 3: return vec3(0, 0, 0); case 4: return vec3(0, 0, 0); case 5: return vec3(0, 0, 0); case 6: return vec3(0, 0, 0); case 7: return vec3(0, 0, 0); case 8: return vec3(0, 0, 0); case 9: return vec3(0, 0, 0); case 10: return vec3(0, 0, 0); case 11: return vec3(0, 0, 0); case 12: return vec3(0, 0, 0); case 13: return vec3(0, 0, 0); case 14: return vec3(0, 0, 0); case 15: return vec3(0, 0, 0); default: return vec3(0.0); } }const float PI = 3.14159265;vec2 rotate(vec2 coord, float angle) { float s = sin(angle); float c = cos(angle); return vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); }out vec4 fragColor;vec3 getColor(vec2 uv) {return vec3(1, 1, 1); }void main() {vec2 uv = vTextureCoord; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); uv -= pos; uv /= (0.5000*2.); uv = rotate(uv, (0.0000 - 0.5) * 2. * PI); vec4 color = vec4(getColor(uv), 1.); fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
563
|
+
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }`],data:{downSample:.5,depth:!1,uniforms:{},isBackground:!0},id:"effect"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0793650793650795,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"NORMAL",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.49660178547135064,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.35409161821999585,leftMode:"relative",top:.6850280273460352,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.49660178547135064,0],[.49660178547135064,.4600869483043395],[0,.4600869483043395]],fill:["#7001D7"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
564
|
+
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform sampler2D uBgTexture; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform int uSampleBg;out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000);uv = uv - pos;vec4 color = texture(uTexture, uv); vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); }color = mix(background, color / max(color.a, 0.0001), color.a * 1.0000);fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
565
|
+
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0158730158730158,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.46738991573774175,widthMode:"relative",height:.46008694830433955,heightMode:"auto",left:.7457263018329404,leftMode:"relative",top:.5757566919333954,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.46738991573774175,0],[.46738991573774175,.46008694830433955],[0,.46008694830433955]],fill:["#4E21AC"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
566
|
+
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
567
|
+
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape1"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:.996031746031746,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.45826120644598894,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.49185679854495884,leftMode:"relative",top:.35992750274551055,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.45826120644598894,0],[.45826120644598894,.4600869483043395],[0,.4600869483043395]],fill:["#FFC7E6"],fitToCanvas:!1,gradientType:"linear",type:"rectangle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
568
|
+
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
569
|
+
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"blur",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
570
|
+
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 0 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 0 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
571
|
+
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 1 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 1 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
572
|
+
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 2 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 2 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
573
|
+
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; } uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 3 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 3 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction);float dither = (randFibo(gl_FragCoord.xy) - 0.5) / 255.0; color.rgb += dither; fragColor = color;}`],compiledVertexShaders:[`#version 300 es
|
|
574
|
+
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{downSample:.25,depth:!1,uniforms:{},isBackground:!1,passes:[{prop:"vertical",value:1,downSample:.25},{prop:"vertical",value:2,downSample:.5},{prop:"vertical",value:3,downSample:.5}]},id:"effect1"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sdf_shape",usesPingPong:!1,texture:!1,speed:1,trackMouseMove:0,mouseMomentum:1,trackMouse:.15,animating:!0,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
575
|
+
precision highp float; precision highp int;in vec2 vTextureCoord; uniform sampler2D uTexture;uniform float uTime;uniform vec2 uMousePos; uniform vec2 uResolution;uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }const float PI = 3.141592653; const float PI2 = 6.283185306; const int DISP_STEPS = 12; const vec3 viewDir = vec3(0,0, -4.25);ivec2 customTexSize; float customTexAspect;const mat3 ROT_Y_90 = mat3( 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0 );const mat3 ROT_Z_90 = mat3( 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );const mat3 ROT_X_90 = mat3( 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 );mat3 rotY(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); }mat3 rotX(float ang) { float c = cos(ang), s = sin(ang); return mat3(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); }mat3 rotZ(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); }mat2 rot(float a) { float s = sin(a); float c = cos(a); return mat2(c, -s, s, c); }vec3 twistY(vec3 p, float amount) { float c = cos(amount * p.y); float s = sin(amount * p.y); mat2 m = mat2(c, -s, s, c); return vec3(m * p.xz, p.y); }vec3 twistX(vec3 p, float amount) { float c = cos(amount * p.x); float s = sin(amount * p.x); mat2 m = mat2(c, -s, s, c); return vec3(p.x, m * p.yz); }float smin(float a, float b, float k) { float h = max(k - abs(a - b), 0.0); return min(a, b) - h * h * 0.25 / k; }float sphere(vec3 p, float r) { return length(p) - r; }float sdfCylinder(vec3 p, float radius, float height) { vec2 d = abs(vec2(length(p.xz) - radius, p.y)) - vec2(radius, height * 0.5); return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); }float sdStar5(vec2 p, float r, float rf) { const vec2 k1 = vec2(0.809016994375, -0.587785252292); const vec2 k2 = vec2(-k1.x,k1.y); p.x = abs(p.x); p -= 2.0*max(dot(k1,p),0.0)*k1; p -= 2.0*max(dot(k2,p),0.0)*k2; p.x = abs(p.x); p.y -= r; vec2 ba = rf*vec2(-k1.y,k1.x) - vec2(0,1); float h = clamp( dot(p,ba)/dot(ba,ba), 0.0, r ); return length(p-ba*h) * sign(p.y*ba.x-p.x*ba.y); }float mergedDiscs(vec3 p) { float result = sdfCylinder(p, 0.7, 0.01 + 0.0000 * 0.5);for(float i = 1.; i < 4.; i++) { float angle = (i * 45.)/360. * 2.0 * PI; mat2 rotZMat = rot(angle); vec3 rotatedP = vec3(rotZMat * p.xy, p.z);result = smin( result, sdfCylinder(rotatedP, 0.7, 0.01 + 0.0000 * 0.5), 0.2 ); }return max(result, sphere(p, 1.4)); }vec3 getRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getThreeDRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getAdjustedP(vec3 p) { float scale = max(0.2600, 0.000000001); float scaleFactor = 1.0/scale; vec3 adjustedP = p * scaleFactor;vec2 twist = vec2(0.7, 0.82);adjustedP.xy *= vec2(uResolution.x / uResolution.y, 1);adjustedP *= (1. + (0.4800 + 0.01));vec2 mousePos = mix(vec2(0), uMousePos - 0.5, 0.1500); vec2 axis = vec2(-1. * vec3(0.48503740648379057, 0.5187032418952618, 0.6966).y - 1. + mousePos.y/PI, vec3(0.48503740648379057, 0.5187032418952618, 0.6966).x + mousePos.x/PI) * 2.;adjustedP = getRepeat(adjustedP);float baseTime = uTime * 0.02; float timeX = vec3(0, 1.2, 0).x * baseTime; float timeY = vec3(0, 1.2, 0).y * baseTime; float timeZ = vec3(0, 1.2, 0).z * baseTime;mat3 rotYMat = rotY(axis.y * PI); mat3 rotXMat = rotX(axis.x * PI); mat3 rotZMat = rotZ(vec3(0.48503740648379057, 0.5187032418952618, 0.6966).z * 2.0 * PI);mat3 combinedRotation = rotZMat * rotYMat * rotXMat; mat3 combinedAnimation = rotZ(timeZ) * rotX(timeX) * rotY(timeY);adjustedP = combinedRotation * adjustedP; adjustedP = combinedAnimation * adjustedP; adjustedP = getThreeDRepeat(adjustedP); adjustedP = mix(adjustedP, twistY(adjustedP, -1.0 * twist.y), step(0.0, abs(twist.y))); adjustedP = mix(adjustedP, twistX(adjustedP, -1.0 * twist.x), step(0.0, abs(twist.x)));return adjustedP; }float getMergedSDF(vec3 p) { p = getAdjustedP(p); return mergedDiscs(p); }float fresnel(vec3 eyeVector, vec3 worldNormal, float power) { float NdotV = abs(dot(eyeVector, worldNormal)); float width = fwidth(dot(eyeVector, worldNormal)); float threshold = 0.2; float edgeDampFactor = smoothstep(threshold, -threshold, width); float fresnelFactor = 1.0 - NdotV; return pow(fresnelFactor, power) * mix(1., edgeDampFactor * 2., 0.5); }vec3 noFrostOrDispersion(vec3 rd, vec3 normal) { float ior = 1.0 / (1.0 + 0.7000 * 0.25); vec3 refractedRay = refract(rd, normal, ior); return texture(uTexture, vTextureCoord - refractedRay.xy).rgb; }vec3 frostOrDispersion(vec3 rd, vec3 normal) { vec3 refractionColor = vec3(0); float iorBase = 1. + 0.7000 * 0.25;vec3 dispCoefficients = vec3(0.03, 0.06, 0.1) * 0.2500 * 1.2;for (int i = 0; i < DISP_STEPS; ++i) { float step = float(i) / float(DISP_STEPS); vec3 disp = step * dispCoefficients; vec3 ior = 1.0 / (iorBase + disp);vec3 refractedRayR = refract(rd, normal, ior.r); vec3 refractedRayG = refract(rd, normal, ior.g); vec3 refractedRayB = refract(rd, normal, ior.b);refractionColor.r += texture(uTexture, vTextureCoord - refractedRayR.xy).r; refractionColor.g += texture(uTexture, vTextureCoord - refractedRayG.xy).g; refractionColor.b += texture(uTexture, vTextureCoord - refractedRayB.xy).b; }return clamp(refractionColor / float(DISP_STEPS), 0.0, 1.0); }vec3 calculateNormal(vec3 p, float eps) { vec2 e = vec2(1.0, -1.0) * eps * 0.5; return normalize( e.xyy * getMergedSDF(p + e.xyy) + e.yyx * getMergedSDF(p + e.yyx) + e.yxy * getMergedSDF(p + e.yxy) + e.xxx * getMergedSDF(p + e.xxx) ); }vec3 sampleTexture(vec3 rd, vec3 normal) {return frostOrDispersion(rd, normal); return noFrostOrDispersion(rd, normal); }float scene(vec3 p) { return max(0.0000000001, getMergedSDF(p) - (0.4800 + 0.005)) * max(0.2600, 0.000000001); }const int STEPS = 128; const float MAX_DISTANCE = 100.0;vec4 rayMarch(vec3 ro, vec3 rd) { float pixelSize = 0.0025; float traveled = 0.; vec3 entryPoint = vec3(0.0); vec3 entryNormal = vec3(0.0); float partialAlpha = 0.0; float lastDistance = 0.0; float smoothing = mix(1., 4., 1.0000);for (int i = 0; i < STEPS; ++i) { vec3 currentPos = ro + rd * traveled; float distance = scene(currentPos); float progress = float(i)/float(STEPS); float step = distance * mix(1., 1.5, progress);if (distance > MAX_DISTANCE) break;if (distance < pixelSize) { partialAlpha = 1.; entryPoint = currentPos; entryNormal = calculateNormal(entryPoint, pixelSize * smoothing); break; }lastDistance = distance;traveled += max(step, pixelSize); if (traveled > MAX_DISTANCE) break; }if (partialAlpha == 0.0) { return texture(uTexture, vTextureCoord); }vec3 samplePosition = mix(rd, entryPoint, 0.0000);vec3 refractionColor = vec3(0.0);refractionColor = sampleTexture(samplePosition, entryNormal); vec3 lightDir = vec3(((vec2(vec3(0.25, 0.25, -3).x, 1.-vec3(0.25, 0.25, -3).y) - 0.333) * 3.) - vec2(0.5, 0.5), vec3(0.25, 0.25, -3).z); vec3 normLightDir = normalize(lightDir);float lightAndShadow = dot(entryNormal, normLightDir); vec3 lightColor = mix(vec3(1), vec3(1, 1, 1), 1. - 0.0000); vec3 fresnelEffect = vec3(0.0);fresnelEffect = fresnel(rd, entryNormal, 8.0) * 0.3000 * vec3(1, 1, 1);vec3 specularEffect = vec3(0.0);vec3 halfwayDir = normalize(lightDir + rd); float specFactor = pow(max(dot(entryNormal, halfwayDir), 0.0), 64.0 * 0.3000 + 0.01); specularEffect = specFactor * 0.3000 * lightColor;vec3 combinedEffects = fresnelEffect + specularEffect; vec3 finalColor = mix(refractionColor, vec3(1, 1, 1) * lightAndShadow, 0.0000); finalColor += combinedEffects;vec4 outputColor = vec4(finalColor, 1.);return outputColor; }out vec4 fragColor;void main() { vec4 col = vec4(0); vec4 bg = texture(uTexture, vTextureCoord);if(0.2600 <= 0.0001 || 0.5000 <= 0.0001) { col = vec4(0); if(1 == 1) { col = bg; } fragColor = col; return; }vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); vec2 uv = vTextureCoord - pos; float fovFactor = tan(radians(20.) * 0.5); vec3 rd = vec3(uv * fovFactor, 0.5); col = rayMarch(viewDir, rd); float dither = (randFibo(vTextureCoord.xy) - 0.5) / 255.0; col += dither;col = mix(bg, col, 0.5000); fragColor = col;}`],compiledVertexShaders:[`#version 300 es
|
|
576
|
+
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sphere",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
577
|
+
precision mediump float; in vec3 vVertexPosition; in vec2 vTextureCoord; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution;const float STEPS = 16.0; const float PI = 3.1415926;vec3 chromaticAbberation(vec2 st, float angle, float amount, float blend) { float aspectRatio = uResolution.x/uResolution.y; float rotation = angle * 360.0 * PI / 180.0; vec2 aberrated = amount * vec2(0.1 * sin(rotation) * aspectRatio, 0.1 * cos(rotation)); aberrated *= distance(st, vec2(0.5)) * 2.0; vec4 red = vec4(0); vec4 blue = vec4(0); vec4 green = vec4(0); float invSteps = 1.0 / STEPS; float invStepsHalf = invSteps * 0.5; for(float i = 1.0; i <= STEPS; i++) { vec2 offset = aberrated * (i * invSteps); red += texture(uTexture, st - offset) * invSteps; blue += texture(uTexture, st + offset) * invSteps; }for (float i = 0.0; i <= STEPS; i++) { vec2 offset = aberrated * ((i * invSteps) - 0.5); green += texture(uTexture, st + offset) * invSteps; } return vec3(red.r, green.g, blue.b); }vec2 sphericalTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float tau) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter);float z = sqrt(lensRadius * lensRadius - s * s);float uAlpha = (1.0 - (1.0 / tau)) * asin(u / lensRadius); float vAlpha = (1.0 - (1.0 / tau)) * asin(v / lensRadius);u = uCenter + z * sin(uAlpha); v = vCenter + z * sin(vAlpha);return vec2(u/aspectRatio, v); }float circularIn(float t) { return 1.0 - sqrt(1.0 - t * t); }vec2 fisheyeTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale ) { float aspectRatio = uResolution.x / uResolution.y;vec2 dir = vec2(u - uCenter, v - vCenter);dir.x /= lensRadius; dir.y /= lensRadius;float dist = length(dir) * 0.15;if (dist < 1.0) { float theta = atan(dir.y, dir.x);float r = dist * 2.0 * PI; float z = sqrt(1.0 - r * r) + 0.25; float rDist = atan(r, z) / PI; float newDist = mix(dist, rDist, 5.);dir.x = newDist * cos(theta); dir.y = newDist * sin(theta); }dir.x *= lensRadius; dir.y *= lensRadius;return mix(vec2(u/aspectRatio, v), vec2(uCenter/aspectRatio, vCenter) + dir, 1.0000); }vec2 discTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter); float r = sqrt(u * u + v * v) / lensRadius; if(r == 0.0) return vec2(uCenter, vCenter);r = pow(r, distortionScale); float theta = atan(r); float rad = theta / r;u = rad * u + uCenter; v = rad * v + vCenter;return vec2(u/aspectRatio, v); }out vec4 fragColor; void main() { vec2 uv = vTextureCoord; vec4 color = texture(uTexture, uv); float aspectRatio = uResolution.x/uResolution.y; uv.x = uv.x * aspectRatio; vec2 sphereCoords = uv; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); pos.x *= aspectRatio;float radius = 0.5000 * uResolution.x/max(uResolution.x, uResolution.y);if(1 == 0) { sphereCoords = sphericalTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 1) { sphereCoords = discTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 2) { sphereCoords = fisheyeTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); }vec2 scaledCoords = (sphereCoords - 0.5) + 0.5; vec4 sphere = texture(uTexture, clamp(scaledCoords, 0.0, 1.0)); float distFromPos = distance(uv, pos); float edgeSmooth = 0.001; float insideSphere = 1.0 - smoothstep(radius/2.0 - edgeSmooth, radius/2.0, distFromPos); float insideSphereAlpha = 1.0 - smoothstep(radius/2.0 + 0.002 - edgeSmooth, radius/2.0 + 0.002, distFromPos); sphere.rgb = chromaticAbberation(scaledCoords, atan(scaledCoords.y, scaledCoords.x), distFromPos * 1.0000, 1.0); color = mix(color, sphere, insideSphere); color.rgb += vec3((0.5000-0.5)*2.) * mix(0., circularIn(smoothstep(0., radius, distFromPos)), insideSphere); if(1 == 1) { color.a = insideSphereAlpha; color.rgb = mix(vec3(0), color.rgb, insideSphereAlpha); } fragColor = color;}`],compiledVertexShaders:[`#version 300 es
|
|
578
|
+
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect3"}],options:{name:"zAI Orb final",fps:60,dpi:1.5,scale:1,includeLogo:!1,isProduction:!1},version:"1.4.29",id:"l9tOlEGo3rE5cxAzUCHg"});function Jv({className:e,dpi:t=2,scale:r=1,fps:n=60,onScene:a,onError:o}){const i=A.useRef(null),s=A.useId();return A.useEffect(()=>{if(!i.current)return;let c=!1,l=null;return(async()=>{try{const u=await Kv();if(c||!i.current)return;i.current.setAttribute("data-us-project-src",ui.url),l=u.addScene({filePath:ui.url,elementId:s,dpi:t,scale:r,fps:n});const f=await l;if(c){f.destroy();return}a(f)}catch{c||o()}})(),()=>{c=!0,a(null),l==null||l.then(u=>u.destroy()).catch(()=>{})}},[s,t,r,n]),w.jsx("div",{ref:i,id:s,className:e,role:"img","aria-hidden":!0})}const ia=80,va=40,pr=6,Xv=1e4,Zv=5e3;function sa(e,t){return e.find(r=>r.capabilities.includes(t))??null}function $v(e,t){return Promise.race([e.then(r=>r).catch(()=>null),new Promise(r=>setTimeout(()=>r(null),t))])}function Jt(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e);return t>=1e12?`$${(e/1e12).toFixed(2)}T`:t>=1e9?`$${(e/1e9).toFixed(2)}B`:t>=1e6?`$${(e/1e6).toFixed(2)}M`:t>=1e3?`$${Math.round(e).toLocaleString("en-US")}`:`$${e.toFixed(2)}`}function mr(e,t=1){return Number.isFinite(e)?`${e>=0?"+":""}${e.toFixed(t)}%`:"—"}function Qv(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e),r=t>=1e3?0:t>=1?2:t>=.01?4:6;return`$${e.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function ey(e){const t=[];if(typeof e.symbol=="string"&&t.push(e.symbol),Array.isArray(e.symbols))for(const r of e.symbols)typeof r=="string"&&t.push(r);return t}function ca(e){return e.filter(t=>t&&t!=="*"&&!t.endsWith(":*"))}function ty(e,t){for(const r of t){const n=e[r];if(typeof n=="string"&&n.trim())return n.trim()}return null}function Va(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function ry(e,t){return e.frames.map(r=>{const n=t.get(r.frame);let a=r.config??{};if(n){const o=n.schema.safeParse(a);o.success&&(a=o.data)}return{type:r.frame,title:r.title,capabilities:(n==null?void 0:n.capabilities)??[],config:a,symbols:ey(a)}})}function ny(e){const t=[];for(const r of e.slice(0,ia)){let n=`- ${r.type}`;if(r.title&&(n+=` "${r.title}"`),r.symbols.length&&(n+=` [${r.symbols.slice(0,va).join(", ")}]`),r.symbols.length===0){const a=ty(r.config,["text","content","body","label","timezone","feed"]);a&&(n+=`: ${Va(a,80)}`)}t.push(n)}return e.length>ia&&t.push(`- …and ${e.length-ia} more frames`),t}function la(e,t){const r=new Set;for(const n of e)if(n.capabilities.some(a=>t.includes(a)))for(const a of n.symbols)r.add(a);return[...r]}async function ay(e,t){const r=new Set;for(const h of t)for(const d of h.capabilities)r.add(d);const n=h=>r.has(h)&&sa(e,h),a=[],o=(h,d,m)=>{const p=n(d);p&&a.push($v(m(p),Zv).then(g=>g?[h,g]:null))},i=ca(la(t,["day-stats","quote-stream","ohlcv"])).slice(0,va);i.length&&o(1,"day-stats",async h=>{const d=await h.getDayStats(i),m=i.map(p=>{const g=d[p];return g?`${p} ${Qv(g.markPx)} (${mr(g.changePct)})`:null}).filter(Boolean);return m.length?`Prices: ${m.join(" · ")}`:null});const s=t.find(h=>h.capabilities.includes("sentiment")),c=typeof(s==null?void 0:s.config.sparklineDays)=="number"?s.config.sparklineDays:30;o(2,"sentiment",async h=>{const m=(await h.getFearGreed(c))[0];return m?`Fear & Greed: ${m.value} (${m.classification})`:null}),o(3,"global-market",async h=>{const d=await h.getGlobalMarket(),m=Object.entries(d.dominance).sort((p,g)=>g[1]-p[1]).slice(0,3).map(([p,g])=>`${p.toUpperCase()} ${g.toFixed(1)}%`).join(", ");return`Global crypto: total mcap ${Jt(d.totalMarketCapUsd)} (${mr(d.marketCapChangePct24h)} 24h); dominance ${m}`});const l=ca(la(t,["funding-history"])).slice(0,va);l.length&&o(4,"funding-history",async h=>{const d=await h.getFundingHistory(l,Date.now()-864e5),m=l.map(p=>{const g=d[p],v=g&&g[g.length-1];return v?`${p} ${mr(v.fundingRate*100,4)}`:null}).filter(Boolean);return m.length?`Funding (latest): ${m.join(" · ")}`:null});const u=ca(la(t,["open-interest"]));if(o(5,"open-interest",async h=>{const m=(await h.getOpenInterest(u.length?u:void 0)).slice(0,pr).map(p=>`${p.symbol} ${Jt(p.openInterestUsd)}`);return m.length?`Open interest: ${m.join(" · ")}`:null}),o(6,"tvl",async h=>{const m=(await h.getTvlByChain()).slice(0,pr).map(p=>`${p.name} ${Jt(p.tvl)}`);return m.length?`TVL by chain: ${m.join(" · ")}`:null}),o(7,"protocol-tvl",async h=>{const m=(await h.getProtocolTvl()).slice(0,pr).map(p=>`${p.name} ${Jt(p.tvl)}`);return m.length?`Protocol TVL: ${m.join(" · ")}`:null}),o(8,"dex-volume",async h=>{const m=(await h.getDexVolume()).slice(0,pr).map(p=>`${p.name} ${Jt(p.volume24h)}`);return m.length?`DEX volume (24h): ${m.join(" · ")}`:null}),o(9,"protocol-fees",async h=>{const m=(await h.getProtocolFees()).slice(0,pr).map(p=>`${p.name} ${Jt(p.fees24h)}`);return m.length?`Protocol fees (24h): ${m.join(" · ")}`:null}),o(10,"coin-markets",async h=>{const m=(await h.getCoinMarkets()).slice(0,pr).map(p=>`${p.symbol} ${Jt(p.marketCapUsd)}${p.changePct24h!=null?` (${mr(p.changePct24h)})`:""}`);return m.length?`Top coins by mcap: ${m.join(" · ")}`:null}),o(11,"coin-movers",async h=>{const m=[...await h.getCoinMovers(300)].sort((v,b)=>(b.changePct["24h"]??0)-(v.changePct["24h"]??0)),p=m.slice(0,3).map(v=>`${v.symbol} ${mr(v.changePct["24h"]??0)}`),g=m.slice(-3).reverse().map(v=>`${v.symbol} ${mr(v.changePct["24h"]??0)}`);return m.length?`Movers (24h): up ${p.join(", ")} · down ${g.join(", ")}`:null}),n("news")){const h=sa(e,"news"),d=new Set;for(const m of t){if(!m.capabilities.includes("news"))continue;const p=typeof m.config.feed=="string"?m.config.feed:null;if(!p||d.has(p))continue;d.add(p);const g=m.symbols.length?[...m.symbols]:void 0;o(12,"news",async()=>{const b=(await h.getNews({feed:p,symbols:g,limit:4})).slice(0,4).map(x=>`“${Va(x.title,90)}”`);return b.length?`News (${p}): ${b.join("; ")}`:null})}}if(o(13,"btc-fees",async h=>{const d=await h.getBtcFees();return`BTC fees: fastest ${d.fastest}, 1h ${d.hour}, economy ${d.economy} sat/vB`}),o(14,"btc-mempool",async h=>{const d=await h.getMempoolState();return`Mempool: ${d.count.toLocaleString("en-US")} txs, ${d.projected.length} blocks pending`}),o(15,"btc-blocks",async h=>{const m=(await h.getBtcBlocks(1))[0];return m?`Latest block: #${m.height} (${m.poolName}, ${m.txCount} txs)`:null}),o(16,"btc-difficulty",async h=>{const d=await h.getDifficultyAdjustment();return`Difficulty: ${mr(d.difficultyChange)} expected in ${d.remainingBlocks} blocks`}),o(17,"mining-pools",async h=>{const m=(await h.getMiningPools("1w")).pools[0];return m?`Mining pools (1w): ${m.name} ${m.sharePct.toFixed(1)}%`:null}),o(18,"lightning-stats",async h=>{const d=await h.getLightningStats();return`Lightning: ${d.nodeCount.toLocaleString("en-US")} nodes, ${d.channelCount.toLocaleString("en-US")} channels`}),o(19,"yield-curve",async h=>{const d=await h.getYieldCurve(),m=g=>d.points.find(v=>v.label===g),p=["3M","2Y","10Y","30Y"].map(g=>{const v=m(g);return v?`${g} ${v.rate.toFixed(2)}%`:null}).filter(Boolean);return p.length?`Yield curve (${d.date}): ${p.join(", ")}`:null}),o(20,"reference-rates",async h=>{const m=(await h.getReferenceRates()).slice(0,3).map(p=>`${p.code} ${p.rate.toFixed(2)}%`);return m.length?`Reference rates: ${m.join(", ")}`:null}),o(21,"financial-stress",async h=>{const d=await h.getFinancialStress();return`Financial stress (OFR): ${d.value.toFixed(2)} (${d.date})`}),o(22,"national-debt",async h=>{const d=await h.getNationalDebt();return`US national debt: ${Jt(d.total)} (${d.date})`}),n("options-summary")){const h=new Set;for(const m of t)m.capabilities.includes("options-summary")&&h.add(typeof m.config.currency=="string"?m.config.currency:"BTC");const d=sa(e,"options-summary");for(const m of h)o(23,"options-summary",async()=>{const p=await d.getOptionsSummary(m);return`Options ${p.currency}: put/call ${p.putCallRatioOi.toFixed(2)} (OI), avg IV ${p.avgIv.toFixed(1)}%`})}if(n("portfolio"))for(const h of t){if(!h.capabilities.includes("portfolio"))continue;const d=h.config.source;if(!d||typeof d.kind!="string")continue;const m=e.find(p=>p.getPortfolio&&(p.portfolioKinds??[]).includes(d.kind));m&&o(24,"portfolio",async()=>{const p=await m.getPortfolio(d),g=p.totalUsd??p.holdings.reduce((b,x)=>b+(x.valueUsd??0),0),v=[...p.holdings].sort((b,x)=>(x.valueUsd??0)-(b.valueUsd??0)).slice(0,pr).map(b=>b.symbol).join(", ");return`Portfolio (${p.label??p.source}): ${Jt(g)}${v?`, top: ${v}`:""}`})}return(await Promise.all(a)).filter(h=>h!==null).sort((h,d)=>h[0]-d[0]).map(h=>h[1])}function oy(e,t){const r=Un();return A.useCallback(async()=>{try{const n=ry(e,t);if(n.length===0)return null;const a=ny(n),o=await ay(r,n),i=[];a.length&&i.push(`Frames on the dashboard:
|
|
579
|
+
${a.join(`
|
|
580
|
+
`)}`),o.length&&i.push(`Live readings right now:
|
|
581
|
+
${o.join(`
|
|
582
|
+
`)}`);const s=i.join(`
|
|
583
|
+
|
|
584
|
+
`);return s?Va(s,Xv):null}catch{return null}},[r,e,t])}var gn;function iy(e){if(!gn)if(typeof document<"u")gn=document.createElement("textarea");else return;var t="&"+e+";";gn.innerHTML=t;var r=gn.value;return r!==t?r:void 0}var R=32,U=9,wr=13,J=10,Ae=96,st=126,We=91,er=94,ge=62,Ot=35,ya=37,ue=45,Mt=61,dt=92,qe=42,He=95,Pe=60,Us=64,jt=93,At=33,Vn=38,wt=58,ba=70,xr=102,En=104,br=119,Ir=116,wa=112,js=115,sy=160,cy=12,ly=44,Pn=59,rn=63,Rt=46,Ke=47,kr=39,Cr=34,lr=43,it=124,Hr=123,Wa=125,Ft=40,Ut=41,uy=120,dy=88,xa=30,pe=48,me=57,ce=65,fe=90,Me=97,Ie=122,Wn=128,It=32,fy={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},T=fy;function hy(e){if(!fi(e,"---"))return null;let t=3;for(;t<e.length&&(e[t]===" "||e[t]===" ");)t++;if(t<e.length&&e[t]==="\r"&&t++,t>=e.length||e[t]!==`
|
|
585
|
+
`)return null;t++;let r=!1;for(;t<e.length;){let n=t;for(;t<e.length&&e[t]!==`
|
|
586
|
+
`&&e[t]!=="\r";)t++;if(t>=e.length)break;let a=t;if(e[t]==="\r"&&t++,t<e.length&&e[t]===`
|
|
587
|
+
`&&t++,fi(e,"---",n))return{endPos:t,hasValidYaml:r};if(!r){let o=Cy(e,n,a);if(o<a){let i=e.charCodeAt(o);if(i>=Me&&i<=Ie||i>=ce&&i<=fe||i>=pe&&i<=me||i===He){for(o++;o<a&&(i=e.charCodeAt(o),i>=Me&&i<=Ie||i>=ce&&i<=fe||i>=pe&&i<=me||i===He||i===ue||i===Rt);)o++;o<a&&e.charCodeAt(o)===wt&&(o++,o>=a?r=!0:(i=e.charCodeAt(o),(i===R||i===U)&&(r=!0)))}}}}return null}var py=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,my={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap",viewbox:"viewBox"},gy={};function Tt(e){if(!e)return gy;var t={};for(var r in e){var n=r.toLowerCase(),a=my[n];if(a)t[a]=e[r];else{var o=r.indexOf(":");o!==-1?t[r.slice(0,o)+r[o+1].toUpperCase()+r.slice(o+2)]=e[r]:t[r]=e[r]}}return t}var vy=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function Gn(e){return e.indexOf("&")===-1?e:e.replace(py,(t,r)=>{var n=iy(r);if(n)return n;if(r[0]==="#"){var a=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return a===0||a>=55296&&a<=57343||a>1114111?"�":a<=65535?String.fromCharCode(a):String.fromCharCode(55296+(a-65536>>10),56320+(a-65536&1023))}return t})}var di=/(javascript|vbscript|data(?!:image)):/i;function Ga(e){if(di.test(e))return null;if(e.indexOf("%")===-1)return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(di.test(t))return null}catch{return null}return e}var yt={},xt,ct;for(xt=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],ct=0;ct<xt.length;ct++)yt[xt[ct]]="a";for(yt[231]=yt[199]="c",yt[240]=yt[208]="d",xt=[200,201,202,203,233,232,234,235],ct=0;ct<xt.length;ct++)yt[xt[ct]]="e";for(xt=[207,239,206,238,205,237,204,236],ct=0;ct<xt.length;ct++)yt[xt[ct]]="i";for(yt[209]=yt[241]="n",xt=[248,216,339,338,213,245,212,244,211,243,210,242],ct=0;ct<xt.length;ct++)yt[xt[ct]]="o";for(xt=[220,252,219,251,218,250,217,249],ct=0;ct<xt.length;ct++)yt[xt[ct]]="u";yt[376]=yt[255]=yt[221]=yt[253]="y";function Dt(e){for(var t="",r=-1,n=e.length,a=0;a<n;a++){var o=e.charCodeAt(a);if(o>=Me&&o<=Ie||o>=pe&&o<=me){r<0&&(r=a);continue}if(o>=ce&&o<=fe){r>=0&&(t+=e.slice(r,a),r=-1),t+=String.fromCharCode(o+It);continue}if(o===R||o===ue){r>=0&&(t+=e.slice(r,a),r=-1),t+="-";continue}r>=0&&(t+=e.slice(r,a),r=-1);var i=yt[o];i&&(t+=i)}return r>=0&&(t+=e.slice(r)),t}function fi(e,t,r){return e.startsWith(t,r)}var hi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","set"]);function nn(e){let t=e.toLowerCase();if(hi.has(t))return!0;let r=t.indexOf(":");return r!==-1?(t=t.slice(r+1),hi.has(t)):!1}var yr=1,pi=2,Or=4,mi=8,yy=16,Lt=32,ar=64,by=(function(){var e=new Uint8Array(128),t;for(e[U]=yr,e[J]=yr|pi,e[cy]=yr,e[wr]=yr|pi,e[R]=yr,t=At;t<=Ke;t++)e[t]=Or;for(t=wt;t<=Us;t++)e[t]=Or;for(t=We;t<=Ae;t++)e[t]=Or;for(t=Hr;t<=st;t++)e[t]=Or;for(t=pe;t<=me;t++)e[t]=yy;for(t=ce;t<=fe;t++)e[t]=mi;for(t=Me;t<=Ie;t++)e[t]=mi;return e})(),wy=/[\p{P}\p{S}]/u,xy=new RegExp("\\p{Zs}","u"),gr=[];function ky(e){var t=e.indexOf("\r"),r=e.indexOf("\0");if(t===-1&&r===-1)return e;var n=e.length;gr.length=0;var a=0,o=0;for(t===-1?o=r:r===-1?o=t:o=t<r?t:r;o<n;o++){var i=e.charCodeAt(o);i===wr?(a<o&&gr.push(e.slice(a,o)),o+1<n&&e.charCodeAt(o+1)===J&&o++,gr.push(`
|
|
588
|
+
`),a=o+1):i===0&&(a<o&&gr.push(e.slice(a,o)),gr.push("�"),a=o+1)}return a<n&&gr.push(e.slice(a)),gr.join("")}function Cy(e,t,r){let n=r??e.length;for(;t<n&&(e[t]===" "||e[t]===" ");)t++;return t}function Hs(e){if(!e)return!1;for(var t in e)return!0;return!1}function _y(e){return{attrs:{},children:[{type:T.text,text:e}],d:!0,type:T.htmlBlock,tag:"header"}}var Ay=/^\n+/;function Sy(e){for(var t=e.length;t>0&&(e[t-1]===`
|
|
589
|
+
`||e[t-1]==="\r");)t--;return e.slice(0,t).replace(Ay,"")+`
|
|
590
|
+
|
|
591
|
+
`}function Nr(e){var r,n;if((e.type===T.htmlSelfClosing||e.type===T.htmlBlock)&&e.b)return[];if(e.type===T.paragraph){var t=e.children;return t?t.flatMap(Nr):[]}return e.type===T.text?(r=e.text)!=null&&r.trim()?[e]:[]:e.type===T.htmlBlock&&e.children?[{...e,children:(n=e.children)==null?void 0:n.flatMap(Nr)}]:[e]}function Bs(e){for(var t=0;t<e.length;t++){if(e[t].type===T.htmlBlock){var r=e[t],n=!1;if(r.d&&r.a&&t===e.length-1){var a="</"+String(r.tag).toLowerCase()+">",o=r.a.toLowerCase().indexOf(a);if(o!==-1){var i=r.a.slice(o+a.length).replace(/<\/[a-z][a-z0-9-]*\s*>/gi,"");i.trim()&&(n=!0)}}n||(r.d=!1)}"children"in e[t]&&e[t].children&&Bs(e[t].children)}}function zy(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.type===T.paragraph&&n.children)for(var a=n.children,o=0;o<a.length;o++){var i=a[o];if(i.type===T.htmlSelfClosing&&i.b&&i.tag.toLowerCase()===t){var s=e.slice(0,r);o>0&&s.push({type:T.paragraph,children:a.slice(0,o)});var c=[];if(o+1<a.length){var l=a.slice(o+1).filter(function(u){return!(u.type===T.htmlSelfClosing&&u.b)});l.length>0&&(c=l)}return c=c.concat(e.slice(r+1)),{found:!0,beforeClose:s,afterClose:c}}}if((n.type===T.htmlSelfClosing||n.type===T.htmlBlock)&&n.b&&n.tag.toLowerCase()===t)return{found:!0,beforeClose:e.slice(0,r),afterClose:e.slice(r+1)}}return{found:!1,beforeClose:e,afterClose:[]}}function Ty(e,t,r){var n=e.replace(new RegExp("\\s*</"+t+">\\s*$","i"),"");return r?Vs(n):n}function gi(e){var t="";for(var r in e){var n=e[r];n===!0?t+=" "+r:n!=null&&n!==!1&&(t+=" "+r+'="'+String(n)+'"')}return t}function Ey(e){var t=[];if(!e)return t;for(var r in e)r.charCodeAt(0)===94&&t.push({identifier:r,footnote:e[r].target});return t}function ka(e,t,r){if(t.indexOf(".")===-1)return(e==null?void 0:e[t])||r;for(var n=e,a=t.split("."),o=0;o<a.length&&(n=n==null?void 0:n[a[o]],n!==void 0);)o++;return n||r}function Py(e){for(var t=!1,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=R||n===Cr||n===ya||n===Pe||n===ge||n===We||n===dt||n===jt||n===er||n===Ae||n>=123){t=!0;break}}if(!t)return e;for(var a="",r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n===ya&&r+2<e.length){var o=e.charCodeAt(r+1),i=e.charCodeAt(r+2);if((o>=pe&&o<=me||o>=ce&&o<=ba||o>=Me&&o<=xr)&&(i>=pe&&i<=me||i>=ce&&i<=ba||i>=Me&&i<=xr)){a+=e[r]+e[r+1]+e[r+2],r+=2;continue}}a+=encodeURI(e[r])}return a}function My(...e){return e.filter(Boolean).join(" ")}var Dy=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),Mn=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function vi(e){return Dy.has(e.toLowerCase())}function Ry(e){return Mn.lastIndex=0,Mn.test(e)}function Vs(e){return Mn.lastIndex=0,e.replace(Mn,function(t,r,n,a){return"<"+r+n+a})}var Oy=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,Ny=/^<[A-Z]/,Ca=["script","pre","style","textarea"],an=new Set(Ca),Ly=/<(?:pre|script|style|textarea)\b/i,yi=/<(?:pre|script|style|textarea)\b/iy,ua=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,bi=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,Ws=new Uint8Array(128);(function(){for(var e=[Ae,qe,He,st,Mt,We,At,Pe,dt,Vn,J,En,br,xr],t=0;t<e.length;t++)Ws[e[t]]=1})();var wi=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function Iy(e){return an.has(e)}function Fy(e){return Ly.test(e)}function Gs(e,t,r){for(var n=t,a=r;n<a&&(e.charCodeAt(n)===R||e.charCodeAt(n)===U);)n++;if(n>=a)return!1;e.charCodeAt(n)===it&&n++;for(var o=0;n<a;){for(;n<a&&(e.charCodeAt(n)===R||e.charCodeAt(n)===U);)n++;if(n>=a)break;if(e.charCodeAt(n)===it&&o>0){for(var i=n+1;i<a&&(e.charCodeAt(i)===R||e.charCodeAt(i)===U);)i++;if(i>=a)return!0}if(e.charCodeAt(n)===wt&&n++,n>=a||e.charCodeAt(n)!==ue)return!1;for(;n<a&&e.charCodeAt(n)===ue;)n++;for(n<a&&e.charCodeAt(n)===wt&&n++,o++;n<a&&(e.charCodeAt(n)===R||e.charCodeAt(n)===U);)n++;if(n<a)if(e.charCodeAt(n)===it)n++;else return!1}return o>0}function Zt(e,t){if(e.charCodeAt(t)!==Pe)return null;let r=t+1,n=e.length,a=!1;e.charCodeAt(r)===Ke&&(r++,a=!0);let o=r,i=e.charCodeAt(r);if(!(i>=Me&&i<=Ie||i>=ce&&i<=fe))return null;for(;r<n&&(e.charCodeAt(r)>=Me&&e.charCodeAt(r)<=Ie||e.charCodeAt(r)>=ce&&e.charCodeAt(r)<=fe||e.charCodeAt(r)>=pe&&e.charCodeAt(r)<=me||e.charCodeAt(r)===ue);)r++;let s=e.slice(o,r);if(!s)return null;let c=r;for(;r<n&&(e.charCodeAt(r)===R||e.charCodeAt(r)===U||e.charCodeAt(r)===J);)r++;let l=e.slice(c,r);if(r===c&&r<n){var u=e.charCodeAt(r);if(u!==ge&&u!==Ke)return null}let f=r,h={},d=!1;for(;r<n;){let z=e.charCodeAt(r);if(z===ge){let D=e.slice(f,r);return{tag:s,attrs:h,selfClosing:!1,end:r+1,rawAttrs:D,whitespaceBeforeAttrs:l,isClosing:a,hasSpaceBeforeSlash:d}}if(z===R||z===U||z===J){r++;continue}if(z===Ke&&r+1<n&&e.charCodeAt(r+1)===ge){let D=e.slice(f,r);return d=r>f&&e.charCodeAt(r-1)===R,{tag:s,attrs:h,selfClosing:!0,end:r+2,rawAttrs:D,whitespaceBeforeAttrs:l,isClosing:a,hasSpaceBeforeSlash:d}}var m=r,p=e.charCodeAt(r);if(!(p>=Me&&p<=Ie||p>=ce&&p<=fe||p===He||p===wt))return null;for(r++;r<n;){var g=e.charCodeAt(r);if(g>=Me&&g<=Ie||g>=ce&&g<=fe||g>=pe&&g<=me||g===He||g===Rt||g===wt||g===ue)r++;else break}for(var v=e.slice(m,r);r<n&&(e.charCodeAt(r)===R||e.charCodeAt(r)===U);)r++;if(e.charCodeAt(r)!==Mt){h[v]="";continue}for(r++;r<n&&(e.charCodeAt(r)===R||e.charCodeAt(r)===U);)r++;var b=e.charCodeAt(r);if(b===Cr||b===kr){r++;for(var x=r;r<n&&e.charCodeAt(r)!==b;)r++;if(r>=n)return null;if(h[v]=e.slice(x,r),r++,r<n){var P=e.charCodeAt(r);if(P!==R&&P!==U&&P!==J&&P!==ge&&P!==Ke)return null}}else if(b===Hr){var C=1,x=r;for(r++;r<n&&C>0;){var g=e.charCodeAt(r);g===Hr?C++:g===Wa&&C--,r++}h[v]=e.slice(x,r)}else{for(var x=r;r<n;){var y=e.charCodeAt(r);if(y===R||y===U||y===ge||y===J||y===Cr||y===kr||y===Mt||y===Pe||y===Ae)break;r++}if(r===x)return null;h[v]=e.slice(x,r)}}return null}function Uy(e,t,r){if(!r.optimizeForStreaming&&e.indexOf("[")===-1)return!1;for(var n=0,a=e.length,o=!1,i=!1;n<a;){for(var s=e.indexOf(`
|
|
592
|
+
`,n),c=s<0?a:s,l=n,u=0;l<c&&u<4;)if(e.charCodeAt(l)===R)u++,l++;else if(e.charCodeAt(l)===U)u+=4,l++;else break;if(l>=c){o=!1,n=s<0?a:s+1;continue}if(u<4){var f=e.charCodeAt(l);if(f===Ae||f===st){for(var h=f,d=0,m=l;m<c&&e.charCodeAt(m)===h;)d++,m++;if(d>=3){var p=!0;if(h===Ae){for(var g=m;g<c;g++)if(e.charCodeAt(g)===Ae){p=!1;break}}if(p){o=!1;for(var v=s<0?a:s+1;v<a;){for(var b=v,x=0;b<a&&x<4;){var P=e.charCodeAt(b);if(P===R)x++,b++;else if(P===U)x+=4,b++;else break}if(x<4&&b<a&&e.charCodeAt(b)===h){for(var C=0;b<a&&e.charCodeAt(b)===h;)C++,b++;if(C>=d){for(;b<a&&(e.charCodeAt(b)===R||e.charCodeAt(b)===U);)b++;if(b>=a||e.charCodeAt(b)===J){n=b>=a?a:b+1;break}}}for(;v<a&&e.charCodeAt(v)!==J;)v++;v<a&&v++}v>=a&&(n=a,i=!0);continue}}}}for(var y=l;y<c&&e.charCodeAt(y)===ge;){y++,y<c&&e.charCodeAt(y)===R&&y++;for(var z=0;y<c&&z<4;)if(e.charCodeAt(y)===R)z++,y++;else if(e.charCodeAt(y)===U)z+=4,y++;else break;if(z>=4)break;o=!1}if(!o&&u<4&&y<c&&e.charCodeAt(y)===We&&!(y+1<a&&e.charCodeAt(y+1)===er)){var D=Ys(e,y,t);if(D){n=D,o=!1;continue}}var N=e.charCodeAt(l);if(N===Ot&&u<4)o=!1;else if(u<4&&(N===ue||N===qe||N===He)){for(var S=l,q=0;S<c;){var B=e.charCodeAt(S);if(B===N)q++;else if(B!==R&&B!==U)break;S++}o=!(q>=3&&S>=c)}else o=!0;n=s<0?a:s+1}return i}function Ys(e,t,r){let n=e.length;if(e.charCodeAt(t)!==We)return null;let a=t+1<n&&e.charCodeAt(t+1)===er,o=t+1;for(;o<n;){var i=e.charCodeAt(o);if(i===jt){o++;break}if(i===We)return null;i===dt&&o+1<n&&o++,o++}if(o>n||e.charCodeAt(o-1)!==jt)return null;let s=e.slice(t+1,o-1);if(s.length>999)return null;let c=bn(s);if(!c||o>=n||e.charCodeAt(o)!==wt)return null;o++;let l=!1;for(;o<n;){let oe=e.charCodeAt(o);if(oe===R||oe===U)o++;else if(oe===J&&!l)l=!0,o++;else break}if(a){let oe=e.indexOf(`
|
|
593
|
+
`,o),V=oe<0?n:oe,L=e.slice(o,V).trim();return r[c]={target:L,title:void 0},oe<0?n:oe+1}var u;if(o<n&&e.charCodeAt(o)===Pe){o++;for(var f=o;o<n&&e.charCodeAt(o)!==ge&&e.charCodeAt(o)!==J;)e.charCodeAt(o)===dt&&o+1<n&&o++,o++;if(o>=n||e.charCodeAt(o)!==ge)return null;u=e.slice(f,o),o++;for(var h=e.indexOf(`
|
|
594
|
+
`,o),d=h<0?n:h,m=o;m<d&&(e.charCodeAt(m)===R||e.charCodeAt(m)===U);)m++;if(m<d){if(m===o)return null;var p=e.charCodeAt(m);if(p!==Cr&&p!==kr&&p!==Ft)return null}}else{for(var f=o,g=0;o<n;){var i=e.charCodeAt(o);if(i===Ft)g++;else if(i===Ut){if(g===0)break;g--}else{if(i===R||i===U||i===J)break;i===dt&&o+1<n&&o++}o++}if(u=e.slice(f,o),!u)return null}for(;o<n&&(e.charCodeAt(o)===R||e.charCodeAt(o)===U);)o++;var v=e.indexOf(`
|
|
595
|
+
`,o),b=v<0?n:v,x,P=!1,C=o,y=o;if(o===b&&o<n)for(y=o+1;y<n&&(e.charCodeAt(y)===R||e.charCodeAt(y)===U);)y++;if(y<n){var z=e.charCodeAt(y);if(z===Cr||z===kr||z===Ft){for(var D=z===Ft?41:z,N=y+1,S=N;N<n;){var q=e.charCodeAt(N);if(q===D){for(var B=N+1;B<n&&(e.charCodeAt(B)===R||e.charCodeAt(B)===U);)B++;(B>=n||e.charCodeAt(B)===J)&&(x=e.slice(S,N),P=!0,C=B<n?B+1:n);break}if(q===dt&&N+1<n){N+=2;continue}if(q===J&&N+1<n&&e.charCodeAt(N+1)===J)break;N++}if(!P&&y===o)return null}}if(P)return r[c]||(r[c]={target:Fr(u),title:x!==void 0?Gn(Fr(x)):x}),C;for(;o<b&&(e.charCodeAt(o)===R||e.charCodeAt(o)===U);)o++;return o<b?null:(r[c]||(r[c]={target:Fr(u),title:x}),v<0?n:v+1)}var Ct=new Uint8Array(by);for(Ct[Ot]|=Lt,Ct[ge]|=Lt,Ct[ue]|=Lt|ar,Ct[lr]|=Lt,Ct[qe]|=Lt|ar,Ct[He]|=Lt|ar,Ct[Ae]|=Lt|ar,Ct[st]|=Lt|ar,Ct[Pe]|=Lt|ar,Ct[We]|=ar,Ct[At]|=ar,Ct[it]|=Lt,vn=pe;vn<=me;vn++)Ct[vn]|=Lt;var vn;function xi(e){if(e.indexOf("[")<0&&e.indexOf("]")<0)return!1;for(var t=0;t<e.length;t++){if(e.charCodeAt(t)===dt){t++;continue}if(e.charCodeAt(t)===We||e.charCodeAt(t)===jt)return!0}return!1}function bn(e){for(var t=e.length,r=!0,n=t>0,a=0;a<t;a++){var o=e.charCodeAt(a);if(o===R){if(r){n=!1;break}r=!0}else if(o<33||o>126||o>=ce&&o<=fe){n=!1;break}else r=!1}if(n&&!r)return e;var i=e.replace(/\s+/g," ").trim();return i.indexOf("ẞ")!==-1?i.replace(/\u1E9E/g,"ss").toLowerCase():i.toLowerCase()}function Ya(e){return e<Wn?Ct[e]:e===sy?yr:0}function Fr(e){return e.indexOf("\\")===-1?e:e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var _a=null,Aa=-1,wn=-1;function Se(e,t){if(t>=Aa&&t<=wn&&e===_a)return wn;var r=e.indexOf(`
|
|
596
|
+
`,t),n=r<0?e.length:r;return _a=e,Aa=t,wn=n,n}function we(e,t){let r=Se(e,t);return r<e.length?r+1:r}function Qr(e,t,r){for(;t<r;){let n=e.charCodeAt(t);if(n!==R&&n!==U)break;t++}return t}function ki(e,t){let r=we(e,t);for(;r<e.length;){let n=Se(e,r);if(_t(e,r,n))return r;r=we(e,r)}return e.length}function ur(e,t,r,n){let a=0;for(;t+a<r&&e.charCodeAt(t+a)===n;)a++;return a}var _e=0,ke=0;function $e(e,t,r){for(_e=0,ke=0;t+ke<r;){let n=e.charCodeAt(t+ke);if(n===U)_e+=4-_e%4;else if(n===R)_e++;else break;ke++}}function _t(e,t,r){return Qr(e,t,r)>=r}function jy(e,t,r,n){let a=Se(e,t);if($e(e,t,a),_e>3)return null;let o=t+ke;if(e.charCodeAt(o)!==Ot)return null;let i=ur(e,o,a,35);if(i<1||i>6||(o+=i,o<a&&e.charCodeAt(o)!==R&&e.charCodeAt(o)!==U))return null;o=Qr(e,o,a);for(var s=a;s>o&&e.charCodeAt(s-1)===R;)s--;for(var c=s;s>o&&e.charCodeAt(s-1)===Ot;)s--;if(s<c)if(s===o||e.charCodeAt(s-1)===R)for(;s>o&&e.charCodeAt(s-1)===R;)s--;else s=c;let l=e.slice(o,s),u=Ur(l,!1,r,n),f=((n==null?void 0:n.slugify)||Dt)(l);return{node:{type:T.heading,level:i,children:u,id:f},end:we(e,a)}}function Hy(e,t,r){var n=e.charCodeAt(t);if(n!==Mt&&n!==ue)return!1;for(var a=t;a<r&&e.charCodeAt(a)===n;)a++;for(;a<r&&(e.charCodeAt(a)===R||e.charCodeAt(a)===U);)a++;return a>=r}function sr(e,t){let r=Se(e,t);if($e(e,t,r),_e>3)return null;let n=t+ke,a=e.charCodeAt(n);if(a!==ue&&a!==qe&&a!==He)return null;let o=0;for(;n<r;){let i=e.charCodeAt(n);if(i===a)o++;else if(i!==R&&i!==U)return null;n++}return o<3?null:{node:{type:T.breakThematic},end:we(e,r)}}function By(e,t,r){let n=Se(e,t);if($e(e,t,n),_e>3)return null;let a=_e,o=t+ke,i=e.charCodeAt(o);if(i!==Ae&&i!==st)return null;let s=ur(e,o,n,i);if(s<3)return null;o+=s;let c=Qr(e,o,n),l=n;if(i===Ae){for(let V=c;V<n;V++)if(e.charCodeAt(V)===Ae)return null}for(;l>c&&(e.charCodeAt(l-1)===R||e.charCodeAt(l-1)===U);)l--;let u=e.slice(c,l),f="",h="",d=u.indexOf(" ");d===-1?f=u:(f=u.slice(0,d),h=u.slice(d+1).trim()),f=Fr(f);var m=void 0;if(h){wi.lastIndex=0;for(var p;(p=wi.exec(h))!==null;)m||(m={}),m[p[1]]=p[2]!==void 0?p[2]:p[3]}let g=we(e,n),v=e.length,b=e.length;for(var x=String.fromCharCode(i).repeat(s),P=g;P<e.length;){var C=e.indexOf(x,P);if(C===-1)break;for(var y=C,z=0;y>0&&z<4&&e.charCodeAt(y-1)===R;)y--,z++;if(z<=3&&(y===0||e.charCodeAt(y-1)===J)){for(var D=C+s;D<e.length&&e.charCodeAt(D)===i;)D++;var N=Se(e,D);if(_t(e,D,N)){v=y,b=we(e,N);break}}P=C+1}var S;if(a===0)S=v>g&&e.charCodeAt(v-1)===J?e.slice(g,v-1):e.slice(g,v);else{S="";for(var q=g;q<v;){var B=Se(e,q);$e(e,q,B);var oe=Math.min(ke,a);S+=e.slice(q+oe,B)+`
|
|
597
|
+
`,q=we(e,B)}S.length>0&&S.charCodeAt(S.length-1)===J&&(S=S.slice(0,-1))}return{node:{type:T.codeBlock,lang:f||void 0,text:S,infoString:h||void 0,attrs:m},end:b}}function Vy(e,t){let r=Se(e,t);if($e(e,t,r),_e<4)return null;let n="",a=t;for(;a<e.length;){let d=Se(e,a);if($e(e,a,d),_t(e,a,d)){for(var o=0,i=we(e,d);i<e.length;){var s=Se(e,i);if(_t(e,i,s)){o++,i=we(e,s);continue}if($e(e,i,s),_e>=4){for(var c=0;c<=o;c++)n+=`
|
|
598
|
+
`;a=i;break}break}if(a!==i)break;continue}if(_e<4)break;let m=0,p=0;var l=0;for(let g=a;g<d&&p<4;g++){if(e.charCodeAt(g)===U){var u=4-p%4;p+u>4&&(l=p+u-4),p+=u}else p++;m++}var f="";if(l>0)for(var h=0;h<l;h++)f+=" ";f+=e.slice(a+m,d),n+=f+`
|
|
599
|
+
`,a=we(e,d)}for(;n.length>0&&n.charCodeAt(n.length-1)===J;)n=n.slice(0,-1);return n?{node:{type:T.codeBlock,lang:void 0,text:n,infoString:void 0,attrs:void 0},end:a}:null}function Wy(e,t,r,n){let a=Se(e,t);if($e(e,t,a),_e>3)return null;let o=t+ke;if(e.charCodeAt(o)!==ge)return null;let i="",s=t,c,l=!1,u=!1,f=!1;for(;s<e.length;){let L=Se(e,s);$e(e,s,L);let F=s+ke;if(e.charCodeAt(F)===ge){let Y=F+1;var h=_e+1,d=!1;if(Y<L){var m=e.charCodeAt(Y);m===R?(Y++,h++,d=!0):m===U&&(d=!0)}for(var p="",g=!1,v=Y;v<L;v++)if(e.charCodeAt(v)===U){g=!0;break}if(g){var b=h;if(d&&Y<L&&e.charCodeAt(Y)===U){for(var x=4-b%4,P=0;P<x-1;P++)p+=" ";b+=x,Y++}for(var C=Y;C<L;C++)if(e.charCodeAt(C)===U){for(var y=4-b%4,z=0;z<y;z++)p+=" ";b+=y}else p+=e[C],b++}else p=e.slice(Y,L);if(!i&&!c){let Ee=p.match(/^\[!([A-Za-z]+)\]\s*$/);if(Ee){c=Ee[1].toUpperCase(),s=we(e,L);continue}}i+=p+`
|
|
600
|
+
`;var D=p.trimStart();D.startsWith("```")||D.startsWith("~~~")?f=!f:(p.startsWith(" ")||p.startsWith(" "))&&(f=!0),u=D.length>0,s=we(e,L)}else if(i&&!_t(e,s,L)&&u){if(_e<4){var N=s+ke,S=N<L?e.charCodeAt(N):0;if(S===Ot||S===ge||S===Ae||S===st||S===Pe||(S===ue||S===qe||S===He)&&sr(e,s)||(S===ue||S===qe||S===lr)&&N+1<L&&(e.charCodeAt(N+1)===R||e.charCodeAt(N+1)===U))break;if(S>=pe&&S<=me){for(var q=N;q<L&&e.charCodeAt(q)>=pe&&e.charCodeAt(q)<=me;)q++;if(q<L&&(e.charCodeAt(q)===Rt||e.charCodeAt(q)===Ut))break}}if(f)break;i+=e.slice(s,L)+`
|
|
601
|
+
`,l=!0,s=we(e,L)}else break}if(!i&&!c)return null;var{inBlockQuote:B,f:oe}=r;r.inBlockQuote=!0,l&&(r.f=!0);let V=cr(i||"",r,n);return r.inBlockQuote=B,r.f=oe,{node:{type:T.blockQuote,children:V,alert:c||void 0},end:s}}function Ks(e,t,r){for(var n=0,a=t;a<r;a++)e.charCodeAt(a)===U?n+=4-n%4:n++;return n}function or(e,t,r){if($e(e,t,r),_e>3)return null;var n=t+ke;if(n>=r)return null;var a=e.charCodeAt(n),o=_e,i=n;if(a===ue||a===qe||a===lr){if(i=n+1,i<r&&e.charCodeAt(i)!==R&&e.charCodeAt(i)!==U&&e.charCodeAt(i)!==J)return null}else if(a>=pe&&a<=me){for(var s=n;s<r&&s-n<9;){var c=e.charCodeAt(s);if(c<pe||c>me)break;s++}if(s>n&&s<r){var l=e.charCodeAt(s);if(l===Rt||l===Ut){if(i=s+1,i<r&&e.charCodeAt(i)!==R&&e.charCodeAt(i)!==U&&e.charCodeAt(i)!==J)return null}else return null}else return null}else return null;var u=i,f=Ks(e,t,i),h=0,d=u,m=f;if(u>=r)return{ordered:a>=pe&&a<=me,marker:a>=pe&&a<=me?e[s]:e[n],start:a>=pe&&a<=me?parseInt(e.slice(n,s),10):void 0,contentStart:u,contentCol:f+1,markerCol:o,isEmpty:!0};for(;d<r&&(e.charCodeAt(d)===R||e.charCodeAt(d)===U);){if(e.charCodeAt(d)===U){var p=4-m%4;m+=p}else m++;d++,h++}var g=d>=r,v=m-f;return g||v>4?(m=f+1,d=u+1,h=1):h===0&&(m=f+1,d=u,h=1),{ordered:a>=pe&&a<=me,marker:a>=pe&&a<=me?e[s]:e[n],start:a>=pe&&a<=me?parseInt(e.slice(n,s),10):void 0,contentStart:d,contentCol:m,markerCol:o,isEmpty:g}}var Dn=0;function Gy(e,t,r,n){var a=0,o=t;for(Dn=0;o<r&&a<n;){var i=e.charCodeAt(o);if(i===U){var s=4-a%4;if(a+s>n){Dn=a+s-n,o++,a=n;break}a+=s}else if(i===R)a++;else break;o++}return o}function Ci(e,t,r,n){var a=Se(e,t),o=or(e,t,a);if(!o)return null;var i=[],s=t,c=o.contentCol,l="",u=o.isEmpty,f=!1,h=!1;if(!o.isEmpty){for(var d=!1,m=o.contentStart;m<a;m++)if(e.charCodeAt(m)===U){d=!0;break}if(d){var p="",g=Ks(e,t,o.contentStart),v=g-o.contentCol;if(v>0)for(var b=0;b<v;b++)p+=" ";for(var x=o.contentStart;x<a;x++)if(e.charCodeAt(x)===U){for(var P=4-g%4,C=0;C<P;C++)p+=" ";g+=P}else p+=e[x],g++;l=p+`
|
|
602
|
+
`}else l=e.slice(o.contentStart,a)+`
|
|
603
|
+
`}for(s=we(e,a);s<e.length;){var y=Se(e,s);$e(e,s,y);var z=e.charCodeAt(s+ke);if(_e<c&&(z===ue||z===qe||z===He)&&_e<=3&&sr(e,s))break;var D=or(e,s,y);if(D&&D.ordered===o.ordered&&D.marker===o.marker&&D.markerCol<c){i.push({contentCol:c,raw:l,hasBlankAfter:f,isEmpty:u}),f&&(h=!0),c=D.contentCol,u=D.isEmpty,f=!1,l=D.isEmpty?"":e.slice(D.contentStart,y)+`
|
|
604
|
+
`,s=we(e,y);continue}if(_t(e,s,y)){l+=`
|
|
605
|
+
`,s=we(e,y);for(var N=!1,S=0;S<l.length;S++){var q=l.charCodeAt(S);if(q!==J&&q!==wr&&q!==R&&q!==U){N=!0;break}}if(u&&!N)if(s<e.length){var B=Se(e,s),oe=or(e,s,B);if(!oe||oe.ordered!==o.ordered||oe.marker!==o.marker)break;f=!0}else break;if(s<e.length){var V=Se(e,s);$e(e,s,V);var L=e.charCodeAt(s+ke);if((L===ue||L===qe||L===He)&&_e<=3&&sr(e,s))break;var F=or(e,s,V);if(F&&F.ordered===o.ordered&&F.marker===o.marker&&F.markerCol<c){f=!0;continue}if(!_t(e,s,V)&&_e<c)break}continue}if(_e>=c){var Y=Gy(e,s,y,c);if(Dn>0){for(var Ee="",$=c,de=0;de<Dn;de++)Ee+=" ",$++;for(var ze=Y;ze<y;ze++)if(e.charCodeAt(ze)===U){for(var lt=4-$%4,De=0;De<lt;De++)Ee+=" ";$+=lt}else Ee+=e[ze],$++;l+=Ee+`
|
|
606
|
+
`}else l+=e.slice(Y,y)+`
|
|
607
|
+
`;s=we(e,y);continue}for(var Ue=!1,ve=0;ve<l.length;ve++){var le=l.charCodeAt(ve);if(le!==J&&le!==wr&&le!==R&&le!==U){Ue=!0;break}}if(!f&&Ue&&!u){var Re=s+ke,ie=e.charCodeAt(Re),xe=ie===Ot||ie===ge||ie===Pe||ie===Ae||ie===st||(ie===ue||ie===qe||ie===He||ie===lr)&&(sr(e,s)!==null||or(e,s,y)!==null)||ie>=pe&&ie<=me&&or(e,s,y)!==null;if(!xe){l+=""+e.slice(Re,y)+`
|
|
608
|
+
`,s=we(e,y);continue}}break}if(i.push({contentCol:c,raw:l,hasBlankAfter:f,isEmpty:u}),i.length===0)return null;var he=h;if(!he)for(var tt=0;tt<i.length;tt++){if(i[tt].hasBlankAfter&&tt<i.length-1){he=!0;break}if(!i[tt].isEmpty){for(var Ce=i[tt].raw,ye=Ce.length,Z=0,Oe=!1,at=!1,Be=!1,pt=!1,gt=0,H=0,Q=-1;Z<ye;){var j=Ce.indexOf(`
|
|
609
|
+
`,Z);if(j<0&&(j=ye),pt){$e(Ce,Z,j);for(var Xe=Ce.slice(Z+ke,j),Te=0;Te<Xe.length&&Xe.charCodeAt(Te)===gt;)Te++;Te>=H&&Xe.slice(Te).trim()===""&&(pt=!1),Z=j<ye?j+1:ye;continue}if(_t(Ce,Z,j)){Q>=0?Be=!0:Oe&&(at=!0),Z=j<ye?j+1:ye;continue}if($e(Ce,Z,j),Q>=0){if(_e>=Q){Z=j<ye?j+1:ye;continue}var mt=or(Ce,Z,j);if(mt&&mt.markerCol<Q&&mt.contentCol<=Q){Z=j<ye?j+1:ye;continue}if(mt){Z=j<ye?j+1:ye;continue}Q=-1,Be&&(at=!0,Be=!1)}var Pt=Ce.slice(Z+ke,j),se=Pt.charCodeAt(0);if((se===Ae||se===st)&&_e<=3){for(var I=0;I<Pt.length&&Pt.charCodeAt(I)===se;)I++;if(I>=3){if(at&&Oe){he=!0;break}pt=!0,gt=se,H=I,Oe=!0,Z=j<ye?j+1:ye;continue}}var ft=_e<=3?or(Ce,Z,j):null;if(ft&&Oe){if(at){he=!0;break}Q=ft.contentCol,Be=!1,Z=j<ye?j+1:ye,Oe=!0;continue}if(at){he=!0;break}Oe=!0,Z=j<ye?j+1:ye}if(he)break}}for(var ot=[],ht=0;ht<i.length;ht++){for(var rt=i[ht],be=rt.raw,Ze=be.length;Ze>0&&be.charCodeAt(Ze-1)===J;)Ze--;var Ve=Ze<be.length?be.slice(0,Ze):be,ut=null;if(Ve.length>=3&&Ve.charCodeAt(0)===We){var je=Ve[1];(je===" "||je==="x"||je==="X")&&Ve.charCodeAt(2)===jt&&(ut={type:T.gfmTask,completed:je==="x"||je==="X"},Ve=Ve.slice(3))}var Le;if(rt.isEmpty&&Ve.trim()==="")Le=[];else if(he){var Ht=r.inList;r.inList=!0,Le=cr(Ve,r,n),r.inList=Ht}else{var Bt=r.inList;if(r.inList=!0,Le=cr(Ve,r,n),r.inList=Bt,Le.length===1&&Le[0].type===T.paragraph)Le=Le[0].children;else if(r.h){var Vt=[];r.h.push({src:Le,dest:Vt,unwrap:!0}),Le=Vt}else{for(var Ar=[],qt=0;qt<Le.length;qt++)if(Le[qt].type===T.paragraph)for(var Wt=Le[qt].children,Vr=0;Vr<Wt.length;Vr++)Ar.push(Wt[Vr]);else Ar.push(Le[qt]);Le=Ar}}if(ut){var Wr=[ut,{type:T.text,text:" "}];if(r.h)r.h.push({src:Le,dest:Wr,unwrap:!1});else for(var Gt=0;Gt<Le.length;Gt++)Wr.push(Le[Gt]);ot.push(Wr)}else ot.push(Le)}return{node:{type:o.ordered?T.orderedList:T.unorderedList,start:o.ordered?o.start:void 0,items:ot},end:s}}var Rn=new Set(["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]);function Xt(e,t,r){let n={};for(let[i,s]of Object.entries(e)){let c=i.toLowerCase();if(c==="style"&&typeof s=="string"){let l={},u=[],f=0,h=0;for(let m=0;m<s.length;m++){let p=s.charCodeAt(m);p===Ft?f++:p===Ut?f--:p===Pn&&f===0&&(u.push(s.slice(h,m)),h=m+1)}h<s.length&&u.push(s.slice(h));let d=!1;u.forEach(m=>{let p=m.indexOf(":");if(p===-1)return;let g=m.slice(0,p).trim(),v=m.slice(p+1).trim();if(g&&v){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(v)){d=!0;return}let b=g.indexOf("-")!==-1?g.replace(/-([a-z])/g,(x,P)=>P.toUpperCase()):g;l[b]=v}}),!d&&Object.keys(l).length>0&&(n[i]=l)}else if((c==="href"||c==="src")&&(r!=null&&r.sanitizer)){let l=r.sanitizer(s,t,c);l!==null&&(n[i]=l)}else if(s==="")n[i]=!0;else if(s.length>=2&&s.charCodeAt(0)===Hr&&s.charCodeAt(s.length-1)===Wa){var a=s.slice(1,-1);if(a.length>0){var o=a.charCodeAt(0);if(o===We||o===Hr)try{n[i]=JSON.parse(a);continue}catch{}}if(a==="true"){n[i]=!0;continue}if(a==="false"){n[i]=!1;continue}if(r!=null&&r.evalUnserializableExpressions)try{n[i]=(0,eval)("("+a+")");continue}catch{}n[i]=a}else n[i]=s}return n}function ir(e,t,r){let n=t.length;if(n===0)return r;var a=t.charCodeAt(0),o=a>=ce&&a<=fe||a>=Me&&a<=Ie;if(!o){for(var i=String.fromCharCode(a),s=e.length-n,c=r;c<=s;){var l=e.indexOf(i,c);if(l===-1||l>s)return-1;for(var u=!0,f=1;f<n;f++){var h=e.charCodeAt(l+f),d=t.charCodeAt(f);if(h>=ce&&h<=fe&&(h+=It),d>=ce&&d<=fe&&(d+=It),h!==d){u=!1;break}}if(u)return l;c=l+1}return-1}a>=ce&&a<=fe&&(a+=It);for(let p=r;p<=e.length-n;p++){var m=e.charCodeAt(p);if(m>=ce&&m<=fe&&(m+=It),m!==a)continue;let g=!0;for(let v=1;v<n;v++){let b=e.charCodeAt(p+v),x=t.charCodeAt(v);if(b>=ce&&b<=fe&&(b+=It),x>=ce&&x<=fe&&(x+=It),b!==x){g=!1;break}}if(g)return p}return-1}function Yy(e,t,r){let n=t.length;var a=t.charCodeAt(0);a>=ce&&a<=fe&&(a+=It);for(let i=Math.min(r,e.length-n);i>=0;i--){var o=e.charCodeAt(i);if(o>=ce&&o<=fe&&(o+=It),o!==a)continue;let s=!0;for(let c=1;c<n;c++){let l=e.charCodeAt(i+c),u=t.charCodeAt(c);if(l>=ce&&l<=fe&&(l+=It),u>=ce&&u<=fe&&(u+=It),l!==u){s=!1;break}}if(s)return i}return-1}var On=-1;function Sa(e,t,r){let n=r.toLowerCase(),a="<"+n,o="</"+n,i=1,s=t,c=e.length;for(On=-1;s<c&&i>0;){let f=ir(e,a,s),h=ir(e,o,s);if(h===-1)return-1;if(f!==-1&&f<h){let d=Zt(e,f);d?(d.tag.toLowerCase()===n&&!d.isClosing&&!d.selfClosing&&!nn(d.tag)&&i++,s=d.end):s=f+1}else{var l=h+o.length,u=l<c?e.charCodeAt(l):62;if((u===ge||u===R||u===U||u===J)&&(i--,i===0)){On=h;let d=h+o.length;for(;d<c&&e.charCodeAt(d)!==ge;)d++;return d+1}s=h+1}}return-1}function qs(e,t,r,n){if(n.ignoreHTMLBlocks||n.disableParsingRawHTML)return null;var a=Se(e,t);if($e(e,t,a),_e>3&&!r.inHTML)return null;var o=t+ke;if(e.charCodeAt(o)!==Pe)return null;var i=e.indexOf(">",o+1);if(i!==-1&&i<a){var s=e.slice(o+1,i);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(s)||/^[^\s@]+@[^\s@]+$/.test(s))return null}var c=Ky(e,o);if(c>=1&&c<=5){var l=e.length;if(c===1){for(var u=e.length,f=0;f<Ca.length;f++){var h=ir(e,"</"+Ca[f]+">",o);h>=0&&h<u&&(u=h)}if(u<e.length){var d=e.indexOf(">",u);l=d>=0?we(e,d+1):e.length}}else{var m=c===2?"-->":c===3?"?>":c===4?">":"]]>",p=e.indexOf(m,o);p>=0&&(l=we(e,p+m.length))}var g=e.slice(o,l);if(c>=2)return{node:{type:T.htmlComment,text:g,l:!1,raw:!0},end:l};var v="div",b=g.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);b&&(v=b[1]);var x=Zt(e,o),P={},C;x&&!x.isClosing&&(P=Xt(x.attrs,v,n),C=x.whitespaceBeforeAttrs+x.rawAttrs);var y=[],z=v.toLowerCase(),D="</"+z,N=ir(g,D,0),S=g,q="";if(x&&x.isClosing)for(S=g.slice(x.end-o);S.length>0&&S.charCodeAt(S.length-1)===J;)S=S.slice(0,-1);else if(x&&!x.isClosing){var B=x.end-o;if(N!==-1)for(S=g.slice(B),S.charCodeAt(0)===J&&(S=S.slice(1));S.length>0&&S.charCodeAt(S.length-1)===J;)S=S.slice(0,-1);else for(S=g;S.length>0&&S.charCodeAt(S.length-1)===J;)S=S.slice(0,-1);if(N!==-1){var oe=g.slice(B,N);q=oe.trim()}}var V=x?x.isClosing:!1;return{node:{type:T.htmlBlock,tag:v,attrs:P,i:C,children:y,a:S,text:q,d:!0,b:V},end:l}}if(c===6||c===7){var L=ki(e,t),F=L<e.length?L:e.length,Y=e.slice(o,F),Ee=L<e.length?we(e,L):e.length,$=Zt(e,o);if($){var de=$.tag,ze=de.toLowerCase(),lt=$.isClosing;if(lt){var De=e.slice($.end,F);return{node:{type:T.htmlBlock,tag:de,attrs:{},children:[],a:De,text:De,d:!0,b:!0},end:Ee}}if($.selfClosing||nn(de))return{node:{type:T.htmlBlock,tag:de,attrs:Xt($.attrs,de,n),i:$.whitespaceBeforeAttrs+$.rawAttrs,children:[],a:"",text:"",d:!1,b:!1},end:$.end<e.length&&e.charCodeAt($.end)===J?$.end+1:$.end};var Ue=r.c||0,ve=e.slice(o,F),le=-1,Re=-1;if(Ue<10){for(var ie="</"+ze,xe=$.end-o,he=1,tt=xe;tt<ve.length&&he>0;){var Ce=ir(ve,"<"+ze,tt),ye=ir(ve,ie,tt);if(ye===-1)break;if(Ce!==-1&&Ce<ye){var Z=Ce+ze.length+1;if(Z<ve.length){var Oe=ve.charCodeAt(Z);(Oe===R||Oe===U||Oe===J||Oe===ge||Oe===Ke)&&he++}tt=Ce+1}else{var at=ye+ie.length;if(at<ve.length){var Be=ve.charCodeAt(at);if((Be===ge||Be===R||Be===U||Be===J)&&(he--,he===0)){le=ye;for(var pt=at;pt<ve.length&&ve.charCodeAt(pt)!==ge;)pt++;Re=pt+1;break}}else if(he--,he===0){le=ye,Re=ve.length;break}tt=ye+1}}var gt=!1;if(le===-1&&c===6&&!$.isClosing){var H=Sa(e,$.end,ze);if(H!==-1){for(var Q=On,j=$.end,Xe=!1,Te=!1,mt=!1,Pt=0,se=!1,I=!1,ft=j;ft<Q;){var ot=e.charCodeAt(ft);if(ot===J)I&&(Xe=!0),se||Pt++,I=!0,ft++;else if(ot===R||ot===U)ft++;else{if(!se&&(se=!0,Pt>=2&&ot===Pe)){mt=!0;break}if(I=!1,ot===Pe){var ht=e.charCodeAt(ft+1)|32;if((ht===wa||ht===js||ht===Ir)&&(yi.lastIndex=ft,yi.test(e))){Te=!0;break}}ft++}}if(Xe&&!mt&&!Te){var rt=Se(e,H);F=rt,Ee=we(e,rt),ve=e.slice(o,F),Y=e.slice(o,F),le=Q-o,Re=H-o,gt=!0}}}}var be=$.rawAttrs.indexOf(`
|
|
610
|
+
`)!==-1||$.whitespaceBeforeAttrs.indexOf(`
|
|
611
|
+
`)!==-1,Ze=!1;if(le!==-1){var Ve=ve.slice(Re).trim();Ze=Ve.length===0}var ut=!1,je=F,Le=Ee;if(le!==-1){var Ht=o+Re,Bt=Se(e,Ht-1);if(Ht<Bt){for(var Vt=Ht;Vt<Bt&&(e.charCodeAt(Vt)===R||e.charCodeAt(Vt)===U);)Vt++;if(Vt<Bt&&e.charCodeAt(Vt)===Pe){var Ar=Zt(e,Vt);Ar&&!Ar.isClosing&&(ut=!0,je=Ht,Le=Ht,Ze=!0)}}if(!ut){var qt=we(e,Bt);if(qt<F){for(var Wt=qt;Wt<F&&(e.charCodeAt(Wt)===R||e.charCodeAt(Wt)===U);)Wt++;if(Wt<F&&e.charCodeAt(Wt)===Pe){var Vr=Zt(e,Wt);Vr&&(ut=!0,je=Bt,Le=qt,Ze=!0)}}}if(!ut&&r.inHTML){ut=!0,je=Bt,Le=we(e,Bt);var Wr=e.slice(Ht,Bt).trim();Ze=Wr.length===0}}var Gt=[],kt="";if(le!==-1){kt=ve.slice($.end-o,le);var Sr=kt.trim();if(Sr){var{inline:Zs,inHTML:$s,c:Qs}=r;r.inHTML=!0,r.c=Ue+1;var ec=ze==="p";if(ec)r.inline=!0,Gt=Ur(Sr,!1,r,n);else{var Za=kt.indexOf(`
|
|
612
|
+
|
|
613
|
+
`)!==-1,$a=ua.test(Sr),Yn=bi.test(Sr),tc=Za||$a||r.inHTML&&Yn,rc=kt.length>=2&&kt.charCodeAt(0)===J&&kt.charCodeAt(kt.length-1)===J&&!Za;rc&&!$a&&!Yn?Gt=[{type:T.text,text:Sr}]:tc||Yn?(r.inline=!1,Gt=cr(kt,r,n)):(r.inline=!0,Gt=Ur(Sr,!1,r,n))}r.inline=Zs,r.inHTML=$s,r.c=Qs}}var Qa=!1;if(c===6&&le!==-1&&!r.inHTML&&!be){var nc=/<[a-zA-Z][^>]*>/.test(kt),ac=kt.indexOf(`
|
|
614
|
+
|
|
615
|
+
`)!==-1||ua.test(kt);nc&&!ac&&(Qa=!0)}var oc=!gt&&(r.inHTML||c===7||be||!Ze||Qa);if(oc){var zt,eo=!1;if(le!==-1&&ut){var to=!1;if(r.inHTML&&Re<ve.length){for(var on=Re;on<ve.length&&ve.charCodeAt(on)!==J;)on++;var Kn=ve.slice(Re,on).trim();to=Kn.length>1&&Kn.charCodeAt(0)===Pe&&Kn.charCodeAt(1)!==Ke}zt=to?ve.slice($.end-o):kt,eo=!0}else(c===7||r.inHTML)&&le!==-1?(zt=ve.slice($.end-o),zt.charCodeAt(0)===J&&(zt=zt.slice(1))):ut?zt=e.slice(o,je):be?zt=Y:(zt=ve.slice($.end-o),zt.charCodeAt(0)===J&&(zt=zt.slice(1)));var ro={type:T.htmlBlock,tag:de,attrs:Xt($.attrs,de,n),i:$.whitespaceBeforeAttrs+$.rawAttrs,children:Gt,a:zt,text:zt,d:!0,b:!1};return eo&&(ro.n=!0),{node:ro,end:Le}}return{node:{type:T.htmlBlock,tag:de,attrs:Xt($.attrs,de,n),i:$.whitespaceBeforeAttrs+$.rawAttrs,children:Gt,a:gt?"":kt,text:kt,d:!1,b:!1},end:Le}}var sn=Y.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),ic=sn?sn[2]:"div",no=sn?sn[1]==="/":!1,qn=Y;if(no){var ao=Y.indexOf(">");ao!==-1&&(qn=Y.slice(ao+1))}return{node:{type:T.htmlBlock,tag:ic,attrs:{},children:[],a:qn,text:qn,d:!0,b:no},end:Ee}}var vt=Zt(e,o);if(!vt)return null;var tr=vt.tag,Jn=tr.toLowerCase(),oo=tr.charCodeAt(0),Xn=oo>=ce&&oo<=fe;if(!Xn&&!Rn.has(Jn)&&!an.has(Jn)&&!Jn.includes("-"))return null;if(vt.isClosing)return{node:{type:T.htmlSelfClosing,tag:tr,attrs:{},a:e.slice(o,vt.end),b:!0},end:vt.end};var zr=Sa(e,vt.end,tr),Gr=[];if(zr!==-1){var sc=On,cn=e.slice(vt.end,sc),ln=cn.trim();if(ln){var cc=cn.indexOf(`
|
|
616
|
+
|
|
617
|
+
`)!==-1,lc=ua.test(ln),uc=bi.test(ln),dc=r.inline,fc=r.inHTML,hc=r.c;r.inHTML=!0,r.c=(r.c||0)+1,cc||lc||uc?(r.inline=!1,Gr=cr(cn,r,n)):(r.inline=!0,Gr=Ur(ln,!1,r,n)),r.inline=dc,r.inHTML=fc,r.c=hc}var pc=Se(e,zr),mc=e.slice(zr,pc).trim(),io=mc?zr:we(e,zr),so=Xn?e.slice(o,zr):e.slice(o,io);return{node:{type:T.htmlBlock,tag:tr,attrs:Xt(vt.attrs,tr,n),i:vt.whitespaceBeforeAttrs+vt.rawAttrs,children:Gr,a:so,text:Xn?cn:so,d:!0,b:!1},end:io}}var Yr=ki(e,vt.end),gc=Yr<e.length?we(e,Yr):Yr,Zn=e.slice(vt.end,Yr);if(Zn.trim()){var{inline:vc,inHTML:yc,c:bc}=r;r.inline=!1,r.inHTML=!0,r.c=(r.c||0)+1,Gr=cr(Zn,r,n),r.inline=vc,r.inHTML=yc,r.c=bc}var wc=e.slice(vt.end,Yr);return{node:{type:T.htmlBlock,tag:tr,attrs:Xt(vt.attrs,tr,n),i:vt.whitespaceBeforeAttrs+vt.rawAttrs,children:Gr,a:wc,text:Zn,d:!0,b:!1},end:gc}}function Ky(e,t){if(e.charCodeAt(t)!==Pe)return 0;var r=t+1,n=e.length;if(e.charCodeAt(r)===At&&e.charCodeAt(r+1)===ue&&e.charCodeAt(r+2)===ue)return 2;if(e.charCodeAt(r)===rn)return 3;if(e.charCodeAt(r)===At){var a=e.charCodeAt(r+1);if(a>=ce&&a<=fe)return 4;if(e.slice(r+1,r+8)==="[CDATA[")return 5}for(var o=e.charCodeAt(r)===Ke,i=o?r+1:r,s=i;s<n;){var c=e.charCodeAt(s);if(c>=ce&&c<=fe||c>=Me&&c<=Ie||c>=pe&&c<=me||c===ue)s++;else break}if(s===i)return 0;var l=e.slice(i,s);if(an.has(l.toLowerCase())){if(o)return 0;var u=e.charCodeAt(s);return u===R||u===U||u===ge||u===J||s>=n?1:0}if(Rn.has(l.toLowerCase())){if(o){for(var f=s;f<n&&(e.charCodeAt(f)===R||e.charCodeAt(f)===U);)f++;return f<n&&e.charCodeAt(f)===ge?6:0}var h=s<n?e.charCodeAt(s):-1;return h===R||h===U||h===ge||h===J||h===Ke||h===-1?6:0}if(o){for(var d=s;d<n&&(e.charCodeAt(d)===R||e.charCodeAt(d)===U);)d++;if(d<n&&e.charCodeAt(d)===ge){var m=Se(e,t),p=e.slice(d+1,m).trim();if(p==="")return 7}}else{var g=Se(e,t),v=Zt(e,t);if(v&&v.end<=g){var b=e.slice(v.end,g).trim();if(b==="")return 7}}return 0}function _i(e,t,r){for(var n=0,a=e.length;n<a&&(e.charCodeAt(n)===R||e.charCodeAt(n)===U);)n++;for(;a>n&&(e.charCodeAt(a-1)===R||e.charCodeAt(a-1)===U);)a--;n<a&&e.charCodeAt(n)===it&&n++,a>n&&e.charCodeAt(a-1)===it&&(a-2<n||e.charCodeAt(a-2)!==dt)&&a--;for(var o=[],i=n,s=!1,c=[],l=n;l<a;){var u=e.charCodeAt(l);if(u===dt&&l+1<a){e.charCodeAt(l+1)===it?(s||(s=!0,c=[]),c.push(e.slice(i,l)),c.push("|"),l+=2,i=l):l+=2;continue}if(u===Ae){for(var f=0;l<a&&e.charCodeAt(l)===Ae;)f++,l++;for(var h=!1;l<a&&!h;){for(var d=0;l<a&&e.charCodeAt(l)===Ae;)d++,l++;d===f?h=!0:d===0&&l++}continue}if(u===it){var m=s?(c.push(e.slice(i,l)),c.join("")):e.slice(i,l);o.push(m.trim()),l++,i=l,s=!1,c=[];continue}l++}var p=s?(c.push(e.slice(i,a)),c.join("")):e.slice(i,a);return o.push(p.trim()),o.map(function(g){var v=g.indexOf("\\|")!==-1?g.replace(/\\\|/g,"|"):g;return v?Ur(v,!1,t,r):[]})}function Ai(e,t,r,n){let a=Se(e,t);var o=e.indexOf("|",t);if(o<0||o>=a)return null;let i=we(e,a);if(i>=e.length)return null;let s=Se(e,i);if(!Gs(e,i,s))return null;let c=e.slice(t,a),l=e.slice(i,s);for(var u=[],f=0,h=l.length;f<h&&(l.charCodeAt(f)===R||l.charCodeAt(f)===U);)f++;for(f<h&&l.charCodeAt(f)===it&&f++;f<h;){for(;f<h&&(l.charCodeAt(f)===R||l.charCodeAt(f)===U);)f++;if(f>=h||l.charCodeAt(f)===it)break;var d=l.charCodeAt(f)===wt;for(d&&f++;f<h&&l.charCodeAt(f)===ue;)f++;var m=f<h&&l.charCodeAt(f)===wt;for(m&&f++,u.push(d&&m?"center":m?"right":d?"left":null);f<h&&(l.charCodeAt(f)===R||l.charCodeAt(f)===U);)f++;f<h&&l.charCodeAt(f)===it&&f++}let p=_i(c,r,n);if(u.length!==p.length)return null;let g=[],v=we(e,s);for(;v<e.length;){let z=Se(e,v),D=e.slice(v,z);if(_t(e,v,z))break;if($e(e,v,z),_e<4){var b=e.charCodeAt(v+ke);if(b===ge||b===Ot||(b===ue||b===qe||b===He)&&sr(e,v))break;if(b===Ae||b===st){for(var x=v+ke,P=0;x<z&&e.charCodeAt(x)===b;)P++,x++;if(P>=3)break}}g.push(_i(D,r,n)),v=we(e,z)}if(n.optimizeForStreaming&&g.length===0)return null;for(var C=p.length,y=0;y<g.length;y++)if(g[y].length<C)for(;g[y].length<C;)g[y].push([]);else g[y].length>C&&(g[y].length=C);return{node:{type:T.table,header:p,cells:g,align:u},end:v}}function qy(e,t,r){var n=Se(e,t);if($e(e,t,n),_e>3)return null;var a=t+ke;if(e.charCodeAt(a)!==We)return null;if(a+1<e.length&&e.charCodeAt(a+1)===er){var o=Jy(e,a,r);return o||null}r.refs||(r.refs={});var i=Ys(e,a,r.refs);return i===null?null:{node:{type:T.refCollection},end:i}}function Jy(e,t,r){var n=e.length;if(e.charCodeAt(t)!==We||t+1>=n||e.charCodeAt(t+1)!==er)return null;for(var a=t+2,o=a;a<n&&e.charCodeAt(a)!==jt;){if(e.charCodeAt(a)===J)return null;a++}if(a>=n)return null;var i=("^"+e.slice(o,a)).toLowerCase();if(a++,a>=n||e.charCodeAt(a)!==wt)return null;for(a++;a<n&&(e.charCodeAt(a)===R||e.charCodeAt(a)===U);)a++;if(a<n&&e.charCodeAt(a)===J)for(a++;a<n&&(e.charCodeAt(a)===R||e.charCodeAt(a)===U);)a++;var s=e.indexOf(`
|
|
618
|
+
`,a);s<0&&(s=n);for(var c=e.slice(a,s).trim(),l=s<n?s+1:n;l<n;){var u=Se(e,l);if($e(e,l,u),_e>=2&&!_t(e,l,u))c+=`
|
|
619
|
+
`+e.slice(l,u),l=we(e,u);else if(_t(e,l,u)){var f=we(e,u);if(f<n){var h=Se(e,f);if($e(e,f,h),_e>=2){c+=`
|
|
620
|
+
`,l=we(e,u);continue}}break}else break}return r.refs[i]||(r.refs[i]={target:c,title:void 0}),{node:{type:T.footnote},end:l}}function Xy(e,t,r,n){let a=t,o=0,i=0,s=-1;for(;a<e.length;){let oe=s>=0?s:Se(e,a);if(s=-1,_t(e,a,oe))break;if($e(e,a,oe),_e<4&&i>0&&!r.f){let L=e.charCodeAt(a+ke);if(L===Mt||L===ue){let F=a+ke;for(;F<oe&&e.charCodeAt(F)===L;)F++;for(;F<oe&&(e.charCodeAt(F)===R||e.charCodeAt(F)===U);)F++;if(F>=oe){o=L===Mt?1:2,a=we(e,oe);break}}}i=oe;let V=we(e,oe);if(V<e.length){if(e.charCodeAt(V)===xa){var c=Se(e,V);a=we(e,c),i=c;continue}let L=Se(e,V);if(s=L,$e(e,V,L),_e<4){let F=e.charCodeAt(V+ke);if(F===ge){a=V;break}if(F===Ot){for(var l=V+ke,u=0;l<L&&e.charCodeAt(l)===Ot&&u<=6;)u++,l++;if(u>=1&&u<=6&&(l>=L||e.charCodeAt(l)===R||e.charCodeAt(l)===U)){a=V;break}}if(F===Ae||F===st){for(var f=V+ke,h=0;f<L&&e.charCodeAt(f)===F;)h++,f++;if(h>=3){a=V;break}}if(F===Pe){var d=V+ke+1,m=d<L?e.charCodeAt(d):0,p=m===At||m===rn;if(!p&&m===Ke){for(var g=d+1,v=g;v<L&&(e.charCodeAt(v)>=ce&&e.charCodeAt(v)<=fe||e.charCodeAt(v)>=Me&&e.charCodeAt(v)<=Ie||e.charCodeAt(v)>=pe&&e.charCodeAt(v)<=me||e.charCodeAt(v)===ue);)v++;v>g&&(p=Rn.has(e.slice(g,v).toLowerCase()))}else if(!p){for(var b=d;b<L&&(e.charCodeAt(b)>=ce&&e.charCodeAt(b)<=fe||e.charCodeAt(b)>=Me&&e.charCodeAt(b)<=Ie||e.charCodeAt(b)>=pe&&e.charCodeAt(b)<=me||e.charCodeAt(b)===ue);)b++;if(b>d){var x=e.slice(d,b).toLowerCase();p=Rn.has(x)||an.has(x)}}if(p&&qs(e,V,r,n)){a=V;break}}if(F===ue||F===qe||F===lr){let Y=V+ke+1;if(Y<L&&(e.charCodeAt(Y)===R||e.charCodeAt(Y)===U)){var P=Qr(e,Y,L);if(P<L&&!sr(e,V)){a=V;break}}}if(F>=pe&&F<=me){let Y=V+ke;for(;Y<L&&e.charCodeAt(Y)>=pe&&e.charCodeAt(Y)<=me;)Y++;if(Y<L&&(e.charCodeAt(Y)===Rt||e.charCodeAt(Y)===Ut)&&Y-(V+ke)===1&&e.charCodeAt(V+ke)===49){var C=Y+1;if(C<L&&(e.charCodeAt(C)===R||e.charCodeAt(C)===U)){var y=Qr(e,C,L);if(y<L){a=V;break}}}}if(F===it){let Y=we(e,L);if(Y<e.length){let Ee=Se(e,Y);if(Gs(e,Y,Ee)){a=V;break}}}if((F===ue||F===qe||F===He)&&sr(e,V)){if(F!==ue){a=V;break}let Y=V+ke;for(;Y<L&&e.charCodeAt(Y)===ue;)Y++;for(;Y<L&&(e.charCodeAt(Y)===R||e.charCodeAt(Y)===U);)Y++;if(Y<L){a=V;break}}}}a=we(e,oe)}for(var z=o?i:a;z>t&&(e.charCodeAt(z-1)===J||e.charCodeAt(z-1)===wr||e.charCodeAt(z-1)===R||e.charCodeAt(z-1)===U);)z--;for(var D=t;D<z&&(e.charCodeAt(D)===R||e.charCodeAt(D)===U);)D++;if(D>=z)return null;for(var N=!1,S=D;S<z;S++)if(e.charCodeAt(S)===xa){N=!0;break}var q=N?e.slice(D,z).replace(/\u001E/g,""):e.slice(D,z);if(!q)return null;let B=Ur(q,!0,r,n);if(o){let oe=((n==null?void 0:n.slugify)||Dt)(q);return{node:{type:T.heading,level:o,children:B,id:oe},end:a}}return{node:{type:T.paragraph,children:B},end:a}}function Ur(e,t,r,n){var a=r.k;if(!a){var o=r.e;r.e=t;var i=Kt(e,0,e.length,r,n);return r.e=o,i}var s=[];return a.push({dest:s,text:e,breaks:t,inline:r.inline,inAnchor:r.inAnchor,inHTML:r.inHTML,htmlDepth:r.c,inList:r.inList,inBlockQuote:r.inBlockQuote,noSetext:r.f,depth:r.j}),s}function Zy(e,t,r){if(e.charCodeAt(t)!==Ae)return null;let n=ur(e,t,r,96),a=t+n;for(;a<r;){let o=e.indexOf("`",a);if(o<0||o>=r)return null;let i=ur(e,o,r,96);if(i===n){let s=e.slice(t+n,o);return s.indexOf(`
|
|
621
|
+
`)!==-1&&(s=s.replace(/\n/g," ")),s.length>0&&s[0]===" "&&s[s.length-1]===" "&&s.trim().length>0&&(s=s.slice(1,-1)),{node:{type:T.codeInline,text:s},end:o+i}}a=o+i}return null}function Ka(e,t,r){if(e.charCodeAt(t)!==Ae)return t;let n=ur(e,t,r,96),a=t+n;for(;a<r;){let o=e.indexOf("`",a);if(o<0||o>=r)return t;let i=ur(e,o,r,96);if(i===n)return o+i;a=o+i}return t}function $y(e,t,r){if(e.charCodeAt(t)!==Pe)return t;if(t+1<r&&e.charCodeAt(t+1)===Ke){let l=t+2;for(;l<r&&e.charCodeAt(l)!==ge;)l++;return l<r?l+1:t}if(t+3<r&&e.charCodeAt(t+1)===At&&e.charCodeAt(t+2)===ue&&e.charCodeAt(t+3)===ue){let l=e.indexOf("-->",t+4);return l>=0?l+3:t}let n=t+1,a=n;for(;n<r;){let l=e.charCodeAt(n);if(l>=ce&&l<=fe||l>=Me&&l<=Ie||l>=pe&&l<=me||l===ue)n++;else break}if(n===a)return t;let o=e.slice(a,n).toLowerCase(),i=!1;for(;n<r;){let l=e.charCodeAt(n);if(l===ge){n++;break}if(l===Ke&&n+1<r&&e.charCodeAt(n+1)===ge){n+=2,i=!0;break}if(l===Cr||l===kr){var s=l;for(n++;n<r&&e.charCodeAt(n)!==s;)n++;n<r&&n++;continue}if(l===J)return t;n++}if(i||nn(o))return n;let c=1;for(;n<r&&c>0;)if(e.charCodeAt(n)===Pe)if(n+1<r&&e.charCodeAt(n+1)===Ke){let l=n+2,u=l;for(;u<r&&(e.charCodeAt(u)>=ce&&e.charCodeAt(u)<=fe||e.charCodeAt(u)>=Me&&e.charCodeAt(u)<=Ie);)u++;if(e.slice(l,u).toLowerCase()===o){for(;u<r&&e.charCodeAt(u)!==ge;)u++;if(u<r&&u++,c--,c===0)return u}n=u}else{let l=n+1,u=l;for(;u<r&&(e.charCodeAt(u)>=ce&&e.charCodeAt(u)<=fe||e.charCodeAt(u)>=Me&&e.charCodeAt(u)<=Ie);)u++;e.slice(l,u).toLowerCase()===o&&c++,n++}else n++;return n}function Qy(e,t,r,n,a){if(e.charCodeAt(t)!==st||t+1>=r||e.charCodeAt(t+1)!==st)return null;let o=t+2;for(;o+1<r;){let i=e.charCodeAt(o);if(i===Ae){let s=Ka(e,o,r);if(s>o){o=s;continue}}if(i===st&&e.charCodeAt(o+1)===st){let s=e.slice(t+2,o),c=Kt(s,0,s.length,n,a);return{node:{type:T.textFormatted,tag:"del",children:c},end:o+2}}i===dt&&o+1<r&&o++,o++}return null}function eb(e,t,r,n,a){if(e.charCodeAt(t)!==Mt||t+1>=r||e.charCodeAt(t+1)!==Mt)return null;let o=t+2;for(;o+1<r;){let i=e.charCodeAt(o);if(i===Ae){let s=Ka(e,o,r);if(s>o){o=s;continue}}if(i===Mt&&e.charCodeAt(o+1)===Mt&&o>t+2){let s=e.slice(t+2,o),c=Kt(s,0,s.length,n,a);return{node:{type:T.textFormatted,tag:"mark",children:c},end:o+2}}i===dt&&o+1<r&&o++,o++}return null}function Si(e,t,r){return e<Wn?!!(Ya(e)&Or):wy.test(t[r])}function zi(e,t,r){return e<Wn?!!(Ya(e)&yr):xy.test(t[r])}function tb(e,t,r){var n=e.charCodeAt(t);if(n!==qe&&n!==He)return null;var a=ur(e,t,r,n);if(a===0)return null;var o=t>0?e.charCodeAt(t-1):32,i=t+a<r?e.charCodeAt(t+a):32,s=zi(o,e,t-1),c=zi(i,e,t+a),l=t>0?Si(o,e,t-1):!1,u=t+a<r?Si(i,e,t+a):!1,f=!c&&(!u||s||l),h=!s&&(!l||c||u),d,m;return n===qe?(d=f,m=h):(d=f&&(!h||l),m=h&&(!f||u)),{len:a,canOpen:d,canClose:m}}function rb(e,t,r,n){if(t.length!==0){for(var a=e.length,o=Array(a),i=null,s=null,c=0;c<a;c++){var l={node:e[c],prev:s,next:null};s?s.next=l:i=l,o[c]=l,s=l}for(var u=Array(t.length),f=0;f<t.length;f++)u[f]=o[t[f].idx];for(var h=[],d=0;d<12;d++)h[d]=-1;for(var m=0;m<t.length;){var p=t[m];if(!p.active||!p.canClose){m++;continue}for(var g=p.ch===qe?0:1,v=g*6+p.len%3*2+(p.canOpen?1:0),b=h[v]!==void 0?h[v]:-1,x=-1,P=m-1;P>b;P--){var C=t[P];if(!(!C.active||C.ch!==p.ch||!C.canOpen)&&!((p.canOpen||C.canClose)&&(C.len+p.len)%3===0&&C.len%3!==0)){x=P;break}}if(x<0){h[v]=m-1,!p.canOpen&&(p.active=!1),m++;continue}var y=t[x],z=y.len>=2&&p.len>=2,D=z?2:1;y.len-=D,p.len-=D;var N=u[x],S=u[m],q=N.node,B=S.node;q.text=q.text.slice(0,q.text.length-D),B.text=B.text.slice(D);for(var oe=[],V=N.next;V&&V!==S;)oe.push(V.node),V=V.next;var L={type:T.textFormatted,tag:z?"strong":"em",children:oe},F={node:L,prev:N,next:S};N.next=F,S.prev=F;for(var Y=x+1;Y<m;Y++)t[Y].active=!1;if(y.len===0&&(y.active=!1,q.text==="")){var Ee=N.prev;F.prev=Ee,Ee?Ee.next=F:i=F}if(p.len===0){if(p.active=!1,B.text===""){var $=S.next;F.next=$,$&&($.prev=F)}}else continue;m++}for(var de=0,ze=i;ze;){var lt=ze.node;if(lt.type===T.text){var De=lt;if(De.text===""){ze=ze.next;continue}if(de>0&&e[de-1].type===T.text){e[de-1].text+=De.text,ze=ze.next;continue}}e[de++]=lt,ze=ze.next}e.length=de}}function Ti(e,t,r,n,a){let o=e.charCodeAt(t)===At,i=o?t+1:t;if(e.charCodeAt(i)!==We)return null;var s=e.indexOf("]",i+1);if(s<0||s>=r)return null;for(var c=i+1,l=-1,u=1;c<r&&u>0;){var f=e.charCodeAt(c);if(f===dt&&c+1<r){c+=2;continue}if(f===Ae){var h=Ka(e,c,r);if(h>c){c=h;continue}}if(f===Pe){var d=Js(e,c,r);if(d){c=d.end;continue}var m=$y(e,c,r);if(m>c){c=m;continue}}f===We?u++:f===jt&&u--,c++}if(u!==0)return null;var p=c-1,g=e.slice(i+1,p),v=c<r?e.charCodeAt(c):0,b=!1;if(v===Ft){var x=!0;for(c++;c<r&&(e.charCodeAt(c)===R||e.charCodeAt(c)===J);)c++;var P="",C=c;if(c<r&&e.charCodeAt(c)===Pe){for(c++,C=c;C<r&&e.charCodeAt(C)!==ge;){if(e.charCodeAt(C)===dt&&C+1<r){C+=2;continue}if(e.charCodeAt(C)===J){x=!1;break}C++}x&&(C>=r||e.charCodeAt(C)!==ge)&&(x=!1),x&&(P=e.slice(c,C),C++)}else if(x)if(n.g!==void 0&&c>=n.g)x=!1;else{for(var y=0,z=!1;C<r;){var D=e.charCodeAt(C);if(D===dt&&C+1<r){C+=2;continue}if(D===Ft)y++;else if(D===Ut){if(z=!0,y===0)break;y--}else if(D===R||D===J)break;C++}C>=r&&!z&&(n.g===void 0||c<n.g)&&(n.g=c),P=e.slice(c,C)}if(x){for(c=C;c<r&&(e.charCodeAt(c)===R||e.charCodeAt(c)===J);)c++;var N;if(c<r){var S=e.charCodeAt(c);if(S===Cr||S===kr||S===Ft){var q=S===Ft?41:S;c++;for(var B=c;c<r&&e.charCodeAt(c)!==q;)e.charCodeAt(c)===dt&&c+1<r&&c++,c++;c>=r?x=!1:(N=e.slice(B,c),c++)}}if(x){for(;c<r&&(e.charCodeAt(c)===R||e.charCodeAt(c)===J);)c++;(c>=r||e.charCodeAt(c)!==Ut)&&(x=!1)}}if(x){c++,P=Fr(P),N!==void 0&&(N=Gn(Fr(N)));var oe=(a==null?void 0:a.sanitizer)||Ga,V=oe(P,o?"img":"a",o?"src":"href"),L=V===null?null:P;if(o){var F=Kt(g,0,g.length,n,a),Y=Ta(F);return{node:{type:T.image,target:L,alt:Y,title:N},end:c}}else{var Ee=n.inAnchor;n.inAnchor=!0;var le=Ee?[{type:T.text,text:g}]:Kt(g,0,g.length,n,a);return n.inAnchor=Ee,!n.inAnchor&&za(le)?null:{node:{type:T.link,target:L,title:N,children:le},end:c}}}else c=p+1,b=!0}var $="",de=c;if(!b&&v===We){var ze=c+1;de=ze;for(var lt=!1;de<r&&e.charCodeAt(de)!==jt;){if(e.charCodeAt(de)===dt&&de+1<r){de+=2;continue}if(e.charCodeAt(de)===We){lt=!0;break}de++}if(lt||de>=r)return null;var De=e.slice(ze,de);if(De.trim())$=bn(De);else{if(xi(g))return null;$=bn(g)}de=de+1}else{if(xi(g))return null;$=bn(g)}var Ue=n.refs[$];if(!Ue)return null;if(o)return{node:{type:T.image,target:Ue.target,alt:Ta(Kt(g,0,g.length,n,a)),title:Ue.title},end:de};var ve=n.inAnchor;n.inAnchor=!0;var le=ve?[{type:T.text,text:g}]:Kt(g,0,g.length,n,a);return n.inAnchor=ve,!n.inAnchor&&za(le)?null:{node:{type:T.link,target:Ue.target,title:Ue.title,children:le},end:de}}function Js(e,t,r){if(e.charCodeAt(t)!==Pe)return null;for(var n=t+1;n<r;){var a=e.charCodeAt(n);if(a===ge)break;if(a===R||a===J||a===wr||a===Pe)return null;n++}if(n>=r||e.charCodeAt(n)!==ge)return null;var o=e.slice(t+1,n),i=o.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return i?{node:{type:T.link,target:o,title:void 0,children:[{type:T.text,text:o}]},end:n+1}:o.indexOf("@")!==-1&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(o)?{node:{type:T.link,target:"mailto:"+o,title:void 0,children:[{type:T.text,text:o}]},end:n+1}:null}function nb(e,t,r,n){if(e.charCodeAt(t)!==We||t+1>=r||e.charCodeAt(t+1)!==er)return null;let a=t+2;for(;a<r&&e.charCodeAt(a)!==jt&&e.charCodeAt(a)!==J;)a++;if(a>=r||e.charCodeAt(a)!==jt)return null;let o=e.slice(t+2,a);return o?{node:{type:T.footnoteReference,target:"#"+Dt(o),text:o},end:a+1}:null}function ab(e,t,r,n){if(n.disableBareUrls)return null;var a="",o=!1,i=e.charCodeAt(t);if(i===En||i===72?t+8<=r&&e.charCodeAt(t+1)===Ir&&e.charCodeAt(t+2)===Ir&&e.charCodeAt(t+3)===wa&&(e.charCodeAt(t+4)===js&&e.charCodeAt(t+5)===wt&&e.charCodeAt(t+6)===Ke&&e.charCodeAt(t+7)===Ke?a="https://":e.charCodeAt(t+4)===wt&&e.charCodeAt(t+5)===Ke&&e.charCodeAt(t+6)===Ke&&(a="http://")):i===xr||i===70?t+6<=r&&e.charCodeAt(t+1)===Ir&&e.charCodeAt(t+2)===wa&&e.charCodeAt(t+3)===wt&&e.charCodeAt(t+4)===Ke&&e.charCodeAt(t+5)===Ke&&(a="ftp://"):(i===br||i===87)&&t+4<=r&&e.charCodeAt(t+1)===br&&e.charCodeAt(t+2)===br&&e.charCodeAt(t+3)===Rt&&(a="www.",o=!0),!a)return null;let s=t+a.length;for(;s<r;){let y=e.charCodeAt(s);if(y===R||y===J||y===U||y===wr||y===Pe||y===ge)break;s++}for(var c=0,l=0,u=t;u<s;u++){var f=e.charCodeAt(u);f===Ft?c++:f===Ut&&l++}let h=s;for(;h>t+a.length;){let y=e.charCodeAt(h-1);if(y===Rt||y===ly||y===wt||y===At||y===rn||y===Ut||y===qe||y===He||y===st){if(y===Ut){if(c>=l)break;l--}h--}else if(y===Pn){for(var d=h-2;d>t&&(e.charCodeAt(d)>=ce&&e.charCodeAt(d)<=fe||e.charCodeAt(d)>=Me&&e.charCodeAt(d)<=Ie||e.charCodeAt(d)>=pe&&e.charCodeAt(d)<=me);)d--;d>=t&&e.charCodeAt(d)===Vn?h=d:h--}else break}if(h<=t+a.length)return null;var m=t+(o?4:a.length),p=e.indexOf("/",m);if((p<0||p>h)&&(p=h),o&&e.indexOf(".",m)===-1)return null;for(var g=-1,v=-1,b=p-1;b>=m;b--)if(e.charCodeAt(b)===Rt)if(g<0)g=b;else{v=b;break}for(var x=v>=0?v+1:m,b=x;b<p;b++)if(e.charCodeAt(b)===He)return null;var P=e.slice(t,h),C=o?"http://"+P:P;return{node:{type:T.link,target:C,title:void 0,children:[{type:T.text,text:P}]},end:h}}function ob(e,t,r,n){if(n.disableBareUrls)return null;for(var a=t,o=a;a<r;){var i=e.charCodeAt(a);if(i>=ce&&i<=fe||i>=Me&&i<=Ie||i>=pe&&i<=me||i===Rt||i===At||i===Ot||i===36||i===ya||i===Vn||i===kr||i===qe||i===lr||i===Ke||i===Mt||i===rn||i===er||i===He||i===Ae||i===Hr||i===it||i===Wa||i===st||i===ue)a++;else break}if(a===o||a>=r||e.charCodeAt(a)!==Us)return null;a++;for(var s=a,c=-1,l=a;a<r;){var i=e.charCodeAt(a);if(i>=ce&&i<=fe||i>=Me&&i<=Ie||i>=pe&&i<=me)a++;else if((i===ue||i===He)&&a>s)a++;else if(i===Rt){if(a===s)break;var u=e.charCodeAt(a-1);if(u===ue||u===He||a-l>63)break;if(a+1<r){var f=e.charCodeAt(a+1);if(f>=ce&&f<=fe||f>=Me&&f<=Ie||f>=pe&&f<=me)c=a,l=a+1,a++;else break}else break}else break}if(a-l>63||c<0)return null;var h=e.charCodeAt(a-1);if(!(h>=ce&&h<=fe||h>=Me&&h<=Ie||h>=pe&&h<=me)||a<=c+1)return null;for(var d=-1,m=c-1;m>=s;m--)if(e.charCodeAt(m)===Rt){d=m;break}for(var p=d>=0?d+1:s,m=p;m<a;m++)if(e.charCodeAt(m)===He)return null;var g=e.slice(t,a);return{node:{type:T.link,target:"mailto:"+g,title:void 0,children:[{type:T.text,text:g}]},end:a}}function za(e){for(var t=0;t<e.length;t++)if(e[t].type===T.link||"children"in e[t]&&Array.isArray(e[t].children)&&za(e[t].children))return!0;return!1}function Ta(e){for(var t="",r=0;r<e.length;r++){var n=e[r];n.type===T.text?t+=n.text:n.type===T.breakLine?t+=" ":n.type===T.codeInline?t+=n.text:"children"in n&&Array.isArray(n.children)?t+=Ta(n.children):n.type===T.image&&(t+=n.alt||"")}return t}function vr(e){return{type:T.text,text:e}}function ib(e,t,r){var n=t+1;if(n>=r)return-1;if(e.charCodeAt(n)===Ot){n++;var a=n<r&&(e.charCodeAt(n)===uy||e.charCodeAt(n)===dy);a&&n++;for(var o=n,i=a?6:7;n<r&&n-o<=i;){var s=e.charCodeAt(n),c=s>=pe&&s<=me||a&&(s>=ce&&s<=ba||s>=Me&&s<=xr);if(!c)break;n++}return n===o||n-o>i?-1:n<r&&e.charCodeAt(n)===Pn?n+1:-1}for(var l=n;n<r&&n-l<48;){var u=e.charCodeAt(n);if(u>=ce&&u<=fe||u>=Me&&u<=Ie||u>=pe&&u<=me){n++;continue}break}return n===l?-1:n<r&&e.charCodeAt(n)===Pn?n+1:-1}function sb(e,t,r,n,a){if(e.charCodeAt(t)!==Pe)return null;var o=t+1;if(o>=r)return null;var i=e.charCodeAt(o);if(i===At&&o+1<r&&e.charCodeAt(o+1)===ue&&o+2<r&&e.charCodeAt(o+2)===ue){var s=o+3;if(s<r&&e.charCodeAt(s)===ge)return{node:{type:T.htmlComment,text:"",l:!0},end:s+1};if(s+1<r&&e.charCodeAt(s)===ue&&e.charCodeAt(s+1)===ge)return{node:{type:T.htmlComment,text:"-",l:!0},end:s+2};var c=e.indexOf("-->",s);return c!==-1&&c<=r-3?{node:{type:T.htmlComment,text:e.slice(t+4,c),l:!1},end:c+3}:null}if(i===rn){var l=e.indexOf("?>",o+1);return l!==-1&&l<r?{node:{type:T.htmlSelfClosing,tag:"?",attrs:{},a:e.slice(t,l+2),b:!1},end:l+2}:null}if(i===At&&o+1<r){var u=e.charCodeAt(o+1);if(u===We&&e.slice(o+1,o+8)==="[CDATA["){var f=e.indexOf("]]>",o+8);return f!==-1&&f<r?{node:{type:T.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:e.slice(t,f+3),b:!1},end:f+3}:null}if(u>=ce&&u<=fe){var h=e.indexOf(">",o+2);return h!==-1&&h<r?{node:{type:T.htmlSelfClosing,tag:"!"+e.slice(o+1,h),attrs:{},a:e.slice(t,h+1),b:!1},end:h+1}:null}}if(i===Ke){var d=o+1;if(d>=r)return null;var m=e.charCodeAt(d);if(!(m>=ce&&m<=fe||m>=Me&&m<=Ie))return null;for(d++;d<r;){var p=e.charCodeAt(d);if(p>=ce&&p<=fe||p>=Me&&p<=Ie||p>=pe&&p<=me||p===ue)d++;else break}for(;d<r&&(e.charCodeAt(d)===R||e.charCodeAt(d)===U||e.charCodeAt(d)===J);)d++;if(d<r&&e.charCodeAt(d)===ge){var g=e.slice(o+1,d).trim();return{node:{type:T.htmlSelfClosing,tag:g,attrs:{},a:e.slice(t,d+1),b:!0},end:d+1}}return null}if(!(i>=ce&&i<=fe||i>=Me&&i<=Ie))return null;var v=Zt(e,t);if(!v)return null;var b=v.tag,x=b.toLowerCase(),P=v.selfClosing;if(P||nn(b))return{node:{type:T.htmlSelfClosing,tag:b,attrs:Xt(v.attrs,b,a),a:e.slice(t,v.end),b:!1},end:v.end};var C=an.has(x),y=Sa(e.slice(0,r),v.end,b);if(y===-1)return{node:{type:T.htmlSelfClosing,tag:b,attrs:Xt(v.attrs,b,a),a:e.slice(t,v.end),b:!1},end:v.end};var z=Yy(e,"</"+x,y),D=e.slice(v.end,z),N=[];if(C)D.trim()&&(N=[{type:T.text,text:D}]);else{var S=D.trim();if(S){var{inAnchor:q,inline:B,e:oe}=n;x==="a"&&(n.inAnchor=!0),n.e=!1;var V=S.indexOf(`
|
|
622
|
+
|
|
623
|
+
`)!==-1||/^#{1,6}\s/.test(S);V?(n.inline=!1,N=cr(S,n,a)):N=Kt(S,0,S.length,n,a),n.inAnchor=q,n.inline=B,n.e=oe}}return{node:{type:T.htmlBlock,tag:b,attrs:Xt(v.attrs,b,a),i:v.rawAttrs,children:N,a:void 0,text:D,d:!1,b:!1},end:y}}var cb=200,Jr=0;function Kt(e,t,r,n,a){if(Jr++,Jr>cb)return Jr--,[{type:T.text,text:e.slice(t,r)}];var o=n.g;n.g=void 0;let i=n;if(a.optimizeForStreaming){let se=function(be,Ze){for(var Ve=1,ut=Ze+1;ut<be.length;ut++){var je=be.charCodeAt(ut);if(je===We)Ve++;else if(je===jt&&(Ve--,Ve===0))return ut}return-1},I=e.slice(t,r),ft=I;for(var s=0,c=0,l=0,u=0,f=0,h=-1,d=-1,m=-1,p=-1,g=-1,v=0;v<I.length;v++){var b=I.charCodeAt(v);b===qe?v+1<I.length&&I.charCodeAt(v+1)===qe?(s++,h=v,v++):(c++,d=v):b===He?v+1<I.length&&I.charCodeAt(v+1)===He?(l++,m=v,v++):(u++,p=v):b===st&&v+1<I.length&&I.charCodeAt(v+1)===st&&(f++,g=v,v++)}var x=[];f%2===1&&g>=0&&x.push([g,2]),l%2===1&&m>=0&&x.push([m,2]),u%2===1&&p>=0&&x.push([p,1]),s%2===1&&h>=0&&x.push([h,2]),c%2===1&&d>=0&&x.push([d,1]),x.sort(function(be,Ze){return Ze[0]-be[0]});for(var P=0;P<x.length;P++){var C=x[P][0],y=x[P][1];I=I.slice(0,C)+I.slice(C+y)}let ot=0,ht=-1;for(let be=0;be<I.length;be++)I.charCodeAt(be)===Ae&&(ot++,ht=be);if(ot%2===1&&ht!==-1){let be=!1,Ze=-1,Ve=0;for(;Ve<I.length;)I.charCodeAt(Ve)===Ae&&(be?(be=!1,Ze=-1):(Ze=Ve,be=!0)),Ve++;be&&Ze!==-1&&(I=I.slice(0,Ze))}for(var z=!0;z;){z=!1;for(var D=-1,N=-1,S=-1,q=!1,B=0;B<I.length;B++){var oe=I.charCodeAt(B);if(oe===We&&(B===0||I.charCodeAt(B-1)!==dt)){var V=B>0&&I.charCodeAt(B-1)===At,L=V?B-1:B,F=se(I,B);if(F===-1)D=L,q=V,N=B+1,S=I.length;else{var Y=F+1;if(Y>=I.length)D=L,q=V,N=B+1,S=F;else if(I.charCodeAt(Y)===Ft){var Ee=I.indexOf(")",Y+1);Ee===-1?(D=L,q=V,N=B+1,S=F,B=I.length):B=Ee}else if(I.charCodeAt(Y)===We){var $=I.indexOf("]",Y+1);$===-1?(D=L,q=V,N=B+1,S=F,B=I.length):B=$}else B=F}}}if(D>=0){var de=q?"":I.slice(N,S);I=I.slice(0,D)+de,z=!0}}let rt=I.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(rt&&rt.index!==void 0){var ze=rt[0].length-rt[2].length,lt=ze>=2&&rt[0].charCodeAt(ze-2)===Ke;if(!lt){for(var De=!1,Ue=0,ve=0;ve<rt.index;ve++)I.charCodeAt(ve)===Ae&&Ue++;if(De=Ue%2===1,!De){let be=rt[1];ir(I,"</"+be,0)===-1&&(I=I.slice(0,rt.index)+rt[2])}}}I!==ft&&(e=e.slice(0,t)+I,r=t+I.length)}let le=[];var Re=[];let ie=t;var xe="",he=a.disableAutoLink||a.disableBareUrls||i.inAnchor?-1:e.indexOf("@",t);for(he>=r&&(he=-1);t<r;){let se=e.charCodeAt(t),I=null;if(se===Ae){if(I=Zy(e,t,r),!I){var tt=ur(e,t,r,Ae);t+=tt-1}}else if(se===qe||se===He){var Ce=tb(e,t,r);if(Ce){if(Ce.canOpen||Ce.canClose){(xe||t>ie)&&(le.push(vr(xe+e.slice(ie,t))),xe="");var ye=e.slice(t,t+Ce.len),Z=vr(ye);Re.push({idx:le.length,ch:se,len:Ce.len,canOpen:Ce.canOpen,canClose:Ce.canClose,active:!0}),le.push(Z),t+=Ce.len,ie=t;continue}t+=Ce.len-1}}else if(se===st)I=Qy(e,t,r,i,a);else if(se===Mt)I=eb(e,t,r,i,a);else if(se===We)t+1<r&&e.charCodeAt(t+1)===er&&(I=nb(e,t,r)),I||(I=Ti(e,t,r,i,a));else if(se===At&&t+1<r&&e.charCodeAt(t+1)===We)I=Ti(e,t,r,i,a);else if(se===Pe)I=Js(e,t,r),!I&&!a.disableParsingRawHTML&&!a.ignoreHTMLBlocks&&(I=sb(e,t,r,i,a));else if(se===Vn){var Oe=ib(e,t,r);if(Oe!==-1){var at=e.slice(t,Oe),Be=Gn(at);if(Be!==at){xe=xe+e.slice(ie,t)+Be,t=Oe,ie=Oe;continue}}}else if((se===En||se===br||se===xr)&&!i.inAnchor&&!a.disableAutoLink&&(t===0||e.charCodeAt(t-1)!==Pe)){var pt=t+1<r?e.charCodeAt(t+1):0;(se===En&&pt===Ir||se===xr&&pt===Ir||se===br&&pt===br)&&(I=ab(e,t,r,a))}if(!I&&he>=0&&he-t<=64&&!i.inAnchor&&!a.disableAutoLink&&!a.disableBareUrls&&(se>=ce&&se<=fe||se>=Me&&se<=Ie||se>=pe&&se<=me)&&(I=ob(e,t,r,a),!I&&t>=he&&(he=e.indexOf("@",t+1),he>=r&&(he=-1))),se===J&&i.e){var gt=!1,H=0;if(t>ie&&e.charCodeAt(t-1)===dt)gt=!0,H=1;else{for(var Q=0,j=t-1;j>=ie&&e.charCodeAt(j)===R;)Q++,j--;Q>=2&&(gt=!0,H=Q)}if(gt){for((xe||t-H>ie)&&(le.push(vr(xe+e.slice(ie,t-H))),xe=""),le.push({type:T.breakLine}),t++;t<r&&e.charCodeAt(t)===R;)t++;ie=t;continue}var Xe=t>ie&&e.charCodeAt(t-1)===R,Te=t+1<r&&e.charCodeAt(t+1)===R;if(Xe||Te){for(var mt=t;mt>ie&&e.charCodeAt(mt-1)===R;)mt--;for(xe+=e.slice(ie,mt)+`
|
|
624
|
+
`,t++;t<r&&e.charCodeAt(t)===R;)t++;ie=t;continue}}if(I)(xe||t>ie)&&(le.push(vr(xe+e.slice(ie,t))),xe=""),le.push(I.node),t=I.end,ie=t;else{if(se===dt&&t+1<r){let ft=e.charCodeAt(t+1);if(Ya(ft)&Or){(xe||t>ie)&&(le.push(vr(xe+e.slice(ie,t))),xe=""),le.push(vr(e[t+1])),t+=2,ie=t;continue}}if(t++,he<0||he-t>64)for(;t<r&&!(he>=0&&he-t<=64);){var Pt=e.charCodeAt(t);if(Pt<Wn&&!Ws[Pt])t++;else break}}}return(xe||r>ie)&&(le.push(vr(xe+e.slice(ie,r))),xe=""),Re.length>0&&rb(le,Re),n.g=o,Jr--,le}var lb=500;function cr(e,t,r){var n=t.j||0;if(n>lb)return[{type:T.text,text:e}];if(t.j=n+1,r.optimizeForStreaming&&!t.m){var a=e.length;a>0&&e.charCodeAt(a-1)===J&&a--;for(var o=a;o>0&&e.charCodeAt(o-1)!==J;)o--;if(o>0&&e.charCodeAt(o)===it){for(var i=!0,s=o;s<a;s++){var c=e.charCodeAt(s);if(c!==R&&c!==U&&c!==ue&&c!==wt&&c!==it){i=!1;break}}if(i){for(var l=o-1;l>0&&e.charCodeAt(l-1)!==J;)l--;e.charCodeAt(l)===it&&(e=e.slice(0,l).trimEnd())}}var u=e.trim(),f=u.lastIndexOf(`
|
|
625
|
+
`),h=f===-1?u:u.slice(f+1);if(h.length>0&&h.charCodeAt(0)===it){for(var d=!1,m=!1,p=1;p<h.length;p++){var g=h.charCodeAt(p);g===it&&(d=!0),g===ue&&(m=!0)}d&&m&&(e=f===-1?"":e.slice(0,e.lastIndexOf(h)).trimEnd())}for(var v=-1,b=-1,x=-1,P=e.length-1;P>=0;P--)if(e.charCodeAt(P)===Pe){var C=P+1<e.length?e.charCodeAt(P+1):0;if(C>=ce&&C<=fe||C>=Me&&C<=Ie){for(var y=P+2;y<e.length;){var z=e.charCodeAt(y);if(z>=ce&&z<=fe||z>=Me&&z<=Ie||z>=pe&&z<=me)y++;else break}for(var D=y;D<e.length&&e.charCodeAt(D)!==ge;)D++;if(D<e.length&&e.charCodeAt(D-1)!==Ke){for(var N=!1,S=D+1;S<e.length;S++)if(e.charCodeAt(S)===Pe){N=!0;break}N||(v=P,b=y,x=D+1)}}break}if(v>=0){for(var q=0,B=0;B<v;B++)e.charCodeAt(B)===Ae&&q++;if(q%2===0){var oe=e.slice(v+1,b);ir(e,"</"+oe,0)===-1&&(e=e.slice(0,v)+e.slice(x))}}for(var V=e.length;V>0&&e.charCodeAt(V-1)===J;)V--;if(V>0){for(var L=V;L>0&&e.charCodeAt(L-1)!==J;)L--;for(var F=L,Y=0;F<V&&e.charCodeAt(F)===R&&Y<3;)F++,Y++;if(L>0&&F<V&&Hy(e,F,V)){for(var Ee=L-1,$=Ee;$>0&&e.charCodeAt($-1)!==J;)$--;_t(e,$,Ee)||(e=e.slice(0,L).trimEnd())}}var de=e.length;if(de>0){for(var ze=e.lastIndexOf(`
|
|
626
|
+
`),lt=ze===-1?0:ze+1,De=de,Ue=lt,ve=0;Ue<De&&e.charCodeAt(Ue)===R&&ve<3;)Ue++,ve++;if(Ue<De){var le=e.charCodeAt(Ue),Re=!1;if(le===qe||le===ue||le===lr){var ie=Ue+1;if(ie>=De||e.charCodeAt(ie)===R||e.charCodeAt(ie)===U){for(var xe=ie;xe<De&&(e.charCodeAt(xe)===R||e.charCodeAt(xe)===U);)xe++;xe>=De&&(Re=!0)}}else if(le>=pe&&le<=me){for(var he=Ue;he<De&&e.charCodeAt(he)>=pe&&e.charCodeAt(he)<=me;)he++;if(he<De&&(e.charCodeAt(he)===Rt||e.charCodeAt(he)===Ut)){var tt=he+1;if(tt>=De||e.charCodeAt(tt)===R||e.charCodeAt(tt)===U){for(var Ce=tt;Ce<De&&(e.charCodeAt(Ce)===R||e.charCodeAt(Ce)===U);)Ce++;Ce>=De&&(Re=!0)}}}Re&&(e=e.slice(0,lt).trimEnd())}}}if(t.inline)return Kt(e,0,e.length,t,r);let ye=[],Z=0,Oe=e.length;if(Z===0&&!r.disableFrontmatter&&e.startsWith("---")){let j=hy(e);if(j&&j.hasValidYaml){if(r.preserveFrontmatter!==!1){let Xe=e.slice(0,j.endPos).trimEnd();ye.push({type:T.frontmatter,text:Xe})}Z=j.endPos}}for(;Z<Oe;){for(var at=e.indexOf(`
|
|
627
|
+
`,Z),Be=at<0?Oe:at;Z<Oe&&_t(e,Z,Be);)Z=Be<Oe?Be+1:Be,Z<Oe&&(at=e.indexOf(`
|
|
628
|
+
`,Z),Be=at<0?Oe:at);if(Z>=Oe)break;var pt=e.charCodeAt(Z)===xa;$e(e,Z,Be);let j=null;if(_a=e,Aa=Z,wn=Be,!pt&&_e>=4&&!t.inHTML)j=Vy(e,Z);else if(!pt){let Xe=Z+ke,Te=e.charCodeAt(Xe);Te===Ot?j=jy(e,Z,t,r):Te===ge?j=Wy(e,Z,t,r):Te===Ae||Te===st?j=By(e,Z):Te===ue||Te===qe||Te===He?(j=sr(e,Z),!j&&(j=Ci(e,Z,t,r))):Te===lr||Te>=pe&&Te<=me?j=Ci(e,Z,t,r):Te===Pe?j=qs(e,Z,t,r):Te===it?j=Ai(e,Z,t,r):Te===We&&(j=qy(e,Z,t))}if(!j){for(var gt=!1,H=Z;H<Be;H++)if(e.charCodeAt(H)===it){gt=!0;break}gt&&(j=Ai(e,Z,t,r))}if(j||(j=Xy(e,Z,t,r)),j)j.node.type!==T.refCollection&&ye.push(j.node),Z=j.end;else{var Q=e.indexOf(`
|
|
629
|
+
`,Z);Z=Q<0?Oe:Q+1}}return t.j=n,ye}function ub(e,t,r,n){var a=Zt(e,t);return a?{tagName:a.tag,tagLower:a.tag.toLowerCase(),attrs:a.rawAttrs,whitespaceBeforeAttrs:a.whitespaceBeforeAttrs,isSelfClosing:a.selfClosing,hasSpaceBeforeSlash:a.hasSpaceBeforeSlash,isClosing:a.isClosing,hasNewline:a.whitespaceBeforeAttrs.includes(`
|
|
630
|
+
`)||a.rawAttrs.includes(`
|
|
631
|
+
`),endPos:a.end}:null}function qa(e,t,r){Jr=0,e=ky(e),!t.refs&&(t.refs={}),(r.optimizeForStreaming||t.inline)&&(t.m=Uy(e,t.refs,r));var n=!t.k;n&&(t.k=[],t.h=[]);let a=cr(e,t,r);if(n){for(var o=t.k,i={inline:t.inline,inAnchor:t.inAnchor,inHTML:t.inHTML,htmlDepth:t.c,inList:t.inList,inBlockQuote:t.inBlockQuote,noSetext:t.f,depth:t.j},s=0;s<o.length;s++){var c=o[s];t.inline=c.inline,t.inAnchor=c.inAnchor,t.inHTML=c.inHTML,t.c=c.htmlDepth,t.inList=c.inList,t.inBlockQuote=c.inBlockQuote,t.f=c.noSetext,t.j=c.depth,t.e=c.breaks;var l=Kt(c.text,0,c.text.length,t,r);t.e=!1;for(var u=0;u<l.length;u++)c.dest.push(l[u])}t.inline=i.inline,t.inAnchor=i.inAnchor,t.inHTML=i.inHTML,t.c=i.htmlDepth,t.inList=i.inList,t.inBlockQuote=i.inBlockQuote,t.f=i.noSetext,t.j=i.depth;for(var f=t.h,h=0;h<f.length;h++)for(var d=f[h],m=0;m<d.src.length;m++){var p=d.src[m];if(d.unwrap&&p.type===T.paragraph)for(var g=p.children,v=0;v<g.length;v++)d.dest.push(g[v]);else d.dest.push(p)}t.k=void 0,t.h=void 0}return Hs(t.refs)?[{type:T.refCollection,refs:t.refs},...a]:a}var Ea;try{Ea=A.createElement("div").$$typeof}catch{Ea=Symbol.for("react.transitional.element")}function Pa(e,t,r){return{$$typeof:Ea,type:e,key:r!=null?""+r:null,ref:null,props:t,_owner:null,_store:{},_debugStack:null,_debugTask:null}}var db=typeof A.createContext<"u"?A.createContext(void 0):void 0;function Ei(e,t,r,n,a,o,i,s,c){switch(e.type){case T.blockQuote:{let d={key:r.key};return e.alert&&(d.className="markdown-alert-"+o(e.alert.toLowerCase(),Dt),e.children.unshift(_y(e.alert))),n("blockquote",d,t(e.children,r))}case T.breakLine:return n("br",{key:r.key});case T.breakThematic:return n("hr",{key:r.key});case T.frontmatter:return s.preserveFrontmatter?n("pre",{key:r.key},e.text):null;case T.codeBlock:let h=e.lang?Gn(e.lang):"";return n("pre",{key:r.key},n("code",{...Tt(e.attrs),className:h?`language-${h} lang-${h}`:""},e.text));case T.codeInline:return n("code",{key:r.key},e.text);case T.footnoteReference:return n("a",{key:r.key,href:a(e.target,"a","href")||void 0},n("sup",null,e.text));case T.gfmTask:return n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"});case T.heading:return n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r));case T.htmlBlock:{let d=e;if(s.tagfilter&&vi(d.tag))return n("span",{key:r.key},"<"+d.tag+gi(d.attrs)+">");if(d.a&&d.d){let m=d.tag.toLowerCase(),p=Iy(m),g=d.children&&d.children.length>0;if(p){let S=Ty(d.a,m,s.tagfilter);return/<[a-z][^>]{0,100}>/i.test(d.a)?c(e.tag,{key:r.key,...Tt(e.attrs),dangerouslySetInnerHTML:{__html:S}}):c(e.tag,{key:r.key,...Tt(e.attrs)},S)}let v=new RegExp(`^<${d.tag}(\\s|>)`,"i");if(g&&!v.test(d.a)&&s.tagfilter&&Ry(d.a))return c(e.tag,{key:r.key,...Tt(e.attrs)},t(d.children,r));if(Fy(d.a)){let S=s.tagfilter?Vs(d.a):d.a;return c(e.tag,{key:r.key,...Tt(e.attrs),dangerouslySetInnerHTML:{__html:S}})}let b={slugify:S=>o(S,Dt),sanitizer:a,tagfilter:!0},x=d.a.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${d.tag}(\\s[^>]*)?>(\\s*</${d.tag}>)?$`,"i").test(x))return d.children&&d.children.length>0?c(e.tag,{key:r.key,...Tt(e.attrs)},t(d.children,r)):c(e.tag,{key:r.key,...Tt(e.attrs)});let P=qa(x,{inline:!1,refs:i,inHTML:!1},b);Bs(P);let C=d.tag.toLowerCase(),y="</"+C+">",z=v.test(x),D=x.toLowerCase().trimEnd().endsWith(y),N=z&&D;if(N&&g)return c(e.tag,{key:r.key,...Tt(e.attrs)},t(d.children,r));if(N)return t(P.flatMap(Nr),r);var l=zy(P,C);if(l.found&&l.afterClose.length>0){var u=l.beforeClose.flatMap(Nr),f=l.afterClose.flatMap(Nr);return Pa(A.Fragment,{children:[c(e.tag,{key:r.key,...Tt(e.attrs)},t(u,r)),t(f,r)]},r.key)}return c(e.tag,{key:r.key,...Tt(e.attrs)},t(P.flatMap(Nr),r))}return nn(e.tag)?c(e.tag,{key:r.key,...Tt(e.attrs)}):c(e.tag,{key:r.key,...Tt(e.attrs)},e.children?t(e.children,r):"")}case T.htmlSelfClosing:{let d=e;return s.tagfilter&&vi(d.tag)?n("span",{key:r.key},"<"+d.tag+gi(d.attrs)+" />"):c(e.tag,{key:r.key,...Tt(e.attrs)})}case T.image:{let d=e.target!=null?a(e.target,"img","src"):null;return n("img",{key:r.key,alt:e.alt&&e.alt.length>0?e.alt:void 0,title:e.title||void 0,src:d||void 0})}case T.link:{let d={key:r.key};return e.target!=null&&(d.href=Py(e.target)),e.title&&(d.title=e.title),n("a",d,t(e.children,r))}case T.table:{let d=e;return n("table",{key:r.key},n("thead",{key:"thead"},n("tr",null,d.header.map(function(m,p){return n("th",{key:p,style:d.align[p]==null?{}:{textAlign:d.align[p]}},t(m,r))}))),d.cells.length>0&&n("tbody",{key:"tbody"},d.cells.map(function(m,p){return n("tr",{key:p},m.map(function(g,v){return n("td",{key:v,style:d.align[v]==null?{}:{textAlign:d.align[v]}},t(g,r))}))})))}case T.text:return e.text;case T.textFormatted:return n(e.tag,{key:r.key},t(e.children,r));case T.orderedList:case T.unorderedList:{let d=e.type===T.orderedList?"ol":"ul";return n(d,{key:r.key,start:e.type===T.orderedList?e.start:void 0},e.items.map(function(m,p){return n("li",{key:p},t(m,r))}))}case T.paragraph:return n("p",{key:r.key},t(e.children,r));case T.ref:return null;default:return null}}var fb=(e,t,r,n,a,o,i)=>{var s=l=>l.map(function(u){return"text"in u?u.text:""}),c=(l,u={})=>{var f=(u.renderDepth||0)+1;if(f>2500)return s(l);u.renderDepth=f;for(var h=u.key,d=[],m=!1,p=0;p<l.length;p++){u.key=p;var g;if(e){var v=Ei.bind(null,l[p],c,u,t,r,n,a,o,i);g=e(v,l[p],c,u)}else g=Ei(l[p],c,u,t,r,n,a,o,i);var b=typeof g=="string";if(b&&m)d[d.length-1]+=g;else if(g!==null)if(Array.isArray(g))for(var x=0;x<g.length;x++)d.push(g[x]);else d.push(g);m=b}return u.key=h,u.renderDepth=f-1,d};return c},hb=(e,t)=>{let r=ka(t,e,void 0);return r?typeof r=="function"||typeof r=="object"&&"render"in r?r:ka(t,`${e}.component`,e):e};function pb(e,t){let r={...t||{}};r.overrides=r.overrides||{};let n=r.slugify||Dt,a=r.sanitizer||Ga,o=r.createElement,i=Hs(r.overrides),s=x=>Ma(x,{...r,wrapper:null});function c(x){for(var P in x){var C=x[P];if(typeof C=="string"&&C.length>0&&C.charCodeAt(0)===Pe&&(Oy.test(C)||Ny.test(C)||ub(C,0))){var y=s(C.trim());x[P]=P==="innerHTML"&&Array.isArray(y)?y[0]:y}}}function l(x,P,...C){var y=P||{},z=x;if(i){var D=ka(r.overrides,x+".props",{});z=hb(x,r.overrides),y={...y,...D,className:My(y.className,D.className)||void 0}}if(!o){var N=y.key;return N!=null&&delete y.key,C.length===1?y.children=C[0]:C.length>1&&(y.children=C),Pa(z,y,N)}return o(z,y,...C)}function u(x,P,...C){return P&&c(P),l(x,P,...C)}let f={...r,slugify:r.slugify?x=>r.slugify(x,Dt):Dt,sanitizer:a,tagfilter:r.tagfilter!==!1},h=e[0]&&e[0].type===T.refCollection?e[0].refs:{},d=fb(r.renderRule,l,a,n,h,r,u),m=d(e,{inline:r.forceInline,refs:h}),p=Ey(h);if(p.length&&m.push(l("footer",{key:"footer"},p.map(function(x){let P=x.identifier.charCodeAt(0)===er?x.identifier.slice(1):x.identifier,C=qa(x.footnote,{inline:!0,refs:h},f);return l("div",{id:n(P,Dt),key:x.identifier},P+": ",d(C,{inline:!0,refs:h}))}))),r.wrapper===null)return m;let g=r.wrapper||(r.forceInline?"span":"div"),v;if(m.length>1||r.forceWrapper)v=m;else return m.length===1?m[0]:null;var b=r.wrapperProps?{...r.wrapperProps}:{};return b.children=v,Pa(g,b,"outer")}function Ma(e="",t={}){let r={...t||{}};r.overrides=r.overrides||{},r.slugify;let n=r.sanitizer||Ga;function a(i){let s=r.forceInline||!r.forceBlock&&!vy.test(i),c={...r,slugify:r.slugify?h=>r.slugify(h,Dt):Dt,sanitizer:n,tagfilter:r.tagfilter!==!1},l=s?i:Sy(i);if(r.optimizeForStreaming){var u=l.lastIndexOf("<");u!==-1&&l.indexOf(">",u)===-1&&(l=l.slice(0,u))}let f=qa(l,{inline:s,refs:o},c);return pb(f,{...c,forceInline:s})}let o={};return a(e)}function mb(e){let t=A.useRef(e),r=t.current;if(r!==e){var n=!0,a=0;for(var o in e)if(a++,!Object.is(r[o],e[o])){n=!1;break}if(n){var i=0;for(var s in r)i++;n=i===a}n||(t.current=e)}return t.current}var gb=({children:e,options:t,...r})=>{if(!(typeof A.useContext<"u")){let s={...t,overrides:{...t==null?void 0:t.overrides},wrapperProps:{...t==null?void 0:t.wrapperProps,...r}};return Ma(e??"",s)}let n=A.useContext(db),a=mb(r),o=A.useMemo(()=>({...n,...t,overrides:{...n==null?void 0:n.overrides,...t==null?void 0:t.overrides},wrapperProps:{...n==null?void 0:n.wrapperProps,...t==null?void 0:t.wrapperProps,...a}}),[n,t,a]),i=e??"";return A.useMemo(()=>Ma(i,o),[i,o])},vb=gb,yb=vb;const bb={forceBlock:!0,overrides:{a:{component:({children:e,...t})=>w.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})}}};function wb({text:e}){return w.jsx("div",{className:"zai-md",children:w.jsx(yb,{options:bb,children:e})})}const da=["what's going on?","what's moving today?","summarize the market for me","what should I be watching?","explain my dashboard"],Ja=["day-stats","ohlcv","quote-stream"],xb=[{caps:Ja,text:e=>e?`what's moving in ${e}?`:"what's moving today?"},{caps:["funding-history"],text:()=>"how's funding looking?"},{caps:["open-interest"],text:()=>"where's open interest building?"},{caps:["sentiment"],text:()=>"is it fear or greed right now?"},{caps:["coin-movers","coin-markets"],text:()=>"what are today's biggest movers?"},{caps:["global-market"],text:()=>"how's the total market cap?"},{caps:["tvl","protocol-tvl","dex-volume","protocol-fees"],text:()=>"which chains are gaining TVL?"},{caps:["news"],text:()=>"any headlines I should see?"},{caps:["btc-fees","btc-mempool","btc-blocks","btc-difficulty","mining-pools","lightning-stats"],text:()=>"how busy is the Bitcoin network?"},{caps:["yield-curve","reference-rates"],text:()=>"what's the yield curve saying?"},{caps:["financial-stress"],text:()=>"any signs of financial stress?"},{caps:["options-summary"],text:()=>"what's the put/call ratio?"},{caps:["portfolio"],text:()=>"how's my portfolio doing?"}],kb=8;function Cb(e,t){var r;for(const n of e.frames){if(!(((r=t.get(n.frame))==null?void 0:r.capabilities)??[]).some(c=>Ja.includes(c)))continue;const o=n.config??{},i=[];if(typeof o.symbol=="string"&&i.push(o.symbol),Array.isArray(o.symbols))for(const c of o.symbols)typeof c=="string"&&i.push(c);const s=i.find(c=>c&&c!=="*"&&!c.endsWith(":*"));if(s)return Bn(s)}}function _b(e,t){var i;const r=new Set;for(const s of e.frames)for(const c of((i=t.get(s.frame))==null?void 0:i.capabilities)??[])r.add(c);if(r.size===0)return da;const n=Cb(e,t),a=[];for(const s of xb)s.caps.some(c=>r.has(c))&&a.push(s.text(s.caps===Ja?n:void 0));const o=[...new Set([...a,...da])].slice(0,kb);return o.length?o:da}const Pi=1,Ab=2,Sb=5,zb="effect2",Tb=3600,Da=320,Eb=38e3,Pb=7200,Mb=130;function Db(e){return e===503?"No assistant is set up to answer yet — install Claude, Codex, or Kimi.":e===413?"That question was too long — try a shorter one.":e>=500?"zAI ran into a problem answering — give it another try.":e===200?"zAI sent back an unexpected response. If you just updated zframes, restart the server.":`zAI couldn't answer right now (error ${e}).`}const Rb=`
|
|
632
|
+
/* Focus scrim: opening the orb blurs + dims the dashboard behind so attention
|
|
633
|
+
lands on the conversation. Sits below the orb dock (z 40) and above the
|
|
634
|
+
ticker tape (z 30), so the orb + chat stay sharp while everything else
|
|
635
|
+
recedes. Clicking it dismisses the orb (click-away-to-close).
|
|
636
|
+
|
|
637
|
+
Two stacked gradients give the open state ATMOSPHERE rather than a flat dim:
|
|
638
|
+
(1) a warm violet glow blooming from the orb at CENTER — the room reads as lit
|
|
639
|
+
by zAI, a glowing source, not just darkened; (2) a deeper, warmer dim toward
|
|
640
|
+
the edges — a violet-plum near-black (not the old cold blue-black) so the room
|
|
641
|
+
genuinely recedes. The center stays clear so the conversation sits in the light
|
|
642
|
+
while everything else falls away. */
|
|
643
|
+
.zai-scrim {
|
|
644
|
+
position: fixed;
|
|
645
|
+
inset: 0;
|
|
646
|
+
z-index: 35;
|
|
647
|
+
opacity: 0;
|
|
648
|
+
pointer-events: none;
|
|
649
|
+
background:
|
|
650
|
+
radial-gradient(
|
|
651
|
+
64% 64% at 50% 50%,
|
|
652
|
+
hsla(268, 82%, 44%, 0.22),
|
|
653
|
+
transparent 60%
|
|
654
|
+
),
|
|
655
|
+
radial-gradient(
|
|
656
|
+
120% 120% at 50% 50%,
|
|
657
|
+
hsla(266, 44%, 7%, 0.12),
|
|
658
|
+
hsla(263, 52%, 4%, 0.74) 82%
|
|
659
|
+
);
|
|
660
|
+
backdrop-filter: blur(0px) saturate(1);
|
|
661
|
+
-webkit-backdrop-filter: blur(0px) saturate(1);
|
|
662
|
+
transition:
|
|
663
|
+
opacity 0.46s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
664
|
+
backdrop-filter 0.46s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
665
|
+
-webkit-backdrop-filter 0.46s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
666
|
+
}
|
|
667
|
+
.zai-scrim[data-open="true"] {
|
|
668
|
+
opacity: 1;
|
|
669
|
+
pointer-events: auto;
|
|
670
|
+
backdrop-filter: blur(2.5px) saturate(1.12);
|
|
671
|
+
-webkit-backdrop-filter: blur(2.5px) saturate(1.12);
|
|
672
|
+
}
|
|
673
|
+
/* Center stage: the orb lives in the MIDDLE of the dashboard, among the frames,
|
|
674
|
+
as a big living presence — not a corner button. It's a vertical stack centered
|
|
675
|
+
on the viewport: history above, orb in the middle, input pill below. Idle the
|
|
676
|
+
orb is large but translucent (frames read straight through it, see .zai-orb
|
|
677
|
+
opacity); opening it grows the orb, dims the dashboard (scrim), and reveals the
|
|
678
|
+
conversation. Sizes are vars so the idle/open scale is tunable in one place. */
|
|
679
|
+
.zai-dock {
|
|
680
|
+
position: fixed;
|
|
681
|
+
left: 50%;
|
|
682
|
+
top: 50%;
|
|
683
|
+
transform: translate(-50%, -50%);
|
|
684
|
+
z-index: 40;
|
|
685
|
+
display: flex;
|
|
686
|
+
flex-direction: column;
|
|
687
|
+
align-items: center;
|
|
688
|
+
gap: 16px;
|
|
689
|
+
font-family: var(--font-dmsans, system-ui, sans-serif);
|
|
690
|
+
--orb-size-idle: 168px;
|
|
691
|
+
--orb-size-open: 300px;
|
|
692
|
+
}
|
|
693
|
+
.zai-panel {
|
|
694
|
+
/* Input pill sits BELOW the orb in the centered column. */
|
|
695
|
+
order: 1;
|
|
696
|
+
display: flex;
|
|
697
|
+
align-items: center;
|
|
698
|
+
width: 0;
|
|
699
|
+
opacity: 0;
|
|
700
|
+
overflow: hidden;
|
|
701
|
+
transition:
|
|
702
|
+
width 0.34s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
703
|
+
opacity 0.22s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
704
|
+
}
|
|
705
|
+
.zai-dock[data-open="true"] .zai-panel {
|
|
706
|
+
width: 330px;
|
|
707
|
+
opacity: 1;
|
|
708
|
+
}
|
|
709
|
+
.zai-input-wrap {
|
|
710
|
+
display: flex;
|
|
711
|
+
align-items: center;
|
|
712
|
+
gap: 8px;
|
|
713
|
+
width: 330px;
|
|
714
|
+
padding: 9px 10px 9px 14px;
|
|
715
|
+
border-radius: 9999px;
|
|
716
|
+
background: rgba(12, 13, 20, 0.72);
|
|
717
|
+
backdrop-filter: blur(12px);
|
|
718
|
+
-webkit-backdrop-filter: blur(12px);
|
|
719
|
+
border: 1px solid hsla(263, 80%, 72%, 0.24);
|
|
720
|
+
/* Negative spread keeps the drop shadow hugging the pill instead of bleeding
|
|
721
|
+
a wide dark halo into the blurred scrim behind it. */
|
|
722
|
+
box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
|
|
723
|
+
}
|
|
724
|
+
/* The input and its animated placeholder share one box: the placeholder is an
|
|
725
|
+
absolutely-positioned layer behind the (transparent) input, so the real
|
|
726
|
+
caret/text sit on top while the hint cross-fades underneath. */
|
|
727
|
+
.zai-input-field {
|
|
728
|
+
position: relative;
|
|
729
|
+
flex: 1;
|
|
730
|
+
min-width: 0;
|
|
731
|
+
display: flex;
|
|
732
|
+
align-items: center;
|
|
733
|
+
}
|
|
734
|
+
.zai-input {
|
|
735
|
+
position: relative;
|
|
736
|
+
z-index: 1;
|
|
737
|
+
flex: 1;
|
|
738
|
+
min-width: 0;
|
|
739
|
+
background: transparent;
|
|
740
|
+
border: 0;
|
|
741
|
+
outline: 0;
|
|
742
|
+
color: #e7e9f3;
|
|
743
|
+
font-size: 13px;
|
|
744
|
+
}
|
|
745
|
+
.zai-ph {
|
|
746
|
+
position: absolute;
|
|
747
|
+
left: 0;
|
|
748
|
+
right: 0;
|
|
749
|
+
top: 50%;
|
|
750
|
+
pointer-events: none;
|
|
751
|
+
color: rgba(255, 255, 255, 0.4);
|
|
752
|
+
font-size: 13px;
|
|
753
|
+
white-space: nowrap;
|
|
754
|
+
overflow: hidden;
|
|
755
|
+
text-overflow: ellipsis;
|
|
756
|
+
opacity: 0;
|
|
757
|
+
transform: translateY(-50%) translateY(5px);
|
|
758
|
+
transition:
|
|
759
|
+
opacity ${Da}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
760
|
+
transform ${Da}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
761
|
+
}
|
|
762
|
+
.zai-ph[data-show="true"] {
|
|
763
|
+
opacity: 1;
|
|
764
|
+
transform: translateY(-50%) translateY(0);
|
|
765
|
+
}
|
|
766
|
+
/* While thinking, the hint shimmers instead of cycling (overrides opacity). */
|
|
767
|
+
.zai-ph-busy {
|
|
768
|
+
animation: zai-ph-pulse 1.5s ease-in-out infinite;
|
|
769
|
+
}
|
|
770
|
+
@keyframes zai-ph-pulse {
|
|
771
|
+
0%, 100% { opacity: 0.34; }
|
|
772
|
+
50% { opacity: 0.7; }
|
|
773
|
+
}
|
|
774
|
+
.zai-agent {
|
|
775
|
+
flex: none;
|
|
776
|
+
font-size: 10px;
|
|
777
|
+
font-weight: 700;
|
|
778
|
+
letter-spacing: 0.05em;
|
|
779
|
+
text-transform: uppercase;
|
|
780
|
+
color: hsla(263, 85%, 82%, 0.95);
|
|
781
|
+
background: hsla(263, 80%, 60%, 0.16);
|
|
782
|
+
border-radius: 7px;
|
|
783
|
+
padding: 4px 7px;
|
|
784
|
+
cursor: pointer;
|
|
785
|
+
user-select: none;
|
|
786
|
+
white-space: nowrap;
|
|
787
|
+
transition: background 0.15s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
788
|
+
}
|
|
789
|
+
.zai-agent:hover { background: hsla(263, 80%, 60%, 0.28); }
|
|
790
|
+
|
|
791
|
+
/* Idle attention nudge: after a stretch of inactivity the orb floats a single
|
|
792
|
+
tailored suggestion beside itself ("here's something you could ask"), then
|
|
793
|
+
fades it away and re-arms while idle. Clicking it opens the orb prefilled with
|
|
794
|
+
that question. Always in the DOM (so the fade transition plays) and revealed
|
|
795
|
+
by data-nudge on the dock; cleared the moment you hover the orb or open it. */
|
|
796
|
+
.zai-nudge {
|
|
797
|
+
position: absolute;
|
|
798
|
+
top: calc(100% + 16px);
|
|
799
|
+
left: 50%;
|
|
800
|
+
max-width: 244px;
|
|
801
|
+
margin: 0;
|
|
802
|
+
padding: 9px 13px;
|
|
803
|
+
border-radius: 14px;
|
|
804
|
+
background: rgba(12, 13, 20, 0.82);
|
|
805
|
+
border: 1px solid hsla(263, 80%, 72%, 0.28);
|
|
806
|
+
backdrop-filter: blur(12px);
|
|
807
|
+
-webkit-backdrop-filter: blur(12px);
|
|
808
|
+
box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.55);
|
|
809
|
+
color: #e7e9f3;
|
|
810
|
+
font-family: inherit;
|
|
811
|
+
font-size: 12.5px;
|
|
812
|
+
line-height: 1.4;
|
|
813
|
+
text-align: center;
|
|
814
|
+
cursor: pointer;
|
|
815
|
+
opacity: 0;
|
|
816
|
+
transform: translateX(-50%) translateY(8px) scale(0.96);
|
|
817
|
+
transform-origin: top center;
|
|
818
|
+
pointer-events: none;
|
|
819
|
+
transition:
|
|
820
|
+
opacity 0.32s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
821
|
+
transform 0.32s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
822
|
+
}
|
|
823
|
+
.zai-dock[data-nudge="true"] .zai-nudge {
|
|
824
|
+
opacity: 1;
|
|
825
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
826
|
+
pointer-events: auto;
|
|
827
|
+
}
|
|
828
|
+
.zai-nudge:hover { border-color: hsla(263, 85%, 78%, 0.45); }
|
|
829
|
+
|
|
830
|
+
/* The WebGL orb scene IS the orb — clipped to a circle and faded in once ready.
|
|
831
|
+
The button is just a transparent container; nothing is drawn behind the orb. */
|
|
832
|
+
.zai-orb-canvas {
|
|
833
|
+
position: absolute;
|
|
834
|
+
inset: 0;
|
|
835
|
+
border-radius: 9999px;
|
|
836
|
+
overflow: hidden;
|
|
837
|
+
opacity: 0;
|
|
838
|
+
transform: scale(0.82);
|
|
839
|
+
transition:
|
|
840
|
+
opacity 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
841
|
+
transform 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
842
|
+
pointer-events: none;
|
|
843
|
+
}
|
|
844
|
+
/* Wake-in bloom: the first time the WebGL orb is ready it scales up from small
|
|
845
|
+
with a slight overshoot and fades in, so it "boots" into the dock instead of
|
|
846
|
+
just appearing. One-shot (fill: both) — once it settles the orb rests at
|
|
847
|
+
scale 1, where the breathing halo (below) takes over. */
|
|
848
|
+
.zai-orb[data-webgl="true"] .zai-orb-canvas {
|
|
849
|
+
opacity: 1;
|
|
850
|
+
transform: scale(1);
|
|
851
|
+
animation: zai-orb-wake 0.7s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1))
|
|
852
|
+
both;
|
|
853
|
+
}
|
|
854
|
+
@keyframes zai-orb-wake {
|
|
855
|
+
0% { opacity: 0; transform: scale(0.7); }
|
|
856
|
+
60% { opacity: 1; transform: scale(1.06); }
|
|
857
|
+
100% { opacity: 1; transform: scale(1); }
|
|
858
|
+
}
|
|
859
|
+
/* Streaming heartbeat: each burst of answer tokens fires a quick expanding ring
|
|
860
|
+
from the orb, so it visibly "pulses" as it talks. Keyed on a beat counter in
|
|
861
|
+
JS (throttled), so each increment remounts the element and replays the
|
|
862
|
+
one-shot ring. */
|
|
863
|
+
.zai-orb-beat {
|
|
864
|
+
position: absolute;
|
|
865
|
+
inset: 0;
|
|
866
|
+
border-radius: 9999px;
|
|
867
|
+
border: 2px solid hsla(263, 92%, 80%, 0.6);
|
|
868
|
+
pointer-events: none;
|
|
869
|
+
animation: zai-orb-beat 0.52s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1))
|
|
870
|
+
forwards;
|
|
871
|
+
}
|
|
872
|
+
@keyframes zai-orb-beat {
|
|
873
|
+
from { opacity: 0.65; transform: scale(0.92); }
|
|
874
|
+
to { opacity: 0; transform: scale(1.55); }
|
|
875
|
+
}
|
|
876
|
+
.zai-orb-canvas canvas {
|
|
877
|
+
width: 100% !important;
|
|
878
|
+
height: 100% !important;
|
|
879
|
+
display: block;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.zai-orb {
|
|
883
|
+
position: relative;
|
|
884
|
+
width: var(--orb-size-idle);
|
|
885
|
+
height: var(--orb-size-idle);
|
|
886
|
+
flex: none;
|
|
887
|
+
padding: 0;
|
|
888
|
+
border: 0;
|
|
889
|
+
border-radius: 9999px;
|
|
890
|
+
cursor: pointer;
|
|
891
|
+
background: transparent;
|
|
892
|
+
/* Idle: large but translucent so the frames behind read THROUGH the orb
|
|
893
|
+
instead of being buried. Firms to full opacity on hover, while thinking,
|
|
894
|
+
and when open (where the scrim dims the dashboard anyway). */
|
|
895
|
+
opacity: 0.6;
|
|
896
|
+
transition:
|
|
897
|
+
width 0.5s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
898
|
+
height 0.5s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
899
|
+
opacity 0.4s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
900
|
+
transform 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
901
|
+
}
|
|
902
|
+
.zai-orb:hover { transform: scale(1.04); opacity: 0.92; }
|
|
903
|
+
.zai-orb:active { transform: scale(0.98); }
|
|
904
|
+
.zai-dock[data-busy="true"] .zai-orb { opacity: 1; }
|
|
905
|
+
.zai-dock[data-open="true"] .zai-orb {
|
|
906
|
+
width: var(--orb-size-open);
|
|
907
|
+
height: var(--orb-size-open);
|
|
908
|
+
opacity: 1;
|
|
909
|
+
}
|
|
910
|
+
/* Breathing halo: a soft violet aura ringing the resting orb, slowly pulsing so
|
|
911
|
+
the idle orb reads as alive (a slow breath) rather than a static button. It's
|
|
912
|
+
a ::before behind the canvas, inset negative so only the glow ring past the
|
|
913
|
+
orb edge shows. Boosted on hover, faster + brighter while thinking. */
|
|
914
|
+
.zai-orb::before {
|
|
915
|
+
content: "";
|
|
916
|
+
position: absolute;
|
|
917
|
+
inset: -7px;
|
|
918
|
+
border-radius: 9999px;
|
|
919
|
+
background: radial-gradient(
|
|
920
|
+
circle,
|
|
921
|
+
hsla(263, 92%, 72%, 0.55),
|
|
922
|
+
hsla(263, 90%, 60%, 0.12) 60%,
|
|
923
|
+
transparent 72%
|
|
924
|
+
);
|
|
925
|
+
filter: blur(7px);
|
|
926
|
+
opacity: 0;
|
|
927
|
+
z-index: -1;
|
|
928
|
+
pointer-events: none;
|
|
929
|
+
transition:
|
|
930
|
+
opacity 0.3s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
931
|
+
transform 0.3s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
932
|
+
}
|
|
933
|
+
.zai-orb[data-webgl="true"]::before,
|
|
934
|
+
.zai-orb[data-fallback="true"]::before {
|
|
935
|
+
animation: zai-orb-breathe 4.5s ease-in-out infinite;
|
|
936
|
+
}
|
|
937
|
+
@keyframes zai-orb-breathe {
|
|
938
|
+
0%, 100% { opacity: 0.28; transform: scale(1); }
|
|
939
|
+
50% { opacity: 0.55; transform: scale(1.12); }
|
|
940
|
+
}
|
|
941
|
+
/* Hover anticipation: the aura firms up + brightens (the scene also speeds up,
|
|
942
|
+
handled in JS) so the orb "leans in" before you click. */
|
|
943
|
+
.zai-orb:hover::before {
|
|
944
|
+
animation: none;
|
|
945
|
+
opacity: 0.72;
|
|
946
|
+
transform: scale(1.16);
|
|
947
|
+
}
|
|
948
|
+
/* While zAI is thinking the halo pulses faster + brighter — the orb visibly
|
|
949
|
+
works, matching the sped-up scene and the background coming alive. Placed
|
|
950
|
+
after the hover rule so it wins when both apply. */
|
|
951
|
+
.zai-dock[data-busy="true"] .zai-orb::before {
|
|
952
|
+
animation: zai-orb-breathe 1.4s ease-in-out infinite;
|
|
953
|
+
background: radial-gradient(
|
|
954
|
+
circle,
|
|
955
|
+
hsla(263, 95%, 76%, 0.72),
|
|
956
|
+
hsla(263, 92%, 62%, 0.16) 60%,
|
|
957
|
+
transparent 72%
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
/* Minimal fallback gradient, shown only if the WebGL scene fails to load, so
|
|
961
|
+
the orb stays visible + clickable instead of being an invisible button. */
|
|
962
|
+
.zai-orb[data-fallback="true"] {
|
|
963
|
+
background:
|
|
964
|
+
radial-gradient(circle at 34% 28%, hsla(263, 95%, 86%, 0.95), transparent 45%),
|
|
965
|
+
radial-gradient(circle at 62% 70%, #7a17e0 0%, #4a0a92 55%, #2c0560 100%);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.zai-history {
|
|
969
|
+
/* Sits ABOVE the orb in the centered column (order:-1). In-flow, not
|
|
970
|
+
corner-anchored, so it stacks over the orb + input as one command surface. */
|
|
971
|
+
order: -1;
|
|
972
|
+
width: 344px;
|
|
973
|
+
display: flex;
|
|
974
|
+
flex-direction: column;
|
|
975
|
+
gap: 8px;
|
|
976
|
+
max-height: 38vh;
|
|
977
|
+
overflow-y: auto;
|
|
978
|
+
overscroll-behavior: contain;
|
|
979
|
+
pointer-events: auto;
|
|
980
|
+
scrollbar-width: none;
|
|
981
|
+
}
|
|
982
|
+
.zai-history::-webkit-scrollbar {
|
|
983
|
+
display: none;
|
|
984
|
+
}
|
|
985
|
+
/* The top fade is a "more above" affordance — only painted once the thread has
|
|
986
|
+
scrolled up off the top. Applying it unconditionally clipped the top edge of
|
|
987
|
+
even a single short chip, so it's gated on scroll position (see onScroll). */
|
|
988
|
+
.zai-history[data-masked="true"] {
|
|
989
|
+
-webkit-mask-image: linear-gradient(180deg, transparent, #000 16%);
|
|
990
|
+
mask-image: linear-gradient(180deg, transparent, #000 16%);
|
|
991
|
+
}
|
|
992
|
+
/* Bottom-pin short threads (the conversation floats just above the input):
|
|
993
|
+
margin-top:auto on the first chip pushes the group down while there's slack,
|
|
994
|
+
then yields to scrolling once the thread outgrows max-height — so a long
|
|
995
|
+
answer scrolls up instead of hard-clipping the oldest message off the top. */
|
|
996
|
+
.zai-history > :first-child {
|
|
997
|
+
margin-top: auto;
|
|
998
|
+
}
|
|
999
|
+
.zai-msg {
|
|
1000
|
+
width: fit-content;
|
|
1001
|
+
max-width: 100%;
|
|
1002
|
+
padding: 8px 12px;
|
|
1003
|
+
border-radius: 14px;
|
|
1004
|
+
font-size: 13px;
|
|
1005
|
+
line-height: 1.45;
|
|
1006
|
+
white-space: pre-wrap;
|
|
1007
|
+
word-break: break-word;
|
|
1008
|
+
backdrop-filter: blur(10px);
|
|
1009
|
+
-webkit-backdrop-filter: blur(10px);
|
|
1010
|
+
animation: zai-rise 0.28s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) both;
|
|
1011
|
+
}
|
|
1012
|
+
.zai-msg-user {
|
|
1013
|
+
align-self: flex-end;
|
|
1014
|
+
background: hsla(263, 70%, 55%, 0.28);
|
|
1015
|
+
border: 1px solid hsla(263, 80%, 75%, 0.3);
|
|
1016
|
+
color: #f0ecff;
|
|
1017
|
+
}
|
|
1018
|
+
.zai-msg-zai {
|
|
1019
|
+
align-self: flex-start;
|
|
1020
|
+
background: rgba(12, 13, 20, 0.66);
|
|
1021
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
1022
|
+
color: #dfe3ef;
|
|
1023
|
+
}
|
|
1024
|
+
.zai-msg-error {
|
|
1025
|
+
color: #ffb4bd;
|
|
1026
|
+
border-color: rgba(255, 107, 129, 0.4);
|
|
1027
|
+
}
|
|
1028
|
+
/* Markdown-rendered zAI answers. The chip's own pre-wrap is meant for plain
|
|
1029
|
+
text; inside .zai-md we let block elements control layout instead, and trim
|
|
1030
|
+
the outer margins so the bubble hugs its content. */
|
|
1031
|
+
.zai-md {
|
|
1032
|
+
white-space: normal;
|
|
1033
|
+
}
|
|
1034
|
+
.zai-md > :first-child {
|
|
1035
|
+
margin-top: 0;
|
|
1036
|
+
}
|
|
1037
|
+
.zai-md > :last-child {
|
|
1038
|
+
margin-bottom: 0;
|
|
1039
|
+
}
|
|
1040
|
+
.zai-md p {
|
|
1041
|
+
margin: 0 0 0.5em;
|
|
1042
|
+
}
|
|
1043
|
+
.zai-md a {
|
|
1044
|
+
color: hsla(263, 85%, 82%, 0.95);
|
|
1045
|
+
text-decoration: underline;
|
|
1046
|
+
text-underline-offset: 2px;
|
|
1047
|
+
word-break: break-word;
|
|
1048
|
+
transition: color 0.15s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
1049
|
+
}
|
|
1050
|
+
.zai-md a:hover {
|
|
1051
|
+
color: #fff;
|
|
1052
|
+
}
|
|
1053
|
+
.zai-md ul,
|
|
1054
|
+
.zai-md ol {
|
|
1055
|
+
margin: 0.35em 0;
|
|
1056
|
+
padding-left: 1.2em;
|
|
1057
|
+
}
|
|
1058
|
+
.zai-md li {
|
|
1059
|
+
margin: 0.15em 0;
|
|
1060
|
+
}
|
|
1061
|
+
.zai-md code {
|
|
1062
|
+
font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
|
|
1063
|
+
font-size: 0.92em;
|
|
1064
|
+
background: rgba(255, 255, 255, 0.1);
|
|
1065
|
+
padding: 0.1em 0.35em;
|
|
1066
|
+
border-radius: 5px;
|
|
1067
|
+
}
|
|
1068
|
+
.zai-md strong {
|
|
1069
|
+
font-weight: 600;
|
|
1070
|
+
color: #f0ecff;
|
|
1071
|
+
}
|
|
1072
|
+
@keyframes zai-rise {
|
|
1073
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
1074
|
+
to { opacity: 1; transform: translateY(0); }
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1078
|
+
.zai-msg { animation: none; }
|
|
1079
|
+
.zai-panel { transition: none; }
|
|
1080
|
+
.zai-ph { transition: opacity 0.15s linear; transform: translateY(-50%); }
|
|
1081
|
+
.zai-ph[data-show="true"] { transform: translateY(-50%); }
|
|
1082
|
+
.zai-ph-busy { animation: none; opacity: 0.5; }
|
|
1083
|
+
.zai-scrim { transition: opacity 0.2s linear; }
|
|
1084
|
+
/* Orb aliveness: keep the presence (a static glow, the nudge chip) but drop
|
|
1085
|
+
the motion — no breathing, wake bloom, hover lean, or heartbeat ring. */
|
|
1086
|
+
.zai-orb::before,
|
|
1087
|
+
.zai-orb[data-webgl="true"]::before,
|
|
1088
|
+
.zai-orb[data-fallback="true"]::before,
|
|
1089
|
+
.zai-dock[data-busy="true"] .zai-orb::before { animation: none; opacity: 0.4; transform: none; }
|
|
1090
|
+
.zai-orb:hover::before { opacity: 0.55; transform: none; }
|
|
1091
|
+
.zai-orb[data-webgl="true"] .zai-orb-canvas { animation: none; transform: none; }
|
|
1092
|
+
.zai-orb-beat { display: none; }
|
|
1093
|
+
.zai-nudge { transition: opacity 0.15s linear; transform: translateX(-50%); }
|
|
1094
|
+
.zai-dock[data-nudge="true"] .zai-nudge { transform: translateX(-50%); }
|
|
1095
|
+
}
|
|
1096
|
+
`;function Ob({onOpenChange:e,onThinkingChange:t,spec:r,registry:n}){var gt;const[a,o]=A.useState(null),[i,s]=A.useState(null),[c,l]=A.useState(!1),[u,f]=A.useState(""),[h,d]=A.useState(!1),[m,p]=A.useState(null),[g,v]=A.useState([]),[b,x]=A.useState(!1),[P,C]=A.useState(!1),[y,z]=A.useState(0),[D,N]=A.useState(!0),[S,q]=A.useState(!1),[B,oe]=A.useState(!1),[V,L]=A.useState(!1),[F,Y]=A.useState(""),[Ee,$]=A.useState(0),de=A.useRef(0),ze=A.useRef(0),lt=A0(),De=A.useRef(null),Ue=A.useRef(null),ve=A.useRef(null),le=oy(r,n),Re=A.useMemo(()=>_b(r,n),[r,n]),ie=A.useCallback((H,Q)=>{var Xe;const j=(Xe=H.layers)==null?void 0:Xe.find(Te=>Te.id===zb&&Te.layerType==="effect");j&&j.layerType==="effect"&&(j.speed=Q)},[]),xe=lt?Pi:h?Sb:B?Ab:Pi,he=A.useRef(xe),tt=A.useCallback(H=>{ve.current=H,H?(ie(H,he.current),C(!1),x(!0)):x(!1)},[ie]),Ce=A.useCallback(()=>{x(!1),C(!0)},[]);A.useEffect(()=>{he.current=xe,ve.current&&ie(ve.current,xe)},[xe,ie]),A.useEffect(()=>{let H=!1;return fetch(Nh,{cache:"no-store"}).then(Q=>Q.ok?Q.json():{agents:[]}).then(Q=>{var Xe;if(H)return;const j=Q.agents??[];o(j),s(((Xe=j[0])==null?void 0:Xe.id)??null)}).catch(()=>{H||o([])}),()=>{H=!0}},[]),A.useEffect(()=>{var H;c&&((H=De.current)==null||H.focus())},[c]),A.useEffect(()=>{if(!c)return;const H=Q=>{Q.key==="Escape"&&l(!1)};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[c]),A.useEffect(()=>{if(!a||a.length===0)return;const H=Q=>{(Q.metaKey||Q.ctrlKey)&&!Q.shiftKey&&!Q.altKey&&Q.key.toLowerCase()==="k"&&(Q.preventDefault(),l(j=>!j))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[a]),A.useEffect(()=>{const H=Ue.current;H&&(H.scrollTop=H.scrollHeight,q(H.scrollTop>1))},[g,c]),A.useEffect(()=>{if(!c||h){N(!0);return}let H;const Q=setInterval(()=>{N(!1),H=setTimeout(()=>{z(j=>j+1),N(!0)},Da)},Tb);return()=>{clearInterval(Q),clearTimeout(H)}},[c,h]),A.useEffect(()=>{if(c||h||!b||g.length>0)return;let H,Q;const j=()=>{H=setTimeout(()=>{Re.length?(Y(Re[ze.current%Re.length]),ze.current+=1,L(!0),Q=setTimeout(()=>{L(!1),j()},Pb)):j()},Eb)};return j(),()=>{clearTimeout(H),clearTimeout(Q),L(!1)}},[c,h,b,g.length,Re]),A.useEffect(()=>{e==null||e(c)},[c,e]),A.useEffect(()=>{t==null||t(h)},[h,t]);const ye=H=>v(Q=>[...Q,H].slice(-8));async function Z(){var Pt;const H=u.trim();if(!H||h)return;const Q=g.filter(se=>!se.error).map(se=>({role:se.role,text:se.text}));ye({role:"user",text:H}),f(""),d(!0),p(null);let j=!1,Xe="";const Te=()=>{j||(j=!0,ye({role:"zai",text:""}))},mt=(se,I=!1)=>v(ft=>{const ot=[...ft];for(let ht=ot.length-1;ht>=0;ht--)if(ot[ht].role==="zai"){ot[ht]={...ot[ht],text:se,error:I};break}return ot});try{const se=await le(),I=await fetch(Lh,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:H,agent:i,context:se??void 0,history:Q.length?Q:void 0})}),ft=I.headers.get("content-type")??"";if(!I.body||!ft.includes("application/x-ndjson")){const be=await I.json().catch(()=>null);if(I.ok&&typeof(be==null?void 0:be.answer)=="string"&&be.answer.trim()){ye({role:"zai",text:be.answer.trim()});return}ye({role:"zai",text:(be==null?void 0:be.error)??Db(I.status),error:!0});return}const ot=I.body.getReader(),ht=new TextDecoder;let rt="";for(;;){const{value:be,done:Ze}=await ot.read();if(Ze)break;rt+=ht.decode(be,{stream:!0});let Ve;for(;(Ve=rt.indexOf(`
|
|
1097
|
+
`))!==-1;){const ut=rt.slice(0,Ve).trim();if(rt=rt.slice(Ve+1),!ut)continue;let je;try{je=JSON.parse(ut)}catch{continue}if(je.type==="status"&&typeof je.text=="string")p(je.text);else if(je.type==="delta"&&typeof je.text=="string"){if(Te(),p(null),Xe+=je.text,mt(Xe),!lt){const Le=Date.now();Le-de.current>Mb&&(de.current=Le,$(Ht=>Ht+1))}}else je.type==="done"?(Te(),mt(je.answer||Xe)):je.type==="error"&&(Te(),mt(je.error||"zAI couldn't finish that answer — try again.",!0))}}j||ye({role:"zai",text:"zAI didn't return anything — try again.",error:!0})}catch{const se="zAI couldn't be reached — check that the zframes server is running.";j?mt(se,!0):ye({role:"zai",text:se,error:!0})}finally{d(!1),p(null),(Pt=De.current)==null||Pt.focus()}}function Oe(H){if(H.key==="Enter"&&!H.shiftKey)H.preventDefault(),Z();else if(H.key==="Tab"&&!H.shiftKey&&!h&&!u){const Q=Re[y%Re.length];Q&&(H.preventDefault(),f(Q))}}function at(){if(!a||a.length<2||!i)return;const H=a.findIndex(Q=>Q.id===i);s(a[(H+1)%a.length].id)}if(!a||a.length===0)return null;const Be=((gt=a.find(H=>H.id===i))==null?void 0:gt.label)??a[0].label,pt=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)?"⌘K":"Ctrl+K";return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:Rb}),w.jsx("div",{className:"zai-scrim","data-open":c,onClick:()=>l(!1),"aria-hidden":"true"}),w.jsxs("div",{className:"zai-dock","data-open":c,"data-busy":h,"data-nudge":V,children:[c&&g.length>0&&w.jsx("div",{className:"zai-history",ref:Ue,"data-masked":S,onScroll:H=>q(H.currentTarget.scrollTop>1),"aria-live":"polite",children:g.map((H,Q)=>H.role==="zai"&&!H.error?w.jsx("div",{className:"zai-msg zai-msg-zai",children:w.jsx(wb,{text:H.text})},Q):w.jsx("div",{className:H.role==="user"?"zai-msg zai-msg-user":"zai-msg zai-msg-zai zai-msg-error",children:H.text},Q))}),w.jsx("button",{type:"button",className:"zai-nudge",tabIndex:V?0:-1,"aria-hidden":!V,onClick:()=>{L(!1),f(F),l(!0)},children:F}),w.jsx("div",{className:"zai-panel",children:w.jsxs("div",{className:"zai-input-wrap",children:[w.jsxs("div",{className:"zai-input-field",children:[w.jsx("input",{ref:De,className:"zai-input",value:u,onChange:H=>f(H.target.value),onKeyDown:Oe,placeholder:"",disabled:h,"aria-label":"Ask zAI"}),w.jsx("span",{className:`zai-ph${h?" zai-ph-busy":""}`,"data-show":!u&&(h||D),"aria-hidden":"true",children:h?m??"thinking…":Re[y%Re.length]??""})]}),w.jsx("span",{className:"zai-agent",onClick:at,title:a.length>1?"Click to switch agent":`Answered by ${Be}`,children:Be})]})}),w.jsxs("button",{type:"button",className:"zai-orb","data-webgl":b,"data-fallback":P,onClick:()=>l(H=>!H),onMouseEnter:()=>{oe(!0),L(!1)},onMouseLeave:()=>oe(!1),"aria-label":c?"Close zAI":"Ask zAI",title:c?"Close zAI":`Ask zAI · ${pt}`,"aria-expanded":c,children:[w.jsx(Jv,{className:"zai-orb-canvas",onScene:tt,onError:Ce}),Ee>0&&w.jsx("span",{className:"zai-orb-beat","aria-hidden":"true"},Ee)]})]})]})}const Nb=A.lazy(()=>E(()=>import("./editor-Dnp1eXvY.js"),__vite__mapDeps([130,1,131,132,133])).then(e=>({default:e.DashboardEditor}))),yn=Nv(),Lb=[...b0(),new Fh,new tp];function Xa({children:e}){return w.jsx("main",{className:"mx-auto max-w-2xl px-6 py-16",children:e})}function Ib(){return w.jsx(Xa,{children:w.jsx("p",{className:"body-sm text-soft",children:"loading dashboard…"})})}function Fb({message:e}){return w.jsxs(Xa,{children:[w.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"couldn’t load your dashboard"}),w.jsxs("p",{className:"body-sm text-soft mb-4",children:["The zframes runtime couldn’t read ",w.jsx("code",{children:"dashboard.json"}),". Make sure you’re running ",w.jsx("code",{children:"zframes serve"})," next to it."]}),w.jsx("p",{className:"caption text-soft",children:w.jsx("code",{children:e})})]})}function Ub({issues:e}){return w.jsxs(Xa,{children:[w.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"dashboard.json is not a valid spec"}),w.jsxs("p",{className:"body-sm text-soft mb-4",children:["Fix the issues below (or run ",w.jsx("code",{children:"zframes lint dashboard.json"}),"), then reload."]}),w.jsx("ul",{className:"body-sm text-normal list-disc space-y-1 pl-5",children:e.map((t,r)=>w.jsxs("li",{children:[w.jsx("code",{children:t.path.join(".")||"(root)"}),": ",t.message]},r))})]})}async function jb(e){try{const t=await fetch(Ph,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`HTTP ${t.status}`);window.location.reload()}catch(t){console.error("zframes: failed to save dashboard.json",t),window.alert("Couldn't save dashboard.json — is `zframes serve` still running? Your edits are still on screen; try Save again.")}}function Hb(){const[e,t]=A.useState({status:"loading"}),[r,n]=A.useState(null),[a,o]=A.useState(null),[i,s]=A.useState(null),[c,l]=A.useState(null),[u,f]=A.useState(null),[h,d]=A.useState(null),[m,p]=A.useState(null),[g,v]=A.useState(null),b=Gv(),[x,P]=A.useState(!1),[C,y]=A.useState(!1),z=a??(e.status==="ready"?e.spec.theme.accentHue:null),D=i??(e.status==="ready"?e.spec.theme.accentSat:null),N=c??(e.status==="ready"?e.spec.typography.scale:null),S=u??(e.status==="ready"?e.spec.theme.upColor:null),q=h??(e.status==="ready"?e.spec.theme.downColor:null);if(A.useEffect(()=>{z!=null&&document.documentElement.style.setProperty("--zf-accent-hue",String(z))},[z]),A.useEffect(()=>{D!=null&&document.documentElement.style.setProperty("--zf-accent-sat",`${D}%`)},[D]),A.useEffect(()=>{N!=null&&(document.documentElement.style.fontSize=`${N*100}%`)},[N]),A.useEffect(()=>{S!=null&&document.documentElement.style.setProperty("--zf-up",S)},[S]),A.useEffect(()=>{q!=null&&document.documentElement.style.setProperty("--zf-down",q)},[q]),A.useEffect(()=>{let L=!1;return fetch(Eh,{cache:"no-store"}).then(F=>{if(!F.ok)throw new Error(`HTTP ${F.status}`);return F.json()}).then(F=>{if(L)return;const Y=ph.safeParse(F);t(Y.success?{status:"ready",spec:Y.data}:{status:"invalid",issues:Y.error.issues})}).catch(F=>{L||t({status:"error",message:String(F)})}),()=>{L=!0}},[]),e.status==="loading")return w.jsx(Ib,{});if(e.status==="error")return w.jsx(Fb,{message:e.message});if(e.status==="invalid")return w.jsx(Ub,{issues:e.issues});const B=e.spec,oe=(m??B.grid.mode)==="flow-horizontal",V=g??B.background;return w.jsxs(bh,{providers:Lb,children:[w.jsx(O0,{background:V,active:x,thinking:C,accentHue:z??B.theme.accentHue,accentSat:D??B.theme.accentSat,sceneHue:yh(V.projectId)}),w.jsxs("main",{className:`relative z-10 mx-auto pt-5 ${oe?"h-[100dvh] max-w-none overflow-hidden px-0":"max-w-[1320px] px-4 pb-24 sm:px-6"}`,style:{"--zf-accent-hue":z??B.theme.accentHue,"--zf-accent-sat":`${D??B.theme.accentSat}%`},children:[w.jsxs("header",{className:`mb-5 flex flex-col gap-2 border-b border-white/[0.06] pb-4 sm:flex-row sm:items-center sm:justify-between ${oe?"px-4 sm:px-6":""}`,children:[w.jsxs("div",{className:"flex items-baseline gap-3",children:[w.jsxs("h1",{className:"font-dmsans text-strong text-lg font-extrabold tracking-tight",children:["/",w.jsx("span",{style:{color:"hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%)"},children:"zframes"})]}),w.jsx(N0,{currentTitle:B.title}),w.jsxs("span",{className:"caption text-soft rounded-full border border-white/[0.08] px-1.5 py-0.5 font-mono leading-none",title:"zframes runtime version",children:["v","0.6.0"]})]}),w.jsx("div",{ref:n,className:"flex min-h-9 items-center justify-end"})]}),b?w.jsx(A.Suspense,{fallback:w.jsx(Uo,{spec:B,registry:yn}),children:w.jsx(Nb,{spec:B,registry:yn,onSave:jb,customiseButtonTarget:r,onAccentHueChange:o,onAccentSatChange:s,onFontScaleChange:l,onUpColorChange:f,onDownColorChange:d,onModeChange:p,onBackgroundChange:v})}):w.jsx(Uo,{spec:B,registry:yn})]}),w.jsx(Wv,{}),w.jsx(Ob,{onOpenChange:P,onThinkingChange:y,spec:B,registry:yn})]})}const Xs=document.getElementById("root");if(!Xs)throw new Error("missing #root element");_c.createRoot(Xs).render(w.jsx(A.StrictMode,{children:w.jsx(Hb,{})}));export{w1 as $,Fv as A,gh as B,U0 as C,c1 as D,tg as E,Wb as F,v1 as G,ng as H,y1 as I,Z0 as J,m1 as K,Q0 as L,g1 as M,fh as N,$0 as O,p1 as P,eg as Q,h1 as R,og as S,Kb as T,Jb as U,j0 as V,cg as W,sg as X,X0 as Y,F0 as Z,yg as _,bh as a,z1 as a$,H0 as a0,B0 as a1,Xb as a2,pg as a3,Zb as a4,Lv as a5,V0 as a6,W0 as a7,wh as a8,xh as a9,Sg as aA,zg as aB,Tg as aC,Eg as aD,Pg as aE,Mg as aF,Dg as aG,Rg as aH,Og as aI,Ig as aJ,Ng as aK,Lg as aL,Fg as aM,Ug as aN,Jg as aO,x1 as aP,Xg as aQ,k1 as aR,Zg as aS,C1 as aT,$g as aU,_1 as aV,Qg as aW,A1 as aX,ev as aY,S1 as aZ,tv as a_,q0 as aa,l1 as ab,d1 as ac,J0 as ad,u1 as ae,ag as af,b1 as ag,G0 as ah,Y0 as ai,$b as aj,rg as ak,f1 as al,bg as am,Qb as an,wg as ao,e1 as ap,xg as aq,t1 as ar,kg as as,r1 as at,Cg as au,n1 as av,_g as aw,a1 as ax,Ag as ay,i1 as az,kh as b,rv as b0,T1 as b1,nv as b2,P1 as b3,av as b4,ov as b5,o1 as b6,iv as b7,M1 as b8,sv as b9,H1 as bA,Av as bB,B1 as bC,Sv as bD,V1 as bE,zv as bF,Tv as bG,Ev as bH,Pv as bI,Mv as bJ,Dv as bK,jg as bL,Hg as bM,Bg as bN,Vg as bO,Wg as bP,Gg as bQ,Yg as bR,Kg as bS,qg as bT,cv as ba,R1 as bb,lv as bc,uv as bd,D1 as be,dv as bf,fv as bg,hv as bh,pv as bi,mv as bj,O1 as bk,gv as bl,vv as bm,N1 as bn,yv as bo,L1 as bp,bv as bq,I1 as br,wv as bs,F1 as bt,xv as bu,U1 as bv,kv as bw,Cv as bx,j1 as by,_v as bz,zh as c,Ch as d,dh as e,Gb as f,gg as g,Bn as h,vg as i,E1 as j,qb as k,G1 as l,W1 as m,K0 as n,s1 as o,mg as p,I0 as q,lg as r,ug as s,Yb as t,Un as u,Io as v,dg as w,fg as x,hg as y,ig as z};
|