Files
ai/charting_library/bundles/chart-floating-tooltip.f2fc565d7b519d7eb7b4.js

8 lines
23 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[762],{14487:(t,e)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)&&o.length){var a=i.apply(null,o);a&&t.push(a)}else if("object"===r)for(var s in o)n.call(o,s)&&o[s]&&t.push(s)}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},80188:t=>{t.exports={divider:"divider-pzdcWv_c","orientation-horizontal":"orientation-horizontal-pzdcWv_c","orientation-vertical":"orientation-vertical-pzdcWv_c","size-xsmall":"size-xsmall-pzdcWv_c","size-small":"size-small-pzdcWv_c","size-medium":"size-medium-pzdcWv_c","size-large":"size-large-pzdcWv_c","size-xlarge":"size-xlarge-pzdcWv_c","size-xxlarge":"size-xxlarge-pzdcWv_c","type-primary":"type-primary-pzdcWv_c","type-secondary":"type-secondary-pzdcWv_c"}},90670:t=>{t.exports={positioner:"positioner-lATuqHRX",noHorizontalShrink:"noHorizontalShrink-lATuqHRX",noHorizontalGrow:"noHorizontalGrow-lATuqHRX",noVerticalShrink:"noVerticalShrink-lATuqHRX",noVerticalGrow:"noVerticalGrow-lATuqHRX",invisible:"invisible-lATuqHRX",portal:"portal-lATuqHRX"}},13528:(t,e,o)=>{"use strict";o.d(e,{AppContext:()=>n});const n=(0,o(79474).createContext)({isOnMobileAppPage:()=>!1,isRtl:!1,locale:"en",renderMode:"legacy"})},95306:(t,e,o)=>{"use strict";o.d(e,{Divider:()=>h});var n,i,r,a=o(79474),s=o(14487),l=o.n(s),c=o(80188),u=o.n(c);function h(t){const{className:e,type:o="secondary",size:n="small",orientation:i="horizontal"}=t,r=l()(e,u().divider,u()[`size-${n}`],u()[`type-${o}`],u()[`orientation-${i}`]);return a.createElement("hr",{className:r,"aria-orientation":i})}!function(t){t.XSmall="xsmall",t.Small="small",t.Medium="medium",t.Large="large",t.XLarge="xlarge",t.XXLarge="xxlarge"}(n||(n={})),function(t){t.Primary="primary",t.Secondary="secondary"}(i||(i={})),function(t){t.Horizontal="horizontal",t.Vertical="vertical"}(r||(r={}))},69947:(t,e,o)=>{"use strict";o.d(e,{useIsomorphicLayoutEffect:()=>i});var n=o(79474);function i(t,e){("undefined"==typeof window?n.useEffect:n.useLayoutEffect)(t,e)}},9774:(t,e,o)=>{"use strict";o.d(e,{useMergedRefs:()=>r});var n=o(79474),i=o(16455);function r(t){return(0,n.useCallback)((0,i.mergeRefs)(t),t)}},98676:(t,e,o)=>{"use strict";o.d(e,{RectanglePositioner:()=>R});var n=o(79474),i=o(14487),r=o.n(i),a=o(6616),s=o(52885),l=o(18045);function c(t){return{x:1-t.x,y:t.y}}function u(t){return t.map((t=>function(t){return{...t,name:t.rtlName||t.name,anchorPoint:c(t.anchorPoint),contentPoint:c(t.contentPoint),offset:t.offset?(e=t.offset,{x:-e.x,y:e.y}):void 0};var e}(t)))}function h(t){return{left:t.x,right:t.x+t.width,top:t.y,bottom:t.y+t.height}}function d(t,e,o,n,i,r,a){const s={...n,...h(n)},l=function(t,e){return{x:t.x+e.anchorPoint.x*t.width+(e.offset?.x??0),y:t.y+e.anchorPoint.y*t.height+(e.offset?.y??0)}
}(t,i),c=o.width,u=f(i.overflowHorizontal,l.x,s.left,s.right,i.contentPoint.x,c),d=Math.min(c,u??1/0),m=a&&void 0!==u&&d<c;m&&e.style.setProperty(r,`${u}px`);const g=m?e.clientHeight:o.height,x=f(i.overflowVertical,l.y,s.top,s.bottom,i.contentPoint.y,g),v=Math.min(g,x??1/0);m&&e.style.removeProperty(r);const w=l.x-i.contentPoint.x*c,y=l.x+(1-i.contentPoint.x)*c,P=p(i.overflowHorizontal,l.x,s.left,s.right,i.contentPoint.x,w,y),b=l.y-i.contentPoint.y*g,_=l.y+(1-i.contentPoint.y)*g,E=p(i.overflowVertical,l.y,s.top,s.bottom,i.contentPoint.y,b,_);return{anchoredPx:{x:P.anchoredPx,y:E.anchoredPx},contentPointFraction:{x:P.contentPointFraction,y:E.contentPointFraction},rule:i,initialContentSizePx:{width:o.width,height:o.height},contentSizeAfterWidthRestrictionPx:{width:d,height:g},contentSizePx:{width:d,height:v},maxContentSizePx:{width:u,height:x},slide:{x:P.slide,y:E.slide}}}function p(t,e,o,n,i,r,a){const s=o-r,l=a-n;switch(t){case"slide":case"crop":if(a-r>n-o||s>0)return{contentPointFraction:0,anchoredPx:o,slide:Math.max(0,s)};if(l>0)return{contentPointFraction:1,anchoredPx:n,slide:Math.max(0,l)};break;case"cropSlide":{const t=o-e,i=e-n;if(t>0||s>0)return{contentPointFraction:0,anchoredPx:o,slide:Math.max(0,t)};if(i>0||l>0)return{contentPointFraction:1,anchoredPx:n,slide:Math.max(0,i)};break}case"cropOverflow":if(s>0)return{contentPointFraction:0,anchoredPx:Math.min(o,e),slide:0};if(l>0)return{contentPointFraction:1,anchoredPx:Math.max(n,e),slide:0}}return{contentPointFraction:i,anchoredPx:e,slide:0}}function f(t,e,o,n,i,r){switch(t){case"crop":return function(t,e,o,n,i){const r=t-e>=0&&o-t>=0;if(r&&(1===n||0===n))return function(t,e,o,n){return 0===n?o-t:t-e}(t,e,o,n);const{availableSpaceStart:a,availableSpaceEnd:s}=g(n,i,t,e,o);return a+s}(e,o,n,i,r);case"cropOverflow":return m(e,o,n,i,r);case"slide":return n-o;case"cropSlide":return Math.min(n-o,m(e,o,n,i,r));case"keepNonFitting":return}}function m(t,e,o,n,i){if(n>=1||n<=0)return function(t,e,o,n){const i=Math.max(0,t-e),r=Math.max(0,o-t),a=n>0?i/n:Number.POSITIVE_INFINITY,s=n<1?r/(1-n):Number.POSITIVE_INFINITY;return Math.min(a,s)}(t,e,o,n);const{availableSpaceStart:r,availableSpaceEnd:a}=g(n,i,t,e,o);return Math.max(0,r)+Math.max(0,a)}function g(t,e,o,n,i){const r=e*Math.max(t,0),a=e*Math.max(1-t,0);return{availableSpaceStart:Math.min(o-n,r),availableSpaceEnd:Math.min(i-o,a)}}function x(t){return t.initialContentSizePx.width-t.contentSizePx.width}function v(t){return t.contentSizeAfterWidthRestrictionPx.height-t.contentSizePx.height}function w(t){return t.slide.x+t.slide.y}function y(t,e){const o=function(t,e){const o=h({x:t.anchoredPx.x-t.contentPointFraction.x*t.contentSizePx.width,y:t.anchoredPx.y-t.contentPointFraction.y*t.contentSizePx.height,width:t.contentSizePx.width,height:t.contentSizePx.height}),n=h(e);return{left:Math.max(0,n.left-o.left),right:Math.max(0,o.right-n.right),top:Math.max(0,n.top-o.top),bottom:Math.max(0,o.bottom-n.bottom)}}(t,e);return(1+o.left+o.right)*(1+o.top+o.bottom)-1}function P(t,e){return{rule:t,overflow:y(t,e),widthDiff:x(t),
heightDiff:v(t),slide:w(t)}}function b(t){return 0===t.overflow&&0===t.widthDiff&&0===t.heightDiff&&0===t.slide}function _(){return{x:0,y:0,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}var E=o(9774),z=o(28115);var S,T=o(7321),A=o(90670),C=o.n(A);function R(t){const{isRtl:e,anchoredAt:o,isOpen:i,placementRules:c,anchorPositionerCardAppearanceClassname:h,refObjectToContentWrapperElement:p,children:f,onPlacementRuleSelected:m,getRootRect:g=_,idOfContentWrapperElement:x,ariaLabelledby:v,ariaMultiselectable:w,role:y,width:S,height:A,repositionTriggers:R=[],repositionDependencies:M=[],contentResize:V=15,dataQaId:H,scrollContainer:I,assumeNoContentWrap:W}=t,F=(0,n.useMemo)((()=>(0,T.isArray)(c)?c:[c]),[c]),D=(0,n.useRef)(null),[L,O]=(0,n.useState)(void 0),G=function(t){const[e,o]=(0,n.useState)((()=>Symbol()));return(0,n.useLayoutEffect)((()=>{const e=t.map((t=>{const e=()=>{o(Symbol())};return t.subscribe(e),()=>t.unsubscribe(e)}));return(0,z.forkFn)(...e)}),[...t]),e}(R);(0,n.useLayoutEffect)((()=>{i&&D.current?O(function(t,e,o,n,i){const{rtl:r,scrollContainer:a,maxWidthCssProperty:s="max-width",maxHeightCssProperty:l="max-height",contentOverflowWrap:c=!0}=i||{},h=r?u(n):n,p=function(t){if(!t)return;const e=t.scrollTop;return()=>{t.scrollTop=e}}(a),f=function(t,e){const o=e.map((e=>[e,t.style.getPropertyValue(e)]));return o.forEach((([e,o])=>{o&&t.style.removeProperty(e)})),()=>{o.forEach((([e,o])=>{t.style.setProperty(e,o)}))}}(e,[s,l]),m=e.getBoundingClientRect(),g=function(){const n=[];for(const i of h){const r=d(t,e,m,o,{...i},s,c),a=P(r,o);if(b(a))return r;n.push(a)}return 1===(i=n).length?i[0].rule:i.slice().sort(((t,e)=>t.overflow!==e.overflow?t.overflow-e.overflow:t.widthDiff!==e.widthDiff?t.widthDiff-e.widthDiff:t.heightDiff!==e.heightDiff?t.heightDiff-e.heightDiff:t.slide-e.slide))[0].rule;var i}();return f(),p?.(),g}(o,D.current,g(),F,{rtl:!!e,scrollContainer:I?.current,maxHeightCssProperty:"--ui-lib-private-positioner-screen-restriction-max-height",maxWidthCssProperty:"--ui-lib-private-positioner-screen-restriction-max-width",contentOverflowWrap:!W})):O(void 0)}),[o,D,g,F,i,G,e,I,W,...M]),(0,n.useEffect)((()=>{if(L?.rule&&m)return m(L.rule)}),[L?.rule,m]);const j=(0,E.useMergedRefs)([p,D]);if(!i)return null;const{classnames:B,style:U}=function(t,e,o){const n=[],i={},r={width:e,height:o};for(const e of["width","height"]){const o=r[e];(Array.isArray(o)?o:[o]).filter(a.isExistent).forEach((o=>{switch(o.by){case"content":return;case"class":return void n.push(o.className);case"anchor":{const n=o.type??"exact";i[N[e][n]]=k(t[e])}}}))}return{classnames:n,style:i}}(o,S,A),X=[h,C().positioner],q=!(1&V),$=!(2&V),Z=!(4&V),Y=!(8&V),Q=r()(q&&C().noHorizontalShrink,$&&C().noHorizontalGrow,Z&&C().noVerticalShrink,Y&&C().noVerticalGrow),J={...U,"--ui-lib-positioner-anchor-width":k(o.width),"--ui-lib-positioner-anchor-height":k(o.height),"--ui-lib-positioner-anchor-top":k(o.y),"--ui-lib-positioner-anchor-left":k(o.x)};return n.createElement(s.Portal,{className:C().portal
},void 0===L?n.createElement("div",{className:r()(C().invisible,...B,...X,Q),style:J,ref:j,"data-qa-id":H},f):n.createElement("div",{className:r()(...X,...B,Q),style:{"--ui-lib-positioner-content-point-x":L.contentPointFraction.x,"--ui-lib-positioner-content-point-y":L.contentPointFraction.y,"--ui-lib-positioner-anchored-x":k(L.anchoredPx.x),"--ui-lib-positioner-anchored-y":k(L.anchoredPx.y),"--ui-lib-private-positioner-screen-restriction-max-width":k(L.maxContentSizePx.width),"--ui-lib-private-positioner-screen-restriction-max-height":k(L.maxContentSizePx.height),"--ui-lib-positioner-content-height-measured":k(L.contentSizePx.height),"--ui-lib-positioner-content-width-measured":k(L.contentSizePx.width),...J},...(0,l.contentProps)(x,v,w,y),ref:j,"data-qa-id":H},f))}function k(t){return void 0!==t&&isFinite(t)?`${t}px`:void 0}!function(t){t[t.AllowHorizontalShrink=1]="AllowHorizontalShrink",t[t.AllowHorizontalGrow=2]="AllowHorizontalGrow",t[t.AllowVerticalShrink=4]="AllowVerticalShrink",t[t.AllowVerticalGrow=8]="AllowVerticalGrow"}(S||(S={}));const N={height:{exact:"--ui-lib-private-positioner-anchor-exact-height",max:"--ui-lib-private-positioner-anchor-max-height",min:"--ui-lib-private-positioner-anchor-min-height"},width:{exact:"--ui-lib-private-positioner-anchor-exact-width",max:"--ui-lib-private-positioner-anchor-max-width",min:"--ui-lib-private-positioner-anchor-min-width"}}},18045:(t,e,o)=>{"use strict";function n(t,e,o,n){return{role:n,"aria-labelledby":e,"aria-multiselectable":o,id:t}}o.d(e,{contentProps:()=>n})},9870:(t,e,o)=>{"use strict";o.d(e,{PLACEMENT_BOTTOM_ALIGN_LEFT:()=>n,PLACEMENT_BOTTOM_ALIGN_RIGHT:()=>i,PLACEMENT_LEFT_ALIGN_CENTER:()=>l,PLACEMENT_RIGHT_ALIGN_CENTER:()=>s,PLACEMENT_TOP_ALIGN_LEFT:()=>r,PLACEMENT_TOP_ALIGN_RIGHT:()=>a});const n={name:"bottom-left",rtlName:"bottom-right",anchorPoint:{x:0,y:1},contentPoint:{x:0,y:0},overflowHorizontal:"slide",overflowVertical:"cropSlide"},i={name:"bottom-right",rtlName:"bottom-left",anchorPoint:{x:1,y:1},contentPoint:{x:1,y:0},overflowHorizontal:"slide",overflowVertical:"cropSlide"},r={name:"top-left",rtlName:"top-right",anchorPoint:{x:0,y:0},contentPoint:{x:0,y:1},overflowHorizontal:"slide",overflowVertical:"cropSlide"},a={name:"top-right",rtlName:"top-left",anchorPoint:{x:1,y:0},contentPoint:{x:1,y:1},overflowHorizontal:"slide",overflowVertical:"cropSlide"},s={name:"right",rtlName:"left",anchorPoint:{x:1,y:.5},contentPoint:{x:0,y:.5},overflowHorizontal:"cropSlide",overflowVertical:"slide"},l={name:"left",rtlName:"right",anchorPoint:{x:0,y:.5},contentPoint:{x:1,y:.5},overflowHorizontal:"cropSlide",overflowVertical:"slide"}},52885:(t,e,o)=>{"use strict";o.d(e,{Portal:()=>c,PortalContext:()=>u});var n=o(79474),i=o(29365),r=o(56770),a=o(46765),s=o(70014),l=o(99286);class c extends n.PureComponent{constructor(){super(...arguments),this._uuid=(0,r.nanoid)()}componentWillUnmount(){this._manager().removeWindow(this._uuid)}render(){const t=this._manager().ensureWindow(this._uuid,this.props.layerOptions);t.style.top=this.props.top||"",
t.style.bottom=this.props.bottom||"",t.style.left=this.props.left||"",t.style.right=this.props.right||"",t.style.pointerEvents=this.props.pointerEvents||"";const e=this.props.className;return e&&("string"==typeof e?t.classList.add(e):t.classList.add(...e)),this.props.shouldTrapFocus&&!t.hasAttribute(s.FOCUS_TRAP_DATA_ATTRIBUTE)&&t.setAttribute(s.FOCUS_TRAP_DATA_ATTRIBUTE,"true"),this.props["aria-hidden"]&&t.setAttribute("aria-hidden","true"),i.createPortal(n.createElement(u.Provider,{value:this},this.props.children),t)}moveToTop(){this._manager().moveToTop(this._uuid)}_manager(){return null===this.context?(0,a.getRootOverlapManager)():this.context}}c.contextType=l.SlotContext;const u=n.createContext(null)},99286:(t,e,o)=>{"use strict";o.d(e,{Slot:()=>i,SlotContext:()=>r});var n=o(79474);class i extends n.Component{shouldComponentUpdate(){return!1}render(){return n.createElement("div",{style:{position:"fixed",zIndex:150,left:0,top:0},ref:this.props.reference})}}const r=n.createContext(null)},28115:(t,e,o)=>{"use strict";function n(...t){return(...e)=>{t.forEach((t=>t?.(...e)))}}o.d(e,{forkFn:()=>n})},16455:(t,e,o)=>{"use strict";function n(t){return e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}}function i(t){return n([t])}o.d(e,{isomorphicRef:()=>i,mergeRefs:()=>n})},46765:(t,e,o)=>{"use strict";o.d(e,{OverlapManager:()=>a,getRootOverlapManager:()=>l});var n=o(85842),i=o(70014);class r{constructor(){this._storage=[]}add(t){this._storage.push(t)}remove(t){this._storage=this._storage.filter((e=>t!==e))}has(t){return this._storage.includes(t)}getItems(){return this._storage}}class a{constructor(t=document){this._storage=new r,this._windows=new Map,this._index=0,this._document=t,this._container=t.createDocumentFragment()}setContainer(t){const e=this._container,o=null===t?this._document.createDocumentFragment():t;!function(t,e){Array.from(t.childNodes).forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&e.appendChild(t)}))}(e,o),this._container=o}registerWindow(t){this._storage.has(t)||this._storage.add(t)}ensureWindow(t,e={position:"fixed",direction:"normal"}){const o=this._windows.get(t);if(void 0!==o)return o;this.registerWindow(t);const n=this._document.createElement("div");if(n.style.position=e.position,n.style.zIndex=this._index.toString(),n.dataset.id=t,void 0!==e.index){const t=this._container.childNodes.length;if(e.index>=t)this._container.appendChild(n);else if(e.index<=0)this._container.insertBefore(n,this._container.firstChild);else{const t=this._container.childNodes[e.index];this._container.insertBefore(n,t)}}else"reverse"===e.direction?this._container.insertBefore(n,this._container.firstChild):this._container.appendChild(n);return this._windows.set(t,n),++this._index,n}unregisterWindow(t){this._storage.remove(t);const e=this._windows.get(t);void 0!==e&&(null!==e.parentElement&&e.parentElement.removeChild(e),this._windows.delete(t))}getZindex(t){const e=this.ensureWindow(t);return parseInt(e.style.zIndex||"0")}moveLastWindowToTop(){const t=this._storage.getItems(),e=t[t.length-1]
;e&&this.moveToTop(e)}moveToTop(t){if(this.getZindex(t)!==this._index){const e=this.ensureWindow(t);this._windows.forEach(((t,o)=>{t.hasAttribute(i.FOCUS_TRAP_DATA_ATTRIBUTE)&&t.setAttribute(i.FOCUS_TRAP_DATA_ATTRIBUTE,t===e?"true":"false")})),e.style.zIndex=(++this._index).toString()}}removeWindow(t){this.unregisterWindow(t)}}const s=new WeakMap;function l(t=document){const e=t.getElementById("overlap-manager-root");if(null!==e)return(0,n.ensureDefined)(s.get(e));{const e=new a(t),o=function(t){const e=t.createElement("div");return e.style.position="absolute",e.style.zIndex=150..toString(),e.style.top="0px",e.style.left="0px",e.id="overlap-manager-root",e.dataset.qaId="overlap-manager-root",e}(t);return s.set(o,e),e.setContainer(o),t.body.appendChild(o),e}}var c;!function(t){t[t.BaseZindex=150]="BaseZindex"}(c||(c={}))},6616:(t,e,o)=>{"use strict";function n(t){return null!=t}o.d(e,{isExistent:()=>n})},64483:(t,e,o)=>{"use strict";o.d(e,{createReactRoot:()=>h});var n=o(79474),i=o(29365),r=o(36334),a=o(13528),s=o(90141),l=o(81458);const c={iOs:"old",android:"new",old:"old",new:"new",any:"any"};function u(t){const[e]=(0,n.useState)({isOnMobileAppPage:t=>(0,s.isOnMobileAppPage)(c[t]),isRtl:(0,l.isRtl)(),locale:window.locale,renderMode:t.renderMode??"legacy"});return n.createElement(a.AppContext.Provider,{value:e},t.children)}function h(t,e,o="legacy"){const a=n.createElement(u,{renderMode:o},t);if("modern"===o){const t=(0,r.createRoot)(e);return t.render(a),{render(e){t.render(n.createElement(u,{renderMode:o},e))},unmount(){t.unmount()}}}return i.render(a,e),{render(t){i.render(n.createElement(u,{renderMode:o},t),e)},unmount(){i.unmountComponentAtNode(e)}}}},57069:(t,e,o)=>{"use strict";o.d(e,{useWatchedValueReadonly:()=>r});var n=o(79474),i=o(69947);const r=(t,e=!1,o=[])=>{const r="watchedValue"in t?t.watchedValue:void 0,a="defaultValue"in t?t.defaultValue:t.watchedValue.value(),[s,l]=(0,n.useState)(r?r.value():a);return(e?i.useIsomorphicLayoutEffect:n.useEffect)((()=>{if(r){l(r.value());const t=t=>l(t);return r.subscribe(t),()=>r.unsubscribe(t)}return()=>{}}),[r,...o]),s}},36334:(t,e,o)=>{"use strict";var n=o(29365);e.createRoot=n.createRoot,n.hydrateRoot},48024:t=>{t.exports={"floating-tooltip-container":"floating-tooltip-container-HbjzitVh",hidden:"hidden-HbjzitVh","chart-floating-tooltip-content":"chart-floating-tooltip-content-HbjzitVh","chart-floating-tooltip-row":"chart-floating-tooltip-row-HbjzitVh","chart-floating-tooltip-divider":"chart-floating-tooltip-divider-HbjzitVh","chart-floating-tooltip-divider-dark":"chart-floating-tooltip-divider-dark-HbjzitVh","chart-floating-tooltip-title":"chart-floating-tooltip-title-HbjzitVh","chart-floating-tooltip-title-text":"chart-floating-tooltip-title-text-HbjzitVh","chart-floating-tooltip-title-text-dark":"chart-floating-tooltip-title-text-dark-HbjzitVh","chart-floating-tooltip-title-inputs":"chart-floating-tooltip-title-inputs-HbjzitVh","chart-floating-tooltip-title-inputs-dark":"chart-floating-tooltip-title-inputs-dark-HbjzitVh",
"chart-floating-tooltip-value":"chart-floating-tooltip-value-HbjzitVh","chart-floating-tooltip-value-dark":"chart-floating-tooltip-value-dark-HbjzitVh","chart-floating-tooltip-value--summary":"chart-floating-tooltip-value--summary-HbjzitVh","chart-floating-tooltip-positioner":"chart-floating-tooltip-positioner-HbjzitVh","chart-floating-tooltip-positioner-dark":"chart-floating-tooltip-positioner-dark-HbjzitVh"}},47580:(t,e,o)=>{"use strict";o.r(e),o.d(e,{createChartFloatingTooltip:()=>v});var n=o(79474),i=o(64483),r=o(14487),a=o.n(r),s=o(7321),l=o(98676),c=o(9870),u=o(95306),h=o(57069),d=o(48024);const p=12;function f(t){const{state:e,isDark:o}=t;return n.createElement("div",{className:d["chart-floating-tooltip-row"]},n.createElement("div",{className:d["chart-floating-tooltip-title"]},n.createElement("div",{className:a()(d["chart-floating-tooltip-title-text"],o&&d["chart-floating-tooltip-title-text-dark"])},e.titleText),n.createElement("div",{className:a()(d["chart-floating-tooltip-title-inputs"],o&&d["chart-floating-tooltip-title-inputs-dark"])},e.titleInputs)),n.createElement("div",{className:a()(d["chart-floating-tooltip-value"],e.isSummary&&d["chart-floating-tooltip-value--summary"],o&&d["chart-floating-tooltip-value-dark"]),style:{color:t.state.valueColor}},e.value))}function m(t){const{state:e,isDark:o}=t;return n.createElement(n.Fragment,null,e.plots.map(((t,e)=>n.createElement(f,{key:e,state:t,isDark:o}))))}function g(t){const e=(0,h.useWatchedValueReadonly)({watchedValue:t.state}),o=[...e.sources,e.seriesSource].filter(s.notUndefined).reduce(((t,e)=>t+e.plots.length),0),i=(0,n.useRef)(null);return n.createElement(l.RectanglePositioner,{isOpen:o>0,anchoredAt:{x:e.x-p,y:e.y,width:2*p,height:0},width:{by:"content"},height:{by:"content"},isRtl:!1,anchorPositionerCardAppearanceClassname:a()(d["chart-floating-tooltip-positioner"],e.isDark&&d["chart-floating-tooltip-positioner-dark"]),placementRules:x,refObjectToContentWrapperElement:i,assumeNoContentWrap:!0},n.createElement("div",{className:d["chart-floating-tooltip-content"]},!!e.seriesSource?.plots.length&&n.createElement(n.Fragment,null,n.createElement(m,{state:e.seriesSource,isDark:e.isDark}),e.sources.length>0&&n.createElement(u.Divider,{size:"xsmall",className:a()(d["chart-floating-tooltip-divider"],e.isDark&&d["chart-floating-tooltip-divider-dark"])})),e.sources.map(((t,o)=>n.createElement(m,{state:t,isDark:e.isDark,key:`source-${o}`})))))}const x=[c.PLACEMENT_RIGHT_ALIGN_CENTER,c.PLACEMENT_LEFT_ALIGN_CENTER];function v(t){const e=document.createElement("div"),o=(0,i.createReactRoot)(n.createElement(g,{state:t}),e);return{destroy:()=>{o.unmount(),e.remove(),t.release()}}}},43921:(t,e,o)=>{"use strict";o.r(e),o.d(e,{createViewState:()=>h,limitedPlots:()=>c});var n=o(7321),i=o(91599),r=o(75595),a=o(68657),s=o(47087);const l=10;function c(t,e,n){if(!t||!e)return[];const r=t.items(),a=n-l+1;if(r.length>e||a>1&&r.length===e){const n=t.items().slice(0,e-1);return n.push({titleText:"",titleInputs:"",value:i.t(null,{context:"chart floating toolbar",
plural:"{plotsCount} more values",count:a},o(85879)).format({plotsCount:a.toString()}),isSummary:!0}),n}return r}function u(t,e,o,n){return e&&"release"in e?(0,a.combine)(((t,e)=>({plots:c(t,o,n)})),e,t).ownership():(0,a.combine)((t=>({plots:c(e,o,n)})),t).ownership()}function h(t,e){const o=(0,a.combine)((t=>t?.activePaneWidget().value()??null),t.weakReference()),i=(0,a.combine)((t=>t?.containsMainSeries()?t.state().model().mainSeries().chartFloatingTooltipView?.()??null:null),o.weakReference()),c=(0,a.combine)(((t,e,o)=>({cursor:t,seriesSource:o,isDark:!!e&&e.state().model().dark().value()})),e.weakReference(),o.weakReference(),u(e.weakReference(),i.ownership(),1/0,0)),h=(0,a.accumulate)(((t,e)=>({seriesSource:e.seriesSource,sources:t.filter((t=>t.plots.length)),x:e.cursor?.x??0,y:e.cursor?.y??0,isDark:e.isDark})),function(t,e,o){const i=(0,a.combine)((t=>t?[(0,r.createWVFromGetterAndSubscription)((()=>[...t.state().sourcesByGroup().plotSources().filter((t=>t.isVisible()))].reverse()),t.state().dataSourcesCollectionChanged()).ownership()]:[]),e.weakReference()),c=(0,a.accumulate)((t=>t[0]??[]),i.ownership());return(0,a.combine)(((e,o)=>{const i=e.filter((t=>!(0,s.isSeries)(t))).map((t=>t.chartFloatingTooltipView?.()??null)).filter(n.notNull),r=function(t){return t.reduce(((t,e)=>t+e.items().length),0)}(i);return i.reduce(((e,o,n)=>{if(e.counter>=l)return e;const i=u(t,o,l-e.counter,r);return{counter:e.counter+i.value().plots.length,views:[...e.views,i]}}),{counter:0,views:[]}).views}),c.ownership(),o.weakReference()).ownership()}(e,o.weakReference(),i.weakReference()).ownership(),c.ownership());return h.ownership()}},56770:(t,e,o)=>{"use strict";o.d(e,{nanoid:()=>n});let n=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"")}}]);