@react-magma/charts 8.0.0-next.4 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon as n}from"react-magma-icons";import{Point as r,LineSegment as o,VictoryChart as a,VictoryVoronoiContainer as i,VictoryTooltip as s,VictoryAxis as l,VictoryLine as c,VictoryScatter as d}from"victory";import{StyledTooltip as p,ThemeContext as u,TooltipPosition as f,TooltipArrow as h,useForceUpdate as m,Checkbox as g,I18nContext as b,Card as v,Datagrid as x,Spinner as y,Paragraph as k,TabsContainer as w,TabPanel as I,useDescendants as S,TypographyVisualStyle as $,Tabs as F,Tab as P,Tooltip as L,IconButton as z,ButtonVariant as C,Announce as E,TabPanelsContainer as A,useIsInverse as j}from"react-magma-dom";import O from"@emotion/styled";import{jsx as R,jsxs as W,Fragment as D}from"react/jsx-runtime";import{AreaChart as T,StackedAreaChart as H,SimpleBarChart as q,GroupedBarChart as _,StackedBarChart as M,DonutChart as G,LineChart as B,LollipopChart as K,PieChart as V}from"@carbon/charts-react";function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function N(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const U=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],X={width:350,height:350,padding:50},Z={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:"#3F3F3F",stroke:"transparent",strokeWidth:0},J=Y({textAnchor:"middle"},Z),Q={area:Y({style:{data:{fill:"pink"},labels:Z}},X),axis:Y({style:{axis:{fill:"transparent",stroke:"#8F8F8F",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:Y({},J,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:"#dfdfdf",strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"painted"},ticks:{fill:"transparent",size:0,stroke:"#8F8F8F",strokeWidth:0,strokeLinecap:"round",strokeLinejoin:"round"},tickLabels:Y({},Z,{fill:"#3F3F3F"})}},X),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:Y({style:{data:{fill:"#3F3F3F",padding:8,strokeWidth:0},labels:Z}},X),boxplot:Y({style:{max:{padding:8,stroke:"#3F3F3F",strokeWidth:1},maxLabels:Y({},Z,{padding:3}),median:{padding:8,stroke:"#3F3F3F",strokeWidth:1},medianLabels:Y({},Z,{padding:3}),min:{padding:8,stroke:"#3F3F3F",strokeWidth:1},minLabels:Y({},Z,{padding:3}),q1:{padding:8,fill:"#3F3F3F"},q1Labels:Y({},Z,{padding:3}),q3:{padding:8,fill:"#3F3F3F"},q3Labels:Y({},Z,{padding:3})},boxWidth:20},X),candlestick:Y({style:{data:{stroke:"#3F3F3F"},labels:Y({},Z,{padding:5})},candleColors:{positive:"#ffffff",negative:"#3F3F3F"}},X),chart:X,errorbar:Y({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:Z}},X),group:Y({colorScale:U},X),histogram:Y({style:{data:{fill:"#3F3F3F",stroke:"pink",strokeWidth:2},labels:Z}},X),legend:{colorScale:U,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:Z,title:Y({},Z,{padding:5})}},line:Y({style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:Z}},X),pie:Y({colorScale:U,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:Y({},Z,{padding:20})}},X),scatter:Y({style:{data:{fill:"#3F3F3F",opacity:1,stroke:"transparent",strokeWidth:0},labels:Z}},X),stack:Y({colorScale:U},X),tooltip:{style:Y({},Z,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:Y({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:Y({},Z,{padding:5,pointerEvents:"none"}),flyout:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},X)};let ee,te,ne=e=>e;const re=O,oe=re(p)(ee||(ee=ne`
1
+ import*as e from"react";import{css as t}from"@emotion/react";import{KeyboardIcon as n}from"react-magma-icons";import{Point as r,LineSegment as o,VictoryChart as a,VictoryVoronoiContainer as i,VictoryTooltip as s,VictoryAxis as l,VictoryLine as c,VictoryScatter as d}from"victory";import{StyledTooltip as p,ThemeContext as u,TooltipPosition as f,TooltipArrow as h,useForceUpdate as m,Checkbox as g,I18nContext as b,Card as v,Datagrid as x,Spinner as y,styled as k,Paragraph as w,TabsContainer as I,TabPanel as S,useDescendants as $,TypographyVisualStyle as F,Tabs as P,Tab as L,Tooltip as z,IconButton as C,ButtonVariant as E,Announce as A,TabPanelsContainer as j,useIsInverse as O}from"react-magma-dom";import R from"@emotion/styled";import{jsx as W,jsxs as D,Fragment as T}from"react/jsx-runtime";import{AreaChart as H,StackedAreaChart as q,SimpleBarChart as _,GroupedBarChart as M,StackedBarChart as G,DonutChart as B,LineChart as K,LollipopChart as V,PieChart as Y}from"@carbon/charts-react";function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(this,arguments)}function U(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const X=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],Z={width:350,height:350,padding:50},J={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:"#3F3F3F",stroke:"transparent",strokeWidth:0},Q=N({textAnchor:"middle"},J),ee={area:N({style:{data:{fill:"pink"},labels:J}},Z),axis:N({style:{axis:{fill:"transparent",stroke:"#8F8F8F",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:N({},Q,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:"#dfdfdf",strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"painted"},ticks:{fill:"transparent",size:0,stroke:"#8F8F8F",strokeWidth:0,strokeLinecap:"round",strokeLinejoin:"round"},tickLabels:N({},J,{fill:"#3F3F3F"})}},Z),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:N({style:{data:{fill:"#3F3F3F",padding:8,strokeWidth:0},labels:J}},Z),boxplot:N({style:{max:{padding:8,stroke:"#3F3F3F",strokeWidth:1},maxLabels:N({},J,{padding:3}),median:{padding:8,stroke:"#3F3F3F",strokeWidth:1},medianLabels:N({},J,{padding:3}),min:{padding:8,stroke:"#3F3F3F",strokeWidth:1},minLabels:N({},J,{padding:3}),q1:{padding:8,fill:"#3F3F3F"},q1Labels:N({},J,{padding:3}),q3:{padding:8,fill:"#3F3F3F"},q3Labels:N({},J,{padding:3})},boxWidth:20},Z),candlestick:N({style:{data:{stroke:"#3F3F3F"},labels:N({},J,{padding:5})},candleColors:{positive:"#ffffff",negative:"#3F3F3F"}},Z),chart:Z,errorbar:N({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:J}},Z),group:N({colorScale:X},Z),histogram:N({style:{data:{fill:"#3F3F3F",stroke:"pink",strokeWidth:2},labels:J}},Z),legend:{colorScale:X,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:J,title:N({},J,{padding:5})}},line:N({style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:J}},Z),pie:N({colorScale:X,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:N({},J,{padding:20})}},Z),scatter:N({style:{data:{fill:"#3F3F3F",opacity:1,stroke:"transparent",strokeWidth:0},labels:J}},Z),stack:N({colorScale:X},Z),tooltip:{style:N({},J,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:N({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:N({},J,{padding:5,pointerEvents:"none"}),flyout:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},Z)};let te,ne,re=e=>e;const oe=R(p)(te||(te=re`
2
2
  background: ${0};
3
3
  border: 1px solid ${0};
4
4
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
@@ -18,42 +18,42 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
18
18
  margin-bottom: 0;
19
19
  }
20
20
  }
21
- `),e=>e.theme.colors.neutral100,e=>e.theme.colors.neutral300,e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize,e=>e.theme.typeScale.size02.lineHeight),ae=re.span(te||(te=ne`
21
+ `),e=>e.theme.colors.neutral100,e=>e.theme.colors.neutral300,e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize,e=>e.theme.typeScale.size02.lineHeight),ae=R.span(ne||(ne=re`
22
22
  background: ${0};
23
23
  border: ${0};
24
24
  border-radius: 4px;
25
25
  height: 20px;
26
26
  width: 20px;
27
27
  margin-right: 8px;
28
- `),e=>e.color,e=>e.color?"none":"3px solid black"),ie=t=>{const{datum:n,index:r,showTooltip:o,x:a,y:i}=t,s=e.useContext(u);return o===`${r}-${n.index}`?R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:a,y:i,width:"275",height:"100%",children:W(oe,{position:f.top,role:"tooltip",theme:s,children:[W("div",{children:[R(ae,{color:s.iterableColors[r]}),R("span",{children:n.label})]}),R(h,{theme:s})]})})}):null},se=t=>{const{x:n,y:r,activePoints:o,hiddenData:a,dataLength:i}=t,s=Array.from(Array(i-0),(e,t)=>t+0).filter(e=>!a.includes(e)),l=e.useContext(u);return R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:n,y:r,width:"275",height:"100%",children:W(oe,{"data-testid":"axis-tooltip",position:f.top,role:"tooltip",theme:l,children:[o.map((e,t)=>W("div",{children:[R(ae,{color:l.iterableColors[s[t]]}),R("span",{children:e.label})]},t)),R(h,{theme:l})]})})})},le=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],ce=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],de=e=>{const{datum:t,index:n,lineIndex:o,pointRefArray:a,registerPoint:i,unregisterPoint:s}=e,l=N(e,le);return R(r,Y({},l,{ariaLabel:t.label,pathComponent:R(pe,{lineIndex:o,pointIndex:n,pointRefArray:a,registerPoint:i,unregisterPoint:s}),role:"button",tabIndex:0}))},pe=t=>{const{lineIndex:n,pointRefArray:r,pointIndex:o,registerPoint:a,unregisterPoint:i}=t,s=N(t,ce),l=m(),c=e.useRef(null);return e.useEffect(()=>(a(r,c),l(),()=>i(r,c)),[]),R("path",Y({ref:c,"data-line-index":n,"data-point-index":o},s))},ue=["events"],fe=e=>{let{events:t}=e,n=N(e,ue);return W("g",{children:[R(o,Y({},n,{events:t,style:{strokeWidth:"50px",stroke:"transparent"}})),R(o,Y({},n,{events:t,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},he=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],me=e.forwardRef((t,n)=>{const{color:r,dataIndex:o,isHidden:a,onClick:i,name:s,focusCurrentLine:l,resetLineFocus:c}=t,d=N(t,he);function p(){a||l&&"function"==typeof l&&l(o)}const f=e.useContext(u);return R("div",{style:{display:"inline-flex"},onMouseEnter:p,onMouseLeave:c,children:R(g,Y({checked:!a,color:r,containerStyle:{alignItems:"center",border:"0",boxShadow:"0 0 0",color:f.colors.neutral,display:"inline-flex",margin:"0 36px 20px 0",padding:"0"},inputStyle:{border:r?"none":`2px solid ${f.colors.neutral800}`,borderRadius:"4px"},labelText:s,onBlur:c,onClick:function(){i&&"function"==typeof i&&i(o),a||c&&"function"==typeof c&&c()},onFocus:p,ref:n,theme:f},d))})}),ge=["axisLabel","tickLabels"],be=["style"],ve=["axisLabel","tickLabels"],xe=["style"];let ye,ke,we,Ie,Se=e=>e;const $e=O,Fe=$e.div(ye||(ye=Se`
28
+ `),e=>e.color,e=>e.color?"none":"3px solid black"),ie=t=>{const{datum:n,index:r,showTooltip:o,x:a,y:i}=t,s=e.useContext(u);return o===`${r}-${n.index}`?W("g",{style:{pointerEvents:"none"},children:W("foreignObject",{x:a,y:i,width:"275",height:"100%",children:D(oe,{position:f.top,role:"tooltip",theme:s,children:[D("div",{children:[W(ae,{color:s.iterableColors[r]}),W("span",{children:n.label})]}),W(h,{theme:s})]})})}):null},se=t=>{const{x:n,y:r,activePoints:o,hiddenData:a,dataLength:i}=t,s=Array.from(Array(i-0),(e,t)=>t+0).filter(e=>!a.includes(e)),l=e.useContext(u);return W("g",{style:{pointerEvents:"none"},children:W("foreignObject",{x:n,y:r,width:"275",height:"100%",children:D(oe,{"data-testid":"axis-tooltip",position:f.top,role:"tooltip",theme:l,children:[o.map((e,t)=>D("div",{children:[W(ae,{color:l.iterableColors[s[t]]}),W("span",{children:e.label})]},t)),W(h,{theme:l})]})})})},le=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],ce=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],de=e=>{const{datum:t,index:n,lineIndex:o,pointRefArray:a,registerPoint:i,unregisterPoint:s}=e,l=U(e,le);return W(r,N({},l,{ariaLabel:t.label,pathComponent:W(pe,{lineIndex:o,pointIndex:n,pointRefArray:a,registerPoint:i,unregisterPoint:s}),role:"button",tabIndex:0}))},pe=t=>{const{lineIndex:n,pointRefArray:r,pointIndex:o,registerPoint:a,unregisterPoint:i}=t,s=U(t,ce),l=m(),c=e.useRef(null);return e.useEffect(()=>(a(r,c),l(),()=>i(r,c)),[]),W("path",N({ref:c,"data-line-index":n,"data-point-index":o},s))},ue=["events"],fe=e=>{let{events:t}=e,n=U(e,ue);return D("g",{children:[W(o,N({},n,{events:t,style:{strokeWidth:"50px",stroke:"transparent"}})),W(o,N({},n,{events:t,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},he=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],me=e.forwardRef((t,n)=>{const{color:r,dataIndex:o,isHidden:a,onClick:i,name:s,focusCurrentLine:l,resetLineFocus:c}=t,d=U(t,he);function p(){a||l&&"function"==typeof l&&l(o)}const f=e.useContext(u);return W("div",{style:{display:"inline-flex"},onMouseEnter:p,onMouseLeave:c,children:W(g,N({checked:!a,color:r,containerStyle:{alignItems:"center",border:"0",boxShadow:"0 0 0",color:f.colors.neutral,display:"inline-flex",margin:"0 36px 20px 0",padding:"0"},inputStyle:{border:r?"none":`2px solid ${f.colors.neutral800}`,borderRadius:"4px"},labelText:s,onBlur:c,onClick:function(){i&&"function"==typeof i&&i(o),a||c&&"function"==typeof c&&c()},onFocus:p,ref:n,theme:f},d))})}),ge=["axisLabel","tickLabels"],be=["style"],ve=["axisLabel","tickLabels"],xe=["style"];let ye,ke,we,Ie,Se=e=>e;const $e=R.div(ye||(ye=Se`
29
29
  max-height: 600px;
30
30
  max-width: 800px;
31
31
  svg {
32
32
  overflow: visible;
33
33
  }
34
- `)),Pe=$e.div(ke||(ke=Se``)),Le=$e.div(we||(we=Se`
34
+ `)),Fe=R.div(ke||(ke=Se``)),Pe=R.div(we||(we=Se`
35
35
  padding-bottom: 24px;
36
- `)),ze=$e.p(Ie||(Ie=Se`
36
+ `)),Le=R.p(Ie||(Ie=Se`
37
37
  color: ${0};
38
38
  font-size: ${0};
39
- `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize);function Ce(t){const{componentProps:{chart:n={},line:r={},scatter:o={},xAxis:{style:{axisLabel:p,tickLabels:f}={}}={style:{}},yAxis:{style:{axisLabel:h,tickLabels:m}={}}={style:{}}}={},data:g=[],lastFocusedScatterPoint:v,pointRefArray:x,registerPoint:y,unregisterPoint:k,tabRef:w,x:I,y:S}=t,$=N(t.componentProps.xAxis.style,ge),F=N(t.componentProps.xAxis,be),P=N(t.componentProps.yAxis.style,ve),L=N(t.componentProps.yAxis,xe),z=e.useContext(u),C=e.useContext(b),[E,A]=e.useState([]),[j,O]=e.useState(800),[T,H]=e.useState(null),[q,_]=e.useState(null),[M,G]=e.useState(!0),[B,K]=e.useState(!1),V=e.useRef(null),U=e.useRef(null);e.useEffect(()=>(ee(),window.addEventListener("resize",ee),window.addEventListener("keydown",te),()=>{window.removeEventListener("resize",ee),window.removeEventListener("keydown",te)}),[]),e.useEffect(()=>(window.addEventListener("mousemove",ne),()=>{window.removeEventListener("mousemove",ne)}),[q]);const X=g.map((e,t)=>`scatter-${t}`),Z=Y({tickLabels:Y({color:"#3f3f3f",fontSize:12},f),axisLabel:Y({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},p)},$),J=Y({tickLabels:Y({fontSize:12},m),axisLabel:Y({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},h)},P);function ee(){V.current&&O(V.current.clientWidth)}function te(e){"Escape"===e.key&&(_(null),G(!1))}function ne(){!q&&G(!0)}function re(e){return null===T||T===e?1:.1}function oe(e){E.includes(e)?A(E.filter(t=>t!==e)):A(E.concat([e]))}function ae(e){H(e)}function le(){H(null)}const ce=(e,t)=>{if(t.current){const n=parseInt(t.current.getAttribute("data-line-index"),10);!e.includes(n)&&e.push(parseInt(t.current.getAttribute("data-line-index"),10))}return e},pe=e=>{const t=parseInt(e.current.getAttribute("data-line-index"),10),n=parseInt(e.current.getAttribute("data-point-index"),10),r=x.current.reduce(ce,[]);return{currentLineIndex:t,currentPointIndex:n,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},ue=(e,t)=>n=>n.current&&parseInt(n.current.getAttribute("data-line-index"),10)===e&&parseInt(n.current.getAttribute("data-point-index"),10)===t;function he(e){const{key:t,shiftKey:n}=e;"Tab"===t&&n&&v&&v.current&&x.current.find(e=>e.current===v.current)&&(e.preventDefault(),v.current.focus())}return W(Fe,{ref:V,children:[R(Pe,{onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Tab":e.preventDefault(),v.current=x.current.find(e=>e.current===document.activeElement).current,n?w.current&&w.current.focus():U.current&&U.current.focus();break;case"ArrowRight":{const e=x.current.findIndex(e=>e.current===document.activeElement);var r;void 0!==e&&(e===x.current.length-1?null==(r=x.current[0])||null==(r=r.current)||r.focus():x.current[e+1].current.focus());break}case"ArrowLeft":{const e=x.current.findIndex(e=>e.current===document.activeElement);void 0!==e&&(0===e?x.current[x.current.length-1].current.focus():x.current[e-1].current.focus());break}case"ArrowUp":{e.preventDefault();const t=x.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:o,highestLineIndex:a}=pe(t);if(e===o)x.current.find(ue(a,n)).current.focus();else{const t=r[r.indexOf(e)-1];x.current.find(ue(t,n)).current.focus()}}break}case"ArrowDown":{e.preventDefault();const t=x.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:o,highestLineIndex:a}=pe(t);if(e===a)x.current.find(ue(o,n)).current.focus();else{const t=r[r.indexOf(e)+1];x.current.find(ue(t,n)).current.focus()}}break}}},children:W(a,Y({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:Q,width:j,containerComponent:R(i,{name:"xAxisGroupLabel",voronoiBlacklist:X,voronoiDimension:"x",labels:B&&M?()=>" ":void 0,labelComponent:M?R(s,{flyoutComponent:R(se,{dataLength:g.length,hiddenData:E})}):void 0,role:"presentation",voronoiPadding:32})},n,{children:[R(l,Y({},L,{dependentAxis:!0,style:J})),g.map(({data:e},t)=>!E.includes(t)&&R(c,Y({style:{data:{opacity:re(t),stroke:z.iterableColors[t],strokeWidth:"3"},parent:{border:z.colors.neutral400}},data:e,labelComponent:R(D,{}),x:I,y:S},r),`line${t}`)),R(l,Y({},F,{style:Z,gridComponent:R(fe,{events:{onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1)}})})),g.map(({data:e},t)=>!E.includes(t)&&R(d,Y({name:`scatter-${t}`,events:[{target:"data",eventHandlers:{onBlur:()=>(G(!0),_(null),[{target:"labels",mutation:()=>({active:void 0})}]),onClick:()=>[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}],onFocus:()=>(G(!1),[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseEnter:()=>(G(!1),[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseLeave:()=>{_(null),G(!0)}}}],style:{data:{fill:z.colors.neutral100,opacity:re(t),stroke:z.iterableColors[t],strokeWidth:2}},size:5,data:e.map((e,n)=>Y({index:n,lineIndex:t},e)),dataComponent:R(de,{lineIndex:t,pointRefArray:x,registerPoint:y,unregisterPoint:k}),labels:()=>"",labelComponent:R(s,{text:"",flyoutComponent:R(ie,{index:t,showTooltip:q})}),x:I,y:S},o),`scatter${t}`))]}))}),W(Le,{children:[R(ze,{theme:z,children:C.charts.line.dataLegendsLabel}),g.map(({name:e},t)=>{const n=C.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,e);return R(me,{"aria-label":n,color:z.iterableColors[t],dataIndex:t,isHidden:E.includes(t),name:e,onClick:oe,onKeyDown:0===t?he:void 0,focusCurrentLine:ae,ref:0===t?U:void 0,resetLineFocus:le},t)})]})]})}function Ee(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}const Ae=t=>{const{data:n=[],xData:{keyValue:r,label:o,tickFormat:a,tickValues:i},yData:{keyValue:s,tickFormat:l}}=t,[c,d]=e.useState({columns:[],rows:[]});return e.useEffect(()=>{d(function(){const e=Ee(r||o||"x"),t=n.reduce((e,{data:t})=>(t.forEach(t=>{const n=t.x||r&&t[r];!e.includes(n)&&e.push(n)}),e),[]);let c={columns:t.length>0?[{field:e,header:o||r||"X",isRowHeader:!0}]:[],rows:t.reduce((n,r,o)=>{const s=i&&"number"==typeof r&&i.length===t.length?a&&"function"==typeof a?a(i[r-1]):i[r-1]:a&&Array.isArray(a)?a[r-1]:a&&"function"==typeof a?a(r):r;return n.push({[e]:s,id:o}),n},[])};return n.reduce((e,t)=>{const{name:n,data:r}=t,o=Ee(n);return e.columns.push({field:o,header:n}),r.forEach((t,n)=>{const r=t.y||0===t.y?t.y:s&&t[s];e.rows[n]=Y({},e.rows[n],{id:c.rows.length>0?n+1:n,[o]:l&&"function"==typeof l?l(r):r})}),e},c)}())},[n]),R(v,{children:c.rows.length>0?R(x,{hasPagination:!1,columns:c.columns,rows:c.rows}):R(y,{})})},je=["description","title","testId","type"];let Oe,Re,We,De,Te,He,qe=e=>e;const _e=O,Me=_e.span(Oe||(Oe=qe`
39
+ `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize);function ze(t){const{componentProps:{chart:n={},line:r={},scatter:o={},xAxis:{style:{axisLabel:p,tickLabels:f}={}}={style:{}},yAxis:{style:{axisLabel:h,tickLabels:m}={}}={style:{}}}={},data:g=[],lastFocusedScatterPoint:v,pointRefArray:x,registerPoint:y,unregisterPoint:k,tabRef:w,x:I,y:S}=t,$=U(t.componentProps.xAxis.style,ge),F=U(t.componentProps.xAxis,be),P=U(t.componentProps.yAxis.style,ve),L=U(t.componentProps.yAxis,xe),z=e.useContext(u),C=e.useContext(b),[E,A]=e.useState([]),[j,O]=e.useState(800),[R,H]=e.useState(null),[q,_]=e.useState(null),[M,G]=e.useState(!0),[B,K]=e.useState(!1),V=e.useRef(null),Y=e.useRef(null);e.useEffect(()=>(Q(),window.addEventListener("resize",Q),window.addEventListener("keydown",te),()=>{window.removeEventListener("resize",Q),window.removeEventListener("keydown",te)}),[]),e.useEffect(()=>(window.addEventListener("mousemove",ne),()=>{window.removeEventListener("mousemove",ne)}),[q]);const X=g.map((e,t)=>`scatter-${t}`),Z=N({tickLabels:N({color:"#3f3f3f",fontSize:12},f),axisLabel:N({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},p)},$),J=N({tickLabels:N({fontSize:12},m),axisLabel:N({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},h)},P);function Q(){V.current&&O(V.current.clientWidth)}function te(e){"Escape"===e.key&&(_(null),G(!1))}function ne(){!q&&G(!0)}function re(e){return null===R||R===e?1:.1}function oe(e){E.includes(e)?A(E.filter(t=>t!==e)):A(E.concat([e]))}function ae(e){H(e)}function le(){H(null)}const ce=(e,t)=>{if(t.current){const n=parseInt(t.current.getAttribute("data-line-index"),10);!e.includes(n)&&e.push(parseInt(t.current.getAttribute("data-line-index"),10))}return e},pe=e=>{const t=parseInt(e.current.getAttribute("data-line-index"),10),n=parseInt(e.current.getAttribute("data-point-index"),10),r=x.current.reduce(ce,[]);return{currentLineIndex:t,currentPointIndex:n,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},ue=(e,t)=>n=>n.current&&parseInt(n.current.getAttribute("data-line-index"),10)===e&&parseInt(n.current.getAttribute("data-point-index"),10)===t;function he(e){const{key:t,shiftKey:n}=e;"Tab"===t&&n&&v&&v.current&&x.current.find(e=>e.current===v.current)&&(e.preventDefault(),v.current.focus())}return D($e,{ref:V,children:[W(Fe,{onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Tab":e.preventDefault(),v.current=x.current.find(e=>e.current===document.activeElement).current,n?w.current&&w.current.focus():Y.current&&Y.current.focus();break;case"ArrowRight":{const e=x.current.findIndex(e=>e.current===document.activeElement);var r;void 0!==e&&(e===x.current.length-1?null==(r=x.current[0])||null==(r=r.current)||r.focus():x.current[e+1].current.focus());break}case"ArrowLeft":{const e=x.current.findIndex(e=>e.current===document.activeElement);void 0!==e&&(0===e?x.current[x.current.length-1].current.focus():x.current[e-1].current.focus());break}case"ArrowUp":{e.preventDefault();const t=x.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:o,highestLineIndex:a}=pe(t);if(e===o)x.current.find(ue(a,n)).current.focus();else{const t=r[r.indexOf(e)-1];x.current.find(ue(t,n)).current.focus()}}break}case"ArrowDown":{e.preventDefault();const t=x.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:o,highestLineIndex:a}=pe(t);if(e===a)x.current.find(ue(o,n)).current.focus();else{const t=r[r.indexOf(e)+1];x.current.find(ue(t,n)).current.focus()}}break}}},children:D(a,N({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:ee,width:j,containerComponent:W(i,{name:"xAxisGroupLabel",voronoiBlacklist:X,voronoiDimension:"x",labels:B&&M?()=>" ":void 0,labelComponent:M?W(s,{flyoutComponent:W(se,{dataLength:g.length,hiddenData:E})}):void 0,role:"presentation",voronoiPadding:32})},n,{children:[W(l,N({},L,{dependentAxis:!0,style:J})),g.map(({data:e},t)=>!E.includes(t)&&W(c,N({style:{data:{opacity:re(t),stroke:z.iterableColors[t],strokeWidth:"3"},parent:{border:z.colors.neutral400}},data:e,labelComponent:W(T,{}),x:I,y:S},r),`line${t}`)),W(l,N({},F,{style:Z,gridComponent:W(fe,{events:{onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1)}})})),g.map(({data:e},t)=>!E.includes(t)&&W(d,N({name:`scatter-${t}`,events:[{target:"data",eventHandlers:{onBlur:()=>(G(!0),_(null),[{target:"labels",mutation:()=>({active:void 0})}]),onClick:()=>[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}],onFocus:()=>(G(!1),[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseEnter:()=>(G(!1),[{target:"labels",mutation:e=>(_(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseLeave:()=>{_(null),G(!0)}}}],style:{data:{fill:z.colors.neutral100,opacity:re(t),stroke:z.iterableColors[t],strokeWidth:2}},size:5,data:e.map((e,n)=>N({index:n,lineIndex:t},e)),dataComponent:W(de,{lineIndex:t,pointRefArray:x,registerPoint:y,unregisterPoint:k}),labels:()=>"",labelComponent:W(s,{text:"",flyoutComponent:W(ie,{index:t,showTooltip:q})}),x:I,y:S},o),`scatter${t}`))]}))}),D(Pe,{children:[W(Le,{theme:z,children:C.charts.line.dataLegendsLabel}),g.map(({name:e},t)=>{const n=C.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,e);return W(me,{"aria-label":n,color:z.iterableColors[t],dataIndex:t,isHidden:E.includes(t),name:e,onClick:oe,onKeyDown:0===t?he:void 0,focusCurrentLine:ae,ref:0===t?Y:void 0,resetLineFocus:le},t)})]})]})}function Ce(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}const Ee=t=>{const{data:n=[],xData:{keyValue:r,label:o,tickFormat:a,tickValues:i},yData:{keyValue:s,tickFormat:l}}=t,[c,d]=e.useState({columns:[],rows:[]});return e.useEffect(()=>{d(function(){const e=Ce(r||o||"x"),t=n.reduce((e,{data:t})=>(t.forEach(t=>{const n=t.x||r&&t[r];!e.includes(n)&&e.push(n)}),e),[]);let c={columns:t.length>0?[{field:e,header:o||r||"X",isRowHeader:!0}]:[],rows:t.reduce((n,r,o)=>{const s=i&&"number"==typeof r&&i.length===t.length?a&&"function"==typeof a?a(i[r-1]):i[r-1]:a&&Array.isArray(a)?a[r-1]:a&&"function"==typeof a?a(r):r;return n.push({[e]:s,id:o}),n},[])};return n.reduce((e,t)=>{const{name:n,data:r}=t,o=Ce(n);return e.columns.push({field:o,header:n}),r.forEach((t,n)=>{const r=t.y||0===t.y?t.y:s&&t[s];e.rows[n]=N({},e.rows[n],{id:c.rows.length>0?n+1:n,[o]:l&&"function"==typeof l?l(r):r})}),e},c)}())},[n]),W(v,{children:c.rows.length>0?W(x,{hasPagination:!1,columns:c.columns,rows:c.rows}):W(y,{})})},Ae=["description","title","testId","type"];let je,Oe,Re,We,De,Te,He=e=>e;const qe=k.span(je||(je=He`
40
40
  color: ${0};
41
41
  font-size: ${0};
42
42
  font-weight: 600;
43
43
  font-family: ${0};
44
44
  line-height: ${0};
45
45
  margin: 0 0 12px 0;
46
- `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size04.fontSize,e=>e.theme.bodyFont,e=>e.theme.typeScale.size04.lineHeight),Ge=_e(k)(Re||(Re=qe`
46
+ `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size04.fontSize,e=>e.theme.bodyFont,e=>e.theme.typeScale.size04.lineHeight),_e=k(w)(Oe||(Oe=He`
47
47
  font-size: ${0};
48
48
  margin: 0 0 18px 0;
49
- `),e=>e.theme.typeScale.size02.fontSize),Be=_e(w)(We||(We=qe`
49
+ `),e=>e.theme.typeScale.size02.fontSize),Me=k(I)(Re||(Re=He`
50
50
  width: 800px;
51
51
  ul {
52
52
  box-shadow: inset 0 -1px 0 ${0};
53
53
  }
54
- `),e=>e.theme.colors.neutral300),Ke=_e(I)(De||(De=qe`
54
+ `),e=>e.theme.colors.neutral300),Ge=k(S)(We||(We=He`
55
55
  padding: 22px 0;
56
- `)),Ve=_e(v)(Te||(Te=qe`
56
+ `)),Be=k(v)(De||(De=He`
57
57
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
58
58
  display: ${0};
59
59
  right: ${0};
@@ -69,10 +69,10 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
69
69
  z-index: 2;
70
70
 
71
71
  ${0}
72
- `),e=>e.isOpen?"block":"none",e=>e.theme.spaceScale.spacing02,e=>e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight,e=>e.isOpen?"1":"0",e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.width&&t(He||(He=qe`
72
+ `),e=>e.isOpen?"block":"none",e=>e.theme.spaceScale.spacing02,e=>e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight,e=>e.isOpen?"1":"0",e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.width&&t(Te||(Te=He`
73
73
  white-space: normal;
74
74
  width: ${0};
75
- `),e.width));function Ye(t,r){var o,a,i;const{description:s,title:l,type:c}=t,d=N(t,je),p=e.useRef(null),f=e.useRef(null),h=e.useContext(u),m=e.useContext(b),[g,v,x]=S(),[y,w]=e.useState(!1);return W("div",{ref:r,children:[R(Me,{theme:h,children:l}),s&&R(Ge,{theme:h,visualStyle:$.bodySmall,children:s}),W(Be,{theme:h,children:[W(F,{children:[R(P,{children:m.charts.line.chartTabLabel}),R(P,{children:m.charts.line.dataTabLabel}),W("div",{onBlur:function(){w(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[R(L,{content:m.charts.line.keyboardInstructionsTooltip,ref:p,children:R(z,{"aria-controls":"keyboardInstructions","aria-label":m.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(y),icon:R(n,{}),onClick:function(){w(e=>!e)},onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Escape":w(!1);break;case"Tab":!n&&f&&f.current&&g.current.find(e=>e.current===f.current)&&(e.preventDefault(),f.current.focus())}},variant:C.link})}),R(E,{children:W(Ve,{id:"keyboardInstructions",isOpen:y,theme:h,width:"350px",children:[R(k,{visualStyle:$.headingXSmall,style:{margin:"0 0 16px"},children:m.charts.line.keyboardInstructionsHeader}),m.charts.line.keyboardInstructions]})})]})]}),W(A,{children:[R(Ke,{theme:h,children:"line"===c&&R(Ce,Y({},d,{lastFocusedScatterPoint:f,pointRefArray:g,registerPoint:v,tabRef:p,unregisterPoint:x}))}),R(Ke,{theme:h,children:R(Ae,{data:d.data,xData:{keyValue:d.x,label:null==(o=d.componentProps)||null==(o=o.xAxis)?void 0:o.label,tickFormat:null==(a=d.componentProps)||null==(a=a.xAxis)?void 0:a.tickFormat},yData:{keyValue:d.y,tickFormat:null==(i=d.componentProps)||null==(i=i.yAxis)?void 0:i.tickFormat}})})]})]})]})}const Ne=e.forwardRef(Ye);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}function Xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ze(e,t){return Ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ze(e,t)}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function Qe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qe=function(){return!!e})()}function et(e,t,n){if(Qe())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Ze(o,n.prototype),o}function tt(e){var t="function"==typeof Map?new Map:void 0;return tt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return et(e,arguments,Je(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ze(n,e)},tt(e)}var nt={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found.\n\n",75:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"};function rt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0],a=[];for(r=1;r<t.length;r+=1)a.push(t[r]);return a.forEach(function(e){o=o.replace(/%[a-z]/,e)}),o}var ot=function(e){var t,n;function r(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];n=e.call(this,rt.apply(void 0,[nt[t]].concat(o)))||this}return Xe(n)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ze(t,n),r}(tt(Error));function at(e){return Math.round(255*e)}function it(e,t,n){return at(e)+","+at(t)+","+at(n)}function st(e,t,n,r){if(void 0===r&&(r=it),0===t)return r(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,i=a*(1-Math.abs(o%2-1)),s=0,l=0,c=0;o>=0&&o<1?(s=a,l=i):o>=1&&o<2?(s=i,l=a):o>=2&&o<3?(l=a,c=i):o>=3&&o<4?(l=i,c=a):o>=4&&o<5?(s=i,c=a):o>=5&&o<6&&(s=a,c=i);var d=n-a/2;return r(s+d,l+d,c+d)}var lt={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ct=/^#[a-fA-F0-9]{6}$/,dt=/^#[a-fA-F0-9]{8}$/,pt=/^#[a-fA-F0-9]{3}$/,ut=/^#[a-fA-F0-9]{4}$/,ft=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,ht=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,mt=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,gt=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,bt=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function vt(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function xt(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):xt(e,t,r)}}function yt(e){return xt(e,e.length,[])}function kt(e,t){if("transparent"===t)return t;var n,r=function(e){if("string"!=typeof e)throw new ot(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return lt[t]?"#"+lt[t]:e}(e);if(t.match(ct))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(dt)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(pt))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(ut)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var o=ft.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=ht.exec(t.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=mt.exec(t);if(i){var s="rgb("+st(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",l=ft.exec(s);if(!l)throw new ot(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=gt.exec(t.substring(0,50));if(c){var d="rgb("+st(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",p=ft.exec(d);if(!p)throw new ot(4,t,d);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10),alpha:parseFloat(""+c[4])}}throw new ot(5)}(t);return function(e,t,n,r){if("object"==typeof e)return e.alpha>=1?function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return bt("#"+vt(e)+vt(t)+vt(n));if("object"==typeof e&&void 0===t&&void 0===n)return bt("#"+vt(e.red)+vt(e.green)+vt(e.blue));throw new ot(6)}(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new ot(7)}(Ue({},r,{alpha:(n=+(100*("number"==typeof r.alpha?r.alpha:1)-100*parseFloat(e)).toFixed(2)/100,Math.max(0,Math.min(1,n)))}))}var wt=yt(kt);const It=["children","testId","isInverse","type","dataSet","options"];let St;const $t=O;var Ft;!function(e){e.area="area",e.areaStacked="areaStacked",e.bar="bar",e.barGrouped="barGrouped",e.barStacked="barStacked",e.donut="donut",e.line="line",e.pie="pie",e.lollipop="lollipop"}(Ft||(Ft={}));const Pt=$t.div(St||(St=(e=>e)`
75
+ `),e.width));function Ke(t,r){var o,a,i;const{description:s,title:l,type:c}=t,d=U(t,Ae),p=e.useRef(null),f=e.useRef(null),h=e.useContext(u),m=e.useContext(b),[g,v,x]=$(),[y,k]=e.useState(!1);return D("div",{ref:r,children:[W(qe,{theme:h,children:l}),s&&W(_e,{theme:h,visualStyle:F.bodySmall,children:s}),D(Me,{theme:h,children:[D(P,{children:[W(L,{children:m.charts.line.chartTabLabel}),W(L,{children:m.charts.line.dataTabLabel}),D("div",{onBlur:function(){k(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[W(z,{content:m.charts.line.keyboardInstructionsTooltip,ref:p,children:W(C,{"aria-controls":"keyboardInstructions","aria-label":m.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(y),icon:W(n,{}),onClick:function(){k(e=>!e)},onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Escape":k(!1);break;case"Tab":!n&&f&&f.current&&g.current.find(e=>e.current===f.current)&&(e.preventDefault(),f.current.focus())}},variant:E.link})}),W(A,{children:D(Be,{id:"keyboardInstructions",isOpen:y,theme:h,width:"350px",children:[W(w,{visualStyle:F.headingXSmall,style:{margin:"0 0 16px"},children:m.charts.line.keyboardInstructionsHeader}),m.charts.line.keyboardInstructions]})})]})]}),D(j,{children:[W(Ge,{theme:h,children:"line"===c&&W(ze,N({},d,{lastFocusedScatterPoint:f,pointRefArray:g,registerPoint:v,tabRef:p,unregisterPoint:x}))}),W(Ge,{theme:h,children:W(Ee,{data:d.data,xData:{keyValue:d.x,label:null==(o=d.componentProps)||null==(o=o.xAxis)?void 0:o.label,tickFormat:null==(a=d.componentProps)||null==(a=a.xAxis)?void 0:a.tickFormat},yData:{keyValue:d.y,tickFormat:null==(i=d.componentProps)||null==(i=i.yAxis)?void 0:i.tickFormat}})})]})]})]})}const Ve=e.forwardRef(Ke);function Ye(){return Ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ye.apply(this,arguments)}function Ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ue(e,t){return Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ue(e,t)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}function Ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ze=function(){return!!e})()}function Je(e,t,n){if(Ze())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Ue(o,n.prototype),o}function Qe(e){var t="function"==typeof Map?new Map:void 0;return Qe=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Je(e,arguments,Xe(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ue(n,e)},Qe(e)}var et={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found.\n\n",75:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"};function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0],a=[];for(r=1;r<t.length;r+=1)a.push(t[r]);return a.forEach(function(e){o=o.replace(/%[a-z]/,e)}),o}var nt=function(e){var t,n;function r(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];n=e.call(this,tt.apply(void 0,[et[t]].concat(o)))||this}return Ne(n)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ue(t,n),r}(Qe(Error));function rt(e){return Math.round(255*e)}function ot(e,t,n){return rt(e)+","+rt(t)+","+rt(n)}function at(e,t,n,r){if(void 0===r&&(r=ot),0===t)return r(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,i=a*(1-Math.abs(o%2-1)),s=0,l=0,c=0;o>=0&&o<1?(s=a,l=i):o>=1&&o<2?(s=i,l=a):o>=2&&o<3?(l=a,c=i):o>=3&&o<4?(l=i,c=a):o>=4&&o<5?(s=i,c=a):o>=5&&o<6&&(s=a,c=i);var d=n-a/2;return r(s+d,l+d,c+d)}var it={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},st=/^#[a-fA-F0-9]{6}$/,lt=/^#[a-fA-F0-9]{8}$/,ct=/^#[a-fA-F0-9]{3}$/,dt=/^#[a-fA-F0-9]{4}$/,pt=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,ut=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,ft=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,ht=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,mt=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function gt(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function bt(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):bt(e,t,r)}}function vt(e){return bt(e,e.length,[])}function xt(e,t){if("transparent"===t)return t;var n,r=function(e){if("string"!=typeof e)throw new nt(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return it[t]?"#"+it[t]:e}(e);if(t.match(st))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(lt)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(ct))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(dt)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var o=pt.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=ut.exec(t.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=ft.exec(t);if(i){var s="rgb("+at(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",l=pt.exec(s);if(!l)throw new nt(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=ht.exec(t.substring(0,50));if(c){var d="rgb("+at(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",p=pt.exec(d);if(!p)throw new nt(4,t,d);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10),alpha:parseFloat(""+c[4])}}throw new nt(5)}(t);return function(e,t,n,r){if("object"==typeof e)return e.alpha>=1?function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return mt("#"+gt(e)+gt(t)+gt(n));if("object"==typeof e&&void 0===t&&void 0===n)return mt("#"+gt(e.red)+gt(e.green)+gt(e.blue));throw new nt(6)}(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new nt(7)}(Ye({},r,{alpha:(n=+(100*("number"==typeof r.alpha?r.alpha:1)-100*parseFloat(e)).toFixed(2)/100,Math.max(0,Math.min(1,n)))}))}var yt=vt(xt);const kt=["children","testId","isInverse","type","dataSet","options"];let wt;var It;!function(e){e.area="area",e.areaStacked="areaStacked",e.bar="bar",e.barGrouped="barGrouped",e.barStacked="barStacked",e.donut="donut",e.line="line",e.pie="pie",e.lollipop="lollipop"}(It||(It={}));const St=R.div(wt||(wt=(e=>e)`
76
76
  .cds--data-table thead tr th {
77
77
  background: ${0} !important;
78
78
  }
@@ -201,7 +201,6 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
201
201
  drop-shadow(-1px 0px 0px ${0})
202
202
  drop-shadow( 0px 1px 0px ${0})
203
203
  drop-shadow( 0px -1px 0px ${0});
204
- }
205
204
  }
206
205
  .cds--cc--lollipop circle.dot.filled,
207
206
  .cds--cc--lollipop circle.dot.hovered {
@@ -214,9 +213,9 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
214
213
  .cds--cc--lollipop circle.dot.hovered{
215
214
  transition: 0.1s all linear;
216
215
  filter:
217
- drop-shadow( 1px 0px 0px ${0})
218
- drop-shadow(-1px 0px 0px ${0})
219
- drop-shadow( 0px 1px 0px ${0})
216
+ drop-shadow( 1px 0px 0px ${0});
217
+ drop-shadow(-1px 0px 0px ${0});
218
+ drop-shadow( 0px 1px 0px ${0});
220
219
  drop-shadow( 0px -1px 0px ${0});
221
220
  }
222
221
  .cds--cc--lollipop .cds--cc--scatter circle.dot.hovered{
@@ -259,7 +258,6 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
259
258
  *:focus {
260
259
  outline: 2px solid
261
260
  ${0} !important;
262
- }
263
261
  outline-offset: 0;
264
262
  }
265
263
  .cds--overflow-menu-options__btn:focus,
@@ -364,5 +362,5 @@ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon
364
362
  position: relative;
365
363
  }
366
364
  }
367
- `),e=>e.isInverse?e.theme.colors.primary700:"",e=>e.theme.colors.neutral700,e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.theme.typeScale.size02.fontSize,e=>e.theme.spaceScale.spacing02,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700,e=>e.theme.borderRadius,e=>e.isInverse?e.theme.colors.primary700:"",e=>e.isInverse?e.theme.colors.primary600:"",e=>e.isInverse?wt(.8,e.theme.colors.neutral100):"inherit",e=>e.isInverse?wt(.8,e.theme.colors.neutral100):"inherit",e=>e.isInverse?"#202565":"",e=>e.isInverse?e.theme.colors.primary600:"",e=>e.theme.bodyFont,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700,e=>e.isInverse?e.theme.colors.neutral900:e.theme.colors.neutral100,e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.theme.typeScale.size03.fontSize,e=>e.theme.spaceScale.spacing03,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral900,e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?wt(.5,e.theme.colors.neutral100):"",e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?"invert(1)":"",e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.focusInverse:"",e=>e.theme.typeScale.size03.lineHeight,e=>e.theme.spaceScale.spacing13,e=>e.theme.spaceScale.spacing04,e=>e.theme.bodyFont,e=>e.theme.typeScale.size03.fontSize,e=>e.theme.borderRadius,e=>e.isInverse?e.theme.colors.tertiary500:e.theme.colors.primary,e=>e.isInverse?e.theme.colors.neutral900:"",e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?`1px solid ${e.theme.colors.focusInverse}`:"",e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?wt(.8,e.theme.colors.neutral100):e.theme.colors.neutral300,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?wt(.8,e.theme.colors.neutral100):e.theme.colors.neutral300,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.theme.typeScale.size02.fontSize,e=>e.isInverse?e.theme.colors.neutral100:"");var Lt;!function(e){e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10"}(Lt||(Lt={}));const zt=e.forwardRef((t,n)=>{const{testId:r,isInverse:o,type:a,dataSet:i,options:s}=t,l=N(t,It),c=e.useContext(u),d=j(o),p={area:T,areaStacked:H,bar:q,barGrouped:_,barStacked:M,donut:G,line:B,lollipop:K,pie:V},f=Y({},s,{theme:d?Lt.G100:Lt.WHITE,color:{scale:function(){let e={};const t=i.map(e=>"group"in e?e.group:null),n=t.filter((e,n)=>t.indexOf(e)===n);return n.forEach((t,r)=>n.length<=c.chartColors.length?e[t||"null"]=d?c.chartColorsInverse[r]:c.chartColors[r]:{}),e}()},tooltip:{truncation:{type:"none"}}}),h=p[a];return e.useEffect(()=>{document.querySelectorAll(".graph-frame ").forEach(e=>{e.setAttribute("aria-label","Interactive chart")})}),R(Pt,Y({"data-testid":r,ref:n,isInverse:d,theme:c,className:"carbon-chart-wrapper"},l,{children:R(h,{data:i,options:f})}))});export{zt as CarbonChart,Ft as CarbonChartType,Ne as Chart};
368
- //# sourceMappingURL=charts.modern.js.map
365
+ `),e=>e.isInverse?e.theme.colors.primary700:"",e=>e.theme.colors.neutral700,e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.theme.typeScale.size02.fontSize,e=>e.theme.spaceScale.spacing02,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700,e=>e.theme.borderRadius,e=>e.isInverse?e.theme.colors.primary700:"",e=>e.isInverse?e.theme.colors.primary600:"",e=>e.isInverse?yt(.8,e.theme.colors.neutral100):"inherit",e=>e.isInverse?yt(.8,e.theme.colors.neutral100):"inherit",e=>e.isInverse?"#202565":"",e=>e.isInverse?e.theme.colors.primary600:"",e=>e.theme.bodyFont,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700,e=>e.isInverse?e.theme.colors.neutral900:e.theme.colors.neutral100,e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.theme.typeScale.size03.fontSize,e=>e.theme.spaceScale.spacing03,e=>e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral900,e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?yt(.5,e.theme.colors.neutral100):"",e=>e.isInverse?e.theme.colors.neutral100:"",e=>e.isInverse?"invert(1)":"",e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?e.theme.colors.focusInverse:"",e=>e.theme.typeScale.size03.lineHeight,e=>e.theme.spaceScale.spacing13,e=>e.theme.spaceScale.spacing04,e=>e.theme.bodyFont,e=>e.theme.typeScale.size03.fontSize,e=>e.theme.borderRadius,e=>e.isInverse?e.theme.colors.tertiary500:e.theme.colors.primary,e=>e.isInverse?e.theme.colors.neutral900:"",e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?`1px solid ${e.theme.colors.focusInverse}`:"",e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.isInverse?yt(.8,e.theme.colors.neutral100):e.theme.colors.neutral300,e=>e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus,e=>e.isInverse?yt(.8,e.theme.colors.neutral100):e.theme.colors.neutral300,e=>e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100,e=>e.theme.typeScale.size02.fontSize,e=>e.isInverse?e.theme.colors.neutral100:"");var $t;!function(e){e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10"}($t||($t={}));const Ft=e.forwardRef((t,n)=>{const{testId:r,isInverse:o,type:a,dataSet:i,options:s}=t,l=U(t,kt),c=e.useContext(u),d=O(o),p={area:H,areaStacked:q,bar:_,barGrouped:M,barStacked:G,donut:B,line:K,lollipop:V,pie:Y},f=N({},s,{theme:d?$t.G100:$t.WHITE,color:{scale:function(){let e={};const t=i.map(e=>"group"in e?e.group:null),n=t.filter((e,n)=>t.indexOf(e)===n);return n.forEach((t,r)=>n.length<=c.chartColors.length?e[t||"null"]=d?c.chartColorsInverse[r]:c.chartColors[r]:{}),e}()},tooltip:{truncation:{type:"none"}}}),h=p[a];return e.useEffect(()=>{document.querySelectorAll(".graph-frame ").forEach(e=>{e.setAttribute("aria-label","Interactive chart")})}),W(St,N({"data-testid":r,ref:n,isInverse:d,theme:c,className:"carbon-chart-wrapper"},l,{children:W(h,{data:i,options:f})}))});export{Ft as CarbonChart,It as CarbonChartType,Ve as Chart};
366
+ //# sourceMappingURL=charts.map