summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteh_coderer <me@tehcoderer.com>2023-05-03 12:08:56 -0400
committerteh_coderer <me@tehcoderer.com>2023-05-03 12:08:56 -0400
commitd1c4ce99fcd53801ae93f7f0d596a1a2e8c8fd14 (patch)
tree3ea5f50955469ef5f273e2fee6d9135f5c56f5a0
parentad74f62bafa5f8a2bd12389fc16796c2cb04a6e4 (diff)
handle add text high/low for candlestick traces when updating
-rw-r--r--frontend-components/plotly/src/components/Chart.tsx3
-rw-r--r--frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx30
-rw-r--r--frontend-components/plotly/src/utils/addAnnotation.tsx56
-rw-r--r--openbb_terminal/core/plots/plotly.html254
4 files changed, 197 insertions, 146 deletions
diff --git a/frontend-components/plotly/src/components/Chart.tsx b/frontend-components/plotly/src/components/Chart.tsx
index d8c59e1b4b6..3c0da92f36f 100644
--- a/frontend-components/plotly/src/components/Chart.tsx
+++ b/frontend-components/plotly/src/components/Chart.tsx
@@ -63,6 +63,7 @@ export default function Chart({
const [changeColor, setChangeColor] = useState(false);
const [colorActive, setColorActive] = useState(false);
const [onAnnotationClick, setOnAnnotationClick] = useState({});
+ const [ohlcAnnotation, setOhlcAnnotation] = useState([]);
const onClose = () => setModal({ name: "" });
@@ -90,6 +91,8 @@ export default function Chart({
setOnAnnotationClick,
setAnnotations,
onAnnotationClick,
+ ohlcAnnotation,
+ setOhlcAnnotation,
annotations,
plotDiv,
});
diff --git a/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx b/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx
index f5ee1b0c994..308a8a0d9eb 100644
--- a/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx
+++ b/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx
@@ -49,21 +49,13 @@ export default function TextChartDialog({
function onChange(e: any) {
console.log(e.target.id.replace("addtext_", ""), e.target.value);
const name = e.target.id.replace("addtext_", "");
- const value =
- e.target.type === "checkbox"
- ? e.target.checked
- ? 1
- : 0
- : e.target.value;
+ const value = e.target.value;
setNewPopupData({ ...newPopupData, [name]: value });
}
function onSubmit() {
console.log("submitting", newPopupData);
if (newPopupData.text !== "") {
- let above = ["above", 1].includes(newPopupData.yanchor);
- newPopupData.yanchor = above ? "above" : "below";
-
if (popUpData?.annotation) {
setNewPopupData({ ...newPopupData, annotation: popUpData.annotation });
}
@@ -158,19 +150,21 @@ export default function TextChartDialog({
defaultValue={popUpData?.annotation?.size || newPopupData?.size}
></input>
<div>
- <label htmlFor="addtext_yanchor" style={{ marginRight: 28 }}>
- <b>Position (Above)</b>
+ <label htmlFor="addtext_yanchor" style={{ marginRight: 31 }}>
+ <b>Position</b>
</label>
- <input
- type="checkbox"
- style={{ ...style, width: "45px" }}
+ <select
id="addtext_yanchor"
- name="check"
- defaultChecked={
- newPopupData?.yanchor === "above" ? true : false
+ name="yanchor"
+ style={{ width: "100px" }}
+ defaultValue={
+ popUpData?.annotation?.yanchor || newPopupData?.yanchor
}
onChange={onChange}
- ></input>
+ >
+ <option value="above">Above</option>
+ <option value="below">Below</option>
+ </select>
</div>
</div>
</div>
diff --git a/frontend-components/plotly/src/utils/addAnnotation.tsx b/frontend-components/plotly/src/utils/addAnnotation.tsx
index 5550284c225..261fa2e9b8e 100644
--- a/frontend-components/plotly/src/utils/addAnnotation.tsx
+++ b/frontend-components/plotly/src/utils/addAnnotation.tsx
@@ -44,6 +44,10 @@ export function add_annotation({
break;
}
}
+
+ if (popup_data.high != undefined) {
+ y = popup_data.yanchor == "above" ? popup_data.high : popup_data.low;
+ }
if (index == -1) {
let annotation: Annotations = {
x: x,
@@ -71,14 +75,19 @@ export function add_annotation({
},
clicktoshow: "onoff",
captureevents: true,
+ high: popup_data.high || undefined,
+ low: popup_data.low || undefined,
};
annotations.push(annotation);
} else {
+ annotations[index].y = y;
annotations[index].text = popup_data.text;
annotations[index].font.color = popup_data.color;
annotations[index].font.size = popup_data.size;
annotations[index].ay = y + popup_data.yshift;
annotations[index].bordercolor = popup_data.bordercolor;
+ annotations[index].high = popup_data.high || undefined;
+ annotations[index].low = popup_data.low || undefined;
}
return { annotations: annotations, annotation: annotations[index] };
}
@@ -124,6 +133,8 @@ export function init_annotation({
setOnAnnotationClick,
setAnnotations,
onAnnotationClick,
+ ohlcAnnotation,
+ setOhlcAnnotation,
annotations,
plotDiv,
}: {
@@ -134,12 +145,15 @@ export function init_annotation({
onAnnotationClick: any;
setOnAnnotationClick: (onAnnotationClick: any) => void;
setAnnotations: (annotations: Partial<Annotations>[]) => void;
+ ohlcAnnotation: any;
+ setOhlcAnnotation: (ohlcAnnotation: any) => void;
annotations: Annotations[];
plotDiv: PlotlyHTMLElement;
}) {
if (popupData.text != undefined && popupData.text != "") {
popupData.text = popupData.text.replace(/\n/g, "<br>");
let popup_data: Partial<PopupData>;
+ let inOhlc = false;
if (popupData.annotation) {
console.log("data", popupData);
@@ -151,12 +165,35 @@ export function init_annotation({
popupData.annotation.y < popupData.annotation.ay ? "above" : "below",
...popupData,
};
+ if (popupData.annotation.high != undefined) {
+ inOhlc = true;
+ }
console.log("popup_data", popup_data);
let to_update = plot_text({
plotData,
popup_data: popup_data as PopupData,
current_text: popupData.annotation.text,
});
+
+ if (inOhlc) {
+ // we update the ohlcAnnotation
+ let ohlcAnnotationIndex = ohlcAnnotation.findIndex(
+ (a) =>
+ a.x == popupData.annotation.x &&
+ a.y == popupData.annotation.y &&
+ a.yref == popupData.annotation.yref
+ );
+ console.log("ohlcAnnotationIndex", ohlcAnnotationIndex);
+ if (ohlcAnnotationIndex == -1) {
+ // we add the annotation to the ohlcAnnotation array
+ setOhlcAnnotation([...ohlcAnnotation, to_update.annotation]);
+ } else {
+ // we replace the annotation in the ohlcAnnotation array
+ ohlcAnnotation[ohlcAnnotationIndex] = to_update.annotation;
+ setOhlcAnnotation(ohlcAnnotation);
+ }
+ }
+
setAnnotations(
[...annotations, to_update.annotation].filter((a) => a != undefined)
);
@@ -182,6 +219,8 @@ export function init_annotation({
let popup_data = {
x: annotation.x,
y: annotation.y,
+ high: annotation?.high ?? undefined,
+ low: annotation?.low ?? undefined,
yanchor: annotation.y < annotation.ay ? "above" : "below",
text: annotation.text,
color: annotation.font.color,
@@ -189,7 +228,8 @@ export function init_annotation({
bordercolor: annotation.bordercolor,
annotation: annotation,
};
- console.log("popup_data", popup_data);
+
+ console.log("popup_data_clickannotation", popup_data);
setOnAnnotationClick(popup_data);
setModal({ name: "textDialog", data: popup_data });
setOnAnnotationClick({});
@@ -200,12 +240,15 @@ export function init_annotation({
let x = eventData.points[0].x;
let yaxis = eventData.points[0].fullData.yaxis;
let y = 0;
+ let high, low;
// We need to check if the trace is a candlestick or not
// this is because the y value is stored in the high or low
if (eventData.points[0].y != undefined) {
y = eventData.points[0].y;
} else if (eventData.points[0].low != undefined) {
+ high = eventData.points[0].high;
+ low = eventData.points[0].low;
if (popup_data?.yanchor == "below") {
y = eventData.points[0].low;
} else {
@@ -217,13 +260,24 @@ export function init_annotation({
x: onAnnotationClick?.annotation?.x ?? x,
y: onAnnotationClick?.annotation?.y ?? y,
yref: onAnnotationClick?.annotation?.yref ?? yaxis,
+ high: onAnnotationClick?.annotation?.high ?? high,
+ low: onAnnotationClick?.annotation?.low ?? low,
...popupData,
};
+
+ if (high != undefined) {
+ // save the annotation to use later
+ ohlcAnnotation.push(popup_data);
+ setOhlcAnnotation(ohlcAnnotation);
+ console.log("ohlcAnnotation", ohlcAnnotation);
+ }
+
let to_update = plot_text({
plotData,
popup_data: popup_data as PopupData,
current_text: onAnnotationClick?.annotation?.text,
});
+
setAnnotations(
[...annotations, to_update.annotation].filter((a) => a != undefined)
);
diff --git a/openbb_terminal/core/plots/plotly.html b/openbb_terminal/core/plots/plotly.html
index 6686a66252b..2737432c60a 100644
--- a/openbb_terminal/core/plots/plotly.html
+++ b/openbb_terminal/core/plots/plotly.html
@@ -37,56 +37,56 @@ function qb(O,F){for(var J=0;J<F.length;J++){const fe=F[J];if(typeof fe!="string
object-assign
(c) Sindre Sorhus
@license MIT
-*/var Fx=Object.getOwnPropertySymbols,M4=Object.prototype.hasOwnProperty,S4=Object.prototype.propertyIsEnumerable;function E4(O){if(O==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(O)}function C4(){try{if(!Object.assign)return!1;var O=new String("abc");if(O[5]="de",Object.getOwnPropertyNames(O)[0]==="5")return!1;for(var F={},J=0;J<10;J++)F["_"+String.fromCharCode(J)]=J;var fe=Object.getOwnPropertyNames(F).map(function(D){return F[D]});if(fe.join("")!=="0123456789")return!1;var Pe={};return"abcdefghijklmnopqrst".split("").forEach(function(D){Pe[D]=D}),Object.keys(Object.assign({},Pe)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Wb=C4()?Object.assign:function(O,F){for(var J,fe=E4(O),Pe,D=1;D<arguments.length;D++){J=Object(arguments[D]);for(var E in J)M4.call(J,E)&&(fe[E]=J[E]);if(Fx){Pe=Fx(J);for(var e=0;e<Pe.length;e++)S4.call(J,Pe[e])&&(fe[Pe[e]]=J[Pe[e]])}}return fe},Zb={exports:{}},zi={};/** @license React v17.0.2
+*/var Dx=Object.getOwnPropertySymbols,M4=Object.prototype.hasOwnProperty,S4=Object.prototype.propertyIsEnumerable;function E4(O){if(O==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(O)}function C4(){try{if(!Object.assign)return!1;var O=new String("abc");if(O[5]="de",Object.getOwnPropertyNames(O)[0]==="5")return!1;for(var F={},J=0;J<10;J++)F["_"+String.fromCharCode(J)]=J;var fe=Object.getOwnPropertyNames(F).map(function(D){return F[D]});if(fe.join("")!=="0123456789")return!1;var Pe={};return"abcdefghijklmnopqrst".split("").forEach(function(D){Pe[D]=D}),Object.keys(Object.assign({},Pe)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Wb=C4()?Object.assign:function(O,F){for(var J,fe=E4(O),Pe,D=1;D<arguments.length;D++){J=Object(arguments[D]);for(var E in J)M4.call(J,E)&&(fe[E]=J[E]);if(Dx){Pe=Dx(J);for(var e=0;e<Pe.length;e++)S4.call(J,Pe[e])&&(fe[Pe[e]]=J[Pe[e]])}}return fe},Zb={exports:{}},zi={};/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Zv=Wb,lh=60103,Yb=60106;zi.Fragment=60107;zi.StrictMode=60108;zi.Profiler=60114;var Xb=60109,$b=60110,Jb=60112;zi.Suspense=60113;var Kb=60115,Qb=60116;if(typeof Symbol=="function"&&Symbol.for){var Dl=Symbol.for;lh=Dl("react.element"),Yb=Dl("react.portal"),zi.Fragment=Dl("react.fragment"),zi.StrictMode=Dl("react.strict_mode"),zi.Profiler=Dl("react.profiler"),Xb=Dl("react.provider"),$b=Dl("react.context"),Jb=Dl("react.forward_ref"),zi.Suspense=Dl("react.suspense"),Kb=Dl("react.memo"),Qb=Dl("react.lazy")}var Bx=typeof Symbol=="function"&&Symbol.iterator;function L4(O){return O===null||typeof O!="object"?null:(O=Bx&&O[Bx]||O["@@iterator"],typeof O=="function"?O:null)}function Vp(O){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+O,J=1;J<arguments.length;J++)F+="&args[]="+encodeURIComponent(arguments[J]);return"Minified React error #"+O+"; visit "+F+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var e_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},t_={};function uh(O,F,J){this.props=O,this.context=F,this.refs=t_,this.updater=J||e_}uh.prototype.isReactComponent={};uh.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error(Vp(85));this.updater.enqueueSetState(this,O,F,"setState")};uh.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function n_(){}n_.prototype=uh.prototype;function Yv(O,F,J){this.props=O,this.context=F,this.refs=t_,this.updater=J||e_}var Xv=Yv.prototype=new n_;Xv.constructor=Yv;Zv(Xv,uh.prototype);Xv.isPureReactComponent=!0;var $v={current:null},r_=Object.prototype.hasOwnProperty,i_={key:!0,ref:!0,__self:!0,__source:!0};function a_(O,F,J){var fe,Pe={},D=null,E=null;if(F!=null)for(fe in F.ref!==void 0&&(E=F.ref),F.key!==void 0&&(D=""+F.key),F)r_.call(F,fe)&&!i_.hasOwnProperty(fe)&&(Pe[fe]=F[fe]);var e=arguments.length-2;if(e===1)Pe.children=J;else if(1<e){for(var _=Array(e),T=0;T<e;T++)_[T]=arguments[T+2];Pe.children=_}if(O&&O.defaultProps)for(fe in e=O.defaultProps,e)Pe[fe]===void 0&&(Pe[fe]=e[fe]);return{$$typeof:lh,type:O,key:D,ref:E,props:Pe,_owner:$v.current}}function P4(O,F){return{$$typeof:lh,type:O.type,key:F,ref:O.ref,props:O.props,_owner:O._owner}}function Jv(O){return typeof O=="object"&&O!==null&&O.$$typeof===lh}function O4(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return F[J]})}var Nx=/\/+/g;function Q1(O,F){return typeof O=="object"&&O!==null&&O.key!=null?O4(""+O.key):F.toString(36)}function n0(O,F,J,fe,Pe){var D=typeof O;(D==="undefined"||D==="boolean")&&(O=null);var E=!1;if(O===null)E=!0;else switch(D){case"string":case"number":E=!0;break;case"object":switch(O.$$typeof){case lh:case Yb:E=!0}}if(E)return E=O,Pe=Pe(E),O=fe===""?"."+Q1(E,0):fe,Array.isArray(Pe)?(J="",O!=null&&(J=O.replace(Nx,"$&/")+"/"),n0(Pe,F,J,"",function(T){return T})):Pe!=null&&(Jv(Pe)&&(Pe=P4(Pe,J+(!Pe.key||E&&E.key===Pe.key?"":(""+Pe.key).replace(Nx,"$&/")+"/")+O)),F.push(Pe)),1;if(E=0,fe=fe===""?".":fe+":",Array.isArray(O))for(var e=0;e<O.length;e++){D=O[e];var _=fe+Q1(D,e);E+=n0(D,F,J,_,Pe)}else if(_=L4(O),typeof _=="function")for(O=_.call(O),e=0;!(D=O.next()).done;)D=D.value,_=fe+Q1(D,e++),E+=n0(D,F,J,_,Pe);else if(D==="object")throw F=""+O,Error(Vp(31,F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F));return E}function Rd(O,F,J){if(O==null)return O;var fe=[],Pe=0;return n0(O,fe,"","",function(D){return F.call(J,D,Pe++)}),fe}function I4(O){if(O._status===-1){var F=O._result;F=F(),O._status=0,O._result=F,F.then(function(J){O._status===0&&(J=J.default,O._status=1,O._result=J)},function(J){O._status===0&&(O._status=2,O._result=J)})}if(O._status===1)return O._result;throw O._result}var o_={current:null};function Nu(){var O=o_.current;if(O===null)throw Error(Vp(321));return O}var R4={ReactCurrentDispatcher:o_,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:$v,IsSomeRendererActing:{current:!1},assign:Zv};zi.Children={map:Rd,forEach:function(O,F,J){Rd(O,function(){F.apply(this,arguments)},J)},count:function(O){var F=0;return Rd(O,function(){F++}),F},toArray:function(O){return Rd(O,function(F){return F})||[]},only:function(O){if(!Jv(O))throw Error(Vp(143));return O}};zi.Component=uh;zi.PureComponent=Yv;zi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R4;zi.cloneElement=function(O,F,J){if(O==null)throw Error(Vp(267,O));var fe=Zv({},O.props),Pe=O.key,D=O.ref,E=O._owner;if(F!=null){if(F.ref!==void 0&&(D=F.ref,E=$v.current),F.key!==void 0&&(Pe=""+F.key),O.type&&O.type.defaultProps)var e=O.type.defaultProps;for(_ in F)r_.call(F,_)&&!i_.hasOwnProperty(_)&&(fe[_]=F[_]===void 0&&e!==void 0?e[_]:F[_])}var _=arguments.length-2;if(_===1)fe.children=J;else if(1<_){e=Array(_);for(var T=0;T<_;T++)e[T]=arguments[T+2];fe.children=e}return{$$typeof:lh,type:O.type,key:Pe,ref:D,props:fe,_owner:E}};zi.createContext=function(O,F){return F===void 0&&(F=null),O={$$typeof:$b,_calculateChangedBits:F,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider={$$typeof:Xb,_context:O},O.Consumer=O};zi.createElement=a_;zi.createFactory=function(O){var F=a_.bind(null,O);return F.type=O,F};zi.createRef=function(){return{current:null}};zi.forwardRef=function(O){return{$$typeof:Jb,render:O}};zi.isValidElement=Jv;zi.lazy=function(O){return{$$typeof:Qb,_payload:{_status:-1,_result:O},_init:I4}};zi.memo=function(O,F){return{$$typeof:Kb,type:O,compare:F===void 0?null:F}};zi.useCallback=function(O,F){return Nu().useCallback(O,F)};zi.useContext=function(O,F){return Nu().useContext(O,F)};zi.useDebugValue=function(){};zi.useEffect=function(O,F){return Nu().useEffect(O,F)};zi.useImperativeHandle=function(O,F,J){return Nu().useImperativeHandle(O,F,J)};zi.useLayoutEffect=function(O,F){return Nu().useLayoutEffect(O,F)};zi.useMemo=function(O,F){return Nu().useMemo(O,F)};zi.useReducer=function(O,F,J){return Nu().useReducer(O,F,J)};zi.useRef=function(O){return Nu().useRef(O)};zi.useState=function(O){return Nu().useState(O)};zi.version="17.0.2";Zb.exports=zi;var Un=Zb.exports;const s_=jp(Un),z4=qb({__proto__:null,default:s_},[Un]);/** @license React v17.0.2
+ */var Wv=Wb,lh=60103,Yb=60106;zi.Fragment=60107;zi.StrictMode=60108;zi.Profiler=60114;var Xb=60109,$b=60110,Jb=60112;zi.Suspense=60113;var Kb=60115,Qb=60116;if(typeof Symbol=="function"&&Symbol.for){var Dl=Symbol.for;lh=Dl("react.element"),Yb=Dl("react.portal"),zi.Fragment=Dl("react.fragment"),zi.StrictMode=Dl("react.strict_mode"),zi.Profiler=Dl("react.profiler"),Xb=Dl("react.provider"),$b=Dl("react.context"),Jb=Dl("react.forward_ref"),zi.Suspense=Dl("react.suspense"),Kb=Dl("react.memo"),Qb=Dl("react.lazy")}var Fx=typeof Symbol=="function"&&Symbol.iterator;function L4(O){return O===null||typeof O!="object"?null:(O=Fx&&O[Fx]||O["@@iterator"],typeof O=="function"?O:null)}function Vp(O){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+O,J=1;J<arguments.length;J++)F+="&args[]="+encodeURIComponent(arguments[J]);return"Minified React error #"+O+"; visit "+F+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var e_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},t_={};function uh(O,F,J){this.props=O,this.context=F,this.refs=t_,this.updater=J||e_}uh.prototype.isReactComponent={};uh.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error(Vp(85));this.updater.enqueueSetState(this,O,F,"setState")};uh.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function n_(){}n_.prototype=uh.prototype;function Zv(O,F,J){this.props=O,this.context=F,this.refs=t_,this.updater=J||e_}var Yv=Zv.prototype=new n_;Yv.constructor=Zv;Wv(Yv,uh.prototype);Yv.isPureReactComponent=!0;var Xv={current:null},r_=Object.prototype.hasOwnProperty,i_={key:!0,ref:!0,__self:!0,__source:!0};function a_(O,F,J){var fe,Pe={},D=null,E=null;if(F!=null)for(fe in F.ref!==void 0&&(E=F.ref),F.key!==void 0&&(D=""+F.key),F)r_.call(F,fe)&&!i_.hasOwnProperty(fe)&&(Pe[fe]=F[fe]);var e=arguments.length-2;if(e===1)Pe.children=J;else if(1<e){for(var _=Array(e),T=0;T<e;T++)_[T]=arguments[T+2];Pe.children=_}if(O&&O.defaultProps)for(fe in e=O.defaultProps,e)Pe[fe]===void 0&&(Pe[fe]=e[fe]);return{$$typeof:lh,type:O,key:D,ref:E,props:Pe,_owner:Xv.current}}function P4(O,F){return{$$typeof:lh,type:O.type,key:F,ref:O.ref,props:O.props,_owner:O._owner}}function $v(O){return typeof O=="object"&&O!==null&&O.$$typeof===lh}function O4(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return F[J]})}var Bx=/\/+/g;function Q1(O,F){return typeof O=="object"&&O!==null&&O.key!=null?O4(""+O.key):F.toString(36)}function n0(O,F,J,fe,Pe){var D=typeof O;(D==="undefined"||D==="boolean")&&(O=null);var E=!1;if(O===null)E=!0;else switch(D){case"string":case"number":E=!0;break;case"object":switch(O.$$typeof){case lh:case Yb:E=!0}}if(E)return E=O,Pe=Pe(E),O=fe===""?"."+Q1(E,0):fe,Array.isArray(Pe)?(J="",O!=null&&(J=O.replace(Bx,"$&/")+"/"),n0(Pe,F,J,"",function(T){return T})):Pe!=null&&($v(Pe)&&(Pe=P4(Pe,J+(!Pe.key||E&&E.key===Pe.key?"":(""+Pe.key).replace(Bx,"$&/")+"/")+O)),F.push(Pe)),1;if(E=0,fe=fe===""?".":fe+":",Array.isArray(O))for(var e=0;e<O.length;e++){D=O[e];var _=fe+Q1(D,e);E+=n0(D,F,J,_,Pe)}else if(_=L4(O),typeof _=="function")for(O=_.call(O),e=0;!(D=O.next()).done;)D=D.value,_=fe+Q1(D,e++),E+=n0(D,F,J,_,Pe);else if(D==="object")throw F=""+O,Error(Vp(31,F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F));return E}function Rd(O,F,J){if(O==null)return O;var fe=[],Pe=0;return n0(O,fe,"","",function(D){return F.call(J,D,Pe++)}),fe}function I4(O){if(O._status===-1){var F=O._result;F=F(),O._status=0,O._result=F,F.then(function(J){O._status===0&&(J=J.default,O._status=1,O._result=J)},function(J){O._status===0&&(O._status=2,O._result=J)})}if(O._status===1)return O._result;throw O._result}var o_={current:null};function Nu(){var O=o_.current;if(O===null)throw Error(Vp(321));return O}var R4={ReactCurrentDispatcher:o_,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:Xv,IsSomeRendererActing:{current:!1},assign:Wv};zi.Children={map:Rd,forEach:function(O,F,J){Rd(O,function(){F.apply(this,arguments)},J)},count:function(O){var F=0;return Rd(O,function(){F++}),F},toArray:function(O){return Rd(O,function(F){return F})||[]},only:function(O){if(!$v(O))throw Error(Vp(143));return O}};zi.Component=uh;zi.PureComponent=Zv;zi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R4;zi.cloneElement=function(O,F,J){if(O==null)throw Error(Vp(267,O));var fe=Wv({},O.props),Pe=O.key,D=O.ref,E=O._owner;if(F!=null){if(F.ref!==void 0&&(D=F.ref,E=Xv.current),F.key!==void 0&&(Pe=""+F.key),O.type&&O.type.defaultProps)var e=O.type.defaultProps;for(_ in F)r_.call(F,_)&&!i_.hasOwnProperty(_)&&(fe[_]=F[_]===void 0&&e!==void 0?e[_]:F[_])}var _=arguments.length-2;if(_===1)fe.children=J;else if(1<_){e=Array(_);for(var T=0;T<_;T++)e[T]=arguments[T+2];fe.children=e}return{$$typeof:lh,type:O.type,key:Pe,ref:D,props:fe,_owner:E}};zi.createContext=function(O,F){return F===void 0&&(F=null),O={$$typeof:$b,_calculateChangedBits:F,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider={$$typeof:Xb,_context:O},O.Consumer=O};zi.createElement=a_;zi.createFactory=function(O){var F=a_.bind(null,O);return F.type=O,F};zi.createRef=function(){return{current:null}};zi.forwardRef=function(O){return{$$typeof:Jb,render:O}};zi.isValidElement=$v;zi.lazy=function(O){return{$$typeof:Qb,_payload:{_status:-1,_result:O},_init:I4}};zi.memo=function(O,F){return{$$typeof:Kb,type:O,compare:F===void 0?null:F}};zi.useCallback=function(O,F){return Nu().useCallback(O,F)};zi.useContext=function(O,F){return Nu().useContext(O,F)};zi.useDebugValue=function(){};zi.useEffect=function(O,F){return Nu().useEffect(O,F)};zi.useImperativeHandle=function(O,F,J){return Nu().useImperativeHandle(O,F,J)};zi.useLayoutEffect=function(O,F){return Nu().useLayoutEffect(O,F)};zi.useMemo=function(O,F){return Nu().useMemo(O,F)};zi.useReducer=function(O,F,J){return Nu().useReducer(O,F,J)};zi.useRef=function(O){return Nu().useRef(O)};zi.useState=function(O){return Nu().useState(O)};zi.version="17.0.2";Zb.exports=zi;var Un=Zb.exports;const s_=jp(Un),z4=qb({__proto__:null,default:s_},[Un]);/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var D4=Un,l_=60103;Up.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var jx=Symbol.for;l_=jx("react.element"),Up.Fragment=jx("react.fragment")}var F4=D4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B4=Object.prototype.hasOwnProperty,N4={key:!0,ref:!0,__self:!0,__source:!0};function u_(O,F,J){var fe,Pe={},D=null,E=null;J!==void 0&&(D=""+J),F.key!==void 0&&(D=""+F.key),F.ref!==void 0&&(E=F.ref);for(fe in F)B4.call(F,fe)&&!N4.hasOwnProperty(fe)&&(Pe[fe]=F[fe]);if(O&&O.defaultProps)for(fe in F=O.defaultProps,F)Pe[fe]===void 0&&(Pe[fe]=F[fe]);return{$$typeof:l_,type:O,key:D,ref:E,props:Pe,_owner:F4.current}}Up.jsx=u_;Up.jsxs=u_;Gb.exports=Up;var Kv=Gb.exports;const eg=Kv.Fragment,Ar=Kv.jsx,ri=Kv.jsxs;var c_={exports:{}},ml={},f_={exports:{}},h_={};/** @license React v0.20.2
+ */var D4=Un,l_=60103;Up.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var Nx=Symbol.for;l_=Nx("react.element"),Up.Fragment=Nx("react.fragment")}var F4=D4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B4=Object.prototype.hasOwnProperty,N4={key:!0,ref:!0,__self:!0,__source:!0};function u_(O,F,J){var fe,Pe={},D=null,E=null;J!==void 0&&(D=""+J),F.key!==void 0&&(D=""+F.key),F.ref!==void 0&&(E=F.ref);for(fe in F)B4.call(F,fe)&&!N4.hasOwnProperty(fe)&&(Pe[fe]=F[fe]);if(O&&O.defaultProps)for(fe in F=O.defaultProps,F)Pe[fe]===void 0&&(Pe[fe]=F[fe]);return{$$typeof:l_,type:O,key:D,ref:E,props:Pe,_owner:F4.current}}Up.jsx=u_;Up.jsxs=u_;Gb.exports=Up;var Jv=Gb.exports;const eg=Jv.Fragment,Ar=Jv.jsx,ri=Jv.jsxs;var c_={exports:{}},ml={},f_={exports:{}},h_={};/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */(function(O){var F,J,fe,Pe;if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;O.unstable_now=function(){return D.now()}}else{var E=Date,e=E.now();O.unstable_now=function(){return E.now()-e}}if(typeof window>"u"||typeof MessageChannel!="function"){var _=null,T=null,s=function(){if(_!==null)try{var I=O.unstable_now();_(!0,I),_=null}catch(R){throw setTimeout(s,0),R}};F=function(I){_!==null?setTimeout(F,0,I):(_=I,setTimeout(s,0))},J=function(I,R){T=setTimeout(I,R)},fe=function(){clearTimeout(T)},O.unstable_shouldYield=function(){return!1},Pe=O.unstable_forceFrameRate=function(){}}else{var w=window.setTimeout,m=window.clearTimeout;if(typeof console<"u"){var f=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof f!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var l=!1,t=null,a=-1,r=5,n=0;O.unstable_shouldYield=function(){return O.unstable_now()>=n},Pe=function(){},O.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):r=0<I?Math.floor(1e3/I):5};var o=new MessageChannel,i=o.port2;o.port1.onmessage=function(){if(t!==null){var I=O.unstable_now();n=I+r;try{t(!0,I)?i.postMessage(null):(l=!1,t=null)}catch(R){throw i.postMessage(null),R}}else l=!1},F=function(I){t=I,l||(l=!0,i.postMessage(null))},J=function(I,R){a=w(function(){I(O.unstable_now())},R)},fe=function(){m(a),a=-1}}function u(I,R){var U=I.length;I.push(R);e:for(;;){var B=U-1>>>1,G=I[B];if(G!==void 0&&0<b(G,R))I[B]=R,I[U]=G,U=B;else break e}}function p(I){return I=I[0],I===void 0?null:I}function c(I){var R=I[0];if(R!==void 0){var U=I.pop();if(U!==R){I[0]=U;e:for(var B=0,G=I.length;B<G;){var N=2*(B+1)-1,j=I[N],V=N+1,H=I[V];if(j!==void 0&&0>b(j,U))H!==void 0&&0>b(H,j)?(I[B]=H,I[V]=U,B=V):(I[B]=j,I[N]=U,B=N);else if(H!==void 0&&0>b(H,U))I[B]=H,I[V]=U,B=V;else break e}}return R}return null}function b(I,R){var U=I.sortIndex-R.sortIndex;return U!==0?U:I.id-R.id}var d=[],v=[],x=1,g=null,y=3,k=!1,h=!1,M=!1;function A(I){for(var R=p(v);R!==null;){if(R.callback===null)c(v);else if(R.startTime<=I)c(v),R.sortIndex=R.expirationTime,u(d,R);else break;R=p(v)}}function C(I){if(M=!1,A(I),!h)if(p(d)!==null)h=!0,F(L);else{var R=p(v);R!==null&&J(C,R.startTime-I)}}function L(I,R){h=!1,M&&(M=!1,fe()),k=!0;var U=y;try{for(A(R),g=p(d);g!==null&&(!(g.expirationTime>R)||I&&!O.unstable_shouldYield());){var B=g.callback;if(typeof B=="function"){g.callback=null,y=g.priorityLevel;var G=B(g.expirationTime<=R);R=O.unstable_now(),typeof G=="function"?g.callback=G:g===p(d)&&c(d),A(R)}else c(d);g=p(d)}if(g!==null)var N=!0;else{var j=p(v);j!==null&&J(C,j.startTime-R),N=!1}return N}finally{g=null,y=U,k=!1}}var P=Pe;O.unstable_IdlePriority=5,O.unstable_ImmediatePriority=1,O.unstable_LowPriority=4,O.unstable_NormalPriority=3,O.unstable_Profiling=null,O.unstable_UserBlockingPriority=2,O.unstable_cancelCallback=function(I){I.callback=null},O.unstable_continueExecution=function(){h||k||(h=!0,F(L))},O.unstable_getCurrentPriorityLevel=function(){return y},O.unstable_getFirstCallbackNode=function(){return p(d)},O.unstable_next=function(I){switch(y){case 1:case 2:case 3:var R=3;break;default:R=y}var U=y;y=R;try{return I()}finally{y=U}},O.unstable_pauseExecution=function(){},O.unstable_requestPaint=P,O.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var U=y;y=I;try{return R()}finally{y=U}},O.unstable_scheduleCallback=function(I,R,U){var B=O.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?B+U:B):U=B,I){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,I={id:x++,callback:R,priorityLevel:I,startTime:U,expirationTime:G,sortIndex:-1},U>B?(I.sortIndex=U,u(v,I),p(d)===null&&I===p(v)&&(M?fe():M=!0,J(C,U-B))):(I.sortIndex=G,u(d,I),h||k||(h=!0,F(L))),I},O.unstable_wrapCallback=function(I){var R=y;return function(){var U=y;y=R;try{return I.apply(this,arguments)}finally{y=U}}}})(h_);f_.exports=h_;var j4=f_.exports;/** @license React v17.0.2
+ */(function(O){var F,J,fe,Pe;if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;O.unstable_now=function(){return D.now()}}else{var E=Date,e=E.now();O.unstable_now=function(){return E.now()-e}}if(typeof window>"u"||typeof MessageChannel!="function"){var _=null,T=null,s=function(){if(_!==null)try{var I=O.unstable_now();_(!0,I),_=null}catch(R){throw setTimeout(s,0),R}};F=function(I){_!==null?setTimeout(F,0,I):(_=I,setTimeout(s,0))},J=function(I,R){T=setTimeout(I,R)},fe=function(){clearTimeout(T)},O.unstable_shouldYield=function(){return!1},Pe=O.unstable_forceFrameRate=function(){}}else{var w=window.setTimeout,m=window.clearTimeout;if(typeof console<"u"){var f=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof f!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var l=!1,t=null,i=-1,r=5,n=0;O.unstable_shouldYield=function(){return O.unstable_now()>=n},Pe=function(){},O.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):r=0<I?Math.floor(1e3/I):5};var o=new MessageChannel,a=o.port2;o.port1.onmessage=function(){if(t!==null){var I=O.unstable_now();n=I+r;try{t(!0,I)?a.postMessage(null):(l=!1,t=null)}catch(R){throw a.postMessage(null),R}}else l=!1},F=function(I){t=I,l||(l=!0,a.postMessage(null))},J=function(I,R){i=w(function(){I(O.unstable_now())},R)},fe=function(){m(i),i=-1}}function u(I,R){var U=I.length;I.push(R);e:for(;;){var B=U-1>>>1,G=I[B];if(G!==void 0&&0<b(G,R))I[B]=R,I[U]=G,U=B;else break e}}function p(I){return I=I[0],I===void 0?null:I}function c(I){var R=I[0];if(R!==void 0){var U=I.pop();if(U!==R){I[0]=U;e:for(var B=0,G=I.length;B<G;){var N=2*(B+1)-1,j=I[N],V=N+1,H=I[V];if(j!==void 0&&0>b(j,U))H!==void 0&&0>b(H,j)?(I[B]=H,I[V]=U,B=V):(I[B]=j,I[N]=U,B=N);else if(H!==void 0&&0>b(H,U))I[B]=H,I[V]=U,B=V;else break e}}return R}return null}function b(I,R){var U=I.sortIndex-R.sortIndex;return U!==0?U:I.id-R.id}var d=[],v=[],x=1,g=null,y=3,k=!1,h=!1,M=!1;function A(I){for(var R=p(v);R!==null;){if(R.callback===null)c(v);else if(R.startTime<=I)c(v),R.sortIndex=R.expirationTime,u(d,R);else break;R=p(v)}}function C(I){if(M=!1,A(I),!h)if(p(d)!==null)h=!0,F(L);else{var R=p(v);R!==null&&J(C,R.startTime-I)}}function L(I,R){h=!1,M&&(M=!1,fe()),k=!0;var U=y;try{for(A(R),g=p(d);g!==null&&(!(g.expirationTime>R)||I&&!O.unstable_shouldYield());){var B=g.callback;if(typeof B=="function"){g.callback=null,y=g.priorityLevel;var G=B(g.expirationTime<=R);R=O.unstable_now(),typeof G=="function"?g.callback=G:g===p(d)&&c(d),A(R)}else c(d);g=p(d)}if(g!==null)var N=!0;else{var j=p(v);j!==null&&J(C,j.startTime-R),N=!1}return N}finally{g=null,y=U,k=!1}}var P=Pe;O.unstable_IdlePriority=5,O.unstable_ImmediatePriority=1,O.unstable_LowPriority=4,O.unstable_NormalPriority=3,O.unstable_Profiling=null,O.unstable_UserBlockingPriority=2,O.unstable_cancelCallback=function(I){I.callback=null},O.unstable_continueExecution=function(){h||k||(h=!0,F(L))},O.unstable_getCurrentPriorityLevel=function(){return y},O.unstable_getFirstCallbackNode=function(){return p(d)},O.unstable_next=function(I){switch(y){case 1:case 2:case 3:var R=3;break;default:R=y}var U=y;y=R;try{return I()}finally{y=U}},O.unstable_pauseExecution=function(){},O.unstable_requestPaint=P,O.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var U=y;y=I;try{return R()}finally{y=U}},O.unstable_scheduleCallback=function(I,R,U){var B=O.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?B+U:B):U=B,I){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,I={id:x++,callback:R,priorityLevel:I,startTime:U,expirationTime:G,sortIndex:-1},U>B?(I.sortIndex=U,u(v,I),p(d)===null&&I===p(v)&&(M?fe():M=!0,J(C,U-B))):(I.sortIndex=G,u(d,I),h||k||(h=!0,F(L))),I},O.unstable_wrapCallback=function(I){var R=y;return function(){var U=y;y=R;try{return I.apply(this,arguments)}finally{y=U}}}})(h_);f_.exports=h_;var j4=f_.exports;/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Y0=Un,da=Wb,xo=j4;function Dr(O){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+O,J=1;J<arguments.length;J++)F+="&args[]="+encodeURIComponent(arguments[J]);return"Minified React error #"+O+"; visit "+F+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Y0)throw Error(Dr(227));var p_=new Set,wp={};function cf(O,F){rh(O,F),rh(O+"Capture",F)}function rh(O,F){for(wp[O]=F,O=0;O<F.length;O++)p_.add(F[O])}var Bu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),U4=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ux=Object.prototype.hasOwnProperty,Vx={},Hx={};function V4(O){return Ux.call(Hx,O)?!0:Ux.call(Vx,O)?!1:U4.test(O)?Hx[O]=!0:(Vx[O]=!0,!1)}function H4(O,F,J,fe){if(J!==null&&J.type===0)return!1;switch(typeof F){case"function":case"symbol":return!0;case"boolean":return fe?!1:J!==null?!J.acceptsBooleans:(O=O.toLowerCase().slice(0,5),O!=="data-"&&O!=="aria-");default:return!1}}function q4(O,F,J,fe){if(F===null||typeof F>"u"||H4(O,F,J,fe))return!0;if(fe)return!1;if(J!==null)switch(J.type){case 3:return!F;case 4:return F===!1;case 5:return isNaN(F);case 6:return isNaN(F)||1>F}return!1}function cs(O,F,J,fe,Pe,D,E){this.acceptsBooleans=F===2||F===3||F===4,this.attributeName=fe,this.attributeNamespace=Pe,this.mustUseProperty=J,this.propertyName=O,this.type=F,this.sanitizeURL=D,this.removeEmptyString=E}var Oo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(O){Oo[O]=new cs(O,0,!1,O,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(O){var F=O[0];Oo[F]=new cs(F,1,!1,O[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(O){Oo[O]=new cs(O,2,!1,O.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(O){Oo[O]=new cs(O,2,!1,O,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(O){Oo[O]=new cs(O,3,!1,O.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(O){Oo[O]=new cs(O,3,!0,O,null,!1,!1)});["capture","download"].forEach(function(O){Oo[O]=new cs(O,4,!1,O,null,!1,!1)});["cols","rows","size","span"].forEach(function(O){Oo[O]=new cs(O,6,!1,O,null,!1,!1)});["rowSpan","start"].forEach(function(O){Oo[O]=new cs(O,5,!1,O.toLowerCase(),null,!1,!1)});var Qv=/[\-:]([a-z])/g;function em(O){return O[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule