semiotic 3.8.1 → 3.8.2
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/CLAUDE.md +3 -1
- package/README.md +53 -52
- package/ai/behaviorContracts.cjs +9 -0
- package/ai/dist/mcp-server.js +142 -13
- package/ai/schema.json +616 -42
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +5 -2
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
- package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
- package/dist/chunk-chunk-27HVVXS6.module.min.js +1 -0
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
- package/dist/chunk-chunk-2UN3ANRN.module.min.js +2 -0
- package/dist/chunk-chunk-2VUEY5TH.module.min.js +1 -0
- package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
- package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
- package/dist/chunk-chunk-5WEFWNUW.module.min.js +2 -0
- package/dist/chunk-chunk-6F6GEAQU.module.min.js +1 -0
- package/dist/chunk-chunk-7LHMKRKE.module.min.js +2 -0
- package/dist/chunk-chunk-BHYTYMY2.module.min.js +2 -0
- package/dist/chunk-chunk-C6EJ4IOD.module.min.js +2 -0
- package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
- package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
- package/dist/chunk-chunk-CYIML3AV.module.min.js +2 -0
- package/dist/chunk-chunk-DNY43POY.module.min.js +1 -0
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
- package/dist/chunk-chunk-E7MIQX7D.module.min.js +2 -0
- package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
- package/dist/chunk-chunk-ES4DCG3L.module.min.js +1 -0
- package/dist/chunk-chunk-FAKO3RGQ.module.min.js +2 -0
- package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
- package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
- package/dist/chunk-chunk-H4PPRW6N.module.min.js +1 -0
- package/dist/chunk-chunk-IFYPMWKY.module.min.js +1 -0
- package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
- package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
- package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
- package/dist/chunk-chunk-L6D3I3V7.module.min.js +2 -0
- package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
- package/dist/chunk-chunk-NO4MCQVD.module.min.js +1 -0
- package/dist/chunk-chunk-ODUZEEBH.module.min.js +2 -0
- package/dist/chunk-chunk-P6UBCMSQ.module.min.js +2 -0
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
- package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
- package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
- package/dist/chunk-chunk-RH5TSQPH.module.min.js +1 -0
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
- package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
- package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
- package/dist/chunk-chunk-STZFFTAN.module.min.js +2 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-T27ZEV6A.module.min.js +1 -0
- package/dist/chunk-chunk-U3AGQ5EF.module.min.js +2 -0
- package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
- package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
- package/dist/chunk-chunk-W3DB2MN4.module.min.js +2 -0
- package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
- package/dist/chunk-chunk-WDIN4LRC.module.min.js +1 -0
- package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
- package/dist/chunk-chunk-XOYX77KF.module.min.js +2 -0
- package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
- package/dist/chunk-chunk-Z5KXAVQD.module.min.js +2 -0
- package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
- package/dist/chunk-chunk-ZLKRTF5N.module.min.js +2 -0
- package/dist/chunk-chunk-ZTNVDWAK.module.min.js +2 -0
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
- package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
- package/dist/components/server/staticSVGChrome.d.ts +3 -2
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
- package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
- package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -4
- package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
- package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
- package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
- package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
- package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e,t=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,l=(e,t,a,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of n(t))o.call(e,s)||s===a||r(e,s,{get:()=>t[s],enumerable:!(l=i(t,s))||l.enumerable});return e},s={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(s,{BigNumber:()=>E,BigNumberDefault:()=>B,buildFormatter:()=>N,buildSparklinePath:()=>D,colorForLevel:()=>M,formatDeltaPercent:()=>$,formatDuration:()=>S,formatSignedDelta:()=>j,resolveThreshold:()=>z}),module.exports=(e=s,l(r({},"__esModule",{value:!0}),e));var u=require("react"),c=((e,i,n)=>(n=null!=e?t(a(e)):{},l(e&&e.__esModule?n:r(n,"default",{value:e,enumerable:!0}),e)))(require("react")),m=require("react/jsx-runtime");function d({componentName:e,message:t,diagnosticHint:r,width:i,height:n}){return(0,m.jsx)("div",{role:"alert",style:{width:i,height:Math.max(n,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:(0,m.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[(0,m.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),(0,m.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),r&&(0,m.jsx)("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:r})]})})}var h=require("react/jsx-runtime"),b=class extends c.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:(0,h.jsx)(d,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},f=require("react/jsx-runtime");function p({componentName:e,width:t,height:r,children:i}){return(0,f.jsx)(b,{fallback:i=>(0,f.jsx)(d,{componentName:e,message:i.message,width:t,height:r}),children:i})}"undefined"!=typeof process&&process;var g=require("react");var x=require("react"),v=()=>()=>{},y=()=>!1,w=()=>!0;function N(e,t={}){if("function"==typeof e)return e;const r=t.locale??"en-US";if("currency"===e){const e=t.precision??2,i=new Intl.NumberFormat(r,{style:"currency",currency:t.currency??"USD",maximumFractionDigits:e,minimumFractionDigits:e});return e=>i.format(e)}if("percent"===e){const e=new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("compact"===e){const e=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("duration"===e)return e=>S(e);const i=new Intl.NumberFormat(r,{notation:t.notation??"standard",maximumFractionDigits:t.precision??0,minimumFractionDigits:0});return e=>i.format(e)}function S(e){if(!Number.isFinite(e))return e+"";const t=0>e?"-":"",r=Math.abs(e);if(1e3>r)return`${t}${Math.round(r)}ms`;const i=r/1e3;if(60>i)return`${t}${n=i,Math.round(100*n)/100+""}s`;var n;const a=i/60;if(60>a){const e=Math.floor(a),r=Math.round(i-60*e);return 0===r?`${t}${e}m`:`${t}${e}m ${r}s`}const o=a/60;if(24>o){const e=Math.floor(o),r=Math.round(a-60*e);return 0===r?`${t}${e}h`:`${t}${e}h ${r}m`}const l=Math.floor(o/24),s=Math.round(o-24*l);return 0===s?`${t}${l}d`:`${t}${l}d ${s}h`}function F(e,t,r){return`${t??""}${e}${r??""}`}function j(e,t){return Number.isFinite(e)?0===e?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}function $(e,t,r="en-US",i=1){if(!Number.isFinite(e)||!Number.isFinite(t))return null;if(0===e)return null;const n=(t-e)/Math.abs(e);return new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:i,minimumFractionDigits:0,signDisplay:"exceptZero"}).format(n)}var _=require("react");function z(e,t){if(!t||0===t.length)return null;if(!Number.isFinite(e))return null;const r=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at);let i=null;for(const t of r){if(t.at>e)break;i=t}return i}function M(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}function D(e,t){const r=t.padding??1;if(0===e.length)return{line:"",area:"",points:[]};if(1===e.length){const e=t.width/2,r=t.height/2;return{line:`M${e},${r}`,area:"",points:[{x:e,y:r}]}}const i=t.yMin??e.reduce((e,t)=>Number.isFinite(t)&&e>t?t:e,1/0),n=(t.yMax??e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,-1/0))-i||1,a=Math.max(0,t.width-2*r),o=Math.max(0,t.height-2*r),l=1===e.length?0:a/(e.length-1),s=[];let u="";for(let t=0;e.length>t;t++){const a=e[t];if(!Number.isFinite(a))continue;const c=r+t*l,m=r+o-(a-i)/n*o;u+=`${0===s.length?"M":"L"}${c.toFixed(2)},${m.toFixed(2)}`,s.push({x:c,y:m})}if(0===s.length)return{line:"",area:"",points:[]};const c=s[0],m=r+o;return{line:u,area:`${u} L${s[s.length-1].x.toFixed(2)},${m.toFixed(2)} L${c.x.toFixed(2)},${m.toFixed(2)} Z`,points:s}}var C=require("react/jsx-runtime"),k={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}};function I(e,t,r){return void 0===e?r:"function"==typeof e?e(t):e}function R(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function L(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}var T=(0,u.forwardRef)((e,t)=>{const{value:r,label:i,caption:n,format:a,locale:o,currency:l,precision:s,prefix:c,suffix:m,unit:d,comparison:h,target:b,delta:f,deltaFormat:S,showDeltaPercent:$,direction:D,sentiment:T,thresholds:E,windowSize:B=60,mode:q="tile",align:H,width:O,height:W,padding:V,emphasis:A,color:U,background:Z,borderColor:X,borderRadius:Y,className:G,style:J,animate:K,stalenessThreshold:Q,staleLabel:ee,headerSlot:te,valueSlot:re,deltaSlot:ie,trendSlot:ne,chartSlot:ae,chartSize:oe,footerSlot:le,onClick:se,onObservation:ue,chartId:ce,description:me,summary:de,loading:he,loadingContent:be,emptyContent:fe}=e,pe=k[q]??k.tile,ge=H??pe.align,xe=O??pe.width,ve=W??pe.height,ye=function(){const[e,t]=(0,g.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,g.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),function(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const r=e;return r.addListener(t),()=>r.removeListener(t)}(e,e=>t(e.matches))},[]),e}(),we=function(){const e=(0,x.useSyncExternalStore)(v,y,w);return(0,x.useRef)(e).current}(),[Ne,Se]=(0,u.useState)([]),[Fe,je]=(0,u.useState)(null),[$e,_e]=(0,u.useState)(null),[ze,Me]=(0,u.useState)(null),De=(0,u.useRef)([]),Ce=(0,u.useRef)(null),ke=(0,u.useRef)(r);(0,u.useEffect)(()=>{ke.current=r},[r]);const Ie=(0,u.useRef)(B);(0,u.useEffect)(()=>{Ie.current=B},[B]);const Re=(0,u.useCallback)(e=>{const t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},r="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:r}},[]),Le=(0,u.useCallback)(e=>{if(0===e.length)return;const t=Ie.current,r=e.map(Re);let i=De.current.concat(r);i.length>t&&(i=i.slice(i.length-t)),De.current=i;const n=r[r.length-1];Ce.current=n.value,Se(i),je(n.value);for(let e=r.length-1;e>=0;e--){const t=r[e].comparison;if(null!=t){_e(t);break}}Me(n.time)},[Re]),Te=(0,u.useCallback)(e=>Le([e]),[Le]);(0,u.useImperativeHandle)(t,()=>({push:e=>Te(e),pushMany:e=>Le(e),clear:()=>{De.current=[],Ce.current=null,Se([]),je(null),_e(null),Me(null)},getValue:()=>Ce.current??(Number.isFinite(ke.current)?ke.current:null),getData:()=>De.current.slice()}),[Te,Le]);const Ee=Fe??r,Be=null==Ee||"number"!=typeof Ee||!Number.isFinite(Ee),Pe=(0,u.useMemo)(()=>N(a??"number",{locale:o,currency:l,precision:s}),[a,o,l,s]),qe=(0,u.useMemo)(()=>N(S??a??"number",{locale:o,currency:l,precision:null==S&&null==a?0:s}),[S,a,o,l,s]),He=K??!1,Oe=("object"!=typeof He||!1!==He.intro)&&!!He,We=Number.isFinite(Ee)?Ee:0,Ve=function(e,t,r,i=e){const[n,a]=(0,u.useState)(()=>i),o=(0,u.useRef)(i),l=(0,u.useRef)(null),s=(0,u.useRef)(e),c=(0,u.useRef)(0),m=!!t,d="object"==typeof t?t.duration:void 0,h="number"==typeof d&&Number.isFinite(d)?Math.max(0,d):300,b="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",f=(0,u.useRef)(e);return(0,u.useEffect)(()=>{const t=e=>{o.current=e,a(e)};if(!Number.isFinite(e))return void t(e);if(!m||r)return void t(e);if(0===h)return void t(e);s.current=o.current,f.current=e,c.current="undefined"!=typeof performance?performance.now():Date.now();const i="linear"===b?e=>e:e=>1-Math.pow(1-e,3),n=e=>{const r=Math.min(1,(e-c.current)/h),a=i(r);t(s.current+(f.current-s.current)*a),1>r?l.current=requestAnimationFrame(n):(l.current=null,t(f.current))};return l.current=requestAnimationFrame(n),()=>{null!=l.current&&cancelAnimationFrame(l.current),l.current=null}},[m,h,b,r,e]),n}(We,He,ye,(0,u.useRef)(!Oe||ye||we?We:0).current),Ae=He?Ve:Number.isFinite(Ee)?Ee:0,Ue=(0,u.useMemo)(()=>z(Number.isFinite(Ee)?Ee:NaN,E),[Ee,E]),Ze=Ue?Ue.level:"neutral",Xe=U??M(Ze,Ue?.color),Ye=$e??h?.value??null,Ge=null!=f?f:null!=Ye&&Number.isFinite(Ee)?Ee-Ye:null,Je=function(e,t,r){if(r&&"auto"!==r)return r;if(null==e||0===e||!Number.isFinite(e))return"neutral";const i=t??"higher-is-better";return"neutral"===i?"neutral":("higher-is-better"===i?e>0:0>e)?"positive":"negative"}(Ge,h?.direction??b?.direction??D,T),Ke=null!=Ge&&Number.isFinite(Ge)?j(Ge,qe):null,Qe=(0,u.useMemo)(()=>new Intl.NumberFormat(o??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[o]),et=null!=Ye&&Number.isFinite(Ee)&&($??1)&&0!==Ye?Qe.format((Ee-Ye)/Math.abs(Ye)):null,tt=function({target:e,value:t,format:r,locale:i,currency:n,precision:a}){const o=(0,_.useMemo)(()=>new Intl.NumberFormat(i??"en-US",{style:"percent",maximumFractionDigits:0}),[i]),l=(0,_.useMemo)(()=>N(e?.format??r??"number",{locale:i,currency:n,precision:a}),[e?.format,r,i,n,a]);return(0,_.useMemo)(()=>{if(!e||!Number.isFinite(e.value))return null;const r="number"==typeof t&&Number.isFinite(t)&&0!==e.value?o.format(t/e.value):null,i=l(e.value);return{label:e.label,percent:r,formattedValue:i,text:r?e.label?`${r} of ${e.label} (${i})`:`${r} of ${i}`:e.label?`target ${e.label} (${i})`:"target "+i}},[e,t,l,o])}({target:b,value:Ee,format:a,locale:o,currency:l,precision:s}),rt=tt?.percent??null,it=tt?.text??null,nt=function(e,t){const[r,i]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!t||null==e)return void i(!1);const r=()=>{i(Date.now()-e>=t)};r();const n=setInterval(r,Math.max(250,Math.floor(t/4)));return()=>clearInterval(n)},[e,t]),r}(ze,Q),at=Number.isFinite(Ae)?F(Pe(Ae),c,m):"",ot={value:Be?null:Ee,formattedValue:at,level:Ze,color:Xe,delta:Ge,deltaFormatted:Ke,deltaPercent:et,sentiment:Je,isStale:nt,pushBuffer:Ne},lt=me??function(e){const t=[];if(e.label&&t.push(e.label+":"),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){const r=e.delta,i=null!=r&&Number.isFinite(r)&&0!==r?r>0?"up":"down":"change";t.push(`${i} ${e.deltaFormatted}${e.deltaPercent?` (${e.deltaPercent})`:""}${e.comparisonLabel?" from "+e.comparisonLabel:""}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:i,formattedValue:Number.isFinite(Ee)?F(Pe(Ee),c,m):"",unit:d,comparisonLabel:h?.label,delta:Ge,deltaFormatted:Ke,deltaPercent:et,targetText:it,thresholdLabel:Ue?.label,stale:nt,staleLabel:ee}),st="number"==typeof V?{top:V,right:V,bottom:V,left:V}:{...pe.padding,...V??{}},ut="end"===ge?"flex-end":"center"===ge?"center":"start"===ge?"flex-start":"inherit",ct={position:"relative",boxSizing:"border-box",width:xe,height:ve,padding:`${st.top}px ${st.right}px ${st.bottom}px ${st.left}px`,background:Z??pe.background,border:pe.border?"1px solid "+(X??"var(--semiotic-border, #e2e2e2)"):void 0,borderRadius:"number"==typeof Y?Y+"px":Y??"var(--semiotic-border-radius, 8px)",display:"inline"===q?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===ut?void 0:ut,textAlign:ge,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:nt?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===A?"span 2":void 0,cursor:se?"pointer":void 0,...J},mt=(0,u.useCallback)(e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,n={value:Be?NaN:Ee,level:Ze,delta:Ge};se&&se(n,{x:r,y:i}),ue&&ue({type:"click",datum:n,x:r,y:i,chartType:"BigNumber",chartId:ce,timestamp:Date.now()})},[se,ue,ce,Be,Ee,Ze,Ge]),dt="inline"===q?"span":"div",ht=["semiotic-bignumber","semiotic-bignumber--mode-"+q,"semiotic-bignumber--level-"+Ze,"semiotic-bignumber--sentiment-"+Je,nt?"semiotic-bignumber--stale":null,G].filter(Boolean).join(" "),bt="positive"===Je?"up":"negative"===Je?"down":"flat";if(he){const e="number"==typeof xe?xe:280,t="number"==typeof ve?ve:160;return(0,C.jsx)(dt,{role:"status","aria-live":"polite","aria-busy":"true",className:ht+" semiotic-bignumber--loading",style:{...ct,opacity:1},children:be??(0,C.jsx)(P,{width:e,height:t,mode:q})})}return Be?!1===fe?null:(0,C.jsx)(dt,{role:"status","aria-label":i?i+": no value":"no value",className:ht+" semiotic-bignumber--empty",style:{...ct,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:fe??"—"}):(0,C.jsx)(p,{componentName:"BigNumber",width:"number"==typeof xe?xe:280,height:"number"==typeof ve?ve:160,children:(0,C.jsxs)(dt,{role:"group","aria-label":lt,"data-chart":"BigNumber","data-mode":q,"data-level":Ze,"data-stale":nt?"true":void 0,"data-sentiment":Je,className:ht,style:ct,onClick:se||ue?mt:void 0,children:[pe.showHeader&&(i||n||te)?(0,C.jsx)("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:pe.showChart&&null!=ae?(oe??pe.chartSize)+8:0},children:I(te,ot,(0,C.jsxs)(C.Fragment,{children:[i?(0,C.jsx)("span",{className:"semiotic-bignumber__label",style:{fontSize:pe.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:i}):null,n?(0,C.jsx)("span",{className:"semiotic-bignumber__caption",style:{fontSize:pe.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:n}):null]}))}):null,I(re,ot,(0,C.jsxs)(dt,{className:"semiotic-bignumber__value semiotic-bignumber__value--"+Ze,style:{display:"inline"===q?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:Xe,fontSize:pe.valueSize||void 0,lineHeight:1.05},children:[(0,C.jsx)("span",{className:"semiotic-bignumber__value-text",children:at}),d?(0,C.jsx)("span",{className:"semiotic-bignumber__unit",style:{fontSize:pe.valueSize?Math.max(11,Math.round(.32*pe.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:d}):null]})),pe.showDelta&&(Ke||tt||h)?(0,C.jsx)(dt,{className:"semiotic-bignumber__delta semiotic-bignumber__delta--"+bt,style:{display:"inline"===q?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===q?0:6,fontSize:pe.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:I(ie,ot,(0,C.jsxs)(C.Fragment,{children:[Ke?(0,C.jsxs)("span",{className:"semiotic-bignumber__delta-row semiotic-bignumber__delta-row--"+bt,style:{display:"inline-flex",alignItems:"center",gap:4,color:R(Je),fontWeight:600},children:[(0,C.jsx)("span",{"aria-hidden":"true",className:"semiotic-bignumber__arrow semiotic-bignumber__arrow--"+bt,children:L(Je)}),(0,C.jsx)("span",{className:"semiotic-bignumber__delta-amount",children:Ke}),et?(0,C.jsxs)("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",et,")"]}):null]}):null,h?.label?(0,C.jsx)("span",{className:"semiotic-bignumber__comparison-label",children:h.label}):null,tt?(0,C.jsxs)("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[Ke||h?.label?(0,C.jsx)("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,(0,C.jsx)("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:rt}),(0,C.jsxs)("span",{className:"semiotic-bignumber__target-value",children:["of ",tt.formattedValue,tt.label?" "+tt.label:""]})]}):null]}))}):null,pe.showChart&&null!=ae?(0,C.jsx)("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:st.top,right:st.right,width:oe??pe.chartSize,height:oe??pe.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,C.jsx)("div",{style:{pointerEvents:"auto",lineHeight:0},children:I(ae,ot,null)})}):null,pe.showTrend&&null!=ne?(0,C.jsx)("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:st.left,right:st.right,bottom:st.bottom+(null!=le?28:0)},children:I(ne,ot,null)}):null,null!=le?(0,C.jsx)(dt,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:st.left,right:st.right,bottom:st.bottom,fontSize:pe.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:I(le,ot,null)}):null,de?(0,C.jsx)("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:de}):null]})})});T.displayName="BigNumber";var E=T,B=T;function P(e){const t=Math.floor(.45*e.width),r=Math.floor(.6*e.width),i=(e,t)=>(0,C.jsx)("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return(0,C.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?i(t,10):null,i(r,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?i(Math.floor(.35*e.width),8):null]})}
|
|
2
|
+
var e,t=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,l=(e,t,a,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of n(t))o.call(e,s)||s===a||r(e,s,{get:()=>t[s],enumerable:!(l=i(t,s))||l.enumerable});return e},s={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(s,{BigNumber:()=>E,BigNumberDefault:()=>B,buildFormatter:()=>N,buildSparklinePath:()=>D,colorForLevel:()=>M,formatDeltaPercent:()=>$,formatDuration:()=>S,formatSignedDelta:()=>j,resolveThreshold:()=>z}),module.exports=(e=s,l(r({},"__esModule",{value:!0}),e));var u=require("react"),c=((e,i,n)=>(n=null!=e?t(a(e)):{},l(e&&e.__esModule?n:r(n,"default",{value:e,enumerable:!0}),e)))(require("react")),m=require("react/jsx-runtime");function d({componentName:e,message:t,diagnosticHint:r,width:i,height:n}){return(0,m.jsx)("div",{role:"alert",style:{width:i,height:Math.max(n,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:(0,m.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[(0,m.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),(0,m.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),r&&(0,m.jsx)("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:r})]})})}var h=require("react/jsx-runtime"),b=class extends c.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:(0,h.jsx)(d,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},f=require("react/jsx-runtime");function p({componentName:e,width:t,height:r,children:i}){return(0,f.jsx)(b,{fallback:i=>(0,f.jsx)(d,{componentName:e,message:i.message,width:t,height:r}),children:i})}"undefined"!=typeof process&&process;var g=require("react");var x=require("react"),v=()=>()=>{},y=()=>!1,w=()=>!0;function N(e,t={}){if("function"==typeof e)return e;const r=t.locale??"en-US";if("currency"===e){const e=t.precision??2,i=new Intl.NumberFormat(r,{style:"currency",currency:t.currency??"USD",maximumFractionDigits:e,minimumFractionDigits:e});return e=>i.format(e)}if("percent"===e){const e=new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("compact"===e){const e=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("duration"===e)return e=>S(e);const i=new Intl.NumberFormat(r,{notation:t.notation??"standard",maximumFractionDigits:t.precision??0,minimumFractionDigits:0});return e=>i.format(e)}function S(e){if(!Number.isFinite(e))return e+"";const t=0>e?"-":"",r=Math.abs(e);if(1e3>r)return`${t}${Math.round(r)}ms`;const i=r/1e3;if(60>i)return`${t}${n=i,Math.round(100*n)/100+""}s`;var n;const a=i/60;if(60>a){const e=Math.floor(a),r=Math.round(i-60*e);return 0===r?`${t}${e}m`:`${t}${e}m ${r}s`}const o=a/60;if(24>o){const e=Math.floor(o),r=Math.round(a-60*e);return 0===r?`${t}${e}h`:`${t}${e}h ${r}m`}const l=Math.floor(o/24),s=Math.round(o-24*l);return 0===s?`${t}${l}d`:`${t}${l}d ${s}h`}function F(e,t,r){return`${t??""}${e}${r??""}`}function j(e,t){return Number.isFinite(e)?0===e?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}function $(e,t,r="en-US",i=1){if(!Number.isFinite(e)||!Number.isFinite(t))return null;if(0===e)return null;const n=(t-e)/Math.abs(e);return new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:i,minimumFractionDigits:0,signDisplay:"exceptZero"}).format(n)}var _=require("react");function z(e,t){if(!t||0===t.length)return null;if(!Number.isFinite(e))return null;const r=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at);let i=null;for(const t of r){if(t.at>e)break;i=t}return i}function M(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}function D(e,t){const r=t.padding??1;if(0===e.length)return{line:"",area:"",points:[]};if(1===e.length){const e=t.width/2,r=t.height/2;return{line:`M${e},${r}`,area:"",points:[{x:e,y:r}]}}const i=t.yMin??e.reduce((e,t)=>Number.isFinite(t)&&e>t?t:e,1/0),n=(t.yMax??e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,-1/0))-i||1,a=Math.max(0,t.width-2*r),o=Math.max(0,t.height-2*r),l=1===e.length?0:a/(e.length-1),s=[];let u="";for(let t=0;e.length>t;t++){const a=e[t];if(!Number.isFinite(a))continue;const c=r+t*l,m=r+o-(a-i)/n*o;u+=`${0===s.length?"M":"L"}${c.toFixed(2)},${m.toFixed(2)}`,s.push({x:c,y:m})}if(0===s.length)return{line:"",area:"",points:[]};const c=s[0],m=r+o;return{line:u,area:`${u} L${s[s.length-1].x.toFixed(2)},${m.toFixed(2)} L${c.x.toFixed(2)},${m.toFixed(2)} Z`,points:s}}var C=require("react/jsx-runtime"),k={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}};function I(e,t,r){return void 0===e?r:"function"==typeof e?e(t):e}function R(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function L(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}var T=(0,u.forwardRef)((e,t)=>{const{value:r,label:i,caption:n,format:a,locale:o,currency:l,precision:s,prefix:c,suffix:m,unit:d,comparison:h,target:b,delta:f,deltaFormat:S,showDeltaPercent:$,direction:D,sentiment:T,thresholds:E,windowSize:B=60,mode:q="tile",align:H,width:O,height:W,padding:V,emphasis:A,color:U,background:Z,borderColor:X,borderRadius:Y,className:G,style:J,animate:K,stalenessThreshold:Q,staleLabel:ee,headerSlot:te,valueSlot:re,deltaSlot:ie,trendSlot:ne,chartSlot:ae,chartSize:oe,footerSlot:le,onClick:se,onObservation:ue,chartId:ce,description:me,summary:de,loading:he,loadingContent:be,emptyContent:fe}=e,pe=k[q]??k.tile,ge=H??pe.align,xe=O??pe.width,ve=W??pe.height,ye=function(){const[e,t]=(0,g.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,g.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),function(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const r=e;return r.addListener(t),()=>r.removeListener(t)}(e,e=>t(e.matches))},[]),e}(),we=function(){const e=(0,x.useSyncExternalStore)(v,y,w);return(0,x.useRef)(e).current}(),[Ne,Se]=(0,u.useState)([]),[Fe,je]=(0,u.useState)(null),[$e,_e]=(0,u.useState)(null),[ze,Me]=(0,u.useState)(null),De=(0,u.useRef)([]),Ce=(0,u.useRef)(null),ke=(0,u.useRef)(r);(0,u.useEffect)(()=>{ke.current=r},[r]);const Ie=(0,u.useRef)(B);(0,u.useEffect)(()=>{Ie.current=B},[B]);const Re=(0,u.useCallback)(e=>{const t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},r="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:r}},[]),Le=(0,u.useCallback)(e=>{if(0===e.length)return;const t=Ie.current,r=e.map(Re);let i=De.current.concat(r);i.length>t&&(i=i.slice(i.length-t)),De.current=i;const n=r[r.length-1];Ce.current=n.value,Se(i),je(n.value);for(let e=r.length-1;e>=0;e--){const t=r[e].comparison;if(null!=t){_e(t);break}}Me(n.time)},[Re]),Te=(0,u.useCallback)(e=>Le([e]),[Le]);(0,u.useImperativeHandle)(t,()=>({push:e=>Te(e),pushMany:e=>Le(e),clear:()=>{De.current=[],Ce.current=null,Se([]),je(null),_e(null),Me(null)},getValue:()=>Ce.current??(Number.isFinite(ke.current)?ke.current:null),getData:()=>De.current.slice()}),[Te,Le]);const Ee=Fe??r,Be=null==Ee||"number"!=typeof Ee||!Number.isFinite(Ee),Pe=(0,u.useMemo)(()=>N(a??"number",{locale:o,currency:l,precision:s}),[a,o,l,s]),qe=(0,u.useMemo)(()=>N(S??a??"number",{locale:o,currency:l,precision:null==S&&null==a?0:s}),[S,a,o,l,s]),He=K??!1,Oe=("object"!=typeof He||!1!==He.intro)&&!!He,We=Number.isFinite(Ee)?Ee:0,Ve=function(e,t,r,i=e){const[n,a]=(0,u.useState)(()=>i),o=(0,u.useRef)(i),l=(0,u.useRef)(null),s=(0,u.useRef)(e),c=(0,u.useRef)(0),m=!!t,d="object"==typeof t?t.duration:void 0,h="number"==typeof d&&Number.isFinite(d)?Math.max(0,d):300,b="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",f=(0,u.useRef)(e);return(0,u.useEffect)(()=>{const t=e=>{o.current=e,a(e)};if(!Number.isFinite(e))return void t(e);if(!m||r)return void t(e);if(0===h)return void t(e);s.current=o.current,f.current=e,c.current="undefined"!=typeof performance?performance.now():Date.now();const i="linear"===b?e=>e:e=>1-Math.pow(1-e,3),n=e=>{const r=Math.min(1,(e-c.current)/h),a=i(r);t(s.current+(f.current-s.current)*a),1>r?l.current=requestAnimationFrame(n):(l.current=null,t(f.current))};return l.current=requestAnimationFrame(n),()=>{null!=l.current&&cancelAnimationFrame(l.current),l.current=null}},[m,h,b,r,e]),n}(We,He,ye,(0,u.useRef)(!Oe||ye||we?We:0).current),Ae=He?Ve:Number.isFinite(Ee)?Ee:0,Ue=(0,u.useMemo)(()=>z(Number.isFinite(Ee)?Ee:NaN,E),[Ee,E]),Ze=Ue?Ue.level:"neutral",Xe=U??M(Ze,Ue?.color),Ye=$e??h?.value??null,Ge=null!=f?f:null!=Ye&&Number.isFinite(Ee)?Ee-Ye:null,Je=function(e,t,r){if(r&&"auto"!==r)return r;if(null==e||0===e||!Number.isFinite(e))return"neutral";const i=t??"higher-is-better";return"neutral"===i?"neutral":("higher-is-better"===i?e>0:0>e)?"positive":"negative"}(Ge,h?.direction??b?.direction??D,T),Ke=null!=Ge&&Number.isFinite(Ge)?j(Ge,qe):null,Qe=(0,u.useMemo)(()=>new Intl.NumberFormat(o??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[o]),et=null!=Ye&&Number.isFinite(Ee)&&($??1)&&0!==Ye?Qe.format((Ee-Ye)/Math.abs(Ye)):null,tt=function({target:e,value:t,format:r,locale:i,currency:n,precision:a}){const o=(0,_.useMemo)(()=>new Intl.NumberFormat(i??"en-US",{style:"percent",maximumFractionDigits:0}),[i]),l=(0,_.useMemo)(()=>N(e?.format??r??"number",{locale:i,currency:n,precision:a}),[e?.format,r,i,n,a]);return(0,_.useMemo)(()=>{if(!e||!Number.isFinite(e.value))return null;const r="number"==typeof t&&Number.isFinite(t)&&0!==e.value?o.format(t/e.value):null,i=l(e.value);return{label:e.label,percent:r,formattedValue:i,text:r?e.label?`${r} of ${e.label} (${i})`:`${r} of ${i}`:e.label?`target ${e.label} (${i})`:"target "+i}},[e,t,l,o])}({target:b,value:Ee,format:a,locale:o,currency:l,precision:s}),rt=tt?.percent??null,it=tt?.text??null,nt=function(e,t){const[r,i]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!t||null==e)return void i(!1);const r=()=>{i(Date.now()-e>=t)};r();const n=setInterval(r,Math.max(250,Math.floor(t/4)));return()=>clearInterval(n)},[e,t]),r}(ze,Q),at=Number.isFinite(Ae)?F(Pe(Ae),c,m):"",ot={value:Be?null:Ee,formattedValue:at,level:Ze,color:Xe,delta:Ge,deltaFormatted:Ke,deltaPercent:et,sentiment:Je,isStale:nt,pushBuffer:Ne},lt=me??function(e){const t=[];if(e.label&&t.push(e.label+":"),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){const r=e.delta,i=null!=r&&Number.isFinite(r)&&0!==r?r>0?"up":"down":"change";t.push(`${i} ${e.deltaFormatted}${e.deltaPercent?` (${e.deltaPercent})`:""}${e.comparisonLabel?" from "+e.comparisonLabel:""}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:i,formattedValue:Number.isFinite(Ee)?F(Pe(Ee),c,m):"",unit:d,comparisonLabel:h?.label,delta:Ge,deltaFormatted:Ke,deltaPercent:et,targetText:it,thresholdLabel:Ue?.label,stale:nt,staleLabel:ee}),st="number"==typeof V?{top:V,right:V,bottom:V,left:V}:{...pe.padding,...V??{}},ut="end"===ge?"flex-end":"center"===ge?"center":"start"===ge?"flex-start":"inherit",ct={position:"relative",boxSizing:"border-box",width:xe,height:ve,padding:`${st.top}px ${st.right}px ${st.bottom}px ${st.left}px`,background:Z??pe.background,border:pe.border?"1px solid "+(X??"var(--semiotic-border, #e2e2e2)"):void 0,borderRadius:"number"==typeof Y?Y+"px":Y??"var(--semiotic-border-radius, 8px)",display:"inline"===q?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===ut?void 0:ut,textAlign:ge,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:nt?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===A?"span 2":void 0,cursor:se?"pointer":void 0,...J},mt=(0,u.useCallback)(e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,n={value:Be?NaN:Ee,level:Ze,delta:Ge};se&&se(n,{x:r,y:i}),ue&&ue({type:"click",datum:n,x:r,y:i,chartType:"BigNumber",chartId:ce,timestamp:Date.now()})},[se,ue,ce,Be,Ee,Ze,Ge]),dt="inline"===q?"span":"div",ht=["semiotic-bignumber","semiotic-bignumber--mode-"+q,"semiotic-bignumber--level-"+Ze,"semiotic-bignumber--sentiment-"+Je,nt?"semiotic-bignumber--stale":null,G].filter(Boolean).join(" "),bt="positive"===Je?"up":"negative"===Je?"down":"flat";if(he){const e="number"==typeof xe?xe:280,t="number"==typeof ve?ve:160;return(0,C.jsx)(dt,{role:"status","aria-live":"polite","aria-busy":"true",className:ht+" semiotic-bignumber--loading",style:{...ct,opacity:1},children:be??(0,C.jsx)(P,{width:e,height:t,mode:q})})}return Be?!1===fe?null:(0,C.jsx)(dt,{role:"status","aria-label":i?i+": no value":"no value",className:ht+" semiotic-bignumber--empty",style:{...ct,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:fe??"—"}):(0,C.jsx)(p,{componentName:"BigNumber",width:"number"==typeof xe?xe:280,height:"number"==typeof ve?ve:160,children:(0,C.jsxs)(dt,{role:"group","aria-label":lt,"data-chart":"BigNumber","data-mode":q,"data-level":Ze,"data-stale":nt?"true":void 0,"data-sentiment":Je,className:ht,style:ct,onClick:se||ue?mt:void 0,children:[pe.showHeader&&(i||n||te)?(0,C.jsx)("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:pe.showChart&&null!=ae?(oe??pe.chartSize)+8:0},children:I(te,ot,(0,C.jsxs)(C.Fragment,{children:[i?(0,C.jsx)("span",{className:"semiotic-bignumber__label",style:{fontSize:pe.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:i}):null,n?(0,C.jsx)("span",{className:"semiotic-bignumber__caption",style:{fontSize:pe.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:n}):null]}))}):null,I(re,ot,(0,C.jsxs)(dt,{className:"semiotic-bignumber__value semiotic-bignumber__value--"+Ze,style:{display:"inline"===q?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:Xe,fontSize:pe.valueSize||void 0,lineHeight:1.05},children:[(0,C.jsx)("span",{className:"semiotic-bignumber__value-text",children:at}),d?(0,C.jsx)("span",{className:"semiotic-bignumber__unit",style:{fontSize:pe.valueSize?Math.max(11,Math.round(.32*pe.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:d}):null]})),pe.showDelta&&(Ke||tt||h)?(0,C.jsx)(dt,{className:"semiotic-bignumber__delta semiotic-bignumber__delta--"+bt,style:{display:"inline"===q?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===q?0:6,fontSize:pe.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:I(ie,ot,(0,C.jsxs)(C.Fragment,{children:[Ke?(0,C.jsxs)("span",{className:"semiotic-bignumber__delta-row semiotic-bignumber__delta-row--"+bt,style:{display:"inline-flex",alignItems:"center",gap:4,color:R(Je),fontWeight:600},children:[(0,C.jsx)("span",{"aria-hidden":"true",className:"semiotic-bignumber__arrow semiotic-bignumber__arrow--"+bt,children:L(Je)}),(0,C.jsx)("span",{className:"semiotic-bignumber__delta-amount",children:Ke}),et?(0,C.jsxs)("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",et,")"]}):null]}):null,h?.label?(0,C.jsx)("span",{className:"semiotic-bignumber__comparison-label",children:h.label}):null,tt?(0,C.jsxs)("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[Ke||h?.label?(0,C.jsx)("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,(0,C.jsx)("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:rt}),(0,C.jsxs)("span",{className:"semiotic-bignumber__target-value",children:["of ",tt.formattedValue,tt.label?" "+tt.label:""]})]}):null]}))}):null,pe.showChart&&null!=ae?(0,C.jsx)("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:st.top,right:st.right,width:oe??pe.chartSize,height:oe??pe.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,C.jsx)("div",{style:{pointerEvents:"auto",lineHeight:0},children:I(ae,ot,null)})}):null,pe.showTrend&&null!=ne?(0,C.jsx)("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:st.left,right:st.right,bottom:st.bottom+(null!=le?28:0)},children:I(ne,ot,null)}):null,null!=le?(0,C.jsx)(dt,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:st.left,right:st.right,bottom:st.bottom,fontSize:pe.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:I(le,ot,null)}):null,de?(0,C.jsx)("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:de}):null]})})});T.displayName="BigNumber";var E=T,B=T;function P(e){const t=Math.floor(.45*e.width),r=Math.floor(.6*e.width),i=(e,t)=>(0,C.jsx)("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return(0,C.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?i(t,10):null,i(r,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?i(Math.floor(.35*e.width),8):null]})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{forwardRef as e,useCallback as t,useEffect as i,useImperativeHandle as n,useMemo as r,useRef as a,useState as o}from"react";import*as l from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function u({componentName:e,message:t,diagnosticHint:i,width:n,height:r}){return s("div",{role:"alert",style:{width:n,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:c("div",{style:{textAlign:"center",maxWidth:400},children:[s("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),s("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),i&&s("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:i})]})})}import{jsx as m}from"react/jsx-runtime";var d=class extends l.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:m(u,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{jsx as h}from"react/jsx-runtime";function b({componentName:e,width:t,height:i,children:n}){return h(d,{fallback:n=>h(u,{componentName:e,message:n.message,width:t,height:i}),children:n})}"undefined"!=typeof process&&process;import{useState as p,useEffect as f}from"react";import{useEffect as g,useLayoutEffect as y,useRef as v,useState as x,useSyncExternalStore as w}from"react";var N=()=>()=>{},F=()=>!1,S=()=>!0;function $(e,t={}){if("function"==typeof e)return e;const i=t.locale??"en-US";if("currency"===e){const e=t.precision??2,n=new Intl.NumberFormat(i,{style:"currency",currency:t.currency??"USD",maximumFractionDigits:e,minimumFractionDigits:e});return e=>n.format(e)}if("percent"===e){const e=new Intl.NumberFormat(i,{style:"percent",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("compact"===e){const e=new Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("duration"===e)return e=>_(e);const n=new Intl.NumberFormat(i,{notation:t.notation??"standard",maximumFractionDigits:t.precision??0,minimumFractionDigits:0});return e=>n.format(e)}function _(e){if(!Number.isFinite(e))return e+"";const t=0>e?"-":"",i=Math.abs(e);if(1e3>i)return`${t}${Math.round(i)}ms`;const n=i/1e3;if(60>n)return`${t}${r=n,Math.round(100*r)/100+""}s`;var r;const a=n/60;if(60>a){const e=Math.floor(a),i=Math.round(n-60*e);return 0===i?`${t}${e}m`:`${t}${e}m ${i}s`}const o=a/60;if(24>o){const e=Math.floor(o),i=Math.round(a-60*e);return 0===i?`${t}${e}h`:`${t}${e}h ${i}m`}const l=Math.floor(o/24),s=Math.round(o-24*l);return 0===s?`${t}${l}d`:`${t}${l}d ${s}h`}function z(e,t,i){return`${t??""}${e}${i??""}`}function D(e,t){return Number.isFinite(e)?0===e?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}function M(e,t,i="en-US",n=1){if(!Number.isFinite(e)||!Number.isFinite(t))return null;if(0===e)return null;const r=(t-e)/Math.abs(e);return new Intl.NumberFormat(i,{style:"percent",maximumFractionDigits:n,minimumFractionDigits:0,signDisplay:"exceptZero"}).format(r)}import{useMemo as C}from"react";function I(e,t){if(!t||0===t.length)return null;if(!Number.isFinite(e))return null;const i=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at);let n=null;for(const t of i){if(t.at>e)break;n=t}return n}function j(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}function k(e,t){const i=t.padding??1;if(0===e.length)return{line:"",area:"",points:[]};if(1===e.length){const e=t.width/2,i=t.height/2;return{line:`M${e},${i}`,area:"",points:[{x:e,y:i}]}}const n=t.yMin??e.reduce((e,t)=>Number.isFinite(t)&&e>t?t:e,1/0),r=(t.yMax??e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,-1/0))-n||1,a=Math.max(0,t.width-2*i),o=Math.max(0,t.height-2*i),l=1===e.length?0:a/(e.length-1),s=[];let c="";for(let t=0;e.length>t;t++){const a=e[t];if(!Number.isFinite(a))continue;const u=i+t*l,m=i+o-(a-n)/r*o;c+=`${0===s.length?"M":"L"}${u.toFixed(2)},${m.toFixed(2)}`,s.push({x:u,y:m})}if(0===s.length)return{line:"",area:"",points:[]};const u=s[0],m=i+o;return{line:c,area:`${c} L${s[s.length-1].x.toFixed(2)},${m.toFixed(2)} L${u.x.toFixed(2)},${m.toFixed(2)} Z`,points:s}}import{Fragment as L,jsx as T,jsxs as B}from"react/jsx-runtime";var E={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}};function H(e,t,i){return void 0===e?i:"function"==typeof e?e(t):e}function W(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function R(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}var V=e((e,l)=>{const{value:s,label:c,caption:u,format:m,locale:d,currency:h,precision:g,prefix:y,suffix:x,unit:_,comparison:M,target:k,delta:V,deltaFormat:A,showDeltaPercent:P,direction:Z,sentiment:q,thresholds:O,windowSize:X=60,mode:Y="tile",align:G,width:J,height:K,padding:Q,emphasis:ee,color:te,background:ie,borderColor:ne,borderRadius:re,className:ae,style:oe,animate:le,stalenessThreshold:se,staleLabel:ce,headerSlot:ue,valueSlot:me,deltaSlot:de,trendSlot:he,chartSlot:be,chartSize:pe,footerSlot:fe,onClick:ge,onObservation:ye,chartId:ve,description:xe,summary:we,loading:Ne,loadingContent:Fe,emptyContent:Se}=e,$e=E[Y]??E.tile,_e=G??$e.align,ze=J??$e.width,De=K??$e.height,Me=function(){const[e,t]=p(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return f(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),function(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const i=e;return i.addListener(t),()=>i.removeListener(t)}(e,e=>t(e.matches))},[]),e}(),Ce=function(){const e=w(N,F,S);return v(e).current}(),[Ie,je]=o([]),[ke,Le]=o(null),[Te,Be]=o(null),[Ee,He]=o(null),We=a([]),Re=a(null),Ve=a(s);i(()=>{Ve.current=s},[s]);const Ae=a(X);i(()=>{Ae.current=X},[X]);const Pe=t(e=>{const t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},i="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:i}},[]),Ue=t(e=>{if(0===e.length)return;const t=Ae.current,i=e.map(Pe);let n=We.current.concat(i);n.length>t&&(n=n.slice(n.length-t)),We.current=n;const r=i[i.length-1];Re.current=r.value,je(n),Le(r.value);for(let e=i.length-1;e>=0;e--){const t=i[e].comparison;if(null!=t){Be(t);break}}He(r.time)},[Pe]),Ze=t(e=>Ue([e]),[Ue]);n(l,()=>({push:e=>Ze(e),pushMany:e=>Ue(e),clear:()=>{We.current=[],Re.current=null,je([]),Le(null),Be(null),He(null)},getValue:()=>Re.current??(Number.isFinite(Ve.current)?Ve.current:null),getData:()=>We.current.slice()}),[Ze,Ue]);const qe=ke??s,Oe=null==qe||"number"!=typeof qe||!Number.isFinite(qe),Xe=r(()=>$(m??"number",{locale:d,currency:h,precision:g}),[m,d,h,g]),Ye=r(()=>$(A??m??"number",{locale:d,currency:h,precision:null==A&&null==m?0:g}),[A,m,d,h,g]),Ge=le??!1,Je=("object"!=typeof Ge||!1!==Ge.intro)&&!!Ge,Ke=Number.isFinite(qe)?qe:0,Qe=function(e,t,n,r=e){const[l,s]=o(()=>r),c=a(r),u=a(null),m=a(e),d=a(0),h=!!t,b="object"==typeof t?t.duration:void 0,p="number"==typeof b&&Number.isFinite(b)?Math.max(0,b):300,f="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",g=a(e);return i(()=>{const t=e=>{c.current=e,s(e)};if(!Number.isFinite(e))return void t(e);if(!h||n)return void t(e);if(0===p)return void t(e);m.current=c.current,g.current=e,d.current="undefined"!=typeof performance?performance.now():Date.now();const i="linear"===f?e=>e:e=>1-Math.pow(1-e,3),r=e=>{const n=Math.min(1,(e-d.current)/p),a=i(n);t(m.current+(g.current-m.current)*a),1>n?u.current=requestAnimationFrame(r):(u.current=null,t(g.current))};return u.current=requestAnimationFrame(r),()=>{null!=u.current&&cancelAnimationFrame(u.current),u.current=null}},[h,p,f,n,e]),l}(Ke,Ge,Me,a(!Je||Me||Ce?Ke:0).current),et=Ge?Qe:Number.isFinite(qe)?qe:0,tt=r(()=>I(Number.isFinite(qe)?qe:NaN,O),[qe,O]),it=tt?tt.level:"neutral",nt=te??j(it,tt?.color),rt=Te??M?.value??null,at=null!=V?V:null!=rt&&Number.isFinite(qe)?qe-rt:null,ot=function(e,t,i){if(i&&"auto"!==i)return i;if(null==e||0===e||!Number.isFinite(e))return"neutral";const n=t??"higher-is-better";return"neutral"===n?"neutral":("higher-is-better"===n?e>0:0>e)?"positive":"negative"}(at,M?.direction??k?.direction??Z,q),lt=null!=at&&Number.isFinite(at)?D(at,Ye):null,st=r(()=>new Intl.NumberFormat(d??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[d]),ct=null!=rt&&Number.isFinite(qe)&&(P??1)&&0!==rt?st.format((qe-rt)/Math.abs(rt)):null,ut=function({target:e,value:t,format:i,locale:n,currency:r,precision:a}){const o=C(()=>new Intl.NumberFormat(n??"en-US",{style:"percent",maximumFractionDigits:0}),[n]),l=C(()=>$(e?.format??i??"number",{locale:n,currency:r,precision:a}),[e?.format,i,n,r,a]);return C(()=>{if(!e||!Number.isFinite(e.value))return null;const i="number"==typeof t&&Number.isFinite(t)&&0!==e.value?o.format(t/e.value):null,n=l(e.value);return{label:e.label,percent:i,formattedValue:n,text:i?e.label?`${i} of ${e.label} (${n})`:`${i} of ${n}`:e.label?`target ${e.label} (${n})`:"target "+n}},[e,t,l,o])}({target:k,value:qe,format:m,locale:d,currency:h,precision:g}),mt=ut?.percent??null,dt=ut?.text??null,ht=function(e,t){const[n,r]=o(!1);return i(()=>{if(!t||null==e)return void r(!1);const i=()=>{r(Date.now()-e>=t)};i();const n=setInterval(i,Math.max(250,Math.floor(t/4)));return()=>clearInterval(n)},[e,t]),n}(Ee,se),bt=Number.isFinite(et)?z(Xe(et),y,x):"",pt={value:Oe?null:qe,formattedValue:bt,level:it,color:nt,delta:at,deltaFormatted:lt,deltaPercent:ct,sentiment:ot,isStale:ht,pushBuffer:Ie},ft=xe??function(e){const t=[];if(e.label&&t.push(e.label+":"),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){const i=e.delta,n=null!=i&&Number.isFinite(i)&&0!==i?i>0?"up":"down":"change";t.push(`${n} ${e.deltaFormatted}${e.deltaPercent?` (${e.deltaPercent})`:""}${e.comparisonLabel?" from "+e.comparisonLabel:""}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:c,formattedValue:Number.isFinite(qe)?z(Xe(qe),y,x):"",unit:_,comparisonLabel:M?.label,delta:at,deltaFormatted:lt,deltaPercent:ct,targetText:dt,thresholdLabel:tt?.label,stale:ht,staleLabel:ce}),gt="number"==typeof Q?{top:Q,right:Q,bottom:Q,left:Q}:{...$e.padding,...Q??{}},yt="end"===_e?"flex-end":"center"===_e?"center":"start"===_e?"flex-start":"inherit",vt={position:"relative",boxSizing:"border-box",width:ze,height:De,padding:`${gt.top}px ${gt.right}px ${gt.bottom}px ${gt.left}px`,background:ie??$e.background,border:$e.border?"1px solid "+(ne??"var(--semiotic-border, #e2e2e2)"):void 0,borderRadius:"number"==typeof re?re+"px":re??"var(--semiotic-border-radius, 8px)",display:"inline"===Y?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===yt?void 0:yt,textAlign:_e,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:ht?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===ee?"span 2":void 0,cursor:ge?"pointer":void 0,...oe},xt=t(e=>{const t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,n=e.clientY-t.top,r={value:Oe?NaN:qe,level:it,delta:at};ge&&ge(r,{x:i,y:n}),ye&&ye({type:"click",datum:r,x:i,y:n,chartType:"BigNumber",chartId:ve,timestamp:Date.now()})},[ge,ye,ve,Oe,qe,it,at]),wt="inline"===Y?"span":"div",Nt=["semiotic-bignumber","semiotic-bignumber--mode-"+Y,"semiotic-bignumber--level-"+it,"semiotic-bignumber--sentiment-"+ot,ht?"semiotic-bignumber--stale":null,ae].filter(Boolean).join(" "),Ft="positive"===ot?"up":"negative"===ot?"down":"flat";if(Ne){const e="number"==typeof ze?ze:280,t="number"==typeof De?De:160;return T(wt,{role:"status","aria-live":"polite","aria-busy":"true",className:Nt+" semiotic-bignumber--loading",style:{...vt,opacity:1},children:Fe??T(U,{width:e,height:t,mode:Y})})}return Oe?!1===Se?null:T(wt,{role:"status","aria-label":c?c+": no value":"no value",className:Nt+" semiotic-bignumber--empty",style:{...vt,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:Se??"—"}):T(b,{componentName:"BigNumber",width:"number"==typeof ze?ze:280,height:"number"==typeof De?De:160,children:B(wt,{role:"group","aria-label":ft,"data-chart":"BigNumber","data-mode":Y,"data-level":it,"data-stale":ht?"true":void 0,"data-sentiment":ot,className:Nt,style:vt,onClick:ge||ye?xt:void 0,children:[$e.showHeader&&(c||u||ue)?T("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:$e.showChart&&null!=be?(pe??$e.chartSize)+8:0},children:H(ue,pt,B(L,{children:[c?T("span",{className:"semiotic-bignumber__label",style:{fontSize:$e.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:c}):null,u?T("span",{className:"semiotic-bignumber__caption",style:{fontSize:$e.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:u}):null]}))}):null,H(me,pt,B(wt,{className:"semiotic-bignumber__value semiotic-bignumber__value--"+it,style:{display:"inline"===Y?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:nt,fontSize:$e.valueSize||void 0,lineHeight:1.05},children:[T("span",{className:"semiotic-bignumber__value-text",children:bt}),_?T("span",{className:"semiotic-bignumber__unit",style:{fontSize:$e.valueSize?Math.max(11,Math.round(.32*$e.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:_}):null]})),$e.showDelta&&(lt||ut||M)?T(wt,{className:"semiotic-bignumber__delta semiotic-bignumber__delta--"+Ft,style:{display:"inline"===Y?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===Y?0:6,fontSize:$e.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:H(de,pt,B(L,{children:[lt?B("span",{className:"semiotic-bignumber__delta-row semiotic-bignumber__delta-row--"+Ft,style:{display:"inline-flex",alignItems:"center",gap:4,color:W(ot),fontWeight:600},children:[T("span",{"aria-hidden":"true",className:"semiotic-bignumber__arrow semiotic-bignumber__arrow--"+Ft,children:R(ot)}),T("span",{className:"semiotic-bignumber__delta-amount",children:lt}),ct?B("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",ct,")"]}):null]}):null,M?.label?T("span",{className:"semiotic-bignumber__comparison-label",children:M.label}):null,ut?B("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[lt||M?.label?T("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,T("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:mt}),B("span",{className:"semiotic-bignumber__target-value",children:["of ",ut.formattedValue,ut.label?" "+ut.label:""]})]}):null]}))}):null,$e.showChart&&null!=be?T("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:gt.top,right:gt.right,width:pe??$e.chartSize,height:pe??$e.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:T("div",{style:{pointerEvents:"auto",lineHeight:0},children:H(be,pt,null)})}):null,$e.showTrend&&null!=he?T("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:gt.left,right:gt.right,bottom:gt.bottom+(null!=fe?28:0)},children:H(he,pt,null)}):null,null!=fe?T(wt,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:gt.left,right:gt.right,bottom:gt.bottom,fontSize:$e.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:H(fe,pt,null)}):null,we?T("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:we}):null]})})});V.displayName="BigNumber";var A=V,P=A;function U(e){const t=Math.floor(.45*e.width),i=Math.floor(.6*e.width),n=(e,t)=>T("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return B("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?n(t,10):null,n(i,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?n(Math.floor(.35*e.width),8):null]})}export{A as BigNumber,P as BigNumberDefault,$ as buildFormatter,k as buildSparklinePath,j as colorForLevel,M as formatDeltaPercent,_ as formatDuration,D as formatSignedDelta,I as resolveThreshold};
|
|
2
|
+
import{BigNumber as m,BigNumber_default as u,buildFormatter as n,buildSparklinePath as o,colorForLevel as i,formatDeltaPercent as c,formatDuration as e,formatSignedDelta as h,resolveThreshold as k}from"./chunk-chunk-FYY2ACNJ.module.min.js";import"./chunk-chunk-ZCNBUZPL.module.min.js";import"./chunk-chunk-YHNZCPOZ.module.min.js";export{m as BigNumber,u as BigNumberDefault,n as buildFormatter,o as buildSparklinePath,i as colorForLevel,c as formatDeltaPercent,e as formatDuration,h as formatSignedDelta,k as resolveThreshold};
|