zframes 0.5.2 → 0.5.3
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 +6 -1
- package/package.json +4 -4
- package/runtime/assets/{bitcoin-dominance-CtnczH5N.js → bitcoin-dominance-CxfMBVwW.js} +1 -1
- package/runtime/assets/{breakeven-zbCEQ5ag.js → breakeven-BrpmE2y2.js} +1 -1
- package/runtime/assets/{breathing-6Wmy_hqF.js → breathing-Bjv7D86F.js} +1 -1
- package/runtime/assets/{btc-blocks-D1xOLm2L.js → btc-blocks-Cy-YFeqC.js} +1 -1
- package/runtime/assets/{btc-difficulty-BTbKIqrl.js → btc-difficulty-CQ_30M6B.js} +1 -1
- package/runtime/assets/{btc-fees-5Geh2TSa.js → btc-fees-DsYgskwn.js} +1 -1
- package/runtime/assets/{btc-hashrate-DZfnxUsi.js → btc-hashrate-C0dYT_WJ.js} +1 -1
- package/runtime/assets/{btc-mempool-8oOMDiaW.js → btc-mempool-DipekM7O.js} +1 -1
- package/runtime/assets/{calculator-D91iI7KM.js → calculator-zC8onHXp.js} +1 -1
- package/runtime/assets/{checklist-DNrOJw0w.js → checklist-baxMKxEm.js} +1 -1
- package/runtime/assets/{clock-BzAIAbhU.js → clock-x9v1tYQm.js} +1 -1
- package/runtime/assets/{coin-movers-99W2EABZ.js → coin-movers-fIxzBuhy.js} +1 -1
- package/runtime/assets/{countdown-ZAJmbykg.js → countdown-BlyeM771.js} +1 -1
- package/runtime/assets/{daily-analysis-CS5MqofA.js → daily-analysis-DxjxE53t.js} +1 -1
- package/runtime/assets/{day-meter-DzBvLcpd.js → day-meter-9YEIbKbk.js} +1 -1
- package/runtime/assets/{dex-volume-chart-BfnczfAT.js → dex-volume-chart-CIN2oKpJ.js} +1 -1
- package/runtime/assets/{dex-volume-treemap-CLyIrkgU.js → dex-volume-treemap-CqHdMsnd.js} +1 -1
- package/runtime/assets/{dice-CAvRf0md.js → dice-DnddcY-J.js} +1 -1
- package/runtime/assets/{dino-game-gsyCpJ-0.js → dino-game-D6AH1SSj.js} +1 -1
- package/runtime/assets/{divider-DCTu-qNh.js → divider-Bu8aGlm1.js} +1 -1
- package/runtime/assets/{drawdy-CZWCFtog.js → drawdy-BhOQeakE.js} +1 -1
- package/runtime/assets/{editor-Ckt9OQ98.js → editor-Ca-voh3h.js} +1 -1
- package/runtime/assets/{fear-greed-DOcPswrx.js → fear-greed-i87oWLnT.js} +1 -1
- package/runtime/assets/{filings-feed-Cs--DpYl.js → filings-feed-Cxg9eG9S.js} +1 -1
- package/runtime/assets/{financial-stress-BqnxLk2O.js → financial-stress-Bv_reW65.js} +1 -1
- package/runtime/assets/{flappy-bird-DaasqVGg.js → flappy-bird-BENHBDEL.js} +1 -1
- package/runtime/assets/{fundamentals-GseULnsD.js → fundamentals-AlhngJ8G.js} +1 -1
- package/runtime/assets/{funding-heatmap-2RvVLTPN.js → funding-heatmap-B4RGXX4K.js} +1 -1
- package/runtime/assets/{funding-rate-chart-DCRKHp6g.js → funding-rate-chart-Cg6gi0YC.js} +1 -1
- package/runtime/assets/{fx-board-CVW6VmbY.js → fx-board-BqGsP0Xx.js} +1 -1
- package/runtime/assets/{heading-BaRMJq2t.js → heading-Dr7Q6vy_.js} +1 -1
- package/runtime/assets/{holiday-calendar-2OBfwbh-.js → holiday-calendar-C1fruUVL.js} +1 -1
- package/runtime/assets/{image-CuTXEV7Q.js → image-BulRsYTV.js} +1 -1
- package/runtime/assets/{index-CH54P4Cn.js → index-BgSQpj_B.js} +43 -43
- package/runtime/assets/{inflation-pulse-B8E9uzQB.js → inflation-pulse-Q-3bZn55.js} +1 -1
- package/runtime/assets/{journal-log-7APM_99k.js → journal-log-FuAPC6JH.js} +1 -1
- package/runtime/assets/{journal-open-CcdGuysA.js → journal-open-BREaG6Cs.js} +1 -1
- package/runtime/assets/{journal-results-CUTn4-kq.js → journal-results-Y_pKQcgg.js} +1 -1
- package/runtime/assets/{journal-score-C31dg2yL.js → journal-score-ZATtCKrj.js} +1 -1
- package/runtime/assets/{journal-ui-C5ueSjZx.js → journal-ui-C_1ADbUX.js} +1 -1
- package/runtime/assets/{labor-market-DgvDQtFo.js → labor-market-DVybIeSN.js} +1 -1
- package/runtime/assets/{lightning-stats-CiUlm-e_.js → lightning-stats-ByvWkKyP.js} +1 -1
- package/runtime/assets/{link-grid-DlsY59eq.js → link-grid-CJC48i5r.js} +1 -1
- package/runtime/assets/{market-cap-treemap-6vqLUgVk.js → market-cap-treemap-CpnOP_gY.js} +1 -1
- package/runtime/assets/{market-hours-BArlXOQB.js → market-hours-B9zPCvQk.js} +1 -1
- package/runtime/assets/{marquee-2Di2SqI2.js → marquee-D8GTgVmy.js} +1 -1
- package/runtime/assets/{mining-pools-Bg02wm2V.js → mining-pools-DiyEBr6a.js} +1 -1
- package/runtime/assets/{mover-row-C8040L85.js → mover-row-CO2STKkw.js} +1 -1
- package/runtime/assets/{national-debt-BS57WjA3.js → national-debt-CcTydivP.js} +1 -1
- package/runtime/assets/{news-feed-oBCTiuoo.js → news-feed-D4xS-sLD.js} +1 -1
- package/runtime/assets/{note-BLWlz52v.js → note-BXsj5NlE.js} +1 -1
- package/runtime/assets/{open-interest-DxMqZcmu.js → open-interest-DaFRJd2O.js} +1 -1
- package/runtime/assets/{options-iv-CgIIFdpN.js → options-iv-MpSqgS3E.js} +1 -1
- package/runtime/assets/{options-oi-strike-blRp4kmB.js → options-oi-strike-BHF28ASR.js} +1 -1
- package/runtime/assets/{options-put-call-CyOwXBVQ.js → options-put-call-_ZFaepBW.js} +1 -1
- package/runtime/assets/{pomodoro-BKJlh-bz.js → pomodoro-CxHVmgqp.js} +1 -1
- package/runtime/assets/{portfolio-allocation-Cat1vq2_.js → portfolio-allocation-Cf251dcH.js} +1 -1
- package/runtime/assets/{portfolio-common-DeyRfuNV.js → portfolio-common-DnESc3oR.js} +1 -1
- package/runtime/assets/{portfolio-holdings-DDDhMMFL.js → portfolio-holdings-2vYKEk7f.js} +1 -1
- package/runtime/assets/{portfolio-value-D9qrGeZp.js → portfolio-value-B-7uIpG4.js} +1 -1
- package/runtime/assets/{price-chart-CQJNOBtu.js → price-chart-Cx_2scgb.js} +1 -1
- package/runtime/assets/{price-compare-DqBiHd7S.js → price-compare-DQcEOpnr.js} +1 -1
- package/runtime/assets/{price-liveline-BlVGC2-R.js → price-liveline-TTo-aOFd.js} +1 -1
- package/runtime/assets/{price-ticker-QdVoVaQh.js → price-ticker-Cp7yYsNm.js} +1 -1
- package/runtime/assets/{protocol-fees-treemap-39F-aE33.js → protocol-fees-treemap-D-koQrKr.js} +1 -1
- package/runtime/assets/{protocol-tvl-chart-DZOgbMZu.js → protocol-tvl-chart-CDZkrQuF.js} +1 -1
- package/runtime/assets/{protocol-tvl-treemap-DusQ6xL2.js → protocol-tvl-treemap-I8fjLZU7.js} +1 -1
- package/runtime/assets/{quote-Di049ggj.js → quote-CKEEp9tF.js} +1 -1
- package/runtime/assets/{rates-board-Dm3tb6-P.js → rates-board-BElUHlYN.js} +1 -1
- package/runtime/assets/{returns-projector-BiMx_kSw.js → returns-projector-DjIbvas1.js} +1 -1
- package/runtime/assets/{risk-reward-1Q_Kt75s.js → risk-reward-pVHqmm_g.js} +1 -1
- package/runtime/assets/{rules-card-BkAX9PEq.js → rules-card-uMZQ6oP0.js} +1 -1
- package/runtime/assets/scene-uwfOGek1.js +1 -0
- package/runtime/assets/{session-progress-D_1dzPzM.js → session-progress-Djhvb1G5.js} +1 -1
- package/runtime/assets/{short-volume-U-uFonb2.js → short-volume-CiBfmCKw.js} +1 -1
- package/runtime/assets/{snake-Dp4E3Dcv.js → snake-CYXVjy8d.js} +1 -1
- package/runtime/assets/{spotify-embed-Cw95WZjV.js → spotify-embed-CGYKFOmX.js} +1 -1
- package/runtime/assets/{stopwatch-B2_iDkKK.js → stopwatch-Cl10sfaX.js} +1 -1
- package/runtime/assets/{top-movers--vCUiTII.js → top-movers-vvOomk6S.js} +1 -1
- package/runtime/assets/{treasury-auctions-BpzYivLg.js → treasury-auctions-JMoATy9T.js} +1 -1
- package/runtime/assets/{tvl-treemap-BYgD9bNy.js → tvl-treemap-B28_19EZ.js} +1 -1
- package/runtime/assets/{video-D-nBm697.js → video-DjiOnvMm.js} +1 -1
- package/runtime/assets/{yield-curve-8IsrMS_9.js → yield-curve-Dj5vJwI4.js} +1 -1
- package/runtime/index.html +1 -1
- package/runtime/assets/unicorn-scene-DcohHRPZ.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/
|
|
2
|
-
var nc=Object.defineProperty;var oc=(e,t,r)=>t in e?nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var X=(e,t,r)=>oc(e,typeof t!="symbol"?t+"":t,r);import{r as z,j as w,a as ac,c as ic}from"./react-qoZPGuNy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const sc="modulepreload",cc=function(e){return"/"+e},na={},R=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let i=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};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"));o=i(r.map(l=>{if(l=cc(l),l in na)return;na[l]=!0;const u=l.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":sc,u||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),u)return new Promise((d,m)=>{f.addEventListener("load",d),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})},_y=[{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:"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 Ay(e){return e}var oa;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 h=0;h<u.length;h++){const f=u[h];f in s||(s[f]=l[f].bind(s))}}const o=(r==null?void 0:r.Parent)??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const l=r!=null&&r.Parent?new a: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 Rr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gi extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(oa=globalThis).__zod_globalConfig??(oa.__zod_globalConfig={});const To=globalThis.__zod_globalConfig;function Xt(e){return To}function vi(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function io(e,t){return typeof t=="bigint"?t.toString():t}function Eo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Po(e){return e==null}function Mo(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function lc(e,t){const r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}const aa=Symbol("evaluating");function Oe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==aa)return n===void 0&&(n=aa,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Cr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ur(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ia(e){return JSON.stringify(e)}function uc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const yi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const dc=Eo(()=>{var e;if(To.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 Fr(e){if(vn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(vn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function bi(e){return Fr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const fc=new Set(["string","number","symbol"]);function Mn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(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 Z(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 hc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const pc={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 mc(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 a=ur(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 Cr(this,"shape",i),i},checks:[]});return dr(e,a)}function gc(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 a=ur(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 Cr(this,"shape",i),i},checks:[]});return dr(e,a)}function vc(e,t){if(!Fr(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ur(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Cr(this,"shape",a),a}});return dr(e,o)}function yc(e,t){if(!Fr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ur(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Cr(this,"shape",n),n}});return dr(e,r)}function bc(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=ur(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Cr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return dr(e,r)}function wc(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ur(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 Cr(this,"shape",c),c},checks:[]});return dr(t,i)}function xc(e,t,r){const n=ur(t._zod.def,{get shape(){const o=t._zod.def.shape,a={...o};if(r)for(const i in r){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(a[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)a[i]=new e({type:"nonoptional",innerType:o[i]});return Cr(this,"shape",a),a}});return dr(t,n)}function Er(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 kc(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 Pr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function an(e){return typeof e=="string"?e:e==null?void 0:e.message}function Qt(e,t,r){var c,l,u,h,f,d;const n=e.message?e.message:an((u=(l=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:u.call(l,e))??an((h=t==null?void 0:t.error)==null?void 0:h.call(t,e))??an((f=r.customError)==null?void 0:f.call(r,e))??an((d=r.localeError)==null?void 0:d.call(r,e))??"Invalid input",{inst:o,continue:a,input:i,...s}=e;return s.path??(s.path=[]),s.message=n,t!=null&&t.reportInput&&(s.input=i),s}function Oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kr(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const wi=(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,io,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},xi=k("$ZodError",wi),ki=k("$ZodError",wi,{Parent:Error});function Cc(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _c(e,t=r=>r.message){const r={_errors:[]},n=(o,a=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>n({issues:s},[...a,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...a,...i.path]);else{const s=[...a,...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 Do=e=>(t,r,n,o)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new Rr;if(i.issues.length){const s=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>Qt(c,a,Xt())));throw yi(s,o==null?void 0:o.callee),s}return i.value},Ro=e=>async(t,r,n,o)=>{const a=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>Qt(c,a,Xt())));throw yi(s,o==null?void 0:o.callee),s}return i.value},On=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Rr;return a.issues.length?{success:!1,error:new(e??xi)(a.issues.map(i=>Qt(i,o,Xt())))}:{success:!0,data:a.value}},Ac=On(ki),Dn=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>Qt(i,o,Xt())))}:{success:!0,data:a.value}},Sc=Dn(ki),zc=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Do(e)(t,r,o)},Tc=e=>(t,r,n)=>Do(e)(t,r,n),Ec=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Ro(e)(t,r,o)},Pc=e=>async(t,r,n)=>Ro(e)(t,r,n),Mc=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return On(e)(t,r,o)},Oc=e=>(t,r,n)=>On(e)(t,r,n),Dc=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Dn(e)(t,r,o)},Rc=e=>async(t,r,n)=>Dn(e)(t,r,n),Nc=/^[cC][0-9a-z]{6,}$/,Lc=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fc=/^[0-9a-vA-V]{20}$/,jc=/^[A-Za-z0-9]{27}$/,Uc=/^[a-zA-Z0-9_-]{21}$/,Bc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hc=/^([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})$/,sa=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)$/,Gc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Wc(){return new RegExp(Vc,"u")}const qc=/^(?:(?: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])$/,Kc=/^(([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}|:))$/,Yc=/^((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])$/,Jc=/^(([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])$/,Zc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ci=/^[A-Za-z0-9_-]*$/,Xc=/^https?$/,Qc=/^\+[1-9]\d{6,14}$/,_i="(?:(?:\\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])))",$c=new RegExp(`^${_i}$`);function Ai(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 el(e){return new RegExp(`^${Ai(e)}$`)}function tl(e){const t=Ai({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(`^${_i}T(?:${n})$`)}const rl=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}$`)},nl=/^-?\d+$/,Si=/^-?\d+(?:\.\d+)?$/,ol=/^(?:true|false)$/i,al=/^[^A-Z]*$/,il=/^[^a-z]*$/,kt=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),zi={number:"number",bigint:"bigint",object:"date"},Ti=k("$ZodCheckLessThan",(e,t)=>{kt.init(e,t);const r=zi[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?o.maximum=t.value:o.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})}}),Ei=k("$ZodCheckGreaterThan",(e,t)=>{kt.init(e,t);const r=zi[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?o.minimum=t.value:o.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})}}),sl=k("$ZodCheckMultipleOf",(e,t)=>{kt.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):lc(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})}}),cl=k("$ZodCheckNumberFormat",(e,t)=>{var i;kt.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[o,a]=pc[t.format];e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,c.minimum=o,c.maximum=a,r&&(c.pattern=nl)}),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<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>a&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ll=k("$ZodCheckMaxLength",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=Oo(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ul=k("$ZodCheckMinLength",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Oo(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),dl=k("$ZodCheckLengthEquals",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,a=o.length;if(a===t.length)return;const i=Oo(o),s=a>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})}}),Rn=k("$ZodCheckStringFormat",(e,t)=>{var r,n;kt.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),fl=k("$ZodCheckRegex",(e,t)=>{Rn.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})}}),hl=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=al),Rn.init(e,t)}),pl=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=il),Rn.init(e,t)}),ml=k("$ZodCheckIncludes",(e,t)=>{kt.init(e,t);const r=Mn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gl=k("$ZodCheckStartsWith",(e,t)=>{kt.init(e,t);const r=new RegExp(`^${Mn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),vl=k("$ZodCheckEndsWith",(e,t)=>{kt.init(e,t);const r=new RegExp(`.*${Mn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),yl=k("$ZodCheckOverwrite",(e,t)=>{kt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class bl{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(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scene-uwfOGek1.js","assets/react-qoZPGuNy.js","assets/portfolio-value-B-7uIpG4.js","assets/liveline-bcaEuskN.js","assets/format-CfAcS4D8.js","assets/live-tick-9Q3ubPF9.js","assets/portfolio-common-DnESc3oR.js","assets/ui-Bq3RQsdJ.js","assets/portfolio-allocation-Cf251dcH.js","assets/chart-utils-BYIZMM9J.js","assets/d3-xK4fOkBU.js","assets/portfolio-holdings-2vYKEk7f.js","assets/bitcoin-dominance-CxfMBVwW.js","assets/clock-x9v1tYQm.js","assets/use-countdown-BmcF-qdL.js","assets/daily-analysis-DxjxE53t.js","assets/journal-log-FuAPC6JH.js","assets/content-shared-BZ1XzrJx.js","assets/journal-store-KCRoPnI_.js","assets/journal-open-BREaG6Cs.js","assets/journal-ui-C_1ADbUX.js","assets/journal-results-Y_pKQcgg.js","assets/journal-score-ZATtCKrj.js","assets/dino-game-D6AH1SSj.js","assets/game-ui-Dy_QYsPr.js","assets/fear-greed-i87oWLnT.js","assets/mini-line-chart-CHM5UBjJ.js","assets/utils-DaT-yT0k.js","assets/filings-feed-Cxg9eG9S.js","assets/feed-row-mVg1d5Zj.js","assets/fundamentals-AlhngJ8G.js","assets/financial-stress-Bv_reW65.js","assets/labor-market-DVybIeSN.js","assets/national-debt-CcTydivP.js","assets/treasury-auctions-JMoATy9T.js","assets/metric-row-BVVhjsjK.js","assets/funding-heatmap-B4RGXX4K.js","assets/funding-rate-chart-Cg6gi0YC.js","assets/index-DK7jWlTL.js","assets/index-XGtH5pVY.css","assets/heading-Dr7Q6vy_.js","assets/image-BulRsYTV.js","assets/inflation-pulse-Q-3bZn55.js","assets/market-hours-B9zPCvQk.js","assets/market-data-CvmpLFSo.js","assets/news-feed-D4xS-sLD.js","assets/note-BXsj5NlE.js","assets/price-chart-Cx_2scgb.js","assets/price-compare-DQcEOpnr.js","assets/price-liveline-TTo-aOFd.js","assets/price-ticker-Cp7yYsNm.js","assets/mover-row-CO2STKkw.js","assets/rates-board-BElUHlYN.js","assets/fx-board-BqGsP0Xx.js","assets/short-volume-CiBfmCKw.js","assets/top-movers-vvOomk6S.js","assets/tvl-treemap-B28_19EZ.js","assets/treemap-leaf-DNIoJEK-.js","assets/yield-curve-Dj5vJwI4.js","assets/dex-volume-treemap-CqHdMsnd.js","assets/dex-volume-chart-CIN2oKpJ.js","assets/protocol-tvl-treemap-I8fjLZU7.js","assets/protocol-tvl-chart-CDZkrQuF.js","assets/protocol-fees-treemap-D-koQrKr.js","assets/market-cap-treemap-CpnOP_gY.js","assets/open-interest-DaFRJd2O.js","assets/snake-CYXVjy8d.js","assets/flappy-bird-BENHBDEL.js","assets/video-DjiOnvMm.js","assets/drawdy-BhOQeakE.js","assets/countdown-BlyeM771.js","assets/link-grid-CJC48i5r.js","assets/calculator-zC8onHXp.js","assets/quote-CKEEp9tF.js","assets/divider-Bu8aGlm1.js","assets/marquee-D8GTgVmy.js","assets/dice-DnddcY-J.js","assets/risk-reward-pVHqmm_g.js","assets/stopwatch-Cl10sfaX.js","assets/session-progress-Djhvb1G5.js","assets/btc-fees-DsYgskwn.js","assets/btc-shared-DeqDaCze.js","assets/btc-mempool-DipekM7O.js","assets/btc-blocks-Cy-YFeqC.js","assets/btc-hashrate-C0dYT_WJ.js","assets/btc-difficulty-CQ_30M6B.js","assets/mining-pools-DiyEBr6a.js","assets/lightning-stats-ByvWkKyP.js","assets/options-put-call-_ZFaepBW.js","assets/options-iv-MpSqgS3E.js","assets/options-oi-strike-BHF28ASR.js","assets/coin-movers-fIxzBuhy.js","assets/holiday-calendar-C1fruUVL.js","assets/day-meter-9YEIbKbk.js","assets/returns-projector-DjIbvas1.js","assets/breakeven-BrpmE2y2.js","assets/checklist-baxMKxEm.js","assets/pomodoro-CxHVmgqp.js","assets/rules-card-uMZQ6oP0.js","assets/breathing-Bjv7D86F.js","assets/spotify-embed-CGYKFOmX.js","assets/editor-Ca-voh3h.js","assets/gridstack-BxxvPIFU.js","assets/gridstack-FIb_WQSt.css","assets/editor-BMMobjrE.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var rc=Object.defineProperty;var nc=(e,t,r)=>t in e?rc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var X=(e,t,r)=>nc(e,typeof t!="symbol"?t+"":t,r);import{r as z,j as w,a as oc,c as ac}from"./react-qoZPGuNy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const ic="modulepreload",sc=function(e){return"/"+e},na={},R=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let i=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};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"));o=i(r.map(l=>{if(l=sc(l),l in na)return;na[l]=!0;const u=l.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":ic,u||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),u)return new Promise((d,m)=>{f.addEventListener("load",d),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})},Ty=[{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:"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 Ey(e){return e}var oa;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 h=0;h<u.length;h++){const f=u[h];f in s||(s[f]=l[f].bind(s))}}const o=(r==null?void 0:r.Parent)??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const l=r!=null&&r.Parent?new a: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 Rr 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"}}(oa=globalThis).__zod_globalConfig??(oa.__zod_globalConfig={});const To=globalThis.__zod_globalConfig;function Xt(e){return To}function gi(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function io(e,t){return typeof t=="bigint"?t.toString():t}function Eo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Po(e){return e==null}function Mo(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function cc(e,t){const r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}const aa=Symbol("evaluating");function Oe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==aa)return n===void 0&&(n=aa,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Cr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ur(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ia(e){return JSON.stringify(e)}function lc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const uc=Eo(()=>{var e;if(To.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 Fr(e){if(vn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(vn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yi(e){return Fr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const dc=new Set(["string","number","symbol"]);function Mn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(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 Z(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 fc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const hc={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 pc(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 a=ur(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 Cr(this,"shape",i),i},checks:[]});return dr(e,a)}function mc(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 a=ur(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 Cr(this,"shape",i),i},checks:[]});return dr(e,a)}function gc(e,t){if(!Fr(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ur(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Cr(this,"shape",a),a}});return dr(e,o)}function vc(e,t){if(!Fr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ur(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Cr(this,"shape",n),n}});return dr(e,r)}function yc(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=ur(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Cr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return dr(e,r)}function bc(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ur(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 Cr(this,"shape",c),c},checks:[]});return dr(t,i)}function wc(e,t,r){const n=ur(t._zod.def,{get shape(){const o=t._zod.def.shape,a={...o};if(r)for(const i in r){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(a[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)a[i]=new e({type:"nonoptional",innerType:o[i]});return Cr(this,"shape",a),a}});return dr(t,n)}function Er(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 xc(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 Pr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function an(e){return typeof e=="string"?e:e==null?void 0:e.message}function Qt(e,t,r){var c,l,u,h,f,d;const n=e.message?e.message:an((u=(l=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:u.call(l,e))??an((h=t==null?void 0:t.error)==null?void 0:h.call(t,e))??an((f=r.customError)==null?void 0:f.call(r,e))??an((d=r.localeError)==null?void 0:d.call(r,e))??"Invalid input",{inst:o,continue:a,input:i,...s}=e;return s.path??(s.path=[]),s.message=n,t!=null&&t.reportInput&&(s.input=i),s}function Oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qr(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const bi=(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,io,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wi=k("$ZodError",bi),xi=k("$ZodError",bi,{Parent:Error});function kc(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Cc(e,t=r=>r.message){const r={_errors:[]},n=(o,a=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>n({issues:s},[...a,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...a,...i.path]);else{const s=[...a,...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 Do=e=>(t,r,n,o)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new Rr;if(i.issues.length){const s=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>Qt(c,a,Xt())));throw vi(s,o==null?void 0:o.callee),s}return i.value},Ro=e=>async(t,r,n,o)=>{const a=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>Qt(c,a,Xt())));throw vi(s,o==null?void 0:o.callee),s}return i.value},On=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Rr;return a.issues.length?{success:!1,error:new(e??wi)(a.issues.map(i=>Qt(i,o,Xt())))}:{success:!0,data:a.value}},_c=On(xi),Dn=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>Qt(i,o,Xt())))}:{success:!0,data:a.value}},Ac=Dn(xi),Sc=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Do(e)(t,r,o)},zc=e=>(t,r,n)=>Do(e)(t,r,n),Tc=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Ro(e)(t,r,o)},Ec=e=>async(t,r,n)=>Ro(e)(t,r,n),Pc=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return On(e)(t,r,o)},Mc=e=>(t,r,n)=>On(e)(t,r,n),Oc=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Dn(e)(t,r,o)},Dc=e=>async(t,r,n)=>Dn(e)(t,r,n),Rc=/^[cC][0-9a-z]{6,}$/,Nc=/^[0-9a-z]+$/,Lc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ic=/^[0-9a-vA-V]{20}$/,Fc=/^[A-Za-z0-9]{27}$/,jc=/^[a-zA-Z0-9_-]{21}$/,Uc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bc=/^([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})$/,sa=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)$/,Hc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vc(){return new RegExp(Gc,"u")}const Wc=/^(?:(?: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])$/,Kc=/^(([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}|:))$/,qc=/^((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])$/,Yc=/^(([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])$/,Jc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ki=/^[A-Za-z0-9_-]*$/,Zc=/^https?$/,Xc=/^\+[1-9]\d{6,14}$/,Ci="(?:(?:\\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])))",Qc=new RegExp(`^${Ci}$`);function _i(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 $c(e){return new RegExp(`^${_i(e)}$`)}function el(e){const t=_i({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(`^${Ci}T(?:${n})$`)}const tl=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}$`)},rl=/^-?\d+$/,Ai=/^-?\d+(?:\.\d+)?$/,nl=/^(?:true|false)$/i,ol=/^[^A-Z]*$/,al=/^[^a-z]*$/,kt=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Si={number:"number",bigint:"bigint",object:"date"},zi=k("$ZodCheckLessThan",(e,t)=>{kt.init(e,t);const r=Si[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?o.maximum=t.value:o.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})}}),Ti=k("$ZodCheckGreaterThan",(e,t)=>{kt.init(e,t);const r=Si[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?o.minimum=t.value:o.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})}}),il=k("$ZodCheckMultipleOf",(e,t)=>{kt.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):cc(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;kt.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[o,a]=hc[t.format];e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,c.minimum=o,c.maximum=a,r&&(c.pattern=rl)}),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<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>a&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),cl=k("$ZodCheckMaxLength",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=Oo(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ll=k("$ZodCheckMinLength",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Oo(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ul=k("$ZodCheckLengthEquals",(e,t)=>{var r;kt.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Po(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,a=o.length;if(a===t.length)return;const i=Oo(o),s=a>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})}}),Rn=k("$ZodCheckStringFormat",(e,t)=>{var r,n;kt.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),dl=k("$ZodCheckRegex",(e,t)=>{Rn.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})}}),fl=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ol),Rn.init(e,t)}),hl=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=al),Rn.init(e,t)}),pl=k("$ZodCheckIncludes",(e,t)=>{kt.init(e,t);const r=Mn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ml=k("$ZodCheckStartsWith",(e,t)=>{kt.init(e,t);const r=new RegExp(`^${Mn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),gl=k("$ZodCheckEndsWith",(e,t)=>{kt.init(e,t);const r=new RegExp(`.*${Mn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),vl=k("$ZodCheckOverwrite",(e,t)=>{kt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class yl{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
3
|
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),a=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new t(...r,o.join(`
|
|
4
|
-
`))}}const wl={major:4,minor:4,patch:3},Xe=k("$ZodType",(e,t)=>{var o;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wl;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const i of a._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const a=(s,c,l)=>{let u=Er(s),h;for(const f of c){if(f._zod.def.when){if(kc(s)||!f._zod.def.when(s))continue}else if(u)continue;const d=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Rr;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(u||(u=Er(s,d)))});else{if(s.issues.length===d)continue;u||(u=Er(s,d))}}return h?h.then(()=>s):s},i=(s,c,l)=>{if(Er(s))return s.aborted=!0,s;const u=a(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Rr;return u.then(h=>e._zod.parse(h,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(h=>i(h,s,c)):i(u,s,c)}const l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Rr;return l.then(u=>a(u,n,c))}return a(l,n,c)}}Oe(e,"~standard",()=>({validate:a=>{var i;try{const s=Ac(e,a);return s.success?{value:s.data}:{issues:(i=s.error)==null?void 0:i.issues}}catch{return Sc(e,a).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),No=k("$ZodString",(e,t)=>{var r;Xe.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??rl(e._zod.bag),e._zod.parse=(n,o)=>{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}}),Ge=k("$ZodStringFormat",(e,t)=>{Rn.init(e,t),No.init(e,t)}),xl=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hc),Ge.init(e,t)}),kl=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=sa(n))}else t.pattern??(t.pattern=sa());Ge.init(e,t)}),Cl=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Gc),Ge.init(e,t)}),_l=k("$ZodURL",(e,t)=>{Ge.init(e,t),e._zod.check=r=>{var n;try{const o=r.value.trim();if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===Xc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.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(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.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=a.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Al=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Wc()),Ge.init(e,t)}),Sl=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Uc),Ge.init(e,t)}),zl=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Nc),Ge.init(e,t)}),Tl=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lc),Ge.init(e,t)}),El=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ic),Ge.init(e,t)}),Pl=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fc),Ge.init(e,t)}),Ml=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jc),Ge.init(e,t)}),Ol=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tl(t)),Ge.init(e,t)}),Dl=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$c),Ge.init(e,t)}),Rl=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=el(t)),Ge.init(e,t)}),Nl=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Bc),Ge.init(e,t)}),Ll=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qc),Ge.init(e,t),e._zod.bag.format="ipv4"}),Il=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kc),Ge.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})}}}),Fl=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Yc),Ge.init(e,t)}),jl=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Jc),Ge.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,a]=n;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Pi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ul=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zc),Ge.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Pi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Bl(e){if(!Ci.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Pi(r)}const Hl=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ci),Ge.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Bl(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Gl=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Qc),Ge.init(e,t)});function Vl(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Wl=k("$ZodJWT",(e,t)=>{Ge.init(e,t),e._zod.check=r=>{Vl(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Mi=k("$ZodNumber",(e,t)=>{Xe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Si,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),ql=k("$ZodNumberFormat",(e,t)=>{cl.init(e,t),Mi.init(e,t)}),Kl=k("$ZodBoolean",(e,t)=>{Xe.init(e,t),e._zod.pattern=ol,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Yl=k("$ZodUnknown",(e,t)=>{Xe.init(e,t),e._zod.parse=r=>r}),Jl=k("$ZodNever",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ca(e,t,r){e.issues.length&&t.issues.push(...Pr(r,e.issues)),t.value[r]=e.value}const Zl=k("$ZodArray",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const a=[];for(let i=0;i<o.length;i++){const s=o[i],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?a.push(c.then(l=>ca(l,r,i))):ca(c,r,i)}return a.length?Promise.all(a).then(()=>r):r}});function yn(e,t,r,n,o,a){const i=r in n;if(e.issues.length){if(o&&a&&!i)return;t.issues.push(...Pr(r,e.issues))}if(!i&&!o){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 Oi(e){var n,o,a,i;const t=Object.keys(e.shape);for(const s of t)if(!((i=(a=(o=(n=e.shape)==null?void 0:n[s])==null?void 0:o._zod)==null?void 0:a.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=hc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Di(e,t,r,n,o,a){const i=[],s=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",h=c.optout==="optional";for(const f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){i.push(f);continue}const d=c.run({value:t[f],issues:[]},n);d instanceof Promise?e.push(d.then(m=>yn(m,r,f,t,u,h))):yn(d,r,f,t,u,h)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}const Xl=k("$ZodObject",(e,t)=>{Xe.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=Eo(()=>Oi(t));Oe(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 h of u.values)c[l].add(h)}}return c});const o=vn,a=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=n.value);const l=s.value;if(!o(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};const u=[],h=i.shape;for(const f of i.keys){const d=h[f],m=d._zod.optin==="optional",p=d._zod.optout==="optional",v=d._zod.run({value:l[f],issues:[]},c);v instanceof Promise?u.push(v.then(g=>yn(g,s,f,l,m,p))):yn(v,s,f,l,m,p)}return a?Di(u,l,s,c,n.value,e):u.length?Promise.all(u).then(()=>s):s}}),Ql=k("$ZodObjectJIT",(e,t)=>{Xl.init(e,t);const r=e._zod.parse,n=Eo(()=>Oi(t)),o=f=>{var x,T;const d=new bl(["shape","payload","ctx"]),m=n.value,p=C=>{const y=ia(C);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);let g=0;for(const C of m.keys)v[C]=`key_${g++}`;d.write("const newResult = {};");for(const C of m.keys){const y=v[C],S=ia(C),E=f[C],O=((x=E==null?void 0:E._zod)==null?void 0:x.optin)==="optional",_=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";d.write(`const ${y} = ${p(C)};`),O&&_?d.write(`
|
|
4
|
+
`))}}const bl={major:4,minor:4,patch:3},Xe=k("$ZodType",(e,t)=>{var o;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bl;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const i of a._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const a=(s,c,l)=>{let u=Er(s),h;for(const f of c){if(f._zod.def.when){if(xc(s)||!f._zod.def.when(s))continue}else if(u)continue;const d=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Rr;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(u||(u=Er(s,d)))});else{if(s.issues.length===d)continue;u||(u=Er(s,d))}}return h?h.then(()=>s):s},i=(s,c,l)=>{if(Er(s))return s.aborted=!0,s;const u=a(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Rr;return u.then(h=>e._zod.parse(h,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(h=>i(h,s,c)):i(u,s,c)}const l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Rr;return l.then(u=>a(u,n,c))}return a(l,n,c)}}Oe(e,"~standard",()=>({validate:a=>{var i;try{const s=_c(e,a);return s.success?{value:s.data}:{issues:(i=s.error)==null?void 0:i.issues}}catch{return Ac(e,a).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),No=k("$ZodString",(e,t)=>{var r;Xe.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??tl(e._zod.bag),e._zod.parse=(n,o)=>{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}}),Ge=k("$ZodStringFormat",(e,t)=>{Rn.init(e,t),No.init(e,t)}),wl=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bc),Ge.init(e,t)}),xl=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=sa(n))}else t.pattern??(t.pattern=sa());Ge.init(e,t)}),kl=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Hc),Ge.init(e,t)}),Cl=k("$ZodURL",(e,t)=>{Ge.init(e,t),e._zod.check=r=>{var n;try{const o=r.value.trim();if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===Zc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.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(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.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=a.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),_l=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vc()),Ge.init(e,t)}),Al=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jc),Ge.init(e,t)}),Sl=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rc),Ge.init(e,t)}),zl=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nc),Ge.init(e,t)}),Tl=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Lc),Ge.init(e,t)}),El=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ic),Ge.init(e,t)}),Pl=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fc),Ge.init(e,t)}),Ml=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=el(t)),Ge.init(e,t)}),Ol=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Qc),Ge.init(e,t)}),Dl=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$c(t)),Ge.init(e,t)}),Rl=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Uc),Ge.init(e,t)}),Nl=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wc),Ge.init(e,t),e._zod.bag.format="ipv4"}),Ll=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kc),Ge.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})}}}),Il=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qc),Ge.init(e,t)}),Fl=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yc),Ge.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,a]=n;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ei(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jl=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Jc),Ge.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ei(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ul(e){if(!ki.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ei(r)}const Bl=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ki),Ge.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ul(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Hl=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Xc),Ge.init(e,t)});function Gl(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Vl=k("$ZodJWT",(e,t)=>{Ge.init(e,t),e._zod.check=r=>{Gl(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pi=k("$ZodNumber",(e,t)=>{Xe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ai,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),Wl=k("$ZodNumberFormat",(e,t)=>{sl.init(e,t),Pi.init(e,t)}),Kl=k("$ZodBoolean",(e,t)=>{Xe.init(e,t),e._zod.pattern=nl,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),ql=k("$ZodUnknown",(e,t)=>{Xe.init(e,t),e._zod.parse=r=>r}),Yl=k("$ZodNever",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ca(e,t,r){e.issues.length&&t.issues.push(...Pr(r,e.issues)),t.value[r]=e.value}const Jl=k("$ZodArray",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const a=[];for(let i=0;i<o.length;i++){const s=o[i],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?a.push(c.then(l=>ca(l,r,i))):ca(c,r,i)}return a.length?Promise.all(a).then(()=>r):r}});function yn(e,t,r,n,o,a){const i=r in n;if(e.issues.length){if(o&&a&&!i)return;t.issues.push(...Pr(r,e.issues))}if(!i&&!o){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 Mi(e){var n,o,a,i;const t=Object.keys(e.shape);for(const s of t)if(!((i=(a=(o=(n=e.shape)==null?void 0:n[s])==null?void 0:o._zod)==null?void 0:a.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=fc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Oi(e,t,r,n,o,a){const i=[],s=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",h=c.optout==="optional";for(const f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){i.push(f);continue}const d=c.run({value:t[f],issues:[]},n);d instanceof Promise?e.push(d.then(m=>yn(m,r,f,t,u,h))):yn(d,r,f,t,u,h)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}const Zl=k("$ZodObject",(e,t)=>{Xe.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=Eo(()=>Mi(t));Oe(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 h of u.values)c[l].add(h)}}return c});const o=vn,a=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=n.value);const l=s.value;if(!o(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};const u=[],h=i.shape;for(const f of i.keys){const d=h[f],m=d._zod.optin==="optional",p=d._zod.optout==="optional",v=d._zod.run({value:l[f],issues:[]},c);v instanceof Promise?u.push(v.then(g=>yn(g,s,f,l,m,p))):yn(v,s,f,l,m,p)}return a?Oi(u,l,s,c,n.value,e):u.length?Promise.all(u).then(()=>s):s}}),Xl=k("$ZodObjectJIT",(e,t)=>{Zl.init(e,t);const r=e._zod.parse,n=Eo(()=>Mi(t)),o=f=>{var x,T;const d=new yl(["shape","payload","ctx"]),m=n.value,p=C=>{const y=ia(C);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);let g=0;for(const C of m.keys)v[C]=`key_${g++}`;d.write("const newResult = {};");for(const C of m.keys){const y=v[C],S=ia(C),E=f[C],O=((x=E==null?void 0:E._zod)==null?void 0:x.optin)==="optional",_=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";d.write(`const ${y} = ${p(C)};`),O&&_?d.write(`
|
|
5
5
|
if (${y}.issues.length) {
|
|
6
6
|
if (${S} in input) {
|
|
7
7
|
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
@@ -60,9 +60,9 @@ var nc=Object.defineProperty;var oc=(e,t,r)=>t in e?nc(e,t,{enumerable:!0,config
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(C,y)=>b(f,C,y)};let a;const i=vn,s=!To.jitless,l=s&&dc.value,u=t.catchall;let h;e._zod.parse=(f,d)=>{h??(h=n.value);const m=f.value;return i(m)?s&&l&&(d==null?void 0:d.async)===!1&&d.jitless!==!0?(a||(a=o(t.shape)),f=a(f,d),u?Di([],m,f,d,h,e):f):r(f,d):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function la(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!Er(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>Qt(i,n,Xt())))}),t)}const $l=k("$ZodUnion",(e,t)=>{Xe.init(e,t),Oe(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Oe(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Oe(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Oe(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Mo(o.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let a=!1;const i=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(s=>la(s,n,e,o)):la(i,n,e,o)}}),eu=k("$ZodIntersection",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,a=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,l])=>ua(r,c,l)):ua(r,a,i)}});function so(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(Fr(e)&&Fr(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(const a of n){const i=so(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}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 o=e[n],a=t[n],i=so(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ua(e,t,r){const n=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=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 a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),Er(e))return e;const i=so(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 tu=k("$ZodRecord",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Fr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const a=[],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,Xt())),input:l,path:[l],inst:e});continue}const h=u.value,f=t.valueType._zod.run({value:o[l],issues:[]},n);f instanceof Promise?a.push(f.then(d=>{d.issues.length&&r.issues.push(...Pr(l,d.issues)),r.value[h]=d.value})):(f.issues.length&&r.issues.push(...Pr(l,f.issues)),r.value[h]=f.value)}let c;for(const l in o)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,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"&&Si.test(s)&&c.issues.length){const h=t.keyType._zod.run({value:Number(s),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(c=h)}if(c.issues.length){t.mode==="loose"?r.value[s]=o[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>Qt(h,n,Xt())),input:s,path:[s],inst:e});continue}const u=t.valueType._zod.run({value:o[s],issues:[]},n);u instanceof Promise?a.push(u.then(h=>{h.issues.length&&r.issues.push(...Pr(s,h.issues)),r.value[c.value]=h.value})):(u.issues.length&&r.issues.push(...Pr(s,u.issues)),r.value[c.value]=u.value)}}return a.length?Promise.all(a).then(()=>r):r}}),ru=k("$ZodEnum",(e,t)=>{Xe.init(e,t);const r=vi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>fc.has(typeof o)).map(o=>typeof o=="string"?Mn(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),nu=k("$ZodTransform",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gi(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Rr;return r.value=o,r.fallback=!0,r}});function da(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ri=k("$ZodOptional",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mo(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=r.value,a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(i=>da(i,o)):da(a,o)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ou=k("$ZodExactOptional",(e,t)=>{Ri.init(e,t),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),au=k("$ZodNullable",(e,t)=>{Xe.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mo(r.source)}|null)$`):void 0}),Oe(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)}),iu=k("$ZodDefault",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>fa(a,t)):fa(o,t)}});function fa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const su=k("$ZodPrefault",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(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))}),cu=k("$ZodNonOptional",(e,t)=>{Xe.init(e,t),Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>ha(a,e)):ha(o,e)}});function ha(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 lu=k("$ZodCatch",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>Qt(i,n,Xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Qt(a,n,Xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Ni=k("$ZodPipe",(e,t)=>{Xe.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>sn(i,t.in,n)):sn(a,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>sn(a,t.out,n)):sn(o,t.out,n)}});function sn(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 uu=k("$ZodPreprocess",(e,t)=>{Ni.init(e,t)}),du=k("$ZodReadonly",(e,t)=>{Xe.init(e,t),Oe(e._zod,"propValues",()=>t.innerType._zod.propValues),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(pa):pa(o)}});function pa(e){return e.value=Object.freeze(e.value),e}const fu=k("$ZodCustom",(e,t)=>{kt.init(e,t),Xe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>ma(a,r,n,e));ma(o,r,n,e)}});function ma(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Kr(o))}}var ga;class hu{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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function pu(){return new hu}(ga=globalThis).__zod_globalRegistry??(ga.__zod_globalRegistry=pu());const Wr=globalThis.__zod_globalRegistry;function mu(e,t){return new e({type:"string",...Z(t)})}function gu(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function vu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function va(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function bu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function wu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function ku(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function Cu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function _u(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function Au(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function Su(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function zu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function Tu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function Eu(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function Pu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function Mu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function Ou(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function Du(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function Ru(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function Nu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function Lu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function Iu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function Fu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function ju(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function Uu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function Bu(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function Hu(e,t){return new e({type:"number",checks:[],...Z(t)})}function Gu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function Vu(e,t){return new e({type:"boolean",...Z(t)})}function Wu(e){return new e({type:"unknown"})}function qu(e,t){return new e({type:"never",...Z(t)})}function ya(e,t){return new Ti({check:"less_than",...Z(t),value:e,inclusive:!1})}function Jn(e,t){return new Ti({check:"less_than",...Z(t),value:e,inclusive:!0})}function ba(e,t){return new Ei({check:"greater_than",...Z(t),value:e,inclusive:!1})}function Zn(e,t){return new Ei({check:"greater_than",...Z(t),value:e,inclusive:!0})}function wa(e,t){return new sl({check:"multiple_of",...Z(t),value:e})}function Li(e,t){return new ll({check:"max_length",...Z(t),maximum:e})}function bn(e,t){return new ul({check:"min_length",...Z(t),minimum:e})}function Ii(e,t){return new dl({check:"length_equals",...Z(t),length:e})}function Ku(e,t){return new fl({check:"string_format",format:"regex",...Z(t),pattern:e})}function Yu(e){return new hl({check:"string_format",format:"lowercase",...Z(e)})}function Ju(e){return new pl({check:"string_format",format:"uppercase",...Z(e)})}function Zu(e,t){return new ml({check:"string_format",format:"includes",...Z(t),includes:e})}function Xu(e,t){return new gl({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function Qu(e,t){return new vl({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function Ur(e){return new yl({check:"overwrite",tx:e})}function $u(e){return Ur(t=>t.normalize(e))}function ed(){return Ur(e=>e.trim())}function td(){return Ur(e=>e.toLowerCase())}function rd(){return Ur(e=>e.toUpperCase())}function nd(){return Ur(e=>uc(e))}function od(e,t,r){return new e({type:"array",element:t,...Z(r)})}function ad(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}function id(e,t){const r=sd(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Kr(o,n.value,r._zod.def));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(Kr(a))}},e(n.value,n)),t);return r}function sd(e,t){const r=new kt({check:"custom",...Z(t)});return r._zod.check=e,r}function wn(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)??Wr,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,h;var n;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const s=(h=(u=e._zod).toJSONSchema)==null?void 0:h.call(u);if(s)i.schema=s;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const m=i.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,f)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),Fe(d,t,f),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&pt(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 xn(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 h=(i=e.metadataRegistry.get(u[0]))==null?void 0:i.id;if(h){const f=n.get(h);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(h,u[0])}}const o=u=>{var p;const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(p=e.external.registry.get(u[0]))==null?void 0:p.id,g=e.external.uri??(x=>x);if(v)return{ref:g(v)};const b=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=b,{defId:b,ref:`${g("__shared")}#/${h}/${b}`}}if(u[1]===r)return{ref:"#"};const d=`#/${h}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},a=u=>{if(u[1].schema.$ref)return;const h=u[1],{ref:f,defId:d}=o(u);h.def={...h.schema},d&&(h.defId=d);const m=h.schema;for(const p in m)delete m[p];m.$ref=f};if(e.cycles==="throw")for(const u of e.seen.entries()){const h=u[1];if(h.cycle)throw new Error(`Cycle detected: #/${(s=h.cycle)==null?void 0:s.join("/")}/<root>
|
|
63
|
+
`)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(C,y)=>b(f,C,y)};let a;const i=vn,s=!To.jitless,l=s&&uc.value,u=t.catchall;let h;e._zod.parse=(f,d)=>{h??(h=n.value);const m=f.value;return i(m)?s&&l&&(d==null?void 0:d.async)===!1&&d.jitless!==!0?(a||(a=o(t.shape)),f=a(f,d),u?Oi([],m,f,d,h,e):f):r(f,d):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function la(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!Er(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>Qt(i,n,Xt())))}),t)}const Ql=k("$ZodUnion",(e,t)=>{Xe.init(e,t),Oe(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Oe(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Oe(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Oe(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Mo(o.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let a=!1;const i=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(s=>la(s,n,e,o)):la(i,n,e,o)}}),$l=k("$ZodIntersection",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,a=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,l])=>ua(r,c,l)):ua(r,a,i)}});function so(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(Fr(e)&&Fr(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(const a of n){const i=so(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}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 o=e[n],a=t[n],i=so(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ua(e,t,r){const n=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=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 a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),Er(e))return e;const i=so(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 eu=k("$ZodRecord",(e,t)=>{Xe.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Fr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const a=[],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,Xt())),input:l,path:[l],inst:e});continue}const h=u.value,f=t.valueType._zod.run({value:o[l],issues:[]},n);f instanceof Promise?a.push(f.then(d=>{d.issues.length&&r.issues.push(...Pr(l,d.issues)),r.value[h]=d.value})):(f.issues.length&&r.issues.push(...Pr(l,f.issues)),r.value[h]=f.value)}let c;for(const l in o)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,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"&&Ai.test(s)&&c.issues.length){const h=t.keyType._zod.run({value:Number(s),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(c=h)}if(c.issues.length){t.mode==="loose"?r.value[s]=o[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>Qt(h,n,Xt())),input:s,path:[s],inst:e});continue}const u=t.valueType._zod.run({value:o[s],issues:[]},n);u instanceof Promise?a.push(u.then(h=>{h.issues.length&&r.issues.push(...Pr(s,h.issues)),r.value[c.value]=h.value})):(u.issues.length&&r.issues.push(...Pr(s,u.issues)),r.value[c.value]=u.value)}}return a.length?Promise.all(a).then(()=>r):r}}),tu=k("$ZodEnum",(e,t)=>{Xe.init(e,t);const r=gi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>dc.has(typeof o)).map(o=>typeof o=="string"?Mn(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),ru=k("$ZodTransform",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new mi(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Rr;return r.value=o,r.fallback=!0,r}});function da(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Di=k("$ZodOptional",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mo(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=r.value,a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(i=>da(i,o)):da(a,o)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),nu=k("$ZodExactOptional",(e,t)=>{Di.init(e,t),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ou=k("$ZodNullable",(e,t)=>{Xe.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mo(r.source)}|null)$`):void 0}),Oe(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)}),au=k("$ZodDefault",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>fa(a,t)):fa(o,t)}});function fa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const iu=k("$ZodPrefault",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(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)=>{Xe.init(e,t),Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>ha(a,e)):ha(o,e)}});function ha(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 cu=k("$ZodCatch",(e,t)=>{Xe.init(e,t),e._zod.optin="optional",Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>Qt(i,n,Xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Qt(a,n,Xt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Ri=k("$ZodPipe",(e,t)=>{Xe.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>sn(i,t.in,n)):sn(a,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>sn(a,t.out,n)):sn(o,t.out,n)}});function sn(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 lu=k("$ZodPreprocess",(e,t)=>{Ri.init(e,t)}),uu=k("$ZodReadonly",(e,t)=>{Xe.init(e,t),Oe(e._zod,"propValues",()=>t.innerType._zod.propValues),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),Oe(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(pa):pa(o)}});function pa(e){return e.value=Object.freeze(e.value),e}const du=k("$ZodCustom",(e,t)=>{kt.init(e,t),Xe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>ma(a,r,n,e));ma(o,r,n,e)}});function ma(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(qr(o))}}var ga;class fu{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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function hu(){return new fu}(ga=globalThis).__zod_globalRegistry??(ga.__zod_globalRegistry=hu());const Wr=globalThis.__zod_globalRegistry;function pu(e,t){return new e({type:"string",...Z(t)})}function mu(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function gu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function va(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function vu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function bu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function wu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function xu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function ku(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function Cu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function _u(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function Au(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function Su(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function zu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function Tu(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function Eu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function Pu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function Mu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function Ou(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function Du(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function Ru(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function Nu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function Lu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function Iu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function Fu(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function ju(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function Uu(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function Bu(e,t){return new e({type:"number",checks:[],...Z(t)})}function Hu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function Gu(e,t){return new e({type:"boolean",...Z(t)})}function Vu(e){return new e({type:"unknown"})}function Wu(e,t){return new e({type:"never",...Z(t)})}function ya(e,t){return new zi({check:"less_than",...Z(t),value:e,inclusive:!1})}function Jn(e,t){return new zi({check:"less_than",...Z(t),value:e,inclusive:!0})}function ba(e,t){return new Ti({check:"greater_than",...Z(t),value:e,inclusive:!1})}function Zn(e,t){return new Ti({check:"greater_than",...Z(t),value:e,inclusive:!0})}function wa(e,t){return new il({check:"multiple_of",...Z(t),value:e})}function Ni(e,t){return new cl({check:"max_length",...Z(t),maximum:e})}function bn(e,t){return new ll({check:"min_length",...Z(t),minimum:e})}function Li(e,t){return new ul({check:"length_equals",...Z(t),length:e})}function Ku(e,t){return new dl({check:"string_format",format:"regex",...Z(t),pattern:e})}function qu(e){return new fl({check:"string_format",format:"lowercase",...Z(e)})}function Yu(e){return new hl({check:"string_format",format:"uppercase",...Z(e)})}function Ju(e,t){return new pl({check:"string_format",format:"includes",...Z(t),includes:e})}function Zu(e,t){return new ml({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function Xu(e,t){return new gl({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function Ur(e){return new vl({check:"overwrite",tx:e})}function Qu(e){return Ur(t=>t.normalize(e))}function $u(){return Ur(e=>e.trim())}function ed(){return Ur(e=>e.toLowerCase())}function td(){return Ur(e=>e.toUpperCase())}function rd(){return Ur(e=>lc(e))}function nd(e,t,r){return new e({type:"array",element:t,...Z(r)})}function od(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}function ad(e,t){const r=id(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(qr(o,n.value,r._zod.def));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(qr(a))}},e(n.value,n)),t);return r}function id(e,t){const r=new kt({check:"custom",...Z(t)});return r._zod.check=e,r}function wn(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)??Wr,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,h;var n;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const s=(h=(u=e._zod).toJSONSchema)==null?void 0:h.call(u);if(s)i.schema=s;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const m=i.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,f)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),Fe(d,t,f),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&pt(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 xn(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 h=(i=e.metadataRegistry.get(u[0]))==null?void 0:i.id;if(h){const f=n.get(h);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(h,u[0])}}const o=u=>{var p;const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(p=e.external.registry.get(u[0]))==null?void 0:p.id,g=e.external.uri??(x=>x);if(v)return{ref:g(v)};const b=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=b,{defId:b,ref:`${g("__shared")}#/${h}/${b}`}}if(u[1]===r)return{ref:"#"};const d=`#/${h}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},a=u=>{if(u[1].schema.$ref)return;const h=u[1],{ref:f,defId:d}=o(u);h.def={...h.schema},d&&(h.defId=d);const m=h.schema;for(const p in m)delete m[p];m.$ref=f};if(e.cycles==="throw")for(const u of e.seen.entries()){const h=u[1];if(h.cycle)throw new Error(`Cycle detected: #/${(s=h.cycle)==null?void 0:s.join("/")}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const h=u[1];if(t===u[0]){a(u);continue}if(e.external){const d=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&d){a(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){a(u);continue}if(h.cycle){a(u);continue}if(h.count>1&&e.reused==="ref"){a(u);continue}}}function kn(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=h=>{const f=e.seen.get(h);if(f.ref===null)return;const d=f.def??f.schema,m={...d},p=f.ref;if(f.ref=null,p){n(p);const g=e.seen.get(p),b=g.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),h._zod.parent===p)for(const T in d)T==="$ref"||T==="allOf"||T in m||delete d[T];if(b.$ref&&g.def)for(const T in d)T==="$ref"||T==="allOf"||T in g.def&&JSON.stringify(d[T])===JSON.stringify(g.def[T])&&delete d[T]}const v=h._zod.parent;if(v&&v!==p){n(v);const g=e.seen.get(v);if(g!=null&&g.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}e.override({zodSchema:h,jsonSchema:d,path:f.path??[]})};for(const h of[...e.seen.entries()].reverse())n(h[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){const h=(c=e.external.registry.get(t))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(h)}Object.assign(o,r.def??r.schema);const a=(l=e.metadataRegistry.get(t))==null?void 0:l.id;a!==void 0&&o.id===a&&delete o.id;const i=((u=e.external)==null?void 0:u.defs)??{};for(const h of e.seen.entries()){const f=h[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,i[f.defId]=f.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const h=JSON.parse(JSON.stringify(o));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cn(t,"input",e.processors),output:Cn(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function pt(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 pt(n.element,r);if(n.type==="set")return pt(n.valueType,r);if(n.type==="lazy")return pt(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 pt(n.innerType,r);if(n.type==="intersection")return pt(n.left,r)||pt(n.right,r);if(n.type==="record"||n.type==="map")return pt(n.keyType,r)||pt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:pt(n.in,r)||pt(n.out,r);if(n.type==="object"){for(const o in n.shape)if(pt(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(pt(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(pt(o,r))return!0;return!!(n.rest&&pt(n.rest,r))}return!1}const cd=(e,t={})=>r=>{const n=wn({...r,processors:t});return Fe(e,n),xn(n,e),kn(n,e)},Cn=(e,t,r={})=>n=>{const{libraryOptions:o,target:a}=n??{},i=wn({...o??{},target:a,io:t,processors:r});return Fe(e,i),xn(i,e),kn(i,e)},ld={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Fi=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=ld[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},ji=(e,t,r,n)=>{const o=r,{minimum:a,maximum:i,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number";const h=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";h?d?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof a=="number"&&(o.minimum=a),f?d?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},Ui=(e,t,r,n)=>{r.type="boolean"},ud=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},dd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},fd=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},hd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},pd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Bi=(e,t,r,n)=>{r.not={}},md=(e,t,r,n)=>{},Hi=(e,t,r,n)=>{},gd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Gi=(e,t,r,n)=>{const o=e._zod.def,a=vi(o.entries);a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),r.enum=a},vd=(e,t,r,n)=>{const o=e._zod.def,a=[];for(const i of o.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");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){const i=a[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),a.every(i=>typeof i=="boolean")&&(r.type="boolean"),a.every(i=>i===null)&&(r.type="null"),r.enum=a},yd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},bd=(e,t,r,n)=>{const o=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=a.source},wd=(e,t,r,n)=>{const o=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:c}=e._zod.bag;i!==void 0&&(a.minLength=i),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(o,a)):(Object.assign(o,a),o.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(o,a)},xd=(e,t,r,n)=>{r.type="boolean"},Vi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Wi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Cd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},_d=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},qi=(e,t,r,n)=>{const o=r,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=Fe(a.element,t,{...n,path:[...n.path,"items"]})},Ki=(e,t,r,n)=>{var l;const o=r,a=e._zod.def;o.type="object",o.properties={};const i=a.shape;for(const u in i)o.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 h=a.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(o.required=Array.from(c)),((l=a.catchall)==null?void 0:l._zod.def.type)==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=Fe(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Yi=(e,t,r,n)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>Fe(s,t,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=i:r.anyOf=i},Ji=(e,t,r,n)=>{const o=e._zod.def,a=Fe(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=Fe(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];r.allOf=c},Ad=(e,t,r,n)=>{const o=r,a=e._zod.def;o.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=a.items.map((f,d)=>Fe(f,t,{...n,path:[...n.path,i,d]})),l=a.rest?Fe(a.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=c,l&&(o.items=l)):t.target==="openapi-3.0"?(o.items={anyOf:c},l&&o.items.anyOf.push(l),o.minItems=c.length,l||(o.maxItems=c.length)):(o.items=c,l&&(o.additionalItems=l));const{minimum:u,maximum:h}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof h=="number"&&(o.maxItems=h)},Zi=(e,t,r,n)=>{const o=r,a=e._zod.def;o.type="object";const i=a.keyType,s=i._zod.bag,c=s==null?void 0:s.patterns;if(a.mode==="loose"&&c&&c.size>0){const u=Fe(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const h of c)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Fe(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Fe(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const l=i._zod.values;if(l){const u=[...l].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},Xi=(e,t,r,n)=>{const o=e._zod.def,a=Fe(o.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Qi=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},$i=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},es=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},ts=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},rs=(e,t,r,n)=>{const o=e._zod.def,a=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?o.out:o.in:o.out;Fe(i,t,n);const s=t.seen.get(e);s.ref=i},ns=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.readOnly=!0},Sd=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},Lo=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},zd=(e,t,r,n)=>{const o=e._zod.innerType;Fe(o,t,n);const a=t.seen.get(e);a.ref=o},xa={string:Fi,number:ji,boolean:Ui,bigint:ud,symbol:dd,null:fd,undefined:hd,void:pd,never:Bi,any:md,unknown:Hi,date:gd,enum:Gi,literal:vd,nan:yd,template_literal:bd,file:wd,success:xd,custom:Vi,function:kd,transform:Wi,map:Cd,set:_d,array:qi,object:Ki,union:Yi,intersection:Ji,tuple:Ad,record:Zi,nullable:Xi,nonoptional:Qi,default:$i,prefault:es,catch:ts,pipe:rs,readonly:ns,promise:Sd,optional:Lo,lazy:zd};function Sy(e,t){if("_idmap"in e){const n=e,o=wn({...t,processors:xa}),a={};for(const c of n._idmap.entries()){const[l,u]=c;Fe(u,o)}const i={},s={registry:n,uri:t==null?void 0:t.uri,defs:a};o.external=s;for(const c of n._idmap.entries()){const[l,u]=c;xn(o,u),i[l]=kn(o,u)}if(Object.keys(a).length>0){const c=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:a}}return{schemas:i}}const r=wn({...t,processors:xa});return Fe(e,r),xn(r,e),kn(r,e)}const Td=k("ZodISODateTime",(e,t)=>{Ol.init(e,t),Ye.init(e,t)});function Ed(e){return Fu(Td,e)}const Pd=k("ZodISODate",(e,t)=>{Dl.init(e,t),Ye.init(e,t)});function Md(e){return ju(Pd,e)}const Od=k("ZodISOTime",(e,t)=>{Rl.init(e,t),Ye.init(e,t)});function Dd(e){return Uu(Od,e)}const Rd=k("ZodISODuration",(e,t)=>{Nl.init(e,t),Ye.init(e,t)});function Nd(e){return Bu(Rd,e)}const Ld=(e,t)=>{xi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>_c(e,r)},flatten:{value:r=>Cc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,io,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,io,2)}},isEmpty:{get(){return e.issues.length===0}}})},Dt=k("ZodError",Ld,{Parent:Error}),Id=Do(Dt),Fd=Ro(Dt),jd=On(Dt),Ud=Dn(Dt),Bd=zc(Dt),Hd=Tc(Dt),Gd=Ec(Dt),Vd=Pc(Dt),Wd=Mc(Dt),qd=Oc(Dt),Kd=Dc(Dt),Yd=Rc(Dt),ka=new WeakMap;function Xr(e,t,r){const n=Object.getPrototypeOf(e);let o=ka.get(n);if(o||(o=new Set,ka.set(n,o)),!o.has(t)){o.add(t);for(const a in r){const i=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const s=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}const Qe=k("ZodType",(e,t)=>(Xe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cn(e,"input"),output:Cn(e,"output")}}),e.toJSONSchema=cd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Id(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>jd(e,r,n),e.parseAsync=async(r,n)=>Fd(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ud(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Bd(e,r,n),e.decode=(r,n)=>Hd(e,r,n),e.encodeAsync=async(r,n)=>Gd(e,r,n),e.decodeAsync=async(r,n)=>Vd(e,r,n),e.safeEncode=(r,n)=>Wd(e,r,n),e.safeDecode=(r,n)=>qd(e,r,n),e.safeEncodeAsync=async(r,n)=>Kd(e,r,n),e.safeDecodeAsync=async(r,n)=>Yd(e,r,n),Xr(e,"ZodType",{check(...r){const n=this.def;return this.clone(ur(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return dr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(jf(r,n))},superRefine(r,n){return this.check(Uf(r,n))},overwrite(r){return this.check(Ur(r))},optional(){return za(this)},exactOptional(){return Sf(this)},nullable(){return Ta(this)},nullish(){return za(Ta(this))},nonoptional(r){return Of(this,r)},array(){return Ke(this)},or(r){return xf([this,r])},and(r){return Cf(this,r)},transform(r){return Ea(this,ss(r))},default(r){return Ef(this,r)},prefault(r){return Mf(this,r)},catch(r){return Rf(this,r)},pipe(r){return Ea(this,r)},readonly(){return If(this)},describe(r){const n=this.clone();return Wr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Wr.get(this);const n=this.clone();return Wr.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=Wr.get(e))==null?void 0:r.description},configurable:!0}),e)),os=k("_ZodString",(e,t)=>{No.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>Fi(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Xr(e,"_ZodString",{regex(...n){return this.check(Ku(...n))},includes(...n){return this.check(Zu(...n))},startsWith(...n){return this.check(Xu(...n))},endsWith(...n){return this.check(Qu(...n))},min(...n){return this.check(bn(...n))},max(...n){return this.check(Li(...n))},length(...n){return this.check(Ii(...n))},nonempty(...n){return this.check(bn(1,...n))},lowercase(n){return this.check(Yu(n))},uppercase(n){return this.check(Ju(n))},trim(){return this.check(ed())},normalize(...n){return this.check($u(...n))},toLowerCase(){return this.check(td())},toUpperCase(){return this.check(rd())},slugify(){return this.check(nd())}})}),as=k("ZodString",(e,t)=>{No.init(e,t),os.init(e,t),e.email=r=>e.check(vu(Jd,r)),e.url=r=>e.check(ku(Zd,r)),e.jwt=r=>e.check(Iu(ff,r)),e.emoji=r=>e.check(Cu(Xd,r)),e.guid=r=>e.check(va(Ca,r)),e.uuid=r=>e.check(yu(cn,r)),e.uuidv4=r=>e.check(bu(cn,r)),e.uuidv6=r=>e.check(wu(cn,r)),e.uuidv7=r=>e.check(xu(cn,r)),e.nanoid=r=>e.check(_u(Qd,r)),e.guid=r=>e.check(va(Ca,r)),e.cuid=r=>e.check(Au($d,r)),e.cuid2=r=>e.check(Su(ef,r)),e.ulid=r=>e.check(zu(tf,r)),e.base64=r=>e.check(Ru(lf,r)),e.base64url=r=>e.check(Nu(uf,r)),e.xid=r=>e.check(Tu(rf,r)),e.ksuid=r=>e.check(Eu(nf,r)),e.ipv4=r=>e.check(Pu(of,r)),e.ipv6=r=>e.check(Mu(af,r)),e.cidrv4=r=>e.check(Ou(sf,r)),e.cidrv6=r=>e.check(Du(cf,r)),e.e164=r=>e.check(Lu(df,r)),e.datetime=r=>e.check(Ed(r)),e.date=r=>e.check(Md(r)),e.time=r=>e.check(Dd(r)),e.duration=r=>e.check(Nd(r))});function W(e){return mu(as,e)}const Ye=k("ZodStringFormat",(e,t)=>{Ge.init(e,t),os.init(e,t)}),Jd=k("ZodEmail",(e,t)=>{Cl.init(e,t),Ye.init(e,t)}),Ca=k("ZodGUID",(e,t)=>{xl.init(e,t),Ye.init(e,t)}),cn=k("ZodUUID",(e,t)=>{kl.init(e,t),Ye.init(e,t)}),Zd=k("ZodURL",(e,t)=>{_l.init(e,t),Ye.init(e,t)}),Xd=k("ZodEmoji",(e,t)=>{Al.init(e,t),Ye.init(e,t)}),Qd=k("ZodNanoID",(e,t)=>{Sl.init(e,t),Ye.init(e,t)}),$d=k("ZodCUID",(e,t)=>{zl.init(e,t),Ye.init(e,t)}),ef=k("ZodCUID2",(e,t)=>{Tl.init(e,t),Ye.init(e,t)}),tf=k("ZodULID",(e,t)=>{El.init(e,t),Ye.init(e,t)}),rf=k("ZodXID",(e,t)=>{Pl.init(e,t),Ye.init(e,t)}),nf=k("ZodKSUID",(e,t)=>{Ml.init(e,t),Ye.init(e,t)}),of=k("ZodIPv4",(e,t)=>{Ll.init(e,t),Ye.init(e,t)}),af=k("ZodIPv6",(e,t)=>{Il.init(e,t),Ye.init(e,t)}),sf=k("ZodCIDRv4",(e,t)=>{Fl.init(e,t),Ye.init(e,t)}),cf=k("ZodCIDRv6",(e,t)=>{jl.init(e,t),Ye.init(e,t)}),lf=k("ZodBase64",(e,t)=>{Ul.init(e,t),Ye.init(e,t)}),uf=k("ZodBase64URL",(e,t)=>{Hl.init(e,t),Ye.init(e,t)}),df=k("ZodE164",(e,t)=>{Gl.init(e,t),Ye.init(e,t)}),ff=k("ZodJWT",(e,t)=>{Wl.init(e,t),Ye.init(e,t)}),is=k("ZodNumber",(e,t)=>{Mi.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>ji(e,n,o),Xr(e,"ZodNumber",{gt(n,o){return this.check(ba(n,o))},gte(n,o){return this.check(Zn(n,o))},min(n,o){return this.check(Zn(n,o))},lt(n,o){return this.check(ya(n,o))},lte(n,o){return this.check(Jn(n,o))},max(n,o){return this.check(Jn(n,o))},int(n){return this.check(_a(n))},safe(n){return this.check(_a(n))},positive(n){return this.check(ba(0,n))},nonnegative(n){return this.check(Zn(0,n))},negative(n){return this.check(ya(0,n))},nonpositive(n){return this.check(Jn(0,n))},multipleOf(n,o){return this.check(wa(n,o))},step(n,o){return this.check(wa(n,o))},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 F(e){return Hu(is,e)}const hf=k("ZodNumberFormat",(e,t)=>{ql.init(e,t),is.init(e,t)});function _a(e){return Gu(hf,e)}const pf=k("ZodBoolean",(e,t)=>{Kl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ui(e,r,n)});function rt(e){return Vu(pf,e)}const mf=k("ZodUnknown",(e,t)=>{Yl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hi()});function co(){return Wu(mf)}const gf=k("ZodNever",(e,t)=>{Jl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi(e,r,n)});function vf(e){return qu(gf,e)}const yf=k("ZodArray",(e,t)=>{Zl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o),e.element=t.element,Xr(e,"ZodArray",{min(r,n){return this.check(bn(r,n))},nonempty(r){return this.check(bn(1,r))},max(r,n){return this.check(Li(r,n))},length(r,n){return this.check(Ii(r,n))},unwrap(){return this.element}})});function Ke(e,t){return od(yf,e,t)}const bf=k("ZodObject",(e,t)=>{Ql.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),Oe(e,"shape",()=>t.shape),Xr(e,"ZodObject",{keyof(){return ke(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:co()})},loose(){return this.clone({...this._zod.def,catchall:co()})},strict(){return this.clone({...this._zod.def,catchall:vf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return vc(this,r)},safeExtend(r){return yc(this,r)},merge(r){return bc(this,r)},pick(r){return mc(this,r)},omit(r){return gc(this,r)},partial(...r){return wc(cs,this,r[0])},required(...r){return xc(ls,this,r[0])}})});function M(e,t){const r={type:"object",shape:e??{},...Z(t)};return new bf(r)}const wf=k("ZodUnion",(e,t)=>{$l.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o),e.options=t.options});function xf(e,t){return new wf({type:"union",options:e,...Z(t)})}const kf=k("ZodIntersection",(e,t)=>{eu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o)});function Cf(e,t){return new kf({type:"intersection",left:e,right:t})}const Aa=k("ZodRecord",(e,t)=>{tu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zi(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Sa(e,t,r){return!t||!t._zod?new Aa({type:"record",keyType:W(),valueType:e,...Z(t)}):new Aa({type:"record",keyType:e,valueType:t,...Z(r)})}const lo=k("ZodEnum",(e,t)=>{ru.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>Gi(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const a={};for(const i of n)if(r.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new lo({...t,checks:[],...Z(o),entries:a})},e.exclude=(n,o)=>{const a={...t.entries};for(const i of n)if(r.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new lo({...t,checks:[],...Z(o),entries:a})}});function ke(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new lo({type:"enum",entries:r,...Z(t)})}const _f=k("ZodTransform",(e,t)=>{nu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gi(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Kr(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Kr(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function ss(e){return new _f({type:"transform",transform:e})}const cs=k("ZodOptional",(e,t)=>{Ri.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function za(e){return new cs({type:"optional",innerType:e})}const Af=k("ZodExactOptional",(e,t)=>{ou.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Sf(e){return new Af({type:"optional",innerType:e})}const zf=k("ZodNullable",(e,t)=>{au.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ta(e){return new zf({type:"nullable",innerType:e})}const Tf=k("ZodDefault",(e,t)=>{iu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ef(e,t){return new Tf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():bi(t)}})}const Pf=k("ZodPrefault",(e,t)=>{su.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Mf(e,t){return new Pf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():bi(t)}})}const ls=k("ZodNonOptional",(e,t)=>{cu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Of(e,t){return new ls({type:"nonoptional",innerType:e,...Z(t)})}const Df=k("ZodCatch",(e,t)=>{lu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rf(e,t){return new Df({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const us=k("ZodPipe",(e,t)=>{Ni.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o),e.in=t.in,e.out=t.out});function Ea(e,t){return new us({type:"pipe",in:e,out:t})}const Nf=k("ZodPreprocess",(e,t)=>{us.init(e,t),uu.init(e,t)}),Lf=k("ZodReadonly",(e,t)=>{du.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ns(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function If(e){return new Lf({type:"readonly",innerType:e})}const Ff=k("ZodCustom",(e,t)=>{fu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r)});function jf(e,t={}){return ad(Ff,e,t)}function Uf(e,t){return id(e,t)}function Bf(e,t){return new Nf({type:"pipe",in:ss(e),out:t})}function Hf(e){return gu(as,e)}const Pa=M({x:F().int().min(0).describe("Column offset, 0-based"),y:F().int().min(0).describe("Row offset, 0-based"),w:F().int().min(1).describe("Width in grid columns"),h:F().int().min(1).describe("Height in grid rows")}),Gf=M({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:Pa,layouts:Sa(W(),Pa).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:Sa(W(),co()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),Vf=M({type:ke(["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:F().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:F().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:F().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:F().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."),Wf=M({accentHue:F().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:F().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:F().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:F().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."),qf=M({fontFamily:ke(["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:ke(["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:F().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."),Kf={sans:'"DM Sans", sans-serif',mono:'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace',serif:'ui-serif, Georgia, "Times New Roman", serif'},Yf={proportional:"normal",tabular:"tabular-nums"},Jf=M({radius:F().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:F().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:F().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:F().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:F().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)."),Zf=Bf(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:o,...a}=r;t={...t,grid:a,appearance:{radius:o,...t.appearance??{}}}}const n=t.background;return n&&typeof n=="object"&&n.type==="gradient"&&!("gradientFrom"in n)&&(t={...t,background:{...n,type:"none"}}),t},M({version:Hf().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:M({mode:ke(["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:F().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:F().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:F().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:F().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.")}).default({mode:"flow-vertical",columns:12,rowHeight:96,rows:6,gap:12}),background:Vf.default({type:"none",color:"#0a0a12",gradientFrom:"#1b1e4d",gradientTo:"#07070c",gradientAngle:160,scale:1,dpi:1.5,opacity:.16}),theme:Wf.default({accentHue:242,accentSat:90,baseHue:233,baseSat:20,upColor:"#3fd08f",downColor:"#ff6b81"}),typography:qf.default({fontFamily:"sans",numericStyle:"proportional",scale:1}),appearance:Jf.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:Ke(Gf)})),zy=[{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"}],Xf=[{key:"aurora",label:"Aurora",description:"The signature zframes scene — a slow indigo aurora drifting over near-black. The default backdrop.",projectId:"YrTzGatwjK7EoFpCSfgZ",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%)"}],Qf=242;function $f(e){const t=Xf.find(r=>r.projectId===e);return t?t.baseHue:Qf}const ds=z.createContext(null),fs=z.createContext([]);function eh({providers:e,children:t}){const r=Array.isArray(e)?e:[e];return w.jsx(fs.Provider,{value:r,children:t})}function Nn(){return z.useContext(fs)}function de(e){return Nn().find(r=>r.capabilities.includes(e))??null}function he(e,t,r,n){const[o,a]=z.useState(t),[i,s]=z.useState(!0),c=z.useContext(ds);return z.useEffect(()=>{if(!e){s(!1);return}let l=!1;a(t),s(!0);const u=()=>{c&&!c.visibleRef.current||e().then(m=>{l||(a(m),s(!1))}).catch(()=>{l||s(!1)})};u();let h;const f=()=>{h=setTimeout(()=>{u(),f()},n*(.85+Math.random()*.3))};f();const d=c==null?void 0:c.subscribe(m=>{m&&!l&&u()});return()=>{l=!0,clearTimeout(h),d==null||d()}},r),{data:o,isLoading:i}}function th(e){const t=de("quote-stream"),[r,n]=z.useState({}),[o,a]=z.useState(!0),i=e.join(",");return z.useEffect(()=>{const s=i.split(",").filter(Boolean);if(n({}),!(t!=null&&t.subscribeMids)||s.length===0){a(!1);return}let c=!1,l=!1;a(!0);const u=setTimeout(()=>{!c&&!l&&a(!1)},8e3),h=t.subscribeMids(f=>{c||(l=!0,clearTimeout(u),a(!1),n(d=>{let m=!1;const p={};for(const v of s){const g=f[v];g!==void 0&&(p[v]=g,g!==d[v]&&(m=!0))}return Object.keys(d).length!==Object.keys(p).length&&(m=!0),m?p:d}))},s);return()=>{c=!0,clearTimeout(u),h()}},[t,i]),{mids:r,isLoading:o}}function Ty(e){return th(e).mids}function rh(e,t=3e4){const r=de("day-stats"),n=e?[...e].sort().join(","):"*",o=n==="*"?void 0:n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getDayStats?()=>r.getDayStats(o):null,{},[r,n,t],t);return{stats:a,isLoading:i}}function Ma(e,t=3e4){return rh(e,t).stats}function Ey(e,t,r=5*6e4){const n=de("funding-history"),o=e.join(","),a=o.split(",").filter(Boolean),{data:i,isLoading:s}=he(n!=null&&n.getFundingHistory&&a.length>0?()=>n.getFundingHistory(a,t):null,{},[n,o,t,r],r);return{history:i,isLoading:s}}function Py(e,t,r,n=6e4){const o=de("ohlcv"),{data:a,isLoading:i}=he(o!=null&&o.getCandles&&e?()=>o.getCandles(e,t,r):null,[],[o,e,t,r,n],n);return{candles:a,isLoading:i}}function My(e,t,r,n=6e4){const o=de("ohlcv"),a=e.join(","),i=a.split(",").filter(Boolean),{data:s,isLoading:c}=he(o!=null&&o.getCandles&&i.length>0?async()=>{const l=await Promise.all(i.map(u=>o.getCandles(u,t,r).then(h=>[u,h]).catch(()=>[u,[]])));return Object.fromEntries(l)}:null,{},[o,a,t,r,n],n);return{candles:s,isLoading:c}}function Oy(e=10*6e4){const t=de("tvl"),{data:r,isLoading:n}=he(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:r,isLoading:n}}function Dy(e=10*6e4){const t=de("dex-volume"),{data:r,isLoading:n}=he(t!=null&&t.getDexVolume?()=>t.getDexVolume():null,[],[t,e],e);return{entries:r,isLoading:n}}function Ry(e,t=5*6e4){const r=de("dex-volume"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getDexVolumeHistory&&o.length>0?()=>r.getDexVolumeHistory(o):null,{},[r,n,t],t);return{history:a,isLoading:i}}function Ny(e=10*6e4){const t=de("protocol-tvl"),{data:r,isLoading:n}=he(t!=null&&t.getProtocolTvl?()=>t.getProtocolTvl():null,[],[t,e],e);return{entries:r,isLoading:n}}function Ly(e,t=5*6e4){const r=de("protocol-tvl"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getProtocolTvlHistory&&o.length>0?()=>r.getProtocolTvlHistory(o):null,{},[r,n,t],t);return{history:a,isLoading:i}}function Iy(e=10*6e4){const t=de("protocol-fees"),{data:r,isLoading:n}=he(t!=null&&t.getProtocolFees?()=>t.getProtocolFees():null,[],[t,e],e);return{entries:r,isLoading:n}}function Fy(e=10*6e4){const t=de("coin-markets"),{data:r,isLoading:n}=he(t!=null&&t.getCoinMarkets?()=>t.getCoinMarkets():null,[],[t,e],e);return{entries:r,isLoading:n}}function jy(e=300,t=15*6e4){const r=de("coin-movers"),{data:n,isLoading:o}=he(r!=null&&r.getCoinMovers?()=>r.getCoinMovers(e):null,[],[r,e,t],t);return{entries:n,isLoading:o}}function Uy(e,t=3e4){const r=de("open-interest"),n=e?[...e].sort().join(","):"*",o=n==="*"?void 0:n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getOpenInterest?()=>r.getOpenInterest(o):null,[],[r,n,t],t);return{entries:a,isLoading:i}}function By(e=15*6e4){const t=de("global-market"),{data:r,isLoading:n}=he(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:r,isLoading:n}}function Hy(e=30,t=60*6e4){const r=de("sentiment"),{data:n,isLoading:o}=he(r!=null&&r.getFearGreed?()=>r.getFearGreed(e):null,[],[r,e,t],t);return{points:n,isLoading:o}}function Gy(e=15*6e4){const t=de("reference-rates"),{data:r,isLoading:n}=he(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function Vy(e,t,r=60*6e4){const n=de("fx-rates"),o=t.join(","),{data:a,isLoading:i}=he(n!=null&&n.getFxRates?()=>n.getFxRates(e,[...t]):null,[],[n,e,o,r],r);return{rates:a,isLoading:i}}function Wy(e=360*6e4){const t=de("treasury-rates"),{data:r,isLoading:n}=he(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function qy(e=360*6e4){const t=de("yield-curve"),{data:r,isLoading:n}=he(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:r,isLoading:n}}function Ky(e=8,t=360*6e4){const r=de("treasury-auctions"),{data:n,isLoading:o}=he(r!=null&&r.getTreasuryAuctions?()=>r.getTreasuryAuctions(e):null,[],[r,e,t],t);return{auctions:n,isLoading:o}}function Yy(e=180,t=360*6e4){const r=de("national-debt"),{data:n,isLoading:o}=he(r!=null&&r.getNationalDebt?()=>r.getNationalDebt(e):null,null,[r,e,t],t);return{debt:n,isLoading:o}}function Jy(e=360*6e4){const t=de("financial-stress"),{data:r,isLoading:n}=he(t!=null&&t.getFinancialStress?()=>t.getFinancialStress():null,null,[t,e],e);return{stress:r,isLoading:n}}function Zy(e,t,r,n=720*6e4){const o=de("macro-series"),{data:a,isLoading:i}=he(o!=null&&o.getMacroSeries&&e?()=>o.getMacroSeries(e,t,r):null,null,[o,e,t,r,n],n);return{series:a,isLoading:i}}function Xy(e,t=30*6e4){const r=de("filings"),{data:n,isLoading:o}=he(r!=null&&r.getCompanyFilings&&e?()=>r.getCompanyFilings(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function Qy(e,t=720*6e4){const r=de("fundamentals"),{data:n,isLoading:o}=he(r!=null&&r.getCompanyFacts&&e?()=>r.getCompanyFacts(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function $y(e,t=360*6e4){const r=de("short-volume"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getShortVolume&&o.length>0?()=>r.getShortVolume(o):null,{},[r,n,t],t);return{data:a,isLoading:i}}function eb(e,t,r,n=5*6e4){const o=de("news"),a=t?t.join(","):"",{data:i,isLoading:s}=he(o!=null&&o.getNews&&e?()=>o.getNews({feed:e,symbols:a?a.split(","):void 0,limit:r}):null,[],[o,e,a,r,n],n);return{items:i,isLoading:s}}function tb(e=3e4){const t=de("btc-fees"),{data:r,isLoading:n}=he(t!=null&&t.getBtcFees?()=>t.getBtcFees():null,null,[t,e],e);return{fees:r,isLoading:n}}function rb(e=15e3){const t=de("btc-mempool"),{data:r,isLoading:n}=he(t!=null&&t.getMempoolState?()=>t.getMempoolState():null,null,[t,e],e);return{state:r,isLoading:n}}function nb(e=8,t=3e4){const r=de("btc-blocks"),{data:n,isLoading:o}=he(r!=null&&r.getBtcBlocks?()=>r.getBtcBlocks(e):null,[],[r,e,t],t);return{blocks:n,isLoading:o}}function ob(e="1y",t=30*6e4){const r=de("btc-hashrate"),{data:n,isLoading:o}=he(r!=null&&r.getNetworkHashrate?()=>r.getNetworkHashrate(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function ab(e=6e4){const t=de("btc-difficulty"),{data:r,isLoading:n}=he(t!=null&&t.getDifficultyAdjustment?()=>t.getDifficultyAdjustment():null,null,[t,e],e);return{adjustment:r,isLoading:n}}function ib(e="1w",t=5*6e4){const r=de("mining-pools"),{data:n,isLoading:o}=he(r!=null&&r.getMiningPools?()=>r.getMiningPools(e):null,null,[r,e,t],t);return{pools:n,isLoading:o}}function sb(e=30*6e4){const t=de("lightning-stats"),{data:r,isLoading:n}=he(t!=null&&t.getLightningStats?()=>t.getLightningStats():null,null,[t,e],e);return{stats:r,isLoading:n}}function cb(e,t=5*6e4){const r=de("options-summary"),n=(e||"BTC").toUpperCase(),{data:o,isLoading:a}=he(r!=null&&r.getOptionsSummary?()=>r.getOptionsSummary(n):null,null,[r,n,t],t);return{summary:o,isLoading:a}}function lb(e,t=6e4){const r=Nn(),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,o=e?`${e.kind}:${e.address??""}`:"",{data:a,isLoading:i}=he(n&&e?()=>n.getPortfolio(e):null,null,[n,o,t],t);return{portfolio:a,isLoading:i}}function ub(e,t,r=43200,n=10*6e4){const o=de("volatility-index"),a=(e||"BTC").toUpperCase(),{data:i,isLoading:s}=he(o!=null&&o.getVolatilityIndex?()=>o.getVolatilityIndex(a,t,r):null,[],[o,a,t,r,n],n);return{points:i,isLoading:s}}const nh=z.createContext(null);function db(){return z.useContext(nh)}const oh=`
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const h=u[1];if(t===u[0]){a(u);continue}if(e.external){const d=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&d){a(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){a(u);continue}if(h.cycle){a(u);continue}if(h.count>1&&e.reused==="ref"){a(u);continue}}}function kn(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=h=>{const f=e.seen.get(h);if(f.ref===null)return;const d=f.def??f.schema,m={...d},p=f.ref;if(f.ref=null,p){n(p);const g=e.seen.get(p),b=g.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),h._zod.parent===p)for(const T in d)T==="$ref"||T==="allOf"||T in m||delete d[T];if(b.$ref&&g.def)for(const T in d)T==="$ref"||T==="allOf"||T in g.def&&JSON.stringify(d[T])===JSON.stringify(g.def[T])&&delete d[T]}const v=h._zod.parent;if(v&&v!==p){n(v);const g=e.seen.get(v);if(g!=null&&g.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}e.override({zodSchema:h,jsonSchema:d,path:f.path??[]})};for(const h of[...e.seen.entries()].reverse())n(h[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){const h=(c=e.external.registry.get(t))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(h)}Object.assign(o,r.def??r.schema);const a=(l=e.metadataRegistry.get(t))==null?void 0:l.id;a!==void 0&&o.id===a&&delete o.id;const i=((u=e.external)==null?void 0:u.defs)??{};for(const h of e.seen.entries()){const f=h[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,i[f.defId]=f.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const h=JSON.parse(JSON.stringify(o));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cn(t,"input",e.processors),output:Cn(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function pt(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 pt(n.element,r);if(n.type==="set")return pt(n.valueType,r);if(n.type==="lazy")return pt(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 pt(n.innerType,r);if(n.type==="intersection")return pt(n.left,r)||pt(n.right,r);if(n.type==="record"||n.type==="map")return pt(n.keyType,r)||pt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:pt(n.in,r)||pt(n.out,r);if(n.type==="object"){for(const o in n.shape)if(pt(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(pt(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(pt(o,r))return!0;return!!(n.rest&&pt(n.rest,r))}return!1}const sd=(e,t={})=>r=>{const n=wn({...r,processors:t});return Fe(e,n),xn(n,e),kn(n,e)},Cn=(e,t,r={})=>n=>{const{libraryOptions:o,target:a}=n??{},i=wn({...o??{},target:a,io:t,processors:r});return Fe(e,i),xn(i,e),kn(i,e)},cd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ii=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=cd[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Fi=(e,t,r,n)=>{const o=r,{minimum:a,maximum:i,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number";const h=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";h?d?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof a=="number"&&(o.minimum=a),f?d?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},ji=(e,t,r,n)=>{r.type="boolean"},ld=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ud=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},dd=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},fd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Ui=(e,t,r,n)=>{r.not={}},pd=(e,t,r,n)=>{},Bi=(e,t,r,n)=>{},md=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Hi=(e,t,r,n)=>{const o=e._zod.def,a=gi(o.entries);a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),r.enum=a},gd=(e,t,r,n)=>{const o=e._zod.def,a=[];for(const i of o.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");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){const i=a[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),a.every(i=>typeof i=="boolean")&&(r.type="boolean"),a.every(i=>i===null)&&(r.type="null"),r.enum=a},vd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yd=(e,t,r,n)=>{const o=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=a.source},bd=(e,t,r,n)=>{const o=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:c}=e._zod.bag;i!==void 0&&(a.minLength=i),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(o,a)):(Object.assign(o,a),o.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(o,a)},wd=(e,t,r,n)=>{r.type="boolean"},Gi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},xd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Vi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Cd=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Wi=(e,t,r,n)=>{const o=r,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=Fe(a.element,t,{...n,path:[...n.path,"items"]})},Ki=(e,t,r,n)=>{var l;const o=r,a=e._zod.def;o.type="object",o.properties={};const i=a.shape;for(const u in i)o.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 h=a.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(o.required=Array.from(c)),((l=a.catchall)==null?void 0:l._zod.def.type)==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=Fe(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},qi=(e,t,r,n)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>Fe(s,t,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=i:r.anyOf=i},Yi=(e,t,r,n)=>{const o=e._zod.def,a=Fe(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=Fe(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];r.allOf=c},_d=(e,t,r,n)=>{const o=r,a=e._zod.def;o.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=a.items.map((f,d)=>Fe(f,t,{...n,path:[...n.path,i,d]})),l=a.rest?Fe(a.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=c,l&&(o.items=l)):t.target==="openapi-3.0"?(o.items={anyOf:c},l&&o.items.anyOf.push(l),o.minItems=c.length,l||(o.maxItems=c.length)):(o.items=c,l&&(o.additionalItems=l));const{minimum:u,maximum:h}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof h=="number"&&(o.maxItems=h)},Ji=(e,t,r,n)=>{const o=r,a=e._zod.def;o.type="object";const i=a.keyType,s=i._zod.bag,c=s==null?void 0:s.patterns;if(a.mode==="loose"&&c&&c.size>0){const u=Fe(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const h of c)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Fe(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Fe(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const l=i._zod.values;if(l){const u=[...l].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},Zi=(e,t,r,n)=>{const o=e._zod.def,a=Fe(o.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Xi=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},Qi=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},$i=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},es=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},ts=(e,t,r,n)=>{const o=e._zod.def,a=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?o.out:o.in:o.out;Fe(i,t,n);const s=t.seen.get(e);s.ref=i},rs=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.readOnly=!0},Ad=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},Lo=(e,t,r,n)=>{const o=e._zod.def;Fe(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},Sd=(e,t,r,n)=>{const o=e._zod.innerType;Fe(o,t,n);const a=t.seen.get(e);a.ref=o},xa={string:Ii,number:Fi,boolean:ji,bigint:ld,symbol:ud,null:dd,undefined:fd,void:hd,never:Ui,any:pd,unknown:Bi,date:md,enum:Hi,literal:gd,nan:vd,template_literal:yd,file:bd,success:wd,custom:Gi,function:xd,transform:Vi,map:kd,set:Cd,array:Wi,object:Ki,union:qi,intersection:Yi,tuple:_d,record:Ji,nullable:Zi,nonoptional:Xi,default:Qi,prefault:$i,catch:es,pipe:ts,readonly:rs,promise:Ad,optional:Lo,lazy:Sd};function Py(e,t){if("_idmap"in e){const n=e,o=wn({...t,processors:xa}),a={};for(const c of n._idmap.entries()){const[l,u]=c;Fe(u,o)}const i={},s={registry:n,uri:t==null?void 0:t.uri,defs:a};o.external=s;for(const c of n._idmap.entries()){const[l,u]=c;xn(o,u),i[l]=kn(o,u)}if(Object.keys(a).length>0){const c=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:a}}return{schemas:i}}const r=wn({...t,processors:xa});return Fe(e,r),xn(r,e),kn(r,e)}const zd=k("ZodISODateTime",(e,t)=>{Ml.init(e,t),Ye.init(e,t)});function Td(e){return Iu(zd,e)}const Ed=k("ZodISODate",(e,t)=>{Ol.init(e,t),Ye.init(e,t)});function Pd(e){return Fu(Ed,e)}const Md=k("ZodISOTime",(e,t)=>{Dl.init(e,t),Ye.init(e,t)});function Od(e){return ju(Md,e)}const Dd=k("ZodISODuration",(e,t)=>{Rl.init(e,t),Ye.init(e,t)});function Rd(e){return Uu(Dd,e)}const Nd=(e,t)=>{wi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Cc(e,r)},flatten:{value:r=>kc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,io,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,io,2)}},isEmpty:{get(){return e.issues.length===0}}})},Dt=k("ZodError",Nd,{Parent:Error}),Ld=Do(Dt),Id=Ro(Dt),Fd=On(Dt),jd=Dn(Dt),Ud=Sc(Dt),Bd=zc(Dt),Hd=Tc(Dt),Gd=Ec(Dt),Vd=Pc(Dt),Wd=Mc(Dt),Kd=Oc(Dt),qd=Dc(Dt),ka=new WeakMap;function Xr(e,t,r){const n=Object.getPrototypeOf(e);let o=ka.get(n);if(o||(o=new Set,ka.set(n,o)),!o.has(t)){o.add(t);for(const a in r){const i=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const s=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}const Qe=k("ZodType",(e,t)=>(Xe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cn(e,"input"),output:Cn(e,"output")}}),e.toJSONSchema=sd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Ld(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Fd(e,r,n),e.parseAsync=async(r,n)=>Id(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>jd(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ud(e,r,n),e.decode=(r,n)=>Bd(e,r,n),e.encodeAsync=async(r,n)=>Hd(e,r,n),e.decodeAsync=async(r,n)=>Gd(e,r,n),e.safeEncode=(r,n)=>Vd(e,r,n),e.safeDecode=(r,n)=>Wd(e,r,n),e.safeEncodeAsync=async(r,n)=>Kd(e,r,n),e.safeDecodeAsync=async(r,n)=>qd(e,r,n),Xr(e,"ZodType",{check(...r){const n=this.def;return this.clone(ur(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return dr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Ff(r,n))},superRefine(r,n){return this.check(jf(r,n))},overwrite(r){return this.check(Ur(r))},optional(){return za(this)},exactOptional(){return Af(this)},nullable(){return Ta(this)},nullish(){return za(Ta(this))},nonoptional(r){return Mf(this,r)},array(){return qe(this)},or(r){return wf([this,r])},and(r){return kf(this,r)},transform(r){return Ea(this,is(r))},default(r){return Tf(this,r)},prefault(r){return Pf(this,r)},catch(r){return Df(this,r)},pipe(r){return Ea(this,r)},readonly(){return Lf(this)},describe(r){const n=this.clone();return Wr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Wr.get(this);const n=this.clone();return Wr.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=Wr.get(e))==null?void 0:r.description},configurable:!0}),e)),ns=k("_ZodString",(e,t)=>{No.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>Ii(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Xr(e,"_ZodString",{regex(...n){return this.check(Ku(...n))},includes(...n){return this.check(Ju(...n))},startsWith(...n){return this.check(Zu(...n))},endsWith(...n){return this.check(Xu(...n))},min(...n){return this.check(bn(...n))},max(...n){return this.check(Ni(...n))},length(...n){return this.check(Li(...n))},nonempty(...n){return this.check(bn(1,...n))},lowercase(n){return this.check(qu(n))},uppercase(n){return this.check(Yu(n))},trim(){return this.check($u())},normalize(...n){return this.check(Qu(...n))},toLowerCase(){return this.check(ed())},toUpperCase(){return this.check(td())},slugify(){return this.check(rd())}})}),os=k("ZodString",(e,t)=>{No.init(e,t),ns.init(e,t),e.email=r=>e.check(gu(Yd,r)),e.url=r=>e.check(xu(Jd,r)),e.jwt=r=>e.check(Lu(df,r)),e.emoji=r=>e.check(ku(Zd,r)),e.guid=r=>e.check(va(Ca,r)),e.uuid=r=>e.check(vu(cn,r)),e.uuidv4=r=>e.check(yu(cn,r)),e.uuidv6=r=>e.check(bu(cn,r)),e.uuidv7=r=>e.check(wu(cn,r)),e.nanoid=r=>e.check(Cu(Xd,r)),e.guid=r=>e.check(va(Ca,r)),e.cuid=r=>e.check(_u(Qd,r)),e.cuid2=r=>e.check(Au($d,r)),e.ulid=r=>e.check(Su(ef,r)),e.base64=r=>e.check(Du(cf,r)),e.base64url=r=>e.check(Ru(lf,r)),e.xid=r=>e.check(zu(tf,r)),e.ksuid=r=>e.check(Tu(rf,r)),e.ipv4=r=>e.check(Eu(nf,r)),e.ipv6=r=>e.check(Pu(of,r)),e.cidrv4=r=>e.check(Mu(af,r)),e.cidrv6=r=>e.check(Ou(sf,r)),e.e164=r=>e.check(Nu(uf,r)),e.datetime=r=>e.check(Td(r)),e.date=r=>e.check(Pd(r)),e.time=r=>e.check(Od(r)),e.duration=r=>e.check(Rd(r))});function W(e){return pu(os,e)}const Ye=k("ZodStringFormat",(e,t)=>{Ge.init(e,t),ns.init(e,t)}),Yd=k("ZodEmail",(e,t)=>{kl.init(e,t),Ye.init(e,t)}),Ca=k("ZodGUID",(e,t)=>{wl.init(e,t),Ye.init(e,t)}),cn=k("ZodUUID",(e,t)=>{xl.init(e,t),Ye.init(e,t)}),Jd=k("ZodURL",(e,t)=>{Cl.init(e,t),Ye.init(e,t)}),Zd=k("ZodEmoji",(e,t)=>{_l.init(e,t),Ye.init(e,t)}),Xd=k("ZodNanoID",(e,t)=>{Al.init(e,t),Ye.init(e,t)}),Qd=k("ZodCUID",(e,t)=>{Sl.init(e,t),Ye.init(e,t)}),$d=k("ZodCUID2",(e,t)=>{zl.init(e,t),Ye.init(e,t)}),ef=k("ZodULID",(e,t)=>{Tl.init(e,t),Ye.init(e,t)}),tf=k("ZodXID",(e,t)=>{El.init(e,t),Ye.init(e,t)}),rf=k("ZodKSUID",(e,t)=>{Pl.init(e,t),Ye.init(e,t)}),nf=k("ZodIPv4",(e,t)=>{Nl.init(e,t),Ye.init(e,t)}),of=k("ZodIPv6",(e,t)=>{Ll.init(e,t),Ye.init(e,t)}),af=k("ZodCIDRv4",(e,t)=>{Il.init(e,t),Ye.init(e,t)}),sf=k("ZodCIDRv6",(e,t)=>{Fl.init(e,t),Ye.init(e,t)}),cf=k("ZodBase64",(e,t)=>{jl.init(e,t),Ye.init(e,t)}),lf=k("ZodBase64URL",(e,t)=>{Bl.init(e,t),Ye.init(e,t)}),uf=k("ZodE164",(e,t)=>{Hl.init(e,t),Ye.init(e,t)}),df=k("ZodJWT",(e,t)=>{Vl.init(e,t),Ye.init(e,t)}),as=k("ZodNumber",(e,t)=>{Pi.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>Fi(e,n,o),Xr(e,"ZodNumber",{gt(n,o){return this.check(ba(n,o))},gte(n,o){return this.check(Zn(n,o))},min(n,o){return this.check(Zn(n,o))},lt(n,o){return this.check(ya(n,o))},lte(n,o){return this.check(Jn(n,o))},max(n,o){return this.check(Jn(n,o))},int(n){return this.check(_a(n))},safe(n){return this.check(_a(n))},positive(n){return this.check(ba(0,n))},nonnegative(n){return this.check(Zn(0,n))},negative(n){return this.check(ya(0,n))},nonpositive(n){return this.check(Jn(0,n))},multipleOf(n,o){return this.check(wa(n,o))},step(n,o){return this.check(wa(n,o))},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 F(e){return Bu(as,e)}const ff=k("ZodNumberFormat",(e,t)=>{Wl.init(e,t),as.init(e,t)});function _a(e){return Hu(ff,e)}const hf=k("ZodBoolean",(e,t)=>{Kl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ji(e,r,n)});function rt(e){return Gu(hf,e)}const pf=k("ZodUnknown",(e,t)=>{ql.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi()});function co(){return Vu(pf)}const mf=k("ZodNever",(e,t)=>{Yl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ui(e,r,n)});function gf(e){return Wu(mf,e)}const vf=k("ZodArray",(e,t)=>{Jl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o),e.element=t.element,Xr(e,"ZodArray",{min(r,n){return this.check(bn(r,n))},nonempty(r){return this.check(bn(1,r))},max(r,n){return this.check(Ni(r,n))},length(r,n){return this.check(Li(r,n))},unwrap(){return this.element}})});function qe(e,t){return nd(vf,e,t)}const yf=k("ZodObject",(e,t)=>{Xl.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),Oe(e,"shape",()=>t.shape),Xr(e,"ZodObject",{keyof(){return ke(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:co()})},loose(){return this.clone({...this._zod.def,catchall:co()})},strict(){return this.clone({...this._zod.def,catchall:gf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return gc(this,r)},safeExtend(r){return vc(this,r)},merge(r){return yc(this,r)},pick(r){return pc(this,r)},omit(r){return mc(this,r)},partial(...r){return bc(ss,this,r[0])},required(...r){return wc(cs,this,r[0])}})});function M(e,t){const r={type:"object",shape:e??{},...Z(t)};return new yf(r)}const bf=k("ZodUnion",(e,t)=>{Ql.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o),e.options=t.options});function wf(e,t){return new bf({type:"union",options:e,...Z(t)})}const xf=k("ZodIntersection",(e,t)=>{$l.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o)});function kf(e,t){return new xf({type:"intersection",left:e,right:t})}const Aa=k("ZodRecord",(e,t)=>{eu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Sa(e,t,r){return!t||!t._zod?new Aa({type:"record",keyType:W(),valueType:e,...Z(t)}):new Aa({type:"record",keyType:e,valueType:t,...Z(r)})}const lo=k("ZodEnum",(e,t)=>{tu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,o,a)=>Hi(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const a={};for(const i of n)if(r.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new lo({...t,checks:[],...Z(o),entries:a})},e.exclude=(n,o)=>{const a={...t.entries};for(const i of n)if(r.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new lo({...t,checks:[],...Z(o),entries:a})}});function ke(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new lo({type:"enum",entries:r,...Z(t)})}const Cf=k("ZodTransform",(e,t)=>{ru.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new mi(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(qr(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(qr(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function is(e){return new Cf({type:"transform",transform:e})}const ss=k("ZodOptional",(e,t)=>{Di.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function za(e){return new ss({type:"optional",innerType:e})}const _f=k("ZodExactOptional",(e,t)=>{nu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Af(e){return new _f({type:"optional",innerType:e})}const Sf=k("ZodNullable",(e,t)=>{ou.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ta(e){return new Sf({type:"nullable",innerType:e})}const zf=k("ZodDefault",(e,t)=>{au.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tf(e,t){return new zf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yi(t)}})}const Ef=k("ZodPrefault",(e,t)=>{iu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Pf(e,t){return new Ef({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yi(t)}})}const cs=k("ZodNonOptional",(e,t)=>{su.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Mf(e,t){return new cs({type:"nonoptional",innerType:e,...Z(t)})}const Of=k("ZodCatch",(e,t)=>{cu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Df(e,t){return new Of({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ls=k("ZodPipe",(e,t)=>{Ri.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.in=t.in,e.out=t.out});function Ea(e,t){return new ls({type:"pipe",in:e,out:t})}const Rf=k("ZodPreprocess",(e,t)=>{ls.init(e,t),lu.init(e,t)}),Nf=k("ZodReadonly",(e,t)=>{uu.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Lf(e){return new Nf({type:"readonly",innerType:e})}const If=k("ZodCustom",(e,t)=>{du.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gi(e,r)});function Ff(e,t={}){return od(If,e,t)}function jf(e,t){return ad(e,t)}function Uf(e,t){return new Rf({type:"pipe",in:is(e),out:t})}function Bf(e){return mu(os,e)}const Pa=M({x:F().int().min(0).describe("Column offset, 0-based"),y:F().int().min(0).describe("Row offset, 0-based"),w:F().int().min(1).describe("Width in grid columns"),h:F().int().min(1).describe("Height in grid rows")}),Hf=M({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:Pa,layouts:Sa(W(),Pa).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:Sa(W(),co()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),Gf=M({type:ke(["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:F().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:F().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:F().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:F().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."),Vf=M({accentHue:F().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:F().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:F().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:F().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."),Wf=M({fontFamily:ke(["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:ke(["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:F().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."),Kf={sans:'"DM Sans", sans-serif',mono:'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace',serif:'ui-serif, Georgia, "Times New Roman", serif'},qf={proportional:"normal",tabular:"tabular-nums"},Yf=M({radius:F().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:F().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:F().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:F().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:F().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)."),Jf=Uf(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:o,...a}=r;t={...t,grid:a,appearance:{radius:o,...t.appearance??{}}}}const n=t.background;return n&&typeof n=="object"&&n.type==="gradient"&&!("gradientFrom"in n)&&(t={...t,background:{...n,type:"none"}}),t},M({version:Bf().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:M({mode:ke(["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:F().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:F().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:F().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:F().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.")}).default({mode:"flow-vertical",columns:12,rowHeight:96,rows:6,gap:12}),background:Gf.default({type:"none",color:"#0a0a12",gradientFrom:"#1b1e4d",gradientTo:"#07070c",gradientAngle:160,scale:1,dpi:1.5,opacity:.16}),theme:Vf.default({accentHue:242,accentSat:90,baseHue:233,baseSat:20,upColor:"#3fd08f",downColor:"#ff6b81"}),typography:Wf.default({fontFamily:"sans",numericStyle:"proportional",scale:1}),appearance:Yf.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:qe(Hf)})),My=[{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"}],Zf="YrTzGatwjK7EoFpCSfgZ",Xf=[{key:"aurora",label:"Aurora",description:"The signature zframes scene — a slow indigo aurora drifting over near-black. The default backdrop.",projectId:Zf,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%)"}],Qf=242;function $f(e){const t=Xf.find(r=>r.projectId===e);return t?t.baseHue:Qf}const us=z.createContext(null),ds=z.createContext([]);function eh({providers:e,children:t}){const r=Array.isArray(e)?e:[e];return w.jsx(ds.Provider,{value:r,children:t})}function Nn(){return z.useContext(ds)}function de(e){return Nn().find(r=>r.capabilities.includes(e))??null}function he(e,t,r,n){const[o,a]=z.useState(t),[i,s]=z.useState(!0),c=z.useContext(us);return z.useEffect(()=>{if(!e){s(!1);return}let l=!1;a(t),s(!0);const u=()=>{c&&!c.visibleRef.current||e().then(m=>{l||(a(m),s(!1))}).catch(()=>{l||s(!1)})};u();let h;const f=()=>{h=setTimeout(()=>{u(),f()},n*(.85+Math.random()*.3))};f();const d=c==null?void 0:c.subscribe(m=>{m&&!l&&u()});return()=>{l=!0,clearTimeout(h),d==null||d()}},r),{data:o,isLoading:i}}function th(e){const t=de("quote-stream"),[r,n]=z.useState({}),[o,a]=z.useState(!0),i=e.join(",");return z.useEffect(()=>{const s=i.split(",").filter(Boolean);if(n({}),!(t!=null&&t.subscribeMids)||s.length===0){a(!1);return}let c=!1,l=!1;a(!0);const u=setTimeout(()=>{!c&&!l&&a(!1)},8e3),h=t.subscribeMids(f=>{c||(l=!0,clearTimeout(u),a(!1),n(d=>{let m=!1;const p={};for(const v of s){const g=f[v];g!==void 0&&(p[v]=g,g!==d[v]&&(m=!0))}return Object.keys(d).length!==Object.keys(p).length&&(m=!0),m?p:d}))},s);return()=>{c=!0,clearTimeout(u),h()}},[t,i]),{mids:r,isLoading:o}}function Oy(e){return th(e).mids}function rh(e,t=3e4){const r=de("day-stats"),n=e?[...e].sort().join(","):"*",o=n==="*"?void 0:n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getDayStats?()=>r.getDayStats(o):null,{},[r,n,t],t);return{stats:a,isLoading:i}}function Ma(e,t=3e4){return rh(e,t).stats}function Dy(e,t,r=5*6e4){const n=de("funding-history"),o=e.join(","),a=o.split(",").filter(Boolean),{data:i,isLoading:s}=he(n!=null&&n.getFundingHistory&&a.length>0?()=>n.getFundingHistory(a,t):null,{},[n,o,t,r],r);return{history:i,isLoading:s}}function Ry(e,t,r,n=6e4){const o=de("ohlcv"),{data:a,isLoading:i}=he(o!=null&&o.getCandles&&e?()=>o.getCandles(e,t,r):null,[],[o,e,t,r,n],n);return{candles:a,isLoading:i}}function Ny(e,t,r,n=6e4){const o=de("ohlcv"),a=e.join(","),i=a.split(",").filter(Boolean),{data:s,isLoading:c}=he(o!=null&&o.getCandles&&i.length>0?async()=>{const l=await Promise.all(i.map(u=>o.getCandles(u,t,r).then(h=>[u,h]).catch(()=>[u,[]])));return Object.fromEntries(l)}:null,{},[o,a,t,r,n],n);return{candles:s,isLoading:c}}function Ly(e=10*6e4){const t=de("tvl"),{data:r,isLoading:n}=he(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:r,isLoading:n}}function Iy(e=10*6e4){const t=de("dex-volume"),{data:r,isLoading:n}=he(t!=null&&t.getDexVolume?()=>t.getDexVolume():null,[],[t,e],e);return{entries:r,isLoading:n}}function Fy(e,t=5*6e4){const r=de("dex-volume"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getDexVolumeHistory&&o.length>0?()=>r.getDexVolumeHistory(o):null,{},[r,n,t],t);return{history:a,isLoading:i}}function jy(e=10*6e4){const t=de("protocol-tvl"),{data:r,isLoading:n}=he(t!=null&&t.getProtocolTvl?()=>t.getProtocolTvl():null,[],[t,e],e);return{entries:r,isLoading:n}}function Uy(e,t=5*6e4){const r=de("protocol-tvl"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getProtocolTvlHistory&&o.length>0?()=>r.getProtocolTvlHistory(o):null,{},[r,n,t],t);return{history:a,isLoading:i}}function By(e=10*6e4){const t=de("protocol-fees"),{data:r,isLoading:n}=he(t!=null&&t.getProtocolFees?()=>t.getProtocolFees():null,[],[t,e],e);return{entries:r,isLoading:n}}function Hy(e=10*6e4){const t=de("coin-markets"),{data:r,isLoading:n}=he(t!=null&&t.getCoinMarkets?()=>t.getCoinMarkets():null,[],[t,e],e);return{entries:r,isLoading:n}}function Gy(e=300,t=15*6e4){const r=de("coin-movers"),{data:n,isLoading:o}=he(r!=null&&r.getCoinMovers?()=>r.getCoinMovers(e):null,[],[r,e,t],t);return{entries:n,isLoading:o}}function Vy(e,t=3e4){const r=de("open-interest"),n=e?[...e].sort().join(","):"*",o=n==="*"?void 0:n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getOpenInterest?()=>r.getOpenInterest(o):null,[],[r,n,t],t);return{entries:a,isLoading:i}}function Wy(e=15*6e4){const t=de("global-market"),{data:r,isLoading:n}=he(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:r,isLoading:n}}function Ky(e=30,t=60*6e4){const r=de("sentiment"),{data:n,isLoading:o}=he(r!=null&&r.getFearGreed?()=>r.getFearGreed(e):null,[],[r,e,t],t);return{points:n,isLoading:o}}function qy(e=15*6e4){const t=de("reference-rates"),{data:r,isLoading:n}=he(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function Yy(e,t,r=60*6e4){const n=de("fx-rates"),o=t.join(","),{data:a,isLoading:i}=he(n!=null&&n.getFxRates?()=>n.getFxRates(e,[...t]):null,[],[n,e,o,r],r);return{rates:a,isLoading:i}}function Jy(e=360*6e4){const t=de("treasury-rates"),{data:r,isLoading:n}=he(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:r,isLoading:n}}function Zy(e=360*6e4){const t=de("yield-curve"),{data:r,isLoading:n}=he(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:r,isLoading:n}}function Xy(e=8,t=360*6e4){const r=de("treasury-auctions"),{data:n,isLoading:o}=he(r!=null&&r.getTreasuryAuctions?()=>r.getTreasuryAuctions(e):null,[],[r,e,t],t);return{auctions:n,isLoading:o}}function Qy(e=180,t=360*6e4){const r=de("national-debt"),{data:n,isLoading:o}=he(r!=null&&r.getNationalDebt?()=>r.getNationalDebt(e):null,null,[r,e,t],t);return{debt:n,isLoading:o}}function $y(e=360*6e4){const t=de("financial-stress"),{data:r,isLoading:n}=he(t!=null&&t.getFinancialStress?()=>t.getFinancialStress():null,null,[t,e],e);return{stress:r,isLoading:n}}function eb(e,t,r,n=720*6e4){const o=de("macro-series"),{data:a,isLoading:i}=he(o!=null&&o.getMacroSeries&&e?()=>o.getMacroSeries(e,t,r):null,null,[o,e,t,r,n],n);return{series:a,isLoading:i}}function tb(e,t=30*6e4){const r=de("filings"),{data:n,isLoading:o}=he(r!=null&&r.getCompanyFilings&&e?()=>r.getCompanyFilings(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function rb(e,t=720*6e4){const r=de("fundamentals"),{data:n,isLoading:o}=he(r!=null&&r.getCompanyFacts&&e?()=>r.getCompanyFacts(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function nb(e,t=360*6e4){const r=de("short-volume"),n=e.join(","),o=n.split(",").filter(Boolean),{data:a,isLoading:i}=he(r!=null&&r.getShortVolume&&o.length>0?()=>r.getShortVolume(o):null,{},[r,n,t],t);return{data:a,isLoading:i}}function ob(e,t,r,n=5*6e4){const o=de("news"),a=t?t.join(","):"",{data:i,isLoading:s}=he(o!=null&&o.getNews&&e?()=>o.getNews({feed:e,symbols:a?a.split(","):void 0,limit:r}):null,[],[o,e,a,r,n],n);return{items:i,isLoading:s}}function ab(e=3e4){const t=de("btc-fees"),{data:r,isLoading:n}=he(t!=null&&t.getBtcFees?()=>t.getBtcFees():null,null,[t,e],e);return{fees:r,isLoading:n}}function ib(e=15e3){const t=de("btc-mempool"),{data:r,isLoading:n}=he(t!=null&&t.getMempoolState?()=>t.getMempoolState():null,null,[t,e],e);return{state:r,isLoading:n}}function sb(e=8,t=3e4){const r=de("btc-blocks"),{data:n,isLoading:o}=he(r!=null&&r.getBtcBlocks?()=>r.getBtcBlocks(e):null,[],[r,e,t],t);return{blocks:n,isLoading:o}}function cb(e="1y",t=30*6e4){const r=de("btc-hashrate"),{data:n,isLoading:o}=he(r!=null&&r.getNetworkHashrate?()=>r.getNetworkHashrate(e):null,null,[r,e,t],t);return{data:n,isLoading:o}}function lb(e=6e4){const t=de("btc-difficulty"),{data:r,isLoading:n}=he(t!=null&&t.getDifficultyAdjustment?()=>t.getDifficultyAdjustment():null,null,[t,e],e);return{adjustment:r,isLoading:n}}function ub(e="1w",t=5*6e4){const r=de("mining-pools"),{data:n,isLoading:o}=he(r!=null&&r.getMiningPools?()=>r.getMiningPools(e):null,null,[r,e,t],t);return{pools:n,isLoading:o}}function db(e=30*6e4){const t=de("lightning-stats"),{data:r,isLoading:n}=he(t!=null&&t.getLightningStats?()=>t.getLightningStats():null,null,[t,e],e);return{stats:r,isLoading:n}}function fb(e,t=5*6e4){const r=de("options-summary"),n=(e||"BTC").toUpperCase(),{data:o,isLoading:a}=he(r!=null&&r.getOptionsSummary?()=>r.getOptionsSummary(n):null,null,[r,n,t],t);return{summary:o,isLoading:a}}function hb(e,t=6e4){const r=Nn(),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,o=e?`${e.kind}:${e.address??""}`:"",{data:a,isLoading:i}=he(n&&e?()=>n.getPortfolio(e):null,null,[n,o,t],t);return{portfolio:a,isLoading:i}}function pb(e,t,r=43200,n=10*6e4){const o=de("volatility-index"),a=(e||"BTC").toUpperCase(),{data:i,isLoading:s}=he(o!=null&&o.getVolatilityIndex?()=>o.getVolatilityIndex(a,t,r):null,[],[o,a,t,r,n],n);return{points:i,isLoading:s}}const nh=z.createContext(null);function mb(){return z.useContext(nh)}const oh=`
|
|
66
66
|
.zf-grid {
|
|
67
67
|
display: grid;
|
|
68
68
|
gap: var(--zf-gap, 12px);
|
|
@@ -507,7 +507,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
507
507
|
@media (prefers-reduced-motion: reduce) {
|
|
508
508
|
.zf-frame-skeleton { animation: none; }
|
|
509
509
|
}
|
|
510
|
-
`,hs=()=>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 Xn({outerClassName:e,style:t,headline:r,frame:n,children:o}){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(hs,{})}),w.jsx("div",{className:"zf-error-headline",children:r}),w.jsx("div",{className:"zf-error-frame",children:n}),o]})})}function ah({sources:e}){return e.length===0?null:w.jsx("span",{className:"zf-frame-source",children:e.map((t,r)=>w.jsxs(z.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 Oa extends z.Component{constructor(){super(...arguments);X(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(hs,{})}),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 Mr=(...e)=>e.filter(Boolean).join(" ");function ih({style:e,className:t,hasIcon:r,titleIcon:n,title:o,titleContent:a,sources:i,children:s}){const c=z.useRef(null),l=z.useRef(!0),u=z.useRef(null);u.current||(u.current=new Set);const h=z.useRef(null);if(!h.current){const f=u.current;h.current={visibleRef:l,subscribe:d=>(f.add(d),()=>{f.delete(d)})}}return z.useEffect(()=>{const f=c.current;if(!f||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(m=>{const p=m[0];if(!p)return;const v=p.isIntersecting;if(v!==l.current){l.current=v;for(const g of[...u.current])g(v)}},{rootMargin:"200px"});return d.observe(f),()=>d.disconnect()},[]),w.jsx(ds.Provider,{value:h.current,children:w.jsxs("div",{ref:c,className:Mr("zf-frame",t),style:e,children:[w.jsxs("div",{className:Mr("zf-frame-title",r?"zf-frame-title--icon":""),children:[n,w.jsx("span",{className:"zf-frame-title-text",children:a??o}),w.jsx(ah,{sources:i})]}),w.jsx("div",{className:"zf-frame-body",children:s})]})})}function sh({instance:e,registry:t,style:r,className:n=""}){const o=Nn(),a=t.get(e.frame);if(!a)return w.jsxs(Xn,{outerClassName:Mr("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(o.flatMap(d=>[...d.capabilities])),s=a.capabilities.filter(d=>!i.has(d));if(s.length>0)return w.jsx(Xn,{outerClassName:Mr("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(z.Fragment,{children:[m>0&&", ",w.jsx("code",{children:d})]},d)),"."]})});const c=a.schema.safeParse(e.config);if(!c.success)return w.jsx(Xn,{outerClassName:Mr("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=a.component,u=a.titleIcon,h=a.titleContent,f=a.source?Array.isArray(a.source)?a.source:[a.source]:[];return a.chrome==="bare"?w.jsx("div",{className:Mr("zf-bare",n),style:r,children:w.jsx(Oa,{children:w.jsx(z.Suspense,{fallback:null,children:w.jsx(l,{config:c.data})})})}):w.jsx(ih,{style:r,className:n,hasIcon:!!u,title:e.title??a.label,sources:f,titleIcon:u?w.jsx(z.Suspense,{fallback:null,children:w.jsx(u,{config:c.data})}):null,titleContent:e.title==null&&h?w.jsx(z.Suspense,{fallback:null,children:w.jsx(h,{config:c.data})}):void 0,children:w.jsx(Oa,{children:w.jsx(z.Suspense,{fallback:w.jsx("div",{className:"zf-frame-skeleton"}),children:w.jsx(l,{config:c.data})})})})}const ch=z.memo(sh);function lh(e,t,r,n,o){var u;const a={"--zf-enter-i":t,"--zf-col-span-sm":e.position.w>=o/2?2:1};if(r){const h=(u=e.layouts)==null?void 0:u["flow-horizontal"];return h?{...a,"--zf-col-start":h.x+1,"--zf-col-span":h.w,"--zf-row-start":h.y+1,"--zf-row-span":Math.min(h.h,n)}:{...a,"--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{...a,"--zf-col-start":i+1,"--zf-col-span":c,"--zf-row-start":s+1,"--zf-row-span":l}}function Da({spec:e,registry:t}){const r=e.grid.mode==="flow-horizontal",n=z.useMemo(()=>e.frames.map((o,a)=>lh(o,a,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:oh}),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-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":Kf[e.typography.fontFamily],"--zf-numeric":Yf[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((o,a)=>w.jsx(ch,{instance:o,registry:t,style:n[a]},o.id))})]})}const uh="/__zframes/dashboard.json",dh="/__zframes/dashboard",fh="/__zframes/dashboards",hh="/__zframes/switch",ph="/__zframes/proxy",mh="/__zframes/account/portfolio",fb="/__zframes/account/credentials",gh="/__zframes/agents",vh="/__zframes/ask";class pe{constructor(t){X(this,"entries",new Map);X(this,"inflight",new Map);X(this,"namespace");X(this,"ttlMs");X(this,"persist");X(this,"staleOnError");X(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 o=this.inflight.get(t);if(o)return o;const a=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,a),a}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 o=JSON.parse(n);if(typeof(o==null?void 0:o.at)!="number")return null;let a;if(this.revive){const s=this.revive(o.value);if(s===null)return null;a=s}else a=o.value;const i={at:o.at,value:a};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 yh=new pe({namespace:"zframes:binance:portfolio",ttlMs:45e3,persist:!1});class bh{constructor(){X(this,"name","Binance");X(this,"capabilities",["portfolio"]);X(this,"portfolioKinds",["binance"])}async getPortfolio(t){if(t.kind!=="binance")throw new Error(`BinanceProvider can't serve source: ${t.kind}`);return yh.get("binance",async()=>{const r=await fetch(`${mh}?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 wh=1e4,xh="zframes (+https://github.com/zentryhq/zframes)";async function ps(e,{timeoutMs:t=wh,init:r,proxied:n}){const o=new Headers(r==null?void 0:r.headers);typeof document>"u"&&!o.has("User-Agent")&&o.set("User-Agent",xh);const a=n&&typeof document<"u"?`${ph}?url=${encodeURIComponent(e)}`:e,i=await fetch(a,{...r,headers:o,signal:(r==null?void 0:r.signal)??AbortSignal.timeout(t)});if(!i.ok)throw new Error(`${e} failed: ${i.status}`);return i}async function Se(e,t,r={}){const o=await(await ps(e,r)).json();return t?t.parse(o):o}async function Yr(e,t={}){return(await ps(e,t)).text()}const kh=["https://ethereum-rpc.publicnode.com","https://cloudflare-eth.com","https://1rpc.io/eth"],Ch="https://api.coingecko.com/api/v3/simple/price",_h="0x70a08231",Ah=1,Sh={symbol:"ETH",address:null,decimals:18,cgId:"ethereum"},_n=[Sh,{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"}],Ra=/^0x[0-9a-fA-F]{40}$/;async function zh(e){const t=e.trim();if(Ra.test(t))return t;try{const r=await Se(`https://api.ensideas.com/ens/resolve/${encodeURIComponent(t)}`);if(r.address&&Ra.test(r.address))return r.address}catch{}throw new Error(`couldn't resolve address: ${t}`)}function Th(e){return`${_h}000000000000000000000000${e.slice(2).toLowerCase()}`}function Eh(e,t){if(!e||e==="0x")return 0;try{return Number(BigInt(e))/10**t}catch{return 0}}async function Ph(e){var s;const t=_n.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:Th(e)},"latest"]}),r=JSON.stringify(t);let n=null,o;for(const c of kh)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 f=((s=u==null?void 0:u.error)==null?void 0:s.message)??"non-array response";throw new Error(`rpc ${c}: ${f}`)}const h=u;if(!h.some(f=>typeof f.result=="string"))throw new Error(`rpc ${c}: no results (throttled?)`);n=h;break}catch(l){o=l}if(!n)throw new Error(`all RPC endpoints failed: ${String(o)}`);const a=new Map;for(const c of n)c.result&&a.set(c.id,c.result);const i=new Map;return _n.forEach((c,l)=>{const u=Eh(a.get(l),c.decimals);u>0&&i.set(c.symbol,u)}),i}const Mh=[...new Set(_n.map(e=>e.cgId))],Oh=new pe({namespace:"zframes:wallet:prices",ttlMs:10*6e4,persist:!0});async function Dh(){return Oh.get("all",async()=>{const e=`${Ch}?ids=${Mh.join(",")}&vs_currencies=usd&include_24hr_change=true`,t=await Se(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("coingecko simple/price: unexpected response shape");return t})}function Rh(e){return`${e.slice(0,6)}…${e.slice(-4)}`}const Nh=new pe({namespace:"zframes:wallet:portfolio",ttlMs:12e4,persist:!1});class Lh{constructor(){X(this,"name","On-chain wallet");X(this,"capabilities",["portfolio"]);X(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 Nh.get(t.address,async()=>{const r=await zh(t.address),n=await Ph(r),o=_n.filter(c=>n.has(c.symbol)),a=o.length?await Dh():{},i=o.map(c=>{var f,d;const l=n.get(c.symbol)??0,u=(f=a[c.cgId])==null?void 0:f.usd,h=u!==void 0?l*u:void 0;return{symbol:c.symbol,amount:l,valueUsd:h,changePct24h:(d=a[c.cgId])==null?void 0:d.usd_24h_change}}).filter(c=>c.valueUsd!==void 0&&c.valueUsd>=Ah).sort((c,l)=>(l.valueUsd??0)-(c.valueUsd??0)),s=i.reduce((c,l)=>c+(l.valueUsd??0),0);return{source:"wallet",label:Rh(r),holdings:i,totalUsd:s,asOf:Date.now()}})}}const Ih="https://api.alternative.me/fng/",Fh=new pe({namespace:"zframes:alternativeme:fng",ttlMs:45*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});class jh{constructor(){X(this,"name","alternative.me");X(this,"capabilities",["sentiment"])}async getFearGreed(t=30){return Fh.get(String(t),async()=>{const r=await Se(`${Ih}?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 Uh="https://api.bls.gov/publicAPI/v2/timeseries/data/",Bh={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate",CES0000000001:"Nonfarm payrolls",CES0500000003:"Avg hourly earnings",LNS11300000:"Labor force participation"};function Hh(e){const t=Number(e);return Number.isFinite(t)?t:null}function Gh(e,t){const r=/^M(0[1-9]|1[0-2])$/.exec(t??""),n=Number(e);if(!r||!Number.isFinite(n))return null;const o=Number(r[1]);return Date.UTC(n,o-1,1)}function Vh(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const Wh=new pe({namespace:"zframes:macro",ttlMs:360*6e4,persist:!0,revive:e=>e&&Array.isArray(e.points)?e:null});class qh{constructor(){X(this,"name","bls");X(this,"capabilities",["macro-series"])}async getMacroSeries(t,r,n){return Wh.get(`${t}:${r}:${n}`,()=>this.fetchMacroSeries(t,r,n))}async fetchMacroSeries(t,r,n){var c,l,u;const o=`${Uh}${encodeURIComponent(t)}?startyear=${r}&endyear=${n}`,a=await Se(o);if(a.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((c=a.message)==null?void 0:c.join(", "))||"request failed"}`);const i=(u=(l=a.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(h=>{const f=Hh(h.value),d=Gh(h.year,h.period);return f===null||d===null?null:{time:d,date:Vh(d),value:f,period:`${h.year}-${h.period}`}}).filter(h=>h!==null).sort((h,f)=>h.time-f.time);return{seriesId:i.seriesID??t,label:Bh[t]??t,source:"BLS",points:s}}}const Kh="https://api.coingecko.com/api/v3/global",Yh="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",Jh=new pe({namespace:"zframes:coingecko:global",ttlMs:12*6e4,persist:!0}),Zh=new pe({namespace:"zframes:coingecko:markets",ttlMs:10*6e4,persist:!0});class Xh{constructor(){X(this,"name","coingecko");X(this,"capabilities",["global-market","coin-markets"])}async getGlobalMarket(){return Jh.get("global",async()=>{var n;const t=await Se(Kh);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 Zh.get("markets",async()=>{const t=await Se(Yh);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 Qh=300,$h=e=>`https://api.coinpaprika.com/v1/tickers?quotes=USD&limit=${e}`,ep=new pe({namespace:"zframes:coinpaprika:movers",ttlMs:12*6e4,persist:!0}),ln=e=>Number.isFinite(e)?e:0;class tp{constructor(){X(this,"name","coinpaprika");X(this,"capabilities",["coin-movers"])}async getCoinMovers(t=Qh){return ep.get(`movers:${t}`,async()=>{const r=await Se($h(t));if(!Array.isArray(r))throw new Error("coinpaprika tickers: unexpected response shape");return r.filter(n=>{var o;return((o=n==null?void 0:n.quotes)==null?void 0:o.USD)&&Number.isFinite(n.quotes.USD.price)}).map(n=>{const o=n.quotes.USD;return{symbol:(n.symbol??"").toUpperCase(),name:n.name,rank:n.rank,priceUsd:o.price,marketCapUsd:o.market_cap,volume24hUsd:o.volume_24h,changePct:{"1h":ln(o.percent_change_1h),"24h":ln(o.percent_change_24h),"7d":ln(o.percent_change_7d),"30d":ln(o.percent_change_30d)}}})})}}const rp="https://api.llama.fi/v2/chains",np="https://api.llama.fi/overview/dexs",op="https://api.llama.fi/overview/fees",ap="https://api.llama.fi/protocols",Ln=8*6e4,ms=30*6e4,ip=new pe({namespace:"zframes:defillama:tvl",ttlMs:Ln}),sp=new pe({namespace:"zframes:defillama:dex-volume",ttlMs:Ln}),cp=new pe({namespace:"zframes:defillama:protocol-tvl",ttlMs:Ln}),lp=new pe({namespace:"zframes:defillama:protocol-fees",ttlMs:Ln}),up=new pe({namespace:"zframes:defillama:dex-history",ttlMs:ms}),dp=new pe({namespace:"zframes:defillama:protocol-history",ttlMs:ms}),Na=e=>[...e].sort().join(",");function fp(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 Qn=e=>Number.isFinite(e)?e:void 0;class hp{constructor(){X(this,"name","defillama");X(this,"capabilities",["tvl","dex-volume","protocol-tvl","protocol-fees"])}async getTvlByChain(){return ip.get("chains",async()=>{const t=await Se(rp);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 sp.get("overview",async()=>{const t=await Se(np),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:Qn(n.change_1d)})).sort((n,o)=>o.volume24h-n.volume24h)})}async getDexVolumeHistory(t){return up.get(Na(t),async()=>{const r=await Promise.all(t.map(n=>Se(`https://api.llama.fi/summary/dexs/${encodeURIComponent(n)}?excludeTotalDataChartBreakdown=true`).then(o=>[n,fp(o.totalDataChart)]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolTvl(){return cp.get("overview",async()=>{const t=await Se(ap);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:Qn(r.change_1d)})).sort((r,n)=>n.tvl-r.tvl)})}async getProtocolTvlHistory(t){return dp.get(Na(t),async()=>{const r=await Promise.all(t.map(n=>Se(`https://api.llama.fi/protocol/${encodeURIComponent(n)}`).then(o=>[n,(o.tvl??[]).map(a=>({time:a.date*1e3,value:Number(a.totalLiquidityUSD)})).filter(a=>Number.isFinite(a.time)&&Number.isFinite(a.value))]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolFees(){return lp.get("overview",async()=>{const t=await Se(op),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:Qn(n.change_1d)})).sort((n,o)=>o.fees24h-n.fees24h)})}}const La="https://www.deribit.com/api/v2/public",pp=new pe({namespace:"zframes:deribit:summary",ttlMs:4*6e4,persist:!0}),mp=new pe({namespace:"zframes:deribit:dvol",ttlMs:9*6e4,persist:!0}),gp={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},vp=/^[A-Z]+-(\d{1,2}[A-Z]{3}\d{2})-(\d+(?:\.\d+)?)-([CP])$/;function yp(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=gp[t[2]],o=2e3+Number(t[3]);return n===void 0?Number.POSITIVE_INFINITY:Date.UTC(o,n,r,8,0,0)}class bp{constructor(){X(this,"name","deribit");X(this,"capabilities",["options-summary","volatility-index"])}async getOptionsSummary(t){const r=t.toUpperCase();return pp.get(r,async()=>{const n=await Se(`${La}/get_book_summary_by_currency?currency=${r}&kind=option`),o=n==null?void 0:n.result;if(!Array.isArray(o)||o.length===0)throw new Error("deribit options: unexpected response shape");let a=0,i=0,s=0,c=0,l=0,u=0,h=0;const f=new Map;for(const g of o){const b=vp.exec(g.instrument_name);if(!b)continue;const[,x,T,C]=b,y=Number(T),S=g.open_interest??0,E=g.volume??0,O=C==="C";O?(a+=S,s+=E):(i+=S,c+=E),Number.isFinite(g.mark_iv)&&S>0&&(l+=g.mark_iv*S,u+=S),!h&&Number.isFinite(g.underlying_price)&&(h=g.underlying_price);let _=f.get(x);_||(_=new Map,f.set(x,_));let K=_.get(y);K||(K={callOi:0,putOi:0},_.set(y,K)),O?K.callOi+=S:K.putOi+=S}const d=Date.now(),m=[...f.keys()].map(g=>({expiry:g,expiryMs:yp(g)}));m.sort((g,b)=>g.expiryMs-b.expiryMs);const p=m.find(g=>g.expiryMs>d)??m[0]??null;let v={expiry:(p==null?void 0:p.expiry)??"",expiryMs:(p==null?void 0:p.expiryMs)??0,strikes:[]};if(p){const g=f.get(p.expiry);v={expiry:p.expiry,expiryMs:p.expiryMs,strikes:[...g.entries()].map(([b,x])=>({strike:b,callOi:x.callOi,putOi:x.putOi})).sort((b,x)=>b.strike-x.strike)}}return{currency:r,underlyingPrice:h,putCallRatioOi:a>0?i/a:0,putCallRatioVolume:s>0?c/s:0,callOi:a,putOi:i,callVolume:s,putVolume:c,avgIv:u>0?l/u:0,nearestExpiry:v,asOf:Date.now()}})}async getVolatilityIndex(t,r,n){const o=t.toUpperCase();return mp.get(`${o}:${n}:${r}`,async()=>{var s;const a=await Se(`${La}/get_volatility_index_data?currency=${o}&start_timestamp=${r}&end_timestamp=${Date.now()}&resolution=${n}`),i=(s=a==null?void 0:a.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 wp=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,xp=7,kp=60*6e4,Cp=new pe({namespace:"zframes:finra:shortvol",ttlMs:kp});function _p(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Ap(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function Sp(e){const t=e.split(/\r?\n/),r=new Map;let n="";for(let o=1;o<t.length;o++){const a=t[o].split("|");if(a.length<5)continue;const[i,s,c,l,u]=a;if(!s)continue;const h=Number(c),f=Number(u);!Number.isFinite(h)||!Number.isFinite(f)||(!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:h,shortExemptVolume:Number(l)||0,totalVolume:f,shortPct:f>0?h/f*100:0}))}if(r.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:n,bySymbol:r}}class zp{constructor(){X(this,"name","finra");X(this,"capabilities",["short-volume"])}async getShortVolume(t){const r=await this.loadReport(),n={};for(const o of t){const a=r.bySymbol.get(_p(o).toUpperCase());a&&(n[o]=a)}return n}loadReport(){return Cp.get("latest",()=>this.fetchLatest())}async fetchLatest(){const t=Date.now();for(let r=0;r<=xp;r++){const n=new Date(t-r*864e5);try{return Sp(await Yr(wp(Ap(n)),{proxied:!0,timeoutMs:15e3}))}catch{}}throw new Error("finra: no recent short-volume file found")}}const Tp="https://api.frankfurter.dev/v1",Ep=new pe({namespace:"zframes:fx",ttlMs:55*6e4,persist:!0}),Pp=40;function Mp(e){return new Date(Date.now()-e*864e5).toISOString().slice(0,10)}class Op{constructor(){X(this,"name","fx");X(this,"capabilities",["fx-rates"])}async getFxRates(t,r){const n=t.toUpperCase(),o=[...new Set(r.map(i=>i.toUpperCase()))].filter(i=>i&&i!==n);if(o.length===0)return[];const a=`${n}:${[...o].sort().join(",")}`;return Ep.get(a,async()=>{const i=`${Tp}/${Mp(Pp)}..?base=${n}&symbols=${o.join(",")}`,s=await Se(i);if(!(s!=null&&s.rates))throw new Error("frankfurter: unexpected response shape");const c=Object.keys(s.rates).sort();return o.map(l=>{var m;const u=[];for(const p of c){const v=(m=s.rates[p])==null?void 0:m[l];typeof v=="number"&&Number.isFinite(v)&&u.push({time:new Date(`${p}T00:00:00Z`).getTime(),value:v})}if(u.length===0)return null;const h=u[u.length-1].value,f=u.length>1?u[u.length-2].value:h,d=f>0?(h-f)/f*100:0;return{symbol:l,base:n,rate:h,changePct:d,history:u}}).filter(l=>l!==null)})}}const Dp="wss://api.hyperliquid.xyz/ws",Rp="https://api.hyperliquid.xyz/info",$n=e=>e.includes(":")?e.split(":")[0]:"";async function un(e){return Se(Rp,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}const Np=new pe({namespace:"zframes:hyperliquid:daystats",ttlMs:25e3}),Lp=new pe({namespace:"zframes:hyperliquid:oi",ttlMs:25e3}),Ip=new pe({namespace:"zframes:hyperliquid:candles",ttlMs:55e3,persist:!0}),Fp=new pe({namespace:"zframes:hyperliquid:funding",ttlMs:4.5*6e4,persist:!0}),Ia=e=>e?[...e].sort().join(","):"*";class jp{constructor(){X(this,"name","hyperliquid");X(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv","open-interest"]);X(this,"ws",null);X(this,"listeners",new Set);X(this,"reconnectTimer",null);X(this,"closedByUser",!1);X(this,"wantedDexes",new Set([""]));X(this,"subscribedDexes",new Set);X(this,"mergedMids",{})}subscribeMids(t,r){this.listeners.add(t);for(const n of r??[])this.wantedDexes.add($n(n));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}getDayStats(t){return Np.get(Ia(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 o=new Set(r);for(const i of n)o.add($n(i));const a={};return await Promise.all([...o].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await un(s),u=r.has(i);c.universe.forEach((h,f)=>{if(!u&&!n.has(h.name))return;const d=l[f];if(!d)return;const m=Number(d.markPx),p=Number(d.prevDayPx);!Number.isFinite(m)||!Number.isFinite(p)||(a[h.name]={markPx:m,prevDayPx:p,changePct:p?(m-p)/p*100:0})})})),a}getOpenInterest(t){return Lp.get(Ia(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 o=new Set(r);for(const i of n)o.add($n(i));const a=[];return await Promise.all([...o].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await un(s),u=r.has(i);c.universe.forEach((h,f)=>{if(!u&&!n.has(h.name))return;const d=l[f];if(!d)return;const m=Number(d.markPx),p=Number(d.openInterest);!Number.isFinite(m)||!Number.isFinite(p)||a.push({symbol:h.name,openInterestUsd:p*m})})})),a.sort((i,s)=>s.openInterestUsd-i.openInterestUsd)}getFundingHistory(t,r){return Fp.get(`${[...t].sort().join(",")}|${r}`,()=>this.fetchFundingHistory(t,r))}async fetchFundingHistory(t,r){const n=await Promise.all(t.map(async o=>{const i=(await un({type:"fundingHistory",coin:o,startTime:r})).map(s=>({time:s.time,fundingRate:Number(s.fundingRate)})).filter(s=>Number.isFinite(s.fundingRate)&&Number.isFinite(s.time));return[o,i]}));return Object.fromEntries(n)}getCandles(t,r,n){return Ip.get(`${t}|${r}|${n}`,()=>this.fetchCandles(t,r,n))}async fetchCandles(t,r,n){return(await un({type:"candleSnapshot",req:{coin:t,interval:r,startTime:n}})).map(a=>({time:a.t,open:Number(a.o),high:Number(a.h),low:Number(a.l),close:Number(a.c),volume:Number(a.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(Dp);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=r=>{var o;let n;try{n=JSON.parse(String(r.data))}catch{return}if(!(n.channel!=="allMids"||!((o=n.data)!=null&&o.mids))){for(const[a,i]of Object.entries(n.data.mids))this.mergedMids[a]=Number(i);for(const a of this.listeners)a(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 rr="https://mempool.space/api",Up=new pe({namespace:"zframes:mempool:fees",ttlMs:25e3,persist:!0}),Bp=new pe({namespace:"zframes:mempool:state",ttlMs:12e3,persist:!0}),Hp=new pe({namespace:"zframes:mempool:blocks",ttlMs:25e3,persist:!0}),Gp=new pe({namespace:"zframes:mempool:hashrate",ttlMs:25*6e4,persist:!0}),Vp=new pe({namespace:"zframes:mempool:difficulty",ttlMs:5e4,persist:!0}),Wp=new pe({namespace:"zframes:mempool:pools",ttlMs:4*6e4,persist:!0}),qp=new pe({namespace:"zframes:mempool:lightning",ttlMs:25*6e4,persist:!0});class Kp{constructor(){X(this,"name","mempool");X(this,"capabilities",["btc-fees","btc-mempool","btc-blocks","btc-hashrate","btc-difficulty","mining-pools","lightning-stats"])}async getBtcFees(){return Up.get("latest",async()=>{const t=await Se(`${rr}/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 Bp.get("latest",async()=>{const[t,r]=await Promise.all([Se(`${rr}/mempool`),Se(`${rr}/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(o=>({medianFee:o.medianFee,feeRange:Array.isArray(o.feeRange)?o.feeRange:[],totalFees:o.totalFees,nTx:o.nTx,blockVSize:o.blockVSize}));return{count:t.count,vsize:t.vsize,totalFee:t.total_fee,projected:n}})}async getBtcBlocks(t=8){return Hp.get(String(t),async()=>{const r=await Se(`${rr}/v1/blocks`);if(!Array.isArray(r))throw new Error("mempool blocks: unexpected response shape");return r.slice(0,t).map(n=>{var o,a,i,s,c,l;return{id:n.id,height:n.height,time:n.timestamp*1e3,txCount:n.tx_count,size:n.size,totalFees:((o=n.extras)==null?void 0:o.totalFees)??0,medianFee:((a=n.extras)==null?void 0:a.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 Gp.get(t,async()=>{const r=await Se(`${rr}/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 Vp.get("latest",async()=>{const t=await Se(`${rr}/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 Wp.get(t,async()=>{const r=await Se(`${rr}/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(o=>({name:o.name,slug:o.slug,blockCount:o.blockCount,sharePct:n>0?o.blockCount/n*100:0,rank:o.rank}))}})}async getLightningStats(){return qp.get("latest",async()=>{var n,o,a;const t=await Se(`${rr}/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:(o=t.previous)==null?void 0:o.channel_count,prevTotalCapacity:(a=t.previous)==null?void 0:a.total_capacity}})}}const Yp={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"}},Jp=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`},Fa={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Jr(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,r)=>{const n=r.toLowerCase();if(Fa[n])return Fa[n];if(r[0]==="#"){const o=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):t}return t})}const In=e=>e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1");function ja(e){return Jr(In(e).replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function St(e,t){const r=e.match(new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,"i"));return r?r[1]:void 0}function Zp(e){const t=[...e.matchAll(/<link\b[^>]*\bhref="([^"]+)"[^>]*>/gi)];if(t.length>0){const n=t.find(o=>/rel="alternate"/i.test(o[0]))??t.find(o=>!/\brel=/i.test(o[0]))??t[0];return Jr(n[1]).trim()}const r=St(e,"link");return r?Jr(In(r)).trim():void 0}function zr(e,t){const r=e.match(new RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`,"i"));return r?Jr(r[1]).trim():void 0}const dn=e=>!!e&&/^https:\/\//i.test(e);function Xp(e){var o,a;const t=(o=e.match(/<media:thumbnail\b[^>]*>/i))==null?void 0:o[0];if(t){const i=zr(t,"url");if(dn(i))return i}for(const i of e.matchAll(/<media:content\b[^>]*>/gi)){const s=zr(i[0],"medium"),c=zr(i[0],"type"),l=s==="image"||!s&&!(c!=null&&c.match(/^(audio|video)\//i)),u=zr(i[0],"url");if(l&&dn(u))return u}for(const i of e.matchAll(/<enclosure\b[^>]*>/gi)){if(!((a=zr(i[0],"type"))!=null&&a.startsWith("image/")))continue;const s=zr(i[0],"url");if(dn(s))return s}const r=St(e,"content:encoded")??St(e,"description")??St(e,"content")??St(e,"summary"),n=r?In(r).match(/<img\b[^>]*\bsrc="([^"]+)"/i):null;if(n){const i=Jr(n[1]).trim();if(dn(i))return i}}function Qp(e){const t=St(e,"pubDate")??St(e,"published")??St(e,"updated")??St(e,"dc:date");if(!t)return;const r=Date.parse(In(t).trim());return Number.isFinite(r)?r:void 0}function Ua(e,t,r){const n=[...e.matchAll(/<(item|entry)\b[\s\S]*?<\/\1>/gi)].map(a=>a[0]),o=[];for(const a of n){const i=St(a,"title"),s=Zp(a);if(!i||!s)continue;const c=ja(i);if(!c)continue;const l=St(a,"description")??St(a,"summary")??St(a,"content"),u=l?ja(l).slice(0,280):void 0,h=Qp(a),f=Xp(a);o.push({title:c,url:s,source:t,...u?{summary:u}:{},...h?{publishedAt:h}:{},...f?{imageUrl:f}:{}})}return o.some(a=>a.publishedAt!==void 0)&&o.sort((a,i)=>(i.publishedAt??0)-(a.publishedAt??0)),o.slice(0,r)}class $p{constructor(){X(this,"name","news");X(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 Yr(Jp(i),{proxied:!0,timeoutMs:12e3});return Ua(s,"Google News",n)}const o=Yp[t];if(!o)throw new Error(`news: unknown feed "${t}"`);const a=await Yr(o.url,{proxied:!0,timeoutMs:12e3});return Ua(a,o.source,n)}}const em="https://markets.newyorkfed.org/api/rates/all/latest.json",tm={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},Ba=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"],rm=new pe({namespace:"zframes:nyfed:rates",ttlMs:12*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});function fr(e){const t=Number(e);return Number.isFinite(t)?t:null}function nm(e,t){const r=Ba.indexOf(e.code),n=Ba.indexOf(t.code);return(r===-1?99:r)-(n===-1?99:n)}class om{constructor(){X(this,"name","nyfed");X(this,"capabilities",["reference-rates"])}async getReferenceRates(){return rm.get("latest",async()=>{const t=await Se(em);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??""),o=fr(r.percentRate??r.average30day);if(!n||!r.effectiveDate||o===null)return null;const a={code:n,label:tm[n]??n,date:r.effectiveDate,rate:o,source:"New York Fed"},i=fr(r.volumeInBillions),s=fr(r.targetRateFrom),c=fr(r.targetRateTo),l=fr(r.average30day),u=fr(r.average90day),h=fr(r.average180day);return i!==null&&(a.volumeInBillions=i),s!==null&&(a.targetRateFrom=s),c!==null&&(a.targetRateTo=c),l!==null&&(a.average30Day=l),u!==null&&(a.average90Day=u),h!==null&&(a.average180Day=h),a}).filter(r=>r!==null).sort(nm)})}}const am="https://www.financialresearch.gov/financial-stress-index/data/fsi.csv",im=60*6e4,sm=new pe({namespace:"zframes:ofr:fsi",ttlMs:im}),cm=[[2,"Credit"],[3,"Equity valuation"],[4,"Safe assets"],[5,"Funding"],[6,"Volatility"]];function Ha(e){const t=Number(e);return Number.isFinite(t)?t:null}function lm(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=Ha(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 o=r[r.length-1],a=cm.map(([i,s])=>({label:s,value:Ha(n[i])??0}));return{value:o.value,date:o.date,categories:a,trend:r.slice(-90),source:"OFR"}}class um{constructor(){X(this,"name","ofr");X(this,"capabilities",["financial-stress"])}async getFinancialStress(){return sm.get("latest",()=>Yr(am,{proxied:!0}).then(lm))}}const dm={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 uo(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function Ga(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,""),o=dm[n];return o===void 0?null:uo(o)}const fm=e=>`https://data.sec.gov/submissions/CIK${e}.json`,hm=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,gs=15*6e4,pm=new pe({namespace:"zframes:sec:filings",ttlMs:gs}),mm=new pe({namespace:"zframes:sec:facts",ttlMs:gs});function gm(e,t,r){const n=String(Number(e)),o=t.replace(/-/g,""),a=`https://www.sec.gov/Archives/edgar/data/${n}/${o}`;return r?`${a}/${r}`:`${a}/`}const vm=[{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 ym(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function bm(e,t){const r=e.filter(o=>o.end&&o.form&&Number.isFinite(o.val));return(t==="flow"&&r.some(o=>o.fp==="FY")?r.filter(o=>o.fp==="FY"):r).reduce((o,a)=>!o||a.end>o.end?a:o,null)}function wm(e){var r,n;if(!e)return[];const t=[];for(const o of vm){const a=e[o.taxonomy];if(!a)continue;let i=null;for(const s of o.concepts){const c=(n=(r=a[s])==null?void 0:r.units)==null?void 0:n[o.unit];if(!(c!=null&&c.length))continue;const l=bm(c,o.kind);l&&(!i||l.end>i.end)&&(i=l)}i&&t.push({label:o.label,value:i.val,unit:o.unit,end:i.end,fiscalPeriod:ym(i),form:i.form})}return t}class xm{constructor(t){X(this,"name","sec");X(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=Ga(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return mm.get(r,()=>this.fetchCompanyFacts(r))}async fetchCompanyFacts(t){const r=await Se(hm(t),void 0,{proxied:!0,...this.nodeInit()}),n=wm(r.facts);if(n.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:uo(r.cik??t),entityName:r.entityName??"",metrics:n}}async getCompanyFilings(t){const r=Ga(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return pm.get(r,()=>this.fetchFilings(r))}async fetchFilings(t){var i,s,c,l,u,h,f;const r=await Se(fm(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 o=n.accessionNumber.length,a=[];for(let d=0;d<o;d++){const m=n.accessionNumber[d],p=(s=n.form)==null?void 0:s[d],v=(c=n.filingDate)==null?void 0:c[d];if(!m||!p||!v)continue;const g=(l=n.reportDate)==null?void 0:l[d],b=(u=n.primaryDocDescription)==null?void 0:u[d],x=(h=n.items)==null?void 0:h[d];a.push({form:p,filingDate:v,accessionNumber:m,url:gm(t,m,(f=n.primaryDocument)==null?void 0:f[d]),...g?{reportDate:g}:{},...b?{description:b}:{},...x?{items:x}:{}})}return{cik:uo(r.cik??t),name:r.name??"",tickers:r.tickers??[],exchanges:r.exchanges??[],filings:a,...r.sic?{sic:r.sic}:{},...r.sicDescription?{sicDescription:r.sicDescription}:{},...r.category?{category:r.category}:{},...r.fiscalYearEnd?{fiscalYearEnd:r.fiscalYearEnd}:{}}}}const km="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",Cm=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`,_m=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`,Am=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}`,Fn=180*6e4,Sm=new pe({namespace:"zframes:treasury:yield-curve",ttlMs:Fn,persist:!0}),zm=new pe({namespace:"zframes:treasury:avg-rates",ttlMs:Fn,persist:!0}),Tm=new pe({namespace:"zframes:treasury:national-debt",ttlMs:Fn,persist:!0}),Em=new pe({namespace:"zframes:treasury:auctions",ttlMs:Fn,persist:!0}),Pm=[["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 Vt(e){const t=Number(e);return Number.isFinite(t)?t:null}function Mm(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function Om(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let r=null;for(const o of t){const a=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(o);if(!a)continue;const i=a[1].slice(0,10);(!r||i>r.date)&&(r={date:i,raw:o})}if(!r)return null;const n=[];for(const[o,a,i]of Pm){const s=new RegExp(`<d:${o}[^>]*>([^<]*)</d:${o}>`).exec(r.raw),c=s?Number(s[1]):NaN;Number.isFinite(c)&&n.push({label:a,months:i,rate:c})}return n.length?{date:r.date,points:n}:null}class Dm{constructor(){X(this,"name","treasury");X(this,"capabilities",["treasury-rates","yield-curve","treasury-auctions","national-debt"])}async getYieldCurve(){return Sm.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)),o=await Yr(Am(Mm(n)),{proxied:!0,timeoutMs:15e3}).catch(()=>""),a=Om(o);if(a)return a}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){return zm.get("latest",()=>this.fetchTreasuryAverageRates())}async fetchTreasuryAverageRates(){var n;const t=await Se(km,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(o=>o.record_date))==null?void 0:n.record_date;return r?t.data.filter(o=>o.record_date===r).map(o=>{const a=Vt(o.avg_interest_rate_amt);return a===null||!o.security_type_desc||!o.security_desc?null:{date:r,securityType:o.security_type_desc,security:o.security_desc,rate:a}}).filter(o=>o!==null):[]}async getNationalDebt(t=180){return Tm.get(String(t),()=>this.fetchNationalDebt(t))}async fetchNationalDebt(t){const r=Math.max(2,Math.min(t,400)),n=await Se(Cm(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 o=[];for(let i=n.data.length-1;i>=0;i--){const s=n.data[i],c=Vt(s.tot_pub_debt_out_amt),l=Date.parse(`${s.record_date}T00:00:00Z`);!s.record_date||c===null||!Number.isFinite(l)||o.push({time:l,date:s.record_date,total:c})}if(o.length===0)throw new Error("treasury debt to the penny: no usable rows");const a=n.data[0];return{date:a.record_date??o[o.length-1].date,total:Vt(a.tot_pub_debt_out_amt)??o[o.length-1].total,heldByPublic:Vt(a.debt_held_public_amt)??0,intragovernmental:Vt(a.intragov_hold_amt)??0,trend:o}}async getTreasuryAuctions(t=8){return Em.get(String(t),()=>this.fetchTreasuryAuctions(t))}async fetchTreasuryAuctions(t){const r=Math.max(1,Math.min(t,30)),n=await Se(_m(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(o=>{if(!o.auction_date||!o.security_type)return null;const a=Vt(o.high_yield)??Vt(o.high_investment_rate);return{auctionDate:o.auction_date,securityType:o.security_type,securityTerm:o.security_term??"",rate:a,bidToCover:Vt(o.bid_to_cover_ratio),offeringAmount:Vt(o.offering_amt),totalAccepted:Vt(o.total_accepted)}}).filter(o=>o!==null)}}function Rm(){return[new jp,new hp,new jh,new Xh,new tp,new om,new Dm,new qh,new xm,new zp,new um,new Op,new $p,new Kp,new bp]}const vs="(prefers-reduced-data: reduce)",ys="(pointer: coarse) and (max-width: 768px)";function Va(){var t;if(typeof window>"u")return!1;const e=navigator;return!!((t=e.connection)!=null&&t.saveData||window.matchMedia(vs).matches||(e.deviceMemory??8)<=4||(e.hardwareConcurrency??8)<=4||window.matchMedia(ys).matches)}function Nm(){const[e,t]=z.useState(Va);return z.useEffect(()=>{const r=[window.matchMedia(vs),window.matchMedia(ys)],n=()=>t(Va());for(const o of r)o.addEventListener("change",n);return()=>{for(const o of r)o.removeEventListener("change",n)}},[]),e}const Lm=z.lazy(()=>R(()=>import("./unicorn-scene-DcohHRPZ.js"),__vite__mapDeps([0,1]))),Im="/unicornStudio.umd.mjs",Wa="invert(1) hue-rotate(180deg) saturate(1.25)",Fm="opacity 0.5s var(--zf-ease-out), filter 0.5s var(--zf-ease-out)",jm=e=>Math.min(.42,e*2.4),Um=242,Bm=242,Hm=(e,t)=>{const r=((e-t)%360+360)%360;return r>180?r-360:r},bs=90,Gm=e=>Math.round(e/bs*1e3)/1e3;function Vm({background:e,active:t=!1,thinking:r=!1,accentHue:n=Um,accentSat:o=bs,sceneHue:a=Bm}){const i=Nm();if(e.type==="color"||e.type==="gradient"){const f=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:f}})}if(e.type!=="unicorn"||!e.projectId||i)return null;const s=Hm(n,a),c=Gm(o),l=[s===0?"":`hue-rotate(${s}deg)`,c===1?"":`saturate(${c})`].filter(Boolean).join(" "),u=l||"none",h=l?`${l} ${Wa}`:Wa;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?jm(e.opacity):e.opacity,filter:t?h:u,transition:Fm,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(z.Suspense,{fallback:null,children:w.jsx(Lm,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:Im},e.projectId)})})})})})}function Wm({currentTitle:e}){const[t,r]=z.useState(null),[n,o]=z.useState(!1),[a,i]=z.useState(null);z.useEffect(()=>{let u=!1;return fetch(fh,{cache:"no-store"}).then(h=>h.ok?h.json():null).then(h=>{if(u||!h||typeof h!="object")return;const f=h;f.canSwitch===!0&&Array.isArray(f.dashboards)&&r({current:typeof f.current=="string"?f.current:null,dashboards:f.dashboards})}).catch(()=>{}),()=>{u=!0}},[]),z.useEffect(()=>{if(!n)return;const u=h=>{h.key==="Escape"&&o(!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||a)){if(u===t.current){o(!1);return}i(u);try{const h=await fetch(hh,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u})});if(!h.ok)throw new Error(`HTTP ${h.status}`);window.location.reload()}catch(h){console.error("zframes: failed to switch dashboard",h),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:()=>o(!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&&ac.createPortal(w.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Choose a dashboard",onClick:u=>{u.target===u.currentTarget&&o(!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:()=>o(!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 h=u.name===t.current;return w.jsxs("button",{type:"button",disabled:a!==null,onClick:()=>void c(u.name),style:h?{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 ${h?"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"}),h&&w.jsx("span",{className:"caption text-strong rounded-full px-1.5 py-0.5 leading-none",style:{background:`${l} 30%)`},children:"current"}),a===u.name&&w.jsx("span",{className:"caption text-soft",children:"switching…"})]})]},u.name)})})]})}),document.body)]})}const qm={"portfolio-value":{load:()=>R(()=>import("./portfolio-value-D9qrGeZp.js"),__vite__mapDeps([2,1,3,4,5,6,7])).then(e=>e.portfolioValueFrame)},"portfolio-allocation":{load:()=>R(()=>import("./portfolio-allocation-Cat1vq2_.js"),__vite__mapDeps([8,1,4,6,7,9,10])).then(e=>e.portfolioAllocationFrame)},"portfolio-holdings":{load:()=>R(()=>import("./portfolio-holdings-DDDhMMFL.js"),__vite__mapDeps([11,1,4,6,7])).then(e=>e.portfolioHoldingsFrame)},"bitcoin-dominance":{load:()=>R(()=>import("./bitcoin-dominance-CtnczH5N.js"),__vite__mapDeps([12,1,4,7])).then(e=>e.bitcoinDominanceFrame)},clock:{load:()=>R(()=>import("./clock-BzAIAbhU.js"),__vite__mapDeps([13,1,7,14])).then(e=>e.clockFrame)},"daily-analysis":{load:()=>R(()=>import("./daily-analysis-CS5MqofA.js"),__vite__mapDeps([15,1,4,7])).then(e=>e.dailyAnalysisFrame)},"journal-log":{load:()=>R(()=>import("./journal-log-7APM_99k.js"),__vite__mapDeps([16,1,17,4,18,7])).then(e=>e.journalLogFrame)},"journal-open":{load:()=>R(()=>import("./journal-open-CcdGuysA.js"),__vite__mapDeps([19,1,18,4,20,17,7])).then(e=>e.journalOpenFrame)},"journal-results":{load:()=>R(()=>import("./journal-results-CUTn4-kq.js"),__vite__mapDeps([21,1,18,4,20,17,7])).then(e=>e.journalResultsFrame)},"journal-score":{load:()=>R(()=>import("./journal-score-C31dg2yL.js"),__vite__mapDeps([22,1,4,18,20,17])).then(e=>e.journalScoreFrame)},"dino-game":{load:()=>R(()=>import("./dino-game-gsyCpJ-0.js"),__vite__mapDeps([23,1,24,4])).then(e=>e.dinoGameFrame)},"fear-greed":{load:()=>R(()=>import("./fear-greed-DOcPswrx.js"),__vite__mapDeps([25,1,7,26,10,27])).then(e=>e.fearGreedFrame)},"filings-feed":{load:()=>R(()=>import("./filings-feed-Cs--DpYl.js"),__vite__mapDeps([28,1,29,4,7])).then(e=>e.filingsFeedFrame)},fundamentals:{load:()=>R(()=>import("./fundamentals-GseULnsD.js"),__vite__mapDeps([30,1,4,7])).then(e=>e.fundamentalsFrame)},"financial-stress":{load:()=>R(()=>import("./financial-stress-BqnxLk2O.js"),__vite__mapDeps([31,1,4,7,26,10,27])).then(e=>e.financialStressFrame)},"labor-market":{load:()=>R(()=>import("./labor-market-DgvDQtFo.js"),__vite__mapDeps([32,1,4,7,26,10,27])).then(e=>e.laborMarketFrame)},"national-debt":{load:()=>R(()=>import("./national-debt-BS57WjA3.js"),__vite__mapDeps([33,1,4,7,26,10,27])).then(e=>e.nationalDebtFrame)},"treasury-auctions":{load:()=>R(()=>import("./treasury-auctions-BpzYivLg.js"),__vite__mapDeps([34,1,4,35,7])).then(e=>e.treasuryAuctionsFrame)},"funding-heatmap":{load:()=>R(()=>import("./funding-heatmap-2RvVLTPN.js"),__vite__mapDeps([36,1,4,7,27])).then(e=>e.fundingHeatmapFrame)},"funding-rate-chart":{load:()=>R(()=>import("./funding-rate-chart-DCRKHp6g.js"),__vite__mapDeps([37,1,4,7,9,10,38,27,39])).then(e=>e.fundingRateChartFrame)},heading:{load:()=>R(()=>import("./heading-BaRMJq2t.js"),__vite__mapDeps([40,1])).then(e=>e.headingFrame)},image:{load:()=>R(()=>import("./image-CuTXEV7Q.js"),__vite__mapDeps([41,1,7])).then(e=>e.imageFrame)},"inflation-pulse":{load:()=>R(()=>import("./inflation-pulse-B8E9uzQB.js"),__vite__mapDeps([42,1,4,7,26,10,27])).then(e=>e.inflationPulseFrame)},"market-hours":{load:()=>R(()=>import("./market-hours-BArlXOQB.js"),__vite__mapDeps([43,1,44,4,7])).then(e=>e.marketHoursFrame),titleIcon:!0},"news-feed":{load:()=>R(()=>import("./news-feed-oBCTiuoo.js"),__vite__mapDeps([45,1,29,4,7])).then(e=>e.newsFeedFrame)},note:{load:()=>R(()=>import("./note-BLWlz52v.js"),__vite__mapDeps([46,1,7])).then(e=>e.noteFrame)},"price-chart":{load:()=>R(()=>import("./price-chart-CQJNOBtu.js"),__vite__mapDeps([47,1,3,4,5,7])).then(e=>e.priceChartFrame),titleIcon:!0,titleContent:!0},"price-compare":{load:()=>R(()=>import("./price-compare-DqBiHd7S.js"),__vite__mapDeps([48,1,4,7,9,10,38,27,39])).then(e=>e.priceCompareFrame),titleContent:!0},"price-liveline":{load:()=>R(()=>import("./price-liveline-BlVGC2-R.js"),__vite__mapDeps([49,1,3,4,5,9,10])).then(e=>e.priceLivelineFrame)},"price-ticker":{load:()=>R(()=>import("./price-ticker-QdVoVaQh.js"),__vite__mapDeps([50,1,51,4,7])).then(e=>e.priceTickerFrame)},"rates-board":{load:()=>R(()=>import("./rates-board-Dm3tb6-P.js"),__vite__mapDeps([52,1,4,35,7])).then(e=>e.ratesBoardFrame)},"fx-board":{load:()=>R(()=>import("./fx-board-CVW6VmbY.js"),__vite__mapDeps([53,1,4,7,26,10,27])).then(e=>e.fxBoardFrame)},"short-volume":{load:()=>R(()=>import("./short-volume-U-uFonb2.js"),__vite__mapDeps([54,1,4,7])).then(e=>e.shortVolumeFrame)},"top-movers":{load:()=>R(()=>import("./top-movers--vCUiTII.js"),__vite__mapDeps([55,1,51,4,7])).then(e=>e.topMoversFrame)},"tvl-treemap":{load:()=>R(()=>import("./tvl-treemap-BYgD9bNy.js"),__vite__mapDeps([56,1,4,57,27,10,7])).then(e=>e.tvlTreemapFrame)},"yield-curve":{load:()=>R(()=>import("./yield-curve-8IsrMS_9.js"),__vite__mapDeps([58,1,4,7])).then(e=>e.yieldCurveFrame)},"dex-volume-treemap":{load:()=>R(()=>import("./dex-volume-treemap-CLyIrkgU.js"),__vite__mapDeps([59,1,4,57,27,10,7])).then(e=>e.dexVolumeTreemapFrame)},"dex-volume-chart":{load:()=>R(()=>import("./dex-volume-chart-BfnczfAT.js"),__vite__mapDeps([60,1,4,7,9,10,38,27,39])).then(e=>e.dexVolumeChartFrame)},"protocol-tvl-treemap":{load:()=>R(()=>import("./protocol-tvl-treemap-DusQ6xL2.js"),__vite__mapDeps([61,1,4,57,27,10,7])).then(e=>e.protocolTvlTreemapFrame)},"protocol-tvl-chart":{load:()=>R(()=>import("./protocol-tvl-chart-DZOgbMZu.js"),__vite__mapDeps([62,1,4,7,9,10,38,27,39])).then(e=>e.protocolTvlChartFrame)},"protocol-fees-treemap":{load:()=>R(()=>import("./protocol-fees-treemap-39F-aE33.js"),__vite__mapDeps([63,1,4,57,27,10,7])).then(e=>e.protocolFeesTreemapFrame)},"market-cap-treemap":{load:()=>R(()=>import("./market-cap-treemap-6vqLUgVk.js"),__vite__mapDeps([64,1,4,57,27,10,7])).then(e=>e.marketCapTreemapFrame)},"open-interest":{load:()=>R(()=>import("./open-interest-DxMqZcmu.js"),__vite__mapDeps([65,1,4,7])).then(e=>e.openInterestFrame)},snake:{load:()=>R(()=>import("./snake-Dp4E3Dcv.js"),__vite__mapDeps([66,1,24,4])).then(e=>e.snakeFrame)},"flappy-bird":{load:()=>R(()=>import("./flappy-bird-DaasqVGg.js"),__vite__mapDeps([67,1,24,4])).then(e=>e.flappyBirdFrame)},video:{load:()=>R(()=>import("./video-D-nBm697.js"),__vite__mapDeps([68,1,7])).then(e=>e.videoFrame)},drawdy:{load:()=>R(()=>import("./drawdy-CZWCFtog.js"),__vite__mapDeps([69,1,7])).then(e=>e.drawdyFrame)},countdown:{load:()=>R(()=>import("./countdown-ZAJmbykg.js"),__vite__mapDeps([70,1,7,14])).then(e=>e.countdownFrame)},"link-grid":{load:()=>R(()=>import("./link-grid-DlsY59eq.js"),__vite__mapDeps([71,1,17,7])).then(e=>e.linkGridFrame)},calculator:{load:()=>R(()=>import("./calculator-D91iI7KM.js"),__vite__mapDeps([72,1,17,7])).then(e=>e.calculatorFrame)},quote:{load:()=>R(()=>import("./quote-Di049ggj.js"),__vite__mapDeps([73,1])).then(e=>e.quoteFrame)},divider:{load:()=>R(()=>import("./divider-DCTu-qNh.js"),__vite__mapDeps([74,1])).then(e=>e.dividerFrame)},marquee:{load:()=>R(()=>import("./marquee-2Di2SqI2.js"),__vite__mapDeps([75,1])).then(e=>e.marqueeFrame)},dice:{load:()=>R(()=>import("./dice-CAvRf0md.js"),__vite__mapDeps([76,1,17,7])).then(e=>e.diceFrame)},"risk-reward":{load:()=>R(()=>import("./risk-reward-1Q_Kt75s.js"),__vite__mapDeps([77,1,17,4,7])).then(e=>e.riskRewardFrame)},stopwatch:{load:()=>R(()=>import("./stopwatch-B2_iDkKK.js"),__vite__mapDeps([78,1,17])).then(e=>e.stopwatchFrame)},"session-progress":{load:()=>R(()=>import("./session-progress-D_1dzPzM.js"),__vite__mapDeps([79,1,44,7])).then(e=>e.sessionProgressFrame)},"btc-fees":{load:()=>R(()=>import("./btc-fees-5Geh2TSa.js"),__vite__mapDeps([80,1,81,4,7])).then(e=>e.btcFeesFrame)},"btc-mempool":{load:()=>R(()=>import("./btc-mempool-8oOMDiaW.js"),__vite__mapDeps([82,1,81,4,7])).then(e=>e.btcMempoolFrame)},"btc-blocks":{load:()=>R(()=>import("./btc-blocks-D1xOLm2L.js"),__vite__mapDeps([83,1,4,7])).then(e=>e.btcBlocksFrame)},"btc-hashrate":{load:()=>R(()=>import("./btc-hashrate-DZfnxUsi.js"),__vite__mapDeps([84,1,4,7,26,10,27])).then(e=>e.btcHashrateFrame)},"btc-difficulty":{load:()=>R(()=>import("./btc-difficulty-BTbKIqrl.js"),__vite__mapDeps([85,1,4,7])).then(e=>e.btcDifficultyFrame)},"mining-pools":{load:()=>R(()=>import("./mining-pools-Bg02wm2V.js"),__vite__mapDeps([86,1,4,57,27,10,7])).then(e=>e.miningPoolsFrame)},"lightning-stats":{load:()=>R(()=>import("./lightning-stats-CiUlm-e_.js"),__vite__mapDeps([87,1,4,7])).then(e=>e.lightningStatsFrame)},"options-put-call":{load:()=>R(()=>import("./options-put-call-CyOwXBVQ.js"),__vite__mapDeps([88,1,4,7])).then(e=>e.optionsPutCallFrame)},"options-iv":{load:()=>R(()=>import("./options-iv-CgIIFdpN.js"),__vite__mapDeps([89,1,4,7,26,10,27])).then(e=>e.optionsIvFrame)},"options-oi-strike":{load:()=>R(()=>import("./options-oi-strike-blRp4kmB.js"),__vite__mapDeps([90,1,4,7])).then(e=>e.optionsOiStrikeFrame)},"coin-movers":{load:()=>R(()=>import("./coin-movers-99W2EABZ.js"),__vite__mapDeps([91,1,51,4,7])).then(e=>e.coinMoversFrame)},"holiday-calendar":{load:()=>R(()=>import("./holiday-calendar-2OBfwbh-.js"),__vite__mapDeps([92,1,44,35,7])).then(e=>e.holidayCalendarFrame)},"day-meter":{load:()=>R(()=>import("./day-meter-DzBvLcpd.js"),__vite__mapDeps([93,1,44,7])).then(e=>e.dayMeterFrame)},"returns-projector":{load:()=>R(()=>import("./returns-projector-BiMx_kSw.js"),__vite__mapDeps([94,1,17,4,26,10,27])).then(e=>e.returnsProjectorFrame)},breakeven:{load:()=>R(()=>import("./breakeven-zbCEQ5ag.js"),__vite__mapDeps([95,1,17,4,7])).then(e=>e.breakevenFrame)},checklist:{load:()=>R(()=>import("./checklist-DNrOJw0w.js"),__vite__mapDeps([96,1,7])).then(e=>e.checklistFrame)},pomodoro:{load:()=>R(()=>import("./pomodoro-BKJlh-bz.js"),__vite__mapDeps([97,1,17])).then(e=>e.pomodoroFrame)},"rules-card":{load:()=>R(()=>import("./rules-card-BkAX9PEq.js"),__vite__mapDeps([98,1,7])).then(e=>e.rulesCardFrame)},breathing:{load:()=>R(()=>import("./breathing-6Wmy_hqF.js"),__vite__mapDeps([99,1])).then(e=>e.breathingFrame)},"spotify-embed":{load:()=>R(()=>import("./spotify-embed-Cw95WZjV.js"),__vite__mapDeps([100,1,7])).then(e=>e.spotifyEmbedFrame)}},L=e=>`/widget-icons/${e}.png`,ie={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"}},Km={name:"clock",label:"Clock",category:"tools",iconUrl:L("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:M({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:rt().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:rt().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:rt().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:rt().default(!1).describe("Show the weekday and date under the time."),showTimezone:rt().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".')})},Ym={name:"market-hours",label:"Market Hours",category:"tools",iconUrl:L("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:M({exchanges:Ke(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:ke(["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.")})},Jm={name:"fear-greed",label:"Fear & Greed",category:"sentiment",iconUrl:L("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:ie.alternativeMe,schema:M({sparklineDays:F().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},Zm={name:"funding-rate-chart",label:"Funding Rate Chart",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(W()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:ke(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},Xm={name:"note",label:"Note",category:"layout",iconUrl:L("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:M({text:W().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:ke(["left","center"]).default("left").describe("Text alignment inside the card.")})},Qm={name:"price-chart",label:"Price Chart",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({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:ke(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:ke(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:W().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},$m={name:"price-liveline",label:"Price Liveline",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(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:F().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:rt().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},e0={name:"price-ticker",label:"Price Ticker",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(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".')})},t0={name:"top-movers",label:"Top Movers",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({count:F().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},r0={name:"tvl-treemap",label:"TVL Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},n0={name:"bitcoin-dominance",label:"Bitcoin Dominance",category:"crypto",iconUrl:L("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:ie.coingecko,schema:M({showTotalMarketCap:rt().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},o0={name:"rates-board",label:"Rates Board",category:"macro",iconUrl:L("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:[ie.nyFed,ie.treasury],schema:M({maxReferenceRates:F().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:rt().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:F().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},a0={name:"fx-board",label:"FX Board",category:"macro",iconUrl:L("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:ie.frankfurter,schema:M({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:Ke(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:rt().default(!0).describe("Show a small ~30-day trend sparkline next to each rate.")})},i0={name:"inflation-pulse",label:"Inflation Pulse",category:"macro",iconUrl:L("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:ie.bls,schema:M({months:F().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},s0={name:"financial-stress",label:"Financial Stress",category:"macro",iconUrl:L("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:ie.ofr,schema:M({trendDays:F().int().min(20).max(90).default(60).describe("How many recent daily readings to plot in the trend line."),showCategories:rt().default(!0).describe("Show the five category contributions (credit, equity valuation, safe assets, funding, volatility) under the headline.")})},c0={name:"national-debt",label:"National Debt",category:"macro",iconUrl:L("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:ie.treasury,schema:M({trendDays:F().int().min(30).max(365).default(180).describe("How many business days of history to load for the trend and the change figure."),showSplit:rt().default(!0).describe("Show the debt-held-by-the-public vs intragovernmental-holdings split.")})},l0={name:"labor-market",label:"Labor Market",category:"macro",iconUrl:L("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:ie.bls,schema:M({months:F().int().min(13).max(36).default(18).describe("How many monthly observations to show in the trend.")})},u0={name:"treasury-auctions",label:"Treasury Auctions",category:"macro",iconUrl:L("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:ie.treasury,schema:M({count:F().int().min(3).max(20).default(8).describe("How many recent auctions to list (newest first).")})},d0={name:"filings-feed",label:"Filings Feed",category:"equities",iconUrl:L("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:ie.secEdgar,schema:M({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:ke(["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:F().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},f0={name:"yield-curve",label:"Yield Curve",category:"macro",iconUrl:L("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:ie.treasury,schema:M({maturities:Ke(ke(["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).")})},h0={name:"fundamentals",label:"Fundamentals",category:"equities",iconUrl:L("fundamentals"),layout:{w:4,h:3,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:ie.secEdgar,schema:M({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.')})},p0={name:"short-volume",label:"Short Volume",category:"equities",iconUrl:L("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:ie.finra,schema:M({symbols:Ke(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:ke(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},m0={name:"funding-heatmap",label:"Funding Heatmap",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(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"].')})},g0={name:"dino-game",label:"Dino Game",category:"games",iconUrl:L("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:M({})},v0={name:"image",label:"Image",category:"layout",iconUrl:L("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:M({url:W().min(1).describe("Image URL (https)."),alt:W().default("").describe("Alt text for accessibility."),fit:ke(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},y0={name:"heading",label:"Heading",category:"layout",iconUrl:L("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:M({title:W().min(1).describe("The heading text."),subtitle:W().optional().describe("Smaller supporting line under the title.")})},b0={name:"daily-analysis",label:"Daily Analysis",category:"tools",iconUrl:L("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:M({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:F().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:F().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},w0={name:"journal-log",label:"Journal · Log",category:"journal",iconUrl:L("journal-log"),layout:{w:4,h:5,minW:3,minH:4},source:ie.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:M({})},x0={name:"journal-open",label:"Journal · Open",category:"journal",iconUrl:L("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:ie.hyperliquid,capabilities:["quote-stream"],schema:M({max:F().int().min(1).max(20).default(8).describe("How many open calls to show (newest first).")})},k0={name:"journal-results",label:"Journal · Results",category:"journal",iconUrl:L("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:M({max:F().int().min(1).max(20).default(8).describe("How many resolved calls to show (newest first).")})},C0={name:"journal-score",label:"Journal · Scoreboard",category:"journal",iconUrl:L("journal-score"),layout:{w:4,h:2,minW:3,minH:2},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:M({})},_0={name:"price-compare",label:"Price Compare",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(W()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:ke(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:rt().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.")})},Io={source:ke(["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".')},A0={name:"portfolio-value",label:"Portfolio Value",category:"portfolio",iconUrl:L("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:M({...Io,windowSec:F().int().positive().default(300).describe("Seconds of live history the equity line shows; it accumulates from when the dashboard opens.")})},S0={name:"portfolio-allocation",label:"Portfolio Allocation",category:"portfolio",iconUrl:L("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:M({...Io})},z0={name:"portfolio-holdings",label:"Portfolio Holdings",category:"portfolio",iconUrl:L("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:M({...Io})},T0={name:"news-feed",label:"News Feed",category:"sentiment",iconUrl:L("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:M({source:ke(["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:Ke(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:F().int().min(3).max(20).default(8).describe("How many headlines to list (newest first).")})},E0={name:"dex-volume-treemap",label:"DEX Volume Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the highest-volume DEX protocols to show.")})},P0={name:"dex-volume-chart",label:"DEX Volume Chart",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({protocols:Ke(W()).min(1).max(6).describe('DeFiLlama DEX protocol slugs (lowercase, hyphenated), e.g. ["uniswap", "pancakeswap", "aerodrome-slipstream"]. 1 to 6.'),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},M0={name:"protocol-tvl-treemap",label:"Protocol TVL Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the largest protocols by TVL to show.")})},O0={name:"protocol-tvl-chart",label:"Protocol TVL Chart",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({protocols:Ke(W()).min(1).max(6).describe('DeFiLlama protocol slugs (lowercase, hyphenated), e.g. ["lido", "aave", "eigenlayer"]. 1 to 6.'),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},D0={name:"protocol-fees-treemap",label:"Protocol Fees Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the highest fee-earning protocols to show.")})},R0={name:"market-cap-treemap",label:"Market Cap Treemap",category:"crypto",iconUrl:L("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:ie.coingecko,schema:M({topN:F().int().min(5).max(50).default(12).describe("How many of the largest coins by market cap to show (up to 50).")})},N0={name:"open-interest",label:"Open Interest",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:Ke(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.`)})},L0={name:"snake",label:"Snake",category:"games",iconUrl:L("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:M({})},I0={name:"flappy-bird",label:"Flappy Bird",category:"games",iconUrl:L("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:M({})},F0={name:"video",label:"Video",category:"layout",iconUrl:L("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:M({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).")})},j0={name:"drawdy",label:"Drawdy",category:"layout",iconUrl:L("drawdy"),layout:{w:8,h:6,minW:2,minH:2},description:"Embeds drawdy.io as an interactive whiteboard canvas. No configuration needed.",capabilities:[],schema:M({})},U0={name:"countdown",label:"Countdown",category:"tools",iconUrl:L("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:M({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:rt().default(!0).describe("Show the formatted target date and time under the countdown.")})},B0={name:"link-grid",label:"Quick Links",category:"tools",iconUrl:L("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:M({links:Ke(M({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:F().int().min(1).max(4).default(2).describe("How many tiles per row.")})},H0={name:"calculator",label:"Position Calculator",category:"tools",iconUrl:L("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:M({account:F().positive().default(1e4).describe("Account size used as the risk base, in the quote currency."),riskPct:F().positive().max(100).default(1).describe("Percent of the account risked on the trade, e.g. 1 = 1%."),entry:F().positive().default(100).describe("Entry price."),stop:F().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.")})},G0={name:"quote",label:"Quote",category:"layout",iconUrl:L("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:M({quotes:Ke(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:F().int().min(0).default(12).describe("Seconds between rotations when there are multiple quotes. 0 shows the first quote, fixed.")})},V0={name:"divider",label:"Divider",category:"layout",iconUrl:L("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:M({label:W().default("").describe("Optional text shown in the middle of the rule. Empty = a clean line."),orientation:ke(["horizontal","vertical"]).default("horizontal").describe("Horizontal rule (spans the width) or vertical rule (spans the height)."),style:ke(["solid","dashed","dotted"]).default("solid").describe("Line style.")})},W0={name:"dice",label:"Dice",category:"tools",iconUrl:L("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:M({mode:ke(["coin","dice","list"]).default("coin").describe("coin = heads/tails, dice = 1–6, list = random pick from options."),options:Ke(W()).default(["Yes","No"]).describe("Choices used in list mode."),label:W().default("").describe("Optional caption, e.g. the question being decided.")})},q0={name:"risk-reward",label:"Risk / Reward",category:"tools",iconUrl:L("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:M({entry:F().default(100).describe("Planned entry price."),stop:F().default(95).describe("Stop-loss price."),target:F().default(115).describe("Profit target price."),direction:ke(["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.")})},K0={name:"marquee",label:"Marquee",category:"layout",iconUrl:L("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:M({text:W().default("LFG").describe("The text that scrolls across the banner."),speed:ke(["slow","normal","fast"]).default("normal").describe("Scroll speed."),accent:rt().default(!0).describe("Tint the text with the dashboard accent color.")})},Y0={name:"stopwatch",label:"Stopwatch",layout:{w:3,h:2,minW:2,minH:1},category:"tools",iconUrl:L("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:M({label:W().default("Session").describe("Caption above the timer."),startedAt:F().default(0).describe("Epoch ms when the timer was last started; 0 = paused. Persisted automatically by the frame."),accumulatedMs:F().default(0).describe("Milliseconds banked before the current run. Persisted automatically by the frame.")})},J0={name:"session-progress",label:"Session Progress",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),label:W().default("").describe("Optional caption shown by the exchange code."),showCountdown:rt().default(!0).describe("Show the time-to-open / time-to-close countdown.")})},Z0={name:"holiday-calendar",label:"Holiday Calendar",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),count:F().int().min(1).max(20).default(5).describe("How many upcoming holidays to list."),label:W().default("").describe("Optional caption shown above the list.")})},X0={name:"day-meter",label:"Day Meter",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),weekdaysOnly:rt().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.")})},Q0={name:"returns-projector",label:"Returns Projector",category:"tools",iconUrl:L("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:M({principal:F().default(1e3).describe("Starting balance."),ratePct:F().default(5).describe("Return per period, in percent (e.g. 5 = 5%)."),periods:F().int().min(1).max(600).default(12).describe("Number of compounding periods to project."),contribution:F().default(0).describe("Amount added at the end of each period."),label:W().default("").describe("Optional caption.")})},$0={name:"breakeven",label:"Break-even",category:"tools",iconUrl:L("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:M({fills:Ke(M({price:F().describe("Fill price."),size:F().describe("Fill size, in units.")})).default([{price:100,size:1}]).describe("Your entry fills; their size-weighted average is the break-even."),currentPrice:F().default(0).describe("Optional current price; greater than 0 shows the unrealized P&L %."),label:W().default("").describe("Optional caption.")})},eg={name:"checklist",label:"Checklist",category:"tools",iconUrl:L("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:M({title:W().default("Pre-trade checklist").describe("Heading shown above the list."),items:Ke(W()).default(["Trend & bias aligned","Stop level set","Risk sized correctly"]).describe("The checklist items, top to bottom."),checked:Ke(rt()).default([]).describe("Per-item checked state (by index); persisted automatically by the frame.")})},tg={name:"pomodoro",label:"Pomodoro",category:"tools",iconUrl:L("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:M({workMin:F().min(1).max(180).default(25).describe("Work interval length, in minutes."),breakMin:F().min(1).max(120).default(5).describe("Break interval length, in minutes."),cycles:F().int().min(1).max(20).default(4).describe("Work/break cycles before the counter loops."),label:W().default("").describe("Optional caption.")})},rg={name:"rules-card",label:"Rules",category:"layout",iconUrl:L("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:M({title:W().default("My rules").describe("Heading shown above the list."),rules:Ke(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.")})},ng={name:"breathing",label:"Breathing",category:"layout",iconUrl:L("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:M({inhale:F().min(1).max(60).default(4).describe("Inhale seconds."),hold:F().min(0).max(60).default(4).describe("Hold-after-inhale seconds."),exhale:F().min(1).max(60).default(4).describe("Exhale seconds."),holdAfter:F().min(0).max(60).default(4).describe("Hold-after-exhale seconds.")})},og={name:"spotify-embed",label:"Spotify",category:"layout",iconUrl:L("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:M({url:W().default("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M").describe("A Spotify share URL (open.spotify.com/track|album|playlist|artist/…)."),compact:rt().default(!1).describe("Use Spotify's compact (single-row) player height.")})},ag={name:"btc-fees",label:"BTC Fees",category:"bitcoin",iconUrl:L("btc-fees"),layout:{w:3,h:2,minW:2,minH:2},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:ie.mempool,schema:M({tiers:Ke(ke(["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.')})},ig={name:"btc-mempool",label:"BTC Mempool",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({projectedBlocks:F().int().min(1).max(8).default(5).describe("How many projected (yet-to-be-mined) blocks to show, next-to-mine first.")})},sg={name:"btc-blocks",label:"BTC Blocks",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({count:F().int().min(3).max(15).default(8).describe("How many recent blocks to list (newest first).")})},cg={name:"btc-hashrate",label:"BTC Hashrate",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({window:ke(["1y","2y","3y"]).default("1y").describe("History window for the hashrate line.")})},lg={name:"btc-difficulty",label:"BTC Difficulty",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({showPrevious:rt().default(!0).describe("Also show the percentage change applied at the previous retarget.")})},ug={name:"mining-pools",label:"Mining Pools",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({window:ke(["24h","3d","1w","1m"]).default("1w").describe("Window over which to measure each pool's block share."),topN:F().int().min(3).max(25).default(12).describe("How many of the largest pools to show; the rest fold into 'Other'.")})},dg={name:"lightning-stats",label:"Lightning Network",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({showSplit:rt().default(!0).describe("Show the Tor vs clearnet node split under the headline stats.")})},fg={name:"options-put-call",label:"Put / Call Ratio",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which Deribit options book to summarise — BTC or ETH (the only deeply liquid books)."),basis:ke(["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.')})},hg={name:"options-iv",label:"Implied Volatility",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which DVOL volatility index to plot — BTC or ETH."),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the volatility-index line.")})},pg={name:"options-oi-strike",label:"OI by Strike",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which Deribit options book — BTC or ETH."),strikes:F().int().min(6).max(30).default(14).describe("How many strikes nearest the current spot to show (centered on the underlying price).")})},mg={name:"coin-movers",label:"Coin Movers",category:"markets",iconUrl:L("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:ie.coinpaprika,schema:M({window:ke(["1h","24h","7d","30d"]).default("24h").describe("Which price-change window ranks the movers: 1h (intraday momentum), 24h (daily), 7d (weekly), 30d (monthly)."),count:F().int().min(3).max(15).default(6).describe("How many gainers and how many losers to list (each side)."),minRank:F().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.")})},gg=[T0,A0,S0,z0,n0,Km,b0,g0,Jm,d0,h0,s0,l0,c0,u0,m0,Zm,y0,v0,i0,Ym,Xm,Qm,_0,$m,e0,o0,a0,p0,t0,r0,f0,E0,P0,M0,O0,D0,R0,N0,L0,I0,F0,j0,U0,B0,H0,G0,V0,ag,ig,sg,cg,lg,ug,dg,fg,hg,pg,mg],vg=[...gg,$0,ng,eg,X0,W0,Z0,w0,x0,k0,C0,K0,tg,Q0,q0,rg,J0,og,Y0],qa=()=>null;function yg(){const e=new Map;for(const t of vg){const r=qm[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 o=()=>n??(n=r.load().catch(c=>{throw n=null,c})),a=z.lazy(()=>o().then(c=>({default:c.component}))),i=r.titleIcon?z.lazy(()=>o().then(c=>(c.titleIcon||console.warn(`[zframes] frame "${t.name}" is flagged titleIcon but its module exports none`),{default:c.titleIcon??qa}))):void 0,s=r.titleContent?z.lazy(()=>o().then(c=>(c.titleContent||console.warn(`[zframes] frame "${t.name}" is flagged titleContent but its module exports none`),{default:c.titleContent??qa}))):void 0;e.set(t.name,{...t,component:a,titleIcon:i,titleContent:s})}return e}function jn(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function ws(e){return e.includes(":")}function bg(e){const t=jn(e);return ws(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const Ka=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function wg(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)|0;return Ka[Math.abs(t)%Ka.length]}function xg({symbol:e,size:t=18,className:r=""}){const n=jn(e),o=ws(e),[a,i]=z.useState(!1);z.useEffect(()=>i(!1),[e]);const s=o?"rounded-[5px]":"rounded-full",c={width:t,height:t};return a?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:wg(n),fontSize:Math.round(t*.42)},children:n.slice(0,2).toUpperCase()}):w.jsx("img",{src:bg(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>i(!0),className:`shrink-0 object-contain ${s} ${o?"bg-white p-px":""} ${r}`,style:c})}const kg=["xyz:*"],Cg=200,_g="var(--zf-up, #3fd08f)",Ag="var(--zf-down, #ff6b81)";function Ya(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const Sg=`
|
|
510
|
+
`,fs=()=>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 Xn({outerClassName:e,style:t,headline:r,frame:n,children:o}){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(fs,{})}),w.jsx("div",{className:"zf-error-headline",children:r}),w.jsx("div",{className:"zf-error-frame",children:n}),o]})})}function ah({sources:e}){return e.length===0?null:w.jsx("span",{className:"zf-frame-source",children:e.map((t,r)=>w.jsxs(z.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 Oa extends z.Component{constructor(){super(...arguments);X(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(fs,{})}),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 Mr=(...e)=>e.filter(Boolean).join(" ");function ih({style:e,className:t,hasIcon:r,titleIcon:n,title:o,titleContent:a,sources:i,children:s}){const c=z.useRef(null),l=z.useRef(!0),u=z.useRef(null);u.current||(u.current=new Set);const h=z.useRef(null);if(!h.current){const f=u.current;h.current={visibleRef:l,subscribe:d=>(f.add(d),()=>{f.delete(d)})}}return z.useEffect(()=>{const f=c.current;if(!f||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(m=>{const p=m[0];if(!p)return;const v=p.isIntersecting;if(v!==l.current){l.current=v;for(const g of[...u.current])g(v)}},{rootMargin:"200px"});return d.observe(f),()=>d.disconnect()},[]),w.jsx(us.Provider,{value:h.current,children:w.jsxs("div",{ref:c,className:Mr("zf-frame",t),style:e,children:[w.jsxs("div",{className:Mr("zf-frame-title",r?"zf-frame-title--icon":""),children:[n,w.jsx("span",{className:"zf-frame-title-text",children:a??o}),w.jsx(ah,{sources:i})]}),w.jsx("div",{className:"zf-frame-body",children:s})]})})}function sh({instance:e,registry:t,style:r,className:n=""}){const o=Nn(),a=t.get(e.frame);if(!a)return w.jsxs(Xn,{outerClassName:Mr("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(o.flatMap(d=>[...d.capabilities])),s=a.capabilities.filter(d=>!i.has(d));if(s.length>0)return w.jsx(Xn,{outerClassName:Mr("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(z.Fragment,{children:[m>0&&", ",w.jsx("code",{children:d})]},d)),"."]})});const c=a.schema.safeParse(e.config);if(!c.success)return w.jsx(Xn,{outerClassName:Mr("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=a.component,u=a.titleIcon,h=a.titleContent,f=a.source?Array.isArray(a.source)?a.source:[a.source]:[];return a.chrome==="bare"?w.jsx("div",{className:Mr("zf-bare",n),style:r,children:w.jsx(Oa,{children:w.jsx(z.Suspense,{fallback:null,children:w.jsx(l,{config:c.data})})})}):w.jsx(ih,{style:r,className:n,hasIcon:!!u,title:e.title??a.label,sources:f,titleIcon:u?w.jsx(z.Suspense,{fallback:null,children:w.jsx(u,{config:c.data})}):null,titleContent:e.title==null&&h?w.jsx(z.Suspense,{fallback:null,children:w.jsx(h,{config:c.data})}):void 0,children:w.jsx(Oa,{children:w.jsx(z.Suspense,{fallback:w.jsx("div",{className:"zf-frame-skeleton"}),children:w.jsx(l,{config:c.data})})})})}const ch=z.memo(sh);function lh(e,t,r,n,o){var u;const a={"--zf-enter-i":t,"--zf-col-span-sm":e.position.w>=o/2?2:1};if(r){const h=(u=e.layouts)==null?void 0:u["flow-horizontal"];return h?{...a,"--zf-col-start":h.x+1,"--zf-col-span":h.w,"--zf-row-start":h.y+1,"--zf-row-span":Math.min(h.h,n)}:{...a,"--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{...a,"--zf-col-start":i+1,"--zf-col-span":c,"--zf-row-start":s+1,"--zf-row-span":l}}function Da({spec:e,registry:t}){const r=e.grid.mode==="flow-horizontal",n=z.useMemo(()=>e.frames.map((o,a)=>lh(o,a,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:oh}),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-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":Kf[e.typography.fontFamily],"--zf-numeric":qf[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((o,a)=>w.jsx(ch,{instance:o,registry:t,style:n[a]},o.id))})]})}const uh="/__zframes/dashboard.json",dh="/__zframes/dashboard",fh="/__zframes/dashboards",hh="/__zframes/switch",ph="/__zframes/proxy",mh="/__zframes/account/portfolio",gb="/__zframes/account/credentials",gh="/__zframes/agents",vh="/__zframes/ask";class pe{constructor(t){X(this,"entries",new Map);X(this,"inflight",new Map);X(this,"namespace");X(this,"ttlMs");X(this,"persist");X(this,"staleOnError");X(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 o=this.inflight.get(t);if(o)return o;const a=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,a),a}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 o=JSON.parse(n);if(typeof(o==null?void 0:o.at)!="number")return null;let a;if(this.revive){const s=this.revive(o.value);if(s===null)return null;a=s}else a=o.value;const i={at:o.at,value:a};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 yh=new pe({namespace:"zframes:binance:portfolio",ttlMs:45e3,persist:!1});class bh{constructor(){X(this,"name","Binance");X(this,"capabilities",["portfolio"]);X(this,"portfolioKinds",["binance"])}async getPortfolio(t){if(t.kind!=="binance")throw new Error(`BinanceProvider can't serve source: ${t.kind}`);return yh.get("binance",async()=>{const r=await fetch(`${mh}?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 wh=1e4,xh="zframes (+https://github.com/zentryhq/zframes)";async function hs(e,{timeoutMs:t=wh,init:r,proxied:n}){const o=new Headers(r==null?void 0:r.headers);typeof document>"u"&&!o.has("User-Agent")&&o.set("User-Agent",xh);const a=n&&typeof document<"u"?`${ph}?url=${encodeURIComponent(e)}`:e,i=await fetch(a,{...r,headers:o,signal:(r==null?void 0:r.signal)??AbortSignal.timeout(t)});if(!i.ok)throw new Error(`${e} failed: ${i.status}`);return i}async function Se(e,t,r={}){const o=await(await hs(e,r)).json();return t?t.parse(o):o}async function Yr(e,t={}){return(await hs(e,t)).text()}const kh=["https://ethereum-rpc.publicnode.com","https://cloudflare-eth.com","https://1rpc.io/eth"],Ch="https://api.coingecko.com/api/v3/simple/price",_h="0x70a08231",Ah=1,Sh={symbol:"ETH",address:null,decimals:18,cgId:"ethereum"},_n=[Sh,{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"}],Ra=/^0x[0-9a-fA-F]{40}$/;async function zh(e){const t=e.trim();if(Ra.test(t))return t;try{const r=await Se(`https://api.ensideas.com/ens/resolve/${encodeURIComponent(t)}`);if(r.address&&Ra.test(r.address))return r.address}catch{}throw new Error(`couldn't resolve address: ${t}`)}function Th(e){return`${_h}000000000000000000000000${e.slice(2).toLowerCase()}`}function Eh(e,t){if(!e||e==="0x")return 0;try{return Number(BigInt(e))/10**t}catch{return 0}}async function Ph(e){var s;const t=_n.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:Th(e)},"latest"]}),r=JSON.stringify(t);let n=null,o;for(const c of kh)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 f=((s=u==null?void 0:u.error)==null?void 0:s.message)??"non-array response";throw new Error(`rpc ${c}: ${f}`)}const h=u;if(!h.some(f=>typeof f.result=="string"))throw new Error(`rpc ${c}: no results (throttled?)`);n=h;break}catch(l){o=l}if(!n)throw new Error(`all RPC endpoints failed: ${String(o)}`);const a=new Map;for(const c of n)c.result&&a.set(c.id,c.result);const i=new Map;return _n.forEach((c,l)=>{const u=Eh(a.get(l),c.decimals);u>0&&i.set(c.symbol,u)}),i}const Mh=[...new Set(_n.map(e=>e.cgId))],Oh=new pe({namespace:"zframes:wallet:prices",ttlMs:10*6e4,persist:!0});async function Dh(){return Oh.get("all",async()=>{const e=`${Ch}?ids=${Mh.join(",")}&vs_currencies=usd&include_24hr_change=true`,t=await Se(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("coingecko simple/price: unexpected response shape");return t})}function Rh(e){return`${e.slice(0,6)}…${e.slice(-4)}`}const Nh=new pe({namespace:"zframes:wallet:portfolio",ttlMs:12e4,persist:!1});class Lh{constructor(){X(this,"name","On-chain wallet");X(this,"capabilities",["portfolio"]);X(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 Nh.get(t.address,async()=>{const r=await zh(t.address),n=await Ph(r),o=_n.filter(c=>n.has(c.symbol)),a=o.length?await Dh():{},i=o.map(c=>{var f,d;const l=n.get(c.symbol)??0,u=(f=a[c.cgId])==null?void 0:f.usd,h=u!==void 0?l*u:void 0;return{symbol:c.symbol,amount:l,valueUsd:h,changePct24h:(d=a[c.cgId])==null?void 0:d.usd_24h_change}}).filter(c=>c.valueUsd!==void 0&&c.valueUsd>=Ah).sort((c,l)=>(l.valueUsd??0)-(c.valueUsd??0)),s=i.reduce((c,l)=>c+(l.valueUsd??0),0);return{source:"wallet",label:Rh(r),holdings:i,totalUsd:s,asOf:Date.now()}})}}const Ih="https://api.alternative.me/fng/",Fh=new pe({namespace:"zframes:alternativeme:fng",ttlMs:45*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});class jh{constructor(){X(this,"name","alternative.me");X(this,"capabilities",["sentiment"])}async getFearGreed(t=30){return Fh.get(String(t),async()=>{const r=await Se(`${Ih}?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 Uh="https://api.bls.gov/publicAPI/v2/timeseries/data/",Bh={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate",CES0000000001:"Nonfarm payrolls",CES0500000003:"Avg hourly earnings",LNS11300000:"Labor force participation"};function Hh(e){const t=Number(e);return Number.isFinite(t)?t:null}function Gh(e,t){const r=/^M(0[1-9]|1[0-2])$/.exec(t??""),n=Number(e);if(!r||!Number.isFinite(n))return null;const o=Number(r[1]);return Date.UTC(n,o-1,1)}function Vh(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const Wh=new pe({namespace:"zframes:macro",ttlMs:360*6e4,persist:!0,revive:e=>e&&Array.isArray(e.points)?e:null});class Kh{constructor(){X(this,"name","bls");X(this,"capabilities",["macro-series"])}async getMacroSeries(t,r,n){return Wh.get(`${t}:${r}:${n}`,()=>this.fetchMacroSeries(t,r,n))}async fetchMacroSeries(t,r,n){var c,l,u;const o=`${Uh}${encodeURIComponent(t)}?startyear=${r}&endyear=${n}`,a=await Se(o);if(a.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((c=a.message)==null?void 0:c.join(", "))||"request failed"}`);const i=(u=(l=a.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(h=>{const f=Hh(h.value),d=Gh(h.year,h.period);return f===null||d===null?null:{time:d,date:Vh(d),value:f,period:`${h.year}-${h.period}`}}).filter(h=>h!==null).sort((h,f)=>h.time-f.time);return{seriesId:i.seriesID??t,label:Bh[t]??t,source:"BLS",points:s}}}const qh="https://api.coingecko.com/api/v3/global",Yh="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",Jh=new pe({namespace:"zframes:coingecko:global",ttlMs:12*6e4,persist:!0}),Zh=new pe({namespace:"zframes:coingecko:markets",ttlMs:10*6e4,persist:!0});class Xh{constructor(){X(this,"name","coingecko");X(this,"capabilities",["global-market","coin-markets"])}async getGlobalMarket(){return Jh.get("global",async()=>{var n;const t=await Se(qh);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 Zh.get("markets",async()=>{const t=await Se(Yh);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 Qh=300,$h=e=>`https://api.coinpaprika.com/v1/tickers?quotes=USD&limit=${e}`,ep=new pe({namespace:"zframes:coinpaprika:movers",ttlMs:12*6e4,persist:!0}),ln=e=>Number.isFinite(e)?e:0;class tp{constructor(){X(this,"name","coinpaprika");X(this,"capabilities",["coin-movers"])}async getCoinMovers(t=Qh){return ep.get(`movers:${t}`,async()=>{const r=await Se($h(t));if(!Array.isArray(r))throw new Error("coinpaprika tickers: unexpected response shape");return r.filter(n=>{var o;return((o=n==null?void 0:n.quotes)==null?void 0:o.USD)&&Number.isFinite(n.quotes.USD.price)}).map(n=>{const o=n.quotes.USD;return{symbol:(n.symbol??"").toUpperCase(),name:n.name,rank:n.rank,priceUsd:o.price,marketCapUsd:o.market_cap,volume24hUsd:o.volume_24h,changePct:{"1h":ln(o.percent_change_1h),"24h":ln(o.percent_change_24h),"7d":ln(o.percent_change_7d),"30d":ln(o.percent_change_30d)}}})})}}const rp="https://api.llama.fi/v2/chains",np="https://api.llama.fi/overview/dexs",op="https://api.llama.fi/overview/fees",ap="https://api.llama.fi/protocols",Ln=8*6e4,ps=30*6e4,ip=new pe({namespace:"zframes:defillama:tvl",ttlMs:Ln}),sp=new pe({namespace:"zframes:defillama:dex-volume",ttlMs:Ln}),cp=new pe({namespace:"zframes:defillama:protocol-tvl",ttlMs:Ln}),lp=new pe({namespace:"zframes:defillama:protocol-fees",ttlMs:Ln}),up=new pe({namespace:"zframes:defillama:dex-history",ttlMs:ps}),dp=new pe({namespace:"zframes:defillama:protocol-history",ttlMs:ps}),Na=e=>[...e].sort().join(",");function fp(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 Qn=e=>Number.isFinite(e)?e:void 0;class hp{constructor(){X(this,"name","defillama");X(this,"capabilities",["tvl","dex-volume","protocol-tvl","protocol-fees"])}async getTvlByChain(){return ip.get("chains",async()=>{const t=await Se(rp);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 sp.get("overview",async()=>{const t=await Se(np),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:Qn(n.change_1d)})).sort((n,o)=>o.volume24h-n.volume24h)})}async getDexVolumeHistory(t){return up.get(Na(t),async()=>{const r=await Promise.all(t.map(n=>Se(`https://api.llama.fi/summary/dexs/${encodeURIComponent(n)}?excludeTotalDataChartBreakdown=true`).then(o=>[n,fp(o.totalDataChart)]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolTvl(){return cp.get("overview",async()=>{const t=await Se(ap);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:Qn(r.change_1d)})).sort((r,n)=>n.tvl-r.tvl)})}async getProtocolTvlHistory(t){return dp.get(Na(t),async()=>{const r=await Promise.all(t.map(n=>Se(`https://api.llama.fi/protocol/${encodeURIComponent(n)}`).then(o=>[n,(o.tvl??[]).map(a=>({time:a.date*1e3,value:Number(a.totalLiquidityUSD)})).filter(a=>Number.isFinite(a.time)&&Number.isFinite(a.value))]).catch(()=>[n,[]])));return Object.fromEntries(r)})}async getProtocolFees(){return lp.get("overview",async()=>{const t=await Se(op),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:Qn(n.change_1d)})).sort((n,o)=>o.fees24h-n.fees24h)})}}const La="https://www.deribit.com/api/v2/public",pp=new pe({namespace:"zframes:deribit:summary",ttlMs:4*6e4,persist:!0}),mp=new pe({namespace:"zframes:deribit:dvol",ttlMs:9*6e4,persist:!0}),gp={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},vp=/^[A-Z]+-(\d{1,2}[A-Z]{3}\d{2})-(\d+(?:\.\d+)?)-([CP])$/;function yp(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=gp[t[2]],o=2e3+Number(t[3]);return n===void 0?Number.POSITIVE_INFINITY:Date.UTC(o,n,r,8,0,0)}class bp{constructor(){X(this,"name","deribit");X(this,"capabilities",["options-summary","volatility-index"])}async getOptionsSummary(t){const r=t.toUpperCase();return pp.get(r,async()=>{const n=await Se(`${La}/get_book_summary_by_currency?currency=${r}&kind=option`),o=n==null?void 0:n.result;if(!Array.isArray(o)||o.length===0)throw new Error("deribit options: unexpected response shape");let a=0,i=0,s=0,c=0,l=0,u=0,h=0;const f=new Map;for(const g of o){const b=vp.exec(g.instrument_name);if(!b)continue;const[,x,T,C]=b,y=Number(T),S=g.open_interest??0,E=g.volume??0,O=C==="C";O?(a+=S,s+=E):(i+=S,c+=E),Number.isFinite(g.mark_iv)&&S>0&&(l+=g.mark_iv*S,u+=S),!h&&Number.isFinite(g.underlying_price)&&(h=g.underlying_price);let _=f.get(x);_||(_=new Map,f.set(x,_));let q=_.get(y);q||(q={callOi:0,putOi:0},_.set(y,q)),O?q.callOi+=S:q.putOi+=S}const d=Date.now(),m=[...f.keys()].map(g=>({expiry:g,expiryMs:yp(g)}));m.sort((g,b)=>g.expiryMs-b.expiryMs);const p=m.find(g=>g.expiryMs>d)??m[0]??null;let v={expiry:(p==null?void 0:p.expiry)??"",expiryMs:(p==null?void 0:p.expiryMs)??0,strikes:[]};if(p){const g=f.get(p.expiry);v={expiry:p.expiry,expiryMs:p.expiryMs,strikes:[...g.entries()].map(([b,x])=>({strike:b,callOi:x.callOi,putOi:x.putOi})).sort((b,x)=>b.strike-x.strike)}}return{currency:r,underlyingPrice:h,putCallRatioOi:a>0?i/a:0,putCallRatioVolume:s>0?c/s:0,callOi:a,putOi:i,callVolume:s,putVolume:c,avgIv:u>0?l/u:0,nearestExpiry:v,asOf:Date.now()}})}async getVolatilityIndex(t,r,n){const o=t.toUpperCase();return mp.get(`${o}:${n}:${r}`,async()=>{var s;const a=await Se(`${La}/get_volatility_index_data?currency=${o}&start_timestamp=${r}&end_timestamp=${Date.now()}&resolution=${n}`),i=(s=a==null?void 0:a.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 wp=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,xp=7,kp=60*6e4,Cp=new pe({namespace:"zframes:finra:shortvol",ttlMs:kp});function _p(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Ap(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function Sp(e){const t=e.split(/\r?\n/),r=new Map;let n="";for(let o=1;o<t.length;o++){const a=t[o].split("|");if(a.length<5)continue;const[i,s,c,l,u]=a;if(!s)continue;const h=Number(c),f=Number(u);!Number.isFinite(h)||!Number.isFinite(f)||(!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:h,shortExemptVolume:Number(l)||0,totalVolume:f,shortPct:f>0?h/f*100:0}))}if(r.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:n,bySymbol:r}}class zp{constructor(){X(this,"name","finra");X(this,"capabilities",["short-volume"])}async getShortVolume(t){const r=await this.loadReport(),n={};for(const o of t){const a=r.bySymbol.get(_p(o).toUpperCase());a&&(n[o]=a)}return n}loadReport(){return Cp.get("latest",()=>this.fetchLatest())}async fetchLatest(){const t=Date.now();for(let r=0;r<=xp;r++){const n=new Date(t-r*864e5);try{return Sp(await Yr(wp(Ap(n)),{proxied:!0,timeoutMs:15e3}))}catch{}}throw new Error("finra: no recent short-volume file found")}}const Tp="https://api.frankfurter.dev/v1",Ep=new pe({namespace:"zframes:fx",ttlMs:55*6e4,persist:!0}),Pp=40;function Mp(e){return new Date(Date.now()-e*864e5).toISOString().slice(0,10)}class Op{constructor(){X(this,"name","fx");X(this,"capabilities",["fx-rates"])}async getFxRates(t,r){const n=t.toUpperCase(),o=[...new Set(r.map(i=>i.toUpperCase()))].filter(i=>i&&i!==n);if(o.length===0)return[];const a=`${n}:${[...o].sort().join(",")}`;return Ep.get(a,async()=>{const i=`${Tp}/${Mp(Pp)}..?base=${n}&symbols=${o.join(",")}`,s=await Se(i);if(!(s!=null&&s.rates))throw new Error("frankfurter: unexpected response shape");const c=Object.keys(s.rates).sort();return o.map(l=>{var m;const u=[];for(const p of c){const v=(m=s.rates[p])==null?void 0:m[l];typeof v=="number"&&Number.isFinite(v)&&u.push({time:new Date(`${p}T00:00:00Z`).getTime(),value:v})}if(u.length===0)return null;const h=u[u.length-1].value,f=u.length>1?u[u.length-2].value:h,d=f>0?(h-f)/f*100:0;return{symbol:l,base:n,rate:h,changePct:d,history:u}}).filter(l=>l!==null)})}}const Dp="wss://api.hyperliquid.xyz/ws",Rp="https://api.hyperliquid.xyz/info",$n=e=>e.includes(":")?e.split(":")[0]:"";async function un(e){return Se(Rp,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}const Np=new pe({namespace:"zframes:hyperliquid:daystats",ttlMs:25e3}),Lp=new pe({namespace:"zframes:hyperliquid:oi",ttlMs:25e3}),Ip=new pe({namespace:"zframes:hyperliquid:candles",ttlMs:55e3,persist:!0}),Fp=new pe({namespace:"zframes:hyperliquid:funding",ttlMs:4.5*6e4,persist:!0}),Ia=e=>e?[...e].sort().join(","):"*";class jp{constructor(){X(this,"name","hyperliquid");X(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv","open-interest"]);X(this,"ws",null);X(this,"listeners",new Set);X(this,"reconnectTimer",null);X(this,"closedByUser",!1);X(this,"wantedDexes",new Set([""]));X(this,"subscribedDexes",new Set);X(this,"mergedMids",{})}subscribeMids(t,r){this.listeners.add(t);for(const n of r??[])this.wantedDexes.add($n(n));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}getDayStats(t){return Np.get(Ia(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 o=new Set(r);for(const i of n)o.add($n(i));const a={};return await Promise.all([...o].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await un(s),u=r.has(i);c.universe.forEach((h,f)=>{if(!u&&!n.has(h.name))return;const d=l[f];if(!d)return;const m=Number(d.markPx),p=Number(d.prevDayPx);!Number.isFinite(m)||!Number.isFinite(p)||(a[h.name]={markPx:m,prevDayPx:p,changePct:p?(m-p)/p*100:0})})})),a}getOpenInterest(t){return Lp.get(Ia(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 o=new Set(r);for(const i of n)o.add($n(i));const a=[];return await Promise.all([...o].map(async i=>{const s={type:"metaAndAssetCtxs"};i&&(s.dex=i);const[c,l]=await un(s),u=r.has(i);c.universe.forEach((h,f)=>{if(!u&&!n.has(h.name))return;const d=l[f];if(!d)return;const m=Number(d.markPx),p=Number(d.openInterest);!Number.isFinite(m)||!Number.isFinite(p)||a.push({symbol:h.name,openInterestUsd:p*m})})})),a.sort((i,s)=>s.openInterestUsd-i.openInterestUsd)}getFundingHistory(t,r){return Fp.get(`${[...t].sort().join(",")}|${r}`,()=>this.fetchFundingHistory(t,r))}async fetchFundingHistory(t,r){const n=await Promise.all(t.map(async o=>{const i=(await un({type:"fundingHistory",coin:o,startTime:r})).map(s=>({time:s.time,fundingRate:Number(s.fundingRate)})).filter(s=>Number.isFinite(s.fundingRate)&&Number.isFinite(s.time));return[o,i]}));return Object.fromEntries(n)}getCandles(t,r,n){return Ip.get(`${t}|${r}|${n}`,()=>this.fetchCandles(t,r,n))}async fetchCandles(t,r,n){return(await un({type:"candleSnapshot",req:{coin:t,interval:r,startTime:n}})).map(a=>({time:a.t,open:Number(a.o),high:Number(a.h),low:Number(a.l),close:Number(a.c),volume:Number(a.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(Dp);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=r=>{var o;let n;try{n=JSON.parse(String(r.data))}catch{return}if(!(n.channel!=="allMids"||!((o=n.data)!=null&&o.mids))){for(const[a,i]of Object.entries(n.data.mids))this.mergedMids[a]=Number(i);for(const a of this.listeners)a(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 rr="https://mempool.space/api",Up=new pe({namespace:"zframes:mempool:fees",ttlMs:25e3,persist:!0}),Bp=new pe({namespace:"zframes:mempool:state",ttlMs:12e3,persist:!0}),Hp=new pe({namespace:"zframes:mempool:blocks",ttlMs:25e3,persist:!0}),Gp=new pe({namespace:"zframes:mempool:hashrate",ttlMs:25*6e4,persist:!0}),Vp=new pe({namespace:"zframes:mempool:difficulty",ttlMs:5e4,persist:!0}),Wp=new pe({namespace:"zframes:mempool:pools",ttlMs:4*6e4,persist:!0}),Kp=new pe({namespace:"zframes:mempool:lightning",ttlMs:25*6e4,persist:!0});class qp{constructor(){X(this,"name","mempool");X(this,"capabilities",["btc-fees","btc-mempool","btc-blocks","btc-hashrate","btc-difficulty","mining-pools","lightning-stats"])}async getBtcFees(){return Up.get("latest",async()=>{const t=await Se(`${rr}/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 Bp.get("latest",async()=>{const[t,r]=await Promise.all([Se(`${rr}/mempool`),Se(`${rr}/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(o=>({medianFee:o.medianFee,feeRange:Array.isArray(o.feeRange)?o.feeRange:[],totalFees:o.totalFees,nTx:o.nTx,blockVSize:o.blockVSize}));return{count:t.count,vsize:t.vsize,totalFee:t.total_fee,projected:n}})}async getBtcBlocks(t=8){return Hp.get(String(t),async()=>{const r=await Se(`${rr}/v1/blocks`);if(!Array.isArray(r))throw new Error("mempool blocks: unexpected response shape");return r.slice(0,t).map(n=>{var o,a,i,s,c,l;return{id:n.id,height:n.height,time:n.timestamp*1e3,txCount:n.tx_count,size:n.size,totalFees:((o=n.extras)==null?void 0:o.totalFees)??0,medianFee:((a=n.extras)==null?void 0:a.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 Gp.get(t,async()=>{const r=await Se(`${rr}/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 Vp.get("latest",async()=>{const t=await Se(`${rr}/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 Wp.get(t,async()=>{const r=await Se(`${rr}/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(o=>({name:o.name,slug:o.slug,blockCount:o.blockCount,sharePct:n>0?o.blockCount/n*100:0,rank:o.rank}))}})}async getLightningStats(){return Kp.get("latest",async()=>{var n,o,a;const t=await Se(`${rr}/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:(o=t.previous)==null?void 0:o.channel_count,prevTotalCapacity:(a=t.previous)==null?void 0:a.total_capacity}})}}const Yp={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"}},Jp=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`},Fa={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Jr(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,r)=>{const n=r.toLowerCase();if(Fa[n])return Fa[n];if(r[0]==="#"){const o=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):t}return t})}const In=e=>e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1");function ja(e){return Jr(In(e).replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function St(e,t){const r=e.match(new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,"i"));return r?r[1]:void 0}function Zp(e){const t=[...e.matchAll(/<link\b[^>]*\bhref="([^"]+)"[^>]*>/gi)];if(t.length>0){const n=t.find(o=>/rel="alternate"/i.test(o[0]))??t.find(o=>!/\brel=/i.test(o[0]))??t[0];return Jr(n[1]).trim()}const r=St(e,"link");return r?Jr(In(r)).trim():void 0}function zr(e,t){const r=e.match(new RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`,"i"));return r?Jr(r[1]).trim():void 0}const dn=e=>!!e&&/^https:\/\//i.test(e);function Xp(e){var o,a;const t=(o=e.match(/<media:thumbnail\b[^>]*>/i))==null?void 0:o[0];if(t){const i=zr(t,"url");if(dn(i))return i}for(const i of e.matchAll(/<media:content\b[^>]*>/gi)){const s=zr(i[0],"medium"),c=zr(i[0],"type"),l=s==="image"||!s&&!(c!=null&&c.match(/^(audio|video)\//i)),u=zr(i[0],"url");if(l&&dn(u))return u}for(const i of e.matchAll(/<enclosure\b[^>]*>/gi)){if(!((a=zr(i[0],"type"))!=null&&a.startsWith("image/")))continue;const s=zr(i[0],"url");if(dn(s))return s}const r=St(e,"content:encoded")??St(e,"description")??St(e,"content")??St(e,"summary"),n=r?In(r).match(/<img\b[^>]*\bsrc="([^"]+)"/i):null;if(n){const i=Jr(n[1]).trim();if(dn(i))return i}}function Qp(e){const t=St(e,"pubDate")??St(e,"published")??St(e,"updated")??St(e,"dc:date");if(!t)return;const r=Date.parse(In(t).trim());return Number.isFinite(r)?r:void 0}function Ua(e,t,r){const n=[...e.matchAll(/<(item|entry)\b[\s\S]*?<\/\1>/gi)].map(a=>a[0]),o=[];for(const a of n){const i=St(a,"title"),s=Zp(a);if(!i||!s)continue;const c=ja(i);if(!c)continue;const l=St(a,"description")??St(a,"summary")??St(a,"content"),u=l?ja(l).slice(0,280):void 0,h=Qp(a),f=Xp(a);o.push({title:c,url:s,source:t,...u?{summary:u}:{},...h?{publishedAt:h}:{},...f?{imageUrl:f}:{}})}return o.some(a=>a.publishedAt!==void 0)&&o.sort((a,i)=>(i.publishedAt??0)-(a.publishedAt??0)),o.slice(0,r)}class $p{constructor(){X(this,"name","news");X(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 Yr(Jp(i),{proxied:!0,timeoutMs:12e3});return Ua(s,"Google News",n)}const o=Yp[t];if(!o)throw new Error(`news: unknown feed "${t}"`);const a=await Yr(o.url,{proxied:!0,timeoutMs:12e3});return Ua(a,o.source,n)}}const em="https://markets.newyorkfed.org/api/rates/all/latest.json",tm={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},Ba=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"],rm=new pe({namespace:"zframes:nyfed:rates",ttlMs:12*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});function fr(e){const t=Number(e);return Number.isFinite(t)?t:null}function nm(e,t){const r=Ba.indexOf(e.code),n=Ba.indexOf(t.code);return(r===-1?99:r)-(n===-1?99:n)}class om{constructor(){X(this,"name","nyfed");X(this,"capabilities",["reference-rates"])}async getReferenceRates(){return rm.get("latest",async()=>{const t=await Se(em);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??""),o=fr(r.percentRate??r.average30day);if(!n||!r.effectiveDate||o===null)return null;const a={code:n,label:tm[n]??n,date:r.effectiveDate,rate:o,source:"New York Fed"},i=fr(r.volumeInBillions),s=fr(r.targetRateFrom),c=fr(r.targetRateTo),l=fr(r.average30day),u=fr(r.average90day),h=fr(r.average180day);return i!==null&&(a.volumeInBillions=i),s!==null&&(a.targetRateFrom=s),c!==null&&(a.targetRateTo=c),l!==null&&(a.average30Day=l),u!==null&&(a.average90Day=u),h!==null&&(a.average180Day=h),a}).filter(r=>r!==null).sort(nm)})}}const am="https://www.financialresearch.gov/financial-stress-index/data/fsi.csv",im=60*6e4,sm=new pe({namespace:"zframes:ofr:fsi",ttlMs:im}),cm=[[2,"Credit"],[3,"Equity valuation"],[4,"Safe assets"],[5,"Funding"],[6,"Volatility"]];function Ha(e){const t=Number(e);return Number.isFinite(t)?t:null}function lm(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=Ha(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 o=r[r.length-1],a=cm.map(([i,s])=>({label:s,value:Ha(n[i])??0}));return{value:o.value,date:o.date,categories:a,trend:r.slice(-90),source:"OFR"}}class um{constructor(){X(this,"name","ofr");X(this,"capabilities",["financial-stress"])}async getFinancialStress(){return sm.get("latest",()=>Yr(am,{proxied:!0}).then(lm))}}const dm={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 uo(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function Ga(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,""),o=dm[n];return o===void 0?null:uo(o)}const fm=e=>`https://data.sec.gov/submissions/CIK${e}.json`,hm=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,ms=15*6e4,pm=new pe({namespace:"zframes:sec:filings",ttlMs:ms}),mm=new pe({namespace:"zframes:sec:facts",ttlMs:ms});function gm(e,t,r){const n=String(Number(e)),o=t.replace(/-/g,""),a=`https://www.sec.gov/Archives/edgar/data/${n}/${o}`;return r?`${a}/${r}`:`${a}/`}const vm=[{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 ym(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function bm(e,t){const r=e.filter(o=>o.end&&o.form&&Number.isFinite(o.val));return(t==="flow"&&r.some(o=>o.fp==="FY")?r.filter(o=>o.fp==="FY"):r).reduce((o,a)=>!o||a.end>o.end?a:o,null)}function wm(e){var r,n;if(!e)return[];const t=[];for(const o of vm){const a=e[o.taxonomy];if(!a)continue;let i=null;for(const s of o.concepts){const c=(n=(r=a[s])==null?void 0:r.units)==null?void 0:n[o.unit];if(!(c!=null&&c.length))continue;const l=bm(c,o.kind);l&&(!i||l.end>i.end)&&(i=l)}i&&t.push({label:o.label,value:i.val,unit:o.unit,end:i.end,fiscalPeriod:ym(i),form:i.form})}return t}class xm{constructor(t){X(this,"name","sec");X(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=Ga(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return mm.get(r,()=>this.fetchCompanyFacts(r))}async fetchCompanyFacts(t){const r=await Se(hm(t),void 0,{proxied:!0,...this.nodeInit()}),n=wm(r.facts);if(n.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:uo(r.cik??t),entityName:r.entityName??"",metrics:n}}async getCompanyFilings(t){const r=Ga(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return pm.get(r,()=>this.fetchFilings(r))}async fetchFilings(t){var i,s,c,l,u,h,f;const r=await Se(fm(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 o=n.accessionNumber.length,a=[];for(let d=0;d<o;d++){const m=n.accessionNumber[d],p=(s=n.form)==null?void 0:s[d],v=(c=n.filingDate)==null?void 0:c[d];if(!m||!p||!v)continue;const g=(l=n.reportDate)==null?void 0:l[d],b=(u=n.primaryDocDescription)==null?void 0:u[d],x=(h=n.items)==null?void 0:h[d];a.push({form:p,filingDate:v,accessionNumber:m,url:gm(t,m,(f=n.primaryDocument)==null?void 0:f[d]),...g?{reportDate:g}:{},...b?{description:b}:{},...x?{items:x}:{}})}return{cik:uo(r.cik??t),name:r.name??"",tickers:r.tickers??[],exchanges:r.exchanges??[],filings:a,...r.sic?{sic:r.sic}:{},...r.sicDescription?{sicDescription:r.sicDescription}:{},...r.category?{category:r.category}:{},...r.fiscalYearEnd?{fiscalYearEnd:r.fiscalYearEnd}:{}}}}const km="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",Cm=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`,_m=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`,Am=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}`,Fn=180*6e4,Sm=new pe({namespace:"zframes:treasury:yield-curve",ttlMs:Fn,persist:!0}),zm=new pe({namespace:"zframes:treasury:avg-rates",ttlMs:Fn,persist:!0}),Tm=new pe({namespace:"zframes:treasury:national-debt",ttlMs:Fn,persist:!0}),Em=new pe({namespace:"zframes:treasury:auctions",ttlMs:Fn,persist:!0}),Pm=[["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 Vt(e){const t=Number(e);return Number.isFinite(t)?t:null}function Mm(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function Om(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let r=null;for(const o of t){const a=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(o);if(!a)continue;const i=a[1].slice(0,10);(!r||i>r.date)&&(r={date:i,raw:o})}if(!r)return null;const n=[];for(const[o,a,i]of Pm){const s=new RegExp(`<d:${o}[^>]*>([^<]*)</d:${o}>`).exec(r.raw),c=s?Number(s[1]):NaN;Number.isFinite(c)&&n.push({label:a,months:i,rate:c})}return n.length?{date:r.date,points:n}:null}class Dm{constructor(){X(this,"name","treasury");X(this,"capabilities",["treasury-rates","yield-curve","treasury-auctions","national-debt"])}async getYieldCurve(){return Sm.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)),o=await Yr(Am(Mm(n)),{proxied:!0,timeoutMs:15e3}).catch(()=>""),a=Om(o);if(a)return a}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){return zm.get("latest",()=>this.fetchTreasuryAverageRates())}async fetchTreasuryAverageRates(){var n;const t=await Se(km,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(o=>o.record_date))==null?void 0:n.record_date;return r?t.data.filter(o=>o.record_date===r).map(o=>{const a=Vt(o.avg_interest_rate_amt);return a===null||!o.security_type_desc||!o.security_desc?null:{date:r,securityType:o.security_type_desc,security:o.security_desc,rate:a}}).filter(o=>o!==null):[]}async getNationalDebt(t=180){return Tm.get(String(t),()=>this.fetchNationalDebt(t))}async fetchNationalDebt(t){const r=Math.max(2,Math.min(t,400)),n=await Se(Cm(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 o=[];for(let i=n.data.length-1;i>=0;i--){const s=n.data[i],c=Vt(s.tot_pub_debt_out_amt),l=Date.parse(`${s.record_date}T00:00:00Z`);!s.record_date||c===null||!Number.isFinite(l)||o.push({time:l,date:s.record_date,total:c})}if(o.length===0)throw new Error("treasury debt to the penny: no usable rows");const a=n.data[0];return{date:a.record_date??o[o.length-1].date,total:Vt(a.tot_pub_debt_out_amt)??o[o.length-1].total,heldByPublic:Vt(a.debt_held_public_amt)??0,intragovernmental:Vt(a.intragov_hold_amt)??0,trend:o}}async getTreasuryAuctions(t=8){return Em.get(String(t),()=>this.fetchTreasuryAuctions(t))}async fetchTreasuryAuctions(t){const r=Math.max(1,Math.min(t,30)),n=await Se(_m(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(o=>{if(!o.auction_date||!o.security_type)return null;const a=Vt(o.high_yield)??Vt(o.high_investment_rate);return{auctionDate:o.auction_date,securityType:o.security_type,securityTerm:o.security_term??"",rate:a,bidToCover:Vt(o.bid_to_cover_ratio),offeringAmount:Vt(o.offering_amt),totalAccepted:Vt(o.total_accepted)}}).filter(o=>o!==null)}}function Rm(){return[new jp,new hp,new jh,new Xh,new tp,new om,new Dm,new Kh,new xm,new zp,new um,new Op,new $p,new qp,new bp]}const gs="(prefers-reduced-data: reduce)",vs="(pointer: coarse) and (max-width: 768px)";function Nm(){var t;if(typeof window>"u")return!1;const e=navigator;return!!((t=e.connection)!=null&&t.saveData||window.matchMedia(gs).matches||(e.deviceMemory??8)<=4||(e.hardwareConcurrency??8)<=4||window.matchMedia(vs).matches)}function Lm(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 Im=()=>!1,Fm=e=>Lm([gs,vs],e);function jm(){return z.useSyncExternalStore(Fm,Nm,Im)}const Um=z.lazy(()=>R(()=>import("./scene-uwfOGek1.js"),__vite__mapDeps([0,1]))),Bm="/unicornStudio.umd.mjs",Va="invert(1) hue-rotate(180deg) saturate(1.25)",Hm="opacity 0.5s var(--zf-ease-out), filter 0.5s var(--zf-ease-out)",Gm=e=>Math.min(.42,e*2.4),Vm=242,Wm=242,Km=(e,t)=>{const r=((e-t)%360+360)%360;return r>180?r-360:r},ys=90,qm=e=>Math.round(e/ys*1e3)/1e3;function Ym({background:e,active:t=!1,thinking:r=!1,accentHue:n=Vm,accentSat:o=ys,sceneHue:a=Wm}){const i=jm();if(e.type==="color"||e.type==="gradient"){const f=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:f}})}if(e.type!=="unicorn"||!e.projectId||i)return null;const s=Km(n,a),c=qm(o),l=[s===0?"":`hue-rotate(${s}deg)`,c===1?"":`saturate(${c})`].filter(Boolean).join(" "),u=l||"none",h=l?`${l} ${Va}`:Va;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?Gm(e.opacity):e.opacity,filter:t?h:u,transition:Hm,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(z.Suspense,{fallback:null,children:w.jsx(Um,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:Bm},e.projectId)})})})})})}function Jm({currentTitle:e}){const[t,r]=z.useState(null),[n,o]=z.useState(!1),[a,i]=z.useState(null);z.useEffect(()=>{let u=!1;return fetch(fh,{cache:"no-store"}).then(h=>h.ok?h.json():null).then(h=>{if(u||!h||typeof h!="object")return;const f=h;f.canSwitch===!0&&Array.isArray(f.dashboards)&&r({current:typeof f.current=="string"?f.current:null,dashboards:f.dashboards})}).catch(()=>{}),()=>{u=!0}},[]),z.useEffect(()=>{if(!n)return;const u=h=>{h.key==="Escape"&&o(!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||a)){if(u===t.current){o(!1);return}i(u);try{const h=await fetch(hh,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u})});if(!h.ok)throw new Error(`HTTP ${h.status}`);window.location.reload()}catch(h){console.error("zframes: failed to switch dashboard",h),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:()=>o(!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&&oc.createPortal(w.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Choose a dashboard",onClick:u=>{u.target===u.currentTarget&&o(!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:()=>o(!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 h=u.name===t.current;return w.jsxs("button",{type:"button",disabled:a!==null,onClick:()=>void c(u.name),style:h?{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 ${h?"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"}),h&&w.jsx("span",{className:"caption text-strong rounded-full px-1.5 py-0.5 leading-none",style:{background:`${l} 30%)`},children:"current"}),a===u.name&&w.jsx("span",{className:"caption text-soft",children:"switching…"})]})]},u.name)})})]})}),document.body)]})}const Zm={"portfolio-value":{load:()=>R(()=>import("./portfolio-value-B-7uIpG4.js"),__vite__mapDeps([2,1,3,4,5,6,7])).then(e=>e.portfolioValueFrame)},"portfolio-allocation":{load:()=>R(()=>import("./portfolio-allocation-Cf251dcH.js"),__vite__mapDeps([8,1,4,6,7,9,10])).then(e=>e.portfolioAllocationFrame)},"portfolio-holdings":{load:()=>R(()=>import("./portfolio-holdings-2vYKEk7f.js"),__vite__mapDeps([11,1,4,6,7])).then(e=>e.portfolioHoldingsFrame)},"bitcoin-dominance":{load:()=>R(()=>import("./bitcoin-dominance-CxfMBVwW.js"),__vite__mapDeps([12,1,4,7])).then(e=>e.bitcoinDominanceFrame)},clock:{load:()=>R(()=>import("./clock-x9v1tYQm.js"),__vite__mapDeps([13,1,7,14])).then(e=>e.clockFrame)},"daily-analysis":{load:()=>R(()=>import("./daily-analysis-DxjxE53t.js"),__vite__mapDeps([15,1,4,7])).then(e=>e.dailyAnalysisFrame)},"journal-log":{load:()=>R(()=>import("./journal-log-FuAPC6JH.js"),__vite__mapDeps([16,1,17,4,18,7])).then(e=>e.journalLogFrame)},"journal-open":{load:()=>R(()=>import("./journal-open-BREaG6Cs.js"),__vite__mapDeps([19,1,18,4,20,17,7])).then(e=>e.journalOpenFrame)},"journal-results":{load:()=>R(()=>import("./journal-results-Y_pKQcgg.js"),__vite__mapDeps([21,1,18,4,20,17,7])).then(e=>e.journalResultsFrame)},"journal-score":{load:()=>R(()=>import("./journal-score-ZATtCKrj.js"),__vite__mapDeps([22,1,4,18,20,17])).then(e=>e.journalScoreFrame)},"dino-game":{load:()=>R(()=>import("./dino-game-D6AH1SSj.js"),__vite__mapDeps([23,1,24,4])).then(e=>e.dinoGameFrame)},"fear-greed":{load:()=>R(()=>import("./fear-greed-i87oWLnT.js"),__vite__mapDeps([25,1,7,26,10,27])).then(e=>e.fearGreedFrame)},"filings-feed":{load:()=>R(()=>import("./filings-feed-Cxg9eG9S.js"),__vite__mapDeps([28,1,29,4,7])).then(e=>e.filingsFeedFrame)},fundamentals:{load:()=>R(()=>import("./fundamentals-AlhngJ8G.js"),__vite__mapDeps([30,1,4,7])).then(e=>e.fundamentalsFrame)},"financial-stress":{load:()=>R(()=>import("./financial-stress-Bv_reW65.js"),__vite__mapDeps([31,1,4,7,26,10,27])).then(e=>e.financialStressFrame)},"labor-market":{load:()=>R(()=>import("./labor-market-DVybIeSN.js"),__vite__mapDeps([32,1,4,7,26,10,27])).then(e=>e.laborMarketFrame)},"national-debt":{load:()=>R(()=>import("./national-debt-CcTydivP.js"),__vite__mapDeps([33,1,4,7,26,10,27])).then(e=>e.nationalDebtFrame)},"treasury-auctions":{load:()=>R(()=>import("./treasury-auctions-JMoATy9T.js"),__vite__mapDeps([34,1,4,35,7])).then(e=>e.treasuryAuctionsFrame)},"funding-heatmap":{load:()=>R(()=>import("./funding-heatmap-B4RGXX4K.js"),__vite__mapDeps([36,1,4,7,27])).then(e=>e.fundingHeatmapFrame)},"funding-rate-chart":{load:()=>R(()=>import("./funding-rate-chart-Cg6gi0YC.js"),__vite__mapDeps([37,1,4,7,9,10,38,27,39])).then(e=>e.fundingRateChartFrame)},heading:{load:()=>R(()=>import("./heading-Dr7Q6vy_.js"),__vite__mapDeps([40,1])).then(e=>e.headingFrame)},image:{load:()=>R(()=>import("./image-BulRsYTV.js"),__vite__mapDeps([41,1,7])).then(e=>e.imageFrame)},"inflation-pulse":{load:()=>R(()=>import("./inflation-pulse-Q-3bZn55.js"),__vite__mapDeps([42,1,4,7,26,10,27])).then(e=>e.inflationPulseFrame)},"market-hours":{load:()=>R(()=>import("./market-hours-B9zPCvQk.js"),__vite__mapDeps([43,1,44,4,7])).then(e=>e.marketHoursFrame),titleIcon:!0},"news-feed":{load:()=>R(()=>import("./news-feed-D4xS-sLD.js"),__vite__mapDeps([45,1,29,4,7])).then(e=>e.newsFeedFrame)},note:{load:()=>R(()=>import("./note-BXsj5NlE.js"),__vite__mapDeps([46,1,7])).then(e=>e.noteFrame)},"price-chart":{load:()=>R(()=>import("./price-chart-Cx_2scgb.js"),__vite__mapDeps([47,1,3,4,5,7])).then(e=>e.priceChartFrame),titleIcon:!0,titleContent:!0},"price-compare":{load:()=>R(()=>import("./price-compare-DQcEOpnr.js"),__vite__mapDeps([48,1,4,7,9,10,38,27,39])).then(e=>e.priceCompareFrame),titleContent:!0},"price-liveline":{load:()=>R(()=>import("./price-liveline-TTo-aOFd.js"),__vite__mapDeps([49,1,3,4,5,9,10])).then(e=>e.priceLivelineFrame)},"price-ticker":{load:()=>R(()=>import("./price-ticker-Cp7yYsNm.js"),__vite__mapDeps([50,1,51,4,7])).then(e=>e.priceTickerFrame)},"rates-board":{load:()=>R(()=>import("./rates-board-BElUHlYN.js"),__vite__mapDeps([52,1,4,35,7])).then(e=>e.ratesBoardFrame)},"fx-board":{load:()=>R(()=>import("./fx-board-BqGsP0Xx.js"),__vite__mapDeps([53,1,4,7,26,10,27])).then(e=>e.fxBoardFrame)},"short-volume":{load:()=>R(()=>import("./short-volume-CiBfmCKw.js"),__vite__mapDeps([54,1,4,7])).then(e=>e.shortVolumeFrame)},"top-movers":{load:()=>R(()=>import("./top-movers-vvOomk6S.js"),__vite__mapDeps([55,1,51,4,7])).then(e=>e.topMoversFrame)},"tvl-treemap":{load:()=>R(()=>import("./tvl-treemap-B28_19EZ.js"),__vite__mapDeps([56,1,4,57,27,10,7])).then(e=>e.tvlTreemapFrame)},"yield-curve":{load:()=>R(()=>import("./yield-curve-Dj5vJwI4.js"),__vite__mapDeps([58,1,4,7])).then(e=>e.yieldCurveFrame)},"dex-volume-treemap":{load:()=>R(()=>import("./dex-volume-treemap-CqHdMsnd.js"),__vite__mapDeps([59,1,4,57,27,10,7])).then(e=>e.dexVolumeTreemapFrame)},"dex-volume-chart":{load:()=>R(()=>import("./dex-volume-chart-CIN2oKpJ.js"),__vite__mapDeps([60,1,4,7,9,10,38,27,39])).then(e=>e.dexVolumeChartFrame)},"protocol-tvl-treemap":{load:()=>R(()=>import("./protocol-tvl-treemap-I8fjLZU7.js"),__vite__mapDeps([61,1,4,57,27,10,7])).then(e=>e.protocolTvlTreemapFrame)},"protocol-tvl-chart":{load:()=>R(()=>import("./protocol-tvl-chart-CDZkrQuF.js"),__vite__mapDeps([62,1,4,7,9,10,38,27,39])).then(e=>e.protocolTvlChartFrame)},"protocol-fees-treemap":{load:()=>R(()=>import("./protocol-fees-treemap-D-koQrKr.js"),__vite__mapDeps([63,1,4,57,27,10,7])).then(e=>e.protocolFeesTreemapFrame)},"market-cap-treemap":{load:()=>R(()=>import("./market-cap-treemap-CpnOP_gY.js"),__vite__mapDeps([64,1,4,57,27,10,7])).then(e=>e.marketCapTreemapFrame)},"open-interest":{load:()=>R(()=>import("./open-interest-DaFRJd2O.js"),__vite__mapDeps([65,1,4,7])).then(e=>e.openInterestFrame)},snake:{load:()=>R(()=>import("./snake-CYXVjy8d.js"),__vite__mapDeps([66,1,24,4])).then(e=>e.snakeFrame)},"flappy-bird":{load:()=>R(()=>import("./flappy-bird-BENHBDEL.js"),__vite__mapDeps([67,1,24,4])).then(e=>e.flappyBirdFrame)},video:{load:()=>R(()=>import("./video-DjiOnvMm.js"),__vite__mapDeps([68,1,7])).then(e=>e.videoFrame)},drawdy:{load:()=>R(()=>import("./drawdy-BhOQeakE.js"),__vite__mapDeps([69,1,7])).then(e=>e.drawdyFrame)},countdown:{load:()=>R(()=>import("./countdown-BlyeM771.js"),__vite__mapDeps([70,1,7,14])).then(e=>e.countdownFrame)},"link-grid":{load:()=>R(()=>import("./link-grid-CJC48i5r.js"),__vite__mapDeps([71,1,17,7])).then(e=>e.linkGridFrame)},calculator:{load:()=>R(()=>import("./calculator-zC8onHXp.js"),__vite__mapDeps([72,1,17,7])).then(e=>e.calculatorFrame)},quote:{load:()=>R(()=>import("./quote-CKEEp9tF.js"),__vite__mapDeps([73,1])).then(e=>e.quoteFrame)},divider:{load:()=>R(()=>import("./divider-Bu8aGlm1.js"),__vite__mapDeps([74,1])).then(e=>e.dividerFrame)},marquee:{load:()=>R(()=>import("./marquee-D8GTgVmy.js"),__vite__mapDeps([75,1])).then(e=>e.marqueeFrame)},dice:{load:()=>R(()=>import("./dice-DnddcY-J.js"),__vite__mapDeps([76,1,17,7])).then(e=>e.diceFrame)},"risk-reward":{load:()=>R(()=>import("./risk-reward-pVHqmm_g.js"),__vite__mapDeps([77,1,17,4,7])).then(e=>e.riskRewardFrame)},stopwatch:{load:()=>R(()=>import("./stopwatch-Cl10sfaX.js"),__vite__mapDeps([78,1,17])).then(e=>e.stopwatchFrame)},"session-progress":{load:()=>R(()=>import("./session-progress-Djhvb1G5.js"),__vite__mapDeps([79,1,44,7])).then(e=>e.sessionProgressFrame)},"btc-fees":{load:()=>R(()=>import("./btc-fees-DsYgskwn.js"),__vite__mapDeps([80,1,81,4,7])).then(e=>e.btcFeesFrame)},"btc-mempool":{load:()=>R(()=>import("./btc-mempool-DipekM7O.js"),__vite__mapDeps([82,1,81,4,7])).then(e=>e.btcMempoolFrame)},"btc-blocks":{load:()=>R(()=>import("./btc-blocks-Cy-YFeqC.js"),__vite__mapDeps([83,1,4,7])).then(e=>e.btcBlocksFrame)},"btc-hashrate":{load:()=>R(()=>import("./btc-hashrate-C0dYT_WJ.js"),__vite__mapDeps([84,1,4,7,26,10,27])).then(e=>e.btcHashrateFrame)},"btc-difficulty":{load:()=>R(()=>import("./btc-difficulty-CQ_30M6B.js"),__vite__mapDeps([85,1,4,7])).then(e=>e.btcDifficultyFrame)},"mining-pools":{load:()=>R(()=>import("./mining-pools-DiyEBr6a.js"),__vite__mapDeps([86,1,4,57,27,10,7])).then(e=>e.miningPoolsFrame)},"lightning-stats":{load:()=>R(()=>import("./lightning-stats-ByvWkKyP.js"),__vite__mapDeps([87,1,4,7])).then(e=>e.lightningStatsFrame)},"options-put-call":{load:()=>R(()=>import("./options-put-call-_ZFaepBW.js"),__vite__mapDeps([88,1,4,7])).then(e=>e.optionsPutCallFrame)},"options-iv":{load:()=>R(()=>import("./options-iv-MpSqgS3E.js"),__vite__mapDeps([89,1,4,7,26,10,27])).then(e=>e.optionsIvFrame)},"options-oi-strike":{load:()=>R(()=>import("./options-oi-strike-BHF28ASR.js"),__vite__mapDeps([90,1,4,7])).then(e=>e.optionsOiStrikeFrame)},"coin-movers":{load:()=>R(()=>import("./coin-movers-fIxzBuhy.js"),__vite__mapDeps([91,1,51,4,7])).then(e=>e.coinMoversFrame)},"holiday-calendar":{load:()=>R(()=>import("./holiday-calendar-C1fruUVL.js"),__vite__mapDeps([92,1,44,35,7])).then(e=>e.holidayCalendarFrame)},"day-meter":{load:()=>R(()=>import("./day-meter-9YEIbKbk.js"),__vite__mapDeps([93,1,44,7])).then(e=>e.dayMeterFrame)},"returns-projector":{load:()=>R(()=>import("./returns-projector-DjIbvas1.js"),__vite__mapDeps([94,1,17,4,26,10,27])).then(e=>e.returnsProjectorFrame)},breakeven:{load:()=>R(()=>import("./breakeven-BrpmE2y2.js"),__vite__mapDeps([95,1,17,4,7])).then(e=>e.breakevenFrame)},checklist:{load:()=>R(()=>import("./checklist-baxMKxEm.js"),__vite__mapDeps([96,1,7])).then(e=>e.checklistFrame)},pomodoro:{load:()=>R(()=>import("./pomodoro-CxHVmgqp.js"),__vite__mapDeps([97,1,17])).then(e=>e.pomodoroFrame)},"rules-card":{load:()=>R(()=>import("./rules-card-uMZQ6oP0.js"),__vite__mapDeps([98,1,7])).then(e=>e.rulesCardFrame)},breathing:{load:()=>R(()=>import("./breathing-Bjv7D86F.js"),__vite__mapDeps([99,1])).then(e=>e.breathingFrame)},"spotify-embed":{load:()=>R(()=>import("./spotify-embed-CGYKFOmX.js"),__vite__mapDeps([100,1,7])).then(e=>e.spotifyEmbedFrame)}},L=e=>`/widget-icons/${e}.png`,ie={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"}},Xm={name:"clock",label:"Clock",category:"tools",iconUrl:L("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:M({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:rt().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:rt().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:rt().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:rt().default(!1).describe("Show the weekday and date under the time."),showTimezone:rt().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".')})},Qm={name:"market-hours",label:"Market Hours",category:"tools",iconUrl:L("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:M({exchanges:qe(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:ke(["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.")})},$m={name:"fear-greed",label:"Fear & Greed",category:"sentiment",iconUrl:L("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:ie.alternativeMe,schema:M({sparklineDays:F().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},e0={name:"funding-rate-chart",label:"Funding Rate Chart",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(W()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:ke(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},t0={name:"note",label:"Note",category:"layout",iconUrl:L("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:M({text:W().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:ke(["left","center"]).default("left").describe("Text alignment inside the card.")})},r0={name:"price-chart",label:"Price Chart",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({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:ke(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:ke(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:W().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},n0={name:"price-liveline",label:"Price Liveline",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(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:F().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:rt().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},o0={name:"price-ticker",label:"Price Ticker",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(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".')})},a0={name:"top-movers",label:"Top Movers",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({count:F().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},i0={name:"tvl-treemap",label:"TVL Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},s0={name:"bitcoin-dominance",label:"Bitcoin Dominance",category:"crypto",iconUrl:L("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:ie.coingecko,schema:M({showTotalMarketCap:rt().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},c0={name:"rates-board",label:"Rates Board",category:"macro",iconUrl:L("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:[ie.nyFed,ie.treasury],schema:M({maxReferenceRates:F().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:rt().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:F().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},l0={name:"fx-board",label:"FX Board",category:"macro",iconUrl:L("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:ie.frankfurter,schema:M({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:qe(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:rt().default(!0).describe("Show a small ~30-day trend sparkline next to each rate.")})},u0={name:"inflation-pulse",label:"Inflation Pulse",category:"macro",iconUrl:L("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:ie.bls,schema:M({months:F().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},d0={name:"financial-stress",label:"Financial Stress",category:"macro",iconUrl:L("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:ie.ofr,schema:M({trendDays:F().int().min(20).max(90).default(60).describe("How many recent daily readings to plot in the trend line."),showCategories:rt().default(!0).describe("Show the five category contributions (credit, equity valuation, safe assets, funding, volatility) under the headline.")})},f0={name:"national-debt",label:"National Debt",category:"macro",iconUrl:L("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:ie.treasury,schema:M({trendDays:F().int().min(30).max(365).default(180).describe("How many business days of history to load for the trend and the change figure."),showSplit:rt().default(!0).describe("Show the debt-held-by-the-public vs intragovernmental-holdings split.")})},h0={name:"labor-market",label:"Labor Market",category:"macro",iconUrl:L("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:ie.bls,schema:M({months:F().int().min(13).max(36).default(18).describe("How many monthly observations to show in the trend.")})},p0={name:"treasury-auctions",label:"Treasury Auctions",category:"macro",iconUrl:L("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:ie.treasury,schema:M({count:F().int().min(3).max(20).default(8).describe("How many recent auctions to list (newest first).")})},m0={name:"filings-feed",label:"Filings Feed",category:"equities",iconUrl:L("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:ie.secEdgar,schema:M({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:ke(["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:F().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},g0={name:"yield-curve",label:"Yield Curve",category:"macro",iconUrl:L("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:ie.treasury,schema:M({maturities:qe(ke(["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).")})},v0={name:"fundamentals",label:"Fundamentals",category:"equities",iconUrl:L("fundamentals"),layout:{w:4,h:3,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:ie.secEdgar,schema:M({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.')})},y0={name:"short-volume",label:"Short Volume",category:"equities",iconUrl:L("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:ie.finra,schema:M({symbols:qe(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:ke(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},b0={name:"funding-heatmap",label:"Funding Heatmap",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(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"].')})},w0={name:"dino-game",label:"Dino Game",category:"games",iconUrl:L("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:M({})},x0={name:"image",label:"Image",category:"layout",iconUrl:L("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:M({url:W().min(1).describe("Image URL (https)."),alt:W().default("").describe("Alt text for accessibility."),fit:ke(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},k0={name:"heading",label:"Heading",category:"layout",iconUrl:L("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:M({title:W().min(1).describe("The heading text."),subtitle:W().optional().describe("Smaller supporting line under the title.")})},C0={name:"daily-analysis",label:"Daily Analysis",category:"tools",iconUrl:L("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:M({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:F().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:F().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},_0={name:"journal-log",label:"Journal · Log",category:"journal",iconUrl:L("journal-log"),layout:{w:4,h:5,minW:3,minH:4},source:ie.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:M({})},A0={name:"journal-open",label:"Journal · Open",category:"journal",iconUrl:L("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:ie.hyperliquid,capabilities:["quote-stream"],schema:M({max:F().int().min(1).max(20).default(8).describe("How many open calls to show (newest first).")})},S0={name:"journal-results",label:"Journal · Results",category:"journal",iconUrl:L("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:M({max:F().int().min(1).max(20).default(8).describe("How many resolved calls to show (newest first).")})},z0={name:"journal-score",label:"Journal · Scoreboard",category:"journal",iconUrl:L("journal-score"),layout:{w:4,h:2,minW:3,minH:2},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:M({})},T0={name:"price-compare",label:"Price Compare",category:"markets",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(W()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:ke(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:rt().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.")})},Io={source:ke(["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".')},E0={name:"portfolio-value",label:"Portfolio Value",category:"portfolio",iconUrl:L("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:M({...Io,windowSec:F().int().positive().default(300).describe("Seconds of live history the equity line shows; it accumulates from when the dashboard opens.")})},P0={name:"portfolio-allocation",label:"Portfolio Allocation",category:"portfolio",iconUrl:L("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:M({...Io})},M0={name:"portfolio-holdings",label:"Portfolio Holdings",category:"portfolio",iconUrl:L("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:M({...Io})},O0={name:"news-feed",label:"News Feed",category:"sentiment",iconUrl:L("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:M({source:ke(["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:qe(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:F().int().min(3).max(20).default(8).describe("How many headlines to list (newest first).")})},D0={name:"dex-volume-treemap",label:"DEX Volume Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the highest-volume DEX protocols to show.")})},R0={name:"dex-volume-chart",label:"DEX Volume Chart",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({protocols:qe(W()).min(1).max(6).describe('DeFiLlama DEX protocol slugs (lowercase, hyphenated), e.g. ["uniswap", "pancakeswap", "aerodrome-slipstream"]. 1 to 6.'),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},N0={name:"protocol-tvl-treemap",label:"Protocol TVL Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the largest protocols by TVL to show.")})},L0={name:"protocol-tvl-chart",label:"Protocol TVL Chart",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({protocols:qe(W()).min(1).max(6).describe('DeFiLlama protocol slugs (lowercase, hyphenated), e.g. ["lido", "aave", "eigenlayer"]. 1 to 6.'),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},I0={name:"protocol-fees-treemap",label:"Protocol Fees Treemap",category:"crypto",iconUrl:L("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:ie.defillama,schema:M({topN:F().int().min(3).max(30).default(12).describe("How many of the highest fee-earning protocols to show.")})},F0={name:"market-cap-treemap",label:"Market Cap Treemap",category:"crypto",iconUrl:L("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:ie.coingecko,schema:M({topN:F().int().min(5).max(50).default(12).describe("How many of the largest coins by market cap to show (up to 50).")})},j0={name:"open-interest",label:"Open Interest",category:"derivatives",iconUrl:L("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:ie.hyperliquid,schema:M({symbols:qe(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.`)})},U0={name:"snake",label:"Snake",category:"games",iconUrl:L("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:M({})},B0={name:"flappy-bird",label:"Flappy Bird",category:"games",iconUrl:L("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:M({})},H0={name:"video",label:"Video",category:"layout",iconUrl:L("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:M({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).")})},G0={name:"drawdy",label:"Drawdy",category:"layout",iconUrl:L("drawdy"),layout:{w:8,h:6,minW:2,minH:2},description:"Embeds drawdy.io as an interactive whiteboard canvas. No configuration needed.",capabilities:[],schema:M({})},V0={name:"countdown",label:"Countdown",category:"tools",iconUrl:L("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:M({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:rt().default(!0).describe("Show the formatted target date and time under the countdown.")})},W0={name:"link-grid",label:"Quick Links",category:"tools",iconUrl:L("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:M({links:qe(M({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:F().int().min(1).max(4).default(2).describe("How many tiles per row.")})},K0={name:"calculator",label:"Position Calculator",category:"tools",iconUrl:L("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:M({account:F().positive().default(1e4).describe("Account size used as the risk base, in the quote currency."),riskPct:F().positive().max(100).default(1).describe("Percent of the account risked on the trade, e.g. 1 = 1%."),entry:F().positive().default(100).describe("Entry price."),stop:F().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.")})},q0={name:"quote",label:"Quote",category:"layout",iconUrl:L("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:M({quotes:qe(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:F().int().min(0).default(12).describe("Seconds between rotations when there are multiple quotes. 0 shows the first quote, fixed.")})},Y0={name:"divider",label:"Divider",category:"layout",iconUrl:L("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:M({label:W().default("").describe("Optional text shown in the middle of the rule. Empty = a clean line."),orientation:ke(["horizontal","vertical"]).default("horizontal").describe("Horizontal rule (spans the width) or vertical rule (spans the height)."),style:ke(["solid","dashed","dotted"]).default("solid").describe("Line style.")})},J0={name:"dice",label:"Dice",category:"tools",iconUrl:L("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:M({mode:ke(["coin","dice","list"]).default("coin").describe("coin = heads/tails, dice = 1–6, list = random pick from options."),options:qe(W()).default(["Yes","No"]).describe("Choices used in list mode."),label:W().default("").describe("Optional caption, e.g. the question being decided.")})},Z0={name:"risk-reward",label:"Risk / Reward",category:"tools",iconUrl:L("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:M({entry:F().default(100).describe("Planned entry price."),stop:F().default(95).describe("Stop-loss price."),target:F().default(115).describe("Profit target price."),direction:ke(["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.")})},X0={name:"marquee",label:"Marquee",category:"layout",iconUrl:L("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:M({text:W().default("LFG").describe("The text that scrolls across the banner."),speed:ke(["slow","normal","fast"]).default("normal").describe("Scroll speed."),accent:rt().default(!0).describe("Tint the text with the dashboard accent color.")})},Q0={name:"stopwatch",label:"Stopwatch",layout:{w:3,h:2,minW:2,minH:1},category:"tools",iconUrl:L("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:M({label:W().default("Session").describe("Caption above the timer."),startedAt:F().default(0).describe("Epoch ms when the timer was last started; 0 = paused. Persisted automatically by the frame."),accumulatedMs:F().default(0).describe("Milliseconds banked before the current run. Persisted automatically by the frame.")})},$0={name:"session-progress",label:"Session Progress",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),label:W().default("").describe("Optional caption shown by the exchange code."),showCountdown:rt().default(!0).describe("Show the time-to-open / time-to-close countdown.")})},eg={name:"holiday-calendar",label:"Holiday Calendar",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),count:F().int().min(1).max(20).default(5).describe("How many upcoming holidays to list."),label:W().default("").describe("Optional caption shown above the list.")})},tg={name:"day-meter",label:"Day Meter",category:"tools",iconUrl:L("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:M({exchange:W().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),weekdaysOnly:rt().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.")})},rg={name:"returns-projector",label:"Returns Projector",category:"tools",iconUrl:L("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:M({principal:F().default(1e3).describe("Starting balance."),ratePct:F().default(5).describe("Return per period, in percent (e.g. 5 = 5%)."),periods:F().int().min(1).max(600).default(12).describe("Number of compounding periods to project."),contribution:F().default(0).describe("Amount added at the end of each period."),label:W().default("").describe("Optional caption.")})},ng={name:"breakeven",label:"Break-even",category:"tools",iconUrl:L("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:M({fills:qe(M({price:F().describe("Fill price."),size:F().describe("Fill size, in units.")})).default([{price:100,size:1}]).describe("Your entry fills; their size-weighted average is the break-even."),currentPrice:F().default(0).describe("Optional current price; greater than 0 shows the unrealized P&L %."),label:W().default("").describe("Optional caption.")})},og={name:"checklist",label:"Checklist",category:"tools",iconUrl:L("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:M({title:W().default("Pre-trade checklist").describe("Heading shown above the list."),items:qe(W()).default(["Trend & bias aligned","Stop level set","Risk sized correctly"]).describe("The checklist items, top to bottom."),checked:qe(rt()).default([]).describe("Per-item checked state (by index); persisted automatically by the frame.")})},ag={name:"pomodoro",label:"Pomodoro",category:"tools",iconUrl:L("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:M({workMin:F().min(1).max(180).default(25).describe("Work interval length, in minutes."),breakMin:F().min(1).max(120).default(5).describe("Break interval length, in minutes."),cycles:F().int().min(1).max(20).default(4).describe("Work/break cycles before the counter loops."),label:W().default("").describe("Optional caption.")})},ig={name:"rules-card",label:"Rules",category:"layout",iconUrl:L("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:M({title:W().default("My rules").describe("Heading shown above the list."),rules:qe(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.")})},sg={name:"breathing",label:"Breathing",category:"layout",iconUrl:L("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:M({inhale:F().min(1).max(60).default(4).describe("Inhale seconds."),hold:F().min(0).max(60).default(4).describe("Hold-after-inhale seconds."),exhale:F().min(1).max(60).default(4).describe("Exhale seconds."),holdAfter:F().min(0).max(60).default(4).describe("Hold-after-exhale seconds.")})},cg={name:"spotify-embed",label:"Spotify",category:"layout",iconUrl:L("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:M({url:W().default("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M").describe("A Spotify share URL (open.spotify.com/track|album|playlist|artist/…)."),compact:rt().default(!1).describe("Use Spotify's compact (single-row) player height.")})},lg={name:"btc-fees",label:"BTC Fees",category:"bitcoin",iconUrl:L("btc-fees"),layout:{w:3,h:2,minW:2,minH:2},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:ie.mempool,schema:M({tiers:qe(ke(["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.')})},ug={name:"btc-mempool",label:"BTC Mempool",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({projectedBlocks:F().int().min(1).max(8).default(5).describe("How many projected (yet-to-be-mined) blocks to show, next-to-mine first.")})},dg={name:"btc-blocks",label:"BTC Blocks",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({count:F().int().min(3).max(15).default(8).describe("How many recent blocks to list (newest first).")})},fg={name:"btc-hashrate",label:"BTC Hashrate",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({window:ke(["1y","2y","3y"]).default("1y").describe("History window for the hashrate line.")})},hg={name:"btc-difficulty",label:"BTC Difficulty",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({showPrevious:rt().default(!0).describe("Also show the percentage change applied at the previous retarget.")})},pg={name:"mining-pools",label:"Mining Pools",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({window:ke(["24h","3d","1w","1m"]).default("1w").describe("Window over which to measure each pool's block share."),topN:F().int().min(3).max(25).default(12).describe("How many of the largest pools to show; the rest fold into 'Other'.")})},mg={name:"lightning-stats",label:"Lightning Network",category:"bitcoin",iconUrl:L("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:ie.mempool,schema:M({showSplit:rt().default(!0).describe("Show the Tor vs clearnet node split under the headline stats.")})},gg={name:"options-put-call",label:"Put / Call Ratio",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which Deribit options book to summarise — BTC or ETH (the only deeply liquid books)."),basis:ke(["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.')})},vg={name:"options-iv",label:"Implied Volatility",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which DVOL volatility index to plot — BTC or ETH."),lookback:ke(["7D","1M","3M"]).default("1M").describe("History window for the volatility-index line.")})},yg={name:"options-oi-strike",label:"OI by Strike",category:"derivatives",iconUrl:L("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:ie.deribit,schema:M({currency:ke(["BTC","ETH"]).default("BTC").describe("Which Deribit options book — BTC or ETH."),strikes:F().int().min(6).max(30).default(14).describe("How many strikes nearest the current spot to show (centered on the underlying price).")})},bg={name:"coin-movers",label:"Coin Movers",category:"markets",iconUrl:L("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:ie.coinpaprika,schema:M({window:ke(["1h","24h","7d","30d"]).default("24h").describe("Which price-change window ranks the movers: 1h (intraday momentum), 24h (daily), 7d (weekly), 30d (monthly)."),count:F().int().min(3).max(15).default(6).describe("How many gainers and how many losers to list (each side)."),minRank:F().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.")})},wg=[O0,E0,P0,M0,s0,Xm,C0,w0,$m,m0,v0,d0,h0,f0,p0,b0,e0,k0,x0,u0,Qm,t0,r0,T0,n0,o0,c0,l0,y0,a0,i0,g0,D0,R0,N0,L0,I0,F0,j0,U0,B0,H0,G0,V0,W0,K0,q0,Y0,lg,ug,dg,fg,hg,pg,mg,gg,vg,yg,bg],xg=[...wg,ng,sg,og,tg,J0,eg,_0,A0,S0,z0,X0,ag,rg,Z0,ig,$0,cg,Q0],Wa=()=>null;function kg(){const e=new Map;for(const t of xg){const r=Zm[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 o=()=>n??(n=r.load().catch(c=>{throw n=null,c})),a=z.lazy(()=>o().then(c=>({default:c.component}))),i=r.titleIcon?z.lazy(()=>o().then(c=>(c.titleIcon||console.warn(`[zframes] frame "${t.name}" is flagged titleIcon but its module exports none`),{default:c.titleIcon??Wa}))):void 0,s=r.titleContent?z.lazy(()=>o().then(c=>(c.titleContent||console.warn(`[zframes] frame "${t.name}" is flagged titleContent but its module exports none`),{default:c.titleContent??Wa}))):void 0;e.set(t.name,{...t,component:a,titleIcon:i,titleContent:s})}return e}function jn(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function bs(e){return e.includes(":")}function Cg(e){const t=jn(e);return bs(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const Ka=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function _g(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)|0;return Ka[Math.abs(t)%Ka.length]}function Ag({symbol:e,size:t=18,className:r=""}){const n=jn(e),o=bs(e),[a,i]=z.useState(!1);z.useEffect(()=>i(!1),[e]);const s=o?"rounded-[5px]":"rounded-full",c={width:t,height:t};return a?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:_g(n),fontSize:Math.round(t*.42)},children:n.slice(0,2).toUpperCase()}):w.jsx("img",{src:Cg(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>i(!0),className:`shrink-0 object-contain ${s} ${o?"bg-white p-px":""} ${r}`,style:c})}const Sg=["xyz:*"],zg=200,Tg="var(--zf-up, #3fd08f)",Eg="var(--zf-down, #ff6b81)";function qa(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const Pg=`
|
|
511
511
|
.zf-tape {
|
|
512
512
|
position: fixed;
|
|
513
513
|
left: 0;
|
|
@@ -555,9 +555,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
555
555
|
.zf-tape { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
|
|
556
556
|
.zf-tape-track { animation: none; }
|
|
557
557
|
}
|
|
558
|
-
`;function
|
|
559
|
-
`+await fetch(
|
|
560
|
-
export default module.exports;`,r=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const o=(await import(r)).default;if(!(o!=null&&o.addScene))throw new Error("UnicornStudio engine missing addScene");return o}finally{URL.revokeObjectURL(r)}})(),Tr.catch(()=>{Tr=null}),Tr)}class
|
|
558
|
+
`;function Mg(){const e=Ma(Sg,6e4),t=Ma(void 0,6e4),{symbols:r,stats:n}=z.useMemo(()=>{const l=h=>Object.entries(h).filter(([,f])=>f.markPx>0&&f.prevDayPx>0).map(([f])=>f).sort();return{symbols:[...l(e),...l(t)].slice(0,zg),stats:{...t,...e}}},[e,t]),o=de("quote-stream"),a=z.useRef(null),i=r.join(",");if(z.useEffect(()=>{const l=a.current;if(!l||!(o!=null&&o.subscribeMids)||r.length===0)return;let u={};const h=()=>{for(const p of l.querySelectorAll("[data-zf-px]")){const v=u[p.dataset.zfPx??""];if(v===void 0)continue;const g=qa(v);p.textContent!==g&&(p.textContent=g)}},f=o.subscribeMids(p=>{u=p},r),d=window.setTimeout(h,400),m=window.setInterval(h,1500);return()=>{f(),clearTimeout(d),clearInterval(m)}},[o,i]),r.length===0)return null;const s=Math.max(40,r.length*2.2),c=l=>r.map(u=>{const h=n[u];if(!h)return null;const f=h.changePct>=0?Tg:Eg,d=h.changePct>=0?"+":"";return w.jsxs("span",{className:"zf-tape-item",children:[w.jsx(Ag,{symbol:u,size:15}),w.jsx("span",{className:"zf-tape-sym",children:jn(u)}),w.jsx("span",{className:"zf-tape-px","data-zf-px":u,children:qa(h.markPx)}),w.jsxs("span",{className:"zf-tape-chg",style:{color:f},children:[d,h.changePct.toFixed(2),"%"]})]},`${l}-${u}`)});return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:Pg}),w.jsx("div",{className:"zf-tape","aria-label":"live ticker tape",children:w.jsxs("div",{ref:a,className:"zf-tape-track",style:{animationDuration:`${s}s`},children:[c("a"),w.jsx("span",{"aria-hidden":!0,style:{display:"contents"},children:c("b")})]})})]})}const Ya="(min-width: 1024px)";function Og(){const[e,t]=z.useState(()=>window.matchMedia(Ya).matches);return z.useEffect(()=>{const r=window.matchMedia(Ya),n=()=>t(r.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}const Dg="/unicornStudio.legacy.umd.mjs";let Tr=null;function Rg(){return typeof window>"u"||typeof document>"u"?Promise.reject(new Error("UnicornStudio needs a browser")):Tr||(Tr=(async()=>{const t=`const module={exports:{}};const exports=module.exports;
|
|
559
|
+
`+await fetch(Dg).then(n=>{if(!n.ok)throw new Error(`failed to load UnicornStudio (${n.status})`);return n.text()})+`
|
|
560
|
+
export default module.exports;`,r=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const o=(await import(r)).default;if(!(o!=null&&o.addScene))throw new Error("UnicornStudio engine missing addScene");return o}finally{URL.revokeObjectURL(r)}})(),Tr.catch(()=>{Tr=null}),Tr)}class Ng{constructor(t){X(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 Ja=new Ng({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
|
|
561
561
|
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
|
|
562
562
|
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
|
|
563
563
|
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
|
|
@@ -574,60 +574,60 @@ precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform m
|
|
|
574
574
|
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
|
|
575
575
|
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
|
|
576
576
|
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
|
|
577
|
-
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
|
|
577
|
+
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 Lg({className:e,dpi:t=2,scale:r=1,fps:n=60,onScene:o,onError:a}){const i=z.useRef(null),s=z.useId();return z.useEffect(()=>{if(!i.current)return;let c=!1,l=null;return(async()=>{try{const u=await Rg();if(c||!i.current)return;i.current.setAttribute("data-us-project-src",Ja.url),l=u.addScene({filePath:Ja.url,elementId:s,dpi:t,scale:r,fps:n});const h=await l;if(c){h.destroy();return}o(h)}catch{c||a()}})(),()=>{c=!0,o(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 eo=80,fo=40,hr=6,Ig=1e4,Fg=5e3;function to(e,t){return e.find(r=>r.capabilities.includes(t))??null}function jg(e,t){return Promise.race([e.then(r=>r).catch(()=>null),new Promise(r=>setTimeout(()=>r(null),t))])}function Yt(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 pr(e,t=1){return Number.isFinite(e)?`${e>=0?"+":""}${e.toFixed(t)}%`:"—"}function Ug(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 Bg(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 ro(e){return e.filter(t=>t&&t!=="*"&&!t.endsWith(":*"))}function Hg(e,t){for(const r of t){const n=e[r];if(typeof n=="string"&&n.trim())return n.trim()}return null}function Fo(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function Gg(e,t){return e.frames.map(r=>{const n=t.get(r.frame);let o=r.config??{};if(n){const a=n.schema.safeParse(o);a.success&&(o=a.data)}return{type:r.frame,title:r.title,capabilities:(n==null?void 0:n.capabilities)??[],config:o,symbols:Bg(o)}})}function Vg(e){const t=[];for(const r of e.slice(0,eo)){let n=`- ${r.type}`;if(r.title&&(n+=` "${r.title}"`),r.symbols.length&&(n+=` [${r.symbols.slice(0,fo).join(", ")}]`),r.symbols.length===0){const o=Hg(r.config,["text","content","body","label","timezone","feed"]);o&&(n+=`: ${Fo(o,80)}`)}t.push(n)}return e.length>eo&&t.push(`- …and ${e.length-eo} more frames`),t}function no(e,t){const r=new Set;for(const n of e)if(n.capabilities.some(o=>t.includes(o)))for(const o of n.symbols)r.add(o);return[...r]}async function Wg(e,t){const r=new Set;for(const f of t)for(const d of f.capabilities)r.add(d);const n=f=>r.has(f)&&to(e,f),o=[],a=(f,d,m)=>{const p=n(d);p&&o.push(jg(m(p),Fg).then(v=>v?[f,v]:null))},i=ro(no(t,["day-stats","quote-stream","ohlcv"])).slice(0,fo);i.length&&a(1,"day-stats",async f=>{const d=await f.getDayStats(i),m=i.map(p=>{const v=d[p];return v?`${p} ${Ug(v.markPx)} (${pr(v.changePct)})`:null}).filter(Boolean);return m.length?`Prices: ${m.join(" · ")}`:null});const s=t.find(f=>f.capabilities.includes("sentiment")),c=typeof(s==null?void 0:s.config.sparklineDays)=="number"?s.config.sparklineDays:30;a(2,"sentiment",async f=>{const m=(await f.getFearGreed(c))[0];return m?`Fear & Greed: ${m.value} (${m.classification})`:null}),a(3,"global-market",async f=>{const d=await f.getGlobalMarket(),m=Object.entries(d.dominance).sort((p,v)=>v[1]-p[1]).slice(0,3).map(([p,v])=>`${p.toUpperCase()} ${v.toFixed(1)}%`).join(", ");return`Global crypto: total mcap ${Yt(d.totalMarketCapUsd)} (${pr(d.marketCapChangePct24h)} 24h); dominance ${m}`});const l=ro(no(t,["funding-history"])).slice(0,fo);l.length&&a(4,"funding-history",async f=>{const d=await f.getFundingHistory(l,Date.now()-864e5),m=l.map(p=>{const v=d[p],g=v&&v[v.length-1];return g?`${p} ${pr(g.fundingRate*100,4)}`:null}).filter(Boolean);return m.length?`Funding (latest): ${m.join(" · ")}`:null});const u=ro(no(t,["open-interest"]));if(a(5,"open-interest",async f=>{const m=(await f.getOpenInterest(u.length?u:void 0)).slice(0,hr).map(p=>`${p.symbol} ${Yt(p.openInterestUsd)}`);return m.length?`Open interest: ${m.join(" · ")}`:null}),a(6,"tvl",async f=>{const m=(await f.getTvlByChain()).slice(0,hr).map(p=>`${p.name} ${Yt(p.tvl)}`);return m.length?`TVL by chain: ${m.join(" · ")}`:null}),a(7,"protocol-tvl",async f=>{const m=(await f.getProtocolTvl()).slice(0,hr).map(p=>`${p.name} ${Yt(p.tvl)}`);return m.length?`Protocol TVL: ${m.join(" · ")}`:null}),a(8,"dex-volume",async f=>{const m=(await f.getDexVolume()).slice(0,hr).map(p=>`${p.name} ${Yt(p.volume24h)}`);return m.length?`DEX volume (24h): ${m.join(" · ")}`:null}),a(9,"protocol-fees",async f=>{const m=(await f.getProtocolFees()).slice(0,hr).map(p=>`${p.name} ${Yt(p.fees24h)}`);return m.length?`Protocol fees (24h): ${m.join(" · ")}`:null}),a(10,"coin-markets",async f=>{const m=(await f.getCoinMarkets()).slice(0,hr).map(p=>`${p.symbol} ${Yt(p.marketCapUsd)}${p.changePct24h!=null?` (${pr(p.changePct24h)})`:""}`);return m.length?`Top coins by mcap: ${m.join(" · ")}`:null}),a(11,"coin-movers",async f=>{const m=[...await f.getCoinMovers(300)].sort((g,b)=>(b.changePct["24h"]??0)-(g.changePct["24h"]??0)),p=m.slice(0,3).map(g=>`${g.symbol} ${pr(g.changePct["24h"]??0)}`),v=m.slice(-3).reverse().map(g=>`${g.symbol} ${pr(g.changePct["24h"]??0)}`);return m.length?`Movers (24h): up ${p.join(", ")} · down ${v.join(", ")}`:null}),n("news")){const f=to(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 v=m.symbols.length?[...m.symbols]:void 0;a(12,"news",async()=>{const b=(await f.getNews({feed:p,symbols:v,limit:4})).slice(0,4).map(x=>`“${Fo(x.title,90)}”`);return b.length?`News (${p}): ${b.join("; ")}`:null})}}if(a(13,"btc-fees",async f=>{const d=await f.getBtcFees();return`BTC fees: fastest ${d.fastest}, 1h ${d.hour}, economy ${d.economy} sat/vB`}),a(14,"btc-mempool",async f=>{const d=await f.getMempoolState();return`Mempool: ${d.count.toLocaleString("en-US")} txs, ${d.projected.length} blocks pending`}),a(15,"btc-blocks",async f=>{const m=(await f.getBtcBlocks(1))[0];return m?`Latest block: #${m.height} (${m.poolName}, ${m.txCount} txs)`:null}),a(16,"btc-difficulty",async f=>{const d=await f.getDifficultyAdjustment();return`Difficulty: ${pr(d.difficultyChange)} expected in ${d.remainingBlocks} blocks`}),a(17,"mining-pools",async f=>{const m=(await f.getMiningPools("1w")).pools[0];return m?`Mining pools (1w): ${m.name} ${m.sharePct.toFixed(1)}%`:null}),a(18,"lightning-stats",async f=>{const d=await f.getLightningStats();return`Lightning: ${d.nodeCount.toLocaleString("en-US")} nodes, ${d.channelCount.toLocaleString("en-US")} channels`}),a(19,"yield-curve",async f=>{const d=await f.getYieldCurve(),m=v=>d.points.find(g=>g.label===v),p=["3M","2Y","10Y","30Y"].map(v=>{const g=m(v);return g?`${v} ${g.rate.toFixed(2)}%`:null}).filter(Boolean);return p.length?`Yield curve (${d.date}): ${p.join(", ")}`:null}),a(20,"reference-rates",async f=>{const m=(await f.getReferenceRates()).slice(0,3).map(p=>`${p.code} ${p.rate.toFixed(2)}%`);return m.length?`Reference rates: ${m.join(", ")}`:null}),a(21,"financial-stress",async f=>{const d=await f.getFinancialStress();return`Financial stress (OFR): ${d.value.toFixed(2)} (${d.date})`}),a(22,"national-debt",async f=>{const d=await f.getNationalDebt();return`US national debt: ${Yt(d.total)} (${d.date})`}),n("options-summary")){const f=new Set;for(const m of t)m.capabilities.includes("options-summary")&&f.add(typeof m.config.currency=="string"?m.config.currency:"BTC");const d=to(e,"options-summary");for(const m of f)a(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 f of t){if(!f.capabilities.includes("portfolio"))continue;const d=f.config.source;if(!d||typeof d.kind!="string")continue;const m=e.find(p=>p.getPortfolio&&(p.portfolioKinds??[]).includes(d.kind));m&&a(24,"portfolio",async()=>{const p=await m.getPortfolio(d),v=p.totalUsd??p.holdings.reduce((b,x)=>b+(x.valueUsd??0),0),g=[...p.holdings].sort((b,x)=>(x.valueUsd??0)-(b.valueUsd??0)).slice(0,hr).map(b=>b.symbol).join(", ");return`Portfolio (${p.label??p.source}): ${Yt(v)}${g?`, top: ${g}`:""}`})}return(await Promise.all(o)).filter(f=>f!==null).sort((f,d)=>f[0]-d[0]).map(f=>f[1])}function Kg(e,t){const r=Nn();return z.useCallback(async()=>{try{const n=Gg(e,t);if(n.length===0)return null;const o=Vg(n),a=await Wg(r,n),i=[];o.length&&i.push(`Frames on the dashboard:
|
|
578
578
|
${o.join(`
|
|
579
579
|
`)}`),a.length&&i.push(`Live readings right now:
|
|
580
580
|
${a.join(`
|
|
581
581
|
`)}`);const s=i.join(`
|
|
582
582
|
|
|
583
|
-
`);return s?Fo(s,
|
|
583
|
+
`);return s?Fo(s,Ig):null}catch{return null}},[r,e,t])}var fn;function qg(e){if(!fn)if(typeof document<"u")fn=document.createElement("textarea");else return;var t="&"+e+";";fn.innerHTML=t;var r=fn.value;return r!==t?r:void 0}var P=32,N=9,br=13,J=10,_e=96,nt=126,He=91,$t=94,ue=62,Ot=35,ho=37,ae=45,Et=61,st=92,Ke=42,Ue=95,Te=60,ws=64,Ft=93,xt=33,Un=38,mt=58,po=70,wr=102,An=104,yr=119,Nr=116,mo=112,xs=115,Yg=160,Jg=12,Zg=44,Sn=59,Qr=63,Mt=46,We=47,xr=39,kr=34,cr=43,tt=124,jr=123,jo=125,Lt=40,It=41,Xg=120,Qg=88,go=30,ce=48,le=57,oe=65,se=90,Ee=97,Re=122,Bn=128,Nt=32,$g={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},A=$g;function ev(e){if(!Xa(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]!==`
|
|
584
584
|
`)return null;t++;let r=!1;for(;t<e.length;){let n=t;for(;t<e.length&&e[t]!==`
|
|
585
585
|
`&&e[t]!=="\r";)t++;if(t>=e.length)break;let o=t;if(e[t]==="\r"&&t++,t<e.length&&e[t]===`
|
|
586
|
-
`&&t++,
|
|
587
|
-
`),o=a+1):i===0&&(o<a&&mr.push(e.slice(o,a)),mr.push("�"),o=a+1)}return o<n&&mr.push(e.slice(o)),mr.join("")}function
|
|
588
|
-
`||e[t-1]==="\r");)t--;return e.slice(0,t).replace(
|
|
586
|
+
`&&t++,Xa(e,"---",n))return{endPos:t,hasValidYaml:r};if(!r){let a=uv(e,n,o);if(a<o){let i=e.charCodeAt(a);if(i>=Ee&&i<=Re||i>=oe&&i<=se||i>=ce&&i<=le||i===Ue){for(a++;a<o&&(i=e.charCodeAt(a),i>=Ee&&i<=Re||i>=oe&&i<=se||i>=ce&&i<=le||i===Ue||i===ae||i===Mt);)a++;a<o&&e.charCodeAt(a)===mt&&(a++,a>=o?r=!0:(i=e.charCodeAt(a),(i===P||i===N)&&(r=!0)))}}}}return null}var tv=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,rv={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"},nv={};function At(e){if(!e)return nv;var t={};for(var r in e){var n=r.toLowerCase(),o=rv[n];if(o)t[o]=e[r];else{var a=r.indexOf(":");a!==-1?t[r.slice(0,a)+r[a+1].toUpperCase()+r.slice(a+2)]=e[r]:t[r]=e[r]}}return t}var ov=/(\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 Hn(e){return e.indexOf("&")===-1?e:e.replace(tv,(t,r)=>{var n=qg(r);if(n)return n;if(r[0]==="#"){var o=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return o===0||o>=55296&&o<=57343||o>1114111?"�":o<=65535?String.fromCharCode(o):String.fromCharCode(55296+(o-65536>>10),56320+(o-65536&1023))}return t})}var Za=/(javascript|vbscript|data(?!:image)):/i;function Uo(e){if(Za.test(e))return null;if(e.indexOf("%")===-1)return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(Za.test(t))return null}catch{return null}return e}var dt={},gt,ot;for(gt=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],ot=0;ot<gt.length;ot++)dt[gt[ot]]="a";for(dt[231]=dt[199]="c",dt[240]=dt[208]="d",gt=[200,201,202,203,233,232,234,235],ot=0;ot<gt.length;ot++)dt[gt[ot]]="e";for(gt=[207,239,206,238,205,237,204,236],ot=0;ot<gt.length;ot++)dt[gt[ot]]="i";for(dt[209]=dt[241]="n",gt=[248,216,339,338,213,245,212,244,211,243,210,242],ot=0;ot<gt.length;ot++)dt[gt[ot]]="o";for(gt=[220,252,219,251,218,250,217,249],ot=0;ot<gt.length;ot++)dt[gt[ot]]="u";dt[376]=dt[255]=dt[221]=dt[253]="y";function Pt(e){for(var t="",r=-1,n=e.length,o=0;o<n;o++){var a=e.charCodeAt(o);if(a>=Ee&&a<=Re||a>=ce&&a<=le){r<0&&(r=o);continue}if(a>=oe&&a<=se){r>=0&&(t+=e.slice(r,o),r=-1),t+=String.fromCharCode(a+Nt);continue}if(a===P||a===ae){r>=0&&(t+=e.slice(r,o),r=-1),t+="-";continue}r>=0&&(t+=e.slice(r,o),r=-1);var i=dt[a];i&&(t+=i)}return r>=0&&(t+=e.slice(r)),t}function Xa(e,t,r){return e.startsWith(t,r)}var Qa=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 $r(e){let t=e.toLowerCase();if(Qa.has(t))return!0;let r=t.indexOf(":");return r!==-1?(t=t.slice(r+1),Qa.has(t)):!1}var vr=1,$a=2,Or=4,ei=8,av=16,Rt=32,nr=64,iv=(function(){var e=new Uint8Array(128),t;for(e[N]=vr,e[J]=vr|$a,e[Jg]=vr,e[br]=vr|$a,e[P]=vr,t=xt;t<=We;t++)e[t]=Or;for(t=mt;t<=ws;t++)e[t]=Or;for(t=He;t<=_e;t++)e[t]=Or;for(t=jr;t<=nt;t++)e[t]=Or;for(t=ce;t<=le;t++)e[t]=av;for(t=oe;t<=se;t++)e[t]=ei;for(t=Ee;t<=Re;t++)e[t]=ei;return e})(),sv=/[\p{P}\p{S}]/u,cv=new RegExp("\\p{Zs}","u"),mr=[];function lv(e){var t=e.indexOf("\r"),r=e.indexOf("\0");if(t===-1&&r===-1)return e;var n=e.length;mr.length=0;var o=0,a=0;for(t===-1?a=r:r===-1?a=t:a=t<r?t:r;a<n;a++){var i=e.charCodeAt(a);i===br?(o<a&&mr.push(e.slice(o,a)),a+1<n&&e.charCodeAt(a+1)===J&&a++,mr.push(`
|
|
587
|
+
`),o=a+1):i===0&&(o<a&&mr.push(e.slice(o,a)),mr.push("�"),o=a+1)}return o<n&&mr.push(e.slice(o)),mr.join("")}function uv(e,t,r){let n=r??e.length;for(;t<n&&(e[t]===" "||e[t]===" ");)t++;return t}function ks(e){if(!e)return!1;for(var t in e)return!0;return!1}function dv(e){return{attrs:{},children:[{type:A.text,text:e}],d:!0,type:A.htmlBlock,tag:"header"}}var fv=/^\n+/;function hv(e){for(var t=e.length;t>0&&(e[t-1]===`
|
|
588
|
+
`||e[t-1]==="\r");)t--;return e.slice(0,t).replace(fv,"")+`
|
|
589
589
|
|
|
590
|
-
`}function Dr(e){var r,n;if((e.type===A.htmlSelfClosing||e.type===A.htmlBlock)&&e.b)return[];if(e.type===A.paragraph){var t=e.children;return t?t.flatMap(Dr):[]}return e.type===A.text?(r=e.text)!=null&&r.trim()?[e]:[]:e.type===A.htmlBlock&&e.children?[{...e,children:(n=e.children)==null?void 0:n.flatMap(Dr)}]:[e]}function
|
|
591
|
-
`,n),c=s<0?o:s,l=n,u=0;l<c&&u<4;)if(e.charCodeAt(l)===P)u++,l++;else if(e.charCodeAt(l)===N)u+=4,l++;else break;if(l>=c){a=!1,n=s<0?o:s+1;continue}if(u<4){var h=e.charCodeAt(l);if(h===_e||h===nt){for(var f=h,d=0,m=l;m<c&&e.charCodeAt(m)===f;)d++,m++;if(d>=3){var p=!0;if(f===_e){for(var v=m;v<c;v++)if(e.charCodeAt(v)===_e){p=!1;break}}if(p){a=!1;for(var g=s<0?o:s+1;g<o;){for(var b=g,x=0;b<o&&x<4;){var T=e.charCodeAt(b);if(T===P)x++,b++;else if(T===N)x+=4,b++;else break}if(x<4&&b<o&&e.charCodeAt(b)===f){for(var C=0;b<o&&e.charCodeAt(b)===f;)C++,b++;if(C>=d){for(;b<o&&(e.charCodeAt(b)===P||e.charCodeAt(b)===N);)b++;if(b>=o||e.charCodeAt(b)===J){n=b>=o?o:b+1;break}}}for(;g<o&&e.charCodeAt(g)!==J;)g++;g<o&&g++}g>=o&&(n=o,i=!0);continue}}}}for(var y=l;y<c&&e.charCodeAt(y)===ue;){y++,y<c&&e.charCodeAt(y)===P&&y++;for(var S=0;y<c&&S<4;)if(e.charCodeAt(y)===P)S++,y++;else if(e.charCodeAt(y)===N)S+=4,y++;else break;if(S>=4)break;a=!1}if(!a&&u<4&&y<c&&e.charCodeAt(y)===He&&!(y+1<o&&e.charCodeAt(y+1)===$t)){var E=
|
|
590
|
+
`}function Dr(e){var r,n;if((e.type===A.htmlSelfClosing||e.type===A.htmlBlock)&&e.b)return[];if(e.type===A.paragraph){var t=e.children;return t?t.flatMap(Dr):[]}return e.type===A.text?(r=e.text)!=null&&r.trim()?[e]:[]:e.type===A.htmlBlock&&e.children?[{...e,children:(n=e.children)==null?void 0:n.flatMap(Dr)}]:[e]}function Cs(e){for(var t=0;t<e.length;t++){if(e[t].type===A.htmlBlock){var r=e[t],n=!1;if(r.d&&r.a&&t===e.length-1){var o="</"+String(r.tag).toLowerCase()+">",a=r.a.toLowerCase().indexOf(o);if(a!==-1){var i=r.a.slice(a+o.length).replace(/<\/[a-z][a-z0-9-]*\s*>/gi,"");i.trim()&&(n=!0)}}n||(r.d=!1)}"children"in e[t]&&e[t].children&&Cs(e[t].children)}}function pv(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.type===A.paragraph&&n.children)for(var o=n.children,a=0;a<o.length;a++){var i=o[a];if(i.type===A.htmlSelfClosing&&i.b&&i.tag.toLowerCase()===t){var s=e.slice(0,r);a>0&&s.push({type:A.paragraph,children:o.slice(0,a)});var c=[];if(a+1<o.length){var l=o.slice(a+1).filter(function(u){return!(u.type===A.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===A.htmlSelfClosing||n.type===A.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 mv(e,t,r){var n=e.replace(new RegExp("\\s*</"+t+">\\s*$","i"),"");return r?_s(n):n}function ti(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 gv(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 vo(e,t,r){if(t.indexOf(".")===-1)return(e==null?void 0:e[t])||r;for(var n=e,o=t.split("."),a=0;a<o.length&&(n=n==null?void 0:n[o[a]],n!==void 0);)a++;return n||r}function vv(e){for(var t=!1,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=P||n===kr||n===ho||n===Te||n===ue||n===He||n===st||n===Ft||n===$t||n===_e||n>=123){t=!0;break}}if(!t)return e;for(var o="",r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n===ho&&r+2<e.length){var a=e.charCodeAt(r+1),i=e.charCodeAt(r+2);if((a>=ce&&a<=le||a>=oe&&a<=po||a>=Ee&&a<=wr)&&(i>=ce&&i<=le||i>=oe&&i<=po||i>=Ee&&i<=wr)){o+=e[r]+e[r+1]+e[r+2],r+=2;continue}}o+=encodeURI(e[r])}return o}function yv(...e){return e.filter(Boolean).join(" ")}var bv=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),zn=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function ri(e){return bv.has(e.toLowerCase())}function wv(e){return zn.lastIndex=0,zn.test(e)}function _s(e){return zn.lastIndex=0,e.replace(zn,function(t,r,n,o){return"<"+r+n+o})}var xv=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,kv=/^<[A-Z]/,yo=["script","pre","style","textarea"],en=new Set(yo),Cv=/<(?:pre|script|style|textarea)\b/i,ni=/<(?:pre|script|style|textarea)\b/iy,oo=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,oi=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,As=new Uint8Array(128);(function(){for(var e=[_e,Ke,Ue,nt,Et,He,xt,Te,st,Un,J,An,yr,wr],t=0;t<e.length;t++)As[e[t]]=1})();var ai=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function _v(e){return en.has(e)}function Av(e){return Cv.test(e)}function Ss(e,t,r){for(var n=t,o=r;n<o&&(e.charCodeAt(n)===P||e.charCodeAt(n)===N);)n++;if(n>=o)return!1;e.charCodeAt(n)===tt&&n++;for(var a=0;n<o;){for(;n<o&&(e.charCodeAt(n)===P||e.charCodeAt(n)===N);)n++;if(n>=o)break;if(e.charCodeAt(n)===tt&&a>0){for(var i=n+1;i<o&&(e.charCodeAt(i)===P||e.charCodeAt(i)===N);)i++;if(i>=o)return!0}if(e.charCodeAt(n)===mt&&n++,n>=o||e.charCodeAt(n)!==ae)return!1;for(;n<o&&e.charCodeAt(n)===ae;)n++;for(n<o&&e.charCodeAt(n)===mt&&n++,a++;n<o&&(e.charCodeAt(n)===P||e.charCodeAt(n)===N);)n++;if(n<o)if(e.charCodeAt(n)===tt)n++;else return!1}return a>0}function Zt(e,t){if(e.charCodeAt(t)!==Te)return null;let r=t+1,n=e.length,o=!1;e.charCodeAt(r)===We&&(r++,o=!0);let a=r,i=e.charCodeAt(r);if(!(i>=Ee&&i<=Re||i>=oe&&i<=se))return null;for(;r<n&&(e.charCodeAt(r)>=Ee&&e.charCodeAt(r)<=Re||e.charCodeAt(r)>=oe&&e.charCodeAt(r)<=se||e.charCodeAt(r)>=ce&&e.charCodeAt(r)<=le||e.charCodeAt(r)===ae);)r++;let s=e.slice(a,r);if(!s)return null;let c=r;for(;r<n&&(e.charCodeAt(r)===P||e.charCodeAt(r)===N||e.charCodeAt(r)===J);)r++;let l=e.slice(c,r);if(r===c&&r<n){var u=e.charCodeAt(r);if(u!==ue&&u!==We)return null}let h=r,f={},d=!1;for(;r<n;){let S=e.charCodeAt(r);if(S===ue){let E=e.slice(h,r);return{tag:s,attrs:f,selfClosing:!1,end:r+1,rawAttrs:E,whitespaceBeforeAttrs:l,isClosing:o,hasSpaceBeforeSlash:d}}if(S===P||S===N||S===J){r++;continue}if(S===We&&r+1<n&&e.charCodeAt(r+1)===ue){let E=e.slice(h,r);return d=r>h&&e.charCodeAt(r-1)===P,{tag:s,attrs:f,selfClosing:!0,end:r+2,rawAttrs:E,whitespaceBeforeAttrs:l,isClosing:o,hasSpaceBeforeSlash:d}}var m=r,p=e.charCodeAt(r);if(!(p>=Ee&&p<=Re||p>=oe&&p<=se||p===Ue||p===mt))return null;for(r++;r<n;){var v=e.charCodeAt(r);if(v>=Ee&&v<=Re||v>=oe&&v<=se||v>=ce&&v<=le||v===Ue||v===Mt||v===mt||v===ae)r++;else break}for(var g=e.slice(m,r);r<n&&(e.charCodeAt(r)===P||e.charCodeAt(r)===N);)r++;if(e.charCodeAt(r)!==Et){f[g]="";continue}for(r++;r<n&&(e.charCodeAt(r)===P||e.charCodeAt(r)===N);)r++;var b=e.charCodeAt(r);if(b===kr||b===xr){r++;for(var x=r;r<n&&e.charCodeAt(r)!==b;)r++;if(r>=n)return null;if(f[g]=e.slice(x,r),r++,r<n){var T=e.charCodeAt(r);if(T!==P&&T!==N&&T!==J&&T!==ue&&T!==We)return null}}else if(b===jr){var C=1,x=r;for(r++;r<n&&C>0;){var v=e.charCodeAt(r);v===jr?C++:v===jo&&C--,r++}f[g]=e.slice(x,r)}else{for(var x=r;r<n;){var y=e.charCodeAt(r);if(y===P||y===N||y===ue||y===J||y===kr||y===xr||y===Et||y===Te||y===_e)break;r++}if(r===x)return null;f[g]=e.slice(x,r)}}return null}function Sv(e,t,r){if(!r.optimizeForStreaming&&e.indexOf("[")===-1)return!1;for(var n=0,o=e.length,a=!1,i=!1;n<o;){for(var s=e.indexOf(`
|
|
591
|
+
`,n),c=s<0?o:s,l=n,u=0;l<c&&u<4;)if(e.charCodeAt(l)===P)u++,l++;else if(e.charCodeAt(l)===N)u+=4,l++;else break;if(l>=c){a=!1,n=s<0?o:s+1;continue}if(u<4){var h=e.charCodeAt(l);if(h===_e||h===nt){for(var f=h,d=0,m=l;m<c&&e.charCodeAt(m)===f;)d++,m++;if(d>=3){var p=!0;if(f===_e){for(var v=m;v<c;v++)if(e.charCodeAt(v)===_e){p=!1;break}}if(p){a=!1;for(var g=s<0?o:s+1;g<o;){for(var b=g,x=0;b<o&&x<4;){var T=e.charCodeAt(b);if(T===P)x++,b++;else if(T===N)x+=4,b++;else break}if(x<4&&b<o&&e.charCodeAt(b)===f){for(var C=0;b<o&&e.charCodeAt(b)===f;)C++,b++;if(C>=d){for(;b<o&&(e.charCodeAt(b)===P||e.charCodeAt(b)===N);)b++;if(b>=o||e.charCodeAt(b)===J){n=b>=o?o:b+1;break}}}for(;g<o&&e.charCodeAt(g)!==J;)g++;g<o&&g++}g>=o&&(n=o,i=!0);continue}}}}for(var y=l;y<c&&e.charCodeAt(y)===ue;){y++,y<c&&e.charCodeAt(y)===P&&y++;for(var S=0;y<c&&S<4;)if(e.charCodeAt(y)===P)S++,y++;else if(e.charCodeAt(y)===N)S+=4,y++;else break;if(S>=4)break;a=!1}if(!a&&u<4&&y<c&&e.charCodeAt(y)===He&&!(y+1<o&&e.charCodeAt(y+1)===$t)){var E=zs(e,y,t);if(E){n=E,a=!1;continue}}var O=e.charCodeAt(l);if(O===Ot&&u<4)a=!1;else if(u<4&&(O===ae||O===Ke||O===Ue)){for(var _=l,q=0;_<c;){var U=e.charCodeAt(_);if(U===O)q++;else if(U!==P&&U!==N)break;_++}a=!(q>=3&&_>=c)}else a=!0;n=s<0?o:s+1}return i}function zs(e,t,r){let n=e.length;if(e.charCodeAt(t)!==He)return null;let o=t+1<n&&e.charCodeAt(t+1)===$t,a=t+1;for(;a<n;){var i=e.charCodeAt(a);if(i===Ft){a++;break}if(i===He)return null;i===st&&a+1<n&&a++,a++}if(a>n||e.charCodeAt(a-1)!==Ft)return null;let s=e.slice(t+1,a-1);if(s.length>999)return null;let c=mn(s);if(!c||a>=n||e.charCodeAt(a)!==mt)return null;a++;let l=!1;for(;a<n;){let $=e.charCodeAt(a);if($===P||$===N)a++;else if($===J&&!l)l=!0,a++;else break}if(o){let $=e.indexOf(`
|
|
592
592
|
`,a),H=$<0?n:$,I=e.slice(a,H).trim();return r[c]={target:I,title:void 0},$<0?n:$+1}var u;if(a<n&&e.charCodeAt(a)===Te){a++;for(var h=a;a<n&&e.charCodeAt(a)!==ue&&e.charCodeAt(a)!==J;)e.charCodeAt(a)===st&&a+1<n&&a++,a++;if(a>=n||e.charCodeAt(a)!==ue)return null;u=e.slice(h,a),a++;for(var f=e.indexOf(`
|
|
593
593
|
`,a),d=f<0?n:f,m=a;m<d&&(e.charCodeAt(m)===P||e.charCodeAt(m)===N);)m++;if(m<d){if(m===a)return null;var p=e.charCodeAt(m);if(p!==kr&&p!==xr&&p!==Lt)return null}}else{for(var h=a,v=0;a<n;){var i=e.charCodeAt(a);if(i===Lt)v++;else if(i===It){if(v===0)break;v--}else{if(i===P||i===N||i===J)break;i===st&&a+1<n&&a++}a++}if(u=e.slice(h,a),!u)return null}for(;a<n&&(e.charCodeAt(a)===P||e.charCodeAt(a)===N);)a++;var g=e.indexOf(`
|
|
594
|
-
`,a),b=g<0?n:g,x,T=!1,C=a,y=a;if(a===b&&a<n)for(y=a+1;y<n&&(e.charCodeAt(y)===P||e.charCodeAt(y)===N);)y++;if(y<n){var S=e.charCodeAt(y);if(S===kr||S===xr||S===Lt){for(var E=S===Lt?41:S,O=y+1,_=O;O<n;){var
|
|
595
|
-
`,t),n=r<0?e.length:r;return bo=e,wo=t,gn=n,n}function fe(e,t){let r=Ae(e,t);return r<e.length?r+1:r}function Zr(e,t,r){for(;t<r;){let n=e.charCodeAt(t);if(n!==P&&n!==N)break;t++}return t}function
|
|
596
|
-
`,
|
|
594
|
+
`,a),b=g<0?n:g,x,T=!1,C=a,y=a;if(a===b&&a<n)for(y=a+1;y<n&&(e.charCodeAt(y)===P||e.charCodeAt(y)===N);)y++;if(y<n){var S=e.charCodeAt(y);if(S===kr||S===xr||S===Lt){for(var E=S===Lt?41:S,O=y+1,_=O;O<n;){var q=e.charCodeAt(O);if(q===E){for(var U=O+1;U<n&&(e.charCodeAt(U)===P||e.charCodeAt(U)===N);)U++;(U>=n||e.charCodeAt(U)===J)&&(x=e.slice(_,O),T=!0,C=U<n?U+1:n);break}if(q===st&&O+1<n){O+=2;continue}if(q===J&&O+1<n&&e.charCodeAt(O+1)===J)break;O++}if(!T&&y===a)return null}}if(T)return r[c]||(r[c]={target:Lr(u),title:x!==void 0?Hn(Lr(x)):x}),C;for(;a<b&&(e.charCodeAt(a)===P||e.charCodeAt(a)===N);)a++;return a<b?null:(r[c]||(r[c]={target:Lr(u),title:x}),g<0?n:g+1)}var bt=new Uint8Array(iv);for(bt[Ot]|=Rt,bt[ue]|=Rt,bt[ae]|=Rt|nr,bt[cr]|=Rt,bt[Ke]|=Rt|nr,bt[Ue]|=Rt|nr,bt[_e]|=Rt|nr,bt[nt]|=Rt|nr,bt[Te]|=Rt|nr,bt[He]|=nr,bt[xt]|=nr,bt[tt]|=Rt,hn=ce;hn<=le;hn++)bt[hn]|=Rt;var hn;function ii(e){if(e.indexOf("[")<0&&e.indexOf("]")<0)return!1;for(var t=0;t<e.length;t++){if(e.charCodeAt(t)===st){t++;continue}if(e.charCodeAt(t)===He||e.charCodeAt(t)===Ft)return!0}return!1}function mn(e){for(var t=e.length,r=!0,n=t>0,o=0;o<t;o++){var a=e.charCodeAt(o);if(a===P){if(r){n=!1;break}r=!0}else if(a<33||a>126||a>=oe&&a<=se){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 Bo(e){return e<Bn?bt[e]:e===Yg?vr:0}function Lr(e){return e.indexOf("\\")===-1?e:e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var bo=null,wo=-1,gn=-1;function Ae(e,t){if(t>=wo&&t<=gn&&e===bo)return gn;var r=e.indexOf(`
|
|
595
|
+
`,t),n=r<0?e.length:r;return bo=e,wo=t,gn=n,n}function fe(e,t){let r=Ae(e,t);return r<e.length?r+1:r}function Zr(e,t,r){for(;t<r;){let n=e.charCodeAt(t);if(n!==P&&n!==N)break;t++}return t}function si(e,t){let r=fe(e,t);for(;r<e.length;){let n=Ae(e,r);if(wt(e,r,n))return r;r=fe(e,r)}return e.length}function lr(e,t,r,n){let o=0;for(;t+o<r&&e.charCodeAt(t+o)===n;)o++;return o}var Ce=0,xe=0;function Ze(e,t,r){for(Ce=0,xe=0;t+xe<r;){let n=e.charCodeAt(t+xe);if(n===N)Ce+=4-Ce%4;else if(n===P)Ce++;else break;xe++}}function wt(e,t,r){return Zr(e,t,r)>=r}function zv(e,t,r,n){let o=Ae(e,t);if(Ze(e,t,o),Ce>3)return null;let a=t+xe;if(e.charCodeAt(a)!==Ot)return null;let i=lr(e,a,o,35);if(i<1||i>6||(a+=i,a<o&&e.charCodeAt(a)!==P&&e.charCodeAt(a)!==N))return null;a=Zr(e,a,o);for(var s=o;s>a&&e.charCodeAt(s-1)===P;)s--;for(var c=s;s>a&&e.charCodeAt(s-1)===Ot;)s--;if(s<c)if(s===a||e.charCodeAt(s-1)===P)for(;s>a&&e.charCodeAt(s-1)===P;)s--;else s=c;let l=e.slice(a,s),u=Ir(l,!1,r,n),h=((n==null?void 0:n.slugify)||Pt)(l);return{node:{type:A.heading,level:i,children:u,id:h},end:fe(e,o)}}function Tv(e,t,r){var n=e.charCodeAt(t);if(n!==Et&&n!==ae)return!1;for(var o=t;o<r&&e.charCodeAt(o)===n;)o++;for(;o<r&&(e.charCodeAt(o)===P||e.charCodeAt(o)===N);)o++;return o>=r}function ir(e,t){let r=Ae(e,t);if(Ze(e,t,r),Ce>3)return null;let n=t+xe,o=e.charCodeAt(n);if(o!==ae&&o!==Ke&&o!==Ue)return null;let a=0;for(;n<r;){let i=e.charCodeAt(n);if(i===o)a++;else if(i!==P&&i!==N)return null;n++}return a<3?null:{node:{type:A.breakThematic},end:fe(e,r)}}function Ev(e,t,r){let n=Ae(e,t);if(Ze(e,t,n),Ce>3)return null;let o=Ce,a=t+xe,i=e.charCodeAt(a);if(i!==_e&&i!==nt)return null;let s=lr(e,a,n,i);if(s<3)return null;a+=s;let c=Zr(e,a,n),l=n;if(i===_e){for(let H=c;H<n;H++)if(e.charCodeAt(H)===_e)return null}for(;l>c&&(e.charCodeAt(l-1)===P||e.charCodeAt(l-1)===N);)l--;let u=e.slice(c,l),h="",f="",d=u.indexOf(" ");d===-1?h=u:(h=u.slice(0,d),f=u.slice(d+1).trim()),h=Lr(h);var m=void 0;if(f){ai.lastIndex=0;for(var p;(p=ai.exec(f))!==null;)m||(m={}),m[p[1]]=p[2]!==void 0?p[2]:p[3]}let v=fe(e,n),g=e.length,b=e.length;for(var x=String.fromCharCode(i).repeat(s),T=v;T<e.length;){var C=e.indexOf(x,T);if(C===-1)break;for(var y=C,S=0;y>0&&S<4&&e.charCodeAt(y-1)===P;)y--,S++;if(S<=3&&(y===0||e.charCodeAt(y-1)===J)){for(var E=C+s;E<e.length&&e.charCodeAt(E)===i;)E++;var O=Ae(e,E);if(wt(e,E,O)){g=y,b=fe(e,O);break}}T=C+1}var _;if(o===0)_=g>v&&e.charCodeAt(g-1)===J?e.slice(v,g-1):e.slice(v,g);else{_="";for(var q=v;q<g;){var U=Ae(e,q);Ze(e,q,U);var $=Math.min(xe,o);_+=e.slice(q+$,U)+`
|
|
596
|
+
`,q=fe(e,U)}_.length>0&&_.charCodeAt(_.length-1)===J&&(_=_.slice(0,-1))}return{node:{type:A.codeBlock,lang:h||void 0,text:_,infoString:f||void 0,attrs:m},end:b}}function Pv(e,t){let r=Ae(e,t);if(Ze(e,t,r),Ce<4)return null;let n="",o=t;for(;o<e.length;){let d=Ae(e,o);if(Ze(e,o,d),wt(e,o,d)){for(var a=0,i=fe(e,d);i<e.length;){var s=Ae(e,i);if(wt(e,i,s)){a++,i=fe(e,s);continue}if(Ze(e,i,s),Ce>=4){for(var c=0;c<=a;c++)n+=`
|
|
597
597
|
`;o=i;break}break}if(o!==i)break;continue}if(Ce<4)break;let m=0,p=0;var l=0;for(let v=o;v<d&&p<4;v++){if(e.charCodeAt(v)===N){var u=4-p%4;p+u>4&&(l=p+u-4),p+=u}else p++;m++}var h="";if(l>0)for(var f=0;f<l;f++)h+=" ";h+=e.slice(o+m,d),n+=h+`
|
|
598
|
-
`,o=fe(e,d)}for(;n.length>0&&n.charCodeAt(n.length-1)===J;)n=n.slice(0,-1);return n?{node:{type:A.codeBlock,lang:void 0,text:n,infoString:void 0,attrs:void 0},end:o}:null}function
|
|
599
|
-
`;var E=p.trimStart();E.startsWith("```")||E.startsWith("~~~")?h=!h:(p.startsWith(" ")||p.startsWith(" "))&&(h=!0),u=E.length>0,s=fe(e,I)}else if(i&&!wt(e,s,I)&&u){if(Ce<4){var O=s+xe,_=O<I?e.charCodeAt(O):0;if(_===Ot||_===ue||_===_e||_===nt||_===Te||(_===ae||_===
|
|
600
|
-
`,l=!0,s=fe(e,I)}else break}if(!i&&!c)return null;var{inBlockQuote:U,f:$}=r;r.inBlockQuote=!0,l&&(r.f=!0);let H=sr(i||"",r,n);return r.inBlockQuote=U,r.f=$,{node:{type:A.blockQuote,children:H,alert:c||void 0},end:s}}function
|
|
598
|
+
`,o=fe(e,d)}for(;n.length>0&&n.charCodeAt(n.length-1)===J;)n=n.slice(0,-1);return n?{node:{type:A.codeBlock,lang:void 0,text:n,infoString:void 0,attrs:void 0},end:o}:null}function Mv(e,t,r,n){let o=Ae(e,t);if(Ze(e,t,o),Ce>3)return null;let a=t+xe;if(e.charCodeAt(a)!==ue)return null;let i="",s=t,c,l=!1,u=!1,h=!1;for(;s<e.length;){let I=Ae(e,s);Ze(e,s,I);let D=s+xe;if(e.charCodeAt(D)===ue){let G=D+1;var f=Ce+1,d=!1;if(G<I){var m=e.charCodeAt(G);m===P?(G++,f++,d=!0):m===N&&(d=!0)}for(var p="",v=!1,g=G;g<I;g++)if(e.charCodeAt(g)===N){v=!0;break}if(v){var b=f;if(d&&G<I&&e.charCodeAt(G)===N){for(var x=4-b%4,T=0;T<x-1;T++)p+=" ";b+=x,G++}for(var C=G;C<I;C++)if(e.charCodeAt(C)===N){for(var y=4-b%4,S=0;S<y;S++)p+=" ";b+=y}else p+=e[C],b++}else p=e.slice(G,I);if(!i&&!c){let Pe=p.match(/^\[!([A-Za-z]+)\]\s*$/);if(Pe){c=Pe[1].toUpperCase(),s=fe(e,I);continue}}i+=p+`
|
|
599
|
+
`;var E=p.trimStart();E.startsWith("```")||E.startsWith("~~~")?h=!h:(p.startsWith(" ")||p.startsWith(" "))&&(h=!0),u=E.length>0,s=fe(e,I)}else if(i&&!wt(e,s,I)&&u){if(Ce<4){var O=s+xe,_=O<I?e.charCodeAt(O):0;if(_===Ot||_===ue||_===_e||_===nt||_===Te||(_===ae||_===Ke||_===Ue)&&ir(e,s)||(_===ae||_===Ke||_===cr)&&O+1<I&&(e.charCodeAt(O+1)===P||e.charCodeAt(O+1)===N))break;if(_>=ce&&_<=le){for(var q=O;q<I&&e.charCodeAt(q)>=ce&&e.charCodeAt(q)<=le;)q++;if(q<I&&(e.charCodeAt(q)===Mt||e.charCodeAt(q)===It))break}}if(h)break;i+=e.slice(s,I)+`
|
|
600
|
+
`,l=!0,s=fe(e,I)}else break}if(!i&&!c)return null;var{inBlockQuote:U,f:$}=r;r.inBlockQuote=!0,l&&(r.f=!0);let H=sr(i||"",r,n);return r.inBlockQuote=U,r.f=$,{node:{type:A.blockQuote,children:H,alert:c||void 0},end:s}}function Ts(e,t,r){for(var n=0,o=t;o<r;o++)e.charCodeAt(o)===N?n+=4-n%4:n++;return n}function or(e,t,r){if(Ze(e,t,r),Ce>3)return null;var n=t+xe;if(n>=r)return null;var o=e.charCodeAt(n),a=Ce,i=n;if(o===ae||o===Ke||o===cr){if(i=n+1,i<r&&e.charCodeAt(i)!==P&&e.charCodeAt(i)!==N&&e.charCodeAt(i)!==J)return null}else if(o>=ce&&o<=le){for(var s=n;s<r&&s-n<9;){var c=e.charCodeAt(s);if(c<ce||c>le)break;s++}if(s>n&&s<r){var l=e.charCodeAt(s);if(l===Mt||l===It){if(i=s+1,i<r&&e.charCodeAt(i)!==P&&e.charCodeAt(i)!==N&&e.charCodeAt(i)!==J)return null}else return null}else return null}else return null;var u=i,h=Ts(e,t,i),f=0,d=u,m=h;if(u>=r)return{ordered:o>=ce&&o<=le,marker:o>=ce&&o<=le?e[s]:e[n],start:o>=ce&&o<=le?parseInt(e.slice(n,s),10):void 0,contentStart:u,contentCol:h+1,markerCol:a,isEmpty:!0};for(;d<r&&(e.charCodeAt(d)===P||e.charCodeAt(d)===N);){if(e.charCodeAt(d)===N){var p=4-m%4;m+=p}else m++;d++,f++}var v=d>=r,g=m-h;return v||g>4?(m=h+1,d=u+1,f=1):f===0&&(m=h+1,d=u,f=1),{ordered:o>=ce&&o<=le,marker:o>=ce&&o<=le?e[s]:e[n],start:o>=ce&&o<=le?parseInt(e.slice(n,s),10):void 0,contentStart:d,contentCol:m,markerCol:a,isEmpty:v}}var Tn=0;function Ov(e,t,r,n){var o=0,a=t;for(Tn=0;a<r&&o<n;){var i=e.charCodeAt(a);if(i===N){var s=4-o%4;if(o+s>n){Tn=o+s-n,a++,o=n;break}o+=s}else if(i===P)o++;else break;a++}return a}function ci(e,t,r,n){var o=Ae(e,t),a=or(e,t,o);if(!a)return null;var i=[],s=t,c=a.contentCol,l="",u=a.isEmpty,h=!1,f=!1;if(!a.isEmpty){for(var d=!1,m=a.contentStart;m<o;m++)if(e.charCodeAt(m)===N){d=!0;break}if(d){var p="",v=Ts(e,t,a.contentStart),g=v-a.contentCol;if(g>0)for(var b=0;b<g;b++)p+=" ";for(var x=a.contentStart;x<o;x++)if(e.charCodeAt(x)===N){for(var T=4-v%4,C=0;C<T;C++)p+=" ";v+=T}else p+=e[x],v++;l=p+`
|
|
601
601
|
`}else l=e.slice(a.contentStart,o)+`
|
|
602
|
-
`}for(s=fe(e,o);s<e.length;){var y=Ae(e,s);Ze(e,s,y);var S=e.charCodeAt(s+xe);if(Ce<c&&(S===ae||S===
|
|
602
|
+
`}for(s=fe(e,o);s<e.length;){var y=Ae(e,s);Ze(e,s,y);var S=e.charCodeAt(s+xe);if(Ce<c&&(S===ae||S===Ke||S===Ue)&&Ce<=3&&ir(e,s))break;var E=or(e,s,y);if(E&&E.ordered===a.ordered&&E.marker===a.marker&&E.markerCol<c){i.push({contentCol:c,raw:l,hasBlankAfter:h,isEmpty:u}),h&&(f=!0),c=E.contentCol,u=E.isEmpty,h=!1,l=E.isEmpty?"":e.slice(E.contentStart,y)+`
|
|
603
603
|
`,s=fe(e,y);continue}if(wt(e,s,y)){l+=`
|
|
604
|
-
`,s=fe(e,y);for(var O=!1,_=0;_<l.length;_++){var
|
|
604
|
+
`,s=fe(e,y);for(var O=!1,_=0;_<l.length;_++){var q=l.charCodeAt(_);if(q!==J&&q!==br&&q!==P&&q!==N){O=!0;break}}if(u&&!O)if(s<e.length){var U=Ae(e,s),$=or(e,s,U);if(!$||$.ordered!==a.ordered||$.marker!==a.marker)break;h=!0}else break;if(s<e.length){var H=Ae(e,s);Ze(e,s,H);var I=e.charCodeAt(s+xe);if((I===ae||I===Ke||I===Ue)&&Ce<=3&&ir(e,s))break;var D=or(e,s,H);if(D&&D.ordered===a.ordered&&D.marker===a.marker&&D.markerCol<c){h=!0;continue}if(!wt(e,s,H)&&Ce<c)break}continue}if(Ce>=c){var G=Ov(e,s,y,c);if(Tn>0){for(var Pe="",Q=c,te=0;te<Tn;te++)Pe+=" ",Q++;for(var ze=G;ze<y;ze++)if(e.charCodeAt(ze)===N){for(var ct=4-Q%4,De=0;De<ct;De++)Pe+=" ";Q+=ct}else Pe+=e[ze],Q++;l+=Pe+`
|
|
605
605
|
`}else l+=e.slice(G,y)+`
|
|
606
|
-
`;s=fe(e,y);continue}for(var je=!1,me=0;me<l.length;me++){var re=l.charCodeAt(me);if(re!==J&&re!==br&&re!==P&&re!==N){je=!0;break}}if(!h&&je&&!u){var j=s+xe,B=e.charCodeAt(j),ne=B===Ot||B===ue||B===Te||B===_e||B===nt||(B===ae||B===
|
|
607
|
-
`,s=fe(e,y);continue}}break}if(i.push({contentCol:c,raw:l,hasBlankAfter:h,isEmpty:u}),i.length===0)return null;var ee=f;if(!ee)for(var Ne=0;Ne<i.length;Ne++){if(i[Ne].hasBlankAfter&&Ne<i.length-1){ee=!0;break}if(!i[Ne].isEmpty){for(var ve=i[Ne].raw,we=ve.length,
|
|
608
|
-
`,
|
|
606
|
+
`;s=fe(e,y);continue}for(var je=!1,me=0;me<l.length;me++){var re=l.charCodeAt(me);if(re!==J&&re!==br&&re!==P&&re!==N){je=!0;break}}if(!h&&je&&!u){var j=s+xe,B=e.charCodeAt(j),ne=B===Ot||B===ue||B===Te||B===_e||B===nt||(B===ae||B===Ke||B===Ue||B===cr)&&(ir(e,s)!==null||or(e,s,y)!==null)||B>=ce&&B<=le&&or(e,s,y)!==null;if(!ne){l+=""+e.slice(j,y)+`
|
|
607
|
+
`,s=fe(e,y);continue}}break}if(i.push({contentCol:c,raw:l,hasBlankAfter:h,isEmpty:u}),i.length===0)return null;var ee=f;if(!ee)for(var Ne=0;Ne<i.length;Ne++){if(i[Ne].hasBlankAfter&&Ne<i.length-1){ee=!0;break}if(!i[Ne].isEmpty){for(var ve=i[Ne].raw,we=ve.length,K=0,ye=!1,Je=!1,Me=!1,Ve=!1,at=0,Le=0,it=-1;K<we;){var Y=ve.indexOf(`
|
|
608
|
+
`,K);if(Y<0&&(Y=we),Ve){Ze(ve,K,Y);for(var ft=ve.slice(K+xe,Y),ge=0;ge<ft.length&&ft.charCodeAt(ge)===at;)ge++;ge>=Le&&ft.slice(ge).trim()===""&&(Ve=!1),K=Y<we?Y+1:we;continue}if(wt(ve,K,Y)){it>=0?Me=!0:ye&&(Je=!0),K=Y<we?Y+1:we;continue}if(Ze(ve,K,Y),it>=0){if(Ce>=it){K=Y<we?Y+1:we;continue}var zt=or(ve,K,Y);if(zt&&zt.markerCol<it&&zt.contentCol<=it){K=Y<we?Y+1:we;continue}if(zt){K=Y<we?Y+1:we;continue}it=-1,Me&&(Je=!0,Me=!1)}var Kt=ve.slice(K+xe,Y),be=Kt.charCodeAt(0);if((be===_e||be===nt)&&Ce<=3){for(var V=0;V<Kt.length&&Kt.charCodeAt(V)===be;)V++;if(V>=3){if(Je&&ye){ee=!0;break}Ve=!0,at=be,Le=V,ye=!0,K=Y<we?Y+1:we;continue}}var vt=Ce<=3?or(ve,K,Y):null;if(vt&&ye){if(Je){ee=!0;break}it=vt.contentCol,Me=!1,K=Y<we?Y+1:we,ye=!0;continue}if(Je){ee=!0;break}ye=!0,K=Y<we?Y+1:we}if(ee)break}}for(var Tt=[],jt=0;jt<i.length;jt++){for(var ht=i[jt],Ie=ht.raw,$e=Ie.length;$e>0&&Ie.charCodeAt($e-1)===J;)$e--;var et=$e<Ie.length?Ie.slice(0,$e):Ie,lt=null;if(et.length>=3&&et.charCodeAt(0)===He){var Ct=et[1];(Ct===" "||Ct==="x"||Ct==="X")&&et.charCodeAt(2)===Ft&&(lt={type:A.gfmTask,completed:Ct==="x"||Ct==="X"},et=et.slice(3))}var Be;if(ht.isEmpty&&et.trim()==="")Be=[];else if(ee){var er=r.inList;r.inList=!0,Be=sr(et,r,n),r.inList=er}else{var Ut=r.inList;if(r.inList=!0,Be=sr(et,r,n),r.inList=Ut,Be.length===1&&Be[0].type===A.paragraph)Be=Be[0].children;else if(r.h){var Bt=[];r.h.push({src:Be,dest:Bt,unwrap:!0}),Be=Bt}else{for(var _r=[],qt=0;qt<Be.length;qt++)if(Be[qt].type===A.paragraph)for(var Ht=Be[qt].children,Br=0;Br<Ht.length;Br++)_r.push(Ht[Br]);else _r.push(Be[qt]);Be=_r}}if(lt){var Hr=[lt,{type:A.text,text:" "}];if(r.h)r.h.push({src:Be,dest:Hr,unwrap:!1});else for(var Gt=0;Gt<Be.length;Gt++)Hr.push(Be[Gt]);Tt.push(Hr)}else Tt.push(Be)}return{node:{type:a.ordered?A.orderedList:A.unorderedList,start:a.ordered?a.start:void 0,items:Tt},end:s}}var En=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 Jt(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=[],h=0,f=0;for(let m=0;m<s.length;m++){let p=s.charCodeAt(m);p===Lt?h++:p===It?h--:p===Sn&&h===0&&(u.push(s.slice(f,m)),f=m+1)}f<s.length&&u.push(s.slice(f));let d=!1;u.forEach(m=>{let p=m.indexOf(":");if(p===-1)return;let v=m.slice(0,p).trim(),g=m.slice(p+1).trim();if(v&&g){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(g)){d=!0;return}let b=v.indexOf("-")!==-1?v.replace(/-([a-z])/g,(x,T)=>T.toUpperCase()):v;l[b]=g}}),!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)===jr&&s.charCodeAt(s.length-1)===jo){var o=s.slice(1,-1);if(o.length>0){var a=o.charCodeAt(0);if(a===He||a===jr)try{n[i]=JSON.parse(o);continue}catch{}}if(o==="true"){n[i]=!0;continue}if(o==="false"){n[i]=!1;continue}if(r!=null&&r.evalUnserializableExpressions)try{n[i]=(0,eval)("("+o+")");continue}catch{}n[i]=o}else n[i]=s}return n}function ar(e,t,r){let n=t.length;if(n===0)return r;var o=t.charCodeAt(0),a=o>=oe&&o<=se||o>=Ee&&o<=Re;if(!a){for(var i=String.fromCharCode(o),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,h=1;h<n;h++){var f=e.charCodeAt(l+h),d=t.charCodeAt(h);if(f>=oe&&f<=se&&(f+=Nt),d>=oe&&d<=se&&(d+=Nt),f!==d){u=!1;break}}if(u)return l;c=l+1}return-1}o>=oe&&o<=se&&(o+=Nt);for(let p=r;p<=e.length-n;p++){var m=e.charCodeAt(p);if(m>=oe&&m<=se&&(m+=Nt),m!==o)continue;let v=!0;for(let g=1;g<n;g++){let b=e.charCodeAt(p+g),x=t.charCodeAt(g);if(b>=oe&&b<=se&&(b+=Nt),x>=oe&&x<=se&&(x+=Nt),b!==x){v=!1;break}}if(v)return p}return-1}function Dv(e,t,r){let n=t.length;var o=t.charCodeAt(0);o>=oe&&o<=se&&(o+=Nt);for(let i=Math.min(r,e.length-n);i>=0;i--){var a=e.charCodeAt(i);if(a>=oe&&a<=se&&(a+=Nt),a!==o)continue;let s=!0;for(let c=1;c<n;c++){let l=e.charCodeAt(i+c),u=t.charCodeAt(c);if(l>=oe&&l<=se&&(l+=Nt),u>=oe&&u<=se&&(u+=Nt),l!==u){s=!1;break}}if(s)return i}return-1}var Pn=-1;function xo(e,t,r){let n=r.toLowerCase(),o="<"+n,a="</"+n,i=1,s=t,c=e.length;for(Pn=-1;s<c&&i>0;){let h=ar(e,o,s),f=ar(e,a,s);if(f===-1)return-1;if(h!==-1&&h<f){let d=Zt(e,h);d?(d.tag.toLowerCase()===n&&!d.isClosing&&!d.selfClosing&&!$r(d.tag)&&i++,s=d.end):s=h+1}else{var l=f+a.length,u=l<c?e.charCodeAt(l):62;if((u===ue||u===P||u===N||u===J)&&(i--,i===0)){Pn=f;let d=f+a.length;for(;d<c&&e.charCodeAt(d)!==ue;)d++;return d+1}s=f+1}}return-1}function Es(e,t,r,n){if(n.ignoreHTMLBlocks||n.disableParsingRawHTML)return null;var o=Ae(e,t);if(Ze(e,t,o),Ce>3&&!r.inHTML)return null;var a=t+xe;if(e.charCodeAt(a)!==Te)return null;var i=e.indexOf(">",a+1);if(i!==-1&&i<o){var s=e.slice(a+1,i);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(s)||/^[^\s@]+@[^\s@]+$/.test(s))return null}var c=Rv(e,a);if(c>=1&&c<=5){var l=e.length;if(c===1){for(var u=e.length,h=0;h<yo.length;h++){var f=ar(e,"</"+yo[h]+">",a);f>=0&&f<u&&(u=f)}if(u<e.length){var d=e.indexOf(">",u);l=d>=0?fe(e,d+1):e.length}}else{var m=c===2?"-->":c===3?"?>":c===4?">":"]]>",p=e.indexOf(m,a);p>=0&&(l=fe(e,p+m.length))}var v=e.slice(a,l);if(c>=2)return{node:{type:A.htmlComment,text:v,l:!1,raw:!0},end:l};var g="div",b=v.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);b&&(g=b[1]);var x=Zt(e,a),T={},C;x&&!x.isClosing&&(T=Jt(x.attrs,g,n),C=x.whitespaceBeforeAttrs+x.rawAttrs);var y=[],S=g.toLowerCase(),E="</"+S,O=ar(v,E,0),_=v,q="";if(x&&x.isClosing)for(_=v.slice(x.end-a);_.length>0&&_.charCodeAt(_.length-1)===J;)_=_.slice(0,-1);else if(x&&!x.isClosing){var U=x.end-a;if(O!==-1)for(_=v.slice(U),_.charCodeAt(0)===J&&(_=_.slice(1));_.length>0&&_.charCodeAt(_.length-1)===J;)_=_.slice(0,-1);else for(_=v;_.length>0&&_.charCodeAt(_.length-1)===J;)_=_.slice(0,-1);if(O!==-1){var $=v.slice(U,O);q=$.trim()}}var H=x?x.isClosing:!1;return{node:{type:A.htmlBlock,tag:g,attrs:T,i:C,children:y,a:_,text:q,d:!0,b:H},end:l}}if(c===6||c===7){var I=si(e,t),D=I<e.length?I:e.length,G=e.slice(a,D),Pe=I<e.length?fe(e,I):e.length,Q=Zt(e,a);if(Q){var te=Q.tag,ze=te.toLowerCase(),ct=Q.isClosing;if(ct){var De=e.slice(Q.end,D);return{node:{type:A.htmlBlock,tag:te,attrs:{},children:[],a:De,text:De,d:!0,b:!0},end:Pe}}if(Q.selfClosing||$r(te))return{node:{type:A.htmlBlock,tag:te,attrs:Jt(Q.attrs,te,n),i:Q.whitespaceBeforeAttrs+Q.rawAttrs,children:[],a:"",text:"",d:!1,b:!1},end:Q.end<e.length&&e.charCodeAt(Q.end)===J?Q.end+1:Q.end};var je=r.c||0,me=e.slice(a,D),re=-1,j=-1;if(je<10){for(var B="</"+ze,ne=Q.end-a,ee=1,Ne=ne;Ne<me.length&&ee>0;){var ve=ar(me,"<"+ze,Ne),we=ar(me,B,Ne);if(we===-1)break;if(ve!==-1&&ve<we){var K=ve+ze.length+1;if(K<me.length){var ye=me.charCodeAt(K);(ye===P||ye===N||ye===J||ye===ue||ye===We)&&ee++}Ne=ve+1}else{var Je=we+B.length;if(Je<me.length){var Me=me.charCodeAt(Je);if((Me===ue||Me===P||Me===N||Me===J)&&(ee--,ee===0)){re=we;for(var Ve=Je;Ve<me.length&&me.charCodeAt(Ve)!==ue;)Ve++;j=Ve+1;break}}else if(ee--,ee===0){re=we,j=me.length;break}Ne=we+1}}var at=!1;if(re===-1&&c===6&&!Q.isClosing){var Le=xo(e,Q.end,ze);if(Le!==-1){for(var it=Pn,Y=Q.end,ft=!1,ge=!1,zt=!1,Kt=0,be=!1,V=!1,vt=Y;vt<it;){var Tt=e.charCodeAt(vt);if(Tt===J)V&&(ft=!0),be||Kt++,V=!0,vt++;else if(Tt===P||Tt===N)vt++;else{if(!be&&(be=!0,Kt>=2&&Tt===Te)){zt=!0;break}if(V=!1,Tt===Te){var jt=e.charCodeAt(vt+1)|32;if((jt===mo||jt===xs||jt===Nr)&&(ni.lastIndex=vt,ni.test(e))){ge=!0;break}}vt++}}if(ft&&!zt&&!ge){var ht=Ae(e,Le);D=ht,Pe=fe(e,ht),me=e.slice(a,D),G=e.slice(a,D),re=it-a,j=Le-a,at=!0}}}}var Ie=Q.rawAttrs.indexOf(`
|
|
609
609
|
`)!==-1||Q.whitespaceBeforeAttrs.indexOf(`
|
|
610
|
-
`)!==-1,$e=!1;if(re!==-1){var et=me.slice(j).trim();$e=et.length===0}var lt=!1,Ct=D,Be=Pe;if(re!==-1){var er=a+j,Ut=Ae(e,er-1);if(er<Ut){for(var Bt=er;Bt<Ut&&(e.charCodeAt(Bt)===P||e.charCodeAt(Bt)===N);)Bt++;if(Bt<Ut&&e.charCodeAt(Bt)===Te){var _r=Zt(e,Bt);_r&&!_r.isClosing&&(lt=!0,Ct=er,Be=er,$e=!0)}}if(!lt){var
|
|
610
|
+
`)!==-1,$e=!1;if(re!==-1){var et=me.slice(j).trim();$e=et.length===0}var lt=!1,Ct=D,Be=Pe;if(re!==-1){var er=a+j,Ut=Ae(e,er-1);if(er<Ut){for(var Bt=er;Bt<Ut&&(e.charCodeAt(Bt)===P||e.charCodeAt(Bt)===N);)Bt++;if(Bt<Ut&&e.charCodeAt(Bt)===Te){var _r=Zt(e,Bt);_r&&!_r.isClosing&&(lt=!0,Ct=er,Be=er,$e=!0)}}if(!lt){var qt=fe(e,Ut);if(qt<D){for(var Ht=qt;Ht<D&&(e.charCodeAt(Ht)===P||e.charCodeAt(Ht)===N);)Ht++;if(Ht<D&&e.charCodeAt(Ht)===Te){var Br=Zt(e,Ht);Br&&(lt=!0,Ct=Ut,Be=qt,$e=!0)}}}if(!lt&&r.inHTML){lt=!0,Ct=Ut,Be=fe(e,Ut);var Hr=e.slice(er,Ut).trim();$e=Hr.length===0}}var Gt=[],yt="";if(re!==-1){yt=me.slice(Q.end-a,re);var Ar=yt.trim();if(Ar){var{inline:Os,inHTML:Ds,c:Rs}=r;r.inHTML=!0,r.c=je+1;var Ns=ze==="p";if(Ns)r.inline=!0,Gt=Ir(Ar,!1,r,n);else{var Ko=yt.indexOf(`
|
|
611
611
|
|
|
612
|
-
`)!==-1,
|
|
612
|
+
`)!==-1,qo=oo.test(Ar),Gn=oi.test(Ar),Ls=Ko||qo||r.inHTML&&Gn,Is=yt.length>=2&&yt.charCodeAt(0)===J&&yt.charCodeAt(yt.length-1)===J&&!Ko;Is&&!qo&&!Gn?Gt=[{type:A.text,text:Ar}]:Ls||Gn?(r.inline=!1,Gt=sr(yt,r,n)):(r.inline=!0,Gt=Ir(Ar,!1,r,n))}r.inline=Os,r.inHTML=Ds,r.c=Rs}}var Yo=!1;if(c===6&&re!==-1&&!r.inHTML&&!Ie){var Fs=/<[a-zA-Z][^>]*>/.test(yt),js=yt.indexOf(`
|
|
613
613
|
|
|
614
|
-
`)!==-1||oo.test(yt);js
|
|
614
|
+
`)!==-1||oo.test(yt);Fs&&!js&&(Yo=!0)}var Us=!at&&(r.inHTML||c===7||Ie||!$e||Yo);if(Us){var _t,Jo=!1;if(re!==-1&<){var Zo=!1;if(r.inHTML&&j<me.length){for(var tn=j;tn<me.length&&me.charCodeAt(tn)!==J;)tn++;var Vn=me.slice(j,tn).trim();Zo=Vn.length>1&&Vn.charCodeAt(0)===Te&&Vn.charCodeAt(1)!==We}_t=Zo?me.slice(Q.end-a):yt,Jo=!0}else(c===7||r.inHTML)&&re!==-1?(_t=me.slice(Q.end-a),_t.charCodeAt(0)===J&&(_t=_t.slice(1))):lt?_t=e.slice(a,Ct):Ie?_t=G:(_t=me.slice(Q.end-a),_t.charCodeAt(0)===J&&(_t=_t.slice(1)));var Xo={type:A.htmlBlock,tag:te,attrs:Jt(Q.attrs,te,n),i:Q.whitespaceBeforeAttrs+Q.rawAttrs,children:Gt,a:_t,text:_t,d:!0,b:!1};return Jo&&(Xo.n=!0),{node:Xo,end:Be}}return{node:{type:A.htmlBlock,tag:te,attrs:Jt(Q.attrs,te,n),i:Q.whitespaceBeforeAttrs+Q.rawAttrs,children:Gt,a:at?"":yt,text:yt,d:!1,b:!1},end:Be}}var rn=G.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),Bs=rn?rn[2]:"div",Qo=rn?rn[1]==="/":!1,Wn=G;if(Qo){var $o=G.indexOf(">");$o!==-1&&(Wn=G.slice($o+1))}return{node:{type:A.htmlBlock,tag:Bs,attrs:{},children:[],a:Wn,text:Wn,d:!0,b:Qo},end:Pe}}var ut=Zt(e,a);if(!ut)return null;var tr=ut.tag,Kn=tr.toLowerCase(),ea=tr.charCodeAt(0),qn=ea>=oe&&ea<=se;if(!qn&&!En.has(Kn)&&!en.has(Kn)&&!Kn.includes("-"))return null;if(ut.isClosing)return{node:{type:A.htmlSelfClosing,tag:tr,attrs:{},a:e.slice(a,ut.end),b:!0},end:ut.end};var Sr=xo(e,ut.end,tr),Gr=[];if(Sr!==-1){var Hs=Pn,nn=e.slice(ut.end,Hs),on=nn.trim();if(on){var Gs=nn.indexOf(`
|
|
615
615
|
|
|
616
|
-
`)!==-1,
|
|
616
|
+
`)!==-1,Vs=oo.test(on),Ws=oi.test(on),Ks=r.inline,qs=r.inHTML,Ys=r.c;r.inHTML=!0,r.c=(r.c||0)+1,Gs||Vs||Ws?(r.inline=!1,Gr=sr(nn,r,n)):(r.inline=!0,Gr=Ir(on,!1,r,n)),r.inline=Ks,r.inHTML=qs,r.c=Ys}var Js=Ae(e,Sr),Zs=e.slice(Sr,Js).trim(),ta=Zs?Sr:fe(e,Sr),ra=qn?e.slice(a,Sr):e.slice(a,ta);return{node:{type:A.htmlBlock,tag:tr,attrs:Jt(ut.attrs,tr,n),i:ut.whitespaceBeforeAttrs+ut.rawAttrs,children:Gr,a:ra,text:qn?nn:ra,d:!0,b:!1},end:ta}}var Vr=si(e,ut.end),Xs=Vr<e.length?fe(e,Vr):Vr,Yn=e.slice(ut.end,Vr);if(Yn.trim()){var{inline:Qs,inHTML:$s,c:ec}=r;r.inline=!1,r.inHTML=!0,r.c=(r.c||0)+1,Gr=sr(Yn,r,n),r.inline=Qs,r.inHTML=$s,r.c=ec}var tc=e.slice(ut.end,Vr);return{node:{type:A.htmlBlock,tag:tr,attrs:Jt(ut.attrs,tr,n),i:ut.whitespaceBeforeAttrs+ut.rawAttrs,children:Gr,a:tc,text:Yn,d:!0,b:!1},end:Xs}}function Rv(e,t){if(e.charCodeAt(t)!==Te)return 0;var r=t+1,n=e.length;if(e.charCodeAt(r)===xt&&e.charCodeAt(r+1)===ae&&e.charCodeAt(r+2)===ae)return 2;if(e.charCodeAt(r)===Qr)return 3;if(e.charCodeAt(r)===xt){var o=e.charCodeAt(r+1);if(o>=oe&&o<=se)return 4;if(e.slice(r+1,r+8)==="[CDATA[")return 5}for(var a=e.charCodeAt(r)===We,i=a?r+1:r,s=i;s<n;){var c=e.charCodeAt(s);if(c>=oe&&c<=se||c>=Ee&&c<=Re||c>=ce&&c<=le||c===ae)s++;else break}if(s===i)return 0;var l=e.slice(i,s);if(en.has(l.toLowerCase())){if(a)return 0;var u=e.charCodeAt(s);return u===P||u===N||u===ue||u===J||s>=n?1:0}if(En.has(l.toLowerCase())){if(a){for(var h=s;h<n&&(e.charCodeAt(h)===P||e.charCodeAt(h)===N);)h++;return h<n&&e.charCodeAt(h)===ue?6:0}var f=s<n?e.charCodeAt(s):-1;return f===P||f===N||f===ue||f===J||f===We||f===-1?6:0}if(a){for(var d=s;d<n&&(e.charCodeAt(d)===P||e.charCodeAt(d)===N);)d++;if(d<n&&e.charCodeAt(d)===ue){var m=Ae(e,t),p=e.slice(d+1,m).trim();if(p==="")return 7}}else{var v=Ae(e,t),g=Zt(e,t);if(g&&g.end<=v){var b=e.slice(g.end,v).trim();if(b==="")return 7}}return 0}function li(e,t,r){for(var n=0,o=e.length;n<o&&(e.charCodeAt(n)===P||e.charCodeAt(n)===N);)n++;for(;o>n&&(e.charCodeAt(o-1)===P||e.charCodeAt(o-1)===N);)o--;n<o&&e.charCodeAt(n)===tt&&n++,o>n&&e.charCodeAt(o-1)===tt&&(o-2<n||e.charCodeAt(o-2)!==st)&&o--;for(var a=[],i=n,s=!1,c=[],l=n;l<o;){var u=e.charCodeAt(l);if(u===st&&l+1<o){e.charCodeAt(l+1)===tt?(s||(s=!0,c=[]),c.push(e.slice(i,l)),c.push("|"),l+=2,i=l):l+=2;continue}if(u===_e){for(var h=0;l<o&&e.charCodeAt(l)===_e;)h++,l++;for(var f=!1;l<o&&!f;){for(var d=0;l<o&&e.charCodeAt(l)===_e;)d++,l++;d===h?f=!0:d===0&&l++}continue}if(u===tt){var m=s?(c.push(e.slice(i,l)),c.join("")):e.slice(i,l);a.push(m.trim()),l++,i=l,s=!1,c=[];continue}l++}var p=s?(c.push(e.slice(i,o)),c.join("")):e.slice(i,o);return a.push(p.trim()),a.map(function(v){var g=v.indexOf("\\|")!==-1?v.replace(/\\\|/g,"|"):v;return g?Ir(g,!1,t,r):[]})}function ui(e,t,r,n){let o=Ae(e,t);var a=e.indexOf("|",t);if(a<0||a>=o)return null;let i=fe(e,o);if(i>=e.length)return null;let s=Ae(e,i);if(!Ss(e,i,s))return null;let c=e.slice(t,o),l=e.slice(i,s);for(var u=[],h=0,f=l.length;h<f&&(l.charCodeAt(h)===P||l.charCodeAt(h)===N);)h++;for(h<f&&l.charCodeAt(h)===tt&&h++;h<f;){for(;h<f&&(l.charCodeAt(h)===P||l.charCodeAt(h)===N);)h++;if(h>=f||l.charCodeAt(h)===tt)break;var d=l.charCodeAt(h)===mt;for(d&&h++;h<f&&l.charCodeAt(h)===ae;)h++;var m=h<f&&l.charCodeAt(h)===mt;for(m&&h++,u.push(d&&m?"center":m?"right":d?"left":null);h<f&&(l.charCodeAt(h)===P||l.charCodeAt(h)===N);)h++;h<f&&l.charCodeAt(h)===tt&&h++}let p=li(c,r,n);if(u.length!==p.length)return null;let v=[],g=fe(e,s);for(;g<e.length;){let S=Ae(e,g),E=e.slice(g,S);if(wt(e,g,S))break;if(Ze(e,g,S),Ce<4){var b=e.charCodeAt(g+xe);if(b===ue||b===Ot||(b===ae||b===Ke||b===Ue)&&ir(e,g))break;if(b===_e||b===nt){for(var x=g+xe,T=0;x<S&&e.charCodeAt(x)===b;)T++,x++;if(T>=3)break}}v.push(li(E,r,n)),g=fe(e,S)}if(n.optimizeForStreaming&&v.length===0)return null;for(var C=p.length,y=0;y<v.length;y++)if(v[y].length<C)for(;v[y].length<C;)v[y].push([]);else v[y].length>C&&(v[y].length=C);return{node:{type:A.table,header:p,cells:v,align:u},end:g}}function Nv(e,t,r){var n=Ae(e,t);if(Ze(e,t,n),Ce>3)return null;var o=t+xe;if(e.charCodeAt(o)!==He)return null;if(o+1<e.length&&e.charCodeAt(o+1)===$t){var a=Lv(e,o,r);return a||null}r.refs||(r.refs={});var i=zs(e,o,r.refs);return i===null?null:{node:{type:A.refCollection},end:i}}function Lv(e,t,r){var n=e.length;if(e.charCodeAt(t)!==He||t+1>=n||e.charCodeAt(t+1)!==$t)return null;for(var o=t+2,a=o;o<n&&e.charCodeAt(o)!==Ft;){if(e.charCodeAt(o)===J)return null;o++}if(o>=n)return null;var i=("^"+e.slice(a,o)).toLowerCase();if(o++,o>=n||e.charCodeAt(o)!==mt)return null;for(o++;o<n&&(e.charCodeAt(o)===P||e.charCodeAt(o)===N);)o++;if(o<n&&e.charCodeAt(o)===J)for(o++;o<n&&(e.charCodeAt(o)===P||e.charCodeAt(o)===N);)o++;var s=e.indexOf(`
|
|
617
617
|
`,o);s<0&&(s=n);for(var c=e.slice(o,s).trim(),l=s<n?s+1:n;l<n;){var u=Ae(e,l);if(Ze(e,l,u),Ce>=2&&!wt(e,l,u))c+=`
|
|
618
618
|
`+e.slice(l,u),l=fe(e,u);else if(wt(e,l,u)){var h=fe(e,u);if(h<n){var f=Ae(e,h);if(Ze(e,h,f),Ce>=2){c+=`
|
|
619
|
-
`,l=fe(e,u);continue}}break}else break}return r.refs[i]||(r.refs[i]={target:c,title:void 0}),{node:{type:A.footnote},end:l}}function
|
|
620
|
-
`)!==-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:A.codeInline,text:s},end:a+i}}o=a+i}return null}function Ho(e,t,r){if(e.charCodeAt(t)!==_e)return t;let n=lr(e,t,r,96),o=t+n;for(;o<r;){let a=e.indexOf("`",o);if(a<0||a>=r)return t;let i=lr(e,a,r,96);if(i===n)return a+i;o=a+i}return t}function Nv(e,t,r){if(e.charCodeAt(t)!==Te)return t;if(t+1<r&&e.charCodeAt(t+1)===We){let l=t+2;for(;l<r&&e.charCodeAt(l)!==ue;)l++;return l<r?l+1:t}if(t+3<r&&e.charCodeAt(t+1)===xt&&e.charCodeAt(t+2)===ae&&e.charCodeAt(t+3)===ae){let l=e.indexOf("-->",t+4);return l>=0?l+3:t}let n=t+1,o=n;for(;n<r;){let l=e.charCodeAt(n);if(l>=oe&&l<=se||l>=Ee&&l<=Re||l>=ce&&l<=le||l===ae)n++;else break}if(n===o)return t;let a=e.slice(o,n).toLowerCase(),i=!1;for(;n<r;){let l=e.charCodeAt(n);if(l===ue){n++;break}if(l===We&&n+1<r&&e.charCodeAt(n+1)===ue){n+=2,i=!0;break}if(l===kr||l===xr){var s=l;for(n++;n<r&&e.charCodeAt(n)!==s;)n++;n<r&&n++;continue}if(l===J)return t;n++}if(i||$r(a))return n;let c=1;for(;n<r&&c>0;)if(e.charCodeAt(n)===Te)if(n+1<r&&e.charCodeAt(n+1)===We){let l=n+2,u=l;for(;u<r&&(e.charCodeAt(u)>=oe&&e.charCodeAt(u)<=se||e.charCodeAt(u)>=Ee&&e.charCodeAt(u)<=Re);)u++;if(e.slice(l,u).toLowerCase()===a){for(;u<r&&e.charCodeAt(u)!==ue;)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)>=oe&&e.charCodeAt(u)<=se||e.charCodeAt(u)>=Ee&&e.charCodeAt(u)<=Re);)u++;e.slice(l,u).toLowerCase()===a&&c++,n++}else n++;return n}function Lv(e,t,r,n,o){if(e.charCodeAt(t)!==nt||t+1>=r||e.charCodeAt(t+1)!==nt)return null;let a=t+2;for(;a+1<r;){let i=e.charCodeAt(a);if(i===_e){let s=Ho(e,a,r);if(s>a){a=s;continue}}if(i===nt&&e.charCodeAt(a+1)===nt){let s=e.slice(t+2,a),c=Wt(s,0,s.length,n,o);return{node:{type:A.textFormatted,tag:"del",children:c},end:a+2}}i===st&&a+1<r&&a++,a++}return null}function Iv(e,t,r,n,o){if(e.charCodeAt(t)!==Et||t+1>=r||e.charCodeAt(t+1)!==Et)return null;let a=t+2;for(;a+1<r;){let i=e.charCodeAt(a);if(i===_e){let s=Ho(e,a,r);if(s>a){a=s;continue}}if(i===Et&&e.charCodeAt(a+1)===Et&&a>t+2){let s=e.slice(t+2,a),c=Wt(s,0,s.length,n,o);return{node:{type:A.textFormatted,tag:"mark",children:c},end:a+2}}i===st&&a+1<r&&a++,a++}return null}function fi(e,t,r){return e<Bn?!!(Bo(e)&Or):nv.test(t[r])}function hi(e,t,r){return e<Bn?!!(Bo(e)&vr):ov.test(t[r])}function Fv(e,t,r){var n=e.charCodeAt(t);if(n!==qe&&n!==Ue)return null;var o=lr(e,t,r,n);if(o===0)return null;var a=t>0?e.charCodeAt(t-1):32,i=t+o<r?e.charCodeAt(t+o):32,s=hi(a,e,t-1),c=hi(i,e,t+o),l=t>0?fi(a,e,t-1):!1,u=t+o<r?fi(i,e,t+o):!1,h=!c&&(!u||s||l),f=!s&&(!l||c||u),d,m;return n===qe?(d=h,m=f):(d=h&&(!f||l),m=f&&(!h||u)),{len:o,canOpen:d,canClose:m}}function jv(e,t,r,n){if(t.length!==0){for(var o=e.length,a=Array(o),i=null,s=null,c=0;c<o;c++){var l={node:e[c],prev:s,next:null};s?s.next=l:i=l,a[c]=l,s=l}for(var u=Array(t.length),h=0;h<t.length;h++)u[h]=a[t[h].idx];for(var f=[],d=0;d<12;d++)f[d]=-1;for(var m=0;m<t.length;){var p=t[m];if(!p.active||!p.canClose){m++;continue}for(var v=p.ch===qe?0:1,g=v*6+p.len%3*2+(p.canOpen?1:0),b=f[g]!==void 0?f[g]:-1,x=-1,T=m-1;T>b;T--){var C=t[T];if(!(!C.active||C.ch!==p.ch||!C.canOpen)&&!((p.canOpen||C.canClose)&&(C.len+p.len)%3===0&&C.len%3!==0)){x=T;break}}if(x<0){f[g]=m-1,!p.canOpen&&(p.active=!1),m++;continue}var y=t[x],S=y.len>=2&&p.len>=2,E=S?2:1;y.len-=E,p.len-=E;var O=u[x],_=u[m],K=O.node,U=_.node;K.text=K.text.slice(0,K.text.length-E),U.text=U.text.slice(E);for(var $=[],H=O.next;H&&H!==_;)$.push(H.node),H=H.next;var I={type:A.textFormatted,tag:S?"strong":"em",children:$},D={node:I,prev:O,next:_};O.next=D,_.prev=D;for(var G=x+1;G<m;G++)t[G].active=!1;if(y.len===0&&(y.active=!1,K.text==="")){var Pe=O.prev;D.prev=Pe,Pe?Pe.next=D:i=D}if(p.len===0){if(p.active=!1,U.text===""){var Q=_.next;D.next=Q,Q&&(Q.prev=D)}}else continue;m++}for(var te=0,ze=i;ze;){var ct=ze.node;if(ct.type===A.text){var De=ct;if(De.text===""){ze=ze.next;continue}if(te>0&&e[te-1].type===A.text){e[te-1].text+=De.text,ze=ze.next;continue}}e[te++]=ct,ze=ze.next}e.length=te}}function pi(e,t,r,n,o){let a=e.charCodeAt(t)===xt,i=a?t+1:t;if(e.charCodeAt(i)!==He)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 h=e.charCodeAt(c);if(h===st&&c+1<r){c+=2;continue}if(h===_e){var f=Ho(e,c,r);if(f>c){c=f;continue}}if(h===Te){var d=Ms(e,c,r);if(d){c=d.end;continue}var m=Nv(e,c,r);if(m>c){c=m;continue}}h===He?u++:h===Ft&&u--,c++}if(u!==0)return null;var p=c-1,v=e.slice(i+1,p),g=c<r?e.charCodeAt(c):0,b=!1;if(g===Lt){var x=!0;for(c++;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;var T="",C=c;if(c<r&&e.charCodeAt(c)===Te){for(c++,C=c;C<r&&e.charCodeAt(C)!==ue;){if(e.charCodeAt(C)===st&&C+1<r){C+=2;continue}if(e.charCodeAt(C)===J){x=!1;break}C++}x&&(C>=r||e.charCodeAt(C)!==ue)&&(x=!1),x&&(T=e.slice(c,C),C++)}else if(x)if(n.g!==void 0&&c>=n.g)x=!1;else{for(var y=0,S=!1;C<r;){var E=e.charCodeAt(C);if(E===st&&C+1<r){C+=2;continue}if(E===Lt)y++;else if(E===It){if(S=!0,y===0)break;y--}else if(E===P||E===J)break;C++}C>=r&&!S&&(n.g===void 0||c<n.g)&&(n.g=c),T=e.slice(c,C)}if(x){for(c=C;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;var O;if(c<r){var _=e.charCodeAt(c);if(_===kr||_===xr||_===Lt){var K=_===Lt?41:_;c++;for(var U=c;c<r&&e.charCodeAt(c)!==K;)e.charCodeAt(c)===st&&c+1<r&&c++,c++;c>=r?x=!1:(O=e.slice(U,c),c++)}}if(x){for(;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;(c>=r||e.charCodeAt(c)!==It)&&(x=!1)}}if(x){c++,T=Lr(T),O!==void 0&&(O=Hn(Lr(O)));var $=(o==null?void 0:o.sanitizer)||Uo,H=$(T,a?"img":"a",a?"src":"href"),I=H===null?null:T;if(a){var D=Wt(v,0,v.length,n,o),G=Co(D);return{node:{type:A.image,target:I,alt:G,title:O},end:c}}else{var Pe=n.inAnchor;n.inAnchor=!0;var re=Pe?[{type:A.text,text:v}]:Wt(v,0,v.length,n,o);return n.inAnchor=Pe,!n.inAnchor&&ko(re)?null:{node:{type:A.link,target:I,title:O,children:re},end:c}}}else c=p+1,b=!0}var Q="",te=c;if(!b&&g===He){var ze=c+1;te=ze;for(var ct=!1;te<r&&e.charCodeAt(te)!==Ft;){if(e.charCodeAt(te)===st&&te+1<r){te+=2;continue}if(e.charCodeAt(te)===He){ct=!0;break}te++}if(ct||te>=r)return null;var De=e.slice(ze,te);if(De.trim())Q=mn(De);else{if(si(v))return null;Q=mn(v)}te=te+1}else{if(si(v))return null;Q=mn(v)}var je=n.refs[Q];if(!je)return null;if(a)return{node:{type:A.image,target:je.target,alt:Co(Wt(v,0,v.length,n,o)),title:je.title},end:te};var me=n.inAnchor;n.inAnchor=!0;var re=me?[{type:A.text,text:v}]:Wt(v,0,v.length,n,o);return n.inAnchor=me,!n.inAnchor&&ko(re)?null:{node:{type:A.link,target:je.target,title:je.title,children:re},end:te}}function Ms(e,t,r){if(e.charCodeAt(t)!==Te)return null;for(var n=t+1;n<r;){var o=e.charCodeAt(n);if(o===ue)break;if(o===P||o===J||o===br||o===Te)return null;n++}if(n>=r||e.charCodeAt(n)!==ue)return null;var a=e.slice(t+1,n),i=a.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return i?{node:{type:A.link,target:a,title:void 0,children:[{type:A.text,text:a}]},end:n+1}:a.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(a)?{node:{type:A.link,target:"mailto:"+a,title:void 0,children:[{type:A.text,text:a}]},end:n+1}:null}function Uv(e,t,r,n){if(e.charCodeAt(t)!==He||t+1>=r||e.charCodeAt(t+1)!==$t)return null;let o=t+2;for(;o<r&&e.charCodeAt(o)!==Ft&&e.charCodeAt(o)!==J;)o++;if(o>=r||e.charCodeAt(o)!==Ft)return null;let a=e.slice(t+2,o);return a?{node:{type:A.footnoteReference,target:"#"+Pt(a),text:a},end:o+1}:null}function Bv(e,t,r,n){if(n.disableBareUrls)return null;var o="",a=!1,i=e.charCodeAt(t);if(i===An||i===72?t+8<=r&&e.charCodeAt(t+1)===Nr&&e.charCodeAt(t+2)===Nr&&e.charCodeAt(t+3)===mo&&(e.charCodeAt(t+4)===ks&&e.charCodeAt(t+5)===mt&&e.charCodeAt(t+6)===We&&e.charCodeAt(t+7)===We?o="https://":e.charCodeAt(t+4)===mt&&e.charCodeAt(t+5)===We&&e.charCodeAt(t+6)===We&&(o="http://")):i===wr||i===70?t+6<=r&&e.charCodeAt(t+1)===Nr&&e.charCodeAt(t+2)===mo&&e.charCodeAt(t+3)===mt&&e.charCodeAt(t+4)===We&&e.charCodeAt(t+5)===We&&(o="ftp://"):(i===yr||i===87)&&t+4<=r&&e.charCodeAt(t+1)===yr&&e.charCodeAt(t+2)===yr&&e.charCodeAt(t+3)===Mt&&(o="www.",a=!0),!o)return null;let s=t+o.length;for(;s<r;){let y=e.charCodeAt(s);if(y===P||y===J||y===N||y===br||y===Te||y===ue)break;s++}for(var c=0,l=0,u=t;u<s;u++){var h=e.charCodeAt(u);h===Lt?c++:h===It&&l++}let f=s;for(;f>t+o.length;){let y=e.charCodeAt(f-1);if(y===Mt||y===qg||y===mt||y===xt||y===Qr||y===It||y===qe||y===Ue||y===nt){if(y===It){if(c>=l)break;l--}f--}else if(y===Sn){for(var d=f-2;d>t&&(e.charCodeAt(d)>=oe&&e.charCodeAt(d)<=se||e.charCodeAt(d)>=Ee&&e.charCodeAt(d)<=Re||e.charCodeAt(d)>=ce&&e.charCodeAt(d)<=le);)d--;d>=t&&e.charCodeAt(d)===Un?f=d:f--}else break}if(f<=t+o.length)return null;var m=t+(a?4:o.length),p=e.indexOf("/",m);if((p<0||p>f)&&(p=f),a&&e.indexOf(".",m)===-1)return null;for(var v=-1,g=-1,b=p-1;b>=m;b--)if(e.charCodeAt(b)===Mt)if(v<0)v=b;else{g=b;break}for(var x=g>=0?g+1:m,b=x;b<p;b++)if(e.charCodeAt(b)===Ue)return null;var T=e.slice(t,f),C=a?"http://"+T:T;return{node:{type:A.link,target:C,title:void 0,children:[{type:A.text,text:T}]},end:f}}function Hv(e,t,r,n){if(n.disableBareUrls)return null;for(var o=t,a=o;o<r;){var i=e.charCodeAt(o);if(i>=oe&&i<=se||i>=Ee&&i<=Re||i>=ce&&i<=le||i===Mt||i===xt||i===Ot||i===36||i===ho||i===Un||i===xr||i===qe||i===cr||i===We||i===Et||i===Qr||i===$t||i===Ue||i===_e||i===jr||i===tt||i===jo||i===nt||i===ae)o++;else break}if(o===a||o>=r||e.charCodeAt(o)!==xs)return null;o++;for(var s=o,c=-1,l=o;o<r;){var i=e.charCodeAt(o);if(i>=oe&&i<=se||i>=Ee&&i<=Re||i>=ce&&i<=le)o++;else if((i===ae||i===Ue)&&o>s)o++;else if(i===Mt){if(o===s)break;var u=e.charCodeAt(o-1);if(u===ae||u===Ue||o-l>63)break;if(o+1<r){var h=e.charCodeAt(o+1);if(h>=oe&&h<=se||h>=Ee&&h<=Re||h>=ce&&h<=le)c=o,l=o+1,o++;else break}else break}else break}if(o-l>63||c<0)return null;var f=e.charCodeAt(o-1);if(!(f>=oe&&f<=se||f>=Ee&&f<=Re||f>=ce&&f<=le)||o<=c+1)return null;for(var d=-1,m=c-1;m>=s;m--)if(e.charCodeAt(m)===Mt){d=m;break}for(var p=d>=0?d+1:s,m=p;m<o;m++)if(e.charCodeAt(m)===Ue)return null;var v=e.slice(t,o);return{node:{type:A.link,target:"mailto:"+v,title:void 0,children:[{type:A.text,text:v}]},end:o}}function ko(e){for(var t=0;t<e.length;t++)if(e[t].type===A.link||"children"in e[t]&&Array.isArray(e[t].children)&&ko(e[t].children))return!0;return!1}function Co(e){for(var t="",r=0;r<e.length;r++){var n=e[r];n.type===A.text?t+=n.text:n.type===A.breakLine?t+=" ":n.type===A.codeInline?t+=n.text:"children"in n&&Array.isArray(n.children)?t+=Co(n.children):n.type===A.image&&(t+=n.alt||"")}return t}function gr(e){return{type:A.text,text:e}}function Gv(e,t,r){var n=t+1;if(n>=r)return-1;if(e.charCodeAt(n)===Ot){n++;var o=n<r&&(e.charCodeAt(n)===Kg||e.charCodeAt(n)===Yg);o&&n++;for(var a=n,i=o?6:7;n<r&&n-a<=i;){var s=e.charCodeAt(n),c=s>=ce&&s<=le||o&&(s>=oe&&s<=po||s>=Ee&&s<=wr);if(!c)break;n++}return n===a||n-a>i?-1:n<r&&e.charCodeAt(n)===Sn?n+1:-1}for(var l=n;n<r&&n-l<48;){var u=e.charCodeAt(n);if(u>=oe&&u<=se||u>=Ee&&u<=Re||u>=ce&&u<=le){n++;continue}break}return n===l?-1:n<r&&e.charCodeAt(n)===Sn?n+1:-1}function Vv(e,t,r,n,o){if(e.charCodeAt(t)!==Te)return null;var a=t+1;if(a>=r)return null;var i=e.charCodeAt(a);if(i===xt&&a+1<r&&e.charCodeAt(a+1)===ae&&a+2<r&&e.charCodeAt(a+2)===ae){var s=a+3;if(s<r&&e.charCodeAt(s)===ue)return{node:{type:A.htmlComment,text:"",l:!0},end:s+1};if(s+1<r&&e.charCodeAt(s)===ae&&e.charCodeAt(s+1)===ue)return{node:{type:A.htmlComment,text:"-",l:!0},end:s+2};var c=e.indexOf("-->",s);return c!==-1&&c<=r-3?{node:{type:A.htmlComment,text:e.slice(t+4,c),l:!1},end:c+3}:null}if(i===Qr){var l=e.indexOf("?>",a+1);return l!==-1&&l<r?{node:{type:A.htmlSelfClosing,tag:"?",attrs:{},a:e.slice(t,l+2),b:!1},end:l+2}:null}if(i===xt&&a+1<r){var u=e.charCodeAt(a+1);if(u===He&&e.slice(a+1,a+8)==="[CDATA["){var h=e.indexOf("]]>",a+8);return h!==-1&&h<r?{node:{type:A.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:e.slice(t,h+3),b:!1},end:h+3}:null}if(u>=oe&&u<=se){var f=e.indexOf(">",a+2);return f!==-1&&f<r?{node:{type:A.htmlSelfClosing,tag:"!"+e.slice(a+1,f),attrs:{},a:e.slice(t,f+1),b:!1},end:f+1}:null}}if(i===We){var d=a+1;if(d>=r)return null;var m=e.charCodeAt(d);if(!(m>=oe&&m<=se||m>=Ee&&m<=Re))return null;for(d++;d<r;){var p=e.charCodeAt(d);if(p>=oe&&p<=se||p>=Ee&&p<=Re||p>=ce&&p<=le||p===ae)d++;else break}for(;d<r&&(e.charCodeAt(d)===P||e.charCodeAt(d)===N||e.charCodeAt(d)===J);)d++;if(d<r&&e.charCodeAt(d)===ue){var v=e.slice(a+1,d).trim();return{node:{type:A.htmlSelfClosing,tag:v,attrs:{},a:e.slice(t,d+1),b:!0},end:d+1}}return null}if(!(i>=oe&&i<=se||i>=Ee&&i<=Re))return null;var g=Zt(e,t);if(!g)return null;var b=g.tag,x=b.toLowerCase(),T=g.selfClosing;if(T||$r(b))return{node:{type:A.htmlSelfClosing,tag:b,attrs:Jt(g.attrs,b,o),a:e.slice(t,g.end),b:!1},end:g.end};var C=en.has(x),y=xo(e.slice(0,r),g.end,b);if(y===-1)return{node:{type:A.htmlSelfClosing,tag:b,attrs:Jt(g.attrs,b,o),a:e.slice(t,g.end),b:!1},end:g.end};var S=Ev(e,"</"+x,y),E=e.slice(g.end,S),O=[];if(C)E.trim()&&(O=[{type:A.text,text:E}]);else{var _=E.trim();if(_){var{inAnchor:K,inline:U,e:$}=n;x==="a"&&(n.inAnchor=!0),n.e=!1;var H=_.indexOf(`
|
|
619
|
+
`,l=fe(e,u);continue}}break}else break}return r.refs[i]||(r.refs[i]={target:c,title:void 0}),{node:{type:A.footnote},end:l}}function Iv(e,t,r,n){let o=t,a=0,i=0,s=-1;for(;o<e.length;){let $=s>=0?s:Ae(e,o);if(s=-1,wt(e,o,$))break;if(Ze(e,o,$),Ce<4&&i>0&&!r.f){let I=e.charCodeAt(o+xe);if(I===Et||I===ae){let D=o+xe;for(;D<$&&e.charCodeAt(D)===I;)D++;for(;D<$&&(e.charCodeAt(D)===P||e.charCodeAt(D)===N);)D++;if(D>=$){a=I===Et?1:2,o=fe(e,$);break}}}i=$;let H=fe(e,$);if(H<e.length){if(e.charCodeAt(H)===go){var c=Ae(e,H);o=fe(e,c),i=c;continue}let I=Ae(e,H);if(s=I,Ze(e,H,I),Ce<4){let D=e.charCodeAt(H+xe);if(D===ue){o=H;break}if(D===Ot){for(var l=H+xe,u=0;l<I&&e.charCodeAt(l)===Ot&&u<=6;)u++,l++;if(u>=1&&u<=6&&(l>=I||e.charCodeAt(l)===P||e.charCodeAt(l)===N)){o=H;break}}if(D===_e||D===nt){for(var h=H+xe,f=0;h<I&&e.charCodeAt(h)===D;)f++,h++;if(f>=3){o=H;break}}if(D===Te){var d=H+xe+1,m=d<I?e.charCodeAt(d):0,p=m===xt||m===Qr;if(!p&&m===We){for(var v=d+1,g=v;g<I&&(e.charCodeAt(g)>=oe&&e.charCodeAt(g)<=se||e.charCodeAt(g)>=Ee&&e.charCodeAt(g)<=Re||e.charCodeAt(g)>=ce&&e.charCodeAt(g)<=le||e.charCodeAt(g)===ae);)g++;g>v&&(p=En.has(e.slice(v,g).toLowerCase()))}else if(!p){for(var b=d;b<I&&(e.charCodeAt(b)>=oe&&e.charCodeAt(b)<=se||e.charCodeAt(b)>=Ee&&e.charCodeAt(b)<=Re||e.charCodeAt(b)>=ce&&e.charCodeAt(b)<=le||e.charCodeAt(b)===ae);)b++;if(b>d){var x=e.slice(d,b).toLowerCase();p=En.has(x)||en.has(x)}}if(p&&Es(e,H,r,n)){o=H;break}}if(D===ae||D===Ke||D===cr){let G=H+xe+1;if(G<I&&(e.charCodeAt(G)===P||e.charCodeAt(G)===N)){var T=Zr(e,G,I);if(T<I&&!ir(e,H)){o=H;break}}}if(D>=ce&&D<=le){let G=H+xe;for(;G<I&&e.charCodeAt(G)>=ce&&e.charCodeAt(G)<=le;)G++;if(G<I&&(e.charCodeAt(G)===Mt||e.charCodeAt(G)===It)&&G-(H+xe)===1&&e.charCodeAt(H+xe)===49){var C=G+1;if(C<I&&(e.charCodeAt(C)===P||e.charCodeAt(C)===N)){var y=Zr(e,C,I);if(y<I){o=H;break}}}}if(D===tt){let G=fe(e,I);if(G<e.length){let Pe=Ae(e,G);if(Ss(e,G,Pe)){o=H;break}}}if((D===ae||D===Ke||D===Ue)&&ir(e,H)){if(D!==ae){o=H;break}let G=H+xe;for(;G<I&&e.charCodeAt(G)===ae;)G++;for(;G<I&&(e.charCodeAt(G)===P||e.charCodeAt(G)===N);)G++;if(G<I){o=H;break}}}}o=fe(e,$)}for(var S=a?i:o;S>t&&(e.charCodeAt(S-1)===J||e.charCodeAt(S-1)===br||e.charCodeAt(S-1)===P||e.charCodeAt(S-1)===N);)S--;for(var E=t;E<S&&(e.charCodeAt(E)===P||e.charCodeAt(E)===N);)E++;if(E>=S)return null;for(var O=!1,_=E;_<S;_++)if(e.charCodeAt(_)===go){O=!0;break}var q=O?e.slice(E,S).replace(/\u001E/g,""):e.slice(E,S);if(!q)return null;let U=Ir(q,!0,r,n);if(a){let $=((n==null?void 0:n.slugify)||Pt)(q);return{node:{type:A.heading,level:a,children:U,id:$},end:o}}return{node:{type:A.paragraph,children:U},end:o}}function Ir(e,t,r,n){var o=r.k;if(!o){var a=r.e;r.e=t;var i=Wt(e,0,e.length,r,n);return r.e=a,i}var s=[];return o.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 Fv(e,t,r){if(e.charCodeAt(t)!==_e)return null;let n=lr(e,t,r,96),o=t+n;for(;o<r;){let a=e.indexOf("`",o);if(a<0||a>=r)return null;let i=lr(e,a,r,96);if(i===n){let s=e.slice(t+n,a);return s.indexOf(`
|
|
620
|
+
`)!==-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:A.codeInline,text:s},end:a+i}}o=a+i}return null}function Ho(e,t,r){if(e.charCodeAt(t)!==_e)return t;let n=lr(e,t,r,96),o=t+n;for(;o<r;){let a=e.indexOf("`",o);if(a<0||a>=r)return t;let i=lr(e,a,r,96);if(i===n)return a+i;o=a+i}return t}function jv(e,t,r){if(e.charCodeAt(t)!==Te)return t;if(t+1<r&&e.charCodeAt(t+1)===We){let l=t+2;for(;l<r&&e.charCodeAt(l)!==ue;)l++;return l<r?l+1:t}if(t+3<r&&e.charCodeAt(t+1)===xt&&e.charCodeAt(t+2)===ae&&e.charCodeAt(t+3)===ae){let l=e.indexOf("-->",t+4);return l>=0?l+3:t}let n=t+1,o=n;for(;n<r;){let l=e.charCodeAt(n);if(l>=oe&&l<=se||l>=Ee&&l<=Re||l>=ce&&l<=le||l===ae)n++;else break}if(n===o)return t;let a=e.slice(o,n).toLowerCase(),i=!1;for(;n<r;){let l=e.charCodeAt(n);if(l===ue){n++;break}if(l===We&&n+1<r&&e.charCodeAt(n+1)===ue){n+=2,i=!0;break}if(l===kr||l===xr){var s=l;for(n++;n<r&&e.charCodeAt(n)!==s;)n++;n<r&&n++;continue}if(l===J)return t;n++}if(i||$r(a))return n;let c=1;for(;n<r&&c>0;)if(e.charCodeAt(n)===Te)if(n+1<r&&e.charCodeAt(n+1)===We){let l=n+2,u=l;for(;u<r&&(e.charCodeAt(u)>=oe&&e.charCodeAt(u)<=se||e.charCodeAt(u)>=Ee&&e.charCodeAt(u)<=Re);)u++;if(e.slice(l,u).toLowerCase()===a){for(;u<r&&e.charCodeAt(u)!==ue;)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)>=oe&&e.charCodeAt(u)<=se||e.charCodeAt(u)>=Ee&&e.charCodeAt(u)<=Re);)u++;e.slice(l,u).toLowerCase()===a&&c++,n++}else n++;return n}function Uv(e,t,r,n,o){if(e.charCodeAt(t)!==nt||t+1>=r||e.charCodeAt(t+1)!==nt)return null;let a=t+2;for(;a+1<r;){let i=e.charCodeAt(a);if(i===_e){let s=Ho(e,a,r);if(s>a){a=s;continue}}if(i===nt&&e.charCodeAt(a+1)===nt){let s=e.slice(t+2,a),c=Wt(s,0,s.length,n,o);return{node:{type:A.textFormatted,tag:"del",children:c},end:a+2}}i===st&&a+1<r&&a++,a++}return null}function Bv(e,t,r,n,o){if(e.charCodeAt(t)!==Et||t+1>=r||e.charCodeAt(t+1)!==Et)return null;let a=t+2;for(;a+1<r;){let i=e.charCodeAt(a);if(i===_e){let s=Ho(e,a,r);if(s>a){a=s;continue}}if(i===Et&&e.charCodeAt(a+1)===Et&&a>t+2){let s=e.slice(t+2,a),c=Wt(s,0,s.length,n,o);return{node:{type:A.textFormatted,tag:"mark",children:c},end:a+2}}i===st&&a+1<r&&a++,a++}return null}function di(e,t,r){return e<Bn?!!(Bo(e)&Or):sv.test(t[r])}function fi(e,t,r){return e<Bn?!!(Bo(e)&vr):cv.test(t[r])}function Hv(e,t,r){var n=e.charCodeAt(t);if(n!==Ke&&n!==Ue)return null;var o=lr(e,t,r,n);if(o===0)return null;var a=t>0?e.charCodeAt(t-1):32,i=t+o<r?e.charCodeAt(t+o):32,s=fi(a,e,t-1),c=fi(i,e,t+o),l=t>0?di(a,e,t-1):!1,u=t+o<r?di(i,e,t+o):!1,h=!c&&(!u||s||l),f=!s&&(!l||c||u),d,m;return n===Ke?(d=h,m=f):(d=h&&(!f||l),m=f&&(!h||u)),{len:o,canOpen:d,canClose:m}}function Gv(e,t,r,n){if(t.length!==0){for(var o=e.length,a=Array(o),i=null,s=null,c=0;c<o;c++){var l={node:e[c],prev:s,next:null};s?s.next=l:i=l,a[c]=l,s=l}for(var u=Array(t.length),h=0;h<t.length;h++)u[h]=a[t[h].idx];for(var f=[],d=0;d<12;d++)f[d]=-1;for(var m=0;m<t.length;){var p=t[m];if(!p.active||!p.canClose){m++;continue}for(var v=p.ch===Ke?0:1,g=v*6+p.len%3*2+(p.canOpen?1:0),b=f[g]!==void 0?f[g]:-1,x=-1,T=m-1;T>b;T--){var C=t[T];if(!(!C.active||C.ch!==p.ch||!C.canOpen)&&!((p.canOpen||C.canClose)&&(C.len+p.len)%3===0&&C.len%3!==0)){x=T;break}}if(x<0){f[g]=m-1,!p.canOpen&&(p.active=!1),m++;continue}var y=t[x],S=y.len>=2&&p.len>=2,E=S?2:1;y.len-=E,p.len-=E;var O=u[x],_=u[m],q=O.node,U=_.node;q.text=q.text.slice(0,q.text.length-E),U.text=U.text.slice(E);for(var $=[],H=O.next;H&&H!==_;)$.push(H.node),H=H.next;var I={type:A.textFormatted,tag:S?"strong":"em",children:$},D={node:I,prev:O,next:_};O.next=D,_.prev=D;for(var G=x+1;G<m;G++)t[G].active=!1;if(y.len===0&&(y.active=!1,q.text==="")){var Pe=O.prev;D.prev=Pe,Pe?Pe.next=D:i=D}if(p.len===0){if(p.active=!1,U.text===""){var Q=_.next;D.next=Q,Q&&(Q.prev=D)}}else continue;m++}for(var te=0,ze=i;ze;){var ct=ze.node;if(ct.type===A.text){var De=ct;if(De.text===""){ze=ze.next;continue}if(te>0&&e[te-1].type===A.text){e[te-1].text+=De.text,ze=ze.next;continue}}e[te++]=ct,ze=ze.next}e.length=te}}function hi(e,t,r,n,o){let a=e.charCodeAt(t)===xt,i=a?t+1:t;if(e.charCodeAt(i)!==He)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 h=e.charCodeAt(c);if(h===st&&c+1<r){c+=2;continue}if(h===_e){var f=Ho(e,c,r);if(f>c){c=f;continue}}if(h===Te){var d=Ps(e,c,r);if(d){c=d.end;continue}var m=jv(e,c,r);if(m>c){c=m;continue}}h===He?u++:h===Ft&&u--,c++}if(u!==0)return null;var p=c-1,v=e.slice(i+1,p),g=c<r?e.charCodeAt(c):0,b=!1;if(g===Lt){var x=!0;for(c++;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;var T="",C=c;if(c<r&&e.charCodeAt(c)===Te){for(c++,C=c;C<r&&e.charCodeAt(C)!==ue;){if(e.charCodeAt(C)===st&&C+1<r){C+=2;continue}if(e.charCodeAt(C)===J){x=!1;break}C++}x&&(C>=r||e.charCodeAt(C)!==ue)&&(x=!1),x&&(T=e.slice(c,C),C++)}else if(x)if(n.g!==void 0&&c>=n.g)x=!1;else{for(var y=0,S=!1;C<r;){var E=e.charCodeAt(C);if(E===st&&C+1<r){C+=2;continue}if(E===Lt)y++;else if(E===It){if(S=!0,y===0)break;y--}else if(E===P||E===J)break;C++}C>=r&&!S&&(n.g===void 0||c<n.g)&&(n.g=c),T=e.slice(c,C)}if(x){for(c=C;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;var O;if(c<r){var _=e.charCodeAt(c);if(_===kr||_===xr||_===Lt){var q=_===Lt?41:_;c++;for(var U=c;c<r&&e.charCodeAt(c)!==q;)e.charCodeAt(c)===st&&c+1<r&&c++,c++;c>=r?x=!1:(O=e.slice(U,c),c++)}}if(x){for(;c<r&&(e.charCodeAt(c)===P||e.charCodeAt(c)===J);)c++;(c>=r||e.charCodeAt(c)!==It)&&(x=!1)}}if(x){c++,T=Lr(T),O!==void 0&&(O=Hn(Lr(O)));var $=(o==null?void 0:o.sanitizer)||Uo,H=$(T,a?"img":"a",a?"src":"href"),I=H===null?null:T;if(a){var D=Wt(v,0,v.length,n,o),G=Co(D);return{node:{type:A.image,target:I,alt:G,title:O},end:c}}else{var Pe=n.inAnchor;n.inAnchor=!0;var re=Pe?[{type:A.text,text:v}]:Wt(v,0,v.length,n,o);return n.inAnchor=Pe,!n.inAnchor&&ko(re)?null:{node:{type:A.link,target:I,title:O,children:re},end:c}}}else c=p+1,b=!0}var Q="",te=c;if(!b&&g===He){var ze=c+1;te=ze;for(var ct=!1;te<r&&e.charCodeAt(te)!==Ft;){if(e.charCodeAt(te)===st&&te+1<r){te+=2;continue}if(e.charCodeAt(te)===He){ct=!0;break}te++}if(ct||te>=r)return null;var De=e.slice(ze,te);if(De.trim())Q=mn(De);else{if(ii(v))return null;Q=mn(v)}te=te+1}else{if(ii(v))return null;Q=mn(v)}var je=n.refs[Q];if(!je)return null;if(a)return{node:{type:A.image,target:je.target,alt:Co(Wt(v,0,v.length,n,o)),title:je.title},end:te};var me=n.inAnchor;n.inAnchor=!0;var re=me?[{type:A.text,text:v}]:Wt(v,0,v.length,n,o);return n.inAnchor=me,!n.inAnchor&&ko(re)?null:{node:{type:A.link,target:je.target,title:je.title,children:re},end:te}}function Ps(e,t,r){if(e.charCodeAt(t)!==Te)return null;for(var n=t+1;n<r;){var o=e.charCodeAt(n);if(o===ue)break;if(o===P||o===J||o===br||o===Te)return null;n++}if(n>=r||e.charCodeAt(n)!==ue)return null;var a=e.slice(t+1,n),i=a.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return i?{node:{type:A.link,target:a,title:void 0,children:[{type:A.text,text:a}]},end:n+1}:a.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(a)?{node:{type:A.link,target:"mailto:"+a,title:void 0,children:[{type:A.text,text:a}]},end:n+1}:null}function Vv(e,t,r,n){if(e.charCodeAt(t)!==He||t+1>=r||e.charCodeAt(t+1)!==$t)return null;let o=t+2;for(;o<r&&e.charCodeAt(o)!==Ft&&e.charCodeAt(o)!==J;)o++;if(o>=r||e.charCodeAt(o)!==Ft)return null;let a=e.slice(t+2,o);return a?{node:{type:A.footnoteReference,target:"#"+Pt(a),text:a},end:o+1}:null}function Wv(e,t,r,n){if(n.disableBareUrls)return null;var o="",a=!1,i=e.charCodeAt(t);if(i===An||i===72?t+8<=r&&e.charCodeAt(t+1)===Nr&&e.charCodeAt(t+2)===Nr&&e.charCodeAt(t+3)===mo&&(e.charCodeAt(t+4)===xs&&e.charCodeAt(t+5)===mt&&e.charCodeAt(t+6)===We&&e.charCodeAt(t+7)===We?o="https://":e.charCodeAt(t+4)===mt&&e.charCodeAt(t+5)===We&&e.charCodeAt(t+6)===We&&(o="http://")):i===wr||i===70?t+6<=r&&e.charCodeAt(t+1)===Nr&&e.charCodeAt(t+2)===mo&&e.charCodeAt(t+3)===mt&&e.charCodeAt(t+4)===We&&e.charCodeAt(t+5)===We&&(o="ftp://"):(i===yr||i===87)&&t+4<=r&&e.charCodeAt(t+1)===yr&&e.charCodeAt(t+2)===yr&&e.charCodeAt(t+3)===Mt&&(o="www.",a=!0),!o)return null;let s=t+o.length;for(;s<r;){let y=e.charCodeAt(s);if(y===P||y===J||y===N||y===br||y===Te||y===ue)break;s++}for(var c=0,l=0,u=t;u<s;u++){var h=e.charCodeAt(u);h===Lt?c++:h===It&&l++}let f=s;for(;f>t+o.length;){let y=e.charCodeAt(f-1);if(y===Mt||y===Zg||y===mt||y===xt||y===Qr||y===It||y===Ke||y===Ue||y===nt){if(y===It){if(c>=l)break;l--}f--}else if(y===Sn){for(var d=f-2;d>t&&(e.charCodeAt(d)>=oe&&e.charCodeAt(d)<=se||e.charCodeAt(d)>=Ee&&e.charCodeAt(d)<=Re||e.charCodeAt(d)>=ce&&e.charCodeAt(d)<=le);)d--;d>=t&&e.charCodeAt(d)===Un?f=d:f--}else break}if(f<=t+o.length)return null;var m=t+(a?4:o.length),p=e.indexOf("/",m);if((p<0||p>f)&&(p=f),a&&e.indexOf(".",m)===-1)return null;for(var v=-1,g=-1,b=p-1;b>=m;b--)if(e.charCodeAt(b)===Mt)if(v<0)v=b;else{g=b;break}for(var x=g>=0?g+1:m,b=x;b<p;b++)if(e.charCodeAt(b)===Ue)return null;var T=e.slice(t,f),C=a?"http://"+T:T;return{node:{type:A.link,target:C,title:void 0,children:[{type:A.text,text:T}]},end:f}}function Kv(e,t,r,n){if(n.disableBareUrls)return null;for(var o=t,a=o;o<r;){var i=e.charCodeAt(o);if(i>=oe&&i<=se||i>=Ee&&i<=Re||i>=ce&&i<=le||i===Mt||i===xt||i===Ot||i===36||i===ho||i===Un||i===xr||i===Ke||i===cr||i===We||i===Et||i===Qr||i===$t||i===Ue||i===_e||i===jr||i===tt||i===jo||i===nt||i===ae)o++;else break}if(o===a||o>=r||e.charCodeAt(o)!==ws)return null;o++;for(var s=o,c=-1,l=o;o<r;){var i=e.charCodeAt(o);if(i>=oe&&i<=se||i>=Ee&&i<=Re||i>=ce&&i<=le)o++;else if((i===ae||i===Ue)&&o>s)o++;else if(i===Mt){if(o===s)break;var u=e.charCodeAt(o-1);if(u===ae||u===Ue||o-l>63)break;if(o+1<r){var h=e.charCodeAt(o+1);if(h>=oe&&h<=se||h>=Ee&&h<=Re||h>=ce&&h<=le)c=o,l=o+1,o++;else break}else break}else break}if(o-l>63||c<0)return null;var f=e.charCodeAt(o-1);if(!(f>=oe&&f<=se||f>=Ee&&f<=Re||f>=ce&&f<=le)||o<=c+1)return null;for(var d=-1,m=c-1;m>=s;m--)if(e.charCodeAt(m)===Mt){d=m;break}for(var p=d>=0?d+1:s,m=p;m<o;m++)if(e.charCodeAt(m)===Ue)return null;var v=e.slice(t,o);return{node:{type:A.link,target:"mailto:"+v,title:void 0,children:[{type:A.text,text:v}]},end:o}}function ko(e){for(var t=0;t<e.length;t++)if(e[t].type===A.link||"children"in e[t]&&Array.isArray(e[t].children)&&ko(e[t].children))return!0;return!1}function Co(e){for(var t="",r=0;r<e.length;r++){var n=e[r];n.type===A.text?t+=n.text:n.type===A.breakLine?t+=" ":n.type===A.codeInline?t+=n.text:"children"in n&&Array.isArray(n.children)?t+=Co(n.children):n.type===A.image&&(t+=n.alt||"")}return t}function gr(e){return{type:A.text,text:e}}function qv(e,t,r){var n=t+1;if(n>=r)return-1;if(e.charCodeAt(n)===Ot){n++;var o=n<r&&(e.charCodeAt(n)===Xg||e.charCodeAt(n)===Qg);o&&n++;for(var a=n,i=o?6:7;n<r&&n-a<=i;){var s=e.charCodeAt(n),c=s>=ce&&s<=le||o&&(s>=oe&&s<=po||s>=Ee&&s<=wr);if(!c)break;n++}return n===a||n-a>i?-1:n<r&&e.charCodeAt(n)===Sn?n+1:-1}for(var l=n;n<r&&n-l<48;){var u=e.charCodeAt(n);if(u>=oe&&u<=se||u>=Ee&&u<=Re||u>=ce&&u<=le){n++;continue}break}return n===l?-1:n<r&&e.charCodeAt(n)===Sn?n+1:-1}function Yv(e,t,r,n,o){if(e.charCodeAt(t)!==Te)return null;var a=t+1;if(a>=r)return null;var i=e.charCodeAt(a);if(i===xt&&a+1<r&&e.charCodeAt(a+1)===ae&&a+2<r&&e.charCodeAt(a+2)===ae){var s=a+3;if(s<r&&e.charCodeAt(s)===ue)return{node:{type:A.htmlComment,text:"",l:!0},end:s+1};if(s+1<r&&e.charCodeAt(s)===ae&&e.charCodeAt(s+1)===ue)return{node:{type:A.htmlComment,text:"-",l:!0},end:s+2};var c=e.indexOf("-->",s);return c!==-1&&c<=r-3?{node:{type:A.htmlComment,text:e.slice(t+4,c),l:!1},end:c+3}:null}if(i===Qr){var l=e.indexOf("?>",a+1);return l!==-1&&l<r?{node:{type:A.htmlSelfClosing,tag:"?",attrs:{},a:e.slice(t,l+2),b:!1},end:l+2}:null}if(i===xt&&a+1<r){var u=e.charCodeAt(a+1);if(u===He&&e.slice(a+1,a+8)==="[CDATA["){var h=e.indexOf("]]>",a+8);return h!==-1&&h<r?{node:{type:A.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:e.slice(t,h+3),b:!1},end:h+3}:null}if(u>=oe&&u<=se){var f=e.indexOf(">",a+2);return f!==-1&&f<r?{node:{type:A.htmlSelfClosing,tag:"!"+e.slice(a+1,f),attrs:{},a:e.slice(t,f+1),b:!1},end:f+1}:null}}if(i===We){var d=a+1;if(d>=r)return null;var m=e.charCodeAt(d);if(!(m>=oe&&m<=se||m>=Ee&&m<=Re))return null;for(d++;d<r;){var p=e.charCodeAt(d);if(p>=oe&&p<=se||p>=Ee&&p<=Re||p>=ce&&p<=le||p===ae)d++;else break}for(;d<r&&(e.charCodeAt(d)===P||e.charCodeAt(d)===N||e.charCodeAt(d)===J);)d++;if(d<r&&e.charCodeAt(d)===ue){var v=e.slice(a+1,d).trim();return{node:{type:A.htmlSelfClosing,tag:v,attrs:{},a:e.slice(t,d+1),b:!0},end:d+1}}return null}if(!(i>=oe&&i<=se||i>=Ee&&i<=Re))return null;var g=Zt(e,t);if(!g)return null;var b=g.tag,x=b.toLowerCase(),T=g.selfClosing;if(T||$r(b))return{node:{type:A.htmlSelfClosing,tag:b,attrs:Jt(g.attrs,b,o),a:e.slice(t,g.end),b:!1},end:g.end};var C=en.has(x),y=xo(e.slice(0,r),g.end,b);if(y===-1)return{node:{type:A.htmlSelfClosing,tag:b,attrs:Jt(g.attrs,b,o),a:e.slice(t,g.end),b:!1},end:g.end};var S=Dv(e,"</"+x,y),E=e.slice(g.end,S),O=[];if(C)E.trim()&&(O=[{type:A.text,text:E}]);else{var _=E.trim();if(_){var{inAnchor:q,inline:U,e:$}=n;x==="a"&&(n.inAnchor=!0),n.e=!1;var H=_.indexOf(`
|
|
621
621
|
|
|
622
|
-
`)!==-1||/^#{1,6}\s/.test(_);H?(n.inline=!1,O=sr(_,n,o)):O=Wt(_,0,_.length,n,o),n.inAnchor=
|
|
623
|
-
`,t++;t<r&&e.charCodeAt(t)===P;)t++;B=t;continue}}if(V)(ne||t>B)&&(re.push(gr(ne+e.slice(B,t))),ne=""),re.push(V.node),t=V.end,B=t;else{if(be===st&&t+1<r){let vt=e.charCodeAt(t+1);if(Bo(vt)&Or){(ne||t>B)&&(re.push(gr(ne+e.slice(B,t))),ne=""),re.push(gr(e[t+1])),t+=2,B=t;continue}}if(t++,ee<0||ee-t>64)for(;t<r&&!(ee>=0&&ee-t<=64);){var
|
|
624
|
-
`),f=h===-1?u:u.slice(h+1);if(f.length>0&&f.charCodeAt(0)===tt){for(var d=!1,m=!1,p=1;p<f.length;p++){var v=f.charCodeAt(p);v===tt&&(d=!0),v===ae&&(m=!0)}d&&m&&(e=h===-1?"":e.slice(0,e.lastIndexOf(f)).trimEnd())}for(var g=-1,b=-1,x=-1,T=e.length-1;T>=0;T--)if(e.charCodeAt(T)===Te){var C=T+1<e.length?e.charCodeAt(T+1):0;if(C>=oe&&C<=se||C>=Ee&&C<=Re){for(var y=T+2;y<e.length;){var S=e.charCodeAt(y);if(S>=oe&&S<=se||S>=Ee&&S<=Re||S>=ce&&S<=le)y++;else break}for(var E=y;E<e.length&&e.charCodeAt(E)!==ue;)E++;if(E<e.length&&e.charCodeAt(E-1)!==We){for(var O=!1,_=E+1;_<e.length;_++)if(e.charCodeAt(_)===Te){O=!0;break}O||(g=T,b=y,x=E+1)}}break}if(g>=0){for(var
|
|
625
|
-
`),ct=ze===-1?0:ze+1,De=te,je=ct,me=0;je<De&&e.charCodeAt(je)===P&&me<3;)je++,me++;if(je<De){var re=e.charCodeAt(je),j=!1;if(re===
|
|
626
|
-
`,
|
|
627
|
-
`,
|
|
628
|
-
`,
|
|
622
|
+
`)!==-1||/^#{1,6}\s/.test(_);H?(n.inline=!1,O=sr(_,n,o)):O=Wt(_,0,_.length,n,o),n.inAnchor=q,n.inline=U,n.e=$}}return{node:{type:A.htmlBlock,tag:b,attrs:Jt(g.attrs,b,o),i:g.rawAttrs,children:O,a:void 0,text:E,d:!1,b:!1},end:y}}var Jv=200,Kr=0;function Wt(e,t,r,n,o){if(Kr++,Kr>Jv)return Kr--,[{type:A.text,text:e.slice(t,r)}];var a=n.g;n.g=void 0;let i=n;if(o.optimizeForStreaming){let be=function(Ie,$e){for(var et=1,lt=$e+1;lt<Ie.length;lt++){var Ct=Ie.charCodeAt(lt);if(Ct===He)et++;else if(Ct===Ft&&(et--,et===0))return lt}return-1},V=e.slice(t,r),vt=V;for(var s=0,c=0,l=0,u=0,h=0,f=-1,d=-1,m=-1,p=-1,v=-1,g=0;g<V.length;g++){var b=V.charCodeAt(g);b===Ke?g+1<V.length&&V.charCodeAt(g+1)===Ke?(s++,f=g,g++):(c++,d=g):b===Ue?g+1<V.length&&V.charCodeAt(g+1)===Ue?(l++,m=g,g++):(u++,p=g):b===nt&&g+1<V.length&&V.charCodeAt(g+1)===nt&&(h++,v=g,g++)}var x=[];h%2===1&&v>=0&&x.push([v,2]),l%2===1&&m>=0&&x.push([m,2]),u%2===1&&p>=0&&x.push([p,1]),s%2===1&&f>=0&&x.push([f,2]),c%2===1&&d>=0&&x.push([d,1]),x.sort(function(Ie,$e){return $e[0]-Ie[0]});for(var T=0;T<x.length;T++){var C=x[T][0],y=x[T][1];V=V.slice(0,C)+V.slice(C+y)}let Tt=0,jt=-1;for(let Ie=0;Ie<V.length;Ie++)V.charCodeAt(Ie)===_e&&(Tt++,jt=Ie);if(Tt%2===1&&jt!==-1){let Ie=!1,$e=-1,et=0;for(;et<V.length;)V.charCodeAt(et)===_e&&(Ie?(Ie=!1,$e=-1):($e=et,Ie=!0)),et++;Ie&&$e!==-1&&(V=V.slice(0,$e))}for(var S=!0;S;){S=!1;for(var E=-1,O=-1,_=-1,q=!1,U=0;U<V.length;U++){var $=V.charCodeAt(U);if($===He&&(U===0||V.charCodeAt(U-1)!==st)){var H=U>0&&V.charCodeAt(U-1)===xt,I=H?U-1:U,D=be(V,U);if(D===-1)E=I,q=H,O=U+1,_=V.length;else{var G=D+1;if(G>=V.length)E=I,q=H,O=U+1,_=D;else if(V.charCodeAt(G)===Lt){var Pe=V.indexOf(")",G+1);Pe===-1?(E=I,q=H,O=U+1,_=D,U=V.length):U=Pe}else if(V.charCodeAt(G)===He){var Q=V.indexOf("]",G+1);Q===-1?(E=I,q=H,O=U+1,_=D,U=V.length):U=Q}else U=D}}}if(E>=0){var te=q?"":V.slice(O,_);V=V.slice(0,E)+te,S=!0}}let ht=V.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(ht&&ht.index!==void 0){var ze=ht[0].length-ht[2].length,ct=ze>=2&&ht[0].charCodeAt(ze-2)===We;if(!ct){for(var De=!1,je=0,me=0;me<ht.index;me++)V.charCodeAt(me)===_e&&je++;if(De=je%2===1,!De){let Ie=ht[1];ar(V,"</"+Ie,0)===-1&&(V=V.slice(0,ht.index)+ht[2])}}}V!==vt&&(e=e.slice(0,t)+V,r=t+V.length)}let re=[];var j=[];let B=t;var ne="",ee=o.disableAutoLink||o.disableBareUrls||i.inAnchor?-1:e.indexOf("@",t);for(ee>=r&&(ee=-1);t<r;){let be=e.charCodeAt(t),V=null;if(be===_e){if(V=Fv(e,t,r),!V){var Ne=lr(e,t,r,_e);t+=Ne-1}}else if(be===Ke||be===Ue){var ve=Hv(e,t,r);if(ve){if(ve.canOpen||ve.canClose){(ne||t>B)&&(re.push(gr(ne+e.slice(B,t))),ne="");var we=e.slice(t,t+ve.len),K=gr(we);j.push({idx:re.length,ch:be,len:ve.len,canOpen:ve.canOpen,canClose:ve.canClose,active:!0}),re.push(K),t+=ve.len,B=t;continue}t+=ve.len-1}}else if(be===nt)V=Uv(e,t,r,i,o);else if(be===Et)V=Bv(e,t,r,i,o);else if(be===He)t+1<r&&e.charCodeAt(t+1)===$t&&(V=Vv(e,t,r)),V||(V=hi(e,t,r,i,o));else if(be===xt&&t+1<r&&e.charCodeAt(t+1)===He)V=hi(e,t,r,i,o);else if(be===Te)V=Ps(e,t,r),!V&&!o.disableParsingRawHTML&&!o.ignoreHTMLBlocks&&(V=Yv(e,t,r,i,o));else if(be===Un){var ye=qv(e,t,r);if(ye!==-1){var Je=e.slice(t,ye),Me=Hn(Je);if(Me!==Je){ne=ne+e.slice(B,t)+Me,t=ye,B=ye;continue}}}else if((be===An||be===yr||be===wr)&&!i.inAnchor&&!o.disableAutoLink&&(t===0||e.charCodeAt(t-1)!==Te)){var Ve=t+1<r?e.charCodeAt(t+1):0;(be===An&&Ve===Nr||be===wr&&Ve===Nr||be===yr&&Ve===yr)&&(V=Wv(e,t,r,o))}if(!V&&ee>=0&&ee-t<=64&&!i.inAnchor&&!o.disableAutoLink&&!o.disableBareUrls&&(be>=oe&&be<=se||be>=Ee&&be<=Re||be>=ce&&be<=le)&&(V=Kv(e,t,r,o),!V&&t>=ee&&(ee=e.indexOf("@",t+1),ee>=r&&(ee=-1))),be===J&&i.e){var at=!1,Le=0;if(t>B&&e.charCodeAt(t-1)===st)at=!0,Le=1;else{for(var it=0,Y=t-1;Y>=B&&e.charCodeAt(Y)===P;)it++,Y--;it>=2&&(at=!0,Le=it)}if(at){for((ne||t-Le>B)&&(re.push(gr(ne+e.slice(B,t-Le))),ne=""),re.push({type:A.breakLine}),t++;t<r&&e.charCodeAt(t)===P;)t++;B=t;continue}var ft=t>B&&e.charCodeAt(t-1)===P,ge=t+1<r&&e.charCodeAt(t+1)===P;if(ft||ge){for(var zt=t;zt>B&&e.charCodeAt(zt-1)===P;)zt--;for(ne+=e.slice(B,zt)+`
|
|
623
|
+
`,t++;t<r&&e.charCodeAt(t)===P;)t++;B=t;continue}}if(V)(ne||t>B)&&(re.push(gr(ne+e.slice(B,t))),ne=""),re.push(V.node),t=V.end,B=t;else{if(be===st&&t+1<r){let vt=e.charCodeAt(t+1);if(Bo(vt)&Or){(ne||t>B)&&(re.push(gr(ne+e.slice(B,t))),ne=""),re.push(gr(e[t+1])),t+=2,B=t;continue}}if(t++,ee<0||ee-t>64)for(;t<r&&!(ee>=0&&ee-t<=64);){var Kt=e.charCodeAt(t);if(Kt<Bn&&!As[Kt])t++;else break}}}return(ne||r>B)&&(re.push(gr(ne+e.slice(B,r))),ne=""),j.length>0&&Gv(re,j),n.g=a,Kr--,re}var Zv=500;function sr(e,t,r){var n=t.j||0;if(n>Zv)return[{type:A.text,text:e}];if(t.j=n+1,r.optimizeForStreaming&&!t.m){var o=e.length;o>0&&e.charCodeAt(o-1)===J&&o--;for(var a=o;a>0&&e.charCodeAt(a-1)!==J;)a--;if(a>0&&e.charCodeAt(a)===tt){for(var i=!0,s=a;s<o;s++){var c=e.charCodeAt(s);if(c!==P&&c!==N&&c!==ae&&c!==mt&&c!==tt){i=!1;break}}if(i){for(var l=a-1;l>0&&e.charCodeAt(l-1)!==J;)l--;e.charCodeAt(l)===tt&&(e=e.slice(0,l).trimEnd())}}var u=e.trim(),h=u.lastIndexOf(`
|
|
624
|
+
`),f=h===-1?u:u.slice(h+1);if(f.length>0&&f.charCodeAt(0)===tt){for(var d=!1,m=!1,p=1;p<f.length;p++){var v=f.charCodeAt(p);v===tt&&(d=!0),v===ae&&(m=!0)}d&&m&&(e=h===-1?"":e.slice(0,e.lastIndexOf(f)).trimEnd())}for(var g=-1,b=-1,x=-1,T=e.length-1;T>=0;T--)if(e.charCodeAt(T)===Te){var C=T+1<e.length?e.charCodeAt(T+1):0;if(C>=oe&&C<=se||C>=Ee&&C<=Re){for(var y=T+2;y<e.length;){var S=e.charCodeAt(y);if(S>=oe&&S<=se||S>=Ee&&S<=Re||S>=ce&&S<=le)y++;else break}for(var E=y;E<e.length&&e.charCodeAt(E)!==ue;)E++;if(E<e.length&&e.charCodeAt(E-1)!==We){for(var O=!1,_=E+1;_<e.length;_++)if(e.charCodeAt(_)===Te){O=!0;break}O||(g=T,b=y,x=E+1)}}break}if(g>=0){for(var q=0,U=0;U<g;U++)e.charCodeAt(U)===_e&&q++;if(q%2===0){var $=e.slice(g+1,b);ar(e,"</"+$,0)===-1&&(e=e.slice(0,g)+e.slice(x))}}for(var H=e.length;H>0&&e.charCodeAt(H-1)===J;)H--;if(H>0){for(var I=H;I>0&&e.charCodeAt(I-1)!==J;)I--;for(var D=I,G=0;D<H&&e.charCodeAt(D)===P&&G<3;)D++,G++;if(I>0&&D<H&&Tv(e,D,H)){for(var Pe=I-1,Q=Pe;Q>0&&e.charCodeAt(Q-1)!==J;)Q--;wt(e,Q,Pe)||(e=e.slice(0,I).trimEnd())}}var te=e.length;if(te>0){for(var ze=e.lastIndexOf(`
|
|
625
|
+
`),ct=ze===-1?0:ze+1,De=te,je=ct,me=0;je<De&&e.charCodeAt(je)===P&&me<3;)je++,me++;if(je<De){var re=e.charCodeAt(je),j=!1;if(re===Ke||re===ae||re===cr){var B=je+1;if(B>=De||e.charCodeAt(B)===P||e.charCodeAt(B)===N){for(var ne=B;ne<De&&(e.charCodeAt(ne)===P||e.charCodeAt(ne)===N);)ne++;ne>=De&&(j=!0)}}else if(re>=ce&&re<=le){for(var ee=je;ee<De&&e.charCodeAt(ee)>=ce&&e.charCodeAt(ee)<=le;)ee++;if(ee<De&&(e.charCodeAt(ee)===Mt||e.charCodeAt(ee)===It)){var Ne=ee+1;if(Ne>=De||e.charCodeAt(Ne)===P||e.charCodeAt(Ne)===N){for(var ve=Ne;ve<De&&(e.charCodeAt(ve)===P||e.charCodeAt(ve)===N);)ve++;ve>=De&&(j=!0)}}}j&&(e=e.slice(0,ct).trimEnd())}}}if(t.inline)return Wt(e,0,e.length,t,r);let we=[],K=0,ye=e.length;if(K===0&&!r.disableFrontmatter&&e.startsWith("---")){let Y=ev(e);if(Y&&Y.hasValidYaml){if(r.preserveFrontmatter!==!1){let ft=e.slice(0,Y.endPos).trimEnd();we.push({type:A.frontmatter,text:ft})}K=Y.endPos}}for(;K<ye;){for(var Je=e.indexOf(`
|
|
626
|
+
`,K),Me=Je<0?ye:Je;K<ye&&wt(e,K,Me);)K=Me<ye?Me+1:Me,K<ye&&(Je=e.indexOf(`
|
|
627
|
+
`,K),Me=Je<0?ye:Je);if(K>=ye)break;var Ve=e.charCodeAt(K)===go;Ze(e,K,Me);let Y=null;if(bo=e,wo=K,gn=Me,!Ve&&Ce>=4&&!t.inHTML)Y=Pv(e,K);else if(!Ve){let ft=K+xe,ge=e.charCodeAt(ft);ge===Ot?Y=zv(e,K,t,r):ge===ue?Y=Mv(e,K,t,r):ge===_e||ge===nt?Y=Ev(e,K):ge===ae||ge===Ke||ge===Ue?(Y=ir(e,K),!Y&&(Y=ci(e,K,t,r))):ge===cr||ge>=ce&&ge<=le?Y=ci(e,K,t,r):ge===Te?Y=Es(e,K,t,r):ge===tt?Y=ui(e,K,t,r):ge===He&&(Y=Nv(e,K,t))}if(!Y){for(var at=!1,Le=K;Le<Me;Le++)if(e.charCodeAt(Le)===tt){at=!0;break}at&&(Y=ui(e,K,t,r))}if(Y||(Y=Iv(e,K,t,r)),Y)Y.node.type!==A.refCollection&&we.push(Y.node),K=Y.end;else{var it=e.indexOf(`
|
|
628
|
+
`,K);K=it<0?ye:it+1}}return t.j=n,we}function Xv(e,t,r,n){var o=Zt(e,t);return o?{tagName:o.tag,tagLower:o.tag.toLowerCase(),attrs:o.rawAttrs,whitespaceBeforeAttrs:o.whitespaceBeforeAttrs,isSelfClosing:o.selfClosing,hasSpaceBeforeSlash:o.hasSpaceBeforeSlash,isClosing:o.isClosing,hasNewline:o.whitespaceBeforeAttrs.includes(`
|
|
629
629
|
`)||o.rawAttrs.includes(`
|
|
630
|
-
`),endPos:o.end}:null}function Go(e,t,r){qr=0,e=av(e),!t.refs&&(t.refs={}),(r.optimizeForStreaming||t.inline)&&(t.m=kv(e,t.refs,r));var n=!t.k;n&&(t.k=[],t.h=[]);let o=sr(e,t,r);if(n){for(var a=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<a.length;s++){var c=a[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=Wt(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 h=t.h,f=0;f<h.length;f++)for(var d=h[f],m=0;m<d.src.length;m++){var p=d.src[m];if(d.unwrap&&p.type===A.paragraph)for(var v=p.children,g=0;g<v.length;g++)d.dest.push(v[g]);else d.dest.push(p)}t.k=void 0,t.h=void 0}return Cs(t.refs)?[{type:A.refCollection,refs:t.refs},...o]:o}var _o;try{_o=z.createElement("div").$$typeof}catch{_o=Symbol.for("react.transitional.element")}function Ao(e,t,r){return{$$typeof:_o,type:e,key:r!=null?""+r:null,ref:null,props:t,_owner:null,_store:{},_debugStack:null,_debugTask:null}}var Yv=typeof z.createContext<"u"?z.createContext(void 0):void 0;function mi(e,t,r,n,o,a,i,s,c){switch(e.type){case A.blockQuote:{let d={key:r.key};return e.alert&&(d.className="markdown-alert-"+a(e.alert.toLowerCase(),Pt),e.children.unshift(sv(e.alert))),n("blockquote",d,t(e.children,r))}case A.breakLine:return n("br",{key:r.key});case A.breakThematic:return n("hr",{key:r.key});case A.frontmatter:return s.preserveFrontmatter?n("pre",{key:r.key},e.text):null;case A.codeBlock:let f=e.lang?Hn(e.lang):"";return n("pre",{key:r.key},n("code",{...At(e.attrs),className:f?`language-${f} lang-${f}`:""},e.text));case A.codeInline:return n("code",{key:r.key},e.text);case A.footnoteReference:return n("a",{key:r.key,href:o(e.target,"a","href")||void 0},n("sup",null,e.text));case A.gfmTask:return n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"});case A.heading:return n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r));case A.htmlBlock:{let d=e;if(s.tagfilter&&ni(d.tag))return n("span",{key:r.key},"<"+d.tag+ri(d.attrs)+">");if(d.a&&d.d){let m=d.tag.toLowerCase(),p=wv(m),v=d.children&&d.children.length>0;if(p){let _=dv(d.a,m,s.tagfilter);return/<[a-z][^>]{0,100}>/i.test(d.a)?c(e.tag,{key:r.key,...At(e.attrs),dangerouslySetInnerHTML:{__html:_}}):c(e.tag,{key:r.key,...At(e.attrs)},_)}let g=new RegExp(`^<${d.tag}(\\s|>)`,"i");if(v&&!g.test(d.a)&&s.tagfilter&&gv(d.a))return c(e.tag,{key:r.key,...At(e.attrs)},t(d.children,r));if(xv(d.a)){let _=s.tagfilter?As(d.a):d.a;return c(e.tag,{key:r.key,...At(e.attrs),dangerouslySetInnerHTML:{__html:_}})}let b={slugify:_=>a(_,Pt),sanitizer:o,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,...At(e.attrs)},t(d.children,r)):c(e.tag,{key:r.key,...At(e.attrs)});let T=Go(x,{inline:!1,refs:i,inHTML:!1},b);_s(T);let C=d.tag.toLowerCase(),y="</"+C+">",S=g.test(x),E=x.toLowerCase().trimEnd().endsWith(y),O=S&&E;if(O&&v)return c(e.tag,{key:r.key,...At(e.attrs)},t(d.children,r));if(O)return t(T.flatMap(Dr),r);var l=uv(T,C);if(l.found&&l.afterClose.length>0){var u=l.beforeClose.flatMap(Dr),h=l.afterClose.flatMap(Dr);return Ao(z.Fragment,{children:[c(e.tag,{key:r.key,...At(e.attrs)},t(u,r)),t(h,r)]},r.key)}return c(e.tag,{key:r.key,...At(e.attrs)},t(T.flatMap(Dr),r))}return $r(e.tag)?c(e.tag,{key:r.key,...At(e.attrs)}):c(e.tag,{key:r.key,...At(e.attrs)},e.children?t(e.children,r):"")}case A.htmlSelfClosing:{let d=e;return s.tagfilter&&ni(d.tag)?n("span",{key:r.key},"<"+d.tag+ri(d.attrs)+" />"):c(e.tag,{key:r.key,...At(e.attrs)})}case A.image:{let d=e.target!=null?o(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 A.link:{let d={key:r.key};return e.target!=null&&(d.href=hv(e.target)),e.title&&(d.title=e.title),n("a",d,t(e.children,r))}case A.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(v,g){return n("td",{key:g,style:d.align[g]==null?{}:{textAlign:d.align[g]}},t(v,r))}))})))}case A.text:return e.text;case A.textFormatted:return n(e.tag,{key:r.key},t(e.children,r));case A.orderedList:case A.unorderedList:{let d=e.type===A.orderedList?"ol":"ul";return n(d,{key:r.key,start:e.type===A.orderedList?e.start:void 0},e.items.map(function(m,p){return n("li",{key:p},t(m,r))}))}case A.paragraph:return n("p",{key:r.key},t(e.children,r));case A.ref:return null;default:return null}}var Jv=(e,t,r,n,o,a,i)=>{var s=l=>l.map(function(u){return"text"in u?u.text:""}),c=(l,u={})=>{var h=(u.renderDepth||0)+1;if(h>2500)return s(l);u.renderDepth=h;for(var f=u.key,d=[],m=!1,p=0;p<l.length;p++){u.key=p;var v;if(e){var g=mi.bind(null,l[p],c,u,t,r,n,o,a,i);v=e(g,l[p],c,u)}else v=mi(l[p],c,u,t,r,n,o,a,i);var b=typeof v=="string";if(b&&m)d[d.length-1]+=v;else if(v!==null)if(Array.isArray(v))for(var x=0;x<v.length;x++)d.push(v[x]);else d.push(v);m=b}return u.key=f,u.renderDepth=h-1,d};return c},Zv=(e,t)=>{let r=vo(t,e,void 0);return r?typeof r=="function"||typeof r=="object"&&"render"in r?r:vo(t,`${e}.component`,e):e};function Xv(e,t){let r={...t||{}};r.overrides=r.overrides||{};let n=r.slugify||Pt,o=r.sanitizer||Uo,a=r.createElement,i=Cs(r.overrides),s=x=>So(x,{...r,wrapper:null});function c(x){for(var T in x){var C=x[T];if(typeof C=="string"&&C.length>0&&C.charCodeAt(0)===Te&&(vv.test(C)||yv.test(C)||Kv(C,0))){var y=s(C.trim());x[T]=T==="innerHTML"&&Array.isArray(y)?y[0]:y}}}function l(x,T,...C){var y=T||{},S=x;if(i){var E=vo(r.overrides,x+".props",{});S=Zv(x,r.overrides),y={...y,...E,className:pv(y.className,E.className)||void 0}}if(!a){var O=y.key;return O!=null&&delete y.key,C.length===1?y.children=C[0]:C.length>1&&(y.children=C),Ao(S,y,O)}return a(S,y,...C)}function u(x,T,...C){return T&&c(T),l(x,T,...C)}let h={...r,slugify:r.slugify?x=>r.slugify(x,Pt):Pt,sanitizer:o,tagfilter:r.tagfilter!==!1},f=e[0]&&e[0].type===A.refCollection?e[0].refs:{},d=Jv(r.renderRule,l,o,n,f,r,u),m=d(e,{inline:r.forceInline,refs:f}),p=fv(f);if(p.length&&m.push(l("footer",{key:"footer"},p.map(function(x){let T=x.identifier.charCodeAt(0)===$t?x.identifier.slice(1):x.identifier,C=Go(x.footnote,{inline:!0,refs:f},h);return l("div",{id:n(T,Pt),key:x.identifier},T+": ",d(C,{inline:!0,refs:f}))}))),r.wrapper===null)return m;let v=r.wrapper||(r.forceInline?"span":"div"),g;if(m.length>1||r.forceWrapper)g=m;else return m.length===1?m[0]:null;var b=r.wrapperProps?{...r.wrapperProps}:{};return b.children=g,Ao(v,b,"outer")}function So(e="",t={}){let r={...t||{}};r.overrides=r.overrides||{},r.slugify;let n=r.sanitizer||Uo;function o(i){let s=r.forceInline||!r.forceBlock&&!ev.test(i),c={...r,slugify:r.slugify?f=>r.slugify(f,Pt):Pt,sanitizer:n,tagfilter:r.tagfilter!==!1},l=s?i:lv(i);if(r.optimizeForStreaming){var u=l.lastIndexOf("<");u!==-1&&l.indexOf(">",u)===-1&&(l=l.slice(0,u))}let h=Go(l,{inline:s,refs:a},c);return Xv(h,{...c,forceInline:s})}let a={};return o(e)}function Qv(e){let t=z.useRef(e),r=t.current;if(r!==e){var n=!0,o=0;for(var a in e)if(o++,!Object.is(r[a],e[a])){n=!1;break}if(n){var i=0;for(var s in r)i++;n=i===o}n||(t.current=e)}return t.current}var $v=({children:e,options:t,...r})=>{if(!(typeof z.useContext<"u")){let s={...t,overrides:{...t==null?void 0:t.overrides},wrapperProps:{...t==null?void 0:t.wrapperProps,...r}};return So(e??"",s)}let n=z.useContext(Yv),o=Qv(r),a=z.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,...o}}),[n,t,o]),i=e??"";return z.useMemo(()=>So(i,a),[i,a])},ey=$v,ty=ey;const ry={forceBlock:!0,overrides:{a:{component:({children:e,...t})=>w.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})}}};function ny({text:e}){return w.jsx("div",{className:"zai-md",children:w.jsx(ty,{options:ry,children:e})})}const ao=["what's going on?","what's moving today?","summarize the market for me","what should I be watching?","explain my dashboard"],Vo=["day-stats","ohlcv","quote-stream"],oy=[{caps:Vo,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?"}],ay=8;function iy(e,t){var r;for(const n of e.frames){if(!(((r=t.get(n.frame))==null?void 0:r.capabilities)??[]).some(c=>Vo.includes(c)))continue;const a=n.config??{},i=[];if(typeof a.symbol=="string"&&i.push(a.symbol),Array.isArray(a.symbols))for(const c of a.symbols)typeof c=="string"&&i.push(c);const s=i.find(c=>c&&c!=="*"&&!c.endsWith(":*"));if(s)return jn(s)}}function sy(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 ao;const n=iy(e,t),o=[];for(const s of oy)s.caps.some(c=>r.has(c))&&o.push(s.text(s.caps===Vo?n:void 0));const a=[...new Set([...o,...ao])].slice(0,ay);return a.length?a:ao}const cy=1,ly=5,uy="effect2",dy=3600,zo=320;function fy(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 hy=`
|
|
630
|
+
`),endPos:o.end}:null}function Go(e,t,r){Kr=0,e=lv(e),!t.refs&&(t.refs={}),(r.optimizeForStreaming||t.inline)&&(t.m=Sv(e,t.refs,r));var n=!t.k;n&&(t.k=[],t.h=[]);let o=sr(e,t,r);if(n){for(var a=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<a.length;s++){var c=a[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=Wt(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 h=t.h,f=0;f<h.length;f++)for(var d=h[f],m=0;m<d.src.length;m++){var p=d.src[m];if(d.unwrap&&p.type===A.paragraph)for(var v=p.children,g=0;g<v.length;g++)d.dest.push(v[g]);else d.dest.push(p)}t.k=void 0,t.h=void 0}return ks(t.refs)?[{type:A.refCollection,refs:t.refs},...o]:o}var _o;try{_o=z.createElement("div").$$typeof}catch{_o=Symbol.for("react.transitional.element")}function Ao(e,t,r){return{$$typeof:_o,type:e,key:r!=null?""+r:null,ref:null,props:t,_owner:null,_store:{},_debugStack:null,_debugTask:null}}var Qv=typeof z.createContext<"u"?z.createContext(void 0):void 0;function pi(e,t,r,n,o,a,i,s,c){switch(e.type){case A.blockQuote:{let d={key:r.key};return e.alert&&(d.className="markdown-alert-"+a(e.alert.toLowerCase(),Pt),e.children.unshift(dv(e.alert))),n("blockquote",d,t(e.children,r))}case A.breakLine:return n("br",{key:r.key});case A.breakThematic:return n("hr",{key:r.key});case A.frontmatter:return s.preserveFrontmatter?n("pre",{key:r.key},e.text):null;case A.codeBlock:let f=e.lang?Hn(e.lang):"";return n("pre",{key:r.key},n("code",{...At(e.attrs),className:f?`language-${f} lang-${f}`:""},e.text));case A.codeInline:return n("code",{key:r.key},e.text);case A.footnoteReference:return n("a",{key:r.key,href:o(e.target,"a","href")||void 0},n("sup",null,e.text));case A.gfmTask:return n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"});case A.heading:return n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r));case A.htmlBlock:{let d=e;if(s.tagfilter&&ri(d.tag))return n("span",{key:r.key},"<"+d.tag+ti(d.attrs)+">");if(d.a&&d.d){let m=d.tag.toLowerCase(),p=_v(m),v=d.children&&d.children.length>0;if(p){let _=mv(d.a,m,s.tagfilter);return/<[a-z][^>]{0,100}>/i.test(d.a)?c(e.tag,{key:r.key,...At(e.attrs),dangerouslySetInnerHTML:{__html:_}}):c(e.tag,{key:r.key,...At(e.attrs)},_)}let g=new RegExp(`^<${d.tag}(\\s|>)`,"i");if(v&&!g.test(d.a)&&s.tagfilter&&wv(d.a))return c(e.tag,{key:r.key,...At(e.attrs)},t(d.children,r));if(Av(d.a)){let _=s.tagfilter?_s(d.a):d.a;return c(e.tag,{key:r.key,...At(e.attrs),dangerouslySetInnerHTML:{__html:_}})}let b={slugify:_=>a(_,Pt),sanitizer:o,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,...At(e.attrs)},t(d.children,r)):c(e.tag,{key:r.key,...At(e.attrs)});let T=Go(x,{inline:!1,refs:i,inHTML:!1},b);Cs(T);let C=d.tag.toLowerCase(),y="</"+C+">",S=g.test(x),E=x.toLowerCase().trimEnd().endsWith(y),O=S&&E;if(O&&v)return c(e.tag,{key:r.key,...At(e.attrs)},t(d.children,r));if(O)return t(T.flatMap(Dr),r);var l=pv(T,C);if(l.found&&l.afterClose.length>0){var u=l.beforeClose.flatMap(Dr),h=l.afterClose.flatMap(Dr);return Ao(z.Fragment,{children:[c(e.tag,{key:r.key,...At(e.attrs)},t(u,r)),t(h,r)]},r.key)}return c(e.tag,{key:r.key,...At(e.attrs)},t(T.flatMap(Dr),r))}return $r(e.tag)?c(e.tag,{key:r.key,...At(e.attrs)}):c(e.tag,{key:r.key,...At(e.attrs)},e.children?t(e.children,r):"")}case A.htmlSelfClosing:{let d=e;return s.tagfilter&&ri(d.tag)?n("span",{key:r.key},"<"+d.tag+ti(d.attrs)+" />"):c(e.tag,{key:r.key,...At(e.attrs)})}case A.image:{let d=e.target!=null?o(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 A.link:{let d={key:r.key};return e.target!=null&&(d.href=vv(e.target)),e.title&&(d.title=e.title),n("a",d,t(e.children,r))}case A.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(v,g){return n("td",{key:g,style:d.align[g]==null?{}:{textAlign:d.align[g]}},t(v,r))}))})))}case A.text:return e.text;case A.textFormatted:return n(e.tag,{key:r.key},t(e.children,r));case A.orderedList:case A.unorderedList:{let d=e.type===A.orderedList?"ol":"ul";return n(d,{key:r.key,start:e.type===A.orderedList?e.start:void 0},e.items.map(function(m,p){return n("li",{key:p},t(m,r))}))}case A.paragraph:return n("p",{key:r.key},t(e.children,r));case A.ref:return null;default:return null}}var $v=(e,t,r,n,o,a,i)=>{var s=l=>l.map(function(u){return"text"in u?u.text:""}),c=(l,u={})=>{var h=(u.renderDepth||0)+1;if(h>2500)return s(l);u.renderDepth=h;for(var f=u.key,d=[],m=!1,p=0;p<l.length;p++){u.key=p;var v;if(e){var g=pi.bind(null,l[p],c,u,t,r,n,o,a,i);v=e(g,l[p],c,u)}else v=pi(l[p],c,u,t,r,n,o,a,i);var b=typeof v=="string";if(b&&m)d[d.length-1]+=v;else if(v!==null)if(Array.isArray(v))for(var x=0;x<v.length;x++)d.push(v[x]);else d.push(v);m=b}return u.key=f,u.renderDepth=h-1,d};return c},ey=(e,t)=>{let r=vo(t,e,void 0);return r?typeof r=="function"||typeof r=="object"&&"render"in r?r:vo(t,`${e}.component`,e):e};function ty(e,t){let r={...t||{}};r.overrides=r.overrides||{};let n=r.slugify||Pt,o=r.sanitizer||Uo,a=r.createElement,i=ks(r.overrides),s=x=>So(x,{...r,wrapper:null});function c(x){for(var T in x){var C=x[T];if(typeof C=="string"&&C.length>0&&C.charCodeAt(0)===Te&&(xv.test(C)||kv.test(C)||Xv(C,0))){var y=s(C.trim());x[T]=T==="innerHTML"&&Array.isArray(y)?y[0]:y}}}function l(x,T,...C){var y=T||{},S=x;if(i){var E=vo(r.overrides,x+".props",{});S=ey(x,r.overrides),y={...y,...E,className:yv(y.className,E.className)||void 0}}if(!a){var O=y.key;return O!=null&&delete y.key,C.length===1?y.children=C[0]:C.length>1&&(y.children=C),Ao(S,y,O)}return a(S,y,...C)}function u(x,T,...C){return T&&c(T),l(x,T,...C)}let h={...r,slugify:r.slugify?x=>r.slugify(x,Pt):Pt,sanitizer:o,tagfilter:r.tagfilter!==!1},f=e[0]&&e[0].type===A.refCollection?e[0].refs:{},d=$v(r.renderRule,l,o,n,f,r,u),m=d(e,{inline:r.forceInline,refs:f}),p=gv(f);if(p.length&&m.push(l("footer",{key:"footer"},p.map(function(x){let T=x.identifier.charCodeAt(0)===$t?x.identifier.slice(1):x.identifier,C=Go(x.footnote,{inline:!0,refs:f},h);return l("div",{id:n(T,Pt),key:x.identifier},T+": ",d(C,{inline:!0,refs:f}))}))),r.wrapper===null)return m;let v=r.wrapper||(r.forceInline?"span":"div"),g;if(m.length>1||r.forceWrapper)g=m;else return m.length===1?m[0]:null;var b=r.wrapperProps?{...r.wrapperProps}:{};return b.children=g,Ao(v,b,"outer")}function So(e="",t={}){let r={...t||{}};r.overrides=r.overrides||{},r.slugify;let n=r.sanitizer||Uo;function o(i){let s=r.forceInline||!r.forceBlock&&!ov.test(i),c={...r,slugify:r.slugify?f=>r.slugify(f,Pt):Pt,sanitizer:n,tagfilter:r.tagfilter!==!1},l=s?i:hv(i);if(r.optimizeForStreaming){var u=l.lastIndexOf("<");u!==-1&&l.indexOf(">",u)===-1&&(l=l.slice(0,u))}let h=Go(l,{inline:s,refs:a},c);return ty(h,{...c,forceInline:s})}let a={};return o(e)}function ry(e){let t=z.useRef(e),r=t.current;if(r!==e){var n=!0,o=0;for(var a in e)if(o++,!Object.is(r[a],e[a])){n=!1;break}if(n){var i=0;for(var s in r)i++;n=i===o}n||(t.current=e)}return t.current}var ny=({children:e,options:t,...r})=>{if(!(typeof z.useContext<"u")){let s={...t,overrides:{...t==null?void 0:t.overrides},wrapperProps:{...t==null?void 0:t.wrapperProps,...r}};return So(e??"",s)}let n=z.useContext(Qv),o=ry(r),a=z.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,...o}}),[n,t,o]),i=e??"";return z.useMemo(()=>So(i,a),[i,a])},oy=ny,ay=oy;const iy={forceBlock:!0,overrides:{a:{component:({children:e,...t})=>w.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})}}};function sy({text:e}){return w.jsx("div",{className:"zai-md",children:w.jsx(ay,{options:iy,children:e})})}const ao=["what's going on?","what's moving today?","summarize the market for me","what should I be watching?","explain my dashboard"],Vo=["day-stats","ohlcv","quote-stream"],cy=[{caps:Vo,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?"}],ly=8;function uy(e,t){var r;for(const n of e.frames){if(!(((r=t.get(n.frame))==null?void 0:r.capabilities)??[]).some(c=>Vo.includes(c)))continue;const a=n.config??{},i=[];if(typeof a.symbol=="string"&&i.push(a.symbol),Array.isArray(a.symbols))for(const c of a.symbols)typeof c=="string"&&i.push(c);const s=i.find(c=>c&&c!=="*"&&!c.endsWith(":*"));if(s)return jn(s)}}function dy(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 ao;const n=uy(e,t),o=[];for(const s of cy)s.caps.some(c=>r.has(c))&&o.push(s.text(s.caps===Vo?n:void 0));const a=[...new Set([...o,...ao])].slice(0,ly);return a.length?a:ao}const fy=1,hy=5,py="effect2",my=3600,zo=320;function gy(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 vy=`
|
|
631
631
|
/* Focus scrim: opening the orb blurs + dims the dashboard behind so attention
|
|
632
632
|
lands on the conversation. Sits below the orb dock (z 40) and above the
|
|
633
633
|
ticker tape (z 30), so the orb + chat stay sharp while everything else
|
|
@@ -932,5 +932,5 @@ ${a.join(`
|
|
|
932
932
|
.zai-ph-busy { animation: none; opacity: 0.5; }
|
|
933
933
|
.zai-scrim { transition: opacity 0.2s linear; }
|
|
934
934
|
}
|
|
935
|
-
`;function
|
|
936
|
-
`))!==-1;){const ft=at.slice(0,Y).trim();if(at=at.slice(Y+1),!ft)continue;let ge;try{ge=JSON.parse(ft)}catch{continue}ge.type==="status"&&typeof ge.text=="string"?p(ge.text):ge.type==="delta"&&typeof ge.text=="string"?(Ne(),p(null),ee+=ge.text,ve(ee)):ge.type==="done"?(Ne(),ve(ge.answer||ee)):ge.type==="error"&&(Ne(),ve(ge.error||"zAI couldn't finish that answer — try again.",!0))}}ne||te({role:"zai",text:"zAI didn't return anything — try again.",error:!0})}catch{const
|
|
935
|
+
`;function yy({onOpenChange:e,onThinkingChange:t,spec:r,registry:n}){var re;const[o,a]=z.useState(null),[i,s]=z.useState(null),[c,l]=z.useState(!1),[u,h]=z.useState(""),[f,d]=z.useState(!1),[m,p]=z.useState(null),[v,g]=z.useState([]),[b,x]=z.useState(!1),[T,C]=z.useState(!1),[y,S]=z.useState(0),[E,O]=z.useState(!0),[_,q]=z.useState(!1),U=z.useRef(null),$=z.useRef(null),H=z.useRef(null),I=Kg(r,n),D=z.useMemo(()=>dy(r,n),[r,n]),G=z.useCallback((j,B)=>{var ee;const ne=(ee=j.layers)==null?void 0:ee.find(Ne=>Ne.id===py&&Ne.layerType==="effect");ne&&ne.layerType==="effect"&&(ne.speed=B?hy:fy)},[]),Pe=z.useCallback(j=>{H.current=j,j?(G(j,!1),C(!1),x(!0)):x(!1)},[G]),Q=z.useCallback(()=>{x(!1),C(!0)},[]);z.useEffect(()=>{H.current&&G(H.current,f)},[f,G]),z.useEffect(()=>{let j=!1;return fetch(gh,{cache:"no-store"}).then(B=>B.ok?B.json():{agents:[]}).then(B=>{var ee;if(j)return;const ne=B.agents??[];a(ne),s(((ee=ne[0])==null?void 0:ee.id)??null)}).catch(()=>{j||a([])}),()=>{j=!0}},[]),z.useEffect(()=>{var j;c&&((j=U.current)==null||j.focus())},[c]),z.useEffect(()=>{if(!c)return;const j=B=>{B.key==="Escape"&&l(!1)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[c]),z.useEffect(()=>{if(!o||o.length===0)return;const j=B=>{(B.metaKey||B.ctrlKey)&&!B.shiftKey&&!B.altKey&&B.key.toLowerCase()==="k"&&(B.preventDefault(),l(ne=>!ne))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[o]),z.useEffect(()=>{const j=$.current;j&&(j.scrollTop=j.scrollHeight,q(j.scrollTop>1))},[v,c]),z.useEffect(()=>{if(!c||f){O(!0);return}let j;const B=setInterval(()=>{O(!1),j=setTimeout(()=>{S(ne=>ne+1),O(!0)},zo)},my);return()=>{clearInterval(B),clearTimeout(j)}},[c,f]),z.useEffect(()=>{e==null||e(c)},[c,e]),z.useEffect(()=>{t==null||t(f)},[f,t]);const te=j=>g(B=>[...B,j].slice(-8));async function ze(){var we;const j=u.trim();if(!j||f)return;const B=v.filter(K=>!K.error).map(K=>({role:K.role,text:K.text}));te({role:"user",text:j}),h(""),d(!0),p(null);let ne=!1,ee="";const Ne=()=>{ne||(ne=!0,te({role:"zai",text:""}))},ve=(K,ye=!1)=>g(Je=>{const Me=[...Je];for(let Ve=Me.length-1;Ve>=0;Ve--)if(Me[Ve].role==="zai"){Me[Ve]={...Me[Ve],text:K,error:ye};break}return Me});try{const K=await I(),ye=await fetch(vh,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:j,agent:i,context:K??void 0,history:B.length?B:void 0})}),Je=ye.headers.get("content-type")??"";if(!ye.body||!Je.includes("application/x-ndjson")){const Le=await ye.json().catch(()=>null);if(ye.ok&&typeof(Le==null?void 0:Le.answer)=="string"&&Le.answer.trim()){te({role:"zai",text:Le.answer.trim()});return}te({role:"zai",text:(Le==null?void 0:Le.error)??gy(ye.status),error:!0});return}const Me=ye.body.getReader(),Ve=new TextDecoder;let at="";for(;;){const{value:Le,done:it}=await Me.read();if(it)break;at+=Ve.decode(Le,{stream:!0});let Y;for(;(Y=at.indexOf(`
|
|
936
|
+
`))!==-1;){const ft=at.slice(0,Y).trim();if(at=at.slice(Y+1),!ft)continue;let ge;try{ge=JSON.parse(ft)}catch{continue}ge.type==="status"&&typeof ge.text=="string"?p(ge.text):ge.type==="delta"&&typeof ge.text=="string"?(Ne(),p(null),ee+=ge.text,ve(ee)):ge.type==="done"?(Ne(),ve(ge.answer||ee)):ge.type==="error"&&(Ne(),ve(ge.error||"zAI couldn't finish that answer — try again.",!0))}}ne||te({role:"zai",text:"zAI didn't return anything — try again.",error:!0})}catch{const K="zAI couldn't be reached — check that the zframes server is running.";ne?ve(K,!0):te({role:"zai",text:K,error:!0})}finally{d(!1),p(null),(we=U.current)==null||we.focus()}}function ct(j){if(j.key==="Enter"&&!j.shiftKey)j.preventDefault(),ze();else if(j.key==="Tab"&&!j.shiftKey&&!f&&!u){const B=D[y%D.length];B&&(j.preventDefault(),h(B))}}function De(){if(!o||o.length<2||!i)return;const j=o.findIndex(B=>B.id===i);s(o[(j+1)%o.length].id)}if(!o||o.length===0)return null;const je=((re=o.find(j=>j.id===i))==null?void 0:re.label)??o[0].label,me=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)?"⌘K":"Ctrl+K";return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:vy}),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":f,children:[c&&v.length>0&&w.jsx("div",{className:"zai-history",ref:$,"data-masked":_,onScroll:j=>q(j.currentTarget.scrollTop>1),"aria-live":"polite",children:v.map((j,B)=>j.role==="zai"&&!j.error?w.jsx("div",{className:"zai-msg zai-msg-zai",children:w.jsx(sy,{text:j.text})},B):w.jsx("div",{className:j.role==="user"?"zai-msg zai-msg-user":"zai-msg zai-msg-zai zai-msg-error",children:j.text},B))}),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:U,className:"zai-input",value:u,onChange:j=>h(j.target.value),onKeyDown:ct,placeholder:"",disabled:f,"aria-label":"Ask zAI"}),w.jsx("span",{className:`zai-ph${f?" zai-ph-busy":""}`,"data-show":!u&&(f||E),"aria-hidden":"true",children:f?m??"thinking…":D[y%D.length]??""})]}),w.jsx("span",{className:"zai-agent",onClick:De,title:o.length>1?"Click to switch agent":`Answered by ${je}`,children:je})]})}),w.jsx("button",{type:"button",className:"zai-orb","data-webgl":b,"data-fallback":T,onClick:()=>l(j=>!j),"aria-label":c?"Close zAI":"Ask zAI",title:c?"Close zAI":`Ask zAI · ${me}`,"aria-expanded":c,children:w.jsx(Lg,{className:"zai-orb-canvas",onScene:Pe,onError:Q})})]})]})}const by=z.lazy(()=>R(()=>import("./editor-Ca-voh3h.js"),__vite__mapDeps([101,1,102,103,104])).then(e=>({default:e.DashboardEditor}))),pn=kg(),wy=[...Rm(),new bh,new Lh];function Wo({children:e}){return w.jsx("main",{className:"mx-auto max-w-2xl px-6 py-16",children:e})}function xy(){return w.jsx(Wo,{children:w.jsx("p",{className:"body-sm text-soft",children:"loading dashboard…"})})}function ky({message:e}){return w.jsxs(Wo,{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 Cy({issues:e}){return w.jsxs(Wo,{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 _y(e){try{const t=await fetch(dh,{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 Ay(){const[e,t]=z.useState({status:"loading"}),[r,n]=z.useState(null),[o,a]=z.useState(null),[i,s]=z.useState(null),[c,l]=z.useState(null),[u,h]=z.useState(null),[f,d]=z.useState(null),[m,p]=z.useState(null),[v,g]=z.useState(null),b=Og(),[x,T]=z.useState(!1),[C,y]=z.useState(!1),S=o??(e.status==="ready"?e.spec.theme.accentHue:null),E=i??(e.status==="ready"?e.spec.theme.accentSat:null),O=c??(e.status==="ready"?e.spec.typography.scale:null),_=u??(e.status==="ready"?e.spec.theme.upColor:null),q=f??(e.status==="ready"?e.spec.theme.downColor:null);if(z.useEffect(()=>{S!=null&&document.documentElement.style.setProperty("--zf-accent-hue",String(S))},[S]),z.useEffect(()=>{E!=null&&document.documentElement.style.setProperty("--zf-accent-sat",`${E}%`)},[E]),z.useEffect(()=>{O!=null&&(document.documentElement.style.fontSize=`${O*100}%`)},[O]),z.useEffect(()=>{_!=null&&document.documentElement.style.setProperty("--zf-up",_)},[_]),z.useEffect(()=>{q!=null&&document.documentElement.style.setProperty("--zf-down",q)},[q]),z.useEffect(()=>{let I=!1;return fetch(uh,{cache:"no-store"}).then(D=>{if(!D.ok)throw new Error(`HTTP ${D.status}`);return D.json()}).then(D=>{if(I)return;const G=Jf.safeParse(D);t(G.success?{status:"ready",spec:G.data}:{status:"invalid",issues:G.error.issues})}).catch(D=>{I||t({status:"error",message:String(D)})}),()=>{I=!0}},[]),e.status==="loading")return w.jsx(xy,{});if(e.status==="error")return w.jsx(ky,{message:e.message});if(e.status==="invalid")return w.jsx(Cy,{issues:e.issues});const U=e.spec,$=(m??U.grid.mode)==="flow-horizontal",H=v??U.background;return w.jsxs(eh,{providers:wy,children:[w.jsx(Ym,{background:H,active:x,thinking:C,accentHue:S??U.theme.accentHue,accentSat:E??U.theme.accentSat,sceneHue:$f(H.projectId)}),w.jsxs("main",{className:`relative z-10 mx-auto pt-5 ${$?"h-[100dvh] max-w-none overflow-hidden px-0":"max-w-[1320px] px-4 pb-24 sm:px-6"}`,style:{"--zf-accent-hue":S??U.theme.accentHue,"--zf-accent-sat":`${E??U.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 ${$?"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(Jm,{currentTitle:U.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.5.3"]})]}),w.jsx("div",{ref:n,className:"flex min-h-9 items-center justify-end"})]}),b?w.jsx(z.Suspense,{fallback:w.jsx(Da,{spec:U,registry:pn}),children:w.jsx(by,{spec:U,registry:pn,onSave:_y,customiseButtonTarget:r,onAccentHueChange:a,onAccentSatChange:s,onFontScaleChange:l,onUpColorChange:h,onDownColorChange:d,onModeChange:p,onBackgroundChange:g})}):w.jsx(Da,{spec:U,registry:pn})]}),w.jsx(Mg,{}),w.jsx(yy,{onOpenChange:T,onThinkingChange:y,spec:U,registry:pn})]})}const Ms=document.getElementById("root");if(!Ms)throw new Error("missing #root element");ac.createRoot(Ms).render(w.jsx(z.StrictMode,{children:w.jsx(Ay,{})}));export{ob as $,Ag as A,Xf as B,$m as C,Ky as D,m0 as E,Ty as F,tb as G,v0 as H,rb as I,d0 as J,$y as K,h0 as L,eb as M,qf as N,f0 as O,Qy as P,p0 as Q,Xy as R,b0 as S,My as T,Dy as U,e0 as V,k0 as W,x0 as X,u0 as Y,Qm as Z,O0 as _,eh as a,db as a$,t0 as a0,r0 as a1,Ry as a2,T0 as a3,Ny as a4,Cg as a5,n0 as a6,o0 as a7,th as a8,rh as a9,U0 as aA,B0 as aB,H0 as aC,G0 as aD,V0 as aE,W0 as aF,K0 as aG,q0 as aH,Y0 as aI,X0 as aJ,J0 as aK,Z0 as aL,Q0 as aM,$0 as aN,lg as aO,ab as aP,ug as aQ,ib as aR,dg as aS,sb as aT,fg as aU,cb as aV,hg as aW,lb as aX,pg as aY,ub as aZ,mg as a_,c0 as aa,qy as ab,Jy as ac,l0 as ad,Yy as ae,y0 as af,nb as ag,a0 as ah,i0 as ai,Ly as aj,g0 as ak,Zy as al,D0 as am,Iy as an,R0 as ao,Fy as ap,N0 as aq,jy as ar,L0 as as,Uy as at,I0 as au,By as av,F0 as aw,Hy as ax,j0 as ay,Vy as az,nh as b,gg as b0,fb as b1,vg as b2,pb as b3,yg as b4,bg as b5,Gy as b6,eg as b7,tg as b8,rg as b9,ng as ba,og as bb,ag as bc,ig as bd,sg as be,cg as bf,ch as c,oh as d,Kf as e,Ey as f,P0 as g,jn as h,M0 as i,hb as j,Oy as k,gb as l,mb as m,s0 as n,Wy as o,E0 as p,Xm as q,C0 as r,_0 as s,Py as t,Nn as u,Ma as v,A0 as w,S0 as x,z0 as y,w0 as z};
|