initial commit with charts and assistant chat
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6456,9790],{97754:(e,t)=>{var i;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var s=typeof i;if("string"===s||"number"===s)e.push(i);else if(Array.isArray(i)&&i.length){var o=r.apply(null,i);o&&e.push(o)}else if("object"===s)for(var a in i)n.call(i,a)&&i[a]&&e.push(a)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}()},53895:e=>{e.exports={disableSelfPositioning:"disableSelfPositioning-dYiqkKAE"}},51284:e=>{e.exports={"tablet-normal-breakpoint":"(max-width: 768px)","small-height-breakpoint":"(max-height: 360px)","tablet-small-breakpoint":"(max-width: 440px)"}},69101:e=>{e.exports={wrapper:"wrapper-nGEmjtaX",container:"container-nGEmjtaX",tab:"tab-nGEmjtaX",active:"active-nGEmjtaX",title:"title-nGEmjtaX",icon:"icon-nGEmjtaX",withoutIcon:"withoutIcon-nGEmjtaX",titleText:"titleText-nGEmjtaX",nested:"nested-nGEmjtaX",isTablet:"isTablet-nGEmjtaX",isMobile:"isMobile-nGEmjtaX",showLastDivider:"showLastDivider-nGEmjtaX",medium:"medium-nGEmjtaX",large:"large-nGEmjtaX",withoutArrow:"withoutArrow-nGEmjtaX",accessible:"accessible-nGEmjtaX"}},98301:e=>{e.exports={container:"container-PVi_27Zl",centerElement:"centerElement-PVi_27Zl",contentWrap:"contentWrap-PVi_27Zl",withTransition:"withTransition-PVi_27Zl",noticeShowed:"noticeShowed-PVi_27Zl",icon:"icon-PVi_27Zl",textWrap:"textWrap-PVi_27Zl"}},35266:e=>{e.exports={title:"title-z9fs4j4t",small:"small-z9fs4j4t",normal:"normal-z9fs4j4t",large:"large-z9fs4j4t"}},37963:e=>{e.exports={container:"container-XOHpda28",mobile:"mobile-XOHpda28",withoutFavoriting:"withoutFavoriting-XOHpda28"}},58794:e=>{e.exports={title:"title-cIIj4HrJ",disabled:"disabled-cIIj4HrJ",icon:"icon-cIIj4HrJ",locked:"locked-cIIj4HrJ",open:"open-cIIj4HrJ",actionIcon:"actionIcon-cIIj4HrJ",selected:"selected-cIIj4HrJ",codeIcon:"codeIcon-cIIj4HrJ",solutionIcon:"solutionIcon-cIIj4HrJ"}},15272:e=>{e.exports={"tablet-small-breakpoint":"(max-width: 440px)",container:"container-WeNdU0sq",mobile:"mobile-WeNdU0sq",selected:"selected-WeNdU0sq",disabled:"disabled-WeNdU0sq",favorite:"favorite-WeNdU0sq",highlighted:"highlighted-WeNdU0sq","highlight-animation":"highlight-animation-WeNdU0sq",badge:"badge-WeNdU0sq",main:"main-WeNdU0sq",paddingLeft:"paddingLeft-WeNdU0sq",author:"author-WeNdU0sq",likes:"likes-WeNdU0sq",actions:"actions-WeNdU0sq",isActive:"isActive-WeNdU0sq",mobileText:"mobileText-WeNdU0sq"}},26943:e=>{e.exports={container:"container-hrZZtP0J"}},53222:e=>{e.exports={"tablet-small-breakpoint":"(max-width: 440px)",dialog:"dialog-I087YV6b",dialogLibrary:"dialogLibrary-I087YV6b",contentContainer:"contentContainer-I087YV6b",listContainer:"listContainer-I087YV6b",scroll:"scroll-I087YV6b",sidebarContainer:"sidebarContainer-I087YV6b",noContentBlock:"noContentBlock-I087YV6b",tabWithHint:"tabWithHint-I087YV6b",solution:"solution-I087YV6b",mobileSidebarItem:"mobileSidebarItem-I087YV6b"}},16499:e=>{e.exports={
|
||||
favorite:"favorite-_FRQhM5Y",hovered:"hovered-_FRQhM5Y",disabled:"disabled-_FRQhM5Y",focused:"focused-_FRQhM5Y",active:"active-_FRQhM5Y",checked:"checked-_FRQhM5Y"}},86332:(e,t,i)=>{"use strict";i.d(t,{ControlGroupContext:()=>n});const n=i(50959).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},95604:(e,t,i)=>{"use strict";function n(e){let t=0;return e.isTop&&e.isLeft||(t+=1),e.isTop&&e.isRight||(t+=2),e.isBottom&&e.isLeft||(t+=8),e.isBottom&&e.isRight||(t+=4),t}i.d(t,{getGroupCellRemoveRoundBorders:()=>n})},43010:(e,t,i)=>{"use strict";i.d(t,{useIsomorphicLayoutEffect:()=>r});var n=i(50959);function r(e,t){("undefined"==typeof window?n.useEffect:n.useLayoutEffect)(e,t)}},27267:(e,t,i)=>{"use strict";function n(e,t,i,n,r){function s(r){if(e>r.timeStamp)return;const s=r.target;void 0!==i&&null!==t&&null!==s&&s.ownerDocument===n&&(t.contains(s)||i(r))}return r.click&&n.addEventListener("click",s,!1),r.mouseDown&&n.addEventListener("mousedown",s,!1),r.touchEnd&&n.addEventListener("touchend",s,!1),r.touchStart&&n.addEventListener("touchstart",s,!1),()=>{n.removeEventListener("click",s,!1),n.removeEventListener("mousedown",s,!1),n.removeEventListener("touchend",s,!1),n.removeEventListener("touchstart",s,!1)}}i.d(t,{addOutsideEventListener:()=>n})},36383:(e,t,i)=>{"use strict";i.d(t,{useOutsideEvent:()=>o});var n=i(50959),r=i(43010),s=i(27267);function o(e){const{click:t,mouseDown:i,touchEnd:o,touchStart:a,handler:l,reference:c}=e,d=(0,n.useRef)(null),u=(0,n.useRef)("undefined"==typeof window?0:new window.CustomEvent("timestamp").timeStamp);return(0,r.useIsomorphicLayoutEffect)((()=>{const e={click:t,mouseDown:i,touchEnd:o,touchStart:a},n=c?c.current:d.current;return(0,s.addOutsideEventListener)(u.current,n,l,document,e)}),[t,i,o,a,l]),c||d}},9745:(e,t,i)=>{"use strict";i.d(t,{Icon:()=>r});var n=i(50959);const r=n.forwardRef(((e,t)=>{const{icon:i="",title:r,ariaLabel:s,ariaLabelledby:o,ariaHidden:a,...l}=e,c=!!(r||s||o);return n.createElement("span",{role:"img",...l,ref:t,"aria-label":s,"aria-labelledby":o,"aria-hidden":a||!c,title:r,dangerouslySetInnerHTML:{__html:i}})}))},19250:(e,t,i)=>{"use strict";i.d(t,{Portal:()=>c,PortalContext:()=>d});var n=i(50959),r=i(32227),s=i(25931),o=i(67961),a=i(34811),l=i(99663);class c extends n.PureComponent{constructor(){super(...arguments),this._uuid=(0,s.nanoid)()}componentWillUnmount(){this._manager().removeWindow(this._uuid)}render(){const e=this._manager().ensureWindow(this._uuid,this.props.layerOptions);e.style.top=this.props.top||"",e.style.bottom=this.props.bottom||"",e.style.left=this.props.left||"",e.style.right=this.props.right||"",e.style.pointerEvents=this.props.pointerEvents||"";const t=this.props.className;return t&&("string"==typeof t?e.classList.add(t):e.classList.add(...t)),this.props.shouldTrapFocus&&!e.hasAttribute(a.FOCUS_TRAP_DATA_ATTRIBUTE)&&e.setAttribute(a.FOCUS_TRAP_DATA_ATTRIBUTE,"true"),this.props["aria-hidden"]&&e.setAttribute("aria-hidden","true"),r.createPortal(n.createElement(d.Provider,{value:this
|
||||
},this.props.children),e)}moveToTop(){this._manager().moveToTop(this._uuid)}_manager(){return null===this.context?(0,o.getRootOverlapManager)():this.context}}c.contextType=l.SlotContext;const d=n.createContext(null)},99663:(e,t,i)=>{"use strict";i.d(t,{Slot:()=>r,SlotContext:()=>s});var n=i(50959);class r 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 s=n.createContext(null)},67961:(e,t,i)=>{"use strict";i.d(t,{OverlapManager:()=>o,getRootOverlapManager:()=>l});var n=i(50151),r=i(34811);class s{constructor(){this._storage=[]}add(e){this._storage.push(e)}remove(e){this._storage=this._storage.filter((t=>e!==t))}has(e){return this._storage.includes(e)}getItems(){return this._storage}}class o{constructor(e=document){this._storage=new s,this._windows=new Map,this._index=0,this._document=e,this._container=e.createDocumentFragment()}setContainer(e){const t=this._container,i=null===e?this._document.createDocumentFragment():e;!function(e,t){Array.from(e.childNodes).forEach((e=>{e.nodeType===Node.ELEMENT_NODE&&t.appendChild(e)}))}(t,i),this._container=i}registerWindow(e){this._storage.has(e)||this._storage.add(e)}ensureWindow(e,t={position:"fixed",direction:"normal"}){const i=this._windows.get(e);if(void 0!==i)return i;this.registerWindow(e);const n=this._document.createElement("div");if(n.style.position=t.position,n.style.zIndex=this._index.toString(),n.dataset.id=e,void 0!==t.index){const e=this._container.childNodes.length;if(t.index>=e)this._container.appendChild(n);else if(t.index<=0)this._container.insertBefore(n,this._container.firstChild);else{const e=this._container.childNodes[t.index];this._container.insertBefore(n,e)}}else"reverse"===t.direction?this._container.insertBefore(n,this._container.firstChild):this._container.appendChild(n);return this._windows.set(e,n),++this._index,n}unregisterWindow(e){this._storage.remove(e);const t=this._windows.get(e);void 0!==t&&(null!==t.parentElement&&t.parentElement.removeChild(t),this._windows.delete(e))}getZindex(e){const t=this.ensureWindow(e);return parseInt(t.style.zIndex||"0")}moveLastWindowToTop(){const e=this._storage.getItems(),t=e[e.length-1];t&&this.moveToTop(t)}moveToTop(e){if(this.getZindex(e)!==this._index){const t=this.ensureWindow(e);this._windows.forEach(((e,i)=>{e.hasAttribute(r.FOCUS_TRAP_DATA_ATTRIBUTE)&&e.setAttribute(r.FOCUS_TRAP_DATA_ATTRIBUTE,e===t?"true":"false")})),t.style.zIndex=(++this._index).toString()}}removeWindow(e){this.unregisterWindow(e)}}const a=new WeakMap;function l(e=document){const t=e.getElementById("overlap-manager-root");if(null!==t)return(0,n.ensureDefined)(a.get(t));{const t=new o(e),i=function(e){const t=e.createElement("div");return t.style.position="absolute",t.style.zIndex=150..toString(),t.style.top="0px",t.style.left="0px",t.id="overlap-manager-root",t.dataset.qaId="overlap-manager-root",t}(e);return a.set(i,t),t.setContainer(i),e.body.appendChild(i),t}}var c;!function(e){
|
||||
e[e.BaseZindex=150]="BaseZindex"}(c||(c={}))},29196:(e,t,i)=>{"use strict";i.d(t,{useHintShowAnimation:()=>o});var n=i(50959);const r=50,s=2500;function o(e){const[t,i]=(0,n.useState)(!1);return(0,n.useLayoutEffect)((()=>{const t=setTimeout((()=>i(!0)),r),n=setTimeout((()=>i(!1)),e??s);return()=>{clearTimeout(t),clearTimeout(n)}}),[]),t}},99054:(e,t,i)=>{"use strict";i.d(t,{setFixedBodyState:()=>c});const n=(()=>{let e;return()=>{if(void 0===e){const t=document.createElement("div"),i=t.style;i.visibility="hidden",i.width="100px",i.msOverflowStyle="scrollbar",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const s=r.offsetWidth;t.parentNode?.removeChild(t),e=n-s}return e}})();function r(e,t,i){null!==e&&e.style.setProperty(t,i)}function s(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function o(e,t){return parseInt(s(e,t))}let a=0,l=!1;function c(e){const{body:t}=document,i=t.querySelector(".widgetbar-wrap");if(e&&1==++a){const e=s(t,"overflow"),a=o(t,"padding-right");"hidden"!==e.toLowerCase()&&t.scrollHeight>t.offsetHeight&&(r(i,"right",`${n()}px`),t.style.paddingRight=`${a+n()}px`,l=!0),t.classList.add("i-no-scroll")}else if(!e&&a>0&&0==--a&&(t.classList.remove("i-no-scroll"),l)){r(i,"right","0px");let e=0;0,t.scrollHeight<=t.clientHeight&&(e-=n()),t.style.paddingRight=(e<0?0:e)+"px",l=!1}}},87896:(e,t,i)=>{"use strict";i.d(t,{createReactRoot:()=>u});var n=i(50959),r=i(32227),s=i(4237);const o=(0,n.createContext)({isOnMobileAppPage:()=>!1,isRtl:!1,locale:"en",renderMode:"legacy"});var a=i(84015),l=i(24640);const c={iOs:"old",android:"new",old:"old",new:"new",any:"any"};function d(e){const[t]=(0,n.useState)({isOnMobileAppPage:e=>(0,a.isOnMobileAppPage)(c[e]),isRtl:(0,l.isRtl)(),locale:window.locale,renderMode:e.renderMode??"legacy"});return n.createElement(o.Provider,{value:t},e.children)}function u(e,t,i="legacy"){const o=n.createElement(d,{renderMode:i},e);if("modern"===i){const e=(0,s.createRoot)(t);return e.render(o),{render(t){e.render(n.createElement(d,{renderMode:i},t))},unmount(){e.unmount()}}}return r.render(o,t),{render(e){r.render(n.createElement(d,{renderMode:i},e),t)},unmount(){r.unmountComponentAtNode(t)}}}},73986:(e,t,i)=>{"use strict";i.d(t,{DialogBreakpoints:()=>r});var n=i(51284);const r={SmallHeight:n["small-height-breakpoint"],TabletSmall:n["tablet-small-breakpoint"],TabletNormal:n["tablet-normal-breakpoint"]}},22265:(e,t,i)=>{"use strict";i.d(t,{DialogSidebarItem:()=>h,DialogSidebarWrapper:()=>u});var n,r=i(50959),s=i(97754),o=i.n(s),a=i(9745),l=i(65631),c=i(68648),d=i(69101);function u(e){return r.createElement("div",{className:d.wrapper,...e})}function h(e){const{mode:t,title:i,icon:n,isActive:s,onClick:u,tag:h="div",reference:p,className:m,mobileFontSize:v="medium",showLastDivider:f,useBoldIconsForMobile:g,hideArrow:_,...b}=e,{isMobile:y,isTablet:w}=(0,l.getSidebarMode)(t),E=function(){if(y&&g)return n?.bold;return s?n?.bold:n?.default}();return r.createElement(h,{...b,ref:p,
|
||||
title:w?i:"",className:o()(d.tab,w&&d.isTablet,y&&d.isMobile,s&&d.active,_&&d.withoutArrow,m,w&&"apply-common-tooltip"),onClick:u},n&&r.createElement(a.Icon,{className:d.icon,icon:E}),!w&&r.createElement("span",{className:o()(d.title,!n&&d.withoutIcon,"medium"===v?d.medium:d.large,f&&d.showLastDivider)},r.createElement("span",{className:o()(d.titleText,"apply-overflow-tooltip")},i),y&&!_&&r.createElement(a.Icon,{className:d.nested,icon:c})))}!function(e){e.Medium="medium",e.Large="large"}(n||(n={}))},65631:(e,t,i)=>{"use strict";var n,r;function s(e){return{isMobile:"mobile"===e,isTablet:"tablet"===e}}i.d(t,{getSidebarMode:()=>s}),function(e){e.Bold="bold",e.Default="default"}(n||(n={})),function(e){e.Tablet="tablet",e.Mobile="mobile"}(r||(r={}))},86682:(e,t,i)=>{"use strict";i.r(t),i.d(t,{IndicatorsLibraryContainer:()=>ge});var n=i(50959),r=i(11542),s=i(78861);const o=r.t(null,void 0,i(69644));var a,l,c,d,u,h,p;!function(e){e.Title="Title",e.Item="Item",e.Loader="Loader"}(a||(a={})),function(e){e.User="Script$USER",e.Public="Script$PUB",e.InviteOnly="Script$INVITE",e.Favorite="Script$FAVORITE",e.BuiltIn="tv-basicstudies",e.CandlestickPatterns="candlestick-patterns",e.Standard="Script$STD",e.VolumeProfile="tv-volumebyprice",e.Strategies="strategies",e.EditorsPicks="editorsPicks",e.Trending="trending",e.AutoJava="auto-java",e.AutoStandard="auto-standard",e.Auto="auto",e.OldChartPatterns="tv-chartpatterns",e.ChartPatterns="tv-chart_patterns"}(l||(l={})),function(e){e.Favorites="favorites",e.BuiltIns="built-ins",e.PublicLibrary="public-library",e.UserScripts="my-scripts",e.InviteOnlyScripts="invite-only-scripts",e.Addons="addons",e.Financials="financials"}(c||(c={})),function(e){e.Indicators="indicators",e.Strategies="strategies",e.Patterns="patterns",e.Profiles="profiles"}(d||(d={})),function(e){e.Top="top",e.EditorsPicks="editorsPicks",e.Trending="trending"}(u||(u={})),function(e){e.Top="top",e.Trending="trending"}(h||(h={})),function(e){e.Favorites="favorites",e.IncomeStatement="income statements",e.BalanceSheet="balance sheet",e.CashFlow="cash flow",e.Ratios="ratios",e.Statistics="statistics",e.Crypto="crypto"}(p||(p={}));var m=i(19844),v=i(37103),f=i(26610);function g(e,t){const i=e.title.toLowerCase(),n=t.title.toLowerCase();return i<n?-1:i>n?1:0}const _={earning:new RegExp("EPS"),earnings:new RegExp("EPS"),"trailing twelve months":new RegExp("TTM")};function b(e){const{id:t,description:n,shortDescription:s,description_localized:a,is_hidden_study:l,version:c,extra:d,tags:u}=e,h=v.enabled("graying_disabled_tools_enabled")&&window.ChartApiInstance?.studiesAccessController.isToolGrayed(n);return{id:t,title:a||r.t(n,{context:"study"},i(83477)),shortDescription:s,shortTitle:s,isStrategy:m.StudyMetaInfo.isScriptStrategy(e),isHidden:l,isNew:d?.isNew,isUpdated:d?.isUpdated,isBeta:d?.isBeta,isPro:d?.isPro,proBadgeTitle:o,isFundamental:!1,isOverlay:e.is_price_study,studyData:{id:t,version:c,descriptor:{type:"java",studyId:e.id},packageName:y(t,d)},isGrayed:h,tags:u}}function y(e,t){
|
||||
return t?.isChartPattern?"tv-chart_patterns":t?.isAuto?"auto-java":m.StudyMetaInfo.getPackageName(e)}var w=i(97754),E=i.n(w),S=i(63932),I=i(79418),x=i(49483),C=i(69654),T=i(22265),R=i(26943);function N(e){const{reference:t,className:i,...r}=e;return n.createElement("div",{ref:t,className:E()(R.container,i),...r,"data-role":"dialog-content"})}var P=i(58794);function k(e){const{children:t,className:i,disabled:r}=e;return n.createElement("span",{className:E()(P.title,r&&P.disabled,i)},t)}var L=i(91682);const F=n.createContext(null);var A=i(24637),D=i(36189),M=i(68335),W=i(15272);function B(e){const t=(0,n.useContext)(F),{id:s,role:o,style:a,isMobile:l,item:c,query:d,regExpRules:u,isBeta:h,isNew:p,isUpdated:m,isSelected:v,isHighlighted:f,reference:g,onClick:_,renderActions:b,isPro:y,proBadgeTitle:w,onItemActionsClick:S,favoriteClickHandler:I,hideEP:x}=e,{isFavorite:C,isLocked:T,public:R,editorsPick:N}=c,P=(0,L.decodeHTMLEntities)(c.title),M=void 0!==C,B=O(_,c),H=(0,n.useCallback)((e=>{e.stopPropagation(),S?.()}),[S]),U=(0,n.useCallback)((e=>{if(I)return S?.(),void I(e);const i=t?.toggleFavorite;if(i){O((e=>{S?.(),i(e)}),c)(e)}}),[I,S,t?.toggleFavorite]),j=E()(W.container,l&&W.mobile,c.isGrayed&&W.disabled,v&&W.selected,f&&W.highlighted);return n.createElement("div",{id:s,role:o,ref:g,className:j,onClick:B,style:a,"data-role":"list-item","data-disabled":c.isGrayed,"data-title":P,"data-id":c.id},n.createElement("div",{className:E()(W.main,!M&&W.paddingLeft)},M&&n.createElement(D.FavoriteButton,{className:E()(W.favorite,C&&W.isActive),isFilled:C,onClick:U}),n.createElement(k,{disabled:c.isGrayed,className:E()(l&&W.mobileText)},n.createElement(A.HighlightedText,{queryString:d,rules:u,text:P})),!1,h&&n.createElement(BadgeStatus,{type:"beta",className:W.badge}),p&&n.createElement(BadgeStatus,{type:"new",className:W.badge}),m&&n.createElement(BadgeStatus,{type:"updated",className:W.badge}),Boolean(N&&!x)&&n.createElement(BadgeStatus,{type:"ep",className:W.badge,tooltip:r.t(null,void 0,i(10640))}),!1),R&&n.createElement("a",{href:R.authorLink,className:W.author,target:"_blank",onClick:H},R.authorName),!l&&R&&n.createElement("span",{className:W.likes},compactNumberFormat(R.likesCount)),!1)}function O(e,t){return i=>{const n=0===(0,M.modifiersFromEvent)(i)&&0===i.button;!i.defaultPrevented&&e&&n&&(i.preventDefault(),e(t))}}var H,U=i(35266);function j(e){const{title:t,type:i,className:r}=e;return n.createElement("h3",{className:E()(U.title,"Small"===i&&U.small,"Normal"===i&&U.normal,"Large"===i&&U.large,r)},t)}!function(e){e.Small="Small",e.Normal="Normal",e.Large="Large"}(H||(H={}));var q=i(37963);function V(e){const{style:t,children:i,isMobile:r,withoutFavoriting:s}=e;return n.createElement("div",{style:t,className:E()(q.container,r&&q.mobile,s&&q.withoutFavoriting)},i)}var G=i(92164);function X(e){const[t,i]=(0,n.useState)(null);function r(e){return e.findIndex((e=>t?.id===e.id))}return[t,i,function(){i(function(){const i=r(e),n=i===e.length-1;return null===t||-1===i?e[0]??null:n?e[i]:e[i+1]}())},function(){i(function(){
|
||||
const i=r(e);return null===t||0===i||-1===i?e[0]??null:e[i-1]}())}]}var J=i(97006),Y=i(9698),z=i(53222);function Z(e){const{reference:t,data:s,isOpened:o,onClose:a,applyStudy:l,shouldReturnFocus:c}=e,[d,u]=(0,n.useState)(""),h=(0,n.useMemo)((()=>(0,J.createRegExpList)(d,_)),[d]),p=(0,n.useMemo)((()=>d?(0,J.rankedSearch)({data:s,rules:h,queryString:d,primaryKey:"shortDescription",secondaryKey:"title",optionalPrimaryKey:"shortTitle",tertiaryKey:"tags"}):s),[d,h,s]),m=(0,n.useMemo)((()=>p.slice().sort($)),[p]),{highlightedItem:v,selectedItem:f,selectedNodeReference:g,scrollContainerRef:b,searchInputRef:y,onClickStudy:w,handleKeyDown:R}=function(e,t,i,r){let s=0;const[o,a]=(0,n.useState)(null),l=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,u,h,p]=X(t),m=(0,n.useRef)(null);return(0,n.useEffect)((()=>{e?v(0):u(null)}),[e]),(0,n.useEffect)((()=>{void 0!==r&&(v(0),u(null))}),[r]),(0,n.useEffect)((()=>(o&&(s=setTimeout((()=>{a(null)}),1500)),()=>{clearInterval(s)})),[o]),{highlightedItem:o,scrollContainerRef:l,selectedNodeReference:c,selectedItem:d,searchInputRef:m,onClickStudy:function(e){i&&(i(e),u(e),a(e))},handleKeyDown:function(e){const[t,n]=function(e,t){if(null===e.current||null===t.current)return[0,0];const i=e.current.getBoundingClientRect(),n=t.current.getBoundingClientRect(),{height:r}=i,s=i.top-n.top,o=i.bottom-n.bottom+r<0?0:r,a=s-r>0?0:r,{scrollTop:l}=t.current;return[l-a,l+o]}(c,l);if(40===(0,M.hashFromEvent)(e)&&(e.preventDefault(),h(),v(n)),38===(0,M.hashFromEvent)(e)&&(e.preventDefault(),p(),v(t)),13===(0,M.hashFromEvent)(e)&&d){if(!i)return;i(d),a(d)}}};function v(e){null!==l.current&&l.current.scrollTo&&l.current.scrollTo(0,e)}}(o,m,l),P=""===d&&!m.length;(0,n.useEffect)((()=>{o||u(""),x.CheckMobile.any()||y.current?.focus()}),[o]);const k=(0,n.useId)();return n.createElement(I.AdaptivePopupDialog,{className:E()(z.dialogLibrary),isOpened:o,onClose:a,onClickOutside:a,title:r.t(null,void 0,i(84549)),dataName:"indicators-dialog",onKeyDown:R,shouldReturnFocus:c,ref:t,render:()=>n.createElement(n.Fragment,null,n.createElement(C.DialogSearch,{reference:y,placeholder:r.t(null,void 0,i(8573)),onChange:L,onFocus:F,"aria-controls":k,"aria-owns":k,"aria-haspopup":"listbox",activeDescendant:Q(f?.id)}),n.createElement(T.DialogSidebarWrapper,null,n.createElement(N,{id:k,reference:b,role:"listbox",className:z.scroll},P?n.createElement(S.Spinner,null):m.length?n.createElement(n.Fragment,null,n.createElement(V,null,n.createElement(j,{title:r.t(null,void 0,i(7378))})),m.map((e=>n.createElement(B,{key:e.id,id:Q(e.id),role:"option",item:e,onClick:()=>w(e),query:d,regExpRules:h,reference:f?.id===e.id?g:void 0,isSelected:f?.id===e.id,isHighlighted:v?.id===e.id,favoriteClickHandler:t=>{t.stopPropagation(),(0,Y.toggleFavorite)(e.title)}})))):n.createElement(G.ContentIsNotFound,{className:z.noContentBlock,description:r.t(null,void 0,i(70269))}))))});function L(e){u(e.target.value)}function F(){d.length>0&&y.current?.select()}}function $(e,t){return e.isFavorite===t.isFavorite?0:e.isFavorite?-1:1}const K="indicators_dialog_item"
|
||||
;function Q(e){if(void 0!==e)return`${K}_${e}`}var ee=i(89880),te=i(76422),ie=i(72972),ne=i(22613),re=i(73986),se=i(32227),oe=i(90484),ae=i(9745),le=i(29196),ce=i(98301),de=i(99084);function ue(e){const{text:t,withTransition:i=!0}=e,r=(0,le.useHintShowAnimation)(2500);return n.createElement("div",{className:ce.container},n.createElement("div",{className:ce.centerElement},n.createElement("div",{className:w(ce.contentWrap,r&&ce.noticeShowed,i&&ce.withTransition)},n.createElement(ae.Icon,{icon:de,className:ce.icon}),n.createElement("div",{className:ce.textWrap},t))))}class he{constructor(e,t){this._showed=!1,this._wrap=document.createElement("div"),t&&this._wrap.classList.add(t),this._container=e,this._debouncedHide=(0,oe.default)((()=>this.hide()),3e3)}show(e,t){this._wrap&&!this._showed&&(this._showed=!0,this._container.appendChild(this._wrap),se.render(n.createElement(ue,{text:e,withTransition:t}),this._wrap),this._debouncedHide())}hide(){this._wrap&&(this._showed=!1,se.unmountComponentAtNode(this._wrap),this._wrap.remove())}destroy(){this.hide(),delete this._wrap}}var pe=i(2088);class me{constructor(e=!1){this._searchInputRef=n.createRef(),this._dialog=n.createRef(),this._rootInstance=null,this._parentSources=[],this._ignoreChecksWhenAddingStudy=!1,this._visibility=new ne.WatchedValue(!1),this._container=document.createElement("div"),this._isForceRender=!1,this._isDestroyed=!1,this._deepFundamentalsHistoryNotificationHasBeenShown=!1,this._hintRenderer=null,this._showDeepFundamentalsHistoryNotification=()=>{},this._ignoreChecksWhenAddingStudy=e}isDestroyed(){return this._isDestroyed}visible(){return this._visibility.readonly()}resetAllStudies(){}open(e,t,i,n,r){this._parentSources=e,this._updateSymbol(),this._setProps({isOpened:!0,shouldReturnFocus:r?.shouldReturnFocus}),this._visibility.setValue(!0),te.emit("indicators_dialog")}show(e){this.open([],void 0,void 0,void 0,e)}hide(){this._parentSources=[],this._setProps({isOpened:!1}),this._visibility.setValue(!1),this._hintRenderer?.destroy(),this._hintRenderer=null}destroy(){this._isDestroyed=!0,this._hintRenderer?.destroy(),this._rootInstance?.unmount(),this._rootInstance=null}_shouldPreventRender(){return this._isDestroyed||!this._isForceRender&&!this._getProps().value().isOpened}_getRenderData(){return{props:this._getProps().value(),container:this._getContainer()}}_applyStudy(e,t){e.isGrayed?te.emit("onGrayedObjectClicked",{type:"study",name:e.shortDescription}):(x.CheckMobile.any()||this._searchInputRef.current?.select(),this._insertStudyImpl(e,t).then((t=>{null===t&&this._hintRenderer?.hide(),null!==t&&((0,pe.hasConfirmInputs)(t.inputs)||(0,pe.isSymbolicStudy)(t))&&this._hintRenderer?.show(this._getHintText(e.title));window.is_authenticated;x.CheckMobile.any()||(null===document.activeElement||document.activeElement===document.body||null!==this._dialog.current&&this._dialog.current.contains(document.activeElement))&&this._searchInputRef.current?.focus()})))}_setProps(e){const t=this._getProps().value(),{isOpened:i}=t
|
||||
;this._isForceRender=i&&"isOpened"in e&&!e.isOpened;const n={...t,...e};this._getProps().setValue(n)}_requestBuiltInJavaStudies(){return(0,ie.studyMetaInfoRepository)().findAllJavaStudies()}_focus(){this._getProps().value().isOpened&&this._dialog.current?.focus()}_getContainer(){return this._container}_getDialog(){return this._dialog}_getSymbol(){return this._symbol}_showHint(e){if(window.matchMedia(re.DialogBreakpoints.TabletSmall).matches){if(this._hintRenderer?.hide(),!this._hintRenderer){const e=this._dialog.current?.getElement();e&&(this._hintRenderer=new he(e))}this._hintRenderer?.show(this._getHintText(e))}}_getHintText(e){return ee.t(null,{replace:{studyTitle:e}},i(33673))}}function ve(e,t){return e[t]||[]}var fe=i(87896);class ge extends me{constructor(e,t){super(),this._options={onWidget:!1},this._indicatorData=[],this._chartWidgetCollection=e,t&&(this._options=t),this._props=new ne.WatchedValue({data:[],applyStudy:this._applyStudy.bind(this),isOpened:!1,reference:this._getDialog(),onClose:this.hide.bind(this)}),this._getProps().subscribe(this._render.bind(this)),this._init()}async _insertStudyImpl(e,t){const i=await async function(e,t,i,n,r,o){const a=e.activeChartWidget.value();if(!a)return null;const{studyData:l}=t;if(!l)return Promise.resolve(null);const c=l.descriptor;if("java"===c.type){const e=(0,f.tryFindStudyLineToolNameByStudyId)(c.studyId);if(null!==e)return await(0,f.initLineTool)(e),s.tool.setValue(e),null}return a.insertStudy(l.descriptor,i,{stubTitle:t.shortDescription,isFundamental:t.isFundamental,isOverlay:t.isOverlay},void 0,o)}(this._chartWidgetCollection,e,this._parentSources,0,this._symbol,(()=>this._showHint(e.title)));return i?.metaInfo()??null}_updateSymbol(){}_getProps(){return this._props}async _init(){const e=function(e){const t={};return e.forEach((e=>{const{studyData:i}=e;if(!i)return;const{packageName:n}=i;n in t?t[n].push(e):t[n]=[e]})),t}(function(e,t=!0){return e.filter((e=>{const i=!!t||!function(e){return e.isStrategy}(e);return!e.isHidden&&i}))}((await this._requestBuiltInJavaStudies()).map(b)));this._indicatorData=await async function(e,t){let i={...t};return[...ve(i,"tv-basicstudies"),...ve(i,"Script$STD"),...ve(i,"tv-volumebyprice")].filter((e=>!e.isStrategy)).sort(g)}(this._options.onWidget,e),this._setFavorites(),this._setProps({data:this._indicatorData}),Y.favoriteAdded.subscribe(null,(()=>this._refreshFavorites())),Y.favoriteRemoved.subscribe(null,(()=>this._refreshFavorites()))}_setFavorites(){v.enabled("items_favoriting")&&this._indicatorData.forEach((e=>{e.isFavorite=(0,Y.isFavorite)(e.title)}))}_refreshFavorites(){this._setFavorites(),this._setProps({data:this._indicatorData})}_render(){if(this._shouldPreventRender())return;const{props:e,container:t}=this._getRenderData(),i=n.createElement(Z,{...e});this._rootInstance?this._rootInstance.render(i):this._rootInstance=(0,fe.createReactRoot)(i,t)}}},74670:(e,t,i)=>{"use strict";i.d(t,{useActiveDescendant:()=>s});var n=i(50959),r=i(39416);function s(e,t=[]){const[i,s]=(0,n.useState)(!1),o=(0,
|
||||
r.useFunctionalRefObject)(e);return(0,n.useLayoutEffect)((()=>{const e=o.current;if(null===e)return;const t=e=>{switch(e.type){case"active-descendant-focus":s(!0);break;case"active-descendant-blur":s(!1)}};return e.addEventListener("active-descendant-focus",t),e.addEventListener("active-descendant-blur",t),()=>{e.removeEventListener("active-descendant-focus",t),e.removeEventListener("active-descendant-blur",t)}}),t),[o,i]}},71402:(e,t,i)=>{"use strict";i.d(t,{RemoveTitleType:()=>n,removeTitlesMap:()=>s});var n,r=i(11542);!function(e){e.Add="add",e.Remove="remove"}(n||(n={}));const s={[n.Add]:r.t(null,void 0,i(69207)),[n.Remove]:r.t(null,void 0,i(85106))}},36189:(e,t,i)=>{"use strict";i.d(t,{FavoriteButton:()=>h});var n=i(50959),r=i(97754),s=i.n(r),o=i(9745),a=i(71402),l=i(74670),c=i(39146),d=i(48010),u=i(16499);function h(e){const{className:t,isFilled:i,isActive:r,onClick:h,title:p,...m}=e,[v,f]=(0,l.useActiveDescendant)(null),g=p??(i?a.removeTitlesMap[a.RemoveTitleType.Remove]:a.removeTitlesMap[a.RemoveTitleType.Add]);return(0,n.useLayoutEffect)((()=>{const e=v.current;e instanceof HTMLElement&&g&&e.dispatchEvent(new CustomEvent("common-tooltip-update"))}),[g,v]),n.createElement(o.Icon,{...m,className:s()(u.favorite,"apply-common-tooltip",i&&u.checked,r&&u.active,f&&u.focused,t),onClick:h,icon:i?c:d,title:g,ariaLabel:g,ref:v})}},90692:(e,t,i)=>{"use strict";i.d(t,{MatchMedia:()=>r});var n=i(50959);class r extends n.PureComponent{constructor(e){super(e),this._handleChange=()=>{this.forceUpdate()},this.state={query:window.matchMedia(this.props.rule)}}componentDidMount(){this._subscribe(this.state.query)}componentDidUpdate(e,t){this.state.query!==t.query&&(this._unsubscribe(t.query),this._subscribe(this.state.query))}componentWillUnmount(){this._unsubscribe(this.state.query)}render(){return this.props.children(this.state.query.matches)}static getDerivedStateFromProps(e,t){return e.rule!==t.query.media?{query:window.matchMedia(e.rule)}:null}_subscribe(e){e.addEventListener("change",this._handleChange)}_unsubscribe(e){e.removeEventListener("change",this._handleChange)}}},65718:(e,t,i)=>{"use strict";i.d(t,{Portal:()=>n.Portal,PortalContext:()=>n.PortalContext});var n=i(19250)},63932:(e,t,i)=>{"use strict";i.d(t,{Spinner:()=>c});var n=i(50959),r=i(97754),s=i.n(r),o=i(58096),a=(i(40987),i(53895)),l=i.n(a);function c(e){const{ariaLabel:t,ariaLabelledby:i,className:r,style:a,size:c,id:d,disableSelfPositioning:u}=e;return n.createElement("div",{className:s()(r,"tv-spinner","tv-spinner--shown",`tv-spinner--size_${o.spinnerSizeMap[c||o.DEFAULT_SIZE]}`,u&&l().disableSelfPositioning),style:a,role:"progressbar",id:d,"aria-label":t,"aria-labelledby":i})}},9698:(e,t,i)=>{"use strict";i.r(t),i.d(t,{favoriteAdded:()=>s,favoriteRemoved:()=>o,favoritesSynced:()=>a,isFavorite:()=>d,saveFavorites:()=>p,toggleFavorite:()=>c});var n=i(48096),r=i(1765);const s=new n.Delegate,o=new n.Delegate,a=new n.Delegate;let l=[];function c(e){return-1===u(e)?(function(e){!d(e)&&(l.push(e),p(),s.fire(e))}(e),!0):(function(e){const t=u(e)
|
||||
;-1!==t&&(l.splice(t,1),p(),o.fire(e))}(e),!1)}function d(e){return-1!==u(e)}function u(e){return l.indexOf(e)}function h(){l=[];const e=Boolean(void 0===(0,r.getValue)("chart.favoriteLibraryIndicators")),t=(0,r.getJSON)("chart.favoriteLibraryIndicators",[]);if(l.push(...t),0===l.length&&e&&"undefined"!=typeof window){const e=JSON.parse(window.urlParams?.favorites??"{}").indicators;e&&Array.isArray(e)&&l.push(...e)}a.fire()}function p(){const e=l.slice();(0,r.setJSON)("chart.favoriteLibraryIndicators",e)}h(),r.onSync.subscribe(null,h)},99084:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" fill-rule="evenodd" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Zm4-9.97L11.9 6 8.3 9.82 6.1 7.46 4.99 8.5 8.32 12 13 7.03Z"/></svg>'},68648:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentcolor" stroke-width="1.3" d="M12 9l5 5-5 5"/></svg>'},39146:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" d="M9 1l2.35 4.76 5.26.77-3.8 3.7.9 5.24L9 13l-4.7 2.47.9-5.23-3.8-3.71 5.25-.77L9 1z"/></svg>'},48010:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M9 2.13l1.903 3.855.116.236.26.038 4.255.618-3.079 3.001-.188.184.044.259.727 4.237-3.805-2L9 12.434l-.233.122-3.805 2.001.727-4.237.044-.26-.188-.183-3.079-3.001 4.255-.618.26-.038.116-.236L9 2.13z"/></svg>'},25931:(e,t,i)=>{"use strict";i.d(t,{nanoid:()=>n});let n=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")}}]);
|
||||
Reference in New Issue
Block a user