@deephaven/embed-chart 0.66.0 → 0.66.1
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/build/assets/{App-d6a1e5a2.js → App-d1337a7f.js} +2 -2
- package/build/assets/{App-d6a1e5a2.js.map → App-d1337a7f.js.map} +1 -1
- package/build/assets/{Chart-1795dab8.js → Chart-82eecb0c.js} +2 -2
- package/build/assets/{Chart-1795dab8.js.map → Chart-82eecb0c.js.map} +1 -1
- package/build/assets/{IrisGrid-2b244f28.js → IrisGrid-dd3eb44c.js} +2 -2
- package/build/assets/{IrisGrid-2b244f28.js.map → IrisGrid-dd3eb44c.js.map} +1 -1
- package/build/assets/{MarkdownEditor-7d94e5b3.js → MarkdownEditor-eb86631d.js} +2 -2
- package/build/assets/{MarkdownEditor-7d94e5b3.js.map → MarkdownEditor-eb86631d.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-cb1bee43.js → MarkdownNotebook-6676cbfb.js} +2 -2
- package/build/assets/{MarkdownNotebook-cb1bee43.js.map → MarkdownNotebook-6676cbfb.js.map} +1 -1
- package/build/assets/{index-f6c764e6.css → index-0b903f2c.css} +1 -1
- package/build/assets/{index-c9ce1790.js → index-970d8577.js} +2 -2
- package/build/assets/{index-c9ce1790.js.map → index-970d8577.js.map} +1 -1
- package/build/assets/{index-3ededa25.js → index-e47ad363.js} +19 -19
- package/build/assets/index-e47ad363.js.map +1 -0
- package/build/assets/{useChartTheme-6dac2e25.js → useChartTheme-c05b4335.js} +2 -2
- package/build/assets/{useChartTheme-6dac2e25.js.map → useChartTheme-c05b4335.js.map} +1 -1
- package/build/assets/{useConnection-da338dab.js → useConnection-7e182e96.js} +2 -2
- package/build/assets/{useConnection-da338dab.js.map → useConnection-7e182e96.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +7 -7
- package/build/assets/index-3ededa25.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as h,G as F,aY as ge,C as u,D as ye,E as N,R as Se,V as l,F as Te,aZ as be,L as we,a_ as Ee}from"./vendor-d0cd7930.js";import{T as Pe,L as P,aX as Oe,aS as Me,G as Fe,J as Ce,D as _e,F as Ne,K as De,z as xe,R as je,u as Le,r as Re,H as Ie,a7 as $e}from"./index-c9ce1790.js";import{c as ie,g as y}from"./useConnection-da338dab.js";function V(r,e,t,n,o,i,a){try{var s=r[i](a),c=s.value}catch(f){t(f);return}s.done?e(c):Promise.resolve(c).then(n,o)}function Ae(r){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(c){V(i,n,o,a,s,"next",c)}function s(c){V(i,n,o,a,s,"throw",c)}a(void 0)})}}function He(r){return $.apply(this,arguments)}function $(){return $=Ae(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(r)}catch{return z(r)}z(r)}),$.apply(this,arguments)}function z(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function G(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Ue(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?G(Object(t),!0).forEach(function(n){M(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):G(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function M(r,e,t){return e=Ke(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ke(r){var e=ke(r,"string");return typeof e=="symbol"?e:String(e)}function ke(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class A extends h.Component{constructor(e){super(e),M(this,"element",void 0),M(this,"container",void 0),M(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=F.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:n}=this.props;if(!e&&this.container.current!==null){var{options:o}=this.props;o=Ue({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},o),document.body.appendChild(this.element);var i=this.getVisibleElement(this.container.current);i==null&&(i=this.container.current),e=new ge(n||i,this.element,o),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var a=this.element.firstElementChild;a instanceof HTMLElement&&a.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:n,interactive:o,closeOnBlur:i}=this.props,{show:a}=this.state;return u.jsx(ye,{in:a,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:N("popper",{interactive:o},e),onBlur:i?this.handleBlur:void 0,tabIndex:i?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Se.createPortal(this.renderContent(),this.element)})}}M(A,"propTypes",{children:l.node.isRequired,options:l.shape({}),className:l.string,timeout:l.number,onEntered:l.func,onExited:l.func,isShown:l.bool,closeOnBlur:l.bool,interactive:l.bool,referenceObject:l.shape({}),"data-testid":l.string});M(A,"defaultProps",{options:{},className:"",timeout:Pe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const We=A;function B(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(n){v(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function v(r,e,t){return e=Ye(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ye(r){var e=Ve(r,"string");return typeof e=="symbol"?e:String(e)}function Ve(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ze=P.module("Tooltip");class m extends h.Component{static handleHidden(){m.shownTooltipCount-=1,m.shownTooltipCount===0&&(m.lastHiddenTime=Date.now())}static handleShown(){m.shownTooltipCount+=1}constructor(e){super(e),v(this,"container",void 0),v(this,"popper",void 0),v(this,"parent",void 0),v(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=F.createRef(),this.popper=F.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:n}=t,{isShown:o}=this.state;o!==n&&(o?m.handleShown():m.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&m.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){ze.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,n=e.clientY,{isShown:o}=this.state;if(!(!this.popper.current||!this.parent)){var i=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():o&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;(m.shownTooltipCount>0||Date.now()-m.lastHiddenTime<m.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:n,popperClassName:o,"data-testid":i,onEntered:a}=this.props,{isShown:s}=this.state,{options:c}=this.props;return c=Ze({placement:"bottom"},c),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":i,children:u.jsx(We,{className:N(o,"popper-tooltip"),options:c,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}v(m,"defaultTimeout",500);v(m,"defaultReshowTimeout",100);v(m,"triggerReshowThreshold",300);v(m,"shownTooltipCount",0);v(m,"lastHiddenTime",Date.now());v(m,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:m.defaultReshowTimeout,timeout:m.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Ge=m;var Be=3500,Xe=P.module("useCopyToClipboard");function qe(){var[r,e]=h.useState(!1),t=h.useRef(null),n=h.useCallback(o=>{He(o).then(()=>{e(!0)}).catch(i=>Xe.error("Unable to copy ".concat(o),`
|
|
1
|
+
import{r as h,G as F,aY as ge,C as u,D as ye,E as N,R as Se,V as l,F as Te,aZ as be,L as we,a_ as Ee}from"./vendor-d0cd7930.js";import{T as Pe,L as P,aX as Oe,aS as Me,G as Fe,J as Ce,D as _e,F as Ne,K as De,z as xe,R as je,u as Le,r as Re,H as Ie,a7 as $e}from"./index-970d8577.js";import{c as ie,g as y}from"./useConnection-7e182e96.js";function V(r,e,t,n,o,i,a){try{var s=r[i](a),c=s.value}catch(f){t(f);return}s.done?e(c):Promise.resolve(c).then(n,o)}function Ae(r){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(c){V(i,n,o,a,s,"next",c)}function s(c){V(i,n,o,a,s,"throw",c)}a(void 0)})}}function He(r){return $.apply(this,arguments)}function $(){return $=Ae(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(r)}catch{return z(r)}z(r)}),$.apply(this,arguments)}function z(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function G(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Ue(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?G(Object(t),!0).forEach(function(n){M(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):G(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function M(r,e,t){return e=Ke(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ke(r){var e=ke(r,"string");return typeof e=="symbol"?e:String(e)}function ke(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class A extends h.Component{constructor(e){super(e),M(this,"element",void 0),M(this,"container",void 0),M(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=F.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:n}=this.props;if(!e&&this.container.current!==null){var{options:o}=this.props;o=Ue({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},o),document.body.appendChild(this.element);var i=this.getVisibleElement(this.container.current);i==null&&(i=this.container.current),e=new ge(n||i,this.element,o),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var a=this.element.firstElementChild;a instanceof HTMLElement&&a.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:n,interactive:o,closeOnBlur:i}=this.props,{show:a}=this.state;return u.jsx(ye,{in:a,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:N("popper",{interactive:o},e),onBlur:i?this.handleBlur:void 0,tabIndex:i?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Se.createPortal(this.renderContent(),this.element)})}}M(A,"propTypes",{children:l.node.isRequired,options:l.shape({}),className:l.string,timeout:l.number,onEntered:l.func,onExited:l.func,isShown:l.bool,closeOnBlur:l.bool,interactive:l.bool,referenceObject:l.shape({}),"data-testid":l.string});M(A,"defaultProps",{options:{},className:"",timeout:Pe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const We=A;function B(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(n){v(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function v(r,e,t){return e=Ye(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ye(r){var e=Ve(r,"string");return typeof e=="symbol"?e:String(e)}function Ve(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ze=P.module("Tooltip");class m extends h.Component{static handleHidden(){m.shownTooltipCount-=1,m.shownTooltipCount===0&&(m.lastHiddenTime=Date.now())}static handleShown(){m.shownTooltipCount+=1}constructor(e){super(e),v(this,"container",void 0),v(this,"popper",void 0),v(this,"parent",void 0),v(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=F.createRef(),this.popper=F.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:n}=t,{isShown:o}=this.state;o!==n&&(o?m.handleShown():m.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&m.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){ze.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,n=e.clientY,{isShown:o}=this.state;if(!(!this.popper.current||!this.parent)){var i=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():o&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;(m.shownTooltipCount>0||Date.now()-m.lastHiddenTime<m.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:n,popperClassName:o,"data-testid":i,onEntered:a}=this.props,{isShown:s}=this.state,{options:c}=this.props;return c=Ze({placement:"bottom"},c),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":i,children:u.jsx(We,{className:N(o,"popper-tooltip"),options:c,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}v(m,"defaultTimeout",500);v(m,"defaultReshowTimeout",100);v(m,"triggerReshowThreshold",300);v(m,"shownTooltipCount",0);v(m,"lastHiddenTime",Date.now());v(m,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:m.defaultReshowTimeout,timeout:m.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Ge=m;var Be=3500,Xe=P.module("useCopyToClipboard");function qe(){var[r,e]=h.useState(!1),t=h.useRef(null),n=h.useCallback(o=>{He(o).then(()=>{e(!0)}).catch(i=>Xe.error("Unable to copy ".concat(o),`
|
|
2
2
|
`,i))},[]);return h.useEffect(()=>(t.current&&clearTimeout(t.current),r&&(t.current=setTimeout(()=>{e(!1)},Be)),()=>{t.current&&clearTimeout(t.current)}),[r]),[r,n]}var Je=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function X(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function q(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?X(Object(t),!0).forEach(function(n){Qe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qe(r,e,t){return e=et(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function et(r){var e=tt(r,"string");return typeof e=="symbol"?e:String(e)}function tt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function rt(r,e){if(r==null)return{};var t=nt(r,e),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function nt(r,e){if(r==null)return{};var t={},n=Object.keys(r),o,i;for(i=0;i<n.length;i++)o=n[i],!(e.indexOf(o)>=0)&&(t[o]=r[o]);return t}var ot=["primary","secondary","tertiary","success","danger","inline","ghost"],it=["group-end"];function at(r,e){switch(r){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return N("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function st(r){switch(r){case"group-end":return N("pl-2","pr-3")}}var j=F.forwardRef((r,e)=>{var{kind:t,variant:n,type:o,tooltip:i,icon:a,disabled:s=!1,active:c,onClick:f,onContextMenu:D,onMouseDown:g,onMouseUp:w,onMouseEnter:C,onMouseLeave:ue,onKeyDown:me,className:de,style:ce,children:U,tabIndex:he,"data-testid":pe,"aria-label":K}=r,fe=rt(r,Je),k;n&&(k=st(n));var R;a&&(R=F.isValidElement(a)?a:u.jsx(Te,{icon:a}));var W=R!=null&&U==null,ve=at(t,W),I;i!==void 0&&(I=typeof i=="string"?u.jsx(Ge,{children:i}):i);var Z=K;K===void 0&&W&&i!=null&&typeof i=="string"&&(Z=i);var Y=u.jsxs("button",q(q({"data-testid":pe,ref:e,type:o,className:N("btn",ve,k,{active:c},de),onClick:f,onContextMenu:D,onMouseUp:w,onMouseDown:g,onMouseEnter:C,onMouseLeave:ue,onKeyDown:me,style:ce,disabled:s,tabIndex:he,"aria-label":Z},fe),{},{children:[a&&R,U,i!=null&&!s&&I]}));return s&&i!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[Y,I]}):Y});j.displayName="Button";j.propTypes={kind:l.oneOf(ot).isRequired,variant:l.oneOf(it),type:l.oneOf(["submit","reset","button"]),tooltip(r){var{tooltip:e,icon:t,children:n}=r;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){var{children:e,icon:t}=r;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!F.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:l.bool,active:l.bool,onClick(r){var{onClick:e,type:t}=r;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:l.func,onMouseUp:l.func,onMouseDown:l.func,onMouseEnter:l.func,onMouseLeave:l.func,onKeyDown:l.func,tabIndex:l.number,children:l.node,className:l.string,style:l.object,"data-testid":l.string};j.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const lt=j;function ir(r){var{copy:e,kind:t="ghost",tooltip:n="Copy",className:o,style:i,"data-testid":a,children:s}=r,[c,f]=qe();return u.jsx(lt,{kind:t,className:o,style:i,"data-testid":a,icon:c?Oe:Me,tooltip:c?"Copied":n,onClick:()=>{f(typeof e=="function"?e():e)},children:s})}const ut={"dh-spectrum-palette":"_dh-spectrum-palette_llwuf_1"},mt={"dh-spectrum-alias":"_dh-spectrum-alias_1906d_1"};function J(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Q(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?J(Object(t),!0).forEach(function(n){dt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dt(r,e,t){return e=ct(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ct(r){var e=ht(r,"string");return typeof e=="symbol"?e:String(e)}function ht(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ee=Q(Q({},ut),mt);function te(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function x(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?te(Object(t),!0).forEach(function(n){pt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pt(r,e,t){return e=ft(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ft(r){var e=vt(r,"string");return typeof e=="symbol"?e:String(e)}function vt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var{global:gt,light:yt,dark:St,medium:Tt,large:bt}=be,wt={global:gt,light:x(x({},yt),ee),dark:x(x({},St),ee),medium:Tt,large:bt};function Et(r){var{children:e,isPortal:t=!1,theme:n=wt,colorScheme:o}=r,[i]=h.useState(t?we():null);return u.jsx(Ee,{UNSAFE_className:"spectrum-theme-provider",theme:n,colorScheme:o,"data-unique-id":i,children:e})}var Pt=P.module("ThemeProvider"),ae=h.createContext(null);function ar(r){var{themes:e,defaultPreloadValues:t=Le,children:n}=r,o=h.useMemo(()=>Fe(),[]),[i,a]=h.useState(null),[s,c]=h.useState(()=>{var g,w;return(g=(w=Ce())===null||w===void 0?void 0:w.themeKey)!==null&&g!==void 0?g:_e}),f=h.useMemo(()=>e==null?null:Ne(s,{base:o,custom:e??[]}),[o,s,e]),D=h.useMemo(()=>[...o,...e??[]],[o,e]);return h.useEffect(function(){if(!(f==null||e==null)){De(t);var w=xe(t);Pt.debug2("updateThemePreloadData:",{active:f.map(C=>C.themeKey),custom:e.map(C=>C.themeKey),preloadStyleContent:w,selectedThemeKey:s}),je({themeKey:s,preloadStyleContent:w})}},[f,s,e,t]),h.useEffect(()=>{a({activeThemes:f,selectedThemeKey:s,themes:D,setSelectedThemeKey:c})},[f,s,D]),u.jsxs(u.Fragment,{children:[f==null?null:u.jsx(u.Fragment,{children:f.map(g=>u.jsx("style",{"data-theme-key":g.themeKey,children:g.styleContent},g.themeKey))}),i==null?null:u.jsx(ae.Provider,{value:i,children:u.jsx(Et,{children:n})})]})}function Ot(){return ie(ae,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function H(r,e,t){return e=Mt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mt(r){var e=Ft(r,"string");return typeof e=="symbol"?e:String(e)}function Ft(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class L{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}H(L,"TYPE_GLOBAL","type-global");H(L,"TYPE_CONTEXT_PRESET","type-context-preset");H(L,"TYPE_CONTEXT_CUSTOM","type-context-custom");const p=L;class Ct extends p{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const _t=Ct;class Nt extends p{format(e){return String.fromCharCode(e)}}const Dt=Nt;function E(r,e,t){return e=xt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xt(r){var e=jt(r,"string");return typeof e=="symbol"?e:String(e)}function jt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var re=P.module("DateTimeColumnFormatter");class S extends p{static isValid(e,t){try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var n=t?"'T'":" ",o=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(o)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(o)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(o)]])}static getGlobalFormats(e,t){var n=S.makeGlobalFormatStringMap(e,t);return[...n.keys()]}static makeFormatStringMap(e,t){var n=t!==void 0&&t?"'T'":" ",o=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(o)],["MM-dd-yyyy","MM-dd-yyyy".concat(o)],["HH:mm:ss","HH:mm:ss".concat(o)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(o)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(o)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(o)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(o)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(o)]])}static getFormats(e,t){var n=S.makeFormatStringMap(e,t);return[...n.keys()]}constructor(e){var{timeZone:t="",showTimeZone:n=!0,showTSeparator:o=!1,defaultDateTimeFormatString:i=S.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),E(this,"dh",void 0),E(this,"dhTimeZone",void 0),E(this,"defaultDateTimeFormatString",void 0),E(this,"showTimeZone",void 0),E(this,"showTSeparator",void 0),E(this,"formatStringMap",void 0);var a=t||S.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{re.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(S.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=i,this.showTimeZone=n,this.showTSeparator=o,this.formatStringMap=S.makeFormatStringMap(n,o)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,o=this.getEffectiveFormatString(n);try{return this.dh.i18n.DateTimeFormat.format(o,e,this.dhTimeZone)}catch{re.error("Invalid format arguments")}return""}}E(S,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");E(S,"DEFAULT_TIME_ZONE_ID","America/New_York");function b(r,e,t){return e=Lt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lt(r){var e=Rt(r,"string");return typeof e=="symbol"?e:String(e)}function Rt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var It=P.module("DecimalColumnFormatter");class d extends p{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.TYPE_CONTEXT_PRESET,o=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:o}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return d.makeFormat(e,t,p.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return d.makeFormat("Custom Format",e,p.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=d.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),b(this,"defaultFormatString",void 0),b(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,o=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,o)}catch{It.error("Invalid format arguments")}return""}}b(d,"DEFAULT_FORMAT_STRING","###,##0.0000");b(d,"FORMAT_PERCENT",d.makePresetFormat("Percent","##0.00%"));b(d,"FORMAT_BASIS_POINTS",d.makePresetFormat("Basis Points","###,##0 bp",1e4));b(d,"FORMAT_MILLIONS",d.makePresetFormat("Millions","###,##0.000 mm",1e-6));b(d,"FORMAT_SCIENTIFIC_NOTATION",d.makePresetFormat("Scientific Notation","0.0000E0"));b(d,"FORMAT_ROUND",d.makePresetFormat("Round","###,##0"));b(d,"FORMAT_ROUND_TWO_DECIMALS",d.makePresetFormat("0.00","###,##0.00"));b(d,"FORMAT_ROUND_FOUR_DECIMALS",d.makePresetFormat("0.0000","###,##0.0000"));class $t extends p{format(e){return"".concat(e)}}const At=$t;function _(r,e,t){return e=Ht(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ht(r){var e=Ut(r,"string");return typeof e=="symbol"?e:String(e)}function Ut(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Kt=P.module("IntegerColumnFormatter");class T extends p{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.TYPE_CONTEXT_PRESET,o=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:o}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return T.makeFormat(e,t,p.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return T.makeFormat("Custom Format",e,p.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=T.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_(this,"dh",void 0),_(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,o=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,o)}catch{Kt.error("Invalid format arguments")}return""}}_(T,"DEFAULT_FORMAT_STRING","###,##0");_(T,"FORMAT_MILLIONS",T.makePresetFormat("Millions","###,##0.000 mm",1e-6));_(T,"FORMAT_SCIENTIFIC_NOTATION",T.makePresetFormat("Scientific Notation","0.0000E0"));class kt extends p{format(e){return e}}function O(r,e,t){return e=Wt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wt(r){var e=Zt(r,"string");return typeof e=="symbol"?e:String(e)}function Zt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class se{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{var o=y.getNormalizedType(n.columnType);if(o===null)return t;t.has(o)||t.set(o,new Map);var i=t.get(o);return i==null||i.set(n.columnName,n.format),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!0,c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!0;O(this,"defaultColumnFormatter",void 0),O(this,"typeFormatterMap",void 0),O(this,"columnFormatMap",void 0),O(this,"truncateNumbersWithPound",void 0),O(this,"showEmptyStrings",void 0),O(this,"showNullStrings",void 0),this.defaultColumnFormatter=new At,this.typeFormatterMap=new Map([[y.dataType.BOOLEAN,new _t],[y.dataType.CHAR,new Dt],[y.dataType.DATETIME,new S(e,n)],[y.dataType.DECIMAL,new d(e,o)],[y.dataType.INT,new T(e,i)],[y.dataType.STRING,new kt]]),this.columnFormatMap=se.makeColumnFormatMap(t),this.truncateNumbersWithPound=a,this.showEmptyStrings=s,this.showNullStrings=c}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=y.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){var n,o=this.getColumnFormatMapForType(e);return(n=o==null?void 0:o.get(t))!==null&&n!==void 0?n:null}getColumnTypeFormatter(e){var t=y.getNormalizedType(e),n=this.defaultColumnFormatter;if(t){var o;n=(o=this.typeFormatterMap.get(t))!==null&&o!==void 0?o:n}return n}getFormattedString(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var i=this.getColumnTypeFormatter(t),a=o||this.getColumnFormat(t,n);return i.format(e,a??void 0)}get timeZone(){var e,t=this.typeFormatterMap.get(y.dataType.DATETIME);return t==null||(e=t.dhTimeZone)===null||e===void 0?void 0:e.id}}function Yt(r){if(r&&r.formatter){var{formatter:e}=r;return e}}function Vt(r){return{timeZone:r==null?void 0:r.timeZone,defaultDateTimeFormatString:r==null?void 0:r.defaultDateTimeFormat,showTimeZone:r==null?void 0:r.showTimeZone,showTSeparator:r==null?void 0:r.showTSeparator}}function zt(r,e,t){var n=r.getColumnFormat(t,e);return n!=null&&(n.type===p.TYPE_CONTEXT_PRESET||n.type===p.TYPE_CONTEXT_CUSTOM)}const sr={getColumnFormats:Yt,getDateTimeFormatterOptions:Vt,isCustomColumnFormatDefined:zt};function Gt(r,e,t){return e=Bt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bt(r){var e=Xt(r,"string");return typeof e=="symbol"?e:String(e)}function Xt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class lr extends Error{constructor(){super(...arguments),Gt(this,"isDownsamplingError",!0)}}const qt="var(--dh-color-chart-colorway)",Jt="var(--dh-color-chart-grid)",Qt="var(--dh-color-chart-axis-line)",er="var(--dh-color-chart-axis-line-zero)",ne={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:qt,gridcolor:Jt,linecolor:Qt,zerolinecolor:er,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var oe=P.module("ChartTheme");function tr(){var r,e=Re(ne);return e.colorway=Ie((r=e.colorway)!==null&&r!==void 0?r:"").map(t=>{var[n,o]=t;return $e.normalizeCssColor(e.colorway.substring(n,o+1))}).join(" "),oe.debug2("Chart theme:",ne),oe.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"]})}var le=h.createContext(null);function ur(r){var{children:e}=r,{activeThemes:t}=Ot(),n=h.useMemo(tr,[t]);return u.jsx(le.Provider,{value:n,children:e})}function mr(){return ie(le,"No ChartThemeContext value found.")}export{lt as B,ir as C,S as D,se as F,T as I,We as P,kt as S,Ge as T,Ot as a,ae as b,ar as c,_t as d,Dt as e,d as f,At as g,sr as h,p as i,Yt as j,Vt as k,zt as l,tr as m,le as n,ur as o,lr as p,mr as q,He as r,wt as t,qe as u};
|
|
3
|
-
//# sourceMappingURL=useChartTheme-
|
|
3
|
+
//# sourceMappingURL=useChartTheme-c05b4335.js.map
|