lightweight-charts-react-components 0.2.0 → 0.2.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/README.md CHANGED
@@ -105,7 +105,8 @@ tbd
105
105
 
106
106
  ## Examples
107
107
 
108
- tbd
108
+ The [examples](https://github.com/ukorvl/lightweight-charts-react-components/blob/main/examples/) app itself is a [Demo](https://ukorvl.github.io/lightweight-charts-react-components/) web application, but it contains a lot of examples of how to use the library. You can find the source code in the [samples folder](https://github.com/ukorvl/lightweight-charts-react-components/blob/main/examples/src/samples).
109
+ You can run and test the code locally by cloning the repository and running the examples app.
109
110
 
110
111
  ## Contributing
111
112
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**!
3
- * lightweight-charts-react-components v0.2.0
3
+ * lightweight-charts-react-components v0.2.1
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE.md file in the root directory of this source tree.
@@ -15,21 +15,21 @@ import { IChartApi } from 'lightweight-charts';
15
15
  import type { ICustomSeriesPaneView } from 'lightweight-charts';
16
16
  import { IImageWatermarkPluginApi } from 'lightweight-charts';
17
17
  import { ImageWatermarkOptions } from 'lightweight-charts';
18
- import { IPriceLine } from 'lightweight-charts';
18
+ import type { IPriceLine } from 'lightweight-charts';
19
19
  import type { IPriceScaleApi } from 'lightweight-charts';
20
20
  import type { IRange } from 'lightweight-charts';
21
21
  import type { ISeriesApi } from 'lightweight-charts';
22
- import { ISeriesMarkersPluginApi } from 'lightweight-charts';
22
+ import type { ISeriesMarkersPluginApi } from 'lightweight-charts';
23
23
  import { ITextWatermarkPluginApi } from 'lightweight-charts';
24
24
  import type { ITimeScaleApi } from 'lightweight-charts';
25
25
  import type { LogicalRangeChangeEventHandler } from 'lightweight-charts';
26
26
  import { MouseEventHandler } from 'lightweight-charts';
27
- import { PriceLineOptions } from 'lightweight-charts';
27
+ import type { PriceLineOptions } from 'lightweight-charts';
28
28
  import type { PriceScaleOptions as PriceScaleOptions_2 } from 'lightweight-charts';
29
29
  import { ReactNode } from 'react';
30
30
  import { RefAttributes } from 'react';
31
31
  import type { SeriesDataItemTypeMap } from 'lightweight-charts';
32
- import { SeriesMarker } from 'lightweight-charts';
32
+ import type { SeriesMarker } from 'lightweight-charts';
33
33
  import type { SeriesPartialOptionsMap } from 'lightweight-charts';
34
34
  import type { SizeChangeEventHandler } from 'lightweight-charts';
35
35
  import { TextWatermarkOptions } from 'lightweight-charts';
@@ -37,8 +37,6 @@ import { Time } from 'lightweight-charts';
37
37
  import { TimeChartOptions } from 'lightweight-charts';
38
38
  import type { TimeRangeChangeEventHandler } from 'lightweight-charts';
39
39
  import type { TimeScaleOptions as TimeScaleOptions_2 } from 'lightweight-charts';
40
- import { WatermarkImageApiRefBase as WatermarkImageApiRefBase_2 } from './types';
41
- import { WatermarkTextApiRefBase as WatermarkTextApiRefBase_2 } from './types';
42
40
 
43
41
  export declare const AreaSeries: ForwardRefExoticComponent<SeriesProps<"Area"> & RefAttributes<SeriesApiRef<"Area">>>;
44
42
 
@@ -64,7 +62,7 @@ export declare type ChartApiRef = {
64
62
  clear: () => void;
65
63
  };
66
64
 
67
- export declare type ChartOptions = {
65
+ declare type ChartOptions = {
68
66
  onClick?: MouseEventHandler<Time>;
69
67
  onCrosshairMove?: MouseEventHandler<Time>;
70
68
  onInit?: (chart: IChartApi) => void;
@@ -77,26 +75,16 @@ export declare type ChartProps = {
77
75
 
78
76
  export declare const CustomSeries: ForwardRefExoticComponent<SeriesProps<"Custom"> & RefAttributes<SeriesApiRef<"Custom">>>;
79
77
 
80
- export declare type CustomSeriesUniqueProps = {
78
+ declare type CustomSeriesUniqueProps = {
81
79
  plugin?: ICustomSeriesPaneView;
82
80
  };
83
81
 
84
82
  export declare const HistogramSeries: ForwardRefExoticComponent<SeriesProps<"Histogram"> & RefAttributes<SeriesApiRef<"Histogram">>>;
85
83
 
86
- export declare interface IChartContext {
87
- chartApiRef: ChartApiRef | null;
88
- initialized: boolean;
89
- }
90
-
91
84
  export declare type ImageWatermarkProps = {
92
85
  src: string;
93
86
  } & DeepPartial<ImageWatermarkOptions>;
94
87
 
95
- export declare interface ISeriesContext {
96
- seriesApiRef: SeriesApiRef<SeriesType> | null;
97
- initialized: boolean;
98
- }
99
-
100
88
  export declare const LineSeries: ForwardRefExoticComponent<SeriesProps<"Line"> & RefAttributes<SeriesApiRef<"Line">>>;
101
89
 
102
90
  export declare const Markers: ForwardRefExoticComponent<MarkersProps & RefAttributes<MarkersApiRef>>;
@@ -137,7 +125,7 @@ export declare type PriceScaleApiRef = {
137
125
  clear: () => void;
138
126
  };
139
127
 
140
- export declare type PriceScaleOptions = DeepPartial<PriceScaleOptions_2>;
128
+ declare type PriceScaleOptions = DeepPartial<PriceScaleOptions_2>;
141
129
 
142
130
  export declare type PriceScaleProps = {
143
131
  options?: PriceScaleOptions;
@@ -153,7 +141,7 @@ export declare type SeriesApiRef<T extends SeriesType> = {
153
141
 
154
142
  export declare type SeriesOptions<T extends SeriesType> = SeriesPartialOptionsMap[T];
155
143
 
156
- export declare type SeriesParameters<T extends SeriesType> = {
144
+ declare type SeriesParameters<T extends SeriesType> = {
157
145
  data: SeriesDataItemTypeMap[T][];
158
146
  reactive?: boolean;
159
147
  options?: SeriesOptions<T>;
@@ -161,7 +149,7 @@ export declare type SeriesParameters<T extends SeriesType> = {
161
149
 
162
150
  export declare type SeriesProps<T extends SeriesType> = Omit<SeriesTemplateProps<T>, "type">;
163
151
 
164
- export declare type SeriesTemplateProps<T extends SeriesType> = {
152
+ declare type SeriesTemplateProps<T extends SeriesType> = {
165
153
  type: T;
166
154
  children?: ReactNode;
167
155
  } & SeriesParameters<T>;
@@ -179,7 +167,7 @@ export declare type TimeScaleApiRef = {
179
167
  clear: () => void;
180
168
  };
181
169
 
182
- export declare type TimeScaleOptions = DeepPartial<TimeScaleOptions_2>;
170
+ declare type TimeScaleOptions = DeepPartial<TimeScaleOptions_2>;
183
171
 
184
172
  export declare type TimeScaleProps = {
185
173
  onVisibleTimeRangeChange?: TimeRangeChangeEventHandler<Time>;
@@ -194,22 +182,28 @@ export declare type WatermarkApiRef<T extends WatermarkType> = T extends "text"
194
182
 
195
183
  export declare const WatermarkImage: ForwardRefExoticComponent< {
196
184
  src: string;
197
- } & DeepPartial<ImageWatermarkOptions> & RefAttributes<WatermarkImageApiRefBase_2>>;
198
-
199
- export declare type WatermarkImageApiRefBase = {
185
+ } & DeepPartial<ImageWatermarkOptions> & RefAttributes< {
186
+ _watermark: IImageWatermarkPluginApi<Time> | null;
187
+ api: () => IImageWatermarkPluginApi<Time> | null;
188
+ init: () => IImageWatermarkPluginApi<Time> | null;
189
+ clear: () => void;
190
+ }>>;
191
+
192
+ declare type WatermarkImageApiRefBase = {
200
193
  _watermark: IImageWatermarkPluginApi<Time> | null;
201
194
  api: () => IImageWatermarkPluginApi<Time> | null;
202
195
  init: () => IImageWatermarkPluginApi<Time> | null;
203
196
  clear: () => void;
204
197
  };
205
198
 
206
- export declare type WatermarkProps<T extends WatermarkType> = {
207
- type: T;
208
- } & (T extends "text" ? TextWatermarkProps : ImageWatermarkProps);
209
-
210
- export declare const WatermarkText: ForwardRefExoticComponent<DeepPartial<TextWatermarkOptions> & RefAttributes<WatermarkTextApiRefBase_2>>;
199
+ export declare const WatermarkText: ForwardRefExoticComponent<DeepPartial<TextWatermarkOptions> & RefAttributes< {
200
+ _watermark: ITextWatermarkPluginApi<Time> | null;
201
+ api: () => ITextWatermarkPluginApi<Time> | null;
202
+ init: () => ITextWatermarkPluginApi<Time> | null;
203
+ clear: () => void;
204
+ }>>;
211
205
 
212
- export declare type WatermarkTextApiRefBase = {
206
+ declare type WatermarkTextApiRefBase = {
213
207
  _watermark: ITextWatermarkPluginApi<Time> | null;
214
208
  api: () => ITextWatermarkPluginApi<Time> | null;
215
209
  init: () => ITextWatermarkPluginApi<Time> | null;
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**!
3
- * lightweight-charts-react-components v0.2.0
3
+ * lightweight-charts-react-components v0.2.1
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE.md file in the root directory of this source tree.
@@ -8,5 +8,5 @@
8
8
  * @license MIT
9
9
  */
10
10
 
11
- "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BarSeries:function(){return BarSeries},CustomSeries:function(){return series_CustomSeries},Chart:function(){return ChartWrapper},BaselineSeries:function(){return BaselineSeries},LineSeries:function(){return series_LineSeries},CandlestickSeries:function(){return series_CandlestickSeries},PriceLine:function(){return priceLine_PriceLine},WatermarkImage:function(){return WatermarkImage},HistogramSeries:function(){return series_HistogramSeries},Markers:function(){return markers_Markers},TimeScale:function(){return TimeScale},AreaSeries:function(){return series_AreaSeries},WatermarkText:function(){return WatermarkText},PriceScale:function(){return PriceScale}});var jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),ChartContext=(0,external_react_namespaceObject.createContext)({chartApiRef:null,initialized:!1});ChartContext.displayName="ChartContext";var external_lightweight_charts_namespaceObject=require("lightweight-charts");function _array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_without_properties(e,r){if(null==e)return{};var t,n,i=_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function _object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function _sliced_to_array(e,r){return _array_with_holes(e)||_iterable_to_array_limit(e,r)||_unsupported_iterable_to_array(e,r)||_non_iterable_rest()}function _unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return _array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _array_like_to_array(e,r)}}var useChart=function(e){var r=e.container,t=_object_without_properties(e,["container"]),n=t.onClick,i=t.onCrosshairMove,a=t.onInit,o=_object_without_properties(t,["onClick","onCrosshairMove","onInit"]),c=_sliced_to_array((0,external_react_namespaceObject.useState)(!1),2),s=c[0],u=c[1],l=(0,external_react_namespaceObject.useRef)({_chart:null,api:function(){return this._chart},init:function(){return null===this._chart&&(this._chart=(0,external_lightweight_charts_namespaceObject.createChart)(r,o),a&&a(this._chart)),s||u(!0),this._chart},clear:function(){null!==this._chart&&(u(!1),this._chart.remove(),this._chart=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return l.current.init(),function(){l.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(n){var e;null===(e=l.current.api())||void 0===e||e.subscribeClick(n)}return function(){if(n){var e;null===(e=l.current.api())||void 0===e||e.unsubscribeClick(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(i){var e;null===(e=l.current.api())||void 0===e||e.subscribeCrosshairMove(i)}return function(){if(i){var e;null===(e=l.current.api())||void 0===e||e.unsubscribeCrosshairMove(i)}}}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;r&&(null===(e=l.current.api())||void 0===e||e.applyOptions(o))},[o]),{chartApiRef:l,initialized:s}};function _define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){_define_property(e,r,t[r])})}return e}function ChartComponent_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartComponent_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartComponent_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var ChartComponent=function(e){var r=e.children,t=useChart(_object_spread({container:e.container},ChartComponent_object_without_properties(e,["children","container"]))),n=t.chartApiRef.current,i=t.initialized;return(0,jsx_runtime_namespaceObject.jsx)(ChartContext.Provider,{value:{chartApiRef:n,initialized:i},children:r})},chart_ChartComponent=ChartComponent;function ChartWrapper_array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ChartWrapper_array_with_holes(e){if(Array.isArray(e))return e}function ChartWrapper_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ChartWrapper_iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function ChartWrapper_non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ChartWrapper_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){ChartWrapper_define_property(e,r,t[r])})}return e}function ChartWrapper_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ChartWrapper_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ChartWrapper_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartWrapper_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartWrapper_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function ChartWrapper_sliced_to_array(e,r){return ChartWrapper_array_with_holes(e)||ChartWrapper_iterable_to_array_limit(e,r)||ChartWrapper_unsupported_iterable_to_array(e,r)||ChartWrapper_non_iterable_rest()}function ChartWrapper_unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return ChartWrapper_array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ChartWrapper_array_like_to_array(e,r)}}var ChartRenderFunction=function(e,r){var t=e.children,n=e.className,i=ChartWrapper_object_without_properties(e,["children","className"]),a=ChartWrapper_sliced_to_array((0,external_react_namespaceObject.useState)(),2),o=a[0],c=a[1],s=(0,external_react_namespaceObject.useCallback)(function(e){c(e),r&&("function"==typeof r?s(e):r.current=e)},[r]);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:n,children:!!o&&(0,jsx_runtime_namespaceObject.jsx)(chart_ChartComponent,_object_spread_props(ChartWrapper_object_spread({container:o},i),{children:t}))})},ChartWrapper_ChartWrapper=(0,external_react_namespaceObject.forwardRef)(ChartRenderFunction);ChartWrapper_ChartWrapper.displayName="ChartWrapper";var ChartWrapper=ChartWrapper_ChartWrapper,useSafeContext=function(e){var r=(0,external_react_namespaceObject.useContext)(e);if(!r){var t=e.name;throw Error("".concat(t," not found. You can access context value only inside its Provider."))}return r},useTimeScale=function(e){var r=e.onVisibleTimeRangeChange,t=e.onVisibleLogicalRangeChange,n=e.onSizeChange,i=e.visibleRange,a=e.visibleLogicalRange,o=e.options,c=void 0===o?{}:o,s=useSafeContext(ChartContext),u=s.initialized,l=s.chartApiRef;if(!l)throw Error("Chart context not found");var _=(0,external_react_namespaceObject.useRef)({_timeScale:null,api:function(){return this._timeScale},init:function(){if(!this._timeScale){var e=null==l?void 0:l.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(c),i&&this._timeScale.setVisibleRange(i),a&&this._timeScale.setVisibleLogicalRange(a)}return this._timeScale},clear:function(){this._timeScale=null}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){u&&_.current.init()},[u]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){_.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&c){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(c)}},[c]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(n){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(n)}return function(){if(n){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(t){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(t)}return function(){if(t){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(t)}}}},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(r){var e,t;null===(t=_.current)||void 0===t||null===(e=t.api())||void 0===e||e.subscribeVisibleTimeRangeChange(r)}return function(){if(r){var e,t;null===(t=_.current)||void 0===t||null===(e=t.api())||void 0===e||e.unsubscribeVisibleTimeRangeChange(r)}}}},[r]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&i){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(i)}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&a){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(a)}},[a]),_},TimeScaleRenderFunction=function(e,r){var t=useTimeScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},TimeScale_TimeScale=(0,external_react_namespaceObject.forwardRef)(TimeScaleRenderFunction);TimeScale_TimeScale.displayName="TimeScale";var TimeScale=TimeScale_TimeScale;function usePriceScale_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function usePriceScale_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){usePriceScale_define_property(e,r,t[r])})}return e}var usePriceScale=function(e){var r=e.options,t=void 0===r?{}:r,n=e.id,i=useSafeContext(ChartContext),a=i.initialized,o=i.chartApiRef,c=(0,external_react_namespaceObject.useRef)({_priceScale:null,api:function(){return this._priceScale},init:function(){if(!this._priceScale){var e=null==o?void 0:o.api();if(!e)return null;this._priceScale=e.priceScale(n),this._priceScale.applyOptions(usePriceScale_object_spread({},t))}return this._priceScale},setId:function(e){null!==this._priceScale&&null!==o&&(this._priceScale=o.api().priceScale(e))},clear:function(){this._priceScale=null}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){a&&c.current.init()},[a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){c.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;o&&(null===(e=c.current)||void 0===e||e.setId(n))},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&t){var e,r;null===(r=c.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(t)}},[t]),c},PriceScaleRenderFunction=function(e,r){var t=usePriceScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceScale_PriceScale=(0,external_react_namespaceObject.forwardRef)(PriceScaleRenderFunction);PriceScale_PriceScale.displayName="PriceScale";var PriceScale=PriceScale_PriceScale,package_namespaceObject={i8:"0.2.0"};function _assert_this_initialized(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _call_super(e,r,t){return r=_get_prototype_of(r),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(r,t||[],_get_prototype_of(e).constructor):r.apply(e,t))}function _class_call_check(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function _construct(e,r,t){return(_construct=_is_native_reflect_construct()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var i=new(Function.bind.apply(e,n));return t&&_set_prototype_of(i,t.prototype),i}).apply(null,arguments)}function InternalError_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _get_prototype_of(e){return(_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&_set_prototype_of(e,r)}function _is_native_function(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function _possible_constructor_return(e,r){return r&&("object"===_type_of(r)||"function"==typeof r)?r:_assert_this_initialized(e)}function _set_prototype_of(e,r){return(_set_prototype_of=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _wrap_native_super(e){var r="function"==typeof Map?new Map:void 0;return(_wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(t,e)})(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}var docsBaseUrl="https://tradingview.github.io/lightweight-charts/docs/4.2",InternalError_BaseInternalError=function(e){function r(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.isOperational,o=i.cause,c=i.docsPath;return _class_call_check(this,r),InternalError_define_property(t=_call_super(this,r,[e]),"isOperational",void 0),InternalError_define_property(t,"cause",void 0),t.name=null!==(n=t.constructor.name)&&void 0!==n?n:"InternalError",t.isOperational=void 0===a||a,t.cause=o,t.message="".concat(null!=e?e:"An error occurred"),c&&(t.message="".concat(t.message,"\n Docs: see ").concat(docsBaseUrl+c)),package_namespaceObject.i8&&(t.message="".concat(t.message,"\n Version: lightweight-charts-react-components/").concat(package_namespaceObject.i8)),Object.setPrototypeOf(t,r.prototype),t}return _inherits(r,e),r}(_wrap_native_super(Error));function useSeries_array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function useSeries_array_with_holes(e){if(Array.isArray(e))return e}function useSeries_iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function useSeries_non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function useSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=useSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function useSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function useSeries_sliced_to_array(e,r){return useSeries_array_with_holes(e)||useSeries_iterable_to_array_limit(e,r)||useSeries_unsupported_iterable_to_array(e,r)||useSeries_non_iterable_rest()}function useSeries_unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return useSeries_array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return useSeries_array_like_to_array(e,r)}}var useSeries=function(e){var r=e.type,t=e.data,n=e.options,i=void 0===n?{}:n,a=e.reactive,o=void 0===a||a,c=useSeries_object_without_properties(e,["type","data","options","reactive"]),s=useSafeContext(ChartContext),u=s.initialized,l=s.chartApiRef,_=useSeries_sliced_to_array((0,external_react_namespaceObject.useState)(!1),2),p=_[0],f=_[1],b=(0,external_react_namespaceObject.useRef)({_series:null,api:function(){return this._series},init:function(){if(!this._series){var e,n=null==l?void 0:l.api();if(!n)return null;if("Custom"===r){var a=c.plugin;if(!a)throw new InternalError_BaseInternalError("Custom series requires a plugin to be defined");this._series=n.addCustomSeries(a,i)}else this._series=n.addSeries(seriesMap[r],i);f(!0),null===(e=this._series)||void 0===e||e.setData(t)}return this._series},clear:function(){if(null!==this._series){var e;null==l||null===(e=l.api())||void 0===e||e.removeSeries(this._series),this._series=null,f(!1)}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){u&&b.current.init()},[u]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){b.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&t&&o){var e;null===(e=b.current.api())||void 0===e||e.setData(t)}},[t,o]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&i){var e;null===(e=b.current.api())||void 0===e||e.applyOptions(i)}},[i]),{initialized:p,seriesApiRef:b}},seriesMap={Line:external_lightweight_charts_namespaceObject.LineSeries,Candlestick:external_lightweight_charts_namespaceObject.CandlestickSeries,Histogram:external_lightweight_charts_namespaceObject.HistogramSeries,Area:external_lightweight_charts_namespaceObject.AreaSeries,Baseline:external_lightweight_charts_namespaceObject.BaselineSeries,Bar:external_lightweight_charts_namespaceObject.BarSeries},SeriesContext=(0,external_react_namespaceObject.createContext)({seriesApiRef:null,initialized:!1});function SeriesTemplate_object_without_properties(e,r){if(null==e)return{};var t,n,i=SeriesTemplate_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function SeriesTemplate_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}SeriesContext.displayName="SeriesContext";var SeriesTemplateRenderFunction=function(e,r){var t=e.children,n=useSeries(SeriesTemplate_object_without_properties(e,["children"])),i=n.seriesApiRef.current,a=n.initialized;return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return i},[i]),(0,jsx_runtime_namespaceObject.jsx)(SeriesContext.Provider,{value:{seriesApiRef:i,initialized:a},children:t})},SeriesTemplate=(0,external_react_namespaceObject.forwardRef)(SeriesTemplateRenderFunction);SeriesTemplate.displayName="SeriesTemplate";var series_SeriesTemplate=SeriesTemplate;function LineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function LineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){LineSeries_define_property(e,r,t[r])})}return e}function LineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function LineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function LineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=LineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function LineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var LineSeriesRenderFunction=function(e,r){var t=e.children,n=LineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,LineSeries_object_spread_props(LineSeries_object_spread({type:"Line",ref:r},n),{children:t}))},LineSeries=(0,external_react_namespaceObject.forwardRef)(LineSeriesRenderFunction);LineSeries.displayName="LineSeries";var series_LineSeries=LineSeries;function HistogramSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function HistogramSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){HistogramSeries_define_property(e,r,t[r])})}return e}function HistogramSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function HistogramSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HistogramSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function HistogramSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=HistogramSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function HistogramSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var HistogramSeriesRenderFunction=function(e,r){var t=e.children,n=HistogramSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,HistogramSeries_object_spread_props(HistogramSeries_object_spread({type:"Histogram",ref:r},n),{children:t}))},HistogramSeries=(0,external_react_namespaceObject.forwardRef)(HistogramSeriesRenderFunction);HistogramSeries.displayName="HistogramSeries";var series_HistogramSeries=HistogramSeries;function CandlestickSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CandlestickSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CandlestickSeries_define_property(e,r,t[r])})}return e}function CandlestickSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CandlestickSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CandlestickSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CandlestickSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CandlestickSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function CandlestickSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var CandlestickSeriesRenderFunction=function(e,r){var t=e.children,n=CandlestickSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CandlestickSeries_object_spread_props(CandlestickSeries_object_spread({type:"Candlestick",ref:r},n),{children:t}))},CandlestickSeries=(0,external_react_namespaceObject.forwardRef)(CandlestickSeriesRenderFunction);CandlestickSeries.displayName="CandlestickSeries";var series_CandlestickSeries=CandlestickSeries;function AreaSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function AreaSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){AreaSeries_define_property(e,r,t[r])})}return e}function AreaSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function AreaSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AreaSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function AreaSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=AreaSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function AreaSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var AreaSeriesRenderFunction=function(e,r){var t=e.children,n=AreaSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,AreaSeries_object_spread_props(AreaSeries_object_spread({type:"Area",ref:r},n),{children:t}))},AreaSeries=(0,external_react_namespaceObject.forwardRef)(AreaSeriesRenderFunction);AreaSeries.displayName="AreaSeries";var series_AreaSeries=AreaSeries;function BaselineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BaselineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BaselineSeries_define_property(e,r,t[r])})}return e}function BaselineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BaselineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BaselineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BaselineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BaselineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BaselineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BaselineSeriesRenderFunction=function(e,r){var t=e.children,n=BaselineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BaselineSeries_object_spread_props(BaselineSeries_object_spread({type:"Baseline",ref:r},n),{children:t}))},BaselineSeries_BaselineSeries=(0,external_react_namespaceObject.forwardRef)(BaselineSeriesRenderFunction);BaselineSeries_BaselineSeries.displayName="BaselineSeries";var BaselineSeries=BaselineSeries_BaselineSeries;function BarSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BarSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BarSeries_define_property(e,r,t[r])})}return e}function BarSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BarSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BarSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BarSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BarSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BarSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BarSeriesRenderFunction=function(e,r){var t=e.children,n=BarSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BarSeries_object_spread_props(BarSeries_object_spread({type:"Bar",ref:r},n),{children:t}))},BarSeries_BarSeries=(0,external_react_namespaceObject.forwardRef)(BarSeriesRenderFunction);BarSeries_BarSeries.displayName="BarSeries";var BarSeries=BarSeries_BarSeries;function CustomSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CustomSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CustomSeries_define_property(e,r,t[r])})}return e}function CustomSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CustomSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CustomSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CustomSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CustomSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function CustomSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var CustomSeriesRenderFunction=function(e,r){var t=e.children,n=CustomSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CustomSeries_object_spread_props(CustomSeries_object_spread({type:"Custom",ref:r},n),{children:t}))},CustomSeries=(0,external_react_namespaceObject.forwardRef)(CustomSeriesRenderFunction);CustomSeries.displayName="CustomSeries";var series_CustomSeries=CustomSeries;function usePriceLine_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function usePriceLine_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){usePriceLine_define_property(e,r,t[r])})}return e}var usePriceLine=function(e){var r=e.options,t=e.price,n=useSafeContext(SeriesContext),i=n.initialized,a=n.seriesApiRef,o=(0,external_react_namespaceObject.useRef)({_priceLine:null,api:function(){return this._priceLine},init:function(){if(!this._priceLine){var e=null==a?void 0:a.api();if(!e)return null;this._priceLine=e.createPriceLine(usePriceLine_object_spread({price:t},r))}return this._priceLine},clear:function(){if(null!==this._priceLine){var e;null==a||null===(e=a.api())||void 0===e||e.removePriceLine(this._priceLine),this._priceLine=null}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){i&&o.current.init()},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){o.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(a&&r){var e;null===(e=o.current.api())||void 0===e||e.applyOptions(r)}},[r]),o},PriceLineRenderFunction=function(e,r){var t=usePriceLine(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceLine=(0,external_react_namespaceObject.forwardRef)(PriceLineRenderFunction);PriceLine.displayName="PriceLine";var priceLine_PriceLine=PriceLine,useMarkers=function(e){var r=e.reactive,t=void 0===r||r,n=e.markers,i=useSafeContext(SeriesContext),a=i.initialized,o=i.seriesApiRef,c=(0,external_react_namespaceObject.useRef)({_markers:null,api:function(){return this._markers},init:function(){if(null===this._markers){var e=null==o?void 0:o.api();if(!e)return null;this._markers=(0,external_lightweight_charts_namespaceObject.createSeriesMarkers)(e,n)}return this._markers},clear:function(){null!==this._markers&&(this._markers.detach(),this._markers=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){a&&c.current.init()},[a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){c.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&n&&t){var e;null===(e=c.current.api())||void 0===e||e.setMarkers(n)}},[n,t]),c};function _extends(){return(_extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function _object_destructuring_empty(e){if(null==e)throw TypeError("Cannot destructure "+e);return e}var MarkersRenderFunction=function(e,r){var t=useMarkers(_extends({},_object_destructuring_empty(e)));return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},Markers=(0,external_react_namespaceObject.forwardRef)(MarkersRenderFunction);Markers.displayName="Markers";var markers_Markers=Markers;function useWatermark_object_without_properties(e,r){if(null==e)return{};var t,n,i=useWatermark_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function useWatermark_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function useWatermark(e){var r=useSafeContext(ChartContext),t=r.initialized,n=r.chartApiRef,i=(0,external_react_namespaceObject.useRef)({_watermark:null,api:function(){return this._watermark},init:function(){if(null===this._watermark){var r=null==n?void 0:n.api(),t=null==r?void 0:r.panes()[0];if(!r||!t)return null;if(isTextWatermark(e)){e.type;var i=useWatermark_object_without_properties(e,["type"]);this._watermark=(0,external_lightweight_charts_namespaceObject.createTextWatermark)(t,i)}else{e.type;var a=e.src,o=useWatermark_object_without_properties(e,["type","src"]);this._watermark=(0,external_lightweight_charts_namespaceObject.createImageWatermark)(t,a,o)}}return this._watermark},clear:function(){null!==this._watermark&&(this._watermark.detach(),this._watermark=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){t&&i.current.init()},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){i.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(n&&e){e.type;var r,t=useWatermark_object_without_properties(e,["type"]);null===(r=i.current.api())||void 0===r||r.applyOptions(t)}},[e]),i}var isTextWatermark=function(e){return"text"===e.type};function Watermark_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Watermark_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){Watermark_define_property(e,r,t[r])})}return e}function Watermark_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function Watermark_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Watermark_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}var WatermarkRenderFunction=function(e,r){var t=useWatermark(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},WatermarkText=(0,external_react_namespaceObject.forwardRef)(function(e,r){return WatermarkRenderFunction(Watermark_object_spread_props(Watermark_object_spread({},e),{type:"text"}),r)}),WatermarkImage=(0,external_react_namespaceObject.forwardRef)(function(e,r){return WatermarkRenderFunction(Watermark_object_spread_props(Watermark_object_spread({},e),{type:"image"}),r)});for(var __webpack_i__ in WatermarkText.displayName="WatermarkText",WatermarkImage.displayName="WatermarkImage",exports.AreaSeries=__webpack_exports__.AreaSeries,exports.BarSeries=__webpack_exports__.BarSeries,exports.BaselineSeries=__webpack_exports__.BaselineSeries,exports.CandlestickSeries=__webpack_exports__.CandlestickSeries,exports.Chart=__webpack_exports__.Chart,exports.CustomSeries=__webpack_exports__.CustomSeries,exports.HistogramSeries=__webpack_exports__.HistogramSeries,exports.LineSeries=__webpack_exports__.LineSeries,exports.Markers=__webpack_exports__.Markers,exports.PriceLine=__webpack_exports__.PriceLine,exports.PriceScale=__webpack_exports__.PriceScale,exports.TimeScale=__webpack_exports__.TimeScale,exports.WatermarkImage=__webpack_exports__.WatermarkImage,exports.WatermarkText=__webpack_exports__.WatermarkText,__webpack_exports__)-1===["AreaSeries","BarSeries","BaselineSeries","CandlestickSeries","Chart","CustomSeries","HistogramSeries","LineSeries","Markers","PriceLine","PriceScale","TimeScale","WatermarkImage","WatermarkText"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
11
+ "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BarSeries:function(){return BarSeries},CustomSeries:function(){return series_CustomSeries},Chart:function(){return ChartWrapper},BaselineSeries:function(){return BaselineSeries},LineSeries:function(){return series_LineSeries},CandlestickSeries:function(){return series_CandlestickSeries},PriceLine:function(){return priceLine_PriceLine},WatermarkImage:function(){return WatermarkImage},HistogramSeries:function(){return series_HistogramSeries},Markers:function(){return markers_Markers},TimeScale:function(){return TimeScale},AreaSeries:function(){return series_AreaSeries},WatermarkText:function(){return WatermarkText},PriceScale:function(){return PriceScale}});var jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),ChartContext=(0,external_react_namespaceObject.createContext)({chartApiRef:null,initialized:!1});ChartContext.displayName="ChartContext";var external_lightweight_charts_namespaceObject=require("lightweight-charts");function _array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_without_properties(e,r){if(null==e)return{};var t,n,i=_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function _object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function _sliced_to_array(e,r){return _array_with_holes(e)||_iterable_to_array_limit(e,r)||_unsupported_iterable_to_array(e,r)||_non_iterable_rest()}function _unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return _array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _array_like_to_array(e,r)}}var useChart=function(e){var r=e.container,t=_object_without_properties(e,["container"]),n=t.onClick,i=t.onCrosshairMove,a=t.onInit,o=_object_without_properties(t,["onClick","onCrosshairMove","onInit"]),c=_sliced_to_array((0,external_react_namespaceObject.useState)(!1),2),s=c[0],u=c[1],l=(0,external_react_namespaceObject.useRef)({_chart:null,api:function(){return this._chart},init:function(){return null===this._chart&&(this._chart=(0,external_lightweight_charts_namespaceObject.createChart)(r,o),a&&a(this._chart)),s||u(!0),this._chart},clear:function(){null!==this._chart&&(u(!1),this._chart.remove(),this._chart=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return l.current.init(),function(){l.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(n){var e;null===(e=l.current.api())||void 0===e||e.subscribeClick(n)}return function(){if(n){var e;null===(e=l.current.api())||void 0===e||e.unsubscribeClick(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(i){var e;null===(e=l.current.api())||void 0===e||e.subscribeCrosshairMove(i)}return function(){if(i){var e;null===(e=l.current.api())||void 0===e||e.unsubscribeCrosshairMove(i)}}}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;r&&(null===(e=l.current.api())||void 0===e||e.applyOptions(o))},[o]),{chartApiRef:l,initialized:s}};function _define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){_define_property(e,r,t[r])})}return e}function ChartComponent_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartComponent_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartComponent_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var ChartComponent=function(e){var r=e.children,t=useChart(_object_spread({container:e.container},ChartComponent_object_without_properties(e,["children","container"]))),n=t.chartApiRef.current,i=t.initialized;return(0,jsx_runtime_namespaceObject.jsx)(ChartContext.Provider,{value:{chartApiRef:n,initialized:i},children:r})},chart_ChartComponent=ChartComponent;function ChartWrapper_array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function ChartWrapper_array_with_holes(e){if(Array.isArray(e))return e}function ChartWrapper_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ChartWrapper_iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function ChartWrapper_non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ChartWrapper_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){ChartWrapper_define_property(e,r,t[r])})}return e}function ChartWrapper_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ChartWrapper_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ChartWrapper_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartWrapper_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartWrapper_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function ChartWrapper_sliced_to_array(e,r){return ChartWrapper_array_with_holes(e)||ChartWrapper_iterable_to_array_limit(e,r)||ChartWrapper_unsupported_iterable_to_array(e,r)||ChartWrapper_non_iterable_rest()}function ChartWrapper_unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return ChartWrapper_array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ChartWrapper_array_like_to_array(e,r)}}var ChartRenderFunction=function(e,r){var t=e.children,n=e.className,i=ChartWrapper_object_without_properties(e,["children","className"]),a=ChartWrapper_sliced_to_array((0,external_react_namespaceObject.useState)(),2),o=a[0],c=a[1],s=(0,external_react_namespaceObject.useCallback)(function(e){c(e),r&&("function"==typeof r?s(e):r.current=e)},[r]);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:n,children:!!o&&(0,jsx_runtime_namespaceObject.jsx)(chart_ChartComponent,_object_spread_props(ChartWrapper_object_spread({container:o},i),{children:t}))})},ChartWrapper_ChartWrapper=(0,external_react_namespaceObject.forwardRef)(ChartRenderFunction);ChartWrapper_ChartWrapper.displayName="ChartWrapper";var ChartWrapper=ChartWrapper_ChartWrapper,useSafeContext=function(e){var r=(0,external_react_namespaceObject.useContext)(e);if(!r){var t=e.name;throw Error("".concat(t," not found. You can access context value only inside its Provider."))}return r},useTimeScale=function(e){var r=e.onVisibleTimeRangeChange,t=e.onVisibleLogicalRangeChange,n=e.onSizeChange,i=e.visibleRange,a=e.visibleLogicalRange,o=e.options,c=void 0===o?{}:o,s=useSafeContext(ChartContext),u=s.initialized,l=s.chartApiRef;if(!l)throw Error("Chart context not found");var _=(0,external_react_namespaceObject.useRef)({_timeScale:null,api:function(){return this._timeScale},init:function(){if(!this._timeScale){var e=null==l?void 0:l.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(c),i&&this._timeScale.setVisibleRange(i),a&&this._timeScale.setVisibleLogicalRange(a)}return this._timeScale},clear:function(){this._timeScale=null}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){u&&_.current.init()},[u]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){_.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&c){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(c)}},[c]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(n){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(n)}return function(){if(n){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(t){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(t)}return function(){if(t){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(t)}}}},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l){if(r){var e,t;null===(t=_.current)||void 0===t||null===(e=t.api())||void 0===e||e.subscribeVisibleTimeRangeChange(r)}return function(){if(r){var e,t;null===(t=_.current)||void 0===t||null===(e=t.api())||void 0===e||e.unsubscribeVisibleTimeRangeChange(r)}}}},[r]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&i){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(i)}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&a){var e,r;null===(r=_.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(a)}},[a]),_},TimeScaleRenderFunction=function(e,r){var t=useTimeScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},TimeScale_TimeScale=(0,external_react_namespaceObject.forwardRef)(TimeScaleRenderFunction);TimeScale_TimeScale.displayName="TimeScale";var TimeScale=TimeScale_TimeScale,usePriceScale=function(e){var r=e.options,t=void 0===r?{}:r,n=e.id,i=useSafeContext(ChartContext),a=i.initialized,o=i.chartApiRef,c=(0,external_react_namespaceObject.useRef)({_priceScale:null,api:function(){return this._priceScale},init:function(){if(!this._priceScale){var e=null==o?void 0:o.api();if(!e)return null;this._priceScale=e.priceScale(n),this._priceScale.applyOptions(t)}return this._priceScale},setId:function(e){null!==this._priceScale&&null!==o&&(this._priceScale=o.api().priceScale(e),this._priceScale.applyOptions(t))},clear:function(){this._priceScale=null}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){a&&c.current.init()},[a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){c.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;o&&(null===(e=c.current)||void 0===e||e.setId(n))},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&t){var e,r;null===(r=c.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(t)}},[t]),c},PriceScaleRenderFunction=function(e,r){var t=usePriceScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceScale_PriceScale=(0,external_react_namespaceObject.forwardRef)(PriceScaleRenderFunction);PriceScale_PriceScale.displayName="PriceScale";var PriceScale=PriceScale_PriceScale,SeriesContext=(0,external_react_namespaceObject.createContext)({seriesApiRef:null,initialized:!1});SeriesContext.displayName="SeriesContext";var package_namespaceObject={i8:"0.2.1"};function _assert_this_initialized(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _call_super(e,r,t){return r=_get_prototype_of(r),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(r,t||[],_get_prototype_of(e).constructor):r.apply(e,t))}function _class_call_check(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}function _construct(e,r,t){return(_construct=_is_native_reflect_construct()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var i=new(Function.bind.apply(e,n));return t&&_set_prototype_of(i,t.prototype),i}).apply(null,arguments)}function InternalError_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _get_prototype_of(e){return(_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&_set_prototype_of(e,r)}function _is_native_function(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function _possible_constructor_return(e,r){return r&&("object"===_type_of(r)||"function"==typeof r)?r:_assert_this_initialized(e)}function _set_prototype_of(e,r){return(_set_prototype_of=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _wrap_native_super(e){var r="function"==typeof Map?new Map:void 0;return(_wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(t,e)})(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}var docsBaseUrl="https://tradingview.github.io/lightweight-charts/docs",InternalError_BaseInternalError=function(e){function r(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.isOperational,o=i.cause,c=i.docsPath;return _class_call_check(this,r),InternalError_define_property(t=_call_super(this,r,[e]),"isOperational",void 0),InternalError_define_property(t,"cause",void 0),t.name=null!==(n=t.constructor.name)&&void 0!==n?n:"InternalError",t.isOperational=void 0===a||a,t.cause=o,t.message="".concat(null!=e?e:"An error occurred"),c&&(t.message="".concat(t.message,"\n Docs: see ").concat(docsBaseUrl+c)),package_namespaceObject.i8&&(t.message="".concat(t.message,"\n Version: lightweight-charts-react-components/").concat(package_namespaceObject.i8)),Object.setPrototypeOf(t,r.prototype),t}return _inherits(r,e),r}(_wrap_native_super(Error));function useSeries_array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function useSeries_array_with_holes(e){if(Array.isArray(e))return e}function useSeries_iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function useSeries_non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function useSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=useSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function useSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function useSeries_sliced_to_array(e,r){return useSeries_array_with_holes(e)||useSeries_iterable_to_array_limit(e,r)||useSeries_unsupported_iterable_to_array(e,r)||useSeries_non_iterable_rest()}function useSeries_unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return useSeries_array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return useSeries_array_like_to_array(e,r)}}var useSeries=function(e){var r=e.type,t=e.data,n=e.options,i=void 0===n?{}:n,a=e.reactive,o=void 0===a||a,c=useSeries_object_without_properties(e,["type","data","options","reactive"]),s=useSafeContext(ChartContext),u=s.initialized,l=s.chartApiRef,_=useSeries_sliced_to_array((0,external_react_namespaceObject.useState)(!1),2),p=_[0],f=_[1],b=(0,external_react_namespaceObject.useRef)({_series:null,api:function(){return this._series},init:function(){if(!this._series){var e,n=null==l?void 0:l.api();if(!n)return null;if("Custom"===r){var a=c.plugin;if(!a)throw new InternalError_BaseInternalError("Custom series requires a plugin to be defined");this._series=n.addCustomSeries(a,i)}else this._series=n.addSeries(seriesMap[r],i);f(!0),null===(e=this._series)||void 0===e||e.setData(t)}return this._series},clear:function(){if(null!==this._series){var e;null==l||null===(e=l.api())||void 0===e||e.removeSeries(this._series),this._series=null,f(!1)}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){u&&b.current.init()},[u]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){b.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&t&&o){var e;null===(e=b.current.api())||void 0===e||e.setData(t)}},[t,o]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(l&&i){var e;null===(e=b.current.api())||void 0===e||e.applyOptions(i)}},[i]),{initialized:p,seriesApiRef:b}},seriesMap={Line:external_lightweight_charts_namespaceObject.LineSeries,Candlestick:external_lightweight_charts_namespaceObject.CandlestickSeries,Histogram:external_lightweight_charts_namespaceObject.HistogramSeries,Area:external_lightweight_charts_namespaceObject.AreaSeries,Baseline:external_lightweight_charts_namespaceObject.BaselineSeries,Bar:external_lightweight_charts_namespaceObject.BarSeries};function SeriesTemplate_object_without_properties(e,r){if(null==e)return{};var t,n,i=SeriesTemplate_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function SeriesTemplate_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var SeriesTemplateRenderFunction=function(e,r){var t=e.children,n=useSeries(SeriesTemplate_object_without_properties(e,["children"])),i=n.seriesApiRef.current,a=n.initialized;return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return i},[i]),(0,jsx_runtime_namespaceObject.jsx)(SeriesContext.Provider,{value:{seriesApiRef:i,initialized:a},children:t})},SeriesTemplate=(0,external_react_namespaceObject.forwardRef)(SeriesTemplateRenderFunction);SeriesTemplate.displayName="SeriesTemplate";var series_SeriesTemplate=SeriesTemplate;function LineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function LineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){LineSeries_define_property(e,r,t[r])})}return e}function LineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function LineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function LineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=LineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function LineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var LineSeriesRenderFunction=function(e,r){var t=e.children,n=LineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,LineSeries_object_spread_props(LineSeries_object_spread({type:"Line",ref:r},n),{children:t}))},LineSeries=(0,external_react_namespaceObject.forwardRef)(LineSeriesRenderFunction);LineSeries.displayName="LineSeries";var series_LineSeries=LineSeries;function HistogramSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function HistogramSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){HistogramSeries_define_property(e,r,t[r])})}return e}function HistogramSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function HistogramSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HistogramSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function HistogramSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=HistogramSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function HistogramSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var HistogramSeriesRenderFunction=function(e,r){var t=e.children,n=HistogramSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,HistogramSeries_object_spread_props(HistogramSeries_object_spread({type:"Histogram",ref:r},n),{children:t}))},HistogramSeries=(0,external_react_namespaceObject.forwardRef)(HistogramSeriesRenderFunction);HistogramSeries.displayName="HistogramSeries";var series_HistogramSeries=HistogramSeries;function CandlestickSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CandlestickSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CandlestickSeries_define_property(e,r,t[r])})}return e}function CandlestickSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CandlestickSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CandlestickSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CandlestickSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CandlestickSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function CandlestickSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var CandlestickSeriesRenderFunction=function(e,r){var t=e.children,n=CandlestickSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CandlestickSeries_object_spread_props(CandlestickSeries_object_spread({type:"Candlestick",ref:r},n),{children:t}))},CandlestickSeries=(0,external_react_namespaceObject.forwardRef)(CandlestickSeriesRenderFunction);CandlestickSeries.displayName="CandlestickSeries";var series_CandlestickSeries=CandlestickSeries;function AreaSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function AreaSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){AreaSeries_define_property(e,r,t[r])})}return e}function AreaSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function AreaSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AreaSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function AreaSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=AreaSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function AreaSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var AreaSeriesRenderFunction=function(e,r){var t=e.children,n=AreaSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,AreaSeries_object_spread_props(AreaSeries_object_spread({type:"Area",ref:r},n),{children:t}))},AreaSeries=(0,external_react_namespaceObject.forwardRef)(AreaSeriesRenderFunction);AreaSeries.displayName="AreaSeries";var series_AreaSeries=AreaSeries;function BaselineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BaselineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BaselineSeries_define_property(e,r,t[r])})}return e}function BaselineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BaselineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BaselineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BaselineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BaselineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BaselineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BaselineSeriesRenderFunction=function(e,r){var t=e.children,n=BaselineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BaselineSeries_object_spread_props(BaselineSeries_object_spread({type:"Baseline",ref:r},n),{children:t}))},BaselineSeries_BaselineSeries=(0,external_react_namespaceObject.forwardRef)(BaselineSeriesRenderFunction);BaselineSeries_BaselineSeries.displayName="BaselineSeries";var BaselineSeries=BaselineSeries_BaselineSeries;function BarSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BarSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BarSeries_define_property(e,r,t[r])})}return e}function BarSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BarSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BarSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BarSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BarSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BarSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BarSeriesRenderFunction=function(e,r){var t=e.children,n=BarSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BarSeries_object_spread_props(BarSeries_object_spread({type:"Bar",ref:r},n),{children:t}))},BarSeries_BarSeries=(0,external_react_namespaceObject.forwardRef)(BarSeriesRenderFunction);BarSeries_BarSeries.displayName="BarSeries";var BarSeries=BarSeries_BarSeries;function CustomSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CustomSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CustomSeries_define_property(e,r,t[r])})}return e}function CustomSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CustomSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CustomSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CustomSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CustomSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function CustomSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var CustomSeriesRenderFunction=function(e,r){var t=e.children,n=CustomSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CustomSeries_object_spread_props(CustomSeries_object_spread({type:"Custom",ref:r},n),{children:t}))},CustomSeries=(0,external_react_namespaceObject.forwardRef)(CustomSeriesRenderFunction);CustomSeries.displayName="CustomSeries";var series_CustomSeries=CustomSeries;function usePriceLine_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function usePriceLine_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){usePriceLine_define_property(e,r,t[r])})}return e}var usePriceLine=function(e){var r=e.options,t=e.price,n=useSafeContext(SeriesContext),i=n.initialized,a=n.seriesApiRef,o=(0,external_react_namespaceObject.useRef)({_priceLine:null,api:function(){return this._priceLine},init:function(){if(!this._priceLine){var e=null==a?void 0:a.api();if(!e)return null;this._priceLine=e.createPriceLine(usePriceLine_object_spread({price:t},r))}return this._priceLine},clear:function(){if(null!==this._priceLine){var e;null==a||null===(e=a.api())||void 0===e||e.removePriceLine(this._priceLine),this._priceLine=null}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){i&&o.current.init()},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){o.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(a&&r){var e;null===(e=o.current.api())||void 0===e||e.applyOptions(r)}},[r]),o},PriceLineRenderFunction=function(e,r){var t=usePriceLine(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceLine=(0,external_react_namespaceObject.forwardRef)(PriceLineRenderFunction);PriceLine.displayName="PriceLine";var priceLine_PriceLine=PriceLine,useMarkers=function(e){var r=e.reactive,t=void 0===r||r,n=e.markers,i=useSafeContext(SeriesContext),a=i.initialized,o=i.seriesApiRef,c=(0,external_react_namespaceObject.useRef)({_markers:null,api:function(){return this._markers},init:function(){if(null===this._markers){var e=null==o?void 0:o.api();if(!e)return null;this._markers=(0,external_lightweight_charts_namespaceObject.createSeriesMarkers)(e,n)}return this._markers},clear:function(){null!==this._markers&&(this._markers.detach(),this._markers=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){a&&c.current.init()},[a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){c.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&n&&t){var e;null===(e=c.current.api())||void 0===e||e.setMarkers(n)}},[n,t]),c};function _extends(){return(_extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function _object_destructuring_empty(e){if(null==e)throw TypeError("Cannot destructure "+e);return e}var MarkersRenderFunction=function(e,r){var t=useMarkers(_extends({},_object_destructuring_empty(e)));return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},Markers=(0,external_react_namespaceObject.forwardRef)(MarkersRenderFunction);Markers.displayName="Markers";var markers_Markers=Markers;function useWatermark_object_without_properties(e,r){if(null==e)return{};var t,n,i=useWatermark_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function useWatermark_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var useWatermark=function(e){var r=useSafeContext(ChartContext),t=r.initialized,n=r.chartApiRef,i=(0,external_react_namespaceObject.useRef)({_watermark:null,api:function(){return this._watermark},init:function(){if(null===this._watermark){var r=null==n?void 0:n.api(),t=null==r?void 0:r.panes()[0];if(!r||!t)return null;if(isTextWatermark(e)){e.type;var i=useWatermark_object_without_properties(e,["type"]);this._watermark=(0,external_lightweight_charts_namespaceObject.createTextWatermark)(t,i)}else{e.type;var a=e.src,o=useWatermark_object_without_properties(e,["type","src"]);this._watermark=(0,external_lightweight_charts_namespaceObject.createImageWatermark)(t,a,o)}}return this._watermark},clear:function(){null!==this._watermark&&(this._watermark.detach(),this._watermark=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){t&&i.current.init()},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){return function(){i.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(n&&e){e.type;var r,t=useWatermark_object_without_properties(e,["type"]);null===(r=i.current.api())||void 0===r||r.applyOptions(t)}},[e]),i},isTextWatermark=function(e){return"text"===e.type};function Watermark_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Watermark_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){Watermark_define_property(e,r,t[r])})}return e}function Watermark_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function Watermark_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Watermark_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}var WatermarkRenderFunction=function(e,r){var t=useWatermark(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},WatermarkText=(0,external_react_namespaceObject.forwardRef)(function(e,r){return WatermarkRenderFunction(Watermark_object_spread_props(Watermark_object_spread({},e),{type:"text"}),r)}),WatermarkImage=(0,external_react_namespaceObject.forwardRef)(function(e,r){return WatermarkRenderFunction(Watermark_object_spread_props(Watermark_object_spread({},e),{type:"image"}),r)});for(var __webpack_i__ in WatermarkText.displayName="WatermarkText",WatermarkImage.displayName="WatermarkImage",exports.AreaSeries=__webpack_exports__.AreaSeries,exports.BarSeries=__webpack_exports__.BarSeries,exports.BaselineSeries=__webpack_exports__.BaselineSeries,exports.CandlestickSeries=__webpack_exports__.CandlestickSeries,exports.Chart=__webpack_exports__.Chart,exports.CustomSeries=__webpack_exports__.CustomSeries,exports.HistogramSeries=__webpack_exports__.HistogramSeries,exports.LineSeries=__webpack_exports__.LineSeries,exports.Markers=__webpack_exports__.Markers,exports.PriceLine=__webpack_exports__.PriceLine,exports.PriceScale=__webpack_exports__.PriceScale,exports.TimeScale=__webpack_exports__.TimeScale,exports.WatermarkImage=__webpack_exports__.WatermarkImage,exports.WatermarkText=__webpack_exports__.WatermarkText,__webpack_exports__)-1===["AreaSeries","BarSeries","BaselineSeries","CandlestickSeries","Chart","CustomSeries","HistogramSeries","LineSeries","Markers","PriceLine","PriceScale","TimeScale","WatermarkImage","WatermarkText"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
12
12
  //# sourceMappingURL=lightweight-charts-react-components.cjs.map