Release v27.005 (from d937bee0)
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[750],{66783:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,n){if(r(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var o=Object.keys(e),a=Object.keys(n);if(o.length!==a.length)return!1;for(var l=0;l<o.length;l++)if(!t.call(n,o[l])||!r(e[o[l]],n[o[l]]))return!1;return!0}},58222:e=>{e.exports={"light-button":"light-button-bYDQcOkp",link:"link-bYDQcOkp",content:"content-bYDQcOkp","visually-hidden":"visually-hidden-bYDQcOkp",nowrap:"nowrap-bYDQcOkp","ellipsis-container":"ellipsis-container-bYDQcOkp","text-wrap-container":"text-wrap-container-bYDQcOkp","text-wrap-with-ellipsis":"text-wrap-with-ellipsis-bYDQcOkp",icon:"icon-bYDQcOkp","force-direction-ltr":"force-direction-ltr-bYDQcOkp","force-direction-rtl":"force-direction-rtl-bYDQcOkp","with-grouped":"with-grouped-bYDQcOkp","variant-quiet-primary":"variant-quiet-primary-bYDQcOkp",selected:"selected-bYDQcOkp","typography-regular16px":"typography-regular16px-bYDQcOkp","typography-medium16px":"typography-medium16px-bYDQcOkp","typography-regular14px":"typography-regular14px-bYDQcOkp","typography-semibold14px":"typography-semibold14px-bYDQcOkp","typography-semibold16px":"typography-semibold16px-bYDQcOkp","size-xsmall":"size-xsmall-bYDQcOkp","with-start-icon":"with-start-icon-bYDQcOkp","with-end-icon":"with-end-icon-bYDQcOkp","no-content":"no-content-bYDQcOkp",wrap:"wrap-bYDQcOkp","size-small":"size-small-bYDQcOkp","size-medium":"size-medium-bYDQcOkp","variant-primary":"variant-primary-bYDQcOkp","color-gray":"color-gray-bYDQcOkp",caret:"caret-bYDQcOkp",grouped:"grouped-bYDQcOkp",pills:"pills-bYDQcOkp",active:"active-bYDQcOkp","disable-active-on-touch":"disable-active-on-touch-bYDQcOkp","disable-active-state-styles":"disable-active-state-styles-bYDQcOkp","color-green":"color-green-bYDQcOkp","color-red":"color-red-bYDQcOkp","variant-secondary":"variant-secondary-bYDQcOkp","variant-ghost":"variant-ghost-bYDQcOkp"}},88803:e=>{e.exports={"tablet-normal-breakpoint":"screen and (max-width: 768px)","small-height-breakpoint":"screen and (max-height: 360px)","tablet-small-breakpoint":"screen and (max-width: 430px)"}},57240:e=>{e.exports={container:"container-M1mz4quA",pairContainer:"pairContainer-M1mz4quA",logo:"logo-M1mz4quA",hidden:"hidden-M1mz4quA"}},40281:e=>{e.exports={container:"container-qm7Rg5MB",inputContainer:"inputContainer-qm7Rg5MB",withCancel:"withCancel-qm7Rg5MB",input:"input-qm7Rg5MB",icon:"icon-qm7Rg5MB",cancel:"cancel-qm7Rg5MB"}},52597:e=>{e.exports={actions:"actions-rarsm4ka",actionButton:"actionButton-rarsm4ka"}},54257:e=>{e.exports={logo:"logo-d0vVmGvT"}},39339:e=>{e.exports={"tablet-small-breakpoint":"screen and (max-width: 430px)",itemRow:"itemRow-oRSs8UQo",multiLine:"multiLine-oRSs8UQo",cell:"cell-oRSs8UQo",itemInfoCell:"itemInfoCell-oRSs8UQo",description:"description-oRSs8UQo",symbolDescription:"symbolDescription-oRSs8UQo",flag:"flag-oRSs8UQo",
|
||||
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[750],{66783:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,n){if(r(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(var a=0;a<o.length;a++)if(!t.call(n,o[a])||!r(e[o[a]],n[o[a]]))return!1;return!0}},58222:e=>{e.exports={"light-button":"light-button-bYDQcOkp",link:"link-bYDQcOkp",content:"content-bYDQcOkp","visually-hidden":"visually-hidden-bYDQcOkp",nowrap:"nowrap-bYDQcOkp","ellipsis-container":"ellipsis-container-bYDQcOkp","text-wrap-container":"text-wrap-container-bYDQcOkp","text-wrap-with-ellipsis":"text-wrap-with-ellipsis-bYDQcOkp",icon:"icon-bYDQcOkp","force-direction-ltr":"force-direction-ltr-bYDQcOkp","force-direction-rtl":"force-direction-rtl-bYDQcOkp","with-grouped":"with-grouped-bYDQcOkp","variant-quiet-primary":"variant-quiet-primary-bYDQcOkp",selected:"selected-bYDQcOkp","typography-regular16px":"typography-regular16px-bYDQcOkp","typography-medium16px":"typography-medium16px-bYDQcOkp","typography-regular14px":"typography-regular14px-bYDQcOkp","typography-semibold14px":"typography-semibold14px-bYDQcOkp","typography-semibold16px":"typography-semibold16px-bYDQcOkp","size-xsmall":"size-xsmall-bYDQcOkp","with-start-icon":"with-start-icon-bYDQcOkp","with-end-icon":"with-end-icon-bYDQcOkp","no-content":"no-content-bYDQcOkp",wrap:"wrap-bYDQcOkp","size-small":"size-small-bYDQcOkp","size-medium":"size-medium-bYDQcOkp","variant-primary":"variant-primary-bYDQcOkp","color-gray":"color-gray-bYDQcOkp",caret:"caret-bYDQcOkp",grouped:"grouped-bYDQcOkp",pills:"pills-bYDQcOkp",active:"active-bYDQcOkp","disable-active-on-touch":"disable-active-on-touch-bYDQcOkp","disable-active-state-styles":"disable-active-state-styles-bYDQcOkp","color-green":"color-green-bYDQcOkp","color-red":"color-red-bYDQcOkp","variant-secondary":"variant-secondary-bYDQcOkp","variant-ghost":"variant-ghost-bYDQcOkp"}},88803:e=>{e.exports={"tablet-normal-breakpoint":"screen and (max-width: 768px)","small-height-breakpoint":"screen and (max-height: 360px)","tablet-small-breakpoint":"screen and (max-width: 430px)"}},57240:e=>{e.exports={container:"container-M1mz4quA",pairContainer:"pairContainer-M1mz4quA",logo:"logo-M1mz4quA",hidden:"hidden-M1mz4quA"}},40281:e=>{e.exports={container:"container-qm7Rg5MB",inputContainer:"inputContainer-qm7Rg5MB",withCancel:"withCancel-qm7Rg5MB",input:"input-qm7Rg5MB",icon:"icon-qm7Rg5MB",cancel:"cancel-qm7Rg5MB"}},52597:e=>{e.exports={actions:"actions-rarsm4ka",actionButton:"actionButton-rarsm4ka"}},54257:e=>{e.exports={logo:"logo-d0vVmGvT"}},39339:e=>{e.exports={"tablet-small-breakpoint":"screen and (max-width: 430px)",itemRow:"itemRow-oRSs8UQo",multiLine:"multiLine-oRSs8UQo",cell:"cell-oRSs8UQo",itemInfoCell:"itemInfoCell-oRSs8UQo",description:"description-oRSs8UQo",symbolDescription:"symbolDescription-oRSs8UQo",flag:"flag-oRSs8UQo",
|
||||
exchangeDescription:"exchangeDescription-oRSs8UQo",marketType:"marketType-oRSs8UQo",exchangeName:"exchangeName-oRSs8UQo",actionHandleWrap:"actionHandleWrap-oRSs8UQo",source:"source-oRSs8UQo",hover:"hover-oRSs8UQo",selected:"selected-oRSs8UQo",active:"active-oRSs8UQo",highlighted:"highlighted-oRSs8UQo",light:"light-oRSs8UQo","highlight-animation-theme-light":"highlight-animation-theme-light-oRSs8UQo",dark:"dark-oRSs8UQo","highlight-animation-theme-dark":"highlight-animation-theme-dark-oRSs8UQo",markedFlag:"markedFlag-oRSs8UQo",offset:"offset-oRSs8UQo",descriptionCell:"descriptionCell-oRSs8UQo",addition:"addition-oRSs8UQo",exchangeCell:"exchangeCell-oRSs8UQo",fixedWidth:"fixedWidth-oRSs8UQo",expandHandle:"expandHandle-oRSs8UQo",expanded:"expanded-oRSs8UQo",symbolTitle:"symbolTitle-oRSs8UQo",invalid:"invalid-oRSs8UQo",noDescription:"noDescription-oRSs8UQo",highlightedText:"highlightedText-oRSs8UQo",icon:"icon-oRSs8UQo",narrow:"narrow-oRSs8UQo",wide:"wide-oRSs8UQo",dataMode:"dataMode-oRSs8UQo",actionsCell:"actionsCell-oRSs8UQo",action:"action-oRSs8UQo",targetAction:"targetAction-oRSs8UQo",removeAction:"removeAction-oRSs8UQo",addAction:"addAction-oRSs8UQo",markedFlagWrap:"markedFlagWrap-oRSs8UQo",markedFlagMobile:"markedFlagMobile-oRSs8UQo",logo:"logo-oRSs8UQo",isExpandable:"isExpandable-oRSs8UQo",primaryIcon:"primaryIcon-oRSs8UQo"}},33172:e=>{e.exports={icon:"icon-OJpk_CAQ"}},50674:e=>{e.exports={wrap:"wrap-IxKZEhmO",libAllSelected:"libAllSelected-IxKZEhmO",container:"container-IxKZEhmO",iconWrap:"iconWrap-IxKZEhmO",icon:"icon-IxKZEhmO",title:"title-IxKZEhmO",highlighted:"highlighted-IxKZEhmO",description:"description-IxKZEhmO",mobile:"mobile-IxKZEhmO",allSelected:"allSelected-IxKZEhmO",desktop:"desktop-IxKZEhmO",allSelectedIcon:"allSelectedIcon-IxKZEhmO",selected:"selected-IxKZEhmO",focused:"focused-IxKZEhmO",titleWithoutDesc:"titleWithoutDesc-IxKZEhmO",textBlock:"textBlock-IxKZEhmO",bordered:"bordered-IxKZEhmO"}},70699:e=>{e.exports={container:"container-dfKL9A7t",contentList:"contentList-dfKL9A7t",contentListDesktop:"contentListDesktop-dfKL9A7t",searchSourceItemsContainer:"searchSourceItemsContainer-dfKL9A7t",oneColumn:"oneColumn-dfKL9A7t",searchSourceItemsContainerDesktop:"searchSourceItemsContainerDesktop-dfKL9A7t",groupTitleDesktop:"groupTitleDesktop-dfKL9A7t",column:"column-dfKL9A7t",emptyText:"emptyText-dfKL9A7t",emptyIcon:"emptyIcon-dfKL9A7t",noResultsDesktop:"noResultsDesktop-dfKL9A7t"}},37796:e=>{e.exports={wrap:"wrap-gjrLBBL3",item:"item-gjrLBBL3",small:"small-gjrLBBL3",newStyles:"newStyles-gjrLBBL3",mobile:"mobile-gjrLBBL3",text:"text-gjrLBBL3",exchange:"exchange-gjrLBBL3",filterItem:"filterItem-gjrLBBL3",brokerWrap:"brokerWrap-gjrLBBL3"}},52662:e=>{e.exports={wrap:"wrap-dlewR1s1",watchlist:"watchlist-dlewR1s1",noFeed:"noFeed-dlewR1s1",newStyles:"newStyles-dlewR1s1",scrollContainer:"scrollContainer-dlewR1s1",listContainer:"listContainer-dlewR1s1",multiLineItemsContainer:"multiLineItemsContainer-dlewR1s1",withSpinner:"withSpinner-dlewR1s1",spinnerContainer:"spinnerContainer-dlewR1s1",
|
||||
largeSpinner:"largeSpinner-dlewR1s1"}},85544:e=>{e.exports={search:"search-ZXzPWcCf",upperCase:"upperCase-ZXzPWcCf",withFilters:"withFilters-ZXzPWcCf",withButton:"withButton-ZXzPWcCf",symbolType:"symbolType-ZXzPWcCf",spinnerWrap:"spinnerWrap-ZXzPWcCf",emptyText:"emptyText-ZXzPWcCf",emptyIcon:"emptyIcon-ZXzPWcCf",noResultsDesktop:"noResultsDesktop-ZXzPWcCf",brokerButtonWrap:"brokerButtonWrap-ZXzPWcCf",brokerButton:"brokerButton-ZXzPWcCf"}},14444:e=>{e.exports={flagWrap:"flagWrap-QKnxaZOG",icon:"icon-QKnxaZOG",caret:"caret-QKnxaZOG",title:"title-QKnxaZOG",button:"button-QKnxaZOG",withFlag:"withFlag-QKnxaZOG",buttonContent:"buttonContent-QKnxaZOG"}},62393:e=>{e.exports={dialog:"dialog-u2dP3kv1",tabletDialog:"tabletDialog-u2dP3kv1",desktopDialog:"desktopDialog-u2dP3kv1",backButton:"backButton-u2dP3kv1"}},54638:e=>{e.exports={childrenWrapper:"childrenWrapper-_RhDhmVQ",container:"container-_RhDhmVQ"}},88389:e=>{e.exports={bubbles:"bubbles-Ie7o2cas",multiLine:"multiLine-Ie7o2cas",bubble:"bubble-Ie7o2cas"}},61371:e=>{e.exports={bubble:"bubble-zcjhaZ_y",animated:"animated-zcjhaZ_y",content:"content-zcjhaZ_y","appearance-default":"appearance-default-zcjhaZ_y",active:"active-zcjhaZ_y",gray:"gray-zcjhaZ_y",red:"red-zcjhaZ_y",blue:"blue-zcjhaZ_y",green:"green-zcjhaZ_y",orange:"orange-zcjhaZ_y",purple:"purple-zcjhaZ_y",cyan:"cyan-zcjhaZ_y",pink:"pink-zcjhaZ_y","appearance-text":"appearance-text-zcjhaZ_y","fontSize-s":"fontSize-s-zcjhaZ_y","fontSize-m":"fontSize-m-zcjhaZ_y","size-m":"size-m-zcjhaZ_y","size-l":"size-l-zcjhaZ_y"}},82112:e=>{e.exports={}},45300:e=>{e.exports={}},75623:e=>{e.exports={highlighted:"highlighted-cwp8YRo6"}},34587:e=>{e.exports={icon:"icon-WB2y0EnP",dropped:"dropped-WB2y0EnP"}},18429:(e,t,r)=>{"use strict";r.d(t,{SEPARATOR_PREFIX:()=>n,isSeparatorItem:()=>o});const n="###";function o(e){return e.startsWith(n)}},48199:(e,t,r)=>{"use strict";r.d(t,{BackButton:()=>v});var n=r(50959),o=r(64388),a=r(95694),l=r(49498),s=r(60176),i=r(35369),c=r(58478),u=r(73063),d=r(14127),m=r(18073),p=r(99243),h=r(42576);function g(e="large",t="1.2"){switch(e){case"large":return"1.2"===t?a:u;case"medium":return"1.2"===t?l:d;case"small":return"1.2"===t?s:m;case"xsmall":return"1.2"===t?i:p;case"xxsmall":return"1.2"===t?c:h;default:return l}}const v=n.forwardRef(((e,t)=>{const{"aria-label":r,flipIconOnRtl:a,...l}=e;return n.createElement(o.NavButton,{...l,"aria-label":r,ref:t,icon:g(e.size,e.iconStrokeWidth),flipIconOnRtl:a})}))},27011:(e,t,r)=>{"use strict";function n(e,t){return t||null==e||("string"==typeof e||Array.isArray(e))&&0===e.length}r.d(t,{isIconOnly:()=>n})},14543:(e,t,r)=>{"use strict";r.d(t,{LightButton:()=>n.LightButton});r(8025);var n=r(15893);r(50959),r(21593)},8025:(e,t,r)=>{"use strict";r.d(t,{LightButtonContent:()=>g,useLightButtonClasses:()=>h});var n=r(50959),o=r(97754),a=r(34094),l=r(9745),s=r(17946),i=r(27011),c=r(86332);const u=n.createContext({isInButtonGroup:!1,isGroupPrimary:!1});var d=r(2948),m=r(58222),p=r.n(m);const h=(e,t)=>{const r=(0,n.useContext)(s.CustomBehaviourContext),a=(0,
|
||||
n.useContext)(c.ControlGroupContext),{isInButtonGroup:l,isGroupPrimary:d}=(0,n.useContext)(u),{className:m,isSelected:h,children:g,startIcon:v,showCaret:f,endIcon:y,forceDirection:b,iconOnly:S,color:x="gray",variant:w="primary",size:k="medium",enableActiveStateStyles:C=r.enableActiveStateStyles,typography:E,isLink:I=!1,textWrap:L,isPills:T,isActive:R}=e,N=p()[`typography-${((e,t,r)=>{if(r){const e=r.replace(/^\D+/g,"");return t?`semibold${e}`:r}return"xsmall"===e?t?"semibold14px":"regular14px":"small"===e||"medium"===e?t?"semibold16px":"regular16px":""})(k,h||T,E||void 0)}`];return o(m,p()["light-button"],I&&p().link,R&&p().active,h&&p().selected,(0,i.isIconOnly)(g,S)&&p()["no-content"],v&&p()["with-start-icon"],(f||y)&&p()["with-end-icon"],t&&p()["with-grouped"],b&&p()[`force-direction-${b}`],p()[`variant-${d?"primary":w}`],p()[`color-${d?"gray":x}`],p()[`size-${k}`],N,!C&&p()["disable-active-state-styles"],a.isGrouped&&p().grouped,L&&p().wrap,l&&p()["disable-active-on-touch"],T&&p().pills)};function g(e){const{startIcon:t,endIcon:r,showCaret:s,iconOnly:c,ellipsis:u=!0,textWrap:m,tooltipText:h,children:g}=e;return n.createElement(n.Fragment,null,t&&n.createElement(l.Icon,{className:p().icon,icon:t}),!(0,i.isIconOnly)(g,c)&&n.createElement("span",{className:o(p().content,!m&&p().nowrap,"apply-overflow-tooltip","apply-overflow-tooltip--check-children-recursively","apply-overflow-tooltip--allow-text"),"data-overflow-tooltip-text":null!=h?h:(0,a.getTextForTooltip)(g)},m||u?n.createElement(n.Fragment,null,n.createElement("span",{className:o(!m&&u&&p()["ellipsis-container"],m&&p()["text-wrap-container"],m&&u&&p()["text-wrap-with-ellipsis"])},g),n.createElement("span",{className:p()["visually-hidden"],"aria-hidden":!0},g)):n.createElement(n.Fragment,null,g,n.createElement("span",{className:p()["visually-hidden"],"aria-hidden":!0},g))),(r||s)&&(e=>n.createElement(l.Icon,{className:o(p().icon,e.showCaret&&p().caret),icon:e.showCaret?d:e.endIcon}))(e))}},15893:(e,t,r)=>{"use strict";r.d(t,{LightButton:()=>l});var n=r(50959),o=r(86332),a=r(8025);function l(e){const{isGrouped:t}=n.useContext(o.ControlGroupContext),{reference:r,className:l,isSelected:s,children:i,startIcon:c,iconOnly:u,ellipsis:d,showCaret:m,forceDirection:p,endIcon:h,color:g,variant:v,size:f,enableActiveStateStyles:y,typography:b,textWrap:S=!1,maxLines:x,style:w={},isPills:k,isActive:C,tooltipText:E,...I}=e,L=S?null!=x?x:2:1,T=L>0?{...w,"--ui-lib-light-button-content-max-lines":L}:w;return n.createElement("button",{...I,className:(0,a.useLightButtonClasses)({className:l,isSelected:s,children:i,startIcon:c,iconOnly:u,showCaret:m,forceDirection:p,endIcon:h,color:g,variant:v,size:f,enableActiveStateStyles:y,typography:b,textWrap:S,isPills:k,isActive:C},t),ref:r,style:T},n.createElement(a.LightButtonContent,{showCaret:m,startIcon:c,endIcon:h,iconOnly:u,ellipsis:d,textWrap:S,tooltipText:E},i))}},86332:(e,t,r)=>{"use strict";r.d(t,{ControlGroupContext:()=>n});const n=r(50959).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},
|
||||
17946:(e,t,r)=>{"use strict";r.d(t,{CustomBehaviourContext:()=>n});const n=(0,r(50959).createContext)({enableActiveStateStyles:!0});n.displayName="CustomBehaviourContext"},125:(e,t,r)=>{"use strict";r.d(t,{useForceUpdate:()=>o});var n=r(50959);const o=()=>{const[,e]=(0,n.useReducer)((e=>e+1),0);return e}},39416:(e,t,r)=>{"use strict";r.d(t,{useFunctionalRefObject:()=>a});var n=r(50959),o=r(43010);function a(e){const t=(0,n.useMemo)((()=>function(e){const t=r=>{e(r),t.current=r};return t.current=null,t}((e=>{s.current(e)}))),[]),r=(0,n.useRef)(null),a=t=>{if(null===t)return l(r.current,t),void(r.current=null);r.current!==e&&(r.current=e,l(r.current,t))},s=(0,n.useRef)(a);return s.current=a,(0,o.useIsomorphicLayoutEffect)((()=>{if(null!==t.current)return s.current(t.current),()=>s.current(null)}),[e]),t}function l(e,t){null!==e&&("function"==typeof e?e(t):e.current=t)}},43010:(e,t,r)=>{"use strict";r.d(t,{useIsomorphicLayoutEffect:()=>o});var n=r(50959);function o(e,t){("undefined"==typeof window?n.useEffect:n.useLayoutEffect)(e,t)}},86781:(e,t,r)=>{"use strict";r.d(t,{useMatchMedia:()=>a,useSafeMatchMedia:()=>o});var n=r(50959);function o(e,t=!1){const[r,o]=(0,n.useState)(t);return(0,n.useEffect)((()=>{const t=window.matchMedia(e);function r(){o(t.matches)}return r(),t.addListener(r),()=>{t.removeListener(r)}}),[e]),r}function a(e){const t=(0,n.useMemo)((()=>window.matchMedia(e).matches),[]);return o(e,t)}},27267:(e,t,r)=>{"use strict";function n(e,t,r,n,o){function a(o){if(e>o.timeStamp)return;const a=o.target;void 0!==r&&null!==t&&null!==a&&a.ownerDocument===n&&(t.contains(a)||r(o))}return o.click&&n.addEventListener("click",a,!1),o.mouseDown&&n.addEventListener("mousedown",a,!1),o.touchEnd&&n.addEventListener("touchend",a,!1),o.touchStart&&n.addEventListener("touchstart",a,!1),()=>{n.removeEventListener("click",a,!1),n.removeEventListener("mousedown",a,!1),n.removeEventListener("touchend",a,!1),n.removeEventListener("touchstart",a,!1)}}r.d(t,{addOutsideEventListener:()=>n})},67842:(e,t,r)=>{"use strict";r.d(t,{useResizeObserver:()=>s});var n=r(50959),o=r(59255),a=r(43010),l=r(39416);function s(e,t=[]){const{callback:r,ref:s=null}=function(e){return"function"==typeof e?{callback:e}:e}(e),i=(0,n.useRef)(null),c=(0,n.useRef)(r);c.current=r;const u=(0,l.useFunctionalRefObject)(s),d=(0,n.useCallback)((e=>{u(e),null!==i.current&&(i.current.disconnect(),null!==e&&i.current.observe(e))}),[u,i]);return(0,a.useIsomorphicLayoutEffect)((()=>(i.current=new o.default(((e,t)=>{c.current(e,t)})),u.current&&d(u.current),()=>{var e;null===(e=i.current)||void 0===e||e.disconnect()})),[u,...t]),d}},90186:(e,t,r)=>{"use strict";function n(e){return a(e,l)}function o(e){return a(e,s)}function a(e,t){const r=Object.entries(e).filter(t),n={};for(const[e,t]of r)n[e]=t;return n}function l(e){const[t,r]=e;return 0===t.indexOf("data-")&&"string"==typeof r}function s(e){return 0===e[0].indexOf("aria-")}r.d(t,{filterAriaProps:()=>o,filterDataProps:()=>n,filterProps:()=>a,isAriaAttribute:()=>s,isDataAttribute:()=>l})},34094:(e,t,r)=>{
|
||||
"use strict";r.d(t,{getTextForTooltip:()=>l});var n=r(50959);const o=e=>(0,n.isValidElement)(e)&&Boolean(e.props.children),a=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString()+" ",l=e=>Array.isArray(e)||(0,n.isValidElement)(e)?n.Children.toArray(e).reduce(((e,t)=>{let r="";return r=(0,n.isValidElement)(t)&&o(t)?l(t.props.children):(0,n.isValidElement)(t)&&!o(t)?"":a(t),e.concat(r)}),"").trim():a(e)},76460:(e,t,r)=>{"use strict";function n(e){return 0===e.detail}r.d(t,{isKeyboardClick:()=>n})},3685:(e,t,r)=>{"use strict";function n(){var e,t,r;return null!==(r=null===(t=null===(e=window.configurationData)||void 0===e?void 0:e.exchanges)||void 0===t?void 0:t.map((e=>({...e,country:"",providerId:"",flag:""}))))&&void 0!==r?r:[]}r.d(t,{getExchanges:()=>n})},36279:(e,t,r)=>{"use strict";var n;r.d(t,{LogoSize:()=>n,getLogoUrlResolver:()=>l}),function(e){e[e.Medium=0]="Medium",e[e.Large=1]="Large"}(n||(n={}));class o{getSymbolLogoUrl(e){return e}getCountryFlagUrl(){return""}getCryptoLogoUrl(e){return e}getProviderLogoUrl(e){return e}getSourceLogoUrl(e){return e}}let a;function l(){return a||(a=new o),a}},24437:(e,t,r)=>{"use strict";r.d(t,{DialogBreakpoints:()=>o});var n=r(88803);const o={SmallHeight:n["small-height-breakpoint"],TabletSmall:n["tablet-small-breakpoint"],TabletNormal:n["tablet-normal-breakpoint"]}},69654:(e,t,r)=>{"use strict";r.d(t,{DialogSearch:()=>u});var n=r(50959),o=r(97754),a=r.n(o),l=r(11542),s=r(9745),i=r(69859),c=r(40281);function u(e){const{children:t,renderInput:o,onCancel:u,containerClassName:m,inputContainerClassName:p,iconClassName:h,...g}=e;return n.createElement("div",{className:a()(c.container,m)},n.createElement("div",{className:a()(c.inputContainer,p,u&&c.withCancel)},o||n.createElement(d,{...g})),t,n.createElement(s.Icon,{className:a()(c.icon,h),icon:i}),u&&n.createElement("div",{className:c.cancel,onClick:u},l.t(null,void 0,r(20036))))}function d(e){const{className:t,reference:r,value:o,onChange:l,onFocus:s,onBlur:i,onKeyDown:u,onSelect:d,placeholder:m,...p}=e;return n.createElement("input",{...p,ref:r,type:"text",className:a()(t,c.input),autoComplete:"off","data-role":"search",placeholder:m,value:o,onChange:l,onFocus:s,onBlur:i,onSelect:d,onKeyDown:u})}},17531:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchDialogContentItem:()=>B});var n=r(50959),o=r(97754),a=r.n(o),l=(r(11542),r(50151)),s=r(9745),i=r(14483),c=r(24637),u=r(19785),d=r(84524),m=r(24633),p=r(77975),h=r(45345),g=r(32563),v=r(94474),f=r(93251),y=r(36279),b=r(44747);r(82112);var S=r(76068),x=r(58492),w=r(12767),k=r(43010),C=r(57240);function E(e){const{className:t,placeholderLetter:r,url1:o,url2:l,size:s="xxxsmall"}=e,i=(0,n.useRef)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(null),m=(0,n.useRef)(null),p=(0,n.useRef)(null);return(0,k.useIsomorphicLayoutEffect)((()=>{const e=void 0===o?[]:void 0===l?[o]:[o,l],t=p.current=(r=e,Promise.all(r.map((e=>(0,w.getImage)(`symbol_logo_${e}`,e,L).then((e=>e.cloneNode()))))));var r;t.then((e=>{var r,n,o,a,l,s,h,g,v;if(t===p.current)switch(e.length){
|
||||
case 0:null===(r=u.current)||void 0===r||r.classList.add(C.hidden),null===(n=c.current)||void 0===n||n.classList.add(S.hiddenCircleLogoClass),null===(o=i.current)||void 0===o||o.classList.remove(S.hiddenCircleLogoClass);break;case 1:I(c.current,e[0]),null===(a=u.current)||void 0===a||a.classList.add(C.hidden),null===(l=c.current)||void 0===l||l.classList.remove(S.hiddenCircleLogoClass),null===(s=i.current)||void 0===s||s.classList.add(S.hiddenCircleLogoClass);break;case 2:I(d.current,e[0]),I(m.current,e[1]),null===(h=u.current)||void 0===h||h.classList.remove(C.hidden),null===(g=c.current)||void 0===g||g.classList.add(S.hiddenCircleLogoClass),null===(v=i.current)||void 0===v||v.classList.add(S.hiddenCircleLogoClass)}}))}),[o,l]),n.createElement("span",{className:a()(t,C.container)},n.createElement("span",{ref:u,className:a()(C.pairContainer,C.hidden)},n.createElement("span",{className:(0,b.getBlockStyleClasses)(s)},n.createElement("span",{ref:m,className:a()(C.logo,(0,b.getLogoStyleClasses)(s))}),n.createElement("span",{ref:d,className:a()(C.logo,(0,b.getLogoStyleClasses)(s))}))),n.createElement("span",{ref:c,className:a()(C.logo,S.hiddenCircleLogoClass,(0,x.getStyleClasses)(s))}),n.createElement("span",{ref:i,className:a()(C.logo,(0,x.getStyleClasses)(s))},n.createElement(S.CircleLogo,{size:s,placeholderLetter:r})))}function I(e,t){e&&(e.innerHTML="",e.appendChild(t))}function L(e){e.crossOrigin="",e.decoding="async"}var T=r(54257);function R(e){const{logoId:t,baseCurrencyLogoId:r,currencyLogoId:o,placeholder:l,className:s,size:i="xsmall"}=e,c=(0,n.useMemo)((()=>{const e={logoid:t,"currency-logoid":o,"base-currency-logoid":r};return(0,f.removeUsdFromCryptoPairLogos)((0,f.resolveLogoUrls)(e,y.LogoSize.Medium))}),[t,o,r]);return n.createElement(E,{key:i,className:a()(T.logo,s),url1:c[0],url2:c[1],placeholderLetter:l,size:i})}var N=r(29562),D=r(69533),_=r(39339);function B(e){var t,r;const{dangerousTitleHTML:o,title:f,dangerousDescriptionHTML:y,description:b,searchToken:S,exchangeName:x,marketType:w,onClick:k,isSelected:C,isEod:E=!1,isActive:I=!1,isOffset:L=!1,invalid:T=!1,isHighlighted:B=!1,hideExchange:M=!1,hideMarkedListFlag:O=!1,onExpandClick:Q,isExpanded:F,hoverComponent:A,country:P,providerId:U,source:z,source2:V,type:W,flag:Z,itemRef:K,onMouseOut:$,onMouseOver:j,className:G,actions:q,reference:Y,fullSymbolName:H,logoId:X,currencyLogoId:J,baseCurrencyLogoId:ee,shortName:te,hideLogo:re=!1,exchangeTooltip:ne,hideMarketType:oe,isPrimary:ae}=e,{isSmallWidth:le,isMobile:se}=(0,l.ensureNotNull)((0,n.useContext)(d.SymbolSearchItemsDialogContext)),ie=Boolean(A),ce=!T&&!M&&(se||!ie),ue=(0,p.useWatchedValueReadonly)({watchedValue:h.watchedTheme})===m.StdTheme.Dark?_.dark:_.light,de=A,me=i.enabled("show_symbol_logos"),pe=i.enabled("show_exchange_logos"),he=me||!1,ge=null!==(t=null==V?void 0:V.description)&&void 0!==t?t:z,ve=null!==(r=null==V?void 0:V.name)&&void 0!==r?r:z;return n.createElement("div",{
|
||||
className:a()(_.itemRow,le&&_.multiLine,B&&_.highlighted,B&&ue,C&&_.selected,I&&_.active,T&&_.invalid,!se&&g.mobiletouch&&ie&&_.hover,G),onClick:function(e){if(!k||e.defaultPrevented)return;e.preventDefault(),k(e)},"data-role":e["data-role"]||"list-item","data-active":I,"data-type":w,"data-name":"symbol-search-dialog-content-item",onMouseOut:$,onMouseOver:j,ref:Y},n.createElement("div",{ref:K,className:a()(_.itemInfoCell,_.cell,L&&_.offset)},n.createElement("div",{className:a()(_.actionHandleWrap,!he&&_.fixedWidth)},n.createElement(n.Fragment,null,!1,Q&&n.createElement("div",{onClick:function(e){if(!Q||e.defaultPrevented)return;e.preventDefault(),Q(e)}},n.createElement(s.Icon,{className:a()(_.expandHandle,F&&_.expanded,C&&_.selected),icon:D})),he&&!L&&n.createElement("div",{className:a()(_.logo,Boolean(Q)&&_.isExpandable)},n.createElement(R,{key:H,logoId:X,currencyLogoId:J,baseCurrencyLogoId:ee,placeholder:te?te[0]:void 0})))),n.createElement("div",{className:a()(_.description,he&&L&&_.offset)},f&&n.createElement("div",{className:a()(_.symbolTitle,I&&_.active,T&&_.invalid,!Boolean(y)&&_.noDescription),"data-name":"list-item-title"},"string"==typeof f&&S?n.createElement(c.HighlightedText,{className:_.highlightedText,text:f,queryString:S,rules:(0,u.createRegExpList)(S)}):f,E&&n.createElement("span",{className:_.dataMode},"E")),!f&&o&&n.createElement("div",{className:a()(_.symbolTitle,I&&_.active,T&&_.invalid),"data-name":"list-item-title"},n.createElement("span",{dangerouslySetInnerHTML:{__html:o}}),E&&n.createElement("span",{className:_.dataMode},"E")),le&&fe())),!le&&n.createElement("div",{className:a()(_.cell,_.descriptionCell,Boolean(de)&&_.addition)},fe(),de?n.createElement(de,{...e,className:_.actions,onMouseOver:void 0,onMouseOut:void 0}):null),le&&de?n.createElement(de,{...e,className:_.cell,onMouseOver:void 0,onMouseOut:void 0}):null,ce&&n.createElement("div",{className:a()(_.exchangeCell,_.cell)},n.createElement("div",{className:a()(_.exchangeDescription)},!oe&&n.createElement("div",{className:a()(_.marketType,I&&_.active)},w),n.createElement("div",{className:_.source},!1,"economic"===W&&ge&&ve?n.createElement("div",{className:a()(_.exchangeName,I&&_.active,"apply-common-tooltip",_.narrow,oe&&_.wide),title:ge},ve):n.createElement("div",{className:a()(_.exchangeName,I&&_.active,ne&&"apply-common-tooltip"),title:ne},x))),pe&&n.createElement("div",{className:_.flag},n.createElement(N.SymbolSearchFlag,{key:pe?`${H}_exchange`:`${P}_${U}_${null==V?void 0:V.id}_${W}_${Z}`,className:_.icon,country:P,providerId:U,sourceId:"economic"===W&&V?V.id:void 0}))),n.createElement("div",{className:a()(_.cell,Boolean(q)&&_.actionsCell)},q));function fe(){if(T)return null;const e=a()(_.symbolDescription,I&&_.active,!g.mobiletouch&&"apply-overflow-tooltip apply-overflow-tooltip--allow-text");return b?n.createElement("div",{className:e},S?n.createElement(c.HighlightedText,{className:_.highlightedText,text:b,queryString:S,rules:(0,u.createRegExpList)(S)}):b):y?n.createElement("div",{"data-overflow-tooltip-text":(0,v.removeTags)(y),
|
||||
className:e,dangerouslySetInnerHTML:{__html:y}}):null}}},29562:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchFlag:()=>v});var n=r(50959),o=r(97754),a=r.n(o),l=r(24633),s=r(36279);const i=r.p+"mock-dark.16b5f3a431f502b03ae3.svg",c=r.p+"mock-light.d201313017eb2c1b989f.svg";function u(e){return e===l.StdTheme.Dark?i:c}var d=r(77975),m=r(45345),p=r(50151);const h=s.LogoSize.Medium;var g=r(33172);function v(e){const{country:t,providerId:r,sourceId:o,className:l}=e,i=(0,d.useWatchedValueReadonly)({watchedValue:m.watchedTheme}),[c,v]=(0,n.useState)(function({country:e,providerId:t,sourceId:r}){const n=(0,s.getLogoUrlResolver)();return o=>{const a=e=>n.getProviderLogoUrl(e,h),l=[{value:r,resolve:a},{value:e,resolve:e=>n.getCountryFlagUrl(e.toUpperCase(),h)},{value:t,resolve:a}].find((({value:e})=>void 0!==e&&e.length>0));return void 0!==l?l.resolve((0,p.ensureDefined)(l.value)):u(o)}}({country:t,providerId:r,sourceId:o})(i));return n.createElement("img",{className:a()(l,g.icon),crossOrigin:"",src:c,onError:function(){v(u(i))}})}},58442:(e,t,r)=>{"use strict";r.d(t,{QualifiedSources:()=>n,qualifyProName:()=>l});var n,o=r(50151),a=r(14483);r(81319);function l(e){return e}!function(e){function t(e){return e.pro_name}function r(e){{const t=a.enabled("pay_attention_to_ticker_not_symbol")?e.ticker:e.full_name;return(0,o.ensureDefined)(t)}}e.fromQuotesSnapshot=function(e){return"error"===e.status?e.symbolname:e.values.pro_name},e.fromQuotesResponse=function(e){const{values:r,symbolname:n,status:o}=e;return"error"===o&&n?n:t(r)},e.fromQuotes=t,e.fromSymbolSearchResult=function(e,t){{const{ticker:r,full_name:n}=null!=t?t:e;return a.enabled("pay_attention_to_ticker_not_symbol")?(0,o.ensureDefined)(null!=r?r:n):(0,o.ensureDefined)(n)}},e.fromSymbolInfo=r,e.fromSymbolMessage=function(e,t){return"symbol_resolved"===t.method?r(t.params[1]):e}}(n||(n={}))},20882:(e,t,r)=>{"use strict";r.d(t,{createSearchSources:()=>s,filterSearchSources:()=>a,isAllSearchSourcesSelected:()=>o,splitSearchSourcesByGroup:()=>l});const n=[];function o(e){return""===e.value()}function a(e,t){return e.filter((e=>e.includes(t)))}function l(e){const t=new Map;e.forEach((e=>{t.has(e.group())?t.get(e.group()).push(e):t.set(e.group(),[e])}));for(const e of t.values()){e[0].group()!==ExchangeGroup.NorthAmerica&&e.sort(((e,t)=>e.name().toLowerCase()>t.name().toLowerCase()?1:-1))}return new Map([...t.entries()].sort((([e],[t])=>n.indexOf(e)-n.indexOf(t))))}function s(e,t){return t.map((t=>new e(t)))}},70613:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchDialogBodyContext:()=>n});const n=r(50959).createContext(null)},84524:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchItemsDialogContext:()=>n});const n=r(50959).createContext(null)},22350:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchItemsDialog:()=>je});var n=r(50959),o=r(97754),a=r.n(o),l=r(11542),s=r(15983);const i=["futures","forex","bond","economic"];var c=r(84877),u=r(14483),d=r(24437),m=r(35057),p=r(9745),h=r(86240),g=r(86781),v=r(84524),f=r(69654),y=r(3343),b=r(16838);function S(e,t,r){return`source-item-${e}-${t}-${r}`}
|
||||
var x=r(20882),w=r(54638);function k(e){const{children:t,className:r}=e;return n.createElement("div",{className:a()(w.container,r)},n.createElement("div",{className:w.childrenWrapper},t))}var C=r(50151),E=r(77762),I=r(24637),L=r(19785),T=r(81319),R=r(91540),N=r(50674);function D(e){const{searchSource:t,onClick:r,queryString:o,isFocused:l,id:s}=e,{symbolSearchContent:i,isAllSearchSourcesSelected:c,allSearchSourcesTitle:u,isMobile:d}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),m=i.currentSelectedSearchSource,h=(0,C.ensureNotNull)(m).value(),g=c(t),f=t.value()===h,y=(0,n.useMemo)((()=>(0,L.createRegExpList)(o)),[o]),b=t.description(),S=b&&!g,x=T.isSeparateSymbolSearchTabs&&g&&u?u:t.name(),w=a()(N.container,d?N.mobile:N.desktop,f&&N.selected,l&&N.focused,g&&N.allSelected,g&&N.libAllSelected,!g&&d&&N.bordered);return n.createElement("div",{className:a()(!d&&N.wrap,g&&N.libAllSelected),onClick:r,id:s},n.createElement("div",{className:w},n.createElement("div",{className:N.iconWrap},!!g&&n.createElement(p.Icon,{className:a()(N.icon,N.allSelectedIcon),icon:R})),n.createElement("div",{className:N.textBlock},n.createElement("div",{className:a()(N.title,!S&&!d&&N.titleWithoutDesc)},n.createElement(I.HighlightedText,{className:a()(f&&N.highlighted),queryString:o,text:x,rules:y})),S&&n.createElement("div",{className:a()(N.description,"apply-overflow-tooltip")},n.createElement(I.HighlightedText,{className:N.highlighted,queryString:o,rules:y,text:b})))))}var _=r(77975),B=r(45345),M=r(26843),O=r(70613),Q=r(66619),F=r(67562),A=r(70699);const P={emptyTextClassName:A.emptyText};function U(e){const{searchSources:t}=e,{setSelectedIndex:o,setSelectedSearchSource:s,setMode:i,isMobile:c,emptyState:u,autofocus:d}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),m=(0,_.useWatchedValueReadonly)({watchedValue:B.watchedTheme})===M.StdTheme.Dark?Q:F,w=(0,g.useMatchMedia)(h["media-phone-vertical"]),[C,I]=(0,n.useState)(""),L=(0,n.useMemo)((()=>[{group:null,sources:(0,T.createGroupColumns)((0,x.filterSearchSources)(t,C),w?1:2)}]),[t,C,w]),R=(0,n.useRef)(null),N=(0,n.useRef)(null),{focusedItem:U,activeDescendant:z,handleKeyDown:V,resetFocusedItem:W}=function(e,t,r){const[o,a]=(0,n.useState)(null),[l,s]=(0,n.useState)("");function i(t){const r=e[t.groupIndex].sources[t.col].length-1;if(t.row===r){const e=d(t.groupIndex+1);if(null===e)return;return t.col>0&&!u({...t,groupIndex:e,row:0})?void a({groupIndex:e,col:0,row:0}):void a({...t,groupIndex:e,row:0})}a({...t,row:t.row+1})}function c(t){var r,n;if(0===t.row){const o=d(t.groupIndex-1,-1);if(null===o)return;const l=null!==(n=null===(r=e[o].sources[t.col])||void 0===r?void 0:r.length)&&void 0!==n?n:0;return 0===l?void a({groupIndex:o,col:0,row:0}):void a({...t,groupIndex:o,row:l-1})}a({...t,row:t.row-1})}function u(t){var r,n;return Boolean(null===(n=null===(r=e[t.groupIndex])||void 0===r?void 0:r.sources[t.col])||void 0===n?void 0:n[t.row])}function d(t=0,r=1){const n=e.length;let o=(t+n)%n;for(;!u({groupIndex:o,col:0,row:0});)if(o=(o+r+n)%n,o===t)return null;return o}return(0,
|
||||
n.useEffect)((()=>{if(!r.current)return;if(!o)return void s("");const e=S(o.groupIndex,o.col,o.row),t=r.current.querySelector(`#${e}`);null==t||t.scrollIntoView({block:"nearest"}),s(e)}),[o]),(0,n.useEffect)((()=>{a(null)}),[t]),{focusedItem:o,activeDescendant:l,handleKeyDown:function(n){if(!r.current)return;const l=(0,y.hashFromEvent)(n);if(32!==l&&13!==l)switch((0,b.mapKeyCodeToDirection)(l)){case"blockNext":if(n.preventDefault(),!o){const e=d();if(null===e)break;a({groupIndex:e,col:0,row:0});break}i(o);break;case"blockPrev":if(n.preventDefault(),!o)break;c(o);break;case"inlineNext":{if(!o||t)break;n.preventDefault();const r=e[o.groupIndex].sources.length;if(o.col===r-1||!u({...o,col:o.col+1})){i({...o,col:0});break}a({...o,col:o.col+1});break}case"inlinePrev":{if(!o||t)break;n.preventDefault();const r=e[o.groupIndex].sources.length;if(0===o.col){if(0!==o.row){c({...o,col:r-1});break}const t=d(o.groupIndex-1,-1);if(null===t)break;const n=e[t].sources.length,l=e[t].sources[0].length;if(!u({groupIndex:t,col:n-1,row:l-1})){c(o);break}a({groupIndex:t,col:n-1,row:l-1});break}a({...o,col:o.col-1});break}}else{if(!o)return;n.preventDefault();const e=r.current.querySelector(`#${S(o.groupIndex,o.col,o.row)}`);e instanceof HTMLElement&&e.click()}},resetFocusedItem:()=>a(null)}}(L,w,N);(0,n.useLayoutEffect)((()=>{var e;d&&(null===(e=null==R?void 0:R.current)||void 0===e||e.focus())}),[]);const Z=u?n.createElement(u,null):n.createElement(k,{className:A.noResultsDesktop},n.createElement(p.Icon,{icon:m,className:A.emptyIcon}),n.createElement("div",{className:A.emptyText},l.t(null,void 0,r(29673)))),K=!(L.length&&L.every((e=>0===e.sources.length)));return n.createElement(O.SymbolSearchDialogBodyContext.Provider,{value:P},n.createElement(f.DialogSearch,{placeholder:l.t(null,void 0,r(52298)),onChange:function(e){W(),I(e.target.value),N&&N.current&&(N.current.scrollTop=0)},reference:R,onKeyDown:V,onBlur:W,"aria-activedescendant":z}),K?n.createElement("div",{ref:N,className:a()(A.contentList,!c&&A.contentListDesktop),onTouchStart:function(){var e;null===(e=R.current)||void 0===e||e.blur()}},L.map(((e,t)=>{const{group:r,sources:o}=e;return 0===o.length?n.createElement(n.Fragment,{key:r}):n.createElement(n.Fragment,{key:r},!1,n.createElement("div",{className:a()(A.searchSourceItemsContainer,!c&&A.searchSourceItemsContainerDesktop,w&&A.oneColumn)},o.map(((e,r)=>n.createElement("div",{key:`${t}-${r}`,className:A.column},e.map(((e,o)=>n.createElement(D,{id:S(t,r,o),isFocused:!!U&&(U.groupIndex===t&&U.col===r&&U.row===o),key:e.value(),searchSource:e,queryString:C,onClick:$.bind(null,e)}))))))))}))):Z);function $(e){s(e),i("symbolSearch"),o(-1)}}var z=r(962),V=r(45884);r(76861),r(69798);function W(e){return e.hasOwnProperty("exchange")}async function Z(e){{const t=await async function(e){return new Promise((t=>{window.ChartApiInstance.searchSymbols(e.text||"",e.exchange||"",e.type||"","",!1,!0,"",!0,"",(e=>{t(e)}))}))}(e);return{symbols:t,symbols_remaining:0}}}new Map([].map((({value:e,search_type:t})=>[e,t])))
|
||||
;var K=r(78136),$=r(51768),j=r(68335),G=r(31409),q=r(44254),Y=r(486),H=r(81574),X=r(35119),J=r(32617),ee=r(69135),te=r(63861),re=r(52597);function ne(e){var t;const{state:r,update:o}=e,{searchRef:a,forceUpdate:l,upperCaseEnabled:i}=(0,C.ensureNotNull)((0,n.useContext)(v.SymbolSearchItemsDialogContext)),c=(0,q.tokenize)(null===(t=a.current)||void 0===t?void 0:t.value),d=(0,s.validate)(c);let m=[{icon:Y,insert:"/",type:"binaryOp",name:"division"},{icon:H,insert:"-",type:"binaryOp",name:"subtraction"},{icon:X,insert:"+",type:"binaryOp",name:"addition"},{icon:J,insert:"*",type:"binaryOp",name:"multiplication"}];return u.enabled("hide_exponentiation_spread_operator")||(m=m.concat([{icon:ee,insert:"^",type:"binaryOp",name:"exponentiation"}])),u.enabled("hide_reciprocal_spread_operator")||(m=m.concat([{icon:te,type:"complete",name:"1/x",callback:()=>{!a.current||d.errors.length||d.warnings.length||(a.current.value=(0,s.stringifyTokens)((0,s.flip)(c)),l())}}])),n.createElement("div",{className:re.actions},m.map((e=>n.createElement(G.ToolWidgetButton,{className:re.actionButton,icon:e.icon,key:e.name,isDisabled:oe(e,d),onClick:()=>function(e){var t;if(!oe(e,d)){if(e.insert&&a.current){const t=a.current.value+e.insert;a.current.value=t,a.current.setSelectionRange(t.length,t.length);const[n,,c]=(0,s.getCurrentTokenParamsFromInput)(a.current,i);r.current&&(r.current.selectedIndexValue=-1,r.current.searchSpreadsValue=(0,s.isSpread)(c),r.current.searchTokenValue=n),l(),o()}e.callback&&e.callback(),null===(t=a.current)||void 0===t||t.focus(),(0,$.trackEvent)("GUI","SS",e.name)}}(e)}))))}function oe(e,t){let r=!1;if(!t.errors.length)switch(e.type){case"binaryOp":r="var"===t.currentState;break;case"openBrace":r="var"!==t.currentState;break;case"closeBrace":r="var"===t.currentState&&t.braceBalance>0;break;case"complete":r=!t.errors.length&&!t.warnings.length}return!r}var ae=r(90186),le=r(61371);function se(e){const{title:t,isActive:r,isAnimated:n,activeColor:o,size:l="m",appearance:s="default",fontSize:i="m",grayStyles:c,className:u}=e;return a()(le.bubble,r&&le.active,o&&le[o],t&&"apply-common-tooltip",l&&le[`size-${l}`],i&&le[`fontSize-${i}`],s&&le[`appearance-${s}`],n&&le.animated,c&&le.gray,u)}function ie(e){const{id:t,title:r,tabIndex:o,role:l,contentClassName:s,children:i,onClick:c,onMouseDown:u,reference:d,grayStyles:m,...p}=e;return n.createElement("span",{...(0,ae.filterAriaProps)(p),...(0,ae.filterDataProps)(p),id:t,title:r,tabIndex:o,role:l,className:se(e),onClick:c,onMouseDown:u,ref:d},n.createElement("span",{className:a()(le.content,s)},i))}var ce=r(88389);function ue(e){const{className:t,itemClassName:r,itemContentClassName:a,items:l,getItemTitle:s,getItemTooltip:i,getItemKey:c,checkItemIsActive:u,getItemColor:d,onBubbleClick:m,multiline:p,children:h,BubbleComponent:g=ie,reference:v,fontSize:f,grayStyles:y}=e;return n.createElement("div",{className:o(t,ce.bubbles,p&&ce.multiLine),ref:v},l.map(((e,t)=>n.createElement(g,{key:c?c(e):t,id:c?c(e):t.toString(),className:o(ce.bubble,r),contentClassName:a,onClick:function(){m(e)
|
||||
},onMouseDown:function(e){e.preventDefault()},isActive:!!u&&u(e),activeColor:d?d(e):void 0,fontSize:f,title:i?i(e):void 0,grayStyles:y},s(e)))),h)}var de=r(63932),me=r(20037),pe=r(29006),he=r(14543),ge=r(10381),ve=r(52019),fe=r(14444);const ye=(0,T.getDefaultSearchSource)();function be(e){const{mode:t,setMode:o,searchRef:s,cachedInputValue:i,setSelectedIndex:c,setSelectedSearchSource:u,isAllSearchSourcesSelected:d,allSearchSourcesTitle:m,upperCaseEnabled:h,symbolSearchContent:g}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),f=g.currentSelectedSearchSource,y=(0,C.ensureNotNull)(f),b="symbolSearch"===t,S=d(y),x=T.isSeparateSymbolSearchTabs&&S&&m?m:y.name(),w=(0,n.useCallback)((()=>{var e;if(T.isSeparateSymbolSearchTabs&&!S&&ye)return u(ye),c(-1),void(null===(e=s.current)||void 0===e||e.focus());s.current&&(i.current=h?s.current.value.toUpperCase():s.current.value),o("exchange")}),[S,s,h,o,u]);return T.isSeparateSymbolSearchTabs?b?n.createElement(he.LightButton,{onClick:w,isPills:!S,size:"xsmall",variant:S?"ghost":"quiet-primary",showCaret:S,endIcon:S?void 0:ve,enableActiveStateStyles:!1,className:a()(fe.button,!S&&fe.withFlag),tabIndex:-1,"data-name":"sources-button"},n.createElement("div",{className:fe.buttonContent},null,n.createElement("span",null,x))):null:b?n.createElement("div",{className:a()(fe.flagWrap,"apply-common-tooltip",!S&&fe.withFlag),title:l.t(null,void 0,r(13269)),onClick:w,"data-name":"sources-button"},S&&n.createElement(p.Icon,{className:fe.icon,icon:R}),null,n.createElement("div",{className:a()(fe.title)},x),n.createElement(ge.ToolWidgetCaret,{className:fe.caret,dropped:!1})):null}var Se=r(37796);function xe(e){const{brokerButton:t=null}=e,{isSmallWidth:o,selectedFilterValues:s,setSelectedFilterValues:i,setSelectedIndex:c,isMobile:u,searchRef:d,symbolSearchContent:m}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),p=m.tabSelectFilters;return T.isSeparateSymbolSearchTabs?n.createElement("div",{className:a()(Se.wrap,Se.small,Se.newStyles,u&&Se.mobile)},t&&n.createElement("div",{className:Se.brokerWrap},t),m.canChangeExchange&&n.createElement("div",{className:Se.filterItem},n.createElement(be,null)),p&&p.map((e=>{const{id:t,options:r,label:o}=e,a=r.find((e=>e.value===FILTER_DEFAULT_VALUE));if(!a)throw new Error("There must be default filter value in filter definition");const l=r.find((e=>{var r;return e.value===(null===(r=s[m.currentSymbolType])||void 0===r?void 0:r[t])}))||a;return n.createElement("div",{key:t,className:Se.filterItem},n.createElement(SymbolSearchSelectFilter,{selectedOption:l,defaultOption:a,options:r,onSelect:e=>{var r;i(m.currentSymbolType,{[t]:e.value}),trackEvent("New SS",m.currentSymbolType,null===e.value?e.analyticsLabel:e.value),c(-1),null===(r=d.current)||void 0===r||r.focus()},label:o,isMobile:u,"data-name":t}))}))):n.createElement("div",{className:a()(Se.wrap,o&&Se.small)},n.createElement("div",{className:Se.item},n.createElement("div",{className:Se.text},o?l.t(null,void 0,r(48490)):l.t(null,void 0,r(89053)))),n.createElement("div",{className:Se.item
|
||||
},!o&&n.createElement("div",{className:Se.text},l.t(null,void 0,r(29601))),m.canChangeExchange&&n.createElement("div",{className:Se.exchange},n.createElement(be,null))))}var we=r(38223),ke=r(52662);function Ce(e){const{onTouchMove:t,listRef:r,className:o,listWrapRef:l,virtualListKey:s,items:i,getItemSize:c,hideFeed:u,canLoadMore:d,onLoadMoreSymbols:m}=e,{mode:p,isSmallWidth:h,handleListWidth:g}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),[f,y]=(0,n.useState)(null),b=(0,pe.useResizeObserver)((function([e]){y(e.contentRect.height),g(e.contentRect.width)})),S=(0,n.useCallback)((e=>{const{index:t,style:r}=e;return n.createElement("div",{style:r},i[t])}),[i]),x=(0,n.useCallback)((e=>(0,C.ensure)(i[e].key)),[i]),w="watchlist"===p&&null!==f;return n.createElement("div",{className:a()(ke.wrap,w&&ke.watchlist,u&&ke.noFeed,u&&T.isSeparateSymbolSearchTabs&&ke.newStyles,o),onTouchMove:t,ref:b},n.createElement("div",{ref:l,className:a()(ke.scrollContainer,u&&ke.noFeed)},w?n.createElement(me.VariableSizeList,{key:s,ref:r,className:ke.listContainer,width:"100%",height:(0,C.ensureNotNull)(f),itemCount:i.length,itemSize:c,children:S,itemKey:x,overscanCount:20,direction:(0,we.isRtl)()?"rtl":"ltr"}):n.createElement(n.Fragment,null,n.createElement("div",{className:a()(ke.listContainer,h&&ke.multiLineItemsContainer)},!T.isSeparateSymbolSearchTabs&&n.createElement(xe,null),...i,!1))))}var Ee=r(17531),Ie=r(85544);const Le=u.enabled("hide_image_invalid_symbol");function Te(e){const{otherSymbolsCount:t,onChangeSymbolTypeFilter:r,onResetFilters:a,onListTouchMove:l,brokerTitle:s,brokerLogoInfo:i,isBrokerActive:c,onBrokerToggle:u,listRef:d,listWrapRef:m,onLoadMoreSymbols:p,canLoadMore:h}=e,{mode:g,isMobile:f,selectedSymbolType:y,symbolTypes:b,feedItems:S,contentItem:x,emptyState:w=Re,symbolSearchContent:k,symbolSearchState:C}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),I=s?n.createElement(BrokerButton,{brokerTitle:s,isActive:c,onToggle:u,logoInfo:i}):null,L="symbolSearch"===g&&["good","loadingWithPaginated"].includes(C),R=null!=x?x:Ee.SymbolSearchDialogContentItem,N=(0,n.useMemo)((()=>S.map((e=>n.createElement(R,{...e,searchToken:k.token})))),[S]);return n.createElement(n.Fragment,null,"symbolSearch"===g&&n.createElement(n.Fragment,null,b.length>0&&n.createElement(ue,{className:o(T.isSeparateSymbolSearchTabs&&(k.withFilters||f&&I)&&Ie.withFilters,!f&&I&&Ie.withButton),itemClassName:Ie.symbolType,items:b,getItemTitle:e=>e.name,getItemKey:e=>e.value,checkItemIsActive:e=>e.value===y,onBubbleClick:r,multiline:!f,grayStyles:!0},!f&&n.createElement("div",{className:Ie.brokerButton},I)),!T.isSeparateSymbolSearchTabs&&f&&b.length>0&&s&&n.createElement("div",{className:Ie.brokerButtonWrap},I),T.isSeparateSymbolSearchTabs&&n.createElement(xe,{brokerButton:f?I:void 0})),n.createElement(Ce,{listRef:d,listWrapRef:m,onTouchMove:l,items:N,getItemSize:()=>De,onLoadMoreSymbols:p,canLoadMore:h,hideFeed:!L}),"loading"===C&&n.createElement("div",{className:Ie.spinnerWrap
|
||||
},n.createElement(de.Spinner,null)),"symbolSearch"===g&&n.createElement(n.Fragment,null,!1,"empty"===C&&n.createElement(w,null)))}function Re(e){const t=(0,_.useWatchedValueReadonly)({watchedValue:B.watchedTheme})===M.StdTheme.Dark?Q:F;return n.createElement(k,{className:Ie.noResultsDesktop},!Le&&n.createElement(p.Icon,{icon:t,className:Ie.emptyIcon}),n.createElement("div",{className:Ie.emptyText},l.t(null,void 0,r(41379))))}const Ne=(0,T.getDefaultSearchSource)(),De=52;function _e(e){const{mode:t,setMode:o,setSelectedIndex:i,isMobile:c,selectedSearchSource:d,setSelectedSearchSource:m,isAllSearchSourcesSelected:p,selectedSymbolType:h,setSelectedSymbolType:g,symbolSearchContent:y,setSymbolSearchContent:b,searchRef:S,setSearchSpreads:x,showSpreadActions:w,selectedItem:k,forceUpdate:C,placeholder:I,initialScreen:L,footer:R,searchInput:N,upperCaseEnabled:D,externalInput:_,handleKeyDown:B,customSearchSymbols:M,filterDefinitions:Q,filterQueryParams:F,searchSources:A,symbolSearchState:P,setSymbolSearchState:U,onEmptyResults:G}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),q=(0,n.useRef)(t);q.current=t;const Y=(0,n.useRef)(new AbortController),[H,X]=(0,n.useState)(0),J=(0,n.useRef)(0),[ee,te]=(0,n.useState)(y.token),re=(0,n.useRef)(null),oe=(0,n.useRef)(null),ae=(0,n.useRef)({selectedIndexValue:-1,searchTokenValue:"",searchSpreadsValue:!0}),le=(0,n.useRef)(null),se=(0,n.useRef)(null),ie=(0,n.useRef)(null),{broker:ce=null,brokerId:ue,brokerTitle:de,brokerLogoInfo:me,isBrokerChecked:pe=!1,setIsBrokerChecked:he=(()=>{}),unhideSymbolSearchGroups:ge=""}={brokerId:void 0,brokerTitle:void 0,brokerLogoInfo:void 0};(0,n.useEffect)((()=>()=>{Y.current.abort(),Be(),Me()}),[]),(0,n.useEffect)((()=>{(null==S?void 0:S.current)&&te(S.current.value)}),[]),(0,n.useEffect)((()=>{const e=S.current;if(e)return e.addEventListener("input",we),e.addEventListener("focus",De),e.addEventListener("select",xe),e.addEventListener("click",xe),e.addEventListener("keyup",_e),_&&B&&e.addEventListener("keydown",B),()=>{e&&(e.removeEventListener("input",we),e.removeEventListener("focus",De),e.removeEventListener("select",xe),e.removeEventListener("click",xe),e.removeEventListener("keyup",_e),_&&B&&e.removeEventListener("keydown",B))}}),[B]),(0,n.useEffect)((()=>{Boolean(L)&&""===ee.trim()||(b((e=>({...e,symbolStartIndex:0}))),Ce(ee,h,d).then((()=>{re.current&&(re.current.scrollTop=0)})))}),[ee,h,d,pe,L,F]),(0,n.useEffect)((()=>{var e;if(!k||!S.current)return;if(!u.enabled("show_spread_operators"))return S.current.value=k.symbol,void C();const t=W(k)?k.exchange:k.parent.exchange;let r;r="contracts"in k&&(null===(e=k.contracts)||void 0===e?void 0:e.length)?k.contracts[0]:k;const n={name:r.symbol,exchange:t,prefix:r.prefix,fullName:r.full_name},[o,a]=(0,s.getNextSymbolInputValueAndPosition)(S.current,n,D);S.current.value=o,S.current.setSelectionRange(a,a),C()}),[k]);const ve=null!=L?L:"div",fe=Boolean(L)&&"symbolSearch"!==t,ye=null!=N?N:f.DialogSearch,be=(0,n.useMemo)((()=>({listRef:oe,resetRecommends:Re,updateRecommends:Ce,searchToken:ee,
|
||||
emptyTextClassName:Ie.emptyText,isBrokerChecked:pe,symbolSearchState:P,currentMode:q})),[oe,ee,pe,P,q,F]);return n.createElement(O.SymbolSearchDialogBodyContext.Provider,{value:be},!(_&&"symbolSearch"===t)&&n.createElement(ye,{reference:S,className:a()(Ie.search,D&&Ie.upperCase),placeholder:I||l.t(null,void 0,r(52298))},w&&n.createElement(ne,{state:ae,update:ke})),fe?n.createElement(ve,null):n.createElement(Te,{otherSymbolsCount:H,onListTouchMove:function(){var e;null===(e=S.current)||void 0===e||e.blur()},onChangeSymbolTypeFilter:function(e){const{value:t}=e;g(t),i(-1)},onResetFilters:function(){var e;T.isSeparateSymbolSearchTabs?"resetFilter"===P?g((0,T.getAllSymbolTypesValue)()):Ne&&m(Ne):(g((0,T.getAllSymbolTypesValue)()),Ne&&m(Ne));he(!1),c||null===(e=S.current)||void 0===e||e.focus()},brokerTitle:de,brokerLogoInfo:me,isBrokerActive:pe,onBrokerToggle:he,listRef:oe,listWrapRef:re,onLoadMoreSymbols:void 0,canLoadMore:void 0}),R);function Se(){if(!S.current)return;const[e,t,r]=(0,s.getCurrentTokenParamsFromInput)(S.current,D);J.current=t,ae.current={selectedIndexValue:-1,searchSpreadsValue:(0,s.isSpread)(r),searchTokenValue:e},le.current||(le.current=setTimeout(ke,0))}function xe(){if(!S.current)return;const[,e]=(0,s.getCurrentTokenParamsFromInput)(S.current,D);e!==J.current&&Se()}function we(){u.enabled("show_spread_operators")?Se():S.current&&(ae.current={selectedIndexValue:-1,searchSpreadsValue:!1,searchTokenValue:S.current.value},le.current||(le.current=setTimeout(ke,0)))}function ke(){const{selectedIndexValue:e,searchTokenValue:t,searchSpreadsValue:r}=ae.current;le.current=null,(0,z.unstable_batchedUpdates)((()=>{x(r),i(e),te(D?t.toUpperCase():t)}))}async function Ce(e,t,r,n){var o,a,l;try{"noop"===P?U("loading"):n?U("loadingWithPaginated"):(Be(),Me(),se.current=setTimeout((()=>{b({token:e,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A,renderSymbolSearchList:[],symbolsRemaining:0,symbolStartIndex:0}),U("loading")}),500)),Oe();(0,T.getAllSymbolTypesValue)();const i=!1;let c;if(pe&&ce){c=(await(0,V.respectAbort)(Y.current.signal,ce.accountMetainfo())).prefix}const m=u.enabled("show_spread_operators")?null!==(a=null!==(o=(0,s.getExchange)(e))&&void 0!==o?o:c)&&void 0!==a?a:null==r?void 0:r.getRequestExchangeValue():null==d?void 0:d.getRequestExchangeValue(),p=(0,s.getExchange)(e)||null===(l=r||d)||void 0===l?void 0:l.getRequestCountryValue(),[h,g]=await Promise.all([Le(Y.current.signal,e,t,r,m,p,n),i&&!n?getRecent():Promise.resolve([])]),v=g.filter((e=>{var t,r;return m?(null===(t=e.exchange)||void 0===t?void 0:t.toLowerCase())===m.toLowerCase():!p||(null===(r=e.country)||void 0===r?void 0:r.toLowerCase())===p.toLowerCase()})),f=new Set(v.map((e=>`${e.exchange}_${e.symbol}`))),S=h.symbols.filter((e=>!f.has(`${e.exchange}_${e.symbol}`)));let x=function(e,t=window.ChartApiInstance.symbolsGrouping()){var r;const n={},o=[];for(let a=0;a<e.length;++a){
|
||||
const l=e[a];if(l.prefix||Array.isArray(l.contracts))return e;const s=t[l.type];if(void 0===s){o.push(l);continue}const i=s.exec(l.symbol);if(i){const e=i[1];let t;n.hasOwnProperty(e)?t=n[e]:(t=o.length,n[e]=t,o.push({type:l.type,symbol:e,exchange:l.exchange,description:l.description,full_name:l.exchange+":"+e,contracts:[]})),null===(r=o[t].contracts)||void 0===r||r.push(l)}else o.push(l)}return o}([...v,...S]);if(n&&(x=[...y.renderSymbolSearchList,...x]),!x.length)return b((r=>({...r,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],token:e,symbolsRemaining:0,withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A}))),Be(),U("empty"),void Ee();Be(),b((r=>({...r,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],renderSymbolSearchList:x,token:e,symbolsRemaining:h.symbols_remaining,withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A,symbolStartIndex:r.symbolStartIndex+h.symbols.length}))),U("good")}catch(e){(0,V.skipAbortError)(e)}}function Ee(){G&&(ie.current=setTimeout((()=>G()),1e3))}async function Le(e,t,r,n,o,a,l){var i;const c={serverHighlight:!1,text:u.enabled("show_spread_operators")?(0,s.shortName)(t):null===(i=S.current)||void 0===i?void 0:i.value,exchange:o,country:a,type:r,lang:window.language||"",sortByCountry:void 0,brokerId:ue,onlyTradable:Boolean(ue)&&pe,unhideSymbolSearchGroups:ge,signal:e,start:l,filterQueryParams:F},d=(0,K.getSearchRequestDelay)();return void 0!==d&&await(0,V.delay)(e,d),M?M(c):Z(c)}function Re(){Oe(),U("empty"),te(""),x(!1),b((e=>({...e,symbolStartIndex:0}))),Be()}function De(){"watchlist"===q.current&&(o("symbolSearch"),(0,$.trackEvent)("Watchlist","Mobile SS","Go to SS page"))}function _e(e){switch((0,j.hashFromEvent)(e)){case 37:case 39:xe()}}function Be(){se.current&&clearTimeout(se.current)}function Me(){ie.current&&clearTimeout(ie.current)}function Oe(){Y.current.abort(),Y.current=new AbortController}}var Be=r(48199),Me=r(24658),Oe=r(58442),Qe=r(56840);function Fe(e){const[t,r]=(0,n.useState)((()=>{const{defaultSearchSource:t,searchSources:r}=e,n=Qe.getValue("symboledit.exchangefilter","");return r.find((e=>e.value()===n))||t}));return[t,(0,n.useCallback)((e=>{var t;r(e),t=e,Qe.setValue("symboledit.exchangefilter",t.value())}),[])]}function Ae(e){const[t,r]=(0,n.useState)((()=>{if(1===e.types.length)return e.types[0].value;const t=Qe.getValue("symboledit.filter",(0,T.getAllSymbolTypesValue)());return e.types.find((e=>e.value===t))?t:(0,T.getAllSymbolTypesValue)()}));return[t,(0,n.useCallback)((e=>{var t;r(e),t=e,Qe.setValue("symboledit.filter",t)}),[])]}var Pe=r(36947),Ue=r(82708),ze=r(88145),Ve=r(76460),We=r(62393);const Ze=(0,T.getAvailableSearchSources)(),Ke=(0,T.getDefaultSearchSource)(),$e=u.enabled("uppercase_instrument_names");function je(e){var t
|
||||
;const{onClose:o,initialMode:a,defaultValue:m="",showSpreadActions:p,hideMarkedListFlag:h,selectSearchOnInit:g=!0,onSearchComplete:f,dialogTitle:y=l.t(null,void 0,r(99983)),placeholder:S,fullscreen:w,initialScreen:k,wrapper:C,dialog:E,contentItem:I,footer:L,searchInput:R,emptyState:N,autofocus:D,dialogWidth:_,onKeyDown:B,searchSourcesScreen:M,customSearchSymbols:O,isDisableFiltering:Q,disableRecents:F,shouldReturnFocus:A,onSymbolFiltersParamsChange:P,onEmptyResults:z}=e,V=(0,n.useMemo)((()=>Q?[]:e.symbolTypes?e.symbolTypes:(0,T.getAvailableSymbolTypes)()),[]),K=void 0!==e.input,$=Q?[]:Ze,[G,q]=(0,n.useState)(a),Y=(0,n.useRef)(m),[H,X]=Fe({searchSources:$,defaultSearchSource:Ke}),[J,ee]=[],[te,re]=Ae({types:V}),[ne,oe]=[{},()=>{}],[ae,le]=(0,n.useState)(!1),[se,ie]=(0,n.useState)(-1),[ce,ue]=(0,n.useState)("noop"),de=T.isSeparateSymbolSearchTabs?TAB_SELECT_FILTER_MAP:void 0,me=T.isSeparateSymbolSearchTabs?(null==J?void 0:J[te])||Ke:H,pe=(0,n.useMemo)((()=>{if(!T.isSeparateSymbolSearchTabs)return $;return $.filter((e=>{const t=TAB_SOURCE_FILTER_MAP[te];if(!t)return!1;if(!te)return!0;const r=e.group();return r===ExchangeGroup.AllExchanges||r&&t.value.includes(r)}))}),[$,te]),[he,ge]=(0,n.useState)((()=>({canChangeExchange:Boolean(H&&Ze.length>1&&!(0,T.exchangeSelectDisabled)(te)),tabSelectFilters:null==de?void 0:de[te],withFilters:!!te,renderSymbolSearchList:[],token:Y.current,symbolsRemaining:0,currentSymbolType:te,currentSelectedSearchSource:me,currentTabAvailableSearchSources:pe,symbolStartIndex:0}))),ve=(0,n.useCallback)((e=>{trackEvent("New SS",te,"Change sources"),null==ee||ee(te,e),ge((t=>({...t,currentSelectedSearchSource:e})))}),[te,ge]),fe=(0,n.useRef)(null!==(t=e.input)&&void 0!==t?t:null),[ye,be]=(0,n.useState)(!1),Se=(0,Pe.useForceUpdate)(),[xe,ke]=(0,n.useState)(new Set),{broker:Ce=null,brokerId:Ee,unhideSymbolSearchGroups:Ie="",displayBrokerSymbol:Le=!1}={brokerId:void 0};(0,n.useLayoutEffect)((()=>{var e;!(null==fe?void 0:fe.current)||!K&&Boolean(null===(e=fe.current)||void 0===e?void 0:e.value)||(K||"compare"===G||(fe.current.value=Y.current),!D||K&&"symbolSearch"!==G||fe.current.focus())}),[G]),(0,n.useEffect)((()=>{(null==fe?void 0:fe.current)&&g&&D&&fe.current.select()}),[]);const Te=(0,n.useMemo)((()=>he.renderSymbolSearchList.reduce(((e,t)=>{const r=Ye(t),n=xe.has(r);return e.push(t),n&&t.contracts&&e.push(...t.contracts.map((e=>({...e,parent:t})))),e}),[])),[he.renderSymbolSearchList,xe]),Re=(0,n.useRef)(null);(0,n.useEffect)((()=>{var e;-1!==se&&(null===(e=Re.current)||void 0===e||e.scrollIntoView({block:"nearest"}))}),[se,Re]);const Ne=i.includes(te),De=(0,n.useMemo)((()=>Te.map(((e,t)=>{var r,n,o,a;if(W(e)){const o=Ye(e),a=e.contracts?xe.has(o):void 0,l=t===se,s=he.renderSymbolSearchList.findIndex((t=>t.symbol===e.symbol&&t.exchange===e.exchange))+1;return{key:t,numberInList:s,id:o,title:qe(e,Le),description:e.description,isOffset:!1,onClick:lt.bind(null,e,s),providerId:e.provider_id,source:e.source,source2:e.source2,country:null===(r=e.country)||void 0===r?void 0:r.toLocaleLowerCase(),
|
||||
type:e.type,exchangeName:null===e.exchange?void 0:e.exchange,exchangeTooltip:"",prefix:e.prefix||void 0,marketType:(0,Me.marketType)(e.type,e.typespecs,!1),hideMarketType:Ne,isEod:(null===(n=e.params)||void 0===n?void 0:n.includes("eod"))&&"economic"!==e.type,isYield:(0,ze.isYield)(e),isExpanded:a,onExpandClick:e.contracts?st.bind(null,o):void 0,fullSymbolName:e.contracts?Oe.QualifiedSources.fromSymbolSearchResult(e,e.contracts[0]):Oe.QualifiedSources.fromSymbolSearchResult(e),itemRef:l?Re:void 0,isSelected:t===se,hideMarkedListFlag:h,item:e,logoId:e.logoid,currencyLogoId:e["currency-logoid"],baseCurrencyLogoId:e["base-currency-logoid"],shortName:(0,Ue.safeShortName)(Oe.QualifiedSources.fromSymbolSearchResult(e)),currencyCode:e.currency_code,isPrimary:e.is_primary_listing}}{const{parent:r}=e,n=Ye(r),l=t===se,s=he.renderSymbolSearchList.findIndex((e=>e.symbol===r.symbol&&e.exchange===r.exchange))+1;return{key:t,numberInList:s,id:n+e.symbol,dangerousTitleHTML:qe(e,Le),dangerousDescriptionHTML:`${r.description}`+(e.description?` (${e.description})`:""),isOffset:!0,isEod:null===(o=e.params)||void 0===o?void 0:o.includes("eod"),isYield:(0,ze.isYield)(e),onClick:it.bind(null,e.parent,e,s),providerId:r.provider_id,country:null===(a=r.country)||void 0===a?void 0:a.toLowerCase(),type:r.type,exchangeName:null===r.exchange?void 0:r.exchange,exchangeTooltip:"",marketType:(0,Me.marketType)(r.type,e.typespecs,!1),hideMarketType:Ne,fullSymbolName:Oe.QualifiedSources.fromSymbolSearchResult(e.parent,e),itemRef:l?Re:void 0,isSelected:l,hideMarkedListFlag:h,item:e}}}))),[he.renderSymbolSearchList,xe,G,se,B]),Qe=(0,n.useMemo)((()=>function(e,t,r){const n=null==t?void 0:t[e],o=new Map(null==n?void 0:n.map((e=>[e.id,e.urlParam]))),a=r[e];let l;if(a){l={};for(const[e,t]of Object.entries(a)){const r=o.get(e);r&&(l[r]=t)}}return l}(te,de,ne)),[te,de,ne]),je=(0,n.useMemo)((()=>he.renderSymbolSearchList.slice(0,20).map((e=>e.contracts?Oe.QualifiedSources.fromSymbolSearchResult(e,e.contracts[0]):Oe.QualifiedSources.fromSymbolSearchResult(e)))),[he.renderSymbolSearchList]);(0,n.useEffect)((()=>{var e,t,r;if(!P)return;const n=["resetFilter","resetTabFilter","empty"].includes(ce)?[]:je,o={...Qe,result_list:n};if(o.search_type||(o.search_type="bitcoin,crypto"===te?"crypto":te),!T.isSeparateSymbolSearchTabs)return o.exchange=null!==(e=null==me?void 0:me.getRequestCountryValue())&&void 0!==e?e:null,void P(o);if(te){const e=null!==(t=null==me?void 0:me.getRequestCountryValue())&&void 0!==t?t:null;e&&(o.country=e);const n=null!==(r=null==me?void 0:me.getRequestExchangeValue())&&void 0!==r?r:null;n&&(o.exchange=n)}P(o)}),[te,Qe,je,me,ce]);const Je=null!=E?E:Xe,et=Je!==Xe&&!K,tt=(e,t)=>{var r;return{mode:G,setMode:q,selectedSearchSource:me,setSelectedSearchSource:T.isSeparateSymbolSearchTabs?ve:X,isAllSearchSourcesSelected:x.isAllSearchSourcesSelected,allSearchSourcesTitle:T.isSeparateSymbolSearchTabs?null===(r=TAB_SOURCE_FILTER_MAP[he.currentSymbolType])||void 0===r?void 0:r.allSearchSourcesTitle:void 0,selectedSymbolType:te,setSelectedSymbolType:re,
|
||||
selectedIndex:se,setSelectedIndex:ie,onClose:o,setSymbolSearchContent:ge,symbolSearchContent:he,searchRef:fe,cachedInputValue:Y,searchSpreads:ae,setSearchSpreads:le,handleListWidth:ct,isSmallWidth:ye,feedItems:De,isMobile:e,showSpreadActions:p,selectSearchOnInit:g,isTablet:t,selectedItem:Te[se],forceUpdate:Se,placeholder:S,initialScreen:k,toggleExpand:st,openedItems:xe,onSubmit:mt,onSearchComplete:f,footer:L,symbolTypes:V,contentItem:I,searchInput:R,emptyState:N,autofocus:D,upperCaseEnabled:$e,externalInput:K,handleKeyDown:et?void 0:dt,customSearchSymbols:O,searchSources:pe,filterDefinitions:de,selectedFilterValues:ne,setSelectedFilterValues:oe,filterQueryParams:Qe,symbolSearchState:ce,setSymbolSearchState:ue,onEmptyResults:void 0}},rt=null!=M?M:U,nt="exchange"===G,ot=nt?{title:l.t(null,void 0,r(19724)),dataName:"exchanges-search",render:()=>n.createElement(rt,{searchSources:he.currentTabAvailableSearchSources}),additionalHeaderElement:n.createElement(Be.BackButton,{onClick:()=>q("symbolSearch"),className:We.backButton,size:"medium","aria-label":l.t(null,{context:"input"},r(16936)),preservePaddings:!0,flipIconOnRtl:(0,we.isRtl)()}),additionalElementPos:"before"}:{title:y,dataName:"symbol-search-items-dialog",render:()=>n.createElement(_e,null),additionalElementPos:"after"},at=null!=C?C:"div";return n.createElement(at,null,n.createElement(c.MatchMediaMap,{rules:d.DialogBreakpoints},(({TabletSmall:e,TabletNormal:t})=>n.createElement(v.SymbolSearchItemsDialogContext.Provider,{value:tt(e,t)},n.createElement(Je,{...ot,shouldReturnFocus:A,fullScreen:w,onClose:o,onClickOutside:o,onKeyDown:et?void 0:dt,isOpened:!0})))));function lt(e,t,r){if(e.contracts)return e.contracts.length?void it(e,e.contracts[0],t,r):void st(Ye(e));it(e,void 0,t,r)}function st(e){const t=new Set(xe);t.has(e)?t.delete(e):t.add(e),ke(t)}function it(e,t,r,n){const a=t||e,{exchange:l}=e;if(u.enabled("show_spread_operators")){const e={name:a.symbol,exchange:l,prefix:a.prefix,fullName:a.full_name};if(ae)return ut(e),void Se();if(fe.current&&fe.current.value.includes(","))return void ut(e)}pt([{resolved:!0,symbol:Oe.QualifiedSources.fromSymbolSearchResult(e,t),result:a}],r,n),o()}function ct(e){be("fixed"===_||e<=640)}function ut(e){if(!fe.current)return;const[t,r]=(0,s.getNextSymbolInputValueAndPosition)(fe.current,e,$e);fe.current.value=t,fe.current.setSelectionRange(r,r),fe.current.focus()}function dt(e){const t=(0,j.hashFromEvent)(e);switch(t){case 13:e.preventDefault(),mt(!0);break;case 27:if(e.preventDefault(),nt)return void q("symbolSearch");o()}switch((0,b.mapKeyCodeToDirection)(t)){case"blockPrev":if(e.preventDefault(),0===se||"good"!==ce)return;if(-1===se)return void ie(0);ie(se-1);break;case"blockNext":if(e.preventDefault(),se===De.length-1||"good"!==ce)return;ie(se+1);break;case"inlinePrev":{if(-1===se)return;const t=De[se],{id:r,isOffset:n,onExpandClick:o}=t;if(!n&&r&&xe.has(r)&&Boolean(o)&&!Boolean(B)&&(e.preventDefault(),st(r)),o)return void(null==B||B(e,!0));break}case"inlineNext":{if(-1===se)return
|
||||
;const t=De[se],{id:r,isOffset:n,onExpandClick:o}=t;if(n||!r||xe.has(r)||!Boolean(o)||Boolean(B)||(e.preventDefault(),st(r)),o)return void(null==B||B(e,!0));break}}null==B||B(e)}function mt(e){if(!fe.current)return;let t=fe.current.value;if(u.enabled("show_spread_operators")&&ae&&t){const r=De[se];if(r&&void 0!==r.isExpanded&&(r.onClick(),t=fe.current.value),t.includes(",")){return pt(He(t).map(Ge),null),void(e&&o())}return pt([{symbol:$e?t.toUpperCase():t,resolved:!1}],null),void(e&&o())}if(t.includes(","))return pt(He(t).map(Ge),null),void(e&&o());if(-1!==se){De[se].onClick()}else{const r=$e?t.toUpperCase():t;if(r&&""!==r.trim()){const e=He(r);if(void 0!==Ee&&-1===r.indexOf(":"))(function(e){let t=!1;return Promise.all(e.map((e=>-1!==e.indexOf(":")||t?Promise.resolve({symbol:e,resolved:!1}):(t=!0,async function(e){var t;null===(t=await(null==Ce?void 0:Ce.accountMetainfo()))||void 0===t||t.prefix;const r=void 0,n=await Z({strictMatch:!0,serverHighlight:!1,text:e,lang:window.language||"",brokerId:Ee,onlyTradable:!0,unhideSymbolSearchGroups:Ie,exchange:r});if(0!==n.symbols.length){const e=n.symbols[0],{contracts:t}=e,r=t&&t.length>0?t[0]:void 0,o=e.prefix||e.exchange,a=r?r.symbol:e.symbol;if(o&&a)return{symbol:Oe.QualifiedSources.fromSymbolSearchResult(e,r),resolved:!0,result:e}}return{symbol:e,resolved:!1}}(e)))))})(e).then((e=>pt(e,null)));else{pt(e.map(Ge),null)}}e&&o()}}async function pt(e,t,r){var n;const[{result:o,symbol:a,resolved:l}]=e,s=null===(n=fe.current)||void 0===n?void 0:n.value,i=!r||(0,Ve.isKeyboardClick)(r);let c=ae;void 0!==o&&W(o)&&(c="spread"===o.type),f(e,{symbolType:te,isKeyboardEvent:i,numberInList:t,inputValue:s,isSpread:c})}}function Ge(e){return{symbol:$e?e.toUpperCase():e,resolved:!1}}function qe(e,t){const{broker_symbol:r,symbol:n,description:o}=e;return`${"spread"===e.type?o:n}${t&&r?` (${r})`:""}`}function Ye(e){return e.symbol+e.exchange+e.description}function He(e){return e.split(",").map((e=>e.trim())).filter((e=>""!==e))}function Xe(e){const{isMobile:t,isTablet:r}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext);return n.createElement(m.AdaptivePopupDialog,{...e,className:a()(We.dialog,!t&&(r?We.tabletDialog:We.desktopDialog)),backdrop:!0,draggable:!1})}},15983:(e,t,r)=>{"use strict";r.d(t,{flip:()=>s,getCurrentTokenParamsFromInput:()=>v,getExchange:()=>p,getNextSymbolInputValueAndPosition:()=>g,isSpread:()=>u,shortName:()=>m,stringifyTokens:()=>i,validate:()=>l});var n=r(14483),o=r(44254),a=r(81319);function l(e){const t={braceBalance:0,currentState:"var",warnings:[],errors:[]};if(n.enabled("charting_library_base")&&!n.enabled("show_spread_operators"))return t;let r="init";const o=[];for(let n=0;n<e.length;n++){const a=e[n];if("whitespace"!==a.type){if("incompleteSymbol"===a.type||"incompleteNumber"===a.type){const r=n!==e.length-1,o={status:r?"error":"incomplete",reason:"incomplete_token",offset:a.offset,token:a};if(r?t.errors.push(o):t.warnings.push(o),r)continue}switch(a.type){case"symbol":case"number":if("var"===r){t.errors.push({status:"error",
|
||||
reason:"unexpected_token",offset:a.offset,token:a});continue}r="var";break;case"plus":case"minus":case"multiply":case"divide":case"power":if("var"!==r){t.errors.push({status:"error",reason:"unexpected_token",offset:a.offset,token:a});continue}r="operator";break;case"openBrace":if("var"===r){t.errors.push({status:"error",reason:"unexpected_token",offset:a.offset,token:a});continue}o.push(a),r="init";break;case"closeBrace":if("var"!==r){t.errors.push({status:"error",reason:"unexpected_token",offset:a.offset,token:a});continue}o.pop()||t.errors.push({status:"error",reason:"unbalanced_brace",offset:a.offset,token:a}),r="var";break;case"unparsed":t.errors.push({status:"error",reason:"unparsed_entity",offset:a.offset,token:a})}}}for(t.braceBalance=o.length,"var"!==r&&t.warnings.push({status:"incomplete",token:e[e.length-1]});o.length;){const e=o.pop();e&&t.warnings.push({status:"incomplete",reason:"unbalanced_brace",offset:e.offset,token:e})}return t.currentState=r,t}function s(e){const t=function(e){let t,r=0,n=0;for(let o=0;o<e.length;o++){const a=e[o];if("whitespace"!==a.type)switch(r){case 0:if("number"!==a.type||1!=+a.value)return[];r=1;break;case 1:if(1!==r||"divide"!==a.type)return[];r=2,t=o+1;break;case 2:if("openBrace"===a.type)r=3,n=1;else if(c(a.type))return[];break;case 3:"openBrace"===a.type?n++:"closeBrace"===a.type&&(n--,n<=0&&(r=2))}}return e.slice(t)}(e);return t.length?d(t):d((0,o.tokenize)("1/("+i(e)+")"))}function i(e){return e.reduce(((e,t)=>"symbol"===t.type&&o.symbolTokenEscapeRe.test(t.value)?e+`'${t.value}'`:e+t.value),"")}function c(e){return"plus"===e||"minus"===e||"multiply"===e||"divide"===e||"power"===e}function u(e){return e.length>1&&e.some((e=>c(e.type)))}function d(e){e=function(e){const t=[];for(const r of e)"whitespace"!==r.type&&t.push(r);return t}(e);const t=[],r=[];let n;for(let o=0;o<e.length;o++){const a=e[o];switch(a.type){case"plus":case"minus":case"multiply":case"divide":case"power":r.length&&r[r.length-1].minPrecedence>a.precedence&&(r[r.length-1].minPrecedence=a.precedence);break;case"openBrace":n={minPrecedence:1/0,openBraceIndex:o},r.push(n);break;case"closeBrace":{if(n=r.pop(),!n)break;const a=e[n.openBraceIndex-1],l=e[o+1],s=a&&("plus"===a.type||"multiply"===a.type);(!c(null==l?void 0:l.type)||(null==l?void 0:l.precedence)<=n.minPrecedence)&&(!c(null==a?void 0:a.type)||(null==a?void 0:a.precedence)<(null==n?void 0:n.minPrecedence)||(null==a?void 0:a.precedence)===(null==n?void 0:n.minPrecedence)&&s)&&(t.unshift(n.openBraceIndex),t.push(o),r.length&&r[r.length-1].minPrecedence>n.minPrecedence&&(r[r.length-1].minPrecedence=n.minPrecedence))}}}for(let r=t.length;r--;)e.splice(t[r],1);return e}function m(e){return d((0,o.tokenize)(e)).reduce(((e,t)=>{if("symbol"!==t.type)return e+t.value;const[,r]=h(t);return r?e+r:e}),"")}function p(e){const t=function(e){const t=(0,o.tokenize)(e),r=[];return t.forEach((e=>{if("symbol"!==e.type)return;const[t]=h(e);t&&r.push(t)})),r}(e);if(1===t.length)return t[0]}function h(e){const t=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i.exec(e.value)
|
||||
;return null===t?[void 0,void 0]:[t[1],t[2]]}function g(e,t,r){const n=e.value,[l,s]=v(e,r),i=(0,a.getSymbolFullName)(t),c=o.symbolTokenEscapeRe.test(i)?`'${i}'`:i;return[n.substring(0,s)+c+n.substring(s+l.length),s+c.length]}function v(e,t){const{value:r,selectionStart:n}=e,a=(0,o.tokenize)(t?r.toUpperCase():r),l=function(e,t){for(let r=0;r<e.length;r++){const n=e[r],o="symbol"===n.type||"incompleteSymbol"===n.type||"number"===n.type;if(n.offset<=t&&t<=n.offset+n.value.length&&o)return n}return null}(a,n||0);return[(null==l?void 0:l.value)||"",l?l.offset:r.length,a]}},81319:(e,t,r)=>{"use strict";r.d(t,{createGroupColumns:()=>p,exchangeSelectDisabled:()=>m,getAllSymbolTypesValue:()=>d,getAvailableSearchSources:()=>c,getAvailableSymbolTypes:()=>u,getDefaultSearchSource:()=>i,getSymbolFullName:()=>s,isSeparateSymbolSearchTabs:()=>h});var n=r(11542),o=r(20882);class a{constructor(e){this._exchange=e}value(){return this._exchange.value}name(){return(0,o.isAllSearchSourcesSelected)(this)?n.t(null,void 0,r(64498)):this._exchange.name}description(){return this._exchange.desc}country(){return this._exchange.country}providerId(){return this._exchange.providerId}group(){return this._exchange.group}includes(e){return function(e,t){const r=t.toLowerCase(),{name:n,desc:o,searchTerms:a}=e;return n.toLowerCase().includes(r)||o.toLowerCase().includes(r)||void 0!==a&&a.some((e=>e.toLowerCase().includes(r)))}(this._exchange,e)}getRequestExchangeValue(){return this._exchange.value}getRequestCountryValue(){}}var l=r(3685);function s(e){if(e.fullName)return e.fullName;let t;return t=e.prefix||e.exchange?(e.prefix||e.exchange)+":"+e.name:e.name,t.replace(/<\/?[^>]+(>|$)/g,"")}function i(){const e=c();return e.find(o.isAllSearchSourcesSelected)||e[0]||null}function c(){return(0,o.createSearchSources)(a,(0,l.getExchanges)())}function u(){return window.ChartApiInstance.supportedSymbolsTypes()}function d(){return""}function m(e){return!!h&&!TAB_SOURCE_FILTER_MAP[e]}function p(e,t=2){if(0===e.length)return[];if(1===t)return[e];const r=Math.floor(e.length/2)+e.length%2;return[e.slice(0,r),e.slice(r)].filter((e=>e.length>0))}const h=!1},82708:(e,t,r)=>{"use strict";r.d(t,{safeShortName:()=>o});var n=r(79982);function o(e){try{return(0,n.shortName)(e)}catch(t){return e}}},44254:(e,t,r)=>{"use strict";r.d(t,{symbolTokenEscapeRe:()=>l,tokenize:()=>c});var n=r(14483),o=r(18429);const a=n.enabled("charting_library_base")?/(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^])(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:.&])*|'.+?'/:/(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF])(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:.&])*|'.+?'/,l=/[+\-/*]/,s={number:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:.&]))|\.\d+/,incompleteNumber:/\./,symbol:a,incompleteSymbol:/'[^']*/,separatorPrefix:o.SEPARATOR_PREFIX,openBrace:"(",closeBrace:")",plus:"+",minus:"-",multiply:"*",divide:"/",power:"^",whitespace:/[\0-\x20\s]+/,unparsed:null},i=new RegExp(Object.values(s).map((e=>{return null===e?"":`(${"string"==typeof e?(t=e,
|
||||
t.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&")):e.source})`;var t})).filter((e=>""!==e)).concat(".").join("|"),"g");function c(e){if(!e)return[];const t=[],r=Object.keys(s);let n;for(;n=i.exec(e);){let e=!1;for(let o=r.length;o--;)if(n[o+1]){r[o]&&t.push({value:n[o+1],type:r[o],precedence:0,offset:n.index}),e=!0;break}e||t.push({value:n[0],type:"unparsed",precedence:0,offset:n.index})}return t}},93251:(e,t,r)=>{"use strict";r.d(t,{removeUsdFromCryptoPairLogos:()=>l,resolveLogoUrls:()=>a});var n=r(36279);const o=(0,n.getLogoUrlResolver)();function a(e,t=n.LogoSize.Medium){const r=e.logoid,a=e["base-currency-logoid"],l=e["currency-logoid"],s=r&&o.getSymbolLogoUrl(r,t);if(s)return[s];const i=a&&o.getSymbolLogoUrl(a,t),c=l&&o.getSymbolLogoUrl(l,t);return i&&c?[i,c]:i?[i]:c?[c]:[]}function l(e){return 2!==e.length?e:function(e){return e.some((e=>s(e)))}(e)&&!function(e){return e.some((e=>e.includes("country")&&!s(e)))}(e)?e.filter((e=>!s(e))):e}function s(e){return!1}},44747:(e,t,r)=>{"use strict";r.d(t,{getBlockStyleClasses:()=>o,getLogoStyleClasses:()=>a});var n=r(97754);function o(e,t){return n("tv-circle-logo-pair",`tv-circle-logo-pair--${e}`,t)}function a(e,t){return n("tv-circle-logo-pair__logo",`tv-circle-logo-pair__logo--${e}`,!t&&"tv-circle-logo-pair__logo-empty")}},76068:(e,t,r)=>{"use strict";r.d(t,{CircleLogo:()=>l,hiddenCircleLogoClass:()=>a});var n=r(50959),o=r(58492);r(45300);const a="tv-circle-logo--visually-hidden";function l(e){var t,r;const a=(0,o.getStyleClasses)(e.size,e.className),l=null!==(r=null!==(t=e.alt)&&void 0!==t?t:e.title)&&void 0!==r?r:"";return(0,o.isCircleLogoWithUrlProps)(e)?n.createElement("img",{className:a,crossOrigin:"",src:e.logoUrl,alt:l,title:e.title,loading:e.loading,"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]}):n.createElement("span",{className:a,title:e.title,"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]},e.placeholderLetter)}},58492:(e,t,r)=>{"use strict";r.d(t,{getStyleClasses:()=>o,isCircleLogoWithUrlProps:()=>a});var n=r(97754);function o(e,t){return n("tv-circle-logo",`tv-circle-logo--${e}`,t)}function a(e){return"logoUrl"in e&&void 0!==e.logoUrl&&0!==e.logoUrl.length}},19785:(e,t,r)=>{"use strict";r.d(t,{createRegExpList:()=>a,getHighlightedChars:()=>l,rankedSearch:()=>o});var n=r(1722);function o(e){const{data:t,rules:r,queryString:o,isPreventedFromFiltering:a,primaryKey:l,secondaryKey:s=l,optionalPrimaryKey:i,tertiaryKey:c}=e;return t.map((e=>{const t=i&&e[i]?e[i]:e[l],a=e[s],u=c&&e[c];let d,m=0;return r.forEach((e=>{var r,l,s,i,c;const{re:p,fullMatch:h}=e;if(p.lastIndex=0,(0,n.isString)(t)&&t&&t.toLowerCase()===o.toLowerCase())return m=4,void(d=null===(r=t.match(h))||void 0===r?void 0:r.index);if((0,n.isString)(t)&&h.test(t))return m=3,void(d=null===(l=t.match(h))||void 0===l?void 0:l.index);if((0,n.isString)(a)&&h.test(a))return m=2,void(d=null===(s=a.match(h))||void 0===s?void 0:s.index);if((0,n.isString)(a)&&p.test(a))return m=2,void(d=null===(i=a.match(p))||void 0===i?void 0:i.index)
|
||||
;if(Array.isArray(u))for(const e of u)if(h.test(e))return m=1,void(d=null===(c=e.match(h))||void 0===c?void 0:c.index)})),{matchPriority:m,matchIndex:d,item:e}})).filter((e=>a||e.matchPriority)).sort(((e,t)=>{if(e.matchPriority<t.matchPriority)return 1;if(e.matchPriority>t.matchPriority)return-1;if(e.matchPriority===t.matchPriority){if(void 0===e.matchIndex||void 0===t.matchIndex)return 0;if(e.matchIndex>t.matchIndex)return 1;if(e.matchIndex<t.matchIndex)return-1}return 0})).map((({item:e})=>e))}function a(e,t){const r=[],n=e.toLowerCase(),o=e.split("").map(((e,t)=>`(${0!==t?`[/\\s-]${s(e)}`:s(e)})`)).join("(.*?)")+"(.*)";return r.push({fullMatch:new RegExp(`(${s(e)})`,"i"),re:new RegExp(`^${o}`,"i"),reserveRe:new RegExp(o,"i"),fuzzyHighlight:!0}),t&&t.hasOwnProperty(n)&&r.push({fullMatch:t[n],re:t[n],fuzzyHighlight:!1}),r}function l(e,t,r){const n=[];return e&&r?(r.forEach((e=>{const{fullMatch:r,re:o,reserveRe:a}=e;r.lastIndex=0,o.lastIndex=0;const l=r.exec(t),s=l||o.exec(t)||a&&a.exec(t);if(e.fuzzyHighlight=!l,s)if(e.fuzzyHighlight){let e=s.index;for(let t=1;t<s.length;t++){const r=s[t],o=s[t].length;if(t%2){const t=r.startsWith(" ")||r.startsWith("/")||r.startsWith("-");n[t?e+1:e]=!0}e+=o}}else for(let e=0;e<s[0].length;e++)n[s.index+e]=!0})),n):n}function s(e){return e.replace(/[!-/[-^{-}?]/g,"\\$&")}},24637:(e,t,r)=>{"use strict";r.d(t,{HighlightedText:()=>s});var n=r(50959),o=r(97754),a=r(19785),l=r(75623);function s(e){const{queryString:t,rules:r,text:s,className:i}=e,c=(0,n.useMemo)((()=>(0,a.getHighlightedChars)(t,s,r)),[t,r,s]);return n.createElement(n.Fragment,null,c.length?s.split("").map(((e,t)=>n.createElement(n.Fragment,{key:t},c[t]?n.createElement("span",{className:o(l.highlighted,i)},e):n.createElement("span",null,e)))):s)}},77762:(e,t,r)=>{"use strict";r.d(t,{useEnsuredContext:()=>a});var n=r(50959),o=r(50151);function a(e){return(0,o.ensureNotNull)((0,n.useContext)(e))}},36947:(e,t,r)=>{"use strict";r.d(t,{useForceUpdate:()=>n.useForceUpdate});var n=r(125)},29006:(e,t,r)=>{"use strict";r.d(t,{useResizeObserver:()=>n.useResizeObserver});var n=r(67842)},77975:(e,t,r)=>{"use strict";r.d(t,{useWatchedValueReadonly:()=>o});var n=r(50959);const o=(e,t=!1)=>{const r="watchedValue"in e?e.watchedValue:void 0,o="defaultValue"in e?e.defaultValue:e.watchedValue.value(),[a,l]=(0,n.useState)(r?r.value():o);return(t?n.useLayoutEffect:n.useEffect)((()=>{if(r){l(r.value());const e=e=>l(e);return r.subscribe(e),()=>r.unsubscribe(e)}return()=>{}}),[r]),a}},84877:(e,t,r)=>{"use strict";r.d(t,{MatchMediaMap:()=>l});var n=r(50959),o=r(66783),a=r.n(o);class l extends n.Component{constructor(e){super(e),this._handleMediaChange=()=>{const e=i(this.state.queries,((e,t)=>t.matches));let t=!1;for(const r in e)if(e.hasOwnProperty(r)&&this.state.matches[r]!==e[r]){t=!0;break}t&&this.setState({matches:e})};const{rules:t}=this.props;this.state=s(t)}shouldComponentUpdate(e,t){return!a()(e,this.props)||(!a()(t.rules,this.state.rules)||!a()(t.matches,this.state.matches))}componentDidMount(){this._migrate(null,this.state.queries)}
|
||||
componentDidUpdate(e,t){a()(e.rules,this.props.rules)||this._migrate(t.queries,this.state.queries)}componentWillUnmount(){this._migrate(this.state.queries,null)}render(){return this.props.children(this.state.matches)}static getDerivedStateFromProps(e,t){if(a()(e.rules,t.rules))return null;const{rules:r}=e;return s(r)}_migrate(e,t){null!==e&&i(e,((e,t)=>{t.removeListener(this._handleMediaChange)})),null!==t&&i(t,((e,t)=>{t.addListener(this._handleMediaChange)}))}}function s(e){const t=i(e,((e,t)=>window.matchMedia(t)));return{queries:t,matches:i(t,((e,t)=>t.matches)),rules:{...e}}}function i(e,t){const r={};for(const n in e)e.hasOwnProperty(n)&&(r[n]=t(n,e[n]));return r}},63932:(e,t,r)=>{"use strict";r.d(t,{Spinner:()=>l});var n=r(50959),o=r(97754),a=r(58096);r(83135);function l(e){const t=o(e.className,"tv-spinner","tv-spinner--shown",`tv-spinner--size_${a.spinnerSizeMap[e.size||a.DEFAULT_SIZE]}`);return n.createElement("div",{className:t,style:e.style,role:"progressbar"})}},10381:(e,t,r)=>{"use strict";r.d(t,{ToolWidgetCaret:()=>i});var n=r(50959),o=r(97754),a=r(9745),l=r(34587),s=r(578);function i(e){const{dropped:t,className:r}=e;return n.createElement(a.Icon,{className:o(r,l.icon,{[l.dropped]:t}),icon:s})}},78029:e=>{e.exports={button:"button-GwQQdU8S",hover:"hover-GwQQdU8S",clicked:"clicked-GwQQdU8S",isInteractive:"isInteractive-GwQQdU8S",accessible:"accessible-GwQQdU8S",isGrouped:"isGrouped-GwQQdU8S",isActive:"isActive-GwQQdU8S",isOpened:"isOpened-GwQQdU8S",isDisabled:"isDisabled-GwQQdU8S",text:"text-GwQQdU8S",icon:"icon-GwQQdU8S",endIcon:"endIcon-GwQQdU8S"}},31409:(e,t,r)=>{"use strict";r.d(t,{DEFAULT_TOOL_WIDGET_BUTTON_THEME:()=>s,ToolWidgetButton:()=>i});var n=r(50959),o=r(97754),a=r(9745),l=r(78029);const s=l,i=n.forwardRef(((e,t)=>{const{tag:r="div",icon:s,endIcon:i,isActive:c,isOpened:u,isDisabled:d,isGrouped:m,isHovered:p,isClicked:h,onClick:g,text:v,textBeforeIcon:f,title:y,theme:b=l,className:S,forceInteractive:x,inactive:w,"data-name":k,"data-tooltip":C,...E}=e,I=o(S,b.button,(y||C)&&"apply-common-tooltip",{[b.isActive]:c,[b.isOpened]:u,[b.isInteractive]:(x||Boolean(g))&&!d&&!w,[b.isDisabled]:Boolean(d||w),[b.isGrouped]:m,[b.hover]:p,[b.clicked]:h}),L=s&&("string"==typeof s?n.createElement(a.Icon,{className:b.icon,icon:s}):n.cloneElement(s,{className:o(b.icon,s.props.className)}));return"button"===r?n.createElement("button",{...E,ref:t,type:"button",className:o(I,b.accessible),disabled:d&&!w,onClick:g,title:y,"data-name":k,"data-tooltip":C},f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),L,!f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v)):n.createElement("div",{...E,ref:t,"data-role":"button",className:I,onClick:d?void 0:g,title:y,"data-name":k,"data-tooltip":C},f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),L,!f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),i&&n.createElement(a.Icon,{icon:i,className:l.endIcon}))}))},24658:(e,t,r)=>{"use strict";r.d(t,{VISIBLE_TYPESPECS:()=>l,marketType:()=>s});var n=r(11542)
|
||||
;const o=new Map([["cfd",n.t(null,void 0,r(87592))],["dr",n.t(null,void 0,r(67245))],["index",n.t(null,void 0,r(12754))],["forex",n.t(null,void 0,r(39512))],["right",n.t(null,{context:"symbol_type"},r(9898))],["bond",n.t(null,void 0,r(79852))],["bitcoin",n.t(null,void 0,r(8448))],["crypto",n.t(null,void 0,r(8448))],["economic",n.t(null,void 0,r(88720))],["indices",n.t(null,void 0,r(60804))],["futures",n.t(null,void 0,r(81859))],["stock",n.t(null,void 0,r(36931))],["commodity",n.t(null,void 0,r(12629))]]);r(42053);const a=new Map,l=new Set(["cfd","spreadbet","defi","yield","government","corporate","mutual","money","etf","unit","trust","reit","etn","convertible","closedend","crypto","oracle"]);function s(e,t=[],r=!0){const n=t.filter((e=>l.has(e))),s=`${e}_${n.sort().join("_")}`,i=a.get(s);if(void 0!==i)return i;const c=r?function(e){return o.get(e)||e}(e):e,u=Boolean(t.length)?[c,...n].join(" "):c;return a.set(s,u),u}},2948:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3.92 7.83 9 12.29l5.08-4.46-1-1.13L9 10.29l-4.09-3.6-.99 1.14Z"/></svg>'},52019:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M13.35 5.35a.5.5 0 0 0-.7-.7L9 8.29 5.35 4.65a.5.5 0 1 0-.7.7L8.29 9l-3.64 3.65a.5.5 0 0 0 .7.7L9 9.71l3.65 3.64a.5.5 0 0 0 .7-.7L9.71 9l3.64-3.65z"/></svg>'},95694:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M17 22.5 6.85 12.35a.5.5 0 0 1 0-.7L17 1.5"/></svg>'},49498: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" stroke-linecap="round" stroke-width="1.2" d="M12 16.5 4.85 9.35a.5.5 0 0 1 0-.7L12 1.5"/></svg>'},60176:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M9.5 12.5 3.9 7.37a.5.5 0 0 1 0-.74L9.5 1.5"/></svg>'},35369:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M8 10.5 3.85 6.35a.5.5 0 0 1 0-.7L8 1.5"/></svg>'},58478:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M7 8.5 3.85 5.35a.5.5 0 0 1 0-.7L7 1.5"/></svg>'},73063:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M17 22.5 6.85 12.35a.5.5 0 0 1 0-.7L17 1.5"/></svg>'},14127:e=>{
|
||||
largeSpinner:"largeSpinner-dlewR1s1"}},85544:e=>{e.exports={search:"search-ZXzPWcCf",upperCase:"upperCase-ZXzPWcCf",withFilters:"withFilters-ZXzPWcCf",withButton:"withButton-ZXzPWcCf",symbolType:"symbolType-ZXzPWcCf",spinnerWrap:"spinnerWrap-ZXzPWcCf",emptyText:"emptyText-ZXzPWcCf",emptyIcon:"emptyIcon-ZXzPWcCf",noResultsDesktop:"noResultsDesktop-ZXzPWcCf",brokerButtonWrap:"brokerButtonWrap-ZXzPWcCf",brokerButton:"brokerButton-ZXzPWcCf"}},14444:e=>{e.exports={flagWrap:"flagWrap-QKnxaZOG",icon:"icon-QKnxaZOG",caret:"caret-QKnxaZOG",title:"title-QKnxaZOG",button:"button-QKnxaZOG",withFlag:"withFlag-QKnxaZOG",buttonContent:"buttonContent-QKnxaZOG"}},62393:e=>{e.exports={dialog:"dialog-u2dP3kv1",tabletDialog:"tabletDialog-u2dP3kv1",desktopDialog:"desktopDialog-u2dP3kv1",backButton:"backButton-u2dP3kv1"}},54638:e=>{e.exports={childrenWrapper:"childrenWrapper-_RhDhmVQ",container:"container-_RhDhmVQ"}},88389:e=>{e.exports={bubbles:"bubbles-Ie7o2cas",multiLine:"multiLine-Ie7o2cas",bubble:"bubble-Ie7o2cas"}},61371:e=>{e.exports={bubble:"bubble-zcjhaZ_y",animated:"animated-zcjhaZ_y",content:"content-zcjhaZ_y","appearance-default":"appearance-default-zcjhaZ_y",active:"active-zcjhaZ_y",gray:"gray-zcjhaZ_y",red:"red-zcjhaZ_y",blue:"blue-zcjhaZ_y",green:"green-zcjhaZ_y",orange:"orange-zcjhaZ_y",purple:"purple-zcjhaZ_y",cyan:"cyan-zcjhaZ_y",pink:"pink-zcjhaZ_y","appearance-text":"appearance-text-zcjhaZ_y","fontSize-s":"fontSize-s-zcjhaZ_y","fontSize-m":"fontSize-m-zcjhaZ_y","size-m":"size-m-zcjhaZ_y","size-l":"size-l-zcjhaZ_y"}},82112:e=>{e.exports={}},45300:e=>{e.exports={}},75623:e=>{e.exports={highlighted:"highlighted-cwp8YRo6"}},34587:e=>{e.exports={icon:"icon-WB2y0EnP",dropped:"dropped-WB2y0EnP"}},18429:(e,t,r)=>{"use strict";r.d(t,{SEPARATOR_PREFIX:()=>n,isSeparatorItem:()=>o});const n="###";function o(e){return e.startsWith(n)}},48199:(e,t,r)=>{"use strict";r.d(t,{BackButton:()=>v});var n=r(50959),o=r(64388),l=r(95694),a=r(49498),s=r(60176),i=r(35369),c=r(58478),u=r(73063),d=r(14127),m=r(18073),p=r(99243),h=r(42576);function g(e="large",t="1.2"){switch(e){case"large":return"1.2"===t?l:u;case"medium":return"1.2"===t?a:d;case"small":return"1.2"===t?s:m;case"xsmall":return"1.2"===t?i:p;case"xxsmall":return"1.2"===t?c:h;default:return a}}const v=n.forwardRef(((e,t)=>{const{"aria-label":r,flipIconOnRtl:l,...a}=e;return n.createElement(o.NavButton,{...a,"aria-label":r,ref:t,icon:g(e.size,e.iconStrokeWidth),flipIconOnRtl:l})}))},27011:(e,t,r)=>{"use strict";function n(e,t){return t||null==e||("string"==typeof e||Array.isArray(e))&&0===e.length}r.d(t,{isIconOnly:()=>n})},14543:(e,t,r)=>{"use strict";r.d(t,{LightButton:()=>n.LightButton});r(8025);var n=r(15893);r(50959),r(21593)},8025:(e,t,r)=>{"use strict";r.d(t,{LightButtonContent:()=>g,useLightButtonClasses:()=>h});var n=r(50959),o=r(97754),l=r(34094),a=r(9745),s=r(17946),i=r(27011),c=r(86332);const u=n.createContext({isInButtonGroup:!1,isGroupPrimary:!1});var d=r(2948),m=r(58222),p=r.n(m);const h=(e,t)=>{const r=(0,n.useContext)(s.CustomBehaviourContext),l=(0,
|
||||
n.useContext)(c.ControlGroupContext),{isInButtonGroup:a,isGroupPrimary:d}=(0,n.useContext)(u),{className:m,isSelected:h,children:g,startIcon:v,showCaret:f,endIcon:y,forceDirection:b,iconOnly:S,color:x="gray",variant:w="primary",size:k="medium",enableActiveStateStyles:C=r.enableActiveStateStyles,typography:E,isLink:I=!1,textWrap:L,isPills:T,isActive:R}=e,N=p()[`typography-${((e,t,r)=>{if(r){const e=r.replace(/^\D+/g,"");return t?`semibold${e}`:r}return"xsmall"===e?t?"semibold14px":"regular14px":"small"===e||"medium"===e?t?"semibold16px":"regular16px":""})(k,h||T,E||void 0)}`];return o(m,p()["light-button"],I&&p().link,R&&p().active,h&&p().selected,(0,i.isIconOnly)(g,S)&&p()["no-content"],v&&p()["with-start-icon"],(f||y)&&p()["with-end-icon"],t&&p()["with-grouped"],b&&p()[`force-direction-${b}`],p()[`variant-${d?"primary":w}`],p()[`color-${d?"gray":x}`],p()[`size-${k}`],N,!C&&p()["disable-active-state-styles"],l.isGrouped&&p().grouped,L&&p().wrap,a&&p()["disable-active-on-touch"],T&&p().pills)};function g(e){const{startIcon:t,endIcon:r,showCaret:s,iconOnly:c,ellipsis:u=!0,textWrap:m,tooltipText:h,children:g}=e;return n.createElement(n.Fragment,null,t&&n.createElement(a.Icon,{className:p().icon,icon:t}),!(0,i.isIconOnly)(g,c)&&n.createElement("span",{className:o(p().content,!m&&p().nowrap,"apply-overflow-tooltip","apply-overflow-tooltip--check-children-recursively","apply-overflow-tooltip--allow-text"),"data-overflow-tooltip-text":null!=h?h:(0,l.getTextForTooltip)(g)},m||u?n.createElement(n.Fragment,null,n.createElement("span",{className:o(!m&&u&&p()["ellipsis-container"],m&&p()["text-wrap-container"],m&&u&&p()["text-wrap-with-ellipsis"])},g),n.createElement("span",{className:p()["visually-hidden"],"aria-hidden":!0},g)):n.createElement(n.Fragment,null,g,n.createElement("span",{className:p()["visually-hidden"],"aria-hidden":!0},g))),(r||s)&&(e=>n.createElement(a.Icon,{className:o(p().icon,e.showCaret&&p().caret),icon:e.showCaret?d:e.endIcon}))(e))}},15893:(e,t,r)=>{"use strict";r.d(t,{LightButton:()=>a});var n=r(50959),o=r(86332),l=r(8025);function a(e){const{isGrouped:t}=n.useContext(o.ControlGroupContext),{reference:r,className:a,isSelected:s,children:i,startIcon:c,iconOnly:u,ellipsis:d,showCaret:m,forceDirection:p,endIcon:h,color:g,variant:v,size:f,enableActiveStateStyles:y,typography:b,textWrap:S=!1,maxLines:x,style:w={},isPills:k,isActive:C,tooltipText:E,...I}=e,L=S?null!=x?x:2:1,T=L>0?{...w,"--ui-lib-light-button-content-max-lines":L}:w;return n.createElement("button",{...I,className:(0,l.useLightButtonClasses)({className:a,isSelected:s,children:i,startIcon:c,iconOnly:u,showCaret:m,forceDirection:p,endIcon:h,color:g,variant:v,size:f,enableActiveStateStyles:y,typography:b,textWrap:S,isPills:k,isActive:C},t),ref:r,style:T},n.createElement(l.LightButtonContent,{showCaret:m,startIcon:c,endIcon:h,iconOnly:u,ellipsis:d,textWrap:S,tooltipText:E},i))}},86332:(e,t,r)=>{"use strict";r.d(t,{ControlGroupContext:()=>n});const n=r(50959).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},
|
||||
17946:(e,t,r)=>{"use strict";r.d(t,{CustomBehaviourContext:()=>n});const n=(0,r(50959).createContext)({enableActiveStateStyles:!0});n.displayName="CustomBehaviourContext"},125:(e,t,r)=>{"use strict";r.d(t,{useForceUpdate:()=>o});var n=r(50959);const o=()=>{const[,e]=(0,n.useReducer)((e=>e+1),0);return e}},39416:(e,t,r)=>{"use strict";r.d(t,{useFunctionalRefObject:()=>l});var n=r(50959),o=r(43010);function l(e){const t=(0,n.useMemo)((()=>function(e){const t=r=>{e(r),t.current=r};return t.current=null,t}((e=>{s.current(e)}))),[]),r=(0,n.useRef)(null),l=t=>{if(null===t)return a(r.current,t),void(r.current=null);r.current!==e&&(r.current=e,a(r.current,t))},s=(0,n.useRef)(l);return s.current=l,(0,o.useIsomorphicLayoutEffect)((()=>{if(null!==t.current)return s.current(t.current),()=>s.current(null)}),[e]),t}function a(e,t){null!==e&&("function"==typeof e?e(t):e.current=t)}},43010:(e,t,r)=>{"use strict";r.d(t,{useIsomorphicLayoutEffect:()=>o});var n=r(50959);function o(e,t){("undefined"==typeof window?n.useEffect:n.useLayoutEffect)(e,t)}},86781:(e,t,r)=>{"use strict";r.d(t,{useMatchMedia:()=>l,useSafeMatchMedia:()=>o});var n=r(50959);function o(e,t=!1){const[r,o]=(0,n.useState)(t);return(0,n.useEffect)((()=>{const t=window.matchMedia(e);function r(){o(t.matches)}return r(),t.addListener(r),()=>{t.removeListener(r)}}),[e]),r}function l(e){const t=(0,n.useMemo)((()=>window.matchMedia(e).matches),[]);return o(e,t)}},27267:(e,t,r)=>{"use strict";function n(e,t,r,n,o){function l(o){if(e>o.timeStamp)return;const l=o.target;void 0!==r&&null!==t&&null!==l&&l.ownerDocument===n&&(t.contains(l)||r(o))}return o.click&&n.addEventListener("click",l,!1),o.mouseDown&&n.addEventListener("mousedown",l,!1),o.touchEnd&&n.addEventListener("touchend",l,!1),o.touchStart&&n.addEventListener("touchstart",l,!1),()=>{n.removeEventListener("click",l,!1),n.removeEventListener("mousedown",l,!1),n.removeEventListener("touchend",l,!1),n.removeEventListener("touchstart",l,!1)}}r.d(t,{addOutsideEventListener:()=>n})},67842:(e,t,r)=>{"use strict";r.d(t,{useResizeObserver:()=>s});var n=r(50959),o=r(59255),l=r(43010),a=r(39416);function s(e,t=[]){const{callback:r,ref:s=null}=function(e){return"function"==typeof e?{callback:e}:e}(e),i=(0,n.useRef)(null),c=(0,n.useRef)(r);c.current=r;const u=(0,a.useFunctionalRefObject)(s),d=(0,n.useCallback)((e=>{u(e),null!==i.current&&(i.current.disconnect(),null!==e&&i.current.observe(e))}),[u,i]);return(0,l.useIsomorphicLayoutEffect)((()=>(i.current=new o.default(((e,t)=>{c.current(e,t)})),u.current&&d(u.current),()=>{var e;null===(e=i.current)||void 0===e||e.disconnect()})),[u,...t]),d}},90186:(e,t,r)=>{"use strict";function n(e){return l(e,a)}function o(e){return l(e,s)}function l(e,t){const r=Object.entries(e).filter(t),n={};for(const[e,t]of r)n[e]=t;return n}function a(e){const[t,r]=e;return 0===t.indexOf("data-")&&"string"==typeof r}function s(e){return 0===e[0].indexOf("aria-")}r.d(t,{filterAriaProps:()=>o,filterDataProps:()=>n,filterProps:()=>l,isAriaAttribute:()=>s,isDataAttribute:()=>a})},34094:(e,t,r)=>{
|
||||
"use strict";r.d(t,{getTextForTooltip:()=>a});var n=r(50959);const o=e=>(0,n.isValidElement)(e)&&Boolean(e.props.children),l=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString()+" ",a=e=>Array.isArray(e)||(0,n.isValidElement)(e)?n.Children.toArray(e).reduce(((e,t)=>{let r="";return r=(0,n.isValidElement)(t)&&o(t)?a(t.props.children):(0,n.isValidElement)(t)&&!o(t)?"":l(t),e.concat(r)}),"").trim():l(e)},76460:(e,t,r)=>{"use strict";function n(e){return 0===e.detail}r.d(t,{isKeyboardClick:()=>n})},3685:(e,t,r)=>{"use strict";function n(){var e,t,r;return null!==(r=null===(t=null===(e=window.configurationData)||void 0===e?void 0:e.exchanges)||void 0===t?void 0:t.map((e=>({...e,country:"",providerId:"",flag:""}))))&&void 0!==r?r:[]}r.d(t,{getExchanges:()=>n})},36279:(e,t,r)=>{"use strict";var n;r.d(t,{LogoSize:()=>n,getLogoUrlResolver:()=>a}),function(e){e[e.Medium=0]="Medium",e[e.Large=1]="Large"}(n||(n={}));class o{getSymbolLogoUrl(e){return e}getCountryFlagUrl(){return""}getCryptoLogoUrl(e){return e}getProviderLogoUrl(e){return e}getSourceLogoUrl(e){return e}}let l;function a(){return l||(l=new o),l}},24437:(e,t,r)=>{"use strict";r.d(t,{DialogBreakpoints:()=>o});var n=r(88803);const o={SmallHeight:n["small-height-breakpoint"],TabletSmall:n["tablet-small-breakpoint"],TabletNormal:n["tablet-normal-breakpoint"]}},69654:(e,t,r)=>{"use strict";r.d(t,{DialogSearch:()=>u});var n=r(50959),o=r(97754),l=r.n(o),a=r(11542),s=r(9745),i=r(69859),c=r(40281);function u(e){const{children:t,renderInput:o,onCancel:u,containerClassName:m,inputContainerClassName:p,iconClassName:h,...g}=e;return n.createElement("div",{className:l()(c.container,m)},n.createElement("div",{className:l()(c.inputContainer,p,u&&c.withCancel)},o||n.createElement(d,{...g})),t,n.createElement(s.Icon,{className:l()(c.icon,h),icon:i}),u&&n.createElement("div",{className:c.cancel,onClick:u},a.t(null,void 0,r(20036))))}function d(e){const{className:t,reference:r,value:o,onChange:a,onFocus:s,onBlur:i,onKeyDown:u,onSelect:d,placeholder:m,...p}=e;return n.createElement("input",{...p,ref:r,type:"text",className:l()(t,c.input),autoComplete:"off","data-role":"search",placeholder:m,value:o,onChange:a,onFocus:s,onBlur:i,onSelect:d,onKeyDown:u})}},17531:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchDialogContentItem:()=>B});var n=r(50959),o=r(97754),l=r.n(o),a=(r(11542),r(50151)),s=r(9745),i=r(14483),c=r(24637),u=r(19785),d=r(84524),m=r(24633),p=r(77975),h=r(45345),g=r(32563),v=r(94474),f=r(93251),y=r(36279),b=r(44747);r(82112);var S=r(76068),x=r(58492),w=r(12767),k=r(43010),C=r(57240);function E(e){const{className:t,placeholderLetter:r,url1:o,url2:a,size:s="xxxsmall"}=e,i=(0,n.useRef)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(null),m=(0,n.useRef)(null),p=(0,n.useRef)(null);return(0,k.useIsomorphicLayoutEffect)((()=>{const e=void 0===o?[]:void 0===a?[o]:[o,a],t=p.current=(r=e,Promise.all(r.map((e=>(0,w.getImage)(`symbol_logo_${e}`,e,L).then((e=>e.cloneNode()))))));var r;t.then((e=>{var r,n,o,l,a,s,h,g,v;if(t===p.current)switch(e.length){
|
||||
case 0:null===(r=u.current)||void 0===r||r.classList.add(C.hidden),null===(n=c.current)||void 0===n||n.classList.add(S.hiddenCircleLogoClass),null===(o=i.current)||void 0===o||o.classList.remove(S.hiddenCircleLogoClass);break;case 1:I(c.current,e[0]),null===(l=u.current)||void 0===l||l.classList.add(C.hidden),null===(a=c.current)||void 0===a||a.classList.remove(S.hiddenCircleLogoClass),null===(s=i.current)||void 0===s||s.classList.add(S.hiddenCircleLogoClass);break;case 2:I(d.current,e[0]),I(m.current,e[1]),null===(h=u.current)||void 0===h||h.classList.remove(C.hidden),null===(g=c.current)||void 0===g||g.classList.add(S.hiddenCircleLogoClass),null===(v=i.current)||void 0===v||v.classList.add(S.hiddenCircleLogoClass)}}))}),[o,a]),n.createElement("span",{className:l()(t,C.container)},n.createElement("span",{ref:u,className:l()(C.pairContainer,C.hidden)},n.createElement("span",{className:(0,b.getBlockStyleClasses)(s)},n.createElement("span",{ref:m,className:l()(C.logo,(0,b.getLogoStyleClasses)(s))}),n.createElement("span",{ref:d,className:l()(C.logo,(0,b.getLogoStyleClasses)(s))}))),n.createElement("span",{ref:c,className:l()(C.logo,S.hiddenCircleLogoClass,(0,x.getStyleClasses)(s))}),n.createElement("span",{ref:i,className:l()(C.logo,(0,x.getStyleClasses)(s))},n.createElement(S.CircleLogo,{size:s,placeholderLetter:r})))}function I(e,t){e&&(e.innerHTML="",e.appendChild(t))}function L(e){e.crossOrigin="",e.decoding="async"}var T=r(54257);function R(e){const{logoId:t,baseCurrencyLogoId:r,currencyLogoId:o,placeholder:a,className:s,size:i="xsmall"}=e,c=(0,n.useMemo)((()=>{const e={logoid:t,"currency-logoid":o,"base-currency-logoid":r};return(0,f.removeUsdFromCryptoPairLogos)((0,f.resolveLogoUrls)(e,y.LogoSize.Medium))}),[t,o,r]);return n.createElement(E,{key:i,className:l()(T.logo,s),url1:c[0],url2:c[1],placeholderLetter:a,size:i})}var N=r(29562),D=r(69533),_=r(39339);function B(e){var t,r;const{dangerousTitleHTML:o,title:f,dangerousDescriptionHTML:y,description:b,searchToken:S,exchangeName:x,marketType:w,onClick:k,isSelected:C,isEod:E=!1,isActive:I=!1,isOffset:L=!1,invalid:T=!1,isHighlighted:B=!1,hideExchange:M=!1,hideMarkedListFlag:O=!1,onExpandClick:Q,isExpanded:F,hoverComponent:A,country:P,providerId:U,source:z,source2:V,type:W,flag:Z,itemRef:K,onMouseOut:$,onMouseOver:j,className:G,actions:q,reference:Y,fullSymbolName:H,logoId:X,currencyLogoId:J,baseCurrencyLogoId:ee,shortName:te,hideLogo:re=!1,exchangeTooltip:ne,hideMarketType:oe,isPrimary:le}=e,{isSmallWidth:ae,isMobile:se}=(0,a.ensureNotNull)((0,n.useContext)(d.SymbolSearchItemsDialogContext)),ie=Boolean(A),ce=!T&&!M&&(se||!ie),ue=(0,p.useWatchedValueReadonly)({watchedValue:h.watchedTheme})===m.StdTheme.Dark?_.dark:_.light,de=A,me=i.enabled("show_symbol_logos"),pe=i.enabled("show_exchange_logos"),he=me||!1,ge=null!==(t=null==V?void 0:V.description)&&void 0!==t?t:z,ve=null!==(r=null==V?void 0:V.name)&&void 0!==r?r:z;return n.createElement("div",{
|
||||
className:l()(_.itemRow,ae&&_.multiLine,B&&_.highlighted,B&&ue,C&&_.selected,I&&_.active,T&&_.invalid,!se&&g.mobiletouch&&ie&&_.hover,G),onClick:function(e){if(!k||e.defaultPrevented)return;e.preventDefault(),k(e)},"data-role":e["data-role"]||"list-item","data-active":I,"data-type":w,"data-name":"symbol-search-dialog-content-item",onMouseOut:$,onMouseOver:j,ref:Y},n.createElement("div",{ref:K,className:l()(_.itemInfoCell,_.cell,L&&_.offset)},n.createElement("div",{className:l()(_.actionHandleWrap,!he&&_.fixedWidth)},n.createElement(n.Fragment,null,!1,Q&&n.createElement("div",{onClick:function(e){if(!Q||e.defaultPrevented)return;e.preventDefault(),Q(e)}},n.createElement(s.Icon,{className:l()(_.expandHandle,F&&_.expanded,C&&_.selected),icon:D})),he&&!L&&n.createElement("div",{className:l()(_.logo,Boolean(Q)&&_.isExpandable)},n.createElement(R,{key:H,logoId:X,currencyLogoId:J,baseCurrencyLogoId:ee,placeholder:te?te[0]:void 0})))),n.createElement("div",{className:l()(_.description,he&&L&&_.offset)},f&&n.createElement("div",{className:l()(_.symbolTitle,I&&_.active,T&&_.invalid,!Boolean(y)&&_.noDescription),"data-name":"list-item-title"},"string"==typeof f&&S?n.createElement(c.HighlightedText,{className:_.highlightedText,text:f,queryString:S,rules:(0,u.createRegExpList)(S)}):f,E&&n.createElement("span",{className:_.dataMode},"E")),!f&&o&&n.createElement("div",{className:l()(_.symbolTitle,I&&_.active,T&&_.invalid),"data-name":"list-item-title"},n.createElement("span",{dangerouslySetInnerHTML:{__html:o}}),E&&n.createElement("span",{className:_.dataMode},"E")),ae&&fe())),!ae&&n.createElement("div",{className:l()(_.cell,_.descriptionCell,Boolean(de)&&_.addition)},fe(),de?n.createElement(de,{...e,className:_.actions,onMouseOver:void 0,onMouseOut:void 0}):null),ae&&de?n.createElement(de,{...e,className:_.cell,onMouseOver:void 0,onMouseOut:void 0}):null,ce&&n.createElement("div",{className:l()(_.exchangeCell,_.cell)},n.createElement("div",{className:l()(_.exchangeDescription)},!oe&&n.createElement("div",{className:l()(_.marketType,I&&_.active)},w),n.createElement("div",{className:_.source},!1,"economic"===W&&ge&&ve?n.createElement("div",{className:l()(_.exchangeName,I&&_.active,"apply-common-tooltip",_.narrow,oe&&_.wide),title:ge},ve):n.createElement("div",{className:l()(_.exchangeName,I&&_.active,ne&&"apply-common-tooltip"),title:ne},x))),pe&&n.createElement("div",{className:_.flag},n.createElement(N.SymbolSearchFlag,{key:pe?`${H}_exchange`:`${P}_${U}_${null==V?void 0:V.id}_${W}_${Z}`,className:_.icon,country:P,providerId:U,sourceId:"economic"===W&&V?V.id:void 0}))),n.createElement("div",{className:l()(_.cell,Boolean(q)&&_.actionsCell)},q));function fe(){if(T)return null;const e=l()(_.symbolDescription,I&&_.active,!g.mobiletouch&&"apply-overflow-tooltip apply-overflow-tooltip--allow-text");return b?n.createElement("div",{className:e},S?n.createElement(c.HighlightedText,{className:_.highlightedText,text:b,queryString:S,rules:(0,u.createRegExpList)(S)}):b):y?n.createElement("div",{"data-overflow-tooltip-text":(0,v.removeTags)(y),
|
||||
className:e,dangerouslySetInnerHTML:{__html:y}}):null}}},29562:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchFlag:()=>v});var n=r(50959),o=r(97754),l=r.n(o),a=r(24633),s=r(36279);const i=r.p+"mock-dark.16b5f3a431f502b03ae3.svg",c=r.p+"mock-light.d201313017eb2c1b989f.svg";function u(e){return e===a.StdTheme.Dark?i:c}var d=r(77975),m=r(45345),p=r(50151);const h=s.LogoSize.Medium;var g=r(33172);function v(e){const{country:t,providerId:r,sourceId:o,className:a}=e,i=(0,d.useWatchedValueReadonly)({watchedValue:m.watchedTheme}),[c,v]=(0,n.useState)(function({country:e,providerId:t,sourceId:r}){const n=(0,s.getLogoUrlResolver)();return o=>{const l=e=>n.getProviderLogoUrl(e,h),a=[{value:r,resolve:l},{value:e,resolve:e=>n.getCountryFlagUrl(e.toUpperCase(),h)},{value:t,resolve:l}].find((({value:e})=>void 0!==e&&e.length>0));return void 0!==a?a.resolve((0,p.ensureDefined)(a.value)):u(o)}}({country:t,providerId:r,sourceId:o})(i));return n.createElement("img",{className:l()(a,g.icon),crossOrigin:"",src:c,onError:function(){v(u(i))}})}},58442:(e,t,r)=>{"use strict";r.d(t,{QualifiedSources:()=>n,qualifyProName:()=>a});var n,o=r(50151),l=r(14483);r(81319);function a(e){return e}!function(e){function t(e){return e.pro_name}function r(e){{const t=l.enabled("pay_attention_to_ticker_not_symbol")?e.ticker:e.full_name;return(0,o.ensureDefined)(t)}}e.fromQuotesSnapshot=function(e){return"error"===e.status?e.symbolname:e.values.pro_name},e.fromQuotesResponse=function(e){const{values:r,symbolname:n,status:o}=e;return"error"===o&&n?n:t(r)},e.fromQuotes=t,e.fromSymbolSearchResult=function(e,t){var r;{const{ticker:n,full_name:a,symbol:s}=null!=t?t:e;return l.enabled("pay_attention_to_ticker_not_symbol")?(0,o.ensureDefined)(null!==(r=null!=n?n:a)&&void 0!==r?r:s):(0,o.ensureDefined)(null!=a?a:s)}},e.fromSymbolInfo=r,e.fromSymbolMessage=function(e,t){return"symbol_resolved"===t.method?r(t.params[1]):e}}(n||(n={}))},20882:(e,t,r)=>{"use strict";r.d(t,{createSearchSources:()=>s,filterSearchSources:()=>l,isAllSearchSourcesSelected:()=>o,splitSearchSourcesByGroup:()=>a});const n=[];function o(e){return""===e.value()}function l(e,t){return e.filter((e=>e.includes(t)))}function a(e){const t=new Map;e.forEach((e=>{t.has(e.group())?t.get(e.group()).push(e):t.set(e.group(),[e])}));for(const e of t.values()){e[0].group()!==ExchangeGroup.NorthAmerica&&e.sort(((e,t)=>e.name().toLowerCase()>t.name().toLowerCase()?1:-1))}return new Map([...t.entries()].sort((([e],[t])=>n.indexOf(e)-n.indexOf(t))))}function s(e,t){return t.map((t=>new e(t)))}},70613:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchDialogBodyContext:()=>n});const n=r(50959).createContext(null)},84524:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchItemsDialogContext:()=>n});const n=r(50959).createContext(null)},22350:(e,t,r)=>{"use strict";r.d(t,{SymbolSearchItemsDialog:()=>je});var n=r(50959),o=r(97754),l=r.n(o),a=r(11542),s=r(15983);const i=["futures","forex","bond","economic"];var c=r(84877),u=r(14483),d=r(24437),m=r(35057),p=r(9745),h=r(86240),g=r(86781),v=r(84524),f=r(69654),y=r(3343),b=r(16838)
|
||||
;function S(e,t,r){return`source-item-${e}-${t}-${r}`}var x=r(20882),w=r(54638);function k(e){const{children:t,className:r}=e;return n.createElement("div",{className:l()(w.container,r)},n.createElement("div",{className:w.childrenWrapper},t))}var C=r(50151),E=r(77762),I=r(24637),L=r(19785),T=r(81319),R=r(91540),N=r(50674);function D(e){const{searchSource:t,onClick:r,queryString:o,isFocused:a,id:s}=e,{symbolSearchContent:i,isAllSearchSourcesSelected:c,allSearchSourcesTitle:u,isMobile:d}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),m=i.currentSelectedSearchSource,h=(0,C.ensureNotNull)(m).value(),g=c(t),f=t.value()===h,y=(0,n.useMemo)((()=>(0,L.createRegExpList)(o)),[o]),b=t.description(),S=b&&!g,x=T.isSeparateSymbolSearchTabs&&g&&u?u:t.name(),w=l()(N.container,d?N.mobile:N.desktop,f&&N.selected,a&&N.focused,g&&N.allSelected,g&&N.libAllSelected,!g&&d&&N.bordered);return n.createElement("div",{className:l()(!d&&N.wrap,g&&N.libAllSelected),onClick:r,id:s},n.createElement("div",{className:w},n.createElement("div",{className:N.iconWrap},!!g&&n.createElement(p.Icon,{className:l()(N.icon,N.allSelectedIcon),icon:R})),n.createElement("div",{className:N.textBlock},n.createElement("div",{className:l()(N.title,!S&&!d&&N.titleWithoutDesc)},n.createElement(I.HighlightedText,{className:l()(f&&N.highlighted),queryString:o,text:x,rules:y})),S&&n.createElement("div",{className:l()(N.description,"apply-overflow-tooltip")},n.createElement(I.HighlightedText,{className:N.highlighted,queryString:o,rules:y,text:b})))))}var _=r(77975),B=r(45345),M=r(26843),O=r(70613),Q=r(66619),F=r(67562),A=r(70699);const P={emptyTextClassName:A.emptyText};function U(e){const{searchSources:t}=e,{setSelectedIndex:o,setSelectedSearchSource:s,setMode:i,isMobile:c,emptyState:u,autofocus:d}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),m=(0,_.useWatchedValueReadonly)({watchedValue:B.watchedTheme})===M.StdTheme.Dark?Q:F,w=(0,g.useMatchMedia)(h["media-phone-vertical"]),[C,I]=(0,n.useState)(""),L=(0,n.useMemo)((()=>[{group:null,sources:(0,T.createGroupColumns)((0,x.filterSearchSources)(t,C),w?1:2)}]),[t,C,w]),R=(0,n.useRef)(null),N=(0,n.useRef)(null),{focusedItem:U,activeDescendant:z,handleKeyDown:V,resetFocusedItem:W}=function(e,t,r){const[o,l]=(0,n.useState)(null),[a,s]=(0,n.useState)("");function i(t){const r=e[t.groupIndex].sources[t.col].length-1;if(t.row===r){const e=d(t.groupIndex+1);if(null===e)return;return t.col>0&&!u({...t,groupIndex:e,row:0})?void l({groupIndex:e,col:0,row:0}):void l({...t,groupIndex:e,row:0})}l({...t,row:t.row+1})}function c(t){var r,n;if(0===t.row){const o=d(t.groupIndex-1,-1);if(null===o)return;const a=null!==(n=null===(r=e[o].sources[t.col])||void 0===r?void 0:r.length)&&void 0!==n?n:0;return 0===a?void l({groupIndex:o,col:0,row:0}):void l({...t,groupIndex:o,row:a-1})}l({...t,row:t.row-1})}function u(t){var r,n;return Boolean(null===(n=null===(r=e[t.groupIndex])||void 0===r?void 0:r.sources[t.col])||void 0===n?void 0:n[t.row])}function d(t=0,r=1){const n=e.length;let o=(t+n)%n;for(;!u({groupIndex:o,col:0,row:0
|
||||
});)if(o=(o+r+n)%n,o===t)return null;return o}return(0,n.useEffect)((()=>{if(!r.current)return;if(!o)return void s("");const e=S(o.groupIndex,o.col,o.row),t=r.current.querySelector(`#${e}`);null==t||t.scrollIntoView({block:"nearest"}),s(e)}),[o]),(0,n.useEffect)((()=>{l(null)}),[t]),{focusedItem:o,activeDescendant:a,handleKeyDown:function(n){if(!r.current)return;const a=(0,y.hashFromEvent)(n);if(32!==a&&13!==a)switch((0,b.mapKeyCodeToDirection)(a)){case"blockNext":if(n.preventDefault(),!o){const e=d();if(null===e)break;l({groupIndex:e,col:0,row:0});break}i(o);break;case"blockPrev":if(n.preventDefault(),!o)break;c(o);break;case"inlineNext":{if(!o||t)break;n.preventDefault();const r=e[o.groupIndex].sources.length;if(o.col===r-1||!u({...o,col:o.col+1})){i({...o,col:0});break}l({...o,col:o.col+1});break}case"inlinePrev":{if(!o||t)break;n.preventDefault();const r=e[o.groupIndex].sources.length;if(0===o.col){if(0!==o.row){c({...o,col:r-1});break}const t=d(o.groupIndex-1,-1);if(null===t)break;const n=e[t].sources.length,a=e[t].sources[0].length;if(!u({groupIndex:t,col:n-1,row:a-1})){c(o);break}l({groupIndex:t,col:n-1,row:a-1});break}l({...o,col:o.col-1});break}}else{if(!o)return;n.preventDefault();const e=r.current.querySelector(`#${S(o.groupIndex,o.col,o.row)}`);e instanceof HTMLElement&&e.click()}},resetFocusedItem:()=>l(null)}}(L,w,N);(0,n.useLayoutEffect)((()=>{var e;d&&(null===(e=null==R?void 0:R.current)||void 0===e||e.focus())}),[]);const Z=u?n.createElement(u,null):n.createElement(k,{className:A.noResultsDesktop},n.createElement(p.Icon,{icon:m,className:A.emptyIcon}),n.createElement("div",{className:A.emptyText},a.t(null,void 0,r(29673)))),K=!(L.length&&L.every((e=>0===e.sources.length)));return n.createElement(O.SymbolSearchDialogBodyContext.Provider,{value:P},n.createElement(f.DialogSearch,{placeholder:a.t(null,void 0,r(52298)),onChange:function(e){W(),I(e.target.value),N&&N.current&&(N.current.scrollTop=0)},reference:R,onKeyDown:V,onBlur:W,"aria-activedescendant":z}),K?n.createElement("div",{ref:N,className:l()(A.contentList,!c&&A.contentListDesktop),onTouchStart:function(){var e;null===(e=R.current)||void 0===e||e.blur()}},L.map(((e,t)=>{const{group:r,sources:o}=e;return 0===o.length?n.createElement(n.Fragment,{key:r}):n.createElement(n.Fragment,{key:r},!1,n.createElement("div",{className:l()(A.searchSourceItemsContainer,!c&&A.searchSourceItemsContainerDesktop,w&&A.oneColumn)},o.map(((e,r)=>n.createElement("div",{key:`${t}-${r}`,className:A.column},e.map(((e,o)=>n.createElement(D,{id:S(t,r,o),isFocused:!!U&&(U.groupIndex===t&&U.col===r&&U.row===o),key:e.value(),searchSource:e,queryString:C,onClick:$.bind(null,e)}))))))))}))):Z);function $(e){s(e),i("symbolSearch"),o(-1)}}var z=r(962),V=r(45884);r(76861),r(69798);function W(e){return e.hasOwnProperty("exchange")}async function Z(e){{const t=await async function(e){return new Promise((t=>{window.ChartApiInstance.searchSymbols(e.text||"",e.exchange||"",e.type||"","",!1,!0,"",!0,"",(e=>{t(e)}))}))}(e);return{symbols:t,symbols_remaining:0}}}
|
||||
new Map([].map((({value:e,search_type:t})=>[e,t])));var K=r(78136),$=r(51768),j=r(68335),G=r(31409),q=r(44254),Y=r(486),H=r(81574),X=r(35119),J=r(32617),ee=r(69135),te=r(63861),re=r(52597);function ne(e){var t;const{state:r,update:o}=e,{searchRef:l,forceUpdate:a,upperCaseEnabled:i}=(0,C.ensureNotNull)((0,n.useContext)(v.SymbolSearchItemsDialogContext)),c=(0,q.tokenize)(null===(t=l.current)||void 0===t?void 0:t.value),d=(0,s.validate)(c);let m=[{icon:Y,insert:"/",type:"binaryOp",name:"division"},{icon:H,insert:"-",type:"binaryOp",name:"subtraction"},{icon:X,insert:"+",type:"binaryOp",name:"addition"},{icon:J,insert:"*",type:"binaryOp",name:"multiplication"}];return u.enabled("hide_exponentiation_spread_operator")||(m=m.concat([{icon:ee,insert:"^",type:"binaryOp",name:"exponentiation"}])),u.enabled("hide_reciprocal_spread_operator")||(m=m.concat([{icon:te,type:"complete",name:"1/x",callback:()=>{!l.current||d.errors.length||d.warnings.length||(l.current.value=(0,s.stringifyTokens)((0,s.flip)(c)),a())}}])),n.createElement("div",{className:re.actions},m.map((e=>n.createElement(G.ToolWidgetButton,{className:re.actionButton,icon:e.icon,key:e.name,isDisabled:oe(e,d),onClick:()=>function(e){var t;if(!oe(e,d)){if(e.insert&&l.current){const t=l.current.value+e.insert;l.current.value=t,l.current.setSelectionRange(t.length,t.length);const[n,,c]=(0,s.getCurrentTokenParamsFromInput)(l.current,i);r.current&&(r.current.selectedIndexValue=-1,r.current.searchSpreadsValue=(0,s.isSpread)(c),r.current.searchTokenValue=n),a(),o()}e.callback&&e.callback(),null===(t=l.current)||void 0===t||t.focus(),(0,$.trackEvent)("GUI","SS",e.name)}}(e)}))))}function oe(e,t){let r=!1;if(!t.errors.length)switch(e.type){case"binaryOp":r="var"===t.currentState;break;case"openBrace":r="var"!==t.currentState;break;case"closeBrace":r="var"===t.currentState&&t.braceBalance>0;break;case"complete":r=!t.errors.length&&!t.warnings.length}return!r}var le=r(90186),ae=r(61371);function se(e){const{title:t,isActive:r,isAnimated:n,activeColor:o,size:a="m",appearance:s="default",fontSize:i="m",grayStyles:c,className:u}=e;return l()(ae.bubble,r&&ae.active,o&&ae[o],t&&"apply-common-tooltip",a&&ae[`size-${a}`],i&&ae[`fontSize-${i}`],s&&ae[`appearance-${s}`],n&&ae.animated,c&&ae.gray,u)}function ie(e){const{id:t,title:r,tabIndex:o,role:a,contentClassName:s,children:i,onClick:c,onMouseDown:u,reference:d,grayStyles:m,...p}=e;return n.createElement("span",{...(0,le.filterAriaProps)(p),...(0,le.filterDataProps)(p),id:t,title:r,tabIndex:o,role:a,className:se(e),onClick:c,onMouseDown:u,ref:d},n.createElement("span",{className:l()(ae.content,s)},i))}var ce=r(88389);function ue(e){const{className:t,itemClassName:r,itemContentClassName:l,items:a,getItemTitle:s,getItemTooltip:i,getItemKey:c,checkItemIsActive:u,getItemColor:d,onBubbleClick:m,multiline:p,children:h,BubbleComponent:g=ie,reference:v,fontSize:f,grayStyles:y}=e;return n.createElement("div",{className:o(t,ce.bubbles,p&&ce.multiLine),ref:v},a.map(((e,t)=>n.createElement(g,{key:c?c(e):t,id:c?c(e):t.toString(),
|
||||
className:o(ce.bubble,r),contentClassName:l,onClick:function(){m(e)},onMouseDown:function(e){e.preventDefault()},isActive:!!u&&u(e),activeColor:d?d(e):void 0,fontSize:f,title:i?i(e):void 0,grayStyles:y},s(e)))),h)}var de=r(63932),me=r(20037),pe=r(29006),he=r(14543),ge=r(10381),ve=r(52019),fe=r(14444);const ye=(0,T.getDefaultSearchSource)();function be(e){const{mode:t,setMode:o,searchRef:s,cachedInputValue:i,setSelectedIndex:c,setSelectedSearchSource:u,isAllSearchSourcesSelected:d,allSearchSourcesTitle:m,upperCaseEnabled:h,symbolSearchContent:g}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),f=g.currentSelectedSearchSource,y=(0,C.ensureNotNull)(f),b="symbolSearch"===t,S=d(y),x=T.isSeparateSymbolSearchTabs&&S&&m?m:y.name(),w=(0,n.useCallback)((()=>{var e;if(T.isSeparateSymbolSearchTabs&&!S&&ye)return u(ye),c(-1),void(null===(e=s.current)||void 0===e||e.focus());s.current&&(i.current=h?s.current.value.toUpperCase():s.current.value),o("exchange")}),[S,s,h,o,u]);return T.isSeparateSymbolSearchTabs?b?n.createElement(he.LightButton,{onClick:w,isPills:!S,size:"xsmall",variant:S?"ghost":"quiet-primary",showCaret:S,endIcon:S?void 0:ve,enableActiveStateStyles:!1,className:l()(fe.button,!S&&fe.withFlag),tabIndex:-1,"data-name":"sources-button"},n.createElement("div",{className:fe.buttonContent},null,n.createElement("span",null,x))):null:b?n.createElement("div",{className:l()(fe.flagWrap,"apply-common-tooltip",!S&&fe.withFlag),title:a.t(null,void 0,r(13269)),onClick:w,"data-name":"sources-button"},S&&n.createElement(p.Icon,{className:fe.icon,icon:R}),null,n.createElement("div",{className:l()(fe.title)},x),n.createElement(ge.ToolWidgetCaret,{className:fe.caret,dropped:!1})):null}var Se=r(37796);function xe(e){const{brokerButton:t=null}=e,{isSmallWidth:o,selectedFilterValues:s,setSelectedFilterValues:i,setSelectedIndex:c,isMobile:u,searchRef:d,symbolSearchContent:m}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),p=m.tabSelectFilters;return T.isSeparateSymbolSearchTabs?n.createElement("div",{className:l()(Se.wrap,Se.small,Se.newStyles,u&&Se.mobile)},t&&n.createElement("div",{className:Se.brokerWrap},t),m.canChangeExchange&&n.createElement("div",{className:Se.filterItem},n.createElement(be,null)),p&&p.map((e=>{const{id:t,options:r,label:o}=e,l=r.find((e=>e.value===FILTER_DEFAULT_VALUE));if(!l)throw new Error("There must be default filter value in filter definition");const a=r.find((e=>{var r;return e.value===(null===(r=s[m.currentSymbolType])||void 0===r?void 0:r[t])}))||l;return n.createElement("div",{key:t,className:Se.filterItem},n.createElement(SymbolSearchSelectFilter,{selectedOption:a,defaultOption:l,options:r,onSelect:e=>{var r;i(m.currentSymbolType,{[t]:e.value}),trackEvent("New SS",m.currentSymbolType,null===e.value?e.analyticsLabel:e.value),c(-1),null===(r=d.current)||void 0===r||r.focus()},label:o,isMobile:u,"data-name":t}))}))):n.createElement("div",{className:l()(Se.wrap,o&&Se.small)},n.createElement("div",{className:Se.item},n.createElement("div",{className:Se.text
|
||||
},o?a.t(null,void 0,r(48490)):a.t(null,void 0,r(89053)))),n.createElement("div",{className:Se.item},!o&&n.createElement("div",{className:Se.text},a.t(null,void 0,r(29601))),m.canChangeExchange&&n.createElement("div",{className:Se.exchange},n.createElement(be,null))))}var we=r(38223),ke=r(52662);function Ce(e){const{onTouchMove:t,listRef:r,className:o,listWrapRef:a,virtualListKey:s,items:i,getItemSize:c,hideFeed:u,canLoadMore:d,onLoadMoreSymbols:m}=e,{mode:p,isSmallWidth:h,handleListWidth:g}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),[f,y]=(0,n.useState)(null),b=(0,pe.useResizeObserver)((function([e]){y(e.contentRect.height),g(e.contentRect.width)})),S=(0,n.useCallback)((e=>{const{index:t,style:r}=e;return n.createElement("div",{style:r},i[t])}),[i]),x=(0,n.useCallback)((e=>(0,C.ensure)(i[e].key)),[i]),w="watchlist"===p&&null!==f;return n.createElement("div",{className:l()(ke.wrap,w&&ke.watchlist,u&&ke.noFeed,u&&T.isSeparateSymbolSearchTabs&&ke.newStyles,o),onTouchMove:t,ref:b},n.createElement("div",{ref:a,className:l()(ke.scrollContainer,u&&ke.noFeed)},w?n.createElement(me.VariableSizeList,{key:s,ref:r,className:ke.listContainer,width:"100%",height:(0,C.ensureNotNull)(f),itemCount:i.length,itemSize:c,children:S,itemKey:x,overscanCount:20,direction:(0,we.isRtl)()?"rtl":"ltr"}):n.createElement(n.Fragment,null,n.createElement("div",{className:l()(ke.listContainer,h&&ke.multiLineItemsContainer)},!T.isSeparateSymbolSearchTabs&&n.createElement(xe,null),...i,!1))))}var Ee=r(17531),Ie=r(85544);const Le=u.enabled("hide_image_invalid_symbol");function Te(e){const{otherSymbolsCount:t,onChangeSymbolTypeFilter:r,onResetFilters:l,onListTouchMove:a,brokerTitle:s,brokerLogoInfo:i,isBrokerActive:c,onBrokerToggle:u,listRef:d,listWrapRef:m,onLoadMoreSymbols:p,canLoadMore:h}=e,{mode:g,isMobile:f,selectedSymbolType:y,symbolTypes:b,feedItems:S,contentItem:x,emptyState:w=Re,symbolSearchContent:k,symbolSearchState:C}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),I=s?n.createElement(BrokerButton,{brokerTitle:s,isActive:c,onToggle:u,logoInfo:i}):null,L="symbolSearch"===g&&["good","loadingWithPaginated"].includes(C),R=null!=x?x:Ee.SymbolSearchDialogContentItem,N=(0,n.useMemo)((()=>S.map((e=>n.createElement(R,{...e,searchToken:k.token})))),[S]);return n.createElement(n.Fragment,null,"symbolSearch"===g&&n.createElement(n.Fragment,null,b.length>0&&n.createElement(ue,{className:o(T.isSeparateSymbolSearchTabs&&(k.withFilters||f&&I)&&Ie.withFilters,!f&&I&&Ie.withButton),itemClassName:Ie.symbolType,items:b,getItemTitle:e=>e.name,getItemKey:e=>e.value,checkItemIsActive:e=>e.value===y,onBubbleClick:r,multiline:!f,grayStyles:!0},!f&&n.createElement("div",{className:Ie.brokerButton},I)),!T.isSeparateSymbolSearchTabs&&f&&b.length>0&&s&&n.createElement("div",{className:Ie.brokerButtonWrap},I),T.isSeparateSymbolSearchTabs&&n.createElement(xe,{brokerButton:f?I:void 0})),n.createElement(Ce,{listRef:d,listWrapRef:m,onTouchMove:a,items:N,getItemSize:()=>De,onLoadMoreSymbols:p,canLoadMore:h,hideFeed:!L
|
||||
}),"loading"===C&&n.createElement("div",{className:Ie.spinnerWrap},n.createElement(de.Spinner,null)),"symbolSearch"===g&&n.createElement(n.Fragment,null,!1,"empty"===C&&n.createElement(w,null)))}function Re(e){const t=(0,_.useWatchedValueReadonly)({watchedValue:B.watchedTheme})===M.StdTheme.Dark?Q:F;return n.createElement(k,{className:Ie.noResultsDesktop},!Le&&n.createElement(p.Icon,{icon:t,className:Ie.emptyIcon}),n.createElement("div",{className:Ie.emptyText},a.t(null,void 0,r(41379))))}const Ne=(0,T.getDefaultSearchSource)(),De=52;function _e(e){const{mode:t,setMode:o,setSelectedIndex:i,isMobile:c,selectedSearchSource:d,setSelectedSearchSource:m,isAllSearchSourcesSelected:p,selectedSymbolType:h,setSelectedSymbolType:g,symbolSearchContent:y,setSymbolSearchContent:b,searchRef:S,setSearchSpreads:x,showSpreadActions:w,selectedItem:k,forceUpdate:C,placeholder:I,initialScreen:L,footer:R,searchInput:N,upperCaseEnabled:D,externalInput:_,handleKeyDown:B,customSearchSymbols:M,filterDefinitions:Q,filterQueryParams:F,searchSources:A,symbolSearchState:P,setSymbolSearchState:U,onEmptyResults:G}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext),q=(0,n.useRef)(t);q.current=t;const Y=(0,n.useRef)(new AbortController),[H,X]=(0,n.useState)(0),J=(0,n.useRef)(0),[ee,te]=(0,n.useState)(y.token),re=(0,n.useRef)(null),oe=(0,n.useRef)(null),le=(0,n.useRef)({selectedIndexValue:-1,searchTokenValue:"",searchSpreadsValue:!0}),ae=(0,n.useRef)(null),se=(0,n.useRef)(null),ie=(0,n.useRef)(null),{broker:ce=null,brokerId:ue,brokerTitle:de,brokerLogoInfo:me,isBrokerChecked:pe=!1,setIsBrokerChecked:he=(()=>{}),unhideSymbolSearchGroups:ge=""}={brokerId:void 0,brokerTitle:void 0,brokerLogoInfo:void 0};(0,n.useEffect)((()=>()=>{Y.current.abort(),Be(),Me()}),[]),(0,n.useEffect)((()=>{(null==S?void 0:S.current)&&te(S.current.value)}),[]),(0,n.useEffect)((()=>{const e=S.current;if(e)return e.addEventListener("input",we),e.addEventListener("focus",De),e.addEventListener("select",xe),e.addEventListener("click",xe),e.addEventListener("keyup",_e),_&&B&&e.addEventListener("keydown",B),()=>{e&&(e.removeEventListener("input",we),e.removeEventListener("focus",De),e.removeEventListener("select",xe),e.removeEventListener("click",xe),e.removeEventListener("keyup",_e),_&&B&&e.removeEventListener("keydown",B))}}),[B]),(0,n.useEffect)((()=>{Boolean(L)&&""===ee.trim()||(b((e=>({...e,symbolStartIndex:0}))),Ce(ee,h,d).then((()=>{re.current&&(re.current.scrollTop=0)})))}),[ee,h,d,pe,L,F]),(0,n.useEffect)((()=>{var e;if(!k||!S.current)return;if(!u.enabled("show_spread_operators"))return S.current.value=k.symbol,void C();const t=W(k)?k.exchange:k.parent.exchange;let r;r="contracts"in k&&(null===(e=k.contracts)||void 0===e?void 0:e.length)?k.contracts[0]:k;const n={name:r.symbol,exchange:t,prefix:r.prefix,fullName:r.full_name},[o,l]=(0,s.getNextSymbolInputValueAndPosition)(S.current,n,D);S.current.value=o,S.current.setSelectionRange(l,l),C()}),[k]);const ve=null!=L?L:"div",fe=Boolean(L)&&"symbolSearch"!==t,ye=null!=N?N:f.DialogSearch,be=(0,n.useMemo)((()=>({listRef:oe,
|
||||
resetRecommends:Re,updateRecommends:Ce,searchToken:ee,emptyTextClassName:Ie.emptyText,isBrokerChecked:pe,symbolSearchState:P,currentMode:q})),[oe,ee,pe,P,q,F]);return n.createElement(O.SymbolSearchDialogBodyContext.Provider,{value:be},!(_&&"symbolSearch"===t)&&n.createElement(ye,{reference:S,className:l()(Ie.search,D&&Ie.upperCase),placeholder:I||a.t(null,void 0,r(52298))},w&&n.createElement(ne,{state:le,update:ke})),fe?n.createElement(ve,null):n.createElement(Te,{otherSymbolsCount:H,onListTouchMove:function(){var e;null===(e=S.current)||void 0===e||e.blur()},onChangeSymbolTypeFilter:function(e){const{value:t}=e;g(t),i(-1)},onResetFilters:function(){var e;T.isSeparateSymbolSearchTabs?"resetFilter"===P?g((0,T.getAllSymbolTypesValue)()):Ne&&m(Ne):(g((0,T.getAllSymbolTypesValue)()),Ne&&m(Ne));he(!1),c||null===(e=S.current)||void 0===e||e.focus()},brokerTitle:de,brokerLogoInfo:me,isBrokerActive:pe,onBrokerToggle:he,listRef:oe,listWrapRef:re,onLoadMoreSymbols:void 0,canLoadMore:void 0}),R);function Se(){if(!S.current)return;const[e,t,r]=(0,s.getCurrentTokenParamsFromInput)(S.current,D);J.current=t,le.current={selectedIndexValue:-1,searchSpreadsValue:(0,s.isSpread)(r),searchTokenValue:e},ae.current||(ae.current=setTimeout(ke,0))}function xe(){if(!S.current)return;const[,e]=(0,s.getCurrentTokenParamsFromInput)(S.current,D);e!==J.current&&Se()}function we(){u.enabled("show_spread_operators")?Se():S.current&&(le.current={selectedIndexValue:-1,searchSpreadsValue:!1,searchTokenValue:S.current.value},ae.current||(ae.current=setTimeout(ke,0)))}function ke(){const{selectedIndexValue:e,searchTokenValue:t,searchSpreadsValue:r}=le.current;ae.current=null,(0,z.unstable_batchedUpdates)((()=>{x(r),i(e),te(D?t.toUpperCase():t)}))}async function Ce(e,t,r,n){var o,l,a;try{"noop"===P?U("loading"):n?U("loadingWithPaginated"):(Be(),Me(),se.current=setTimeout((()=>{b({token:e,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A,renderSymbolSearchList:[],symbolsRemaining:0,symbolStartIndex:0}),U("loading")}),500)),Oe();(0,T.getAllSymbolTypesValue)();const i=!1;let c;if(pe&&ce){c=(await(0,V.respectAbort)(Y.current.signal,ce.accountMetainfo())).prefix}const m=u.enabled("show_spread_operators")?null!==(l=null!==(o=(0,s.getExchange)(e))&&void 0!==o?o:c)&&void 0!==l?l:null==r?void 0:r.getRequestExchangeValue():null==d?void 0:d.getRequestExchangeValue(),p=(0,s.getExchange)(e)||null===(a=r||d)||void 0===a?void 0:a.getRequestCountryValue(),[h,g]=await Promise.all([Le(Y.current.signal,e,t,r,m,p,n),i&&!n?getRecent():Promise.resolve([])]),v=g.filter((e=>{var t,r;return m?(null===(t=e.exchange)||void 0===t?void 0:t.toLowerCase())===m.toLowerCase():!p||(null===(r=e.country)||void 0===r?void 0:r.toLowerCase())===p.toLowerCase()})),f=new Set(v.map((e=>`${e.exchange}_${e.symbol}`))),S=h.symbols.filter((e=>!f.has(`${e.exchange}_${e.symbol}`)))
|
||||
;let x=function(e,t=window.ChartApiInstance.symbolsGrouping()){var r;const n={},o=[];for(let l=0;l<e.length;++l){const a=e[l];if(a.prefix||Array.isArray(a.contracts))return e;const s=t[a.type];if(void 0===s){o.push(a);continue}const i=s.exec(a.symbol);if(i){const e=i[1];let t;n.hasOwnProperty(e)?t=n[e]:(t=o.length,n[e]=t,o.push({type:a.type,symbol:e,exchange:a.exchange,description:a.description,full_name:a.exchange+":"+e,contracts:[]})),null===(r=o[t].contracts)||void 0===r||r.push(a)}else o.push(a)}return o}([...v,...S]);if(n&&(x=[...y.renderSymbolSearchList,...x]),!x.length)return b((r=>({...r,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],token:e,symbolsRemaining:0,withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A}))),Be(),U("empty"),void Ee();Be(),b((r=>({...r,canChangeExchange:Boolean(d&&A.length>1&&!(0,T.exchangeSelectDisabled)(t)),tabSelectFilters:null==Q?void 0:Q[t],renderSymbolSearchList:x,token:e,symbolsRemaining:h.symbols_remaining,withFilters:!!t,currentSymbolType:t,currentSelectedSearchSource:d,currentTabAvailableSearchSources:A,symbolStartIndex:r.symbolStartIndex+h.symbols.length}))),U("good")}catch(e){(0,V.skipAbortError)(e)}}function Ee(){G&&(ie.current=setTimeout((()=>G()),1e3))}async function Le(e,t,r,n,o,l,a){var i;const c={serverHighlight:!1,text:u.enabled("show_spread_operators")?(0,s.shortName)(t):null===(i=S.current)||void 0===i?void 0:i.value,exchange:o,country:l,type:r,lang:window.language||"",sortByCountry:void 0,brokerId:ue,onlyTradable:Boolean(ue)&&pe,unhideSymbolSearchGroups:ge,signal:e,start:a,filterQueryParams:F},d=(0,K.getSearchRequestDelay)();return void 0!==d&&await(0,V.delay)(e,d),M?M(c):Z(c)}function Re(){Oe(),U("empty"),te(""),x(!1),b((e=>({...e,symbolStartIndex:0}))),Be()}function De(){"watchlist"===q.current&&(o("symbolSearch"),(0,$.trackEvent)("Watchlist","Mobile SS","Go to SS page"))}function _e(e){switch((0,j.hashFromEvent)(e)){case 37:case 39:xe()}}function Be(){se.current&&clearTimeout(se.current)}function Me(){ie.current&&clearTimeout(ie.current)}function Oe(){Y.current.abort(),Y.current=new AbortController}}var Be=r(48199),Me=r(24658),Oe=r(58442),Qe=r(56840);function Fe(e){const[t,r]=(0,n.useState)((()=>{const{defaultSearchSource:t,searchSources:r}=e,n=Qe.getValue("symboledit.exchangefilter","");return r.find((e=>e.value()===n))||t}));return[t,(0,n.useCallback)((e=>{var t;r(e),t=e,Qe.setValue("symboledit.exchangefilter",t.value())}),[])]}function Ae(e){const[t,r]=(0,n.useState)((()=>{if(1===e.types.length)return e.types[0].value;const t=Qe.getValue("symboledit.filter",(0,T.getAllSymbolTypesValue)());return e.types.find((e=>e.value===t))?t:(0,T.getAllSymbolTypesValue)()}));return[t,(0,n.useCallback)((e=>{var t;r(e),t=e,Qe.setValue("symboledit.filter",t)}),[])]}var Pe=r(36947),Ue=r(82708),ze=r(88145),Ve=r(76460),We=r(62393);const Ze=(0,T.getAvailableSearchSources)(),Ke=(0,T.getDefaultSearchSource)(),$e=u.enabled("uppercase_instrument_names");function je(e){
|
||||
var t;const{onClose:o,initialMode:l,defaultValue:m="",showSpreadActions:p,hideMarkedListFlag:h,selectSearchOnInit:g=!0,onSearchComplete:f,dialogTitle:y=a.t(null,void 0,r(99983)),placeholder:S,fullscreen:w,initialScreen:k,wrapper:C,dialog:E,contentItem:I,footer:L,searchInput:R,emptyState:N,autofocus:D,dialogWidth:_,onKeyDown:B,searchSourcesScreen:M,customSearchSymbols:O,isDisableFiltering:Q,disableRecents:F,shouldReturnFocus:A,onSymbolFiltersParamsChange:P,onEmptyResults:z}=e,V=(0,n.useMemo)((()=>Q?[]:e.symbolTypes?e.symbolTypes:(0,T.getAvailableSymbolTypes)()),[]),K=void 0!==e.input,$=Q?[]:Ze,[G,q]=(0,n.useState)(l),Y=(0,n.useRef)(m),[H,X]=Fe({searchSources:$,defaultSearchSource:Ke}),[J,ee]=[],[te,re]=Ae({types:V}),[ne,oe]=[{},()=>{}],[le,ae]=(0,n.useState)(!1),[se,ie]=(0,n.useState)(-1),[ce,ue]=(0,n.useState)("noop"),de=T.isSeparateSymbolSearchTabs?TAB_SELECT_FILTER_MAP:void 0,me=T.isSeparateSymbolSearchTabs?(null==J?void 0:J[te])||Ke:H,pe=(0,n.useMemo)((()=>{if(!T.isSeparateSymbolSearchTabs)return $;return $.filter((e=>{const t=TAB_SOURCE_FILTER_MAP[te];if(!t)return!1;if(!te)return!0;const r=e.group();return r===ExchangeGroup.AllExchanges||r&&t.value.includes(r)}))}),[$,te]),[he,ge]=(0,n.useState)((()=>({canChangeExchange:Boolean(H&&Ze.length>1&&!(0,T.exchangeSelectDisabled)(te)),tabSelectFilters:null==de?void 0:de[te],withFilters:!!te,renderSymbolSearchList:[],token:Y.current,symbolsRemaining:0,currentSymbolType:te,currentSelectedSearchSource:me,currentTabAvailableSearchSources:pe,symbolStartIndex:0}))),ve=(0,n.useCallback)((e=>{trackEvent("New SS",te,"Change sources"),null==ee||ee(te,e),ge((t=>({...t,currentSelectedSearchSource:e})))}),[te,ge]),fe=(0,n.useRef)(null!==(t=e.input)&&void 0!==t?t:null),[ye,be]=(0,n.useState)(!1),Se=(0,Pe.useForceUpdate)(),[xe,ke]=(0,n.useState)(new Set),{broker:Ce=null,brokerId:Ee,unhideSymbolSearchGroups:Ie="",displayBrokerSymbol:Le=!1}={brokerId:void 0};(0,n.useLayoutEffect)((()=>{var e;!(null==fe?void 0:fe.current)||!K&&Boolean(null===(e=fe.current)||void 0===e?void 0:e.value)||(K||"compare"===G||(fe.current.value=Y.current),!D||K&&"symbolSearch"!==G||fe.current.focus())}),[G]),(0,n.useEffect)((()=>{(null==fe?void 0:fe.current)&&g&&D&&fe.current.select()}),[]);const Te=(0,n.useMemo)((()=>he.renderSymbolSearchList.reduce(((e,t)=>{const r=Ye(t),n=xe.has(r);return e.push(t),n&&t.contracts&&e.push(...t.contracts.map((e=>({...e,parent:t})))),e}),[])),[he.renderSymbolSearchList,xe]),Re=(0,n.useRef)(null);(0,n.useEffect)((()=>{var e;-1!==se&&(null===(e=Re.current)||void 0===e||e.scrollIntoView({block:"nearest"}))}),[se,Re]);const Ne=i.includes(te),De=(0,n.useMemo)((()=>Te.map(((e,t)=>{var r,n,o,l;if(W(e)){const o=Ye(e),l=e.contracts?xe.has(o):void 0,a=t===se,s=he.renderSymbolSearchList.findIndex((t=>t.symbol===e.symbol&&t.exchange===e.exchange))+1;return{key:t,numberInList:s,id:o,title:qe(e,Le),description:e.description,isOffset:!1,onClick:at.bind(null,e,s),providerId:e.provider_id,source:e.source,source2:e.source2,country:null===(r=e.country)||void 0===r?void 0:r.toLocaleLowerCase(),
|
||||
type:e.type,exchangeName:null===e.exchange?void 0:e.exchange,exchangeTooltip:"",prefix:e.prefix||void 0,marketType:(0,Me.marketType)(e.type,e.typespecs,!1),hideMarketType:Ne,isEod:(null===(n=e.params)||void 0===n?void 0:n.includes("eod"))&&"economic"!==e.type,isYield:(0,ze.isYield)(e),isExpanded:l,onExpandClick:e.contracts?st.bind(null,o):void 0,fullSymbolName:e.contracts?Oe.QualifiedSources.fromSymbolSearchResult(e,e.contracts[0]):Oe.QualifiedSources.fromSymbolSearchResult(e),itemRef:a?Re:void 0,isSelected:t===se,hideMarkedListFlag:h,item:e,logoId:e.logoid,currencyLogoId:e["currency-logoid"],baseCurrencyLogoId:e["base-currency-logoid"],shortName:(0,Ue.safeShortName)(Oe.QualifiedSources.fromSymbolSearchResult(e)),currencyCode:e.currency_code,isPrimary:e.is_primary_listing}}{const{parent:r}=e,n=Ye(r),a=t===se,s=he.renderSymbolSearchList.findIndex((e=>e.symbol===r.symbol&&e.exchange===r.exchange))+1;return{key:t,numberInList:s,id:n+e.symbol,dangerousTitleHTML:qe(e,Le),dangerousDescriptionHTML:`${r.description}`+(e.description?` (${e.description})`:""),isOffset:!0,isEod:null===(o=e.params)||void 0===o?void 0:o.includes("eod"),isYield:(0,ze.isYield)(e),onClick:it.bind(null,e.parent,e,s),providerId:r.provider_id,country:null===(l=r.country)||void 0===l?void 0:l.toLowerCase(),type:r.type,exchangeName:null===r.exchange?void 0:r.exchange,exchangeTooltip:"",marketType:(0,Me.marketType)(r.type,e.typespecs,!1),hideMarketType:Ne,fullSymbolName:Oe.QualifiedSources.fromSymbolSearchResult(e.parent,e),itemRef:a?Re:void 0,isSelected:a,hideMarkedListFlag:h,item:e}}}))),[he.renderSymbolSearchList,xe,G,se,B]),Qe=(0,n.useMemo)((()=>function(e,t,r){const n=null==t?void 0:t[e],o=new Map(null==n?void 0:n.map((e=>[e.id,e.urlParam]))),l=r[e];let a;if(l){a={};for(const[e,t]of Object.entries(l)){const r=o.get(e);r&&(a[r]=t)}}return a}(te,de,ne)),[te,de,ne]),je=(0,n.useMemo)((()=>he.renderSymbolSearchList.slice(0,20).map((e=>e.contracts?Oe.QualifiedSources.fromSymbolSearchResult(e,e.contracts[0]):Oe.QualifiedSources.fromSymbolSearchResult(e)))),[he.renderSymbolSearchList]);(0,n.useEffect)((()=>{var e,t,r;if(!P)return;const n=["resetFilter","resetTabFilter","empty"].includes(ce)?[]:je,o={...Qe,result_list:n};if(o.search_type||(o.search_type="bitcoin,crypto"===te?"crypto":te),!T.isSeparateSymbolSearchTabs)return o.exchange=null!==(e=null==me?void 0:me.getRequestCountryValue())&&void 0!==e?e:null,void P(o);if(te){const e=null!==(t=null==me?void 0:me.getRequestCountryValue())&&void 0!==t?t:null;e&&(o.country=e);const n=null!==(r=null==me?void 0:me.getRequestExchangeValue())&&void 0!==r?r:null;n&&(o.exchange=n)}P(o)}),[te,Qe,je,me,ce]);const Je=null!=E?E:Xe,et=Je!==Xe&&!K,tt=(e,t)=>{var r;return{mode:G,setMode:q,selectedSearchSource:me,setSelectedSearchSource:T.isSeparateSymbolSearchTabs?ve:X,isAllSearchSourcesSelected:x.isAllSearchSourcesSelected,allSearchSourcesTitle:T.isSeparateSymbolSearchTabs?null===(r=TAB_SOURCE_FILTER_MAP[he.currentSymbolType])||void 0===r?void 0:r.allSearchSourcesTitle:void 0,selectedSymbolType:te,setSelectedSymbolType:re,
|
||||
selectedIndex:se,setSelectedIndex:ie,onClose:o,setSymbolSearchContent:ge,symbolSearchContent:he,searchRef:fe,cachedInputValue:Y,searchSpreads:le,setSearchSpreads:ae,handleListWidth:ct,isSmallWidth:ye,feedItems:De,isMobile:e,showSpreadActions:p,selectSearchOnInit:g,isTablet:t,selectedItem:Te[se],forceUpdate:Se,placeholder:S,initialScreen:k,toggleExpand:st,openedItems:xe,onSubmit:mt,onSearchComplete:f,footer:L,symbolTypes:V,contentItem:I,searchInput:R,emptyState:N,autofocus:D,upperCaseEnabled:$e,externalInput:K,handleKeyDown:et?void 0:dt,customSearchSymbols:O,searchSources:pe,filterDefinitions:de,selectedFilterValues:ne,setSelectedFilterValues:oe,filterQueryParams:Qe,symbolSearchState:ce,setSymbolSearchState:ue,onEmptyResults:void 0}},rt=null!=M?M:U,nt="exchange"===G,ot=nt?{title:a.t(null,void 0,r(19724)),dataName:"exchanges-search",render:()=>n.createElement(rt,{searchSources:he.currentTabAvailableSearchSources}),additionalHeaderElement:n.createElement(Be.BackButton,{onClick:()=>q("symbolSearch"),className:We.backButton,size:"medium","aria-label":a.t(null,{context:"input"},r(16936)),preservePaddings:!0,flipIconOnRtl:(0,we.isRtl)()}),additionalElementPos:"before"}:{title:y,dataName:"symbol-search-items-dialog",render:()=>n.createElement(_e,null),additionalElementPos:"after"},lt=null!=C?C:"div";return n.createElement(lt,null,n.createElement(c.MatchMediaMap,{rules:d.DialogBreakpoints},(({TabletSmall:e,TabletNormal:t})=>n.createElement(v.SymbolSearchItemsDialogContext.Provider,{value:tt(e,t)},n.createElement(Je,{...ot,shouldReturnFocus:A,fullScreen:w,onClose:o,onClickOutside:o,onKeyDown:et?void 0:dt,isOpened:!0})))));function at(e,t,r){if(e.contracts)return e.contracts.length?void it(e,e.contracts[0],t,r):void st(Ye(e));it(e,void 0,t,r)}function st(e){const t=new Set(xe);t.has(e)?t.delete(e):t.add(e),ke(t)}function it(e,t,r,n){const l=t||e,{exchange:a}=e;if(u.enabled("show_spread_operators")){const e={name:l.symbol,exchange:a,prefix:l.prefix,fullName:l.full_name};if(le)return ut(e),void Se();if(fe.current&&fe.current.value.includes(","))return void ut(e)}pt([{resolved:!0,symbol:Oe.QualifiedSources.fromSymbolSearchResult(e,t),result:l}],r,n),o()}function ct(e){be("fixed"===_||e<=640)}function ut(e){if(!fe.current)return;const[t,r]=(0,s.getNextSymbolInputValueAndPosition)(fe.current,e,$e);fe.current.value=t,fe.current.setSelectionRange(r,r),fe.current.focus()}function dt(e){const t=(0,j.hashFromEvent)(e);switch(t){case 13:e.preventDefault(),mt(!0);break;case 27:if(e.preventDefault(),nt)return void q("symbolSearch");o()}switch((0,b.mapKeyCodeToDirection)(t)){case"blockPrev":if(e.preventDefault(),0===se||"good"!==ce)return;if(-1===se)return void ie(0);ie(se-1);break;case"blockNext":if(e.preventDefault(),se===De.length-1||"good"!==ce)return;ie(se+1);break;case"inlinePrev":{if(-1===se)return;const t=De[se],{id:r,isOffset:n,onExpandClick:o}=t;if(!n&&r&&xe.has(r)&&Boolean(o)&&!Boolean(B)&&(e.preventDefault(),st(r)),o)return void(null==B||B(e,!0));break}case"inlineNext":{if(-1===se)return
|
||||
;const t=De[se],{id:r,isOffset:n,onExpandClick:o}=t;if(n||!r||xe.has(r)||!Boolean(o)||Boolean(B)||(e.preventDefault(),st(r)),o)return void(null==B||B(e,!0));break}}null==B||B(e)}function mt(e){if(!fe.current)return;let t=fe.current.value;if(u.enabled("show_spread_operators")&&le&&t){const r=De[se];if(r&&void 0!==r.isExpanded&&(r.onClick(),t=fe.current.value),t.includes(",")){return pt(He(t).map(Ge),null),void(e&&o())}return pt([{symbol:$e?t.toUpperCase():t,resolved:!1}],null),void(e&&o())}if(t.includes(","))return pt(He(t).map(Ge),null),void(e&&o());if(-1!==se){De[se].onClick()}else{const r=$e?t.toUpperCase():t;if(r&&""!==r.trim()){const e=He(r);if(void 0!==Ee&&-1===r.indexOf(":"))(function(e){let t=!1;return Promise.all(e.map((e=>-1!==e.indexOf(":")||t?Promise.resolve({symbol:e,resolved:!1}):(t=!0,async function(e){var t;null===(t=await(null==Ce?void 0:Ce.accountMetainfo()))||void 0===t||t.prefix;const r=void 0,n=await Z({strictMatch:!0,serverHighlight:!1,text:e,lang:window.language||"",brokerId:Ee,onlyTradable:!0,unhideSymbolSearchGroups:Ie,exchange:r});if(0!==n.symbols.length){const e=n.symbols[0],{contracts:t}=e,r=t&&t.length>0?t[0]:void 0,o=e.prefix||e.exchange,l=r?r.symbol:e.symbol;if(o&&l)return{symbol:Oe.QualifiedSources.fromSymbolSearchResult(e,r),resolved:!0,result:e}}return{symbol:e,resolved:!1}}(e)))))})(e).then((e=>pt(e,null)));else{pt(e.map(Ge),null)}}e&&o()}}async function pt(e,t,r){var n;const[{result:o,symbol:l,resolved:a}]=e,s=null===(n=fe.current)||void 0===n?void 0:n.value,i=!r||(0,Ve.isKeyboardClick)(r);let c=le;void 0!==o&&W(o)&&(c="spread"===o.type),f(e,{symbolType:te,isKeyboardEvent:i,numberInList:t,inputValue:s,isSpread:c})}}function Ge(e){return{symbol:$e?e.toUpperCase():e,resolved:!1}}function qe(e,t){const{broker_symbol:r,symbol:n,description:o}=e;return`${"spread"===e.type?o:n}${t&&r?` (${r})`:""}`}function Ye(e){return e.symbol+e.exchange+e.description}function He(e){return e.split(",").map((e=>e.trim())).filter((e=>""!==e))}function Xe(e){const{isMobile:t,isTablet:r}=(0,E.useEnsuredContext)(v.SymbolSearchItemsDialogContext);return n.createElement(m.AdaptivePopupDialog,{...e,className:l()(We.dialog,!t&&(r?We.tabletDialog:We.desktopDialog)),backdrop:!0,draggable:!1})}},15983:(e,t,r)=>{"use strict";r.d(t,{flip:()=>s,getCurrentTokenParamsFromInput:()=>v,getExchange:()=>p,getNextSymbolInputValueAndPosition:()=>g,isSpread:()=>u,shortName:()=>m,stringifyTokens:()=>i,validate:()=>a});var n=r(14483),o=r(44254),l=r(81319);function a(e){const t={braceBalance:0,currentState:"var",warnings:[],errors:[]};if(n.enabled("charting_library_base")&&!n.enabled("show_spread_operators"))return t;let r="init";const o=[];for(let n=0;n<e.length;n++){const l=e[n];if("whitespace"!==l.type){if("incompleteSymbol"===l.type||"incompleteNumber"===l.type){const r=n!==e.length-1,o={status:r?"error":"incomplete",reason:"incomplete_token",offset:l.offset,token:l};if(r?t.errors.push(o):t.warnings.push(o),r)continue}switch(l.type){case"symbol":case"number":if("var"===r){t.errors.push({status:"error",
|
||||
reason:"unexpected_token",offset:l.offset,token:l});continue}r="var";break;case"plus":case"minus":case"multiply":case"divide":case"power":if("var"!==r){t.errors.push({status:"error",reason:"unexpected_token",offset:l.offset,token:l});continue}r="operator";break;case"openBrace":if("var"===r){t.errors.push({status:"error",reason:"unexpected_token",offset:l.offset,token:l});continue}o.push(l),r="init";break;case"closeBrace":if("var"!==r){t.errors.push({status:"error",reason:"unexpected_token",offset:l.offset,token:l});continue}o.pop()||t.errors.push({status:"error",reason:"unbalanced_brace",offset:l.offset,token:l}),r="var";break;case"unparsed":t.errors.push({status:"error",reason:"unparsed_entity",offset:l.offset,token:l})}}}for(t.braceBalance=o.length,"var"!==r&&t.warnings.push({status:"incomplete",token:e[e.length-1]});o.length;){const e=o.pop();e&&t.warnings.push({status:"incomplete",reason:"unbalanced_brace",offset:e.offset,token:e})}return t.currentState=r,t}function s(e){const t=function(e){let t,r=0,n=0;for(let o=0;o<e.length;o++){const l=e[o];if("whitespace"!==l.type)switch(r){case 0:if("number"!==l.type||1!=+l.value)return[];r=1;break;case 1:if(1!==r||"divide"!==l.type)return[];r=2,t=o+1;break;case 2:if("openBrace"===l.type)r=3,n=1;else if(c(l.type))return[];break;case 3:"openBrace"===l.type?n++:"closeBrace"===l.type&&(n--,n<=0&&(r=2))}}return e.slice(t)}(e);return t.length?d(t):d((0,o.tokenize)("1/("+i(e)+")"))}function i(e){return e.reduce(((e,t)=>"symbol"===t.type&&o.symbolTokenEscapeRe.test(t.value)?e+`'${t.value}'`:e+t.value),"")}function c(e){return"plus"===e||"minus"===e||"multiply"===e||"divide"===e||"power"===e}function u(e){return e.length>1&&e.some((e=>c(e.type)))}function d(e){e=function(e){const t=[];for(const r of e)"whitespace"!==r.type&&t.push(r);return t}(e);const t=[],r=[];let n;for(let o=0;o<e.length;o++){const l=e[o];switch(l.type){case"plus":case"minus":case"multiply":case"divide":case"power":r.length&&r[r.length-1].minPrecedence>l.precedence&&(r[r.length-1].minPrecedence=l.precedence);break;case"openBrace":n={minPrecedence:1/0,openBraceIndex:o},r.push(n);break;case"closeBrace":{if(n=r.pop(),!n)break;const l=e[n.openBraceIndex-1],a=e[o+1],s=l&&("plus"===l.type||"multiply"===l.type);(!c(null==a?void 0:a.type)||(null==a?void 0:a.precedence)<=n.minPrecedence)&&(!c(null==l?void 0:l.type)||(null==l?void 0:l.precedence)<(null==n?void 0:n.minPrecedence)||(null==l?void 0:l.precedence)===(null==n?void 0:n.minPrecedence)&&s)&&(t.unshift(n.openBraceIndex),t.push(o),r.length&&r[r.length-1].minPrecedence>n.minPrecedence&&(r[r.length-1].minPrecedence=n.minPrecedence))}}}for(let r=t.length;r--;)e.splice(t[r],1);return e}function m(e){return d((0,o.tokenize)(e)).reduce(((e,t)=>{if("symbol"!==t.type)return e+t.value;const[,r]=h(t);return r?e+r:e}),"")}function p(e){const t=function(e){const t=(0,o.tokenize)(e),r=[];return t.forEach((e=>{if("symbol"!==e.type)return;const[t]=h(e);t&&r.push(t)})),r}(e);if(1===t.length)return t[0]}function h(e){const t=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i.exec(e.value)
|
||||
;return null===t?[void 0,void 0]:[t[1],t[2]]}function g(e,t,r){const n=e.value,[a,s]=v(e,r),i=(0,l.getSymbolFullName)(t),c=o.symbolTokenEscapeRe.test(i)?`'${i}'`:i;return[n.substring(0,s)+c+n.substring(s+a.length),s+c.length]}function v(e,t){const{value:r,selectionStart:n}=e,l=(0,o.tokenize)(t?r.toUpperCase():r),a=function(e,t){for(let r=0;r<e.length;r++){const n=e[r],o="symbol"===n.type||"incompleteSymbol"===n.type||"number"===n.type;if(n.offset<=t&&t<=n.offset+n.value.length&&o)return n}return null}(l,n||0);return[(null==a?void 0:a.value)||"",a?a.offset:r.length,l]}},81319:(e,t,r)=>{"use strict";r.d(t,{createGroupColumns:()=>p,exchangeSelectDisabled:()=>m,getAllSymbolTypesValue:()=>d,getAvailableSearchSources:()=>c,getAvailableSymbolTypes:()=>u,getDefaultSearchSource:()=>i,getSymbolFullName:()=>s,isSeparateSymbolSearchTabs:()=>h});var n=r(11542),o=r(20882);class l{constructor(e){this._exchange=e}value(){return this._exchange.value}name(){return(0,o.isAllSearchSourcesSelected)(this)?n.t(null,void 0,r(64498)):this._exchange.name}description(){return this._exchange.desc}country(){return this._exchange.country}providerId(){return this._exchange.providerId}group(){return this._exchange.group}includes(e){return function(e,t){const r=t.toLowerCase(),{name:n,desc:o,searchTerms:l}=e;return n.toLowerCase().includes(r)||o.toLowerCase().includes(r)||void 0!==l&&l.some((e=>e.toLowerCase().includes(r)))}(this._exchange,e)}getRequestExchangeValue(){return this._exchange.value}getRequestCountryValue(){}}var a=r(3685);function s(e){if(e.fullName)return e.fullName;let t;return t=e.prefix||e.exchange?(e.prefix||e.exchange)+":"+e.name:e.name,t.replace(/<\/?[^>]+(>|$)/g,"")}function i(){const e=c();return e.find(o.isAllSearchSourcesSelected)||e[0]||null}function c(){return(0,o.createSearchSources)(l,(0,a.getExchanges)())}function u(){return window.ChartApiInstance.supportedSymbolsTypes()}function d(){return""}function m(e){return!!h&&!TAB_SOURCE_FILTER_MAP[e]}function p(e,t=2){if(0===e.length)return[];if(1===t)return[e];const r=Math.floor(e.length/2)+e.length%2;return[e.slice(0,r),e.slice(r)].filter((e=>e.length>0))}const h=!1},82708:(e,t,r)=>{"use strict";r.d(t,{safeShortName:()=>o});var n=r(79982);function o(e){try{return(0,n.shortName)(e)}catch(t){return e}}},44254:(e,t,r)=>{"use strict";r.d(t,{symbolTokenEscapeRe:()=>a,tokenize:()=>c});var n=r(14483),o=r(18429);const l=n.enabled("charting_library_base")?/(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^])(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:.&])*|'.+?'/:/(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF])(?:[^-+\/*^\s]'|[a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:.&])*|'.+?'/,a=/[+\-/*]/,s={number:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:.&]))|\.\d+/,incompleteNumber:/\./,symbol:l,incompleteSymbol:/'[^']*/,separatorPrefix:o.SEPARATOR_PREFIX,openBrace:"(",closeBrace:")",plus:"+",minus:"-",multiply:"*",divide:"/",power:"^",whitespace:/[\0-\x20\s]+/,unparsed:null},i=new RegExp(Object.values(s).map((e=>{return null===e?"":`(${"string"==typeof e?(t=e,
|
||||
t.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&")):e.source})`;var t})).filter((e=>""!==e)).concat(".").join("|"),"g");function c(e){if(!e)return[];const t=[],r=Object.keys(s);let n;for(;n=i.exec(e);){let e=!1;for(let o=r.length;o--;)if(n[o+1]){r[o]&&t.push({value:n[o+1],type:r[o],precedence:0,offset:n.index}),e=!0;break}e||t.push({value:n[0],type:"unparsed",precedence:0,offset:n.index})}return t}},93251:(e,t,r)=>{"use strict";r.d(t,{removeUsdFromCryptoPairLogos:()=>a,resolveLogoUrls:()=>l});var n=r(36279);const o=(0,n.getLogoUrlResolver)();function l(e,t=n.LogoSize.Medium){const r=e.logoid,l=e["base-currency-logoid"],a=e["currency-logoid"],s=r&&o.getSymbolLogoUrl(r,t);if(s)return[s];const i=l&&o.getSymbolLogoUrl(l,t),c=a&&o.getSymbolLogoUrl(a,t);return i&&c?[i,c]:i?[i]:c?[c]:[]}function a(e){return 2!==e.length?e:function(e){return e.some((e=>s(e)))}(e)&&!function(e){return e.some((e=>e.includes("country")&&!s(e)))}(e)?e.filter((e=>!s(e))):e}function s(e){return!1}},44747:(e,t,r)=>{"use strict";r.d(t,{getBlockStyleClasses:()=>o,getLogoStyleClasses:()=>l});var n=r(97754);function o(e,t){return n("tv-circle-logo-pair",`tv-circle-logo-pair--${e}`,t)}function l(e,t){return n("tv-circle-logo-pair__logo",`tv-circle-logo-pair__logo--${e}`,!t&&"tv-circle-logo-pair__logo-empty")}},76068:(e,t,r)=>{"use strict";r.d(t,{CircleLogo:()=>a,hiddenCircleLogoClass:()=>l});var n=r(50959),o=r(58492);r(45300);const l="tv-circle-logo--visually-hidden";function a(e){var t,r;const l=(0,o.getStyleClasses)(e.size,e.className),a=null!==(r=null!==(t=e.alt)&&void 0!==t?t:e.title)&&void 0!==r?r:"";return(0,o.isCircleLogoWithUrlProps)(e)?n.createElement("img",{className:l,crossOrigin:"",src:e.logoUrl,alt:a,title:e.title,loading:e.loading,"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]}):n.createElement("span",{className:l,title:e.title,"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]},e.placeholderLetter)}},58492:(e,t,r)=>{"use strict";r.d(t,{getStyleClasses:()=>o,isCircleLogoWithUrlProps:()=>l});var n=r(97754);function o(e,t){return n("tv-circle-logo",`tv-circle-logo--${e}`,t)}function l(e){return"logoUrl"in e&&void 0!==e.logoUrl&&0!==e.logoUrl.length}},19785:(e,t,r)=>{"use strict";r.d(t,{createRegExpList:()=>l,getHighlightedChars:()=>a,rankedSearch:()=>o});var n=r(1722);function o(e){const{data:t,rules:r,queryString:o,isPreventedFromFiltering:l,primaryKey:a,secondaryKey:s=a,optionalPrimaryKey:i,tertiaryKey:c}=e;return t.map((e=>{const t=i&&e[i]?e[i]:e[a],l=e[s],u=c&&e[c];let d,m=0;return r.forEach((e=>{var r,a,s,i,c;const{re:p,fullMatch:h}=e;if(p.lastIndex=0,(0,n.isString)(t)&&t&&t.toLowerCase()===o.toLowerCase())return m=4,void(d=null===(r=t.match(h))||void 0===r?void 0:r.index);if((0,n.isString)(t)&&h.test(t))return m=3,void(d=null===(a=t.match(h))||void 0===a?void 0:a.index);if((0,n.isString)(l)&&h.test(l))return m=2,void(d=null===(s=l.match(h))||void 0===s?void 0:s.index);if((0,n.isString)(l)&&p.test(l))return m=2,void(d=null===(i=l.match(p))||void 0===i?void 0:i.index)
|
||||
;if(Array.isArray(u))for(const e of u)if(h.test(e))return m=1,void(d=null===(c=e.match(h))||void 0===c?void 0:c.index)})),{matchPriority:m,matchIndex:d,item:e}})).filter((e=>l||e.matchPriority)).sort(((e,t)=>{if(e.matchPriority<t.matchPriority)return 1;if(e.matchPriority>t.matchPriority)return-1;if(e.matchPriority===t.matchPriority){if(void 0===e.matchIndex||void 0===t.matchIndex)return 0;if(e.matchIndex>t.matchIndex)return 1;if(e.matchIndex<t.matchIndex)return-1}return 0})).map((({item:e})=>e))}function l(e,t){const r=[],n=e.toLowerCase(),o=e.split("").map(((e,t)=>`(${0!==t?`[/\\s-]${s(e)}`:s(e)})`)).join("(.*?)")+"(.*)";return r.push({fullMatch:new RegExp(`(${s(e)})`,"i"),re:new RegExp(`^${o}`,"i"),reserveRe:new RegExp(o,"i"),fuzzyHighlight:!0}),t&&t.hasOwnProperty(n)&&r.push({fullMatch:t[n],re:t[n],fuzzyHighlight:!1}),r}function a(e,t,r){const n=[];return e&&r?(r.forEach((e=>{const{fullMatch:r,re:o,reserveRe:l}=e;r.lastIndex=0,o.lastIndex=0;const a=r.exec(t),s=a||o.exec(t)||l&&l.exec(t);if(e.fuzzyHighlight=!a,s)if(e.fuzzyHighlight){let e=s.index;for(let t=1;t<s.length;t++){const r=s[t],o=s[t].length;if(t%2){const t=r.startsWith(" ")||r.startsWith("/")||r.startsWith("-");n[t?e+1:e]=!0}e+=o}}else for(let e=0;e<s[0].length;e++)n[s.index+e]=!0})),n):n}function s(e){return e.replace(/[!-/[-^{-}?]/g,"\\$&")}},24637:(e,t,r)=>{"use strict";r.d(t,{HighlightedText:()=>s});var n=r(50959),o=r(97754),l=r(19785),a=r(75623);function s(e){const{queryString:t,rules:r,text:s,className:i}=e,c=(0,n.useMemo)((()=>(0,l.getHighlightedChars)(t,s,r)),[t,r,s]);return n.createElement(n.Fragment,null,c.length?s.split("").map(((e,t)=>n.createElement(n.Fragment,{key:t},c[t]?n.createElement("span",{className:o(a.highlighted,i)},e):n.createElement("span",null,e)))):s)}},77762:(e,t,r)=>{"use strict";r.d(t,{useEnsuredContext:()=>l});var n=r(50959),o=r(50151);function l(e){return(0,o.ensureNotNull)((0,n.useContext)(e))}},36947:(e,t,r)=>{"use strict";r.d(t,{useForceUpdate:()=>n.useForceUpdate});var n=r(125)},29006:(e,t,r)=>{"use strict";r.d(t,{useResizeObserver:()=>n.useResizeObserver});var n=r(67842)},77975:(e,t,r)=>{"use strict";r.d(t,{useWatchedValueReadonly:()=>o});var n=r(50959);const o=(e,t=!1)=>{const r="watchedValue"in e?e.watchedValue:void 0,o="defaultValue"in e?e.defaultValue:e.watchedValue.value(),[l,a]=(0,n.useState)(r?r.value():o);return(t?n.useLayoutEffect:n.useEffect)((()=>{if(r){a(r.value());const e=e=>a(e);return r.subscribe(e),()=>r.unsubscribe(e)}return()=>{}}),[r]),l}},84877:(e,t,r)=>{"use strict";r.d(t,{MatchMediaMap:()=>a});var n=r(50959),o=r(66783),l=r.n(o);class a extends n.Component{constructor(e){super(e),this._handleMediaChange=()=>{const e=i(this.state.queries,((e,t)=>t.matches));let t=!1;for(const r in e)if(e.hasOwnProperty(r)&&this.state.matches[r]!==e[r]){t=!0;break}t&&this.setState({matches:e})};const{rules:t}=this.props;this.state=s(t)}shouldComponentUpdate(e,t){return!l()(e,this.props)||(!l()(t.rules,this.state.rules)||!l()(t.matches,this.state.matches))}componentDidMount(){this._migrate(null,this.state.queries)}
|
||||
componentDidUpdate(e,t){l()(e.rules,this.props.rules)||this._migrate(t.queries,this.state.queries)}componentWillUnmount(){this._migrate(this.state.queries,null)}render(){return this.props.children(this.state.matches)}static getDerivedStateFromProps(e,t){if(l()(e.rules,t.rules))return null;const{rules:r}=e;return s(r)}_migrate(e,t){null!==e&&i(e,((e,t)=>{t.removeListener(this._handleMediaChange)})),null!==t&&i(t,((e,t)=>{t.addListener(this._handleMediaChange)}))}}function s(e){const t=i(e,((e,t)=>window.matchMedia(t)));return{queries:t,matches:i(t,((e,t)=>t.matches)),rules:{...e}}}function i(e,t){const r={};for(const n in e)e.hasOwnProperty(n)&&(r[n]=t(n,e[n]));return r}},63932:(e,t,r)=>{"use strict";r.d(t,{Spinner:()=>a});var n=r(50959),o=r(97754),l=r(58096);r(83135);function a(e){const t=o(e.className,"tv-spinner","tv-spinner--shown",`tv-spinner--size_${l.spinnerSizeMap[e.size||l.DEFAULT_SIZE]}`);return n.createElement("div",{className:t,style:e.style,role:"progressbar"})}},10381:(e,t,r)=>{"use strict";r.d(t,{ToolWidgetCaret:()=>i});var n=r(50959),o=r(97754),l=r(9745),a=r(34587),s=r(578);function i(e){const{dropped:t,className:r}=e;return n.createElement(l.Icon,{className:o(r,a.icon,{[a.dropped]:t}),icon:s})}},78029:e=>{e.exports={button:"button-GwQQdU8S",hover:"hover-GwQQdU8S",clicked:"clicked-GwQQdU8S",isInteractive:"isInteractive-GwQQdU8S",accessible:"accessible-GwQQdU8S",isGrouped:"isGrouped-GwQQdU8S",isActive:"isActive-GwQQdU8S",isOpened:"isOpened-GwQQdU8S",isDisabled:"isDisabled-GwQQdU8S",text:"text-GwQQdU8S",icon:"icon-GwQQdU8S",endIcon:"endIcon-GwQQdU8S"}},31409:(e,t,r)=>{"use strict";r.d(t,{DEFAULT_TOOL_WIDGET_BUTTON_THEME:()=>s,ToolWidgetButton:()=>i});var n=r(50959),o=r(97754),l=r(9745),a=r(78029);const s=a,i=n.forwardRef(((e,t)=>{const{tag:r="div",icon:s,endIcon:i,isActive:c,isOpened:u,isDisabled:d,isGrouped:m,isHovered:p,isClicked:h,onClick:g,text:v,textBeforeIcon:f,title:y,theme:b=a,className:S,forceInteractive:x,inactive:w,"data-name":k,"data-tooltip":C,...E}=e,I=o(S,b.button,(y||C)&&"apply-common-tooltip",{[b.isActive]:c,[b.isOpened]:u,[b.isInteractive]:(x||Boolean(g))&&!d&&!w,[b.isDisabled]:Boolean(d||w),[b.isGrouped]:m,[b.hover]:p,[b.clicked]:h}),L=s&&("string"==typeof s?n.createElement(l.Icon,{className:b.icon,icon:s}):n.cloneElement(s,{className:o(b.icon,s.props.className)}));return"button"===r?n.createElement("button",{...E,ref:t,type:"button",className:o(I,b.accessible),disabled:d&&!w,onClick:g,title:y,"data-name":k,"data-tooltip":C},f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),L,!f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v)):n.createElement("div",{...E,ref:t,"data-role":"button",className:I,onClick:d?void 0:g,title:y,"data-name":k,"data-tooltip":C},f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),L,!f&&v&&n.createElement("div",{className:o("js-button-text",b.text)},v),i&&n.createElement(l.Icon,{icon:i,className:a.endIcon}))}))},24658:(e,t,r)=>{"use strict";r.d(t,{VISIBLE_TYPESPECS:()=>a,marketType:()=>s});var n=r(11542)
|
||||
;const o=new Map([["cfd",n.t(null,void 0,r(87592))],["dr",n.t(null,void 0,r(67245))],["index",n.t(null,void 0,r(12754))],["forex",n.t(null,void 0,r(39512))],["right",n.t(null,{context:"symbol_type"},r(9898))],["bond",n.t(null,void 0,r(79852))],["bitcoin",n.t(null,void 0,r(8448))],["crypto",n.t(null,void 0,r(8448))],["economic",n.t(null,void 0,r(88720))],["indices",n.t(null,void 0,r(60804))],["futures",n.t(null,void 0,r(81859))],["stock",n.t(null,void 0,r(36931))],["commodity",n.t(null,void 0,r(12629))]]);r(42053);const l=new Map,a=new Set(["cfd","spreadbet","defi","yield","government","corporate","mutual","money","etf","unit","trust","reit","etn","convertible","closedend","crypto","oracle"]);function s(e,t=[],r=!0){const n=t.filter((e=>a.has(e))),s=`${e}_${n.sort().join("_")}`,i=l.get(s);if(void 0!==i)return i;const c=r?function(e){return o.get(e)||e}(e):e,u=Boolean(t.length)?[c,...n].join(" "):c;return l.set(s,u),u}},2948:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3.92 7.83 9 12.29l5.08-4.46-1-1.13L9 10.29l-4.09-3.6-.99 1.14Z"/></svg>'},52019:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M13.35 5.35a.5.5 0 0 0-.7-.7L9 8.29 5.35 4.65a.5.5 0 1 0-.7.7L8.29 9l-3.64 3.65a.5.5 0 0 0 .7.7L9 9.71l3.65 3.64a.5.5 0 0 0 .7-.7L9.71 9l3.64-3.65z"/></svg>'},95694:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M17 22.5 6.85 12.35a.5.5 0 0 1 0-.7L17 1.5"/></svg>'},49498: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" stroke-linecap="round" stroke-width="1.2" d="M12 16.5 4.85 9.35a.5.5 0 0 1 0-.7L12 1.5"/></svg>'},60176:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M9.5 12.5 3.9 7.37a.5.5 0 0 1 0-.74L9.5 1.5"/></svg>'},35369:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M8 10.5 3.85 6.35a.5.5 0 0 1 0-.7L8 1.5"/></svg>'},58478:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.2" d="M7 8.5 3.85 5.35a.5.5 0 0 1 0-.7L7 1.5"/></svg>'},73063:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M17 22.5 6.85 12.35a.5.5 0 0 1 0-.7L17 1.5"/></svg>'},14127: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" stroke-linecap="round" stroke-width="1.5" d="M12 16.5 4.85 9.35a.5.5 0 0 1 0-.7L12 1.5"/></svg>'},18073:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M9.5 12.5 3.9 7.37a.5.5 0 0 1 0-.74L9.5 1.5"/></svg>'},99243:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M8 10.5 3.85 6.35a.5.5 0 0 1 0-.7L8 1.5"/></svg>'},42576:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M7 8.5 3.85 5.35a.5.5 0 0 1 0-.7L7 1.5"/></svg>'},578:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8" width="16" height="8"><path fill="currentColor" d="M0 1.475l7.396 6.04.596.485.593-.49L16 1.39 14.807 0 7.393 6.122 8.58 6.12 1.186.08z"/></svg>'},91540: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="M2.5 14.5c1.68-1.26 3.7-2 6.5-2s4.91.74 6.5 2m-13-11c1.68 1.26 3.7 2 6.5 2s4.91-.74 6.5-2"/><circle stroke="currentColor" cx="9" cy="9" r="8.5"/><path stroke="currentColor" d="M13.5 9c0 2.42-.55 4.58-1.4 6.12-.87 1.56-1.98 2.38-3.1 2.38s-2.23-.82-3.1-2.38c-.85-1.54-1.4-3.7-1.4-6.12s.55-4.58 1.4-6.12C6.77 1.32 7.88.5 9 .5s2.23.82 3.1 2.38c.85 1.54 1.4 3.7 1.4 6.12z"/></svg>'},66619:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="120" height="120"><path fill="#B2B5BE" fill-rule="evenodd" d="M23 39a36 36 0 0 1 72 0v13.15l15.1 8.44 2.16 1.2-1.64 1.86-12.85 14.59 3.73 4.03L98.57 85 95 81.13V117H77v-12H67v9H50V95H40v22H23V81.28l-3.8 3.61-2.76-2.9 4.05-3.84-12.77-14.5-1.64-1.86 2.16-1.2L23 52.34V39Zm72 36.33 10.98-12.46L95 56.73v18.6ZM23 56.92v18.03L12.35 62.87 23 56.92ZM59 7a32 32 0 0 0-32 32v74h9V91h18v19h9v-9h18v12h10V39A32 32 0 0 0 59 7Zm-7 36a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm19 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></svg>'},67562:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="120" height="120"><path fill="#131722" fill-rule="evenodd" d="M23 39a36 36 0 0 1 72 0v13.15l15.1 8.44 2.16 1.2-1.64 1.86-12.85 14.59 3.73 4.03L98.57 85 95 81.13V117H77v-12H67v9H50V95H40v22H23V81.28l-3.8 3.61-2.76-2.9 4.05-3.84-12.77-14.5-1.64-1.86 2.16-1.2L23 52.34V39Zm72 36.33 10.98-12.46L95 56.73v18.6ZM23 56.92v18.03L12.35 62.87 23 56.92ZM59 7a32 32 0 0 0-32 32v74h9V91h18v19h9v-9h18v12h10V39A32 32 0 0 0 59 7Zm-7 36a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm19 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></svg>'},69859:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none"><path stroke="currentColor" d="M12.4 12.5a7 7 0 1 0-4.9 2 7 7 0 0 0 4.9-2zm0 0l5.101 5"/></svg>'},
|
||||
69533:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none"><path stroke="currentColor" d="M8 5l3.5 3.5L8 12"/></svg>'},486:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path fill="none" stroke="currentColor" stroke-linecap="square" d="M2.5 6.5h9"/><circle fill="currentColor" cx="7" cy="3" r="1"/><circle fill="currentColor" cx="7" cy="10" r="1"/></svg>'},63861:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><g fill="none" fill-rule="evenodd" stroke="currentColor"><path stroke-linecap="square" stroke-linejoin="round" d="M3.5 10V2.5L1 5"/><path stroke-linecap="square" d="M1.5 10.5h4"/><path d="M8 12l3-11"/></g></svg>'},81574:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path fill="none" stroke="currentColor" stroke-linecap="square" d="M2.5 6.5h8"/></svg>'},32617:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path fill="none" stroke="currentColor" stroke-linecap="square" d="M3 10l7-7M3 3l7 7"/></svg>'},35119:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path fill="none" stroke="currentColor" stroke-linecap="square" d="M2.5 6.5h8m-4-4v8"/></svg>'},69135:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path fill="none" stroke="currentColor" stroke-linecap="square" d="M3 7l3.5-3.5L10 7"/></svg>'},86240:e=>{"use strict";e.exports=JSON.parse('{"size-header-height":"64px","media-phone-vertical":"screen and (max-width: 479px)","media-mf-phone-landscape":"screen and (min-width: 568px)"}')}}]);
|
||||
@@ -0,0 +1,4 @@
|
||||
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7271],{18429:(e,t,s)=>{"use strict";s.d(t,{SEPARATOR_PREFIX:()=>o,isSeparatorItem:()=>r});const o="###";function r(e){return e.startsWith(o)}},3685:(e,t,s)=>{"use strict";function o(){var e,t,s;return null!==(s=null===(t=null===(e=window.configurationData)||void 0===e?void 0:e.exchanges)||void 0===t?void 0:t.map((e=>({...e,country:"",providerId:"",flag:""}))))&&void 0!==s?s:[]}s.d(t,{getExchanges:()=>o})},58442:(e,t,s)=>{"use strict";s.d(t,{QualifiedSources:()=>o,qualifyProName:()=>i});var o,r=s(50151),n=s(14483);s(81319);function i(e){return e}!function(e){function t(e){return e.pro_name}function s(e){{const t=n.enabled("pay_attention_to_ticker_not_symbol")?e.ticker:e.full_name;return(0,r.ensureDefined)(t)}}e.fromQuotesSnapshot=function(e){return"error"===e.status?e.symbolname:e.values.pro_name},e.fromQuotesResponse=function(e){const{values:s,symbolname:o,status:r}=e;return"error"===r&&o?o:t(s)},e.fromQuotes=t,e.fromSymbolSearchResult=function(e,t){var s;{const{ticker:o,full_name:i,symbol:a}=null!=t?t:e;return n.enabled("pay_attention_to_ticker_not_symbol")?(0,r.ensureDefined)(null!==(s=null!=o?o:i)&&void 0!==s?s:a):(0,r.ensureDefined)(null!=i?i:a)}},e.fromSymbolInfo=s,e.fromSymbolMessage=function(e,t){return"symbol_resolved"===t.method?s(t.params[1]):e}}(o||(o={}))},20882:(e,t,s)=>{"use strict";s.d(t,{createSearchSources:()=>a,filterSearchSources:()=>n,isAllSearchSourcesSelected:()=>r,splitSearchSourcesByGroup:()=>i});const o=[];function r(e){return""===e.value()}function n(e,t){return e.filter((e=>e.includes(t)))}function i(e){const t=new Map;e.forEach((e=>{t.has(e.group())?t.get(e.group()).push(e):t.set(e.group(),[e])}));for(const e of t.values()){e[0].group()!==ExchangeGroup.NorthAmerica&&e.sort(((e,t)=>e.name().toLowerCase()>t.name().toLowerCase()?1:-1))}return new Map([...t.entries()].sort((([e],[t])=>o.indexOf(e)-o.indexOf(t))))}function a(e,t){return t.map((t=>new e(t)))}},81319:(e,t,s)=>{"use strict";s.d(t,{createGroupColumns:()=>m,exchangeSelectDisabled:()=>h,getAllSymbolTypesValue:()=>u,getAvailableSearchSources:()=>c,getAvailableSymbolTypes:()=>d,getDefaultSearchSource:()=>l,getSymbolFullName:()=>a,isSeparateSymbolSearchTabs:()=>y});var o=s(11542),r=s(20882);class n{constructor(e){this._exchange=e}value(){return this._exchange.value}name(){return(0,r.isAllSearchSourcesSelected)(this)?o.t(null,void 0,s(64498)):this._exchange.name}description(){return this._exchange.desc}country(){return this._exchange.country}providerId(){return this._exchange.providerId}group(){return this._exchange.group}includes(e){return function(e,t){const s=t.toLowerCase(),{name:o,desc:r,searchTerms:n}=e;return o.toLowerCase().includes(s)||r.toLowerCase().includes(s)||void 0!==n&&n.some((e=>e.toLowerCase().includes(s)))}(this._exchange,e)}getRequestExchangeValue(){return this._exchange.value}getRequestCountryValue(){}}var i=s(3685);function a(e){if(e.fullName)return e.fullName;let t;return t=e.prefix||e.exchange?(e.prefix||e.exchange)+":"+e.name:e.name,
|
||||
t.replace(/<\/?[^>]+(>|$)/g,"")}function l(){const e=c();return e.find(r.isAllSearchSourcesSelected)||e[0]||null}function c(){return(0,r.createSearchSources)(n,(0,i.getExchanges)())}function d(){return window.ChartApiInstance.supportedSymbolsTypes()}function u(){return""}function h(e){return!!y&&!TAB_SOURCE_FILTER_MAP[e]}function m(e,t=2){if(0===e.length)return[];if(1===t)return[e];const s=Math.floor(e.length/2)+e.length%2;return[e.slice(0,s),e.slice(s)].filter((e=>e.length>0))}const y=!1},56217:(e,t,s)=>{"use strict";s.r(t),s.d(t,{CompareModel:()=>I});var o=s(50151),r=s(14483),n=s(19171),i=s(27856),a=s(97145),l=s(46148),c=s(64063),d=s(8561),u=s(3685),h=s(58442);new Set(r.enabled("widget")?["pro_name","short_name","description","exchange","type","country_code","provider_id","typespecs"]:["pro_name","short_name","description","exchange","type","country_code","provider_id","typespecs","logoid","currency-logoid","base-currency-logoid"]);const m=(0,u.getExchanges)(),y={};for(const e of m)y[e.value]={country:e.country,providerId:e.providerId};var _=s(88145);function S(e){return e instanceof c.study_Overlay||e instanceof d.StudyCompare}function p(e,t,s){const o=h.QualifiedSources.fromSymbolInfo(e),r=function(e){if(!e)return;const[t,s]=e.split(":");return s&&t&&y[t]?y[t]:void 0}(o),n={id:(null==s?void 0:s.id())||o,symbol:o,checked:t,title:e.name,description:e.description,exchangeName:e.exchange,country:null==r?void 0:r.country,providerId:null==r?void 0:r.providerId,marketType:e.type,study:s,isYield:(0,_.isYield)(e)};{const t=e;t.logo_urls&&t.logo_urls.length&&(t.logo_urls.length>1?(n.baseCurrencyLogoId=t.logo_urls[0],n.currencyLogoId=t.logo_urls[1]):n.logoId=t.logo_urls[0]),t.exchange_logo&&(n.providerId=t.exchange_logo)}return n}function f(e,t,s,o){return{id:void 0!==s?s.id():e,symbol:e,checked:t,title:e,study:s,description:o}}var g=s(56840),b=s(76422),v=s(18429);class I{constructor(e){this._contentItemList=new a.WatchedValue([]),this._checkedSymbols=new Map,this._recentLength=10,this._isDataReady=new a.WatchedValue(!1),this._highlightedSymbol=new a.WatchedValue(null),this._defaultSymbolsDescriptions=new Map,this._idToStudyMap=new Map,this._chartSession=null,this._recentSymbolsEnabled=r.enabled("compare_recent_symbols_enabled"),this._preventHandleSourcesChange=!0,this.removeStudy=e=>{const{symbol:t,study:s}=e;if(!s)return;this._chartWidget.model().removeSource(s,!1);const o=this._checkedSymbols.get(t);o&&o.length>1?this._removeStudyIdFromCheckedSymbols(t,s.id()):this._checkedSymbols.delete(t),this._updateContentItemList(this._contentItemList.value(),!0)},this._getResolveSymbolPromise=(e,t)=>new Promise((s=>{const r=(0,o.ensureNotNull)(this._chartSession).resolveSymbol((0,n.makeNextSymbolId)(),(0,i.encodeExtendedSymbolOrGetSimpleSymbolString)({symbol:e}),s);t&&t.set(e,r)})),this._chartWidget=e.activeChartWidget.value(),this._chartSession=this._chartWidget.model().model().chartApi();const t=new Set(this._loadRecent().reverse()),s=new Set,l=new Set,c=this._chartWidget.model().model().dataSources().filter(S),d=c.map((e=>{
|
||||
const t=e.symbolInfo();if(t)return Promise.resolve(h.QualifiedSources.fromSymbolInfo(t));const s=e.symbol();return(0,h.qualifyProName)(s)}));Promise.all(d).then((e=>{const o=e.map(((e,t)=>c[t]));e.forEach(((e,r)=>{const n=o[r],i=n.id();this._addStudyIdToCheckedSymbols(e,i),this._idToStudyMap.set(i,n),t.has(e)?s.add(e):l.add(e)}));const r=Array.from(t).filter((e=>this._checkedSymbols.has(e))).reduce(((e,t)=>(s.has(t)&&e.push(t),e)),[]).concat(Array.from(l)),n=Array.from(t);if(this._recentSymbolsEnabled&&n.length<this._recentLength){let e;e=[],this._chartWidget.compareSymbols()&&this._chartWidget.compareSymbols().forEach((t=>{e.push((0,h.qualifyProName)(t.symbol)),this._defaultSymbolsDescriptions.set(t.symbol,t.title)}));const t=[...n,...e];r.push(...t)}else r.push(...n);const i=Array.from(new Set(r));{const e=new Map,t=i.map((t=>this._getResolveSymbolPromise(t,e)));Promise.all(t).then((t=>this._handleInitProcess(r,(s=>{const o=e.get(s);return t.find((e=>e.params[0]===o))}),((e,t)=>h.QualifiedSources.fromSymbolMessage(t,e)),((e,t,s,o)=>"symbol_resolved"===e.method?p(e.params[1],s,o):f(t,s,o,this._getSymbolDescription(t))))))}}))}chartModel(){return this._chartWidget.model().model()}comparableOnSameScale(e){return this._chartWidget.model().model().mainSeries().isYield()&&Boolean(e.isYield)}handleSourcesChange(){if(this._preventHandleSourcesChange)return;const e=this.chartModel().dataSources().filter(S),t=new Set(e.map((e=>e.id())));Array.from(t).forEach((e=>{if(!this._checkedStudiesIds().has(e)){const t=this.chartModel().dataSourceForId(e)||null;if(null!==t&&S(t)){const t=this._getContentItemByStudyId(e);if(!t)return;this._addStudyIdToCheckedSymbols(t.symbol,e),this._saveRecent(t.symbol),this._updateContentItemList(this._contentItemList.value(),!0)}}}));Array.from(this._checkedStudiesIds()).forEach((e=>{if(!t.has(e)){const t=this._getContentItemByStudyId(e);if(!t)return;const s=this._checkedSymbols.get(t.symbol);s&&s.length>1?this._removeStudyIdFromCheckedSymbols(t.symbol,e):this._checkedSymbols.delete(t.symbol),this._updateContentItemList(this._contentItemList.value(),!0)}}))}studies(){return this._contentItemList.readonly()}isDataReady(){return this._isDataReady.readonly()}highlightedSymbol(){return this._highlightedSymbol.readonly()}applyStudy(e,t,s){(()=>{const o=this._chartWidget;if(!o)return;if(r=e,(0,v.isSeparatorItem)(r))return;var r;let n;switch(t){case l.CompareOption.SamePctScale:n=o.addCompareAsOverlay(e,s);break;case l.CompareOption.SameScale:n=o.addCompareAsOverlay(e,s,!0);break;case l.CompareOption.NewPriceScale:n=o.addOverlayStudy(e,!0,s);break;case l.CompareOption.NewPane:n=o.addOverlayStudy(e,!1,s)}Promise.all([this._getResolveSymbolPromise(e),n]).then((t=>this._handleApplyProcess(t,(t=>h.QualifiedSources.fromSymbolMessage(e,t)),((e,t,s)=>"symbol_resolved"===e.method?p(e.params[1],!0,s):f(t,!0,s))))),b.emit("add_compare")})()}_snapshoter(){throw new Error("not implemented")}_handleApplyProcess(e,t,s){const[o,r]=e;if(!o||null===r)return;const n=r.id(),i=t(o),a=s(o,i,r);this._saveRecent(i),
|
||||
this._addStudyIdToCheckedSymbols(i,n),this._showNewItem(a,i,n)}_handleInitProcess(e,t,s,o){const r=[];for(const n of e){const e=t(n);if(!e)continue;const i=s(e,n),a=this._checkedSymbols.get(i),l=-1!==r.findIndex((e=>e.symbol===i));if(void 0===a||l)this._recentSymbolsEnabled&&r.push(o(e,i,!1));else for(const t of a)r.push(o(e,i,!0,this._idToStudyMap.get(t)))}this._updateContentItemList(r),this._isDataReady.setValue(!0)}_showNewItem(e,t,s){const o=this._contentItemList.value().map(this._updateChecked,this);o.unshift(e),this._recentSymbolsEnabled&&o.unshift({...e,id:t,study:void 0,checked:!1}),this._updateContentItemList(o),this._highlightedSymbol.setValue(s),setTimeout((()=>this._highlightedSymbol.setValue(null)),500)}_addStudyIdToCheckedSymbols(e,t){const s=this._checkedSymbols.get(e)||[];this._checkedSymbols.set(e,[...s,t])}_removeStudyIdFromCheckedSymbols(e,t){const s=this._checkedSymbols.get(e);if(s){const o=s.indexOf(t);s.splice(o,1),this._checkedSymbols.set(e,s)}}_updateChecked(e){var t;const s=this._checkedSymbols.get(e.symbol),o=null===(t=e.study)||void 0===t?void 0:t.id();return o?{...e,checked:Boolean(s&&s.includes(o))}:e}_updateContentItemList(e,t){const s=t?e.map(this._updateChecked,this):e,o=s.filter((e=>e.checked));if(this._recentSymbolsEnabled){const e=new Set,t=s.reduce(((t,s)=>(s.checked||e.has(s.symbol)||(t.push(s),e.add(s.symbol)),t)),[]).slice(0,this._recentLength);this._contentItemList.setValue(o.concat(t))}else this._contentItemList.setValue(o)}_checkedStudiesIds(){const e=[].concat(...Array.from(this._checkedSymbols.values()));return new Set(e)}_getContentItemByStudyId(e){const t=this._contentItemList.value(),s=t.findIndex((t=>t.study&&t.study.id()===e));return t[s]}_loadRecent(){if(!this._recentSymbolsEnabled)return[];return g.getJSON("CompareDialog.recent",[]).filter((e=>"string"==typeof e))}_saveRecent(e){if(!this._recentSymbolsEnabled)return;const t=new Set(this._loadRecent());t.has(e)&&t.delete(e),t.add(e),g.setJSON("CompareDialog.recent",Array.from(t).slice(-this._recentLength))}_getSymbolDescription(e){var t;return this._defaultSymbolsDescriptions.size&&null!==(t=this._defaultSymbolsDescriptions.get(e))&&void 0!==t?t:""}}I._snapshoter=null},46148:(e,t,s)=>{"use strict";var o;s.d(t,{CompareOption:()=>o}),function(e){e[e.SamePctScale=0]="SamePctScale",e[e.NewPriceScale=1]="NewPriceScale",e[e.NewPane=2]="NewPane",e[e.SameScale=3]="SameScale"}(o||(o={}))},64498:e=>{e.exports={ar:["كل المصادر"],ca_ES:["Totes les fonts"],cs:"All sources",de:["Alle Quellen"],el:"All sources",en:"All sources",es:["Todas las fuentes"],fa:"All sources",fr:["Toutes les sources"],he_IL:["כל המקורות"],hu_HU:"All sources",id_ID:["Seluruh sumber"],it:["Tutte le fonti"],ja:["すべての提供元"],ko:["모든 자료"],ms_MY:["Kesemua sumber"],nl_NL:"All sources",pl:["Wszystkie źródła"],pt:["Todas as fontes"],ro:"All sources",ru:["Все источники"],sv:["Samtliga källor"],th:["แหล่งที่มาทั้งหมด"],tr:["Tüm kaynaklar"],vi:["Tất cả các nguồn"],zh:["全部来源"],zh_TW:["全部來源"]}}}]);
|
||||
@@ -1,4 +0,0 @@
|
||||
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7271],{18429:(e,t,s)=>{"use strict";s.d(t,{SEPARATOR_PREFIX:()=>o,isSeparatorItem:()=>r});const o="###";function r(e){return e.startsWith(o)}},3685:(e,t,s)=>{"use strict";function o(){var e,t,s;return null!==(s=null===(t=null===(e=window.configurationData)||void 0===e?void 0:e.exchanges)||void 0===t?void 0:t.map((e=>({...e,country:"",providerId:"",flag:""}))))&&void 0!==s?s:[]}s.d(t,{getExchanges:()=>o})},58442:(e,t,s)=>{"use strict";s.d(t,{QualifiedSources:()=>o,qualifyProName:()=>i});var o,r=s(50151),n=s(14483);s(81319);function i(e){return e}!function(e){function t(e){return e.pro_name}function s(e){{const t=n.enabled("pay_attention_to_ticker_not_symbol")?e.ticker:e.full_name;return(0,r.ensureDefined)(t)}}e.fromQuotesSnapshot=function(e){return"error"===e.status?e.symbolname:e.values.pro_name},e.fromQuotesResponse=function(e){const{values:s,symbolname:o,status:r}=e;return"error"===r&&o?o:t(s)},e.fromQuotes=t,e.fromSymbolSearchResult=function(e,t){{const{ticker:s,full_name:o}=null!=t?t:e;return n.enabled("pay_attention_to_ticker_not_symbol")?(0,r.ensureDefined)(null!=s?s:o):(0,r.ensureDefined)(o)}},e.fromSymbolInfo=s,e.fromSymbolMessage=function(e,t){return"symbol_resolved"===t.method?s(t.params[1]):e}}(o||(o={}))},20882:(e,t,s)=>{"use strict";s.d(t,{createSearchSources:()=>a,filterSearchSources:()=>n,isAllSearchSourcesSelected:()=>r,splitSearchSourcesByGroup:()=>i});const o=[];function r(e){return""===e.value()}function n(e,t){return e.filter((e=>e.includes(t)))}function i(e){const t=new Map;e.forEach((e=>{t.has(e.group())?t.get(e.group()).push(e):t.set(e.group(),[e])}));for(const e of t.values()){e[0].group()!==ExchangeGroup.NorthAmerica&&e.sort(((e,t)=>e.name().toLowerCase()>t.name().toLowerCase()?1:-1))}return new Map([...t.entries()].sort((([e],[t])=>o.indexOf(e)-o.indexOf(t))))}function a(e,t){return t.map((t=>new e(t)))}},81319:(e,t,s)=>{"use strict";s.d(t,{createGroupColumns:()=>m,exchangeSelectDisabled:()=>h,getAllSymbolTypesValue:()=>u,getAvailableSearchSources:()=>c,getAvailableSymbolTypes:()=>d,getDefaultSearchSource:()=>l,getSymbolFullName:()=>a,isSeparateSymbolSearchTabs:()=>y});var o=s(11542),r=s(20882);class n{constructor(e){this._exchange=e}value(){return this._exchange.value}name(){return(0,r.isAllSearchSourcesSelected)(this)?o.t(null,void 0,s(64498)):this._exchange.name}description(){return this._exchange.desc}country(){return this._exchange.country}providerId(){return this._exchange.providerId}group(){return this._exchange.group}includes(e){return function(e,t){const s=t.toLowerCase(),{name:o,desc:r,searchTerms:n}=e;return o.toLowerCase().includes(s)||r.toLowerCase().includes(s)||void 0!==n&&n.some((e=>e.toLowerCase().includes(s)))}(this._exchange,e)}getRequestExchangeValue(){return this._exchange.value}getRequestCountryValue(){}}var i=s(3685);function a(e){if(e.fullName)return e.fullName;let t;return t=e.prefix||e.exchange?(e.prefix||e.exchange)+":"+e.name:e.name,t.replace(/<\/?[^>]+(>|$)/g,"")}function l(){const e=c()
|
||||
;return e.find(r.isAllSearchSourcesSelected)||e[0]||null}function c(){return(0,r.createSearchSources)(n,(0,i.getExchanges)())}function d(){return window.ChartApiInstance.supportedSymbolsTypes()}function u(){return""}function h(e){return!!y&&!TAB_SOURCE_FILTER_MAP[e]}function m(e,t=2){if(0===e.length)return[];if(1===t)return[e];const s=Math.floor(e.length/2)+e.length%2;return[e.slice(0,s),e.slice(s)].filter((e=>e.length>0))}const y=!1},56217:(e,t,s)=>{"use strict";s.r(t),s.d(t,{CompareModel:()=>I});var o=s(50151),r=s(14483),n=s(19171),i=s(27856),a=s(97145),l=s(46148),c=s(64063),d=s(8561),u=s(3685),h=s(58442);new Set(r.enabled("widget")?["pro_name","short_name","description","exchange","type","country_code","provider_id","typespecs"]:["pro_name","short_name","description","exchange","type","country_code","provider_id","typespecs","logoid","currency-logoid","base-currency-logoid"]);const m=(0,u.getExchanges)(),y={};for(const e of m)y[e.value]={country:e.country,providerId:e.providerId};var _=s(88145);function S(e){return e instanceof c.study_Overlay||e instanceof d.StudyCompare}function p(e,t,s){const o=h.QualifiedSources.fromSymbolInfo(e),r=function(e){if(!e)return;const[t,s]=e.split(":");return s&&t&&y[t]?y[t]:void 0}(o),n={id:(null==s?void 0:s.id())||o,symbol:o,checked:t,title:e.name,description:e.description,exchangeName:e.exchange,country:null==r?void 0:r.country,providerId:null==r?void 0:r.providerId,marketType:e.type,study:s,isYield:(0,_.isYield)(e)};{const t=e;t.logo_urls&&t.logo_urls.length&&(t.logo_urls.length>1?(n.baseCurrencyLogoId=t.logo_urls[0],n.currencyLogoId=t.logo_urls[1]):n.logoId=t.logo_urls[0]),t.exchange_logo&&(n.providerId=t.exchange_logo)}return n}function f(e,t,s,o){return{id:void 0!==s?s.id():e,symbol:e,checked:t,title:e,study:s,description:o}}var g=s(56840),b=s(76422),v=s(18429);class I{constructor(e){this._contentItemList=new a.WatchedValue([]),this._checkedSymbols=new Map,this._recentLength=10,this._isDataReady=new a.WatchedValue(!1),this._highlightedSymbol=new a.WatchedValue(null),this._defaultSymbolsDescriptions=new Map,this._idToStudyMap=new Map,this._chartSession=null,this._recentSymbolsEnabled=r.enabled("compare_recent_symbols_enabled"),this._preventHandleSourcesChange=!0,this.removeStudy=e=>{const{symbol:t,study:s}=e;if(!s)return;this._chartWidget.model().removeSource(s,!1);const o=this._checkedSymbols.get(t);o&&o.length>1?this._removeStudyIdFromCheckedSymbols(t,s.id()):this._checkedSymbols.delete(t),this._updateContentItemList(this._contentItemList.value(),!0)},this._getResolveSymbolPromise=(e,t)=>new Promise((s=>{const r=(0,o.ensureNotNull)(this._chartSession).resolveSymbol((0,n.makeNextSymbolId)(),(0,i.encodeExtendedSymbolOrGetSimpleSymbolString)({symbol:e}),s);t&&t.set(e,r)})),this._chartWidget=e.activeChartWidget.value(),this._chartSession=this._chartWidget.model().model().chartApi();const t=new Set(this._loadRecent().reverse()),s=new Set,l=new Set,c=this._chartWidget.model().model().dataSources().filter(S),d=c.map((e=>{const t=e.symbolInfo()
|
||||
;if(t)return Promise.resolve(h.QualifiedSources.fromSymbolInfo(t));const s=e.symbol();return(0,h.qualifyProName)(s)}));Promise.all(d).then((e=>{const o=e.map(((e,t)=>c[t]));e.forEach(((e,r)=>{const n=o[r],i=n.id();this._addStudyIdToCheckedSymbols(e,i),this._idToStudyMap.set(i,n),t.has(e)?s.add(e):l.add(e)}));const r=Array.from(t).filter((e=>this._checkedSymbols.has(e))).reduce(((e,t)=>(s.has(t)&&e.push(t),e)),[]).concat(Array.from(l)),n=Array.from(t);if(this._recentSymbolsEnabled&&n.length<this._recentLength){let e;e=[],this._chartWidget.compareSymbols()&&this._chartWidget.compareSymbols().forEach((t=>{e.push((0,h.qualifyProName)(t.symbol)),this._defaultSymbolsDescriptions.set(t.symbol,t.title)}));const t=[...n,...e];r.push(...t)}else r.push(...n);const i=Array.from(new Set(r));{const e=new Map,t=i.map((t=>this._getResolveSymbolPromise(t,e)));Promise.all(t).then((t=>this._handleInitProcess(r,(s=>{const o=e.get(s);return t.find((e=>e.params[0]===o))}),((e,t)=>h.QualifiedSources.fromSymbolMessage(t,e)),((e,t,s,o)=>"symbol_resolved"===e.method?p(e.params[1],s,o):f(t,s,o,this._getSymbolDescription(t))))))}}))}chartModel(){return this._chartWidget.model().model()}comparableOnSameScale(e){return this._chartWidget.model().model().mainSeries().isYield()&&Boolean(e.isYield)}handleSourcesChange(){if(this._preventHandleSourcesChange)return;const e=this.chartModel().dataSources().filter(S),t=new Set(e.map((e=>e.id())));Array.from(t).forEach((e=>{if(!this._checkedStudiesIds().has(e)){const t=this.chartModel().dataSourceForId(e)||null;if(null!==t&&S(t)){const t=this._getContentItemByStudyId(e);if(!t)return;this._addStudyIdToCheckedSymbols(t.symbol,e),this._saveRecent(t.symbol),this._updateContentItemList(this._contentItemList.value(),!0)}}}));Array.from(this._checkedStudiesIds()).forEach((e=>{if(!t.has(e)){const t=this._getContentItemByStudyId(e);if(!t)return;const s=this._checkedSymbols.get(t.symbol);s&&s.length>1?this._removeStudyIdFromCheckedSymbols(t.symbol,e):this._checkedSymbols.delete(t.symbol),this._updateContentItemList(this._contentItemList.value(),!0)}}))}studies(){return this._contentItemList.readonly()}isDataReady(){return this._isDataReady.readonly()}highlightedSymbol(){return this._highlightedSymbol.readonly()}applyStudy(e,t,s){(()=>{const o=this._chartWidget;if(!o)return;if(r=e,(0,v.isSeparatorItem)(r))return;var r;let n;switch(t){case l.CompareOption.SamePctScale:n=o.addCompareAsOverlay(e,s);break;case l.CompareOption.SameScale:n=o.addCompareAsOverlay(e,s,!0);break;case l.CompareOption.NewPriceScale:n=o.addOverlayStudy(e,!0,s);break;case l.CompareOption.NewPane:n=o.addOverlayStudy(e,!1,s)}Promise.all([this._getResolveSymbolPromise(e),n]).then((t=>this._handleApplyProcess(t,(t=>h.QualifiedSources.fromSymbolMessage(e,t)),((e,t,s)=>"symbol_resolved"===e.method?p(e.params[1],!0,s):f(t,!0,s))))),b.emit("add_compare")})()}_snapshoter(){throw new Error("not implemented")}_handleApplyProcess(e,t,s){const[o,r]=e;if(!o||null===r)return;const n=r.id(),i=t(o),a=s(o,i,r);this._saveRecent(i),
|
||||
this._addStudyIdToCheckedSymbols(i,n),this._showNewItem(a,i,n)}_handleInitProcess(e,t,s,o){const r=[];for(const n of e){const e=t(n);if(!e)continue;const i=s(e,n),a=this._checkedSymbols.get(i),l=-1!==r.findIndex((e=>e.symbol===i));if(void 0===a||l)this._recentSymbolsEnabled&&r.push(o(e,i,!1));else for(const t of a)r.push(o(e,i,!0,this._idToStudyMap.get(t)))}this._updateContentItemList(r),this._isDataReady.setValue(!0)}_showNewItem(e,t,s){const o=this._contentItemList.value().map(this._updateChecked,this);o.unshift(e),this._recentSymbolsEnabled&&o.unshift({...e,id:t,study:void 0,checked:!1}),this._updateContentItemList(o),this._highlightedSymbol.setValue(s),setTimeout((()=>this._highlightedSymbol.setValue(null)),500)}_addStudyIdToCheckedSymbols(e,t){const s=this._checkedSymbols.get(e)||[];this._checkedSymbols.set(e,[...s,t])}_removeStudyIdFromCheckedSymbols(e,t){const s=this._checkedSymbols.get(e);if(s){const o=s.indexOf(t);s.splice(o,1),this._checkedSymbols.set(e,s)}}_updateChecked(e){var t;const s=this._checkedSymbols.get(e.symbol),o=null===(t=e.study)||void 0===t?void 0:t.id();return o?{...e,checked:Boolean(s&&s.includes(o))}:e}_updateContentItemList(e,t){const s=t?e.map(this._updateChecked,this):e,o=s.filter((e=>e.checked));if(this._recentSymbolsEnabled){const e=new Set,t=s.reduce(((t,s)=>(s.checked||e.has(s.symbol)||(t.push(s),e.add(s.symbol)),t)),[]).slice(0,this._recentLength);this._contentItemList.setValue(o.concat(t))}else this._contentItemList.setValue(o)}_checkedStudiesIds(){const e=[].concat(...Array.from(this._checkedSymbols.values()));return new Set(e)}_getContentItemByStudyId(e){const t=this._contentItemList.value(),s=t.findIndex((t=>t.study&&t.study.id()===e));return t[s]}_loadRecent(){if(!this._recentSymbolsEnabled)return[];return g.getJSON("CompareDialog.recent",[]).filter((e=>"string"==typeof e))}_saveRecent(e){if(!this._recentSymbolsEnabled)return;const t=new Set(this._loadRecent());t.has(e)&&t.delete(e),t.add(e),g.setJSON("CompareDialog.recent",Array.from(t).slice(-this._recentLength))}_getSymbolDescription(e){var t;return this._defaultSymbolsDescriptions.size&&null!==(t=this._defaultSymbolsDescriptions.get(e))&&void 0!==t?t:""}}I._snapshoter=null},46148:(e,t,s)=>{"use strict";var o;s.d(t,{CompareOption:()=>o}),function(e){e[e.SamePctScale=0]="SamePctScale",e[e.NewPriceScale=1]="NewPriceScale",e[e.NewPane=2]="NewPane",e[e.SameScale=3]="SameScale"}(o||(o={}))},64498:e=>{e.exports={ar:["كل المصادر"],ca_ES:["Totes les fonts"],cs:"All sources",de:["Alle Quellen"],el:"All sources",en:"All sources",es:["Todas las fuentes"],fa:"All sources",fr:["Toutes les sources"],he_IL:["כל המקורות"],hu_HU:"All sources",id_ID:["Seluruh sumber"],it:["Tutte le fonti"],ja:["すべての提供元"],ko:["모든 자료"],ms_MY:["Kesemua sumber"],nl_NL:"All sources",pl:["Wszystkie źródła"],pt:["Todas as fontes"],ro:"All sources",ru:["Все источники"],sv:["Samtliga källor"],th:["แหล่งที่มาทั้งหมด"],tr:["Tüm kaynaklar"],vi:["Tất cả các nguồn"],zh:["全部来源"],zh_TW:["全部來源"]}}}]);
|
||||
@@ -42,14 +42,14 @@ to:this._dealignTime(this._cache.bars[0].time)}}_processPendingSubscribers(){con
|
||||
;return 0!==r.bars.length?r.firstLoadedTimeMs=this._dealignTime(r.bars[0].time):0!==this._cache.bars.length?r.firstLoadedTimeMs=this._dealignTime(this._cache.bars[this._cache.bars.length-1].time):r.firstLoadedTimeMs=this._dealignTime((0,s.ensureNotNull)(this._leftDate)),r}_ensureRequestedTo(e){var t;let i;if(this._requesting&&this._logMessage("Internal error: trying to call getBars while the previous request is active",!0),null!==this._leftDate)i=this._leftDate;else{const e=this._now();if(null===this._dwmAligner)i=e;else{let t=this._sessionSpec.alignToNearestSessionStart(new Date(e),1).getTime();if(t<e){const e=this._sessionSpec.alignToNearestSessionEnd(new Date(t),1).getTime();t=this._sessionSpec.alignToNearestSessionStart(new Date(e+1e3),1).getTime()}i=this._dealignTime(t)}}const s=(0,a.alignPeriodsBackForDataRequest)(this._symbolInfo.session,this._symbolInfo.session_holidays,this._symbolInfo.corrections,this._interval.letter(),this._interval.multiplier(),e.countBack,Math.min(e.to,i,null!==(t=this._nextTime)&&void 0!==t?t:1/0));let r=e.countBack;if(e.to<i){r+=(0,a.getPeriodsBetweenDates)(this._symbolInfo.session,this._symbolInfo.session_holidays,this._symbolInfo.corrections,this._interval.letter(),this._interval.multiplier(),e.to,i)}if(null!==this._leftDate&&this._leftDate<s)return void this._processPendingSubscribers();const n=this._firstDataRequest||(this._isSymbolExpired()?0===this._cache.bars.length:null===this._leftDate);this._firstDataRequest=!1,this._requesting=!0,this._nextTime=null,this._leftDate=s;const o=`[${u(s)} ... ${u(i)}, ${r} bars]`;this._logMessage(`Requesting data: ${o}`);let l=!1;const c=s/1e3,h=i/1e3;this._datafeed.getBars(this._symbolInfo,this._resolution,{from:this._interval.isTicks()?c:Math.floor(c),to:this._interval.isTicks()?h:Math.floor(h),countBack:r,firstDataRequest:n},((e,t)=>{if(!this._destroyed)if(l)this._logMessage("getBars callback is already called before",!0);else{if(l=!0,e.length>0){const t=` [${u(e[0].time)} ... ${u(e[e.length-1].time)}]`;this._logMessage(`Receiving bars: total ${e.length} bars in ${t}, requested range: ${o}`)}else this._logMessage(`Receiving bars: barset is empty, requested range: ${o}`);this._requesting=!1,this._processBars(e,t)}}),(e=>{this._destroyed||(l?this._logMessage("getBars callback is already called before",!0):(l=!0,this._requesting=!1,this._errorMessage=e||null,this._processPendingSubscribers()))}))}_processBars(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?(this._emptyResponsesCount=0,this._processFullBarset(e,t)):(this._emptyResponsesCount+=1,this._processEmptyBarset(t)),this._processPendingSubscribers()}_processEmptyBarset(e){e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(u(1e3*e.nextTime))),this._nextTime=1e3*e.nextTime):e&&e.noData?(this._logMessage("EOD received"),this._setEndOfData()):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned"),50===this._emptyResponsesCount&&(this._logMessage("EOD detected due 50 empty responses in a row"),this._setEndOfData())}
|
||||
_setEndOfData(){this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._dealignTime(this._cache.bars[0].time))}_processFullBarset(e,t){this._putToCache(e)?null!==this._leftDate&&0!==this._cache.bars.length&&(this._interval.isTicks()?this._leftDate=this._dealignTime(this._cache.bars[0].time):this._leftDate=Math.min(this._leftDate,this._dealignTime(this._cache.bars[0].time))):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn(`${this._logMessagePrefix()}nextTime should be set when there is no data in the requested period only`):t&&t.noData&&console.warn(`${this._logMessagePrefix()}noData should be set when there is no data in the requested period and earlier only`)}_getNextSubscriptionId(){return this._nextSubscriptionId++}_checkBars(e,t=!1){if(o.enabled("charting_library_debug_mode"))for(let i=1;i<e.length;i++){if(e[i].time<=e[i-1].time){let s=`${this._logMessagePrefix()}Wrong bars time: time ${e[i].time} of bar ${i} should be more than time ${e[i-1].time} of bar ${i-1}`;t&&null!==this._dwmAligner&&(s+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(s)}["high","low","open","close","time"].some((t=>"number"!=typeof e[i][t]||!isFinite(e[i][t])))&&console.error(`${this._logMessagePrefix()}Wrong bars values: all OHLC values should be numbers`)}}_putToCache(e){if(0===e.length)return!0;if(this._cache.bars.length===e.length&&this._cache.bars[0].time===e[0].time&&this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&e[e.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&e[e.length-1].time>=this._cache.bars[0].time){const t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=[...e,...this._cache.bars],this._checkBars(this._cache.bars,!0),!0}_putToCacheNewBar(e){const t=this._cache.bars.length,i=e.time,s=0===t?NaN:this._cache.bars[t-1].time;0===t||s<i?this._cache.bars.push(e):s===i?(this._interval.isTicks()&&this._logMessage("Received update for the last tick bar"),this._cache.bars[t-1]=e):console.error(`${this._logMessagePrefix()}putToCacheNewBar: time violation, previous bar time: `+u(s)+" should be less or equal to new time: "+u(i))}_alignBarsTime(e){if(this._dwmAligner)for(const t of e)t.time=this._dwmAligner.timeToSessionStart(t.time)}_now(){return Date.now()+1e3*this._serverTimeOffsetGetter()+6e4}}class _{constructor(e,t,i){this._threads={},this._datafeed=e,this._serverTimeOffsetGetter=t,this._resetCacheTimePeriod=i}destroy(){this._forEachThread(((e,t)=>t.destroy())),this._threads={},delete this._datafeed}purgeCache(){this._forEachThread(((e,t)=>t.destroy())),this._threads={}}
|
||||
subscribe(e,t,i,s,r){const n=d(e,t);this._threads[n]||(this._threads[n]=this._createThread(e,t));return n+'"'+this._threads[n].addSubscription(i,s,r)}unsubscribe(e){const t=e.split('"');if(2!==t.length)return void console.warn("Wrong guid format");const i=t[0],s=parseInt(t[1]);this._threads.hasOwnProperty(i)?this._threads[i].removeSubscription(s):console.warn("Data thread doesnt exist: "+e)}_createThread(e,t){return new p(this._datafeed,e,t,this._serverTimeOffsetGetter,(0,l.createDwmAligner)(t,e),this._resetCacheTimePeriod)}_forEachThread(e){Object.keys(this._threads).forEach((t=>e(t,this._threads[t])))}}},13041:(e,t,i)=>{"use strict";i.d(t,{barTimeToEndOfPeriod:()=>r,endOfPeriodToBarTime:()=>n});var s=i(60062);function r(e,t,i){if(i.isDays())return t;if(e.moveTo(1e3*t),i.isIntraday()){const i=e.indexOfBar(1e3*t);if(i<0)throw new Error(`${t} is out of the instrument session `);return e.endOfBar(i)/1e3}return e.startOfBar(s.SessionStage.LASTBAR_SESSION)/1e3}function n(e,t,i){if(i.isDays())return t;const s=1e3*t-1;if(e.moveTo(s),i.isIntraday()){const i=e.indexOfBar(s);if(i<0)throw new Error(`${t} is out of the instrument session `);return e.startOfBar(i)/1e3}return t=e.startOfBar(0)/1e3}},48739:(e,t,i)=>{"use strict";i.d(t,{replaceGraphicsTimesWithTimePointIndexIndex:()=>n});const s=new Map([["horizlines",e=>[e.startIndex,e.endIndex]],["hhists",e=>[e.firstBarTime,e.firstBarTime]],["vertlines",e=>[e.index]],["polygons",e=>e.points.map((e=>e.index))],["horizlines",e=>[e.startIndex,e.endIndex]],["hhists",e=>[e.firstBarTime,e.firstBarTime]],["vertlines",e=>[e.index]],["polygons",e=>e.points.map((e=>e.index))],["backgrounds",e=>[e.start,e.stop]]]),r=new Map([["horizlines",(e,t)=>{const i=e;i.startIndex=t.get(i.startIndex),i.endIndex=t.get(i.endIndex)}],["hhists",(e,t)=>{const i=e;i.firstBarTime=t.get(i.firstBarTime),i.lastBarTime=t.get(i.lastBarTime)}],["vertlines",(e,t)=>{const i=e;i.index=t.get(i.index)}],["polygons",(e,t)=>{const i=e;for(const e of i.points)e.index=t.get(e.index)}],["backgrounds",(e,t)=>{const i=e;i.start=t.get(i.start),i.stop=t.get(i.stop)}]]);function n(e){const t=e.data&&e.data.graphicsCmds&&e.data.graphicsCmds.create;if(!t)return[];const i=new Map,n=new Set;s.forEach(((e,s)=>{const r=t[s];if(r)for(const t of r)for(const s of t.data){const t=e(s);for(const e of t)i.set(e,-1),n.add(e)}}));const o=Array.from(n).sort(((e,t)=>e-t));return o.forEach(((e,t)=>i.set(e,t))),r.forEach(((e,s)=>{const r=t[s];if(r)for(const t of r)for(const s of t.data)e(s,i)})),o}},26665:(e,t,i)=>{"use strict";var s=i(14483);window.onload=function(){location.hostname.indexOf(".")>=0&&!function(){try{return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(e){return!1}}()&&setTimeout((function(){try{var e=function(){var e=0;return JSON.parse(urlParams.logo).image&&(e="C",s.enabled("link_to_tradingview")||(e="D")),e}();window.ga&&(0!==e&&window.ga("send","event","s",e),urlParams.utm||window.ga("send","event","l"))}catch(e){}}),3e4)}
|
||||
},3035:(e,t,i)=>{"use strict";var s,r=i(60156),n={};e.exports=function(e,t,i){var o,a,l,c,h={},d=n[i]||"out_of_session",u=!1,p=i,_=t,m=null,g=null;function f(){var e={};e.symbolname=p,e.status="ok",e.values={},e.values.current_session=d,n[p]=d,TradingView.ChartapiMessagerInstances[_].onQuotesData([_].concat([e]))}function v(){if(o)if(c)d="out_of_session";else{var e=(new Date).getTime(),t=r.isTradingNow(e,o)?"market":"out_of_session";a&&r.isTradingNow(e,a)?t="pre_market":l&&r.isTradingNow(e,l)&&(t="post_market"),t!==d&&(d=t)}}return e(i,null,(function(e){u||function(e){o=new r.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),c=e.expired,e.subsession_id&&e.subsessions?e.subsessions.forEach((t=>{switch(t.id){case"premarket":a=new r.SessionInfo(e.timezone,t.session,e.session_holidays,e["session-premarket-correction"]||e.corrections);break;case"postmarket":l=new r.SessionInfo(e.timezone,t.session,e.session_holidays,e["session-postmarket-correction"]||e.corrections)}})):(a=void 0,l=void 0);const t=60-new Date(Date.now()).getSeconds();s&&s?.ticker===e.ticker||(s={ticker:e.ticker,timer:t},clearTimeout(s.timeout)),g=setTimeout((()=>{m=setInterval((()=>{v(),f()}),6e4),v(),f()}),1e3*s.timer),s&&void 0!==s?.timeout||(s.timeout=g),v(),f()}(e)}),(function(){})),h.stop=function(){u=!0,m&&clearInterval(m),g&&clearInterval(g)},h.marketStatus=function(){return d},h}},37360:(e,t,i)=>{"use strict";i.d(t,{BarSet:()=>s});class s{constructor(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTimeMs=0!==this.bars.length?this.bars[0].time:1/0,this._emptyBarCount=0,this._lastBarIsEmpty=!1}symbolinfo(){return this.info}isLastBarClosed(){return this.isBarClosed}setLastBarClosed(e){this.isBarClosed=e}bar(e){const t=this.bars[e];if(void 0===t)throw new Error(`BarSet has no value at index ${e}`);return t}count(){return this.bars.length}emptyBarCount(){return this._emptyBarCount}add(e,t,i){void 0===i&&(i=!1);const s=e,r=this.bars,n=r.length,o=s.time,a=0===n?NaN:r[n-1].time;0===n||a<o?(r.push(s),i&&(this._emptyBarCount+=1,this._lastBarIsEmpty=!0)):a===o?(i!==this._lastBarIsEmpty&&(this._emptyBarCount+=i?1:-1,this._lastBarIsEmpty=i),r[n-1]=s):console.error("time order violation, prev: "+new Date(a).toUTCString()+", cur: "+new Date(o).toUTCString()),this.isBarClosed=!!t}}},55137:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DataFeed:()=>P,setupFeed:()=>S,unsubscribeUnused:()=>b});var s=i(50151),r=i(36274);class n{constructor(){this._listeners=[]}listenersCount(){return this._listeners.reduce(((e,t)=>e+(t?1:0)),0)}addListener(e,t){this._listeners.push({dataListener:e,onErrorCallback:t}),this._barset&&e(this._barset),this._errorMsg&&t(this._errorMsg)}removeListener(e){const t=this._listeners.filter((t=>t&&t.dataListener===e));if(0===t.length)return;const i=this._listeners.indexOf(t[0]);delete this._listeners[i]}onError(e){this._errorMsg=e||"unspecified error";const t=this._listeners,i=t.length;for(let s=0;s<i;s++){const i=t[s];i&&i.onErrorCallback&&i.onErrorCallback(e)}}fire(e,t){t||(this._barset=e)
|
||||
;const i=this._listeners,s=i.length;for(let t=0;t<s;t++){const s=i[t];s&&s.dataListener(e)}}}var o=i(27856),a=i(43910),l=i(37360);class c{constructor(e,t,i,s,r,n,o,l,c,h){this.listeners=e,this._isRecalculated=!1,this._symbolInfo=o,this.engine=new a.StudyEngine({tickerid:t,currencyCode:i,unitId:s,subsessionId:h,period:r,body:n,sessionId:c,symbolInfo:o,dataRange:l,forceAlignBars:!1,enableDwmAligning:!1,input:()=>{throw new Error("BarBuildItem scripts should not need to access any input values")},recalc:(e,t)=>{this._recalc(t)},out:(e,t)=>{this._out(e,t)},nonseriesOut:(e,t)=>{this._nonseriesOut(e,t)},setNoMoreData:()=>{this._barset&&(this._barset.endOfData=!0)},onErrorCallback:e=>{this.listeners.onError(e)}})}stop(){this.engine?this.engine.stop():console.error("Internal library error 0x1")}_recalc(e){this._isRecalculated&&console.error("recalc called twice!"),this._barset||(this._barset=new l.BarSet(this._symbolInfo)),e&&(this._barset.firstLoadedTimeMs=e.firstLoadedTimeMs,this._barset.endOfData=e.endOfData),this.listeners.fire(this._barset),this._isRecalculated=!0}_nonseriesOut(e,t){const i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this._barset?this._barset.count():0,i.lastBar=this._barset?this._barset.bar(this._barset.count()-1):null,this.listeners.fire(i,!0)}_out(e,t){const i=t[0];if(isNaN(i))return;const r={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7];this._barset||(this._barset=new l.BarSet((0,s.ensureDefined)(e.info,"bar builder item output symbol info")));const o=t[8],a=t[9];if(o instanceof Array&&a)for(let e=0;e<o.length;e++){const t=o[e],i={time:t,open:a,high:a,low:a,close:a,volume:0,updatetime:t};this._barset.add(i,!0,!0),this._isRecalculated&&this.listeners.fire(this._barset)}this._barset.add(r,n),this._barset.isBarClosed=!!n,this._isRecalculated&&this.listeners.fire(this._barset)}}var h=i(49581);class d{main(e){const t=e.new_var(h.Std.open(e)),i=e.new_var(h.Std.close(e)),s=t.get(1),r=i.get(1),n=h.Std.ohlc4(e),o=h.Std.na(t.get(1))?(h.Std.open(e)+h.Std.close(e))/2:(s+r)/2;t.set(o),i.set(n);const a=h.Std.max(h.Std.high(e),h.Std.max(o,n)),l=h.Std.min(h.Std.low(e),h.Std.min(o,n)),c=h.Std.volume(e),d=e.symbol;return[d.time,o,a,l,n,c,d.updatetime,d.isBarClosed,void 0,void 0]}}var u=i(77475),p=i(47609),_=i(66846);class m{constructor(e,t,i,s,r,n,o,a){this.listeners=e,this._host=n,this._host.resolve(t,i,(e=>{r&&e.regular_session&&(e.session=e.regular_session),this._subs=this._host.subscribe(e,s,a,(e=>{this.listeners.fire(e)}),(e=>{this.listeners.onError(e)}))}),(e=>{this.listeners.onError(e)}))}stop(){this._subs&&this._host.unsubscribe(this._subs)}}var g=i(65507),f=i(60156),v=i(94421);class y{constructor(e,t){this._period=e,this._generateEmptyBars=!!t}init(e){this._bb=(0,f.newBarBuilder)(this._period,e.symbol.session,null),this._bbEmptyBars=this._generateEmptyBars?(0,f.newBarBuilder)(this._period,e.symbol.session,null):void 0,e.setMinimumAdditionalDepth(0)}main(e){const t=(0,
|
||||
s.ensureDefined)(this._bb,"bar builder study bar builder"),i=e.symbol.time,r=t.alignTime(i),n=e.new_var(r),o=h.Std.na(r),a=n.get(1),l=h.Std.na(a)?1:h.Std.neq(r,a),c=e.new_var(),d=e.new_var(),u=e.new_var(),p=e.new_var(),_=c.get(1),m=d.get(1),g=u.get(1),f=p.get(1),v=o?NaN:l?h.Std.open(e):_,y=o?NaN:l?h.Std.high(e):h.Std.max(h.Std.high(e),m),S=o?NaN:l?h.Std.low(e):h.Std.min(h.Std.low(e),g),b=o?NaN:h.Std.close(e),w=o?NaN:l?h.Std.volume(e):h.Std.volume(e)+f,C=o?NaN:i,P=e.symbol.isBarClosed&&t.isLastBar(0,i),x=this._generateEmptyBars&&l?this._extrapolate(a,r):void 0,T=e.new_var(h.Std.close(e)).get(1),I=x instanceof Array?T:NaN;return c.set(v),d.set(y),u.set(S),p.set(w),[r,v,y,S,b,w,C,P,x,I]}_extrapolate(e,t){return isNaN(e)||isNaN(t)?void 0:(0,v.extrapolateBarsFrontToTime)((0,s.ensureDefined)(this._bbEmptyBars,"bar builder study empty bar builder"),e,t,Number.MAX_SAFE_INTEGER,!0).times}}const S=e=>{P.instance=new P(e),(0,g.setupFeed)(P.instance)},b=()=>{P.instance.removeUnused()},w=e=>{console.error(e),h.Std.error(e)},C=r.Interval.parse("1M").inMilliseconds(0);class P{constructor(e){this._host=e,this._cache={}}subscribe(e,t,i,s,r,n,o,a,l,c,h){const d=l(o),u=((e,t,i,s,r,n,o,a,l)=>n+e+s+(t||"")+(i||"")+(l||"")+(r.has_empty_bars?"_":"")+"_"+o.countBack+"_"+o.to+"_"+Boolean(a))(e,t,i,s,o,a,d,c,h);let p=this._getCache(u);return p||(p=this._createItem(e,t,i,s,o,d,a,c,h),this._putCache(u,p)),p.listeners.addListener(r,n),{key:u,listener:r}}unsubscribe(e){const t=this._getCache(e.key);t&&t.listeners.removeListener(e.listener)}removeUnused(){const e=[],t=e=>!!this._cache[e];for(const i in this._cache)if(t(i)){0===(0,s.ensureNotNull)(this._cache[i],`datafeed cache item ${i}`).listeners.listenersCount()&&e.push(i)}if(0!==e.length){for(let t=0;t<e.length;t++){const i=e[t],r=(0,s.ensureNotNull)(this._cache[i],`unused datafeed cache item ${i}`);this._cache[i]=null,r.stop()}this.removeUnused()}}_getCache(e){return this._cache[e]}_putCache(e,t){this._cache[e]=t}_rebuildFrom(e,t){const i=(0,p.findSuitableResolutionToBuildFrom)(e,t);if(i.error)throw w(i.errorMessage),new Error(i.errorMessage);return i.resolution}_createItem(e,t,i,s,a,l,h,p,g){const f=new n,v=(0,o.decodeExtendedSymbol)(e),S="string"!=typeof v.symbol?v.symbol:v;t=S["currency-id"]||t,i=S["unit-id"]||i;const b=S.symbol,P=S.session&&S.session!==_.SubsessionId.Extended;if((g=S.session||g)===_.SubsessionId.Regular&&(g=void 0),"type"in v){const e=Object.assign({},a);return a.has_empty_bars&&(e.has_empty_bars=!1),new c(f,b,t,i,s,function(e){if(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-"))return new d;const t=`unknown builder type: ${e.type}`;throw console.error(t),new Error(t)}(v),e,l,h,g)}p&&!(0,u.isAlignmentEnabled)()&&w("Internal error: rebuilding is requested but it is disabled."),!p&&a.has_empty_bars&&w('Misconfiguration error: attempt to request data for symbol with "has_empty_bars" flag, but "disable_resolution_rebuild" featureset is enabled');const x=this._rebuildFrom(s,a);if(!r.Interval.isTicks(s)&&(!r.Interval.isEqual(s,x)||p)){(0,
|
||||
u.isAlignmentEnabled)()||w('Misconfiguration error: remove "disable_resolution_rebuild" featureset or provide '+s+" data by yourself");const n=a.has_empty_bars,o=Object.assign({},a);a.has_empty_bars&&(o.has_empty_bars=!1);const d=Math.ceil((T=r.Interval.parse(s),I=r.Interval.parse(x),T.kind()===I.kind()?T.multiplier()/I.multiplier():(T.isMonths()?T.multiplier()*C:T.inMilliseconds())/(I.isMonths()?I.multiplier()*C:I.inMilliseconds())));return l=Object.assign({},l,{countBack:l.countBack*d}),new c(f,e,t,i,x,new y(s,n),o,l,h,g)}var T,I;return new m(f,b,{currency:t,unit:i,session:g},s,!!P,this._host,a,l)}}},40367:(e,t,i)=>{"use strict";let s;function r(e,t,i,r){var n;return null!==(n=null==s?void 0:s(e,t,i,r))&&void 0!==n?n:e}function n(e){s=e}i.d(t,{getVolumeProfileResolutionForPeriod:()=>r,overwriteVolumeProfileResolutionForPeriodGetter:()=>n})},47609:(e,t,i)=>{"use strict";i.d(t,{findSuitableResolutionToBuildFrom:()=>o});var s=i(36274);function r(e,t){const i=t.multiplier();for(let s=e.length-1;s>=0;s--){const r=Number(e[s]);if(i%r==0)return{error:!1,resolution:`${r}${t.letter()}`}}return{error:!0,errorMessage:n(t.value())}}function n(e){return`Misconfiguration error: it is trying to request ${e} but we cannot build it from lower resolution`}function o(e,t){const i=s.Interval.parse(e);if((i.isWeeks()||i.isMonths())&&t.has_weekly_and_monthly){let e=["1"];i.isWeeks()&&void 0!==t.weekly_multipliers&&(e=t.weekly_multipliers),i.isMonths()&&void 0!==t.monthly_multipliers&&(e=t.monthly_multipliers);const s=r(e,i);if(!s.error)return s}if(i.isDWM()&&(void 0===t.has_daily||t.has_daily))return i.isDays()&&void 0!==t.daily_multipliers?r(t.daily_multipliers,i):void 0===t.daily_multipliers||t.daily_multipliers.includes("1")?{error:!1,resolution:"1D"}:{error:!0,errorMessage:"Misconfiguration error: it is trying to request a resolution but symbol does not support it"};if(i.isDWM())return{error:!0,errorMessage:n(i.value())};if(i.isMinutes()&&!t.has_intraday)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request intraday resolution but symbol does not support it"};if(i.isSeconds()&&!t.has_seconds)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request seconds resolution but symbol does not support it"};if(i.isTicks())return!t["is-tickbars-available"]||i.multiplier()>1?{error:!0,errorMessage:`Misconfiguration error: it is trying to request ${i.multiplier()} ticks resolution but symbol does not support it`}:{error:!1,resolution:"1T"};const o=i.isSeconds()?t.seconds_multipliers:t.intraday_multipliers;return void 0===o?{error:!1,resolution:i.value()}:r(o,i)}},65507:(e,t,i)=>{"use strict";i.d(t,{ScriptRunner:()=>w,setupFeed:()=>b});var s=i(50151),r=i(36274),n=i(27856),o=i(41249),a=i(98829),l=i(57333),c=i(60156),h=i(66846);class d{constructor(e,t,i,s,o,l,c){this.periodBase="";const h=(0,n.decodeExtendedSymbol)(e),d="string"==typeof h.symbol?h:h.symbol;if((0,n.isStudySymbol)(d))throw new Error(`Unexpected nested study symbol: ${e}`);const u="string"==typeof h.symbol?h.symbol:h.symbol.symbol
|
||||
;this.ticker=u,this.currencyCode=i||d["currency-id"],this.unitId=s||d["unit-id"],this.subsessionId=c||d.session;const p=d["currency-id"]!==this.currencyCode||d["unit-id"]!==this.unitId;d["currency-id"]=this.currencyCode,d["unit-id"]=this.unitId,p&&(e=(0,n.encodeExtendedSymbolOrGetSimpleSymbolString)(h)),this.tickerid=e;const _=r.Interval.parse(t);this.resolution=_.letter(),this.interval=_.multiplier(),this.period=_.value(),this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.minTick=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.isFirstBar=!1,this.isLastBar=!1,this.session=new a.SessionInfo("Etc/UTC","24x7"),this.regularSubsession=null,this.preMarketSubsession=null,this.postMarketSubsession=null,this.script=o,this.isAdditionalDepthAllowed=!(0,n.isStudySymbol)(h)||h.type.includes("BarSetHeikenAshi"),l&&this.set_symbolinfo(l)}set_symbolinfo(e){if(e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.minTick=e.minmov/e.pricescale,this.currencyCode=e.currency_code,this.unitId=e.unit_id,this.subsessionId=e.subsession_id,this.timezone=o.get_timezone(e.timezone),this.session.init(e.timezone,e.session,e.session_holidays,e.corrections),void 0!==e.subsessions){const t=e.subsessions.find((e=>e.id===h.SubsessionId.Regular)),i=e.subsessions.find((e=>e.id===h.SubsessionId.PreMarket)),s=e.subsessions.find((e=>e.id===h.SubsessionId.PostMarket));void 0!==t&&(this.regularSubsession=new l.SessionSpec(e.timezone,t.session,e.session_holidays,t["session-correction"])),void 0!==i&&(this.preMarketSubsession=new l.SessionSpec(e.timezone,i.session,e.session_holidays,i["session-correction"])),void 0!==s&&(this.postMarketSubsession=new l.SessionSpec(e.timezone,s.session,e.session_holidays,s["session-correction"]))}}isdwm(){return""!==this.resolution&&"S"!==this.resolution&&"T"!==this.resolution}enable_dwm_aligning(e,t){this.dwm_aligner=(0,c.newBarBuilder)(this.period,e,t)}bartime(){const e=this.time;if(!this.isdwm()||isNaN(e))return e;const t=(0,s.ensureDefined)(this.timezone,"symbol instrument timezone"),i=o.utc_to_cal(t,e);return this.session.spec.correctTradingDay(i),o.cal_to_utc(t,i)}lastbar(e){if(isNaN(e.time))return;let t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0));const i=this.time!==t;i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=e.volume||NaN,this.updatetime=e.updatetime||NaN,this.isNewBar=i,this.isBarClosed=!!e.isBarClosed,this.isLastBar=!!e.isLastBar,this.isNewBar&&(this.index++,this.isFirstBar=0===this.index),this.script.calc(this)}}var u=i(78071),p=i(49581);class _{constructor(e){this.mindepth=0,this.original=NaN,this.modified=!1,this._hist=null,this._histPos=0,this.symbol=e}valueOf(){return this.get(0)}get(e){return isNaN(e)&&(e=0),e=e||0,this._hist?e>=this._hist.length?(console.error("not enough depth: "+this),
|
||||
NaN):this._get(e):(this.mindepth=p.Std.max(this.mindepth,e),NaN)}set(e){this._hist&&(this._hist[this._histPos]=e,this.modified=!0)}prepare(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this._hist||this.add_hist()):this.set(this.original),this.modified=!1)}add_hist(){if(!this._hist){let e=p.Std.na(this.mindepth)?p.Std.max_series_default_size:p.Std.max(this.mindepth+1,1);e=Math.round(e);const t=new Array(e);for(let i=0;i<e;i++)t[i]=NaN;this._hist=t,this._histPos=-1}this._histPos=Math.min(this._histPos+1,this._hist.length),this._histPos===this._hist.length&&(this._histPos=this._hist.length-1,this._hist.shift(),this._hist.push(NaN)),this._hist[this._histPos]=this.original}reset_hist(){this._hist=null,this.add_hist()}adopt(e,t,i){this._hist||(this.mindepth=NaN);const s=t.get();let r=e.indexOf(s);if(0!==i){const i=t.get(1);if(!p.Std.na(i)){r=r===e.indexOf(i)?-1:r}}return r<0?NaN:this._get(r)}indexOf(e){if(!this._hist)return this.mindepth=NaN,-1;if(p.Std.na(e))return-1;const t=this._hist.length,i=this.symbol.index+1,s=Math.min(t,i),r=(0,u.upperbound_int)(this._hist,e,0,s);return 0===r?-1:s-r}_get(e){if(null===this._hist)return NaN;let t=this._histPos-e;return t<0&&(t+=this._hist.length),this._hist[t]}}class m extends _{add_hist(){if(this._hist||(this._hist=new Float64Array(2e3),this._histPos=-1),this._histPos=this._histPos+1,this._histPos===this._hist.length){const e=new Float64Array(2*this._hist.length);e.set(this._hist),this._hist=e}this._hist[this._histPos]=this.original}}class g{constructor(e){this.minimumAdditionalDepth=null,this._vars=[],this._varsIndex=0,this._ctx=[],this._ctxIndex=0,this.symbol=e}new_sym(e,t,i,s,r){return this.symbol.script.add_sym(e,t,i,s,r)}select_sym(e){const t=this.symbol.script.get_sym(e);null==t&&p.Std.error(`Attempted to select symbol at index ${e} but there is no such symbol`),this.symbol=t}is_main_symbol(e){return void 0!==e&&e===this.symbol.script.get_sym(0)}new_var(e){const t=this._vars;t.length<=this._varsIndex&&t.push(new _(this.symbol));const i=t[this._varsIndex++];return arguments.length>0&&void 0!==e&&i.set(e),i}new_unlimited_var(e){const t=this._vars;t.length<=this._varsIndex&&t.push(new m(this.symbol));const i=t[this._varsIndex++];return arguments.length>0&&i.set(e),i}new_ctx(){return this._ctx.length<=this._ctxIndex&&this._ctx.push(new g(this.symbol)),this._ctx[this._ctxIndex++]}prepare(e){this._ctxIndex=0,this._varsIndex=0;for(let t=0;t<this._vars.length;t++)this._vars[t].prepare(e);for(let t=0;t<this._ctx.length;t++)this._ctx[t].prepare(e)}maxAdditionalDepth(){if(null!==this.minimumAdditionalDepth)return this.minimumAdditionalDepth;let e=0;for(let t=0;t<this._vars.length;t++){const i=this._vars[t].mindepth;!isNaN(i)&&i>e&&(e=i)}return e}stop(){this.symbol=null,this._vars=null}setMinimumAdditionalDepth(e){this.minimumAdditionalDepth=e}}function f(e){return!Array.isArray(e)&&"composite"!==e.type&&"non_series_bars"!==e.type&&!!e.nonseries}class v{constructor(e,t,i,s,r,n,o,a,l,c,h){this._body=n,this._symbols=[],this._runner=r,this._inputCallback=a,
|
||||
this._out=o,this._nonseriesOut=l,this._ctx=new g(this.add_sym(e,t,i,s,c,h)),this.init()}calc(e){const t=this._ctx,i=this._body;t.prepare(e);const s=i.main(t,this._inputCallback,e);var r;if(null!=s)if(null===(r=s)||Array.isArray(r)||"composite"!==r.type)this._processResult(s);else for(let e=0;e<s.data.length;++e)this._processResult(s.data[e])}init(){const e=this._ctx,t=this._body;t.init&&t.init(e,this._inputCallback),t.main(e,this._inputCallback)}add_sym(e,t,i,s,r,n){const o=this._runner.add_sym(e,t,i,s,this,r,n);return this._symbols.push(o),o.isdwm()&&this._symbols.length>1&&this._runner.host.enableDwmAligning&&o.enable_dwm_aligning(this._symbols[0].session,o.session),o}maxAdditionalDepth(){return this._symbols[0].isAdditionalDepthAllowed?this._ctx.maxAdditionalDepth():0}stop(){var e;this._symbols=null,null===(e=this._ctx)||void 0===e||e.stop(),this._ctx=null}get_sym(e){return this._symbols[e]}_processResult(e){const t=this._ctx;var i;this._out&&e&&(!isNaN(t.symbol.time)||f(e))&&(f(e)?(i=e,Array.isArray(i)||"projection"!==i.type||(e.projectionTime=t.symbol.time),this._nonseriesOut(t.symbol,e)):!function(e){return!Array.isArray(e)&&("non_series_bars"===e.type||"projection"===e.type)}(e)?this._out(t.symbol,e):e.bars.forEach((e=>{this._out(t.symbol,e)})))}}var y=i(77475),S=i(85898);function b(e){w.feed=e}class w{constructor(e){this._nonseriesUpdate=null,this._script=null,this._symbols=[],this._barsets=[],this._subscription=[],this.host=e,this._isRecalculated=!1,this.isStarted=!1,this.start()}add_sym(e,t,i,s,r,n,o){const a=new d(e,t,i,s,r,n,o);return this._symbols.push(a),a}get_sym(e){return this._symbols[e]}out(e,t){if(this._nonseriesUpdate){const i=Object.assign({},this._nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)}start(){this.isStarted=!0;const e=this.host,t=new v(e.tickerid,e.period,e.currencyCode,e.unitId,this,e.body,this.out.bind(this),e.input,e.nonseriesOut,e.symbolInfo,e.subsessionId);this._script=t;const i=[],n=this._symbols,o=Object.assign({},e.dataRange,{countBack:e.dataRange.countBack+this._script.maxAdditionalDepth()}),a=n[0],l=(t,s,r)=>{i.push(w.feed.subscribe(t.tickerid,t.currencyCode,t.unitId,t.period,r,e.onErrorCallback,e.symbolInfo,e.sessionId,s,e.forceAlignBars,t.subsessionId))},c=(t,i)=>{"series"===(i.nonseries?"nonseries":"series")?this.update(t,i):i.lastBar?(this._nonseriesUpdate=i,i.lastBar.isLastBar=!0,this._symbols[0].lastbar(i.lastBar),this._nonseriesUpdate=null):e.nonseriesOut(n[0],i)},h=()=>o;l(a,h,(e=>{!e.nonseries&&Number.isFinite(e.firstLoadedTimeMs)&&(e=>{function i(i,r){let n=(0,y.createTimeToBarTimeAligner)(i,r)(e);const o=(0,y.createDwmAligner)(i,r);return null!==o&&(n=o.timeToExchangeTradingDay(n)),{to:n,countBack:(0,s.ensureNotNull)(t,"script runner script").maxAdditionalDepth()}}for(let e=1;e<n.length;e++){const t=n[e],s=t.period;r.Interval.isEqual(s,a.period)||l(t,i.bind(null,s),c.bind(null,e))}})(e.firstLoadedTimeMs),c(0,e)}));for(let e=1;e<n.length;e++){const t=n[e]
|
||||
;r.Interval.isEqual(t.period,a.period)&&l(t,h,c.bind(null,e))}this._subscription=i}stop(){var e;const t=this._subscription;if(t||this._script){if(null!==t)for(let e=0;e<(null==t?void 0:t.length);e++)w.feed.unsubscribe(t[e]);this._subscription=null,null===(e=this._script)||void 0===e||e.stop(),this._script=null,this._symbols=null,this.isStarted=!1}else console.warn("Recurring script engine stop happened.")}update(e,t){if(!t)return void console.error("Unexpected barset = null");const i=this._symbols[e];if(this._isRecalculated){const e=t.bar(t.count()-1);e.isBarClosed=t.isLastBarClosed(),e.isLastBar=!0,i.lastbar(e)}else this._barsets[e]||(this._barsets[e]=t,i.set_symbolinfo(t.symbolinfo()),this.recalc())}recalc(){const e=this._symbols;for(let t=0;t<e.length;t++)if(!this._barsets[t])return;try{for(let t=e.length-1;t>=0;t--){const i=e[t],s=this._barsets[t],r=s.count();for(let e=0;e<r;e++){const t=s.bar(e);t.isLastBar=e===r-1,t.isBarClosed=!t.isLastBar||s.isLastBarClosed(),i.lastbar(t)}}this._isRecalculated=!0;const t=this._barsets.every((e=>e.endOfData));t&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:t,firstLoadedTimeMs:this._barsets[0].firstLoadedTimeMs,emptyBarCount:this._barsets[0].emptyBarCount()})}catch(e){if(!(e instanceof S.StudyError))throw e;this.host.onErrorCallback(e.message)}}}w.feed={subscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")},unsubscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")}}},46544:(e,t,i)=>{"use strict";const s=i(14483),r=i(33013).getHexColorByName;var n=i(49581).Std;i(24172);var o=i(82808).pivotPointsStandardStudyItem,a=i(72365).volumeProfileVisibleRangeStudyItem,l=i(82597).volumeProfileFixedRangeVbPStudyItem,c=i(82597).volumeProfileFixedRangeBSStudyItem,h=i(39944).spreadStudyItem,d=i(81821).ratioStudyItem,u=i(65097).regressionTrendStudyItem,p=i(53130).anchoredVWAPStudyItem;const _=r("color-ripe-red-400"),m=r("color-minty-green-400"),g=s.enabled("secondary_series_extend_time_scale");JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#9C27B0"}},inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1",format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),n.period(this._context))},this.main=function(e,t){this._context=e;var i=this._context.new_unlimited_var(this._context.symbol.time);this._context.select_sym(1)
|
||||
},3035:(e,t,i)=>{"use strict";var s,r=i(60156),n={};e.exports=function(e,t,i){var o,a,l,c,h={},d=n[i]||"out_of_session",u=!1,p=i,_=t,m=null,g=null;function f(){var e={};e.symbolname=p,e.status="ok",e.values={},e.values.current_session=d,n[p]=d,TradingView.ChartapiMessagerInstances[_].onQuotesData([_].concat([e]))}function v(){if(o)if(c)d="out_of_session";else{var e=(new Date).getTime(),t=r.isTradingNow(e,o)?"market":"out_of_session";a&&r.isTradingNow(e,a)?t="pre_market":l&&r.isTradingNow(e,l)&&(t="post_market"),t!==d&&(d=t)}}return e(i,null,(function(e){u||function(e){o=new r.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),c=e.expired,e.subsession_id&&e.subsessions?e.subsessions.forEach((t=>{switch(t.id){case"regular":o=new r.SessionInfo(e.timezone,e.session,e.session_holidays,t["session-correction"]||e["session-correction"]||e.corrections);break;case"premarket":a=new r.SessionInfo(e.timezone,t.session,e.session_holidays,t["session-correction"]||e["session-premarket-correction"]||e.corrections);break;case"postmarket":l=new r.SessionInfo(e.timezone,t.session,e.session_holidays,t["session-correction"]||e["session-postmarket-correction"]||e.corrections)}})):(a=void 0,l=void 0);const t=60-new Date(Date.now()).getSeconds();s&&s?.ticker===e.ticker||(s={ticker:e.ticker,timer:t},clearTimeout(s.timeout)),g=setTimeout((()=>{m=setInterval((()=>{v(),f()}),6e4),v(),f()}),1e3*s.timer),s&&void 0!==s?.timeout||(s.timeout=g),v(),f()}(e)}),(function(){})),h.stop=function(){u=!0,m&&clearInterval(m),g&&clearInterval(g)},h.marketStatus=function(){return d},h}},37360:(e,t,i)=>{"use strict";i.d(t,{BarSet:()=>s});class s{constructor(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTimeMs=0!==this.bars.length?this.bars[0].time:1/0,this._emptyBarCount=0,this._lastBarIsEmpty=!1}symbolinfo(){return this.info}isLastBarClosed(){return this.isBarClosed}setLastBarClosed(e){this.isBarClosed=e}bar(e){const t=this.bars[e];if(void 0===t)throw new Error(`BarSet has no value at index ${e}`);return t}count(){return this.bars.length}emptyBarCount(){return this._emptyBarCount}add(e,t,i){void 0===i&&(i=!1);const s=e,r=this.bars,n=r.length,o=s.time,a=0===n?NaN:r[n-1].time;0===n||a<o?(r.push(s),i&&(this._emptyBarCount+=1,this._lastBarIsEmpty=!0)):a===o?(i!==this._lastBarIsEmpty&&(this._emptyBarCount+=i?1:-1,this._lastBarIsEmpty=i),r[n-1]=s):console.error("time order violation, prev: "+new Date(a).toUTCString()+", cur: "+new Date(o).toUTCString()),this.isBarClosed=!!t}}},55137:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DataFeed:()=>P,setupFeed:()=>S,unsubscribeUnused:()=>b});var s=i(50151),r=i(36274);class n{constructor(){this._listeners=[]}listenersCount(){return this._listeners.reduce(((e,t)=>e+(t?1:0)),0)}addListener(e,t){this._listeners.push({dataListener:e,onErrorCallback:t}),this._barset&&e(this._barset),this._errorMsg&&t(this._errorMsg)}removeListener(e){const t=this._listeners.filter((t=>t&&t.dataListener===e));if(0===t.length)return;const i=this._listeners.indexOf(t[0]);delete this._listeners[i]}onError(e){
|
||||
this._errorMsg=e||"unspecified error";const t=this._listeners,i=t.length;for(let s=0;s<i;s++){const i=t[s];i&&i.onErrorCallback&&i.onErrorCallback(e)}}fire(e,t){t||(this._barset=e);const i=this._listeners,s=i.length;for(let t=0;t<s;t++){const s=i[t];s&&s.dataListener(e)}}}var o=i(27856),a=i(43910),l=i(37360);class c{constructor(e,t,i,s,r,n,o,l,c,h){this.listeners=e,this._isRecalculated=!1,this._symbolInfo=o,this.engine=new a.StudyEngine({tickerid:t,currencyCode:i,unitId:s,subsessionId:h,period:r,body:n,sessionId:c,symbolInfo:o,dataRange:l,forceAlignBars:!1,enableDwmAligning:!1,input:()=>{throw new Error("BarBuildItem scripts should not need to access any input values")},recalc:(e,t)=>{this._recalc(t)},out:(e,t)=>{this._out(e,t)},nonseriesOut:(e,t)=>{this._nonseriesOut(e,t)},setNoMoreData:()=>{this._barset&&(this._barset.endOfData=!0)},onErrorCallback:e=>{this.listeners.onError(e)}})}stop(){this.engine?this.engine.stop():console.error("Internal library error 0x1")}_recalc(e){this._isRecalculated&&console.error("recalc called twice!"),this._barset||(this._barset=new l.BarSet(this._symbolInfo)),e&&(this._barset.firstLoadedTimeMs=e.firstLoadedTimeMs,this._barset.endOfData=e.endOfData),this.listeners.fire(this._barset),this._isRecalculated=!0}_nonseriesOut(e,t){const i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this._barset?this._barset.count():0,i.lastBar=this._barset?this._barset.bar(this._barset.count()-1):null,this.listeners.fire(i,!0)}_out(e,t){const i=t[0];if(isNaN(i))return;const r={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7];this._barset||(this._barset=new l.BarSet((0,s.ensureDefined)(e.info,"bar builder item output symbol info")));const o=t[8],a=t[9];if(o instanceof Array&&a)for(let e=0;e<o.length;e++){const t=o[e],i={time:t,open:a,high:a,low:a,close:a,volume:0,updatetime:t};this._barset.add(i,!0,!0),this._isRecalculated&&this.listeners.fire(this._barset)}this._barset.add(r,n),this._barset.isBarClosed=!!n,this._isRecalculated&&this.listeners.fire(this._barset)}}var h=i(49581);class d{main(e){const t=e.new_var(h.Std.open(e)),i=e.new_var(h.Std.close(e)),s=t.get(1),r=i.get(1),n=h.Std.ohlc4(e),o=h.Std.na(t.get(1))?(h.Std.open(e)+h.Std.close(e))/2:(s+r)/2;t.set(o),i.set(n);const a=h.Std.max(h.Std.high(e),h.Std.max(o,n)),l=h.Std.min(h.Std.low(e),h.Std.min(o,n)),c=h.Std.volume(e),d=e.symbol;return[d.time,o,a,l,n,c,d.updatetime,d.isBarClosed,void 0,void 0]}}var u=i(77475),p=i(47609),_=i(66846);class m{constructor(e,t,i,s,r,n,o,a){this.listeners=e,this._host=n,this._host.resolve(t,i,(e=>{r&&e.regular_session&&(e.session=e.regular_session),this._subs=this._host.subscribe(e,s,a,(e=>{this.listeners.fire(e)}),(e=>{this.listeners.onError(e)}))}),(e=>{this.listeners.onError(e)}))}stop(){this._subs&&this._host.unsubscribe(this._subs)}}var g=i(65507),f=i(60156),v=i(94421);class y{constructor(e,t){this._period=e,this._generateEmptyBars=!!t}init(e){this._bb=(0,f.newBarBuilder)(this._period,e.symbol.session,null),this._bbEmptyBars=this._generateEmptyBars?(0,
|
||||
f.newBarBuilder)(this._period,e.symbol.session,null):void 0,e.setMinimumAdditionalDepth(0)}main(e){const t=(0,s.ensureDefined)(this._bb,"bar builder study bar builder"),i=e.symbol.time,r=t.alignTime(i),n=e.new_var(r),o=h.Std.na(r),a=n.get(1),l=h.Std.na(a)?1:h.Std.neq(r,a),c=e.new_var(),d=e.new_var(),u=e.new_var(),p=e.new_var(),_=c.get(1),m=d.get(1),g=u.get(1),f=p.get(1),v=o?NaN:l?h.Std.open(e):_,y=o?NaN:l?h.Std.high(e):h.Std.max(h.Std.high(e),m),S=o?NaN:l?h.Std.low(e):h.Std.min(h.Std.low(e),g),b=o?NaN:h.Std.close(e),w=o?NaN:l?h.Std.volume(e):h.Std.volume(e)+f,C=o?NaN:i,P=e.symbol.isBarClosed&&t.isLastBar(0,i),x=this._generateEmptyBars&&l?this._extrapolate(a,r):void 0,T=e.new_var(h.Std.close(e)).get(1),I=x instanceof Array?T:NaN;return c.set(v),d.set(y),u.set(S),p.set(w),[r,v,y,S,b,w,C,P,x,I]}_extrapolate(e,t){return isNaN(e)||isNaN(t)?void 0:(0,v.extrapolateBarsFrontToTime)((0,s.ensureDefined)(this._bbEmptyBars,"bar builder study empty bar builder"),e,t,Number.MAX_SAFE_INTEGER,!0).times}}const S=e=>{P.instance=new P(e),(0,g.setupFeed)(P.instance)},b=()=>{P.instance.removeUnused()},w=e=>{console.error(e),h.Std.error(e)},C=r.Interval.parse("1M").inMilliseconds(0);class P{constructor(e){this._host=e,this._cache={}}subscribe(e,t,i,s,r,n,o,a,l,c,h){const d=l(o),u=((e,t,i,s,r,n,o,a,l)=>n+e+s+(t||"")+(i||"")+(l||"")+(r.has_empty_bars?"_":"")+"_"+o.countBack+"_"+o.to+"_"+Boolean(a))(e,t,i,s,o,a,d,c,h);let p=this._getCache(u);return p||(p=this._createItem(e,t,i,s,o,d,a,c,h),this._putCache(u,p)),p.listeners.addListener(r,n),{key:u,listener:r}}unsubscribe(e){const t=this._getCache(e.key);t&&t.listeners.removeListener(e.listener)}removeUnused(){const e=[],t=e=>!!this._cache[e];for(const i in this._cache)if(t(i)){0===(0,s.ensureNotNull)(this._cache[i],`datafeed cache item ${i}`).listeners.listenersCount()&&e.push(i)}if(0!==e.length){for(let t=0;t<e.length;t++){const i=e[t],r=(0,s.ensureNotNull)(this._cache[i],`unused datafeed cache item ${i}`);this._cache[i]=null,r.stop()}this.removeUnused()}}_getCache(e){return this._cache[e]}_putCache(e,t){this._cache[e]=t}_rebuildFrom(e,t){const i=(0,p.findSuitableResolutionToBuildFrom)(e,t);if(i.error)throw w(i.errorMessage),new Error(i.errorMessage);return i.resolution}_createItem(e,t,i,s,a,l,h,p,g){const f=new n,v=(0,o.decodeExtendedSymbol)(e),S="string"!=typeof v.symbol?v.symbol:v;t=S["currency-id"]||t,i=S["unit-id"]||i;const b=S.symbol,P=S.session&&S.session!==_.SubsessionId.Extended;if((g=S.session||g)===_.SubsessionId.Regular&&(g=void 0),"type"in v){const e=Object.assign({},a);return a.has_empty_bars&&(e.has_empty_bars=!1),new c(f,b,t,i,s,function(e){if(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-"))return new d;const t=`unknown builder type: ${e.type}`;throw console.error(t),new Error(t)}(v),e,l,h,g)}p&&!(0,u.isAlignmentEnabled)()&&w("Internal error: rebuilding is requested but it is disabled."),!p&&a.has_empty_bars&&w('Misconfiguration error: attempt to request data for symbol with "has_empty_bars" flag, but "disable_resolution_rebuild" featureset is enabled')
|
||||
;const x=this._rebuildFrom(s,a);if(!r.Interval.isTicks(s)&&(!r.Interval.isEqual(s,x)||p)){(0,u.isAlignmentEnabled)()||w('Misconfiguration error: remove "disable_resolution_rebuild" featureset or provide '+s+" data by yourself");const n=a.has_empty_bars,o=Object.assign({},a);a.has_empty_bars&&(o.has_empty_bars=!1);const d=Math.ceil((T=r.Interval.parse(s),I=r.Interval.parse(x),T.kind()===I.kind()?T.multiplier()/I.multiplier():(T.isMonths()?T.multiplier()*C:T.inMilliseconds())/(I.isMonths()?I.multiplier()*C:I.inMilliseconds())));return l=Object.assign({},l,{countBack:l.countBack*d}),new c(f,e,t,i,x,new y(s,n),o,l,h,g)}var T,I;return new m(f,b,{currency:t,unit:i,session:g},s,!!P,this._host,a,l)}}},40367:(e,t,i)=>{"use strict";let s;function r(e,t,i,r){var n;return null!==(n=null==s?void 0:s(e,t,i,r))&&void 0!==n?n:e}function n(e){s=e}i.d(t,{getVolumeProfileResolutionForPeriod:()=>r,overwriteVolumeProfileResolutionForPeriodGetter:()=>n})},47609:(e,t,i)=>{"use strict";i.d(t,{findSuitableResolutionToBuildFrom:()=>o});var s=i(36274);function r(e,t){const i=t.multiplier();for(let s=e.length-1;s>=0;s--){const r=Number(e[s]);if(i%r==0)return{error:!1,resolution:`${r}${t.letter()}`}}return{error:!0,errorMessage:n(t.value())}}function n(e){return`Misconfiguration error: it is trying to request ${e} but we cannot build it from lower resolution`}function o(e,t){const i=s.Interval.parse(e);if((i.isWeeks()||i.isMonths())&&t.has_weekly_and_monthly){let e=["1"];i.isWeeks()&&void 0!==t.weekly_multipliers&&(e=t.weekly_multipliers),i.isMonths()&&void 0!==t.monthly_multipliers&&(e=t.monthly_multipliers);const s=r(e,i);if(!s.error)return s}if(i.isDWM()&&(void 0===t.has_daily||t.has_daily))return i.isDays()&&void 0!==t.daily_multipliers?r(t.daily_multipliers,i):void 0===t.daily_multipliers||t.daily_multipliers.includes("1")?{error:!1,resolution:"1D"}:{error:!0,errorMessage:"Misconfiguration error: it is trying to request a resolution but symbol does not support it"};if(i.isDWM())return{error:!0,errorMessage:n(i.value())};if(i.isMinutes()&&!t.has_intraday)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request intraday resolution but symbol does not support it"};if(i.isSeconds()&&!t.has_seconds)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request seconds resolution but symbol does not support it"};if(i.isTicks())return!t["is-tickbars-available"]||i.multiplier()>1?{error:!0,errorMessage:`Misconfiguration error: it is trying to request ${i.multiplier()} ticks resolution but symbol does not support it`}:{error:!1,resolution:"1T"};const o=i.isSeconds()?t.seconds_multipliers:t.intraday_multipliers;return void 0===o?{error:!1,resolution:i.value()}:r(o,i)}},65507:(e,t,i)=>{"use strict";i.d(t,{ScriptRunner:()=>w,setupFeed:()=>b});var s=i(50151),r=i(36274),n=i(27856),o=i(41249),a=i(98829),l=i(57333),c=i(60156),h=i(66846);class d{constructor(e,t,i,s,o,l,c){this.periodBase="";const h=(0,n.decodeExtendedSymbol)(e),d="string"==typeof h.symbol?h:h.symbol;if((0,
|
||||
n.isStudySymbol)(d))throw new Error(`Unexpected nested study symbol: ${e}`);const u="string"==typeof h.symbol?h.symbol:h.symbol.symbol;this.ticker=u,this.currencyCode=i||d["currency-id"],this.unitId=s||d["unit-id"],this.subsessionId=c||d.session;const p=d["currency-id"]!==this.currencyCode||d["unit-id"]!==this.unitId;d["currency-id"]=this.currencyCode,d["unit-id"]=this.unitId,p&&(e=(0,n.encodeExtendedSymbolOrGetSimpleSymbolString)(h)),this.tickerid=e;const _=r.Interval.parse(t);this.resolution=_.letter(),this.interval=_.multiplier(),this.period=_.value(),this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.minTick=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.isFirstBar=!1,this.isLastBar=!1,this.session=new a.SessionInfo("Etc/UTC","24x7"),this.regularSubsession=null,this.preMarketSubsession=null,this.postMarketSubsession=null,this.script=o,this.isAdditionalDepthAllowed=!(0,n.isStudySymbol)(h)||h.type.includes("BarSetHeikenAshi"),l&&this.set_symbolinfo(l)}set_symbolinfo(e){if(e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.minTick=e.minmov/e.pricescale,this.currencyCode=e.currency_code,this.unitId=e.unit_id,this.subsessionId=e.subsession_id,this.timezone=o.get_timezone(e.timezone),this.session.init(e.timezone,e.session,e.session_holidays,e.corrections),void 0!==e.subsessions){const t=e.subsessions.find((e=>e.id===h.SubsessionId.Regular)),i=e.subsessions.find((e=>e.id===h.SubsessionId.PreMarket)),s=e.subsessions.find((e=>e.id===h.SubsessionId.PostMarket));void 0!==t&&(this.regularSubsession=new l.SessionSpec(e.timezone,t.session,e.session_holidays,t["session-correction"])),void 0!==i&&(this.preMarketSubsession=new l.SessionSpec(e.timezone,i.session,e.session_holidays,i["session-correction"])),void 0!==s&&(this.postMarketSubsession=new l.SessionSpec(e.timezone,s.session,e.session_holidays,s["session-correction"]))}}isdwm(){return""!==this.resolution&&"S"!==this.resolution&&"T"!==this.resolution}enable_dwm_aligning(e,t){this.dwm_aligner=(0,c.newBarBuilder)(this.period,e,t)}bartime(){const e=this.time;if(!this.isdwm()||isNaN(e))return e;const t=(0,s.ensureDefined)(this.timezone,"symbol instrument timezone"),i=o.utc_to_cal(t,e);return this.session.spec.correctTradingDay(i),o.cal_to_utc(t,i)}lastbar(e){if(isNaN(e.time))return;let t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0));const i=this.time!==t;i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=e.volume||NaN,this.updatetime=e.updatetime||NaN,this.isNewBar=i,this.isBarClosed=!!e.isBarClosed,this.isLastBar=!!e.isLastBar,this.isNewBar&&(this.index++,this.isFirstBar=0===this.index),this.script.calc(this)}}var u=i(78071),p=i(49581);class _{constructor(e){this.mindepth=0,this.original=NaN,this.modified=!1,this._hist=null,this._histPos=0,this.symbol=e}valueOf(){return this.get(0)}get(e){
|
||||
return isNaN(e)&&(e=0),e=e||0,this._hist?e>=this._hist.length?(console.error("not enough depth: "+this),NaN):this._get(e):(this.mindepth=p.Std.max(this.mindepth,e),NaN)}set(e){this._hist&&(this._hist[this._histPos]=e,this.modified=!0)}prepare(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this._hist||this.add_hist()):this.set(this.original),this.modified=!1)}add_hist(){if(!this._hist){let e=p.Std.na(this.mindepth)?p.Std.max_series_default_size:p.Std.max(this.mindepth+1,1);e=Math.round(e);const t=new Array(e);for(let i=0;i<e;i++)t[i]=NaN;this._hist=t,this._histPos=-1}this._histPos=Math.min(this._histPos+1,this._hist.length),this._histPos===this._hist.length&&(this._histPos=this._hist.length-1,this._hist.shift(),this._hist.push(NaN)),this._hist[this._histPos]=this.original}reset_hist(){this._hist=null,this.add_hist()}adopt(e,t,i){this._hist||(this.mindepth=NaN);const s=t.get();let r=e.indexOf(s);if(0!==i){const i=t.get(1);if(!p.Std.na(i)){r=r===e.indexOf(i)?-1:r}}return r<0?NaN:this._get(r)}indexOf(e){if(!this._hist)return this.mindepth=NaN,-1;if(p.Std.na(e))return-1;const t=this._hist.length,i=this.symbol.index+1,s=Math.min(t,i),r=(0,u.upperbound_int)(this._hist,e,0,s);return 0===r?-1:s-r}_get(e){if(null===this._hist)return NaN;let t=this._histPos-e;return t<0&&(t+=this._hist.length),this._hist[t]}}class m extends _{add_hist(){if(this._hist||(this._hist=new Float64Array(2e3),this._histPos=-1),this._histPos=this._histPos+1,this._histPos===this._hist.length){const e=new Float64Array(2*this._hist.length);e.set(this._hist),this._hist=e}this._hist[this._histPos]=this.original}}class g{constructor(e){this.minimumAdditionalDepth=null,this._vars=[],this._varsIndex=0,this._ctx=[],this._ctxIndex=0,this.symbol=e}new_sym(e,t,i,s,r){return this.symbol.script.add_sym(e,t,i,s,r)}select_sym(e){const t=this.symbol.script.get_sym(e);null==t&&p.Std.error(`Attempted to select symbol at index ${e} but there is no such symbol`),this.symbol=t}is_main_symbol(e){return void 0!==e&&e===this.symbol.script.get_sym(0)}new_var(e){const t=this._vars;t.length<=this._varsIndex&&t.push(new _(this.symbol));const i=t[this._varsIndex++];return arguments.length>0&&void 0!==e&&i.set(e),i}new_unlimited_var(e){const t=this._vars;t.length<=this._varsIndex&&t.push(new m(this.symbol));const i=t[this._varsIndex++];return arguments.length>0&&i.set(e),i}new_ctx(){return this._ctx.length<=this._ctxIndex&&this._ctx.push(new g(this.symbol)),this._ctx[this._ctxIndex++]}prepare(e){this._ctxIndex=0,this._varsIndex=0;for(let t=0;t<this._vars.length;t++)this._vars[t].prepare(e);for(let t=0;t<this._ctx.length;t++)this._ctx[t].prepare(e)}maxAdditionalDepth(){if(null!==this.minimumAdditionalDepth)return this.minimumAdditionalDepth;let e=0;for(let t=0;t<this._vars.length;t++){const i=this._vars[t].mindepth;!isNaN(i)&&i>e&&(e=i)}return e}stop(){this.symbol=null,this._vars=null}setMinimumAdditionalDepth(e){this.minimumAdditionalDepth=e}}function f(e){return!Array.isArray(e)&&"composite"!==e.type&&"non_series_bars"!==e.type&&!!e.nonseries}class v{
|
||||
constructor(e,t,i,s,r,n,o,a,l,c,h){this._body=n,this._symbols=[],this._runner=r,this._inputCallback=a,this._out=o,this._nonseriesOut=l,this._ctx=new g(this.add_sym(e,t,i,s,c,h)),this.init()}calc(e){const t=this._ctx,i=this._body;t.prepare(e);const s=i.main(t,this._inputCallback,e);var r;if(null!=s)if(null===(r=s)||Array.isArray(r)||"composite"!==r.type)this._processResult(s);else for(let e=0;e<s.data.length;++e)this._processResult(s.data[e])}init(){const e=this._ctx,t=this._body;t.init&&t.init(e,this._inputCallback),t.main(e,this._inputCallback)}add_sym(e,t,i,s,r,n){const o=this._runner.add_sym(e,t,i,s,this,r,n);return this._symbols.push(o),o.isdwm()&&this._symbols.length>1&&this._runner.host.enableDwmAligning&&o.enable_dwm_aligning(this._symbols[0].session,o.session),o}maxAdditionalDepth(){return this._symbols[0].isAdditionalDepthAllowed?this._ctx.maxAdditionalDepth():0}stop(){var e;this._symbols=null,null===(e=this._ctx)||void 0===e||e.stop(),this._ctx=null}get_sym(e){return this._symbols[e]}_processResult(e){const t=this._ctx;var i;this._out&&e&&(!isNaN(t.symbol.time)||f(e))&&(f(e)?(i=e,Array.isArray(i)||"projection"!==i.type||(e.projectionTime=t.symbol.time),this._nonseriesOut(t.symbol,e)):!function(e){return!Array.isArray(e)&&("non_series_bars"===e.type||"projection"===e.type)}(e)?this._out(t.symbol,e):e.bars.forEach((e=>{this._out(t.symbol,e)})))}}var y=i(77475),S=i(85898);function b(e){w.feed=e}class w{constructor(e){this._nonseriesUpdate=null,this._script=null,this._symbols=[],this._barsets=[],this._subscription=[],this.host=e,this._isRecalculated=!1,this.isStarted=!1,this.start()}add_sym(e,t,i,s,r,n,o){const a=new d(e,t,i,s,r,n,o);return this._symbols.push(a),a}get_sym(e){return this._symbols[e]}out(e,t){if(this._nonseriesUpdate){const i=Object.assign({},this._nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)}start(){this.isStarted=!0;const e=this.host,t=new v(e.tickerid,e.period,e.currencyCode,e.unitId,this,e.body,this.out.bind(this),e.input,e.nonseriesOut,e.symbolInfo,e.subsessionId);this._script=t;const i=[],n=this._symbols,o=Object.assign({},e.dataRange,{countBack:e.dataRange.countBack+this._script.maxAdditionalDepth()}),a=n[0],l=(t,s,r)=>{i.push(w.feed.subscribe(t.tickerid,t.currencyCode,t.unitId,t.period,r,e.onErrorCallback,e.symbolInfo,e.sessionId,s,e.forceAlignBars,t.subsessionId))},c=(t,i)=>{"series"===(i.nonseries?"nonseries":"series")?this.update(t,i):i.lastBar?(this._nonseriesUpdate=i,i.lastBar.isLastBar=!0,this._symbols[0].lastbar(i.lastBar),this._nonseriesUpdate=null):e.nonseriesOut(n[0],i)},h=()=>o;l(a,h,(e=>{!e.nonseries&&Number.isFinite(e.firstLoadedTimeMs)&&(e=>{function i(i,r){let n=(0,y.createTimeToBarTimeAligner)(i,r)(e);const o=(0,y.createDwmAligner)(i,r);return null!==o&&(n=o.timeToExchangeTradingDay(n)),{to:n,countBack:(0,s.ensureNotNull)(t,"script runner script").maxAdditionalDepth()}}for(let e=1;e<n.length;e++){const t=n[e],s=t.period;r.Interval.isEqual(s,a.period)||l(t,i.bind(null,s),c.bind(null,e))}})(e.firstLoadedTimeMs),c(0,e)
|
||||
}));for(let e=1;e<n.length;e++){const t=n[e];r.Interval.isEqual(t.period,a.period)&&l(t,h,c.bind(null,e))}this._subscription=i}stop(){var e;const t=this._subscription;if(t||this._script){if(null!==t)for(let e=0;e<(null==t?void 0:t.length);e++)w.feed.unsubscribe(t[e]);this._subscription=null,null===(e=this._script)||void 0===e||e.stop(),this._script=null,this._symbols=null,this.isStarted=!1}else console.warn("Recurring script engine stop happened.")}update(e,t){if(!t)return void console.error("Unexpected barset = null");const i=this._symbols[e];if(this._isRecalculated){const e=t.bar(t.count()-1);e.isBarClosed=t.isLastBarClosed(),e.isLastBar=!0,i.lastbar(e)}else this._barsets[e]||(this._barsets[e]=t,i.set_symbolinfo(t.symbolinfo()),this.recalc())}recalc(){const e=this._symbols;for(let t=0;t<e.length;t++)if(!this._barsets[t])return;try{for(let t=e.length-1;t>=0;t--){const i=e[t],s=this._barsets[t],r=s.count();for(let e=0;e<r;e++){const t=s.bar(e);t.isLastBar=e===r-1,t.isBarClosed=!t.isLastBar||s.isLastBarClosed(),i.lastbar(t)}}this._isRecalculated=!0;const t=this._barsets.every((e=>e.endOfData));t&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:t,firstLoadedTimeMs:this._barsets[0].firstLoadedTimeMs,emptyBarCount:this._barsets[0].emptyBarCount()})}catch(e){if(!(e instanceof S.StudyError))throw e;this.host.onErrorCallback(e.message)}}}w.feed={subscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")},unsubscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")}}},46544:(e,t,i)=>{"use strict";const s=i(14483),r=i(33013).getHexColorByName;var n=i(49581).Std;i(24172);var o=i(82808).pivotPointsStandardStudyItem,a=i(72365).volumeProfileVisibleRangeStudyItem,l=i(82597).volumeProfileFixedRangeVbPStudyItem,c=i(82597).volumeProfileFixedRangeBSStudyItem,h=i(39944).spreadStudyItem,d=i(81821).ratioStudyItem,u=i(65097).regressionTrendStudyItem,p=i(53130).anchoredVWAPStudyItem;const _=r("color-ripe-red-400"),m=r("color-minty-green-400"),g=s.enabled("secondary_series_extend_time_scale");JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#9C27B0"}},inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1",format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),n.period(this._context))},this.main=function(e,t){this._context=e;var i=this._context.new_unlimited_var(this._context.symbol.time);this._context.select_sym(1)
|
||||
;var s=this._context.new_unlimited_var(this._context.symbol.time),r=n[t(0)](this._context),o=this._context.new_unlimited_var(r);return this._context.select_sym(0),[o.adopt(s,i,0)]}}},{name:"Overlay",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},inputs:{symbol:"",extendTimeScale:!1}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"Open"},high:{title:"High"},low:{title:"Low"},close:{title:"Close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0},{id:"extendTimeScale",name:"extendTimeScale",defval:!1,type:"boolean",isHidden:!0}],id:"Overlay@tv-basicstudies-1",format:{type:"price",precision:4},canExtendTimeScale:!0},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),n.period(this._context))},this.main=function(e,t){this._context=e;var i=!g||!0!==t(1),s=this._context.new_unlimited_var(this._context.symbol.time);this._context.select_sym(1);var r=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(n.open(this._context)),a=this._context.new_unlimited_var(n.high(this._context)),l=this._context.new_unlimited_var(n.low(this._context)),c=this._context.new_unlimited_var(n.close(this._context));return i?(this._context.select_sym(0),[o.adopt(r,s,1),a.adopt(r,s,1),l.adopt(r,s,1),c.adopt(r,s,1)]):[o.get(0),a.get(0),l.get(0),c.get(0)]}}},{name:"Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:50,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1,color:"#2196F3"},smoothedMA:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1,color:"#2196F3"}},palettes:{volumePalette:{colors:{0:{color:_,width:1,style:0},1:{color:m,width:1,style:0}}}},inputs:{showMA:!1,length:20,col_prev_close:!1,symbol:"",smoothingLine:"SMA",smoothingLength:9}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"},{id:"smoothedMA",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0},smoothedMA:{title:"Smoothed MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"symbol",name:"Other Symbol",defval:"",type:"symbol",optional:!0,isHidden:!1},{id:"showMA",name:"show MA",defval:!1,type:"bool",isHidden:!0},{id:"length",name:"MA Length",defval:20,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["vol_ma"]},{defval:!1,id:"col_prev_close",name:"Color based on previous close",type:"bool"},{id:"smoothingLine",name:"Smoothing Line",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["smoothedMA"]},{
|
||||
id:"smoothingLength",name:"Smoothing Length",defval:9,type:"integer",min:1,max:1e4,hideWhenPlotsHidden:["smoothedMA"]}],id:"Volume@tv-basicstudies-1",format:{type:"volume"}},constructor:function(){this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),n.period(this._context))},this.f_0=function(e,t){return n.gt(e,t)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=n.volume(this._context),s=n.open(this._context),r=n.close(this._context),o=this._context.new_var(this._context.symbol.time),a=this._input(4),l=this._input(5);if(this._context.setMinimumAdditionalDepth(this._input(2)+l),""!==this._input(0)){this._context.select_sym(1);var c=this._context.new_var(this._context.symbol.time),h=this._context.new_var(n.volume(this._context)),d=this._context.new_var(n.open(this._context)),u=this._context.new_var(n.close(this._context));i=h.adopt(c,o,1),s=d.adopt(c,o,1),r=u.adopt(c,o,1),this._context.select_sym(0)}var p,_,m=this._context.new_var(i),g=n.sma(m,this._input(2),this._context),f=this._context.new_var(g),v=this._context.new_var(r);return p=v.get(1)&&this._input(3)?this.f_0(v.get(1),r):this.f_0(s,r),"EMA"===a?_=n.ema(f,l,this._context):"WMA"===a?_=n.wma(f,l,this._context):"SMA"===a&&(_=n.sma(f,l,this._context)),[i,p,g,_]}}},{name:"ZigZag",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"float",min:.001,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),r=i/100,o=Math.ceil(s/2);return[n.zigzag(r,o,this._context),n.zigzagbars(r,o,this._context)]}}},{name:"Sessions",metainfo:{_metainfoVersion:52,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}},backgrounds:{preMarket:{color:"#FF9800",transparency:92,visible:!0},postMarket:{color:"#2196F3",transparency:92,visible:!0}}},linkedToSeries:!0},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break",halign:"left"}},backgrounds:{preMarket:{name:"Pre market"},postMarket:{name:"Post market"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions",format:{type:"inherit"}},constructor:function(){function e(e,t){return{id:e,index:e,extendBottom:!0,extendTop:!0}}function t(e){return{id:e.start,start:e.start,stop:e.stop}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return n.selectSessionBreaks(t,this._times).map(e)
|
||||
},this._getPreAndPostMarketBackgroundsData=function(e){const i=n.selectPreAndPostMarketTimes(e,this._times);return{preMarket:i.preMarket.map(t),postMarket:i.postMarket.map(t)}},this.main=function(e,t){if(n.isdwm(e))return null;var i=n.time(e);if(isNaN(i))return null;var s=this._times.length;if(0!==s&&this._times[s-1]===i||this._times.push(i),!e.symbol.isLastBar||!e.symbol.isNewBar)return null;var r=this._getVerticalLineData(e),o=this._getPreAndPostMarketBackgroundsData(e);return 0===r.length&&0===o.preMarket.length&&0===o.postMarket?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:r}],backgrounds:[{styleId:"preMarket",data:o.preMarket},{styleId:"postMarket",data:o.postMarket}]},erase:[{action:"all"}]}}}}}},{name:"SuperTrend",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0,format:{type:"inherit"}},constructor:function(){this.main=function(e,t){var i=t(0),s=t(1),[r,o]=n.supertrend(s,i,e),a=e.new_var(o).get(1);return[r,-1===o?0:1,-1===o&&a!==o?1:NaN,1===o&&a!==o?1:NaN]}}},o,a,l,c,h,d,u,p])},49581:(e,t,i)=>{"use strict";i.d(t,{Std:()=>h});var s=i(60156),r=i(41249);class n{constructor(e,t,i){var s,r;this._timezone=e,this._preMarketSessionEntries=null!==(s=null==t?void 0:t.entries())&&void 0!==s?s:[],this._postMarketSessionEntries=null!==(r=null==i?void 0:i.entries())&&void 0!==r?r:[]}getPreAndPostMarketTimes(e){if(0===e.length)return{preMarket:[],postMarket:[]};const t=[],i=[];let s=null,n=null,o=e[0],a=(0,r.utc_to_cal)(this._timezone,o);this._isInPreMarketSession(a)&&(n=o),this._isInPostMarketSession(a)&&(s=o);for(let l=1;l<e.length;l++){const c=e[l],h=(0,r.utc_to_cal)(this._timezone,c);null!==s&&this._isInPostMarketSession(a)&&!this._isInPostMarketSession(h)&&(i.push({
|
||||
@@ -57,7 +57,8 @@ start:s,stop:o}),s=null),null===n&&this._isInPreMarketSession(h)&&(n=c),null===s
|
||||
h.dayofweek=(e,t)=>h.timepart(e.symbol,r.DAY_OF_WEEK,t),h.hour=(e,t)=>h.timepart(e.symbol,r.HOUR_OF_DAY,t),h.minute=(e,t)=>h.timepart(e.symbol,r.MINUTE,t),h.second=(e,t)=>h.timepart(e.symbol,r.SECOND,t),h.add_days_considering_dst=(e,t,i)=>r.add_days_considering_dst(r.get_timezone(e),t,i),h.add_years_considering_dst=(e,t,i)=>r.add_years_considering_dst(r.get_timezone(e),t,i),h.selectSessionBreaks=(e,t)=>{if(h.isdwm(e)||void 0===e.symbol.session.timezone)return[];const i=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null),r=[],n=t.length;if(i.moveTo(t[n-1]),1===n&&i.startOfBar(0)===t[0])r.push(t[0]);else{for(let e=n-2;e>=0;--e){const s=t[e];if(s>=i.startOfBar(0))continue;i.moveTo(s);const n=t[e+1];r.push(n)}r.reverse()}return r},h.selectPreAndPostMarketTimes=(e,t)=>{var i,s;if(h.isdwm(e)||void 0===e.symbol.session.timezone)return{preMarket:[],postMarket:[]};return new n(e.symbol.session.timezone,null!==(i=e.symbol.preMarketSubsession)&&void 0!==i?i:null,null!==(s=e.symbol.postMarketSubsession)&&void 0!==s?s:null).getPreAndPostMarketTimes(t)},h.iff=(e,t,i)=>h.not(e)?i:t,h.rising=(e,t)=>{for(let i=1;i<t+1;++i)if(e.get(i)>e.get(0))return 0;return 1},h.falling=(e,t)=>{for(let i=1;i<t+1;++i)if(e.get(i)<e.get(0))return 0;return 1},h.timepart=(e,t,i)=>{const s=r.utc_to_cal(e.session.timezone,i||e.bartime());return r.get_part(s,t)},h.rsi=(e,t)=>h.isZero(t)?100:h.isZero(e)?0:100-100/(1+e/t),h.sum=(e,t,i)=>{const s=i.new_var(),r=h.nz(e.get())+h.nz(s.get(1))-h.nz(e.get(t));return s.set(r),r},h.sma=(e,t,i)=>{const s=h.sum(e,t,i);return h.na(e.get(t-1))?NaN:s/t},h.smma=(e,t,i)=>{const s=i.new_var(e),r=h.sma(s,t,i),n=i.new_var(),o=(n.get(1)*(t-1)+e)/t;return n.set(h.na(n.get(1))?r:o),n.get(0)},h.rma=(e,t,i)=>{const s=h.sum(e,t,i),r=t-1,n=e.get(r),o=i.new_var(),a=o.get(1),l=e.get(),c=h.na(n)?NaN:h.na(a)?s/t:(l+a*r)/t;return o.set(c),c},h.fixnan=(e,t)=>{const i=t.new_var();return isNaN(e)?i.get(1):(i.set(e),e)},h.tr=(e,t)=>{let i=t.new_var(h.close(t)).get(1);return e&&isNaN(i)&&(i=h.close(t)),h.max(h.max(h.high(t)-h.low(t),h.abs(h.high(t)-i)),h.abs(h.low(t)-i))},h.atr=(e,t)=>{const i=t.new_var(h.tr(void 0,t));return h.rma(i,e,t)},h.ema=(e,t,i)=>{const s=h.sum(e,t,i),r=i.new_var(),n=e.get(0),o=e.get(t-1),a=r.get(1),l=h.na(o)?NaN:h.na(a)?s/t:2*(n-a)/(t+1)+a;return r.set(l),l},h.wma=(e,t,i)=>{let s=0;for(let i=t=Math.round(t);i>=0;i--){s+=(t-i)*e.get(i)}return 2*s/(t*(t+1))},h.vwma=(e,t,i)=>{const s=i.new_var(h.volume(i)),r=i.new_var(e.get(0)*h.volume(i));return h.sma(r,t,i)/h.sma(s,t,i)},h.swma=(e,t)=>(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6,h.supertrend=(e,t,i)=>{const s=h.atr(t,i),r=i.new_var(s).get(1),n=h.hl2(i);let o=n+s*e,a=n-s*e;const l=h.close(i),c=i.new_var(l).get(1),d=i.new_var(),u=h.nz(d.get(1)),p=i.new_var(),_=h.nz(p.get(1));a=h.gt(a,u)||h.lt(c,u)?a:u,d.set(a),o=h.lt(o,_)||h.gt(c,_)?o:_,p.set(o);let m=h.na();const g=i.new_var(),f=g.get(1);m=h.na(r)?1:f===_?l>o?-1:1:l<a?1:-1;const v=-1===m?a:o;return g.set(v),h.n(i)<=t?[Number.NaN,0]:[v,m]},h.lowestbars=(e,t,i)=>-d(e,t,0,((e,t)=>h.lt(e,t)),Number.MAX_VALUE).index,
|
||||
h.lowest=(e,t,i)=>d(e,t,0,((e,t)=>h.lt(e,t)),Number.MAX_VALUE).value,h.highestbars=(e,t,i)=>-d(e,t,0,((e,t)=>h.gt(e,t)),Number.MIN_VALUE).index,h.highest=(e,t,i)=>d(e,t,0,((e,t)=>h.gt(e,t)),Number.MIN_VALUE).value,h.cum=(e,t)=>{const i=t.new_var(),s=h.nz(i.get(1))+e;return i.set(s),s},h.accdist=e=>{const t=h.high(e),i=h.low(e),s=h.close(e),r=h.volume(e);return h.cum(s===t&&s===i||t===i?0:r*(2*s-i-t)/(t-i),e)},h.correlation=(e,t,i,s)=>{const r=h.sma(e,i,s),n=h.sma(t,i,s),o=s.new_var(e.get()*t.get());return(h.sma(o,i,s)-r*n)/Math.sqrt(h.variance2(e,r,i)*h.variance2(t,n,i))},h.stoch=(e,t,i,s,r)=>{const n=h.highest(t,s,r),o=h.lowest(i,s,r);return h.fixnan(100*(e.get()-o)/(n-o),r)},h.tsi=(e,t,i,s)=>{const r=s.new_var(h.change(e)),n=s.new_var(h.abs(h.change(e))),o=s.new_var(h.ema(r,i,s)),a=s.new_var(h.ema(n,i,s));return h.ema(o,t,s)/h.ema(a,t,s)},h.cross=(e,t,i)=>{if(isNaN(e)||isNaN(t))return!1;const s=i.new_var((r=e-t)<0?-1:0===r?0:1);var r;return!isNaN(s.get(1))&&s.get(1)!==s.get()},h.linreg=(e,t,i)=>{let s=0,r=0,n=0,o=0;for(let i=0;i<t;++i){const a=e.get(i),l=t-1-i+1;s+=l,r+=a,n+=l*l,o+=a*l}const a=(t*o-s*r)/(t*n-s*s);return r/t-a*s/t+a+a*(t-1-i)},h.sar=(e,t,i,s)=>{const r=s.new_var(),n=s.new_var(),o=s.new_var(),a=h.high(s),l=h.low(s),c=h.close(s),d=s.new_var(a),u=s.new_var(l),p=s.new_var(c),_=s.new_var();let m=_.get(1),g=n.get(1),f=o.get(1);n.set(g),o.set(f);let v=!1;const y=u.get(1),S=u.get(2),b=d.get(1),w=d.get(2),C=p.get(),P=p.get(1);2===h.n(s)&&(h.greater(C,P)?(r.set(1),o.set(d.get()),m=y,f=d.get()):(r.set(-1),o.set(u.get()),m=b,f=u.get()),v=!0,n.set(e),g=e);let x=m+g*(f-m);return 1===r.get()?h.greater(x,u.get())&&(v=!0,r.set(-1),x=Math.max(d.get(),o.get()),o.set(u.get()),n.set(e)):h.less(x,d.get())&&(v=!0,r.set(1),x=Math.min(u.get(),o.get()),o.set(d.get()),n.set(e)),v||(1===r.get()?h.greater(d.get(),o.get())&&(o.set(d.get()),n.set(Math.min(n.get()+t,i))):h.less(u.get(),o.get())&&(o.set(u.get()),n.set(Math.min(n.get()+t,i)))),1===r.get()?(x=Math.min(x,y),h.n(s)>2&&(x=Math.min(x,S))):(x=Math.max(x,b),h.n(s)>2&&(x=Math.max(x,w))),_.set(x),x},h.alma=(e,t,i,s)=>{const r=Math.floor(i*(t-1)),n=t/s*(t/s),o=[];let a=0;for(let e=0;e<t;++e){const t=Math.exp(-1*Math.pow(e-r,2)/(2*n));a+=t,o.push(t)}for(let e=0;e<t;++e)o[e]/=a;let l=0;for(let i=0;i<t;++i)l+=o[i]*e.get(t-i-1);return l},h.change=e=>e.get()-e.get(1),h.roc=(e,t)=>{const i=e.get(t);return 100*(e.get()-i)/i},h.dev=(e,t,i)=>{const s=h.sma(e,t,i);return h.dev2(e,t,s)},h.dev2=(e,t,i)=>{let s=0;for(let r=0;r<t;r++){const t=e.get(r);s+=h.abs(t-i)}return s/t},h.stdev=(e,t,i)=>{const s=h.variance(e,t,i);return h.sqrt(s)},h.variance=(e,t,i)=>{const s=h.sma(e,t,i);return h.variance2(e,s,t)},h.variance2=(e,t,i)=>{let s=0;for(let r=0;r<i;r++){const i=e.get(r),n=h.abs(i-t);s+=n*n}return s/i},h.percentrank=(e,t)=>{if(h.na(e.get(t-1)))return NaN;let i=0;const s=e.get();for(let r=1;r<t;r++){const t=e.get(r);h.ge(s,t)&&i++}return 100*i/t},h.createNewSessionCheck=e=>{if(void 0===e.symbol.session.timezone)return()=>!1;const t=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null)
|
||||
;return e=>t.indexOfBar(e)===o.SessionStage.POST_SESSION&&(t.moveTo(e),!0)},h.createNthBarInSessionCheck=e=>{if(void 0===e.symbol.session.timezone)return()=>!1;const t=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null);return(e,i)=>(t.indexOfBar(e)===o.SessionStage.POST_SESSION&&t.moveTo(e),t.indexOfBar(e)===i)},h.error=e=>{throw new a.StudyError(e)},h.dmi=(e,t,i)=>{const s=i.new_var(h.high(i)),r=i.new_var(h.low(i)),n=h.change(s),o=-h.change(r),a=i.new_var(h.na(n)||h.na(o)?h.na():h.and(h.gt(n,o),h.gt(n,0))?n:0),l=i.new_var(h.na(o)?h.na():h.and(h.gt(o,n),h.gt(o,0))?o:0),c=h.atr(e,i),d=h.fixnan(100*h.rma(a,e,i)/c,i),u=h.fixnan(100*h.rma(l,e,i)/c,i);let p=d+u;h.isZero(p)&&(p+=1);const _=Math.abs(d-u)/p*100,m=i.new_var(_),g=h.rma(m,t,i),f=i.new_var(g);return[d,u,_,g,(f.get(0)+f.get(e-1))/2]},h.zigzag=(e,t,i)=>new m(e,t,i).lastPrice(),h.zigzagbars=(e,t,i)=>{const s=new m(e,t,i);return-1===s.lastIndex()?NaN:s.lastIndex()-h.n(i)};const u=0,p=1;class _{constructor(e,t,i,s,r){this._areaRight=e,this._areaLeft=t,this._pivotType=i,this._series=s,this._currentIndex=r.new_var(0),this._currentValue=r.new_var(NaN),this._pivotIndex=r.new_var(-1),this._index=h.n(r),this._isNewBar=r.symbol.isNewBar;const n=this._currentIndex.get(1),o=this._currentValue.get(1),a=this._pivotIndex.get(1);this._index>1&&(this._currentIndex.set(n),this._currentValue.set(o),this._pivotIndex.set(a))}isPivotFound(){return-1!==this._pivotIndex.get()}pivotIndex(){return this._pivotIndex.get()}currentValue(){return this._currentValue.get()}pivotType(){return this._pivotType}reset(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)}isRightSideOk(e){return e-this._currentIndex.get()===this._areaRight}isViolate(e,t){if(e<1||isNaN(this._currentValue.get()))return!0;const i=this._series.get(this._index-e);return!!isNaN(i)||(i===this._currentValue.get()?t:this._pivotType===p?i>this._currentValue.get():i<this._currentValue.get())}processPoint(e){this.isViolate(e,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(e))}isRestartNeeded(e){return e-this._currentIndex.get()>this._areaRight}update(){if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){let e=!0;for(let t=0;t<this._areaLeft;++t)if(this.isViolate(this._currentIndex.get()-1-t,!0)){e=!1;break}e&&this._pivotIndex.set(this._currentIndex.get())}}else-1!==this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index)){this.reset();for(let e=0;e<=this._areaRight;++e)this.processPoint(this._index-this._areaRight+e)}}}_.LOW=0,_.HIGH=1;class m{constructor(e,t,i){this._deviation=e;const s=i.new_var(h.high(i)),r=i.new_var(h.low(i));s.get(2*t+1),r.get(2*t+1),this._pivotHigh=new _(t,t,p,s,i),this._pivotLow=new _(t,t,u,r,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=h.n(i),this._isBarClosed=i.symbol.isBarClosed;const n=this._lastIndex.get(1),o=this._lastVal.get(1),a=this._lastType.get(1)
|
||||
;this._index>1&&this.addPivot(n,o,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}addPivot(e,t,i){this._lastIndex.set(e),this._lastVal.set(t),this._lastType.set(i)}updatePivot(e,t){this._lastIndex.set(e),this._lastVal.set(t)}lastPrice(){return this._lastVal.get()}lastIndex(){return this._lastIndex.get()}addPoint(e,t,i){if(isNaN(this._lastVal.get()))return void this.addPivot(e,t,i);const s=this._lastVal.get();if(this._lastType.get()===i){return void((i===p?t>s:t<s)&&this.updatePivot(e,t))}Math.abs(s-t)/t>this._deviation&&this.addPivot(e,t,i)}processPivot(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())}}},53130:(e,t,i)=>{"use strict";i.d(t,{anchoredVWAPStudyItem:()=>n});var s=i(50151),r=i(49581);const n={name:"Anchored VWAP",metainfo:{_metainfoVersion:51,description:"Anchored VWAP",shortDescription:"Anchored VWAP",format:{type:"inherit"},id:"AnchoredVWAP@tv-basicstudies-1",is_hidden_study:!0,is_price_study:!0,defaults:{inputs:{start_time:0,source:"hlc3"},styles:{VWAP:{color:"#1e88e5",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,display:15}}},inputs:[{defval:0,id:"start_time",isHidden:!0,max:253370764800,min:-253370764800,name:"Start time",type:"time"},{defval:"hlc3",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"source"}],plots:[{id:"VWAP",type:"line"}],styles:{VWAP:{histogramBase:0,title:"VWAP"}}},constructor:class{constructor(){this._isNewSession=null,this._firstBarTime=0}init(e,t){this._firstBarTime=t(0),this._isNewSession=null}main(e,t,i){if(void 0===i)return[NaN];(0,s.assert)(e.symbol.time===i.time);const n=i.time;if(n&&n<this._firstBarTime)return[NaN];const o=r.Std.volume(e),a=r.Std[t(1)](e),l=e.new_unlimited_var(),c=e.new_unlimited_var(),h=e.symbol.time;null!==h&&(null===this._isNewSession&&(this._isNewSession=r.Std.createNewSessionCheck(e)),this._isNewSession&&this._isNewSession(h)&&(this._resetHist(l),this._resetHist(c))),l.set(r.Std.nz(l.get())+a*o),c.set(r.Std.nz(c.get())+o);return[l.get()/c.get()]}_resetHist(e){e.reset_hist()}}}},2543:(e,t,i)=>{"use strict";i.d(t,{OHLCV:()=>r});var s=i(49581);class r{main(e){return[s.Std.open(e),s.Std.high(e),s.Std.low(e),s.Std.close(e),s.Std.volume(e),s.Std.updatetime(e),void 0,void 0,void 0,void 0]}}},82808:(e,t,i)=>{"use strict";i.d(t,{pivotPointsStandardStudyItem:()=>d});var s=i(36274),r=i(47609),n=i(49581);class o{constructor(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}}class a{constructor(){this.pivots=[]}}function l(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function c(e,t){if(n.Std.ismonthly(e)){let i=new Date(t);return i.getUTCDay()<function(e,t){return new Date(t,e,0).getDate()}(i.getUTCMonth(),i.getUTCFullYear())?(l(i,n.Std.interval(e)),i=n.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=n.Std.add_days_considering_dst("Etc/UTC",i,1),l(i,n.Std.interval(e))),
|
||||
;this._index>1&&this.addPivot(n,o,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}addPivot(e,t,i){this._lastIndex.set(e),this._lastVal.set(t),this._lastType.set(i)}updatePivot(e,t){this._lastIndex.set(e),this._lastVal.set(t)}lastPrice(){return this._lastVal.get()}lastIndex(){return this._lastIndex.get()}addPoint(e,t,i){if(isNaN(this._lastVal.get()))return void this.addPivot(e,t,i);const s=this._lastVal.get();if(this._lastType.get()===i){return void((i===p?t>s:t<s)&&this.updatePivot(e,t))}Math.abs(s-t)/t>this._deviation&&this.addPivot(e,t,i)}processPivot(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())}}},53130:(e,t,i)=>{"use strict";i.d(t,{anchoredVWAPStudyItem:()=>o});const s={_metainfoVersion:51,description:"Anchored VWAP",shortDescription:"Anchored VWAP",format:{type:"inherit"},id:"AnchoredVWAP@tv-basicstudies-1",is_hidden_study:!0,is_price_study:!0,defaults:{areaBackground:{backgroundColor:"#4caf50",fillBackground:!0,transparency:95},filledAreasStyle:{Background_1:{fillType:void 0,color:"#4caf50",transparency:95,visible:!0}},inputs:{start_time:0,"Bands Calculation Mode":"Standard Deviation",bands_multiplier:1,bands_multiplier_2:2,bands_multiplier_3:3,calculate_stDev:!0,calculate_stDev_2:!1,calculate_stDev_3:!1,source:"hlc3"},styles:{VWAP:{color:"#1e88e5",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,display:15},LowerBand:{display:15,color:"#4caf50",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},LowerBand_2:{display:15,color:"#808000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},LowerBand_3:{display:15,color:"#00897b",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand:{display:15,color:"#4caf50",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand_2:{display:15,color:"#808000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand_3:{display:15,color:"#00897b",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0}}},inputs:[{defval:0,id:"start_time",isHidden:!0,max:Number.MAX_SAFE_INTEGER,min:-Number.MAX_SAFE_INTEGER,name:"Start time",type:"time"},{defval:"Standard Deviation",group:"Bands Settings",id:"Bands Calculation Mode",name:"Bands Calculation Mode",options:["Standard Deviation","Percentage"],tooltip:"Determines the units used to calculate the distance of the bands. When 'Percentage' is selected, a multiplier of 1 means 1%.",type:"text",display:15},{defval:!0,group:"Bands Settings",id:"calculate_stDev",inline:"band_1",name:" ",type:"bool",display:0},{defval:1,group:"Bands Settings",id:"bands_multiplier",inline:"band_1",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #1",step:.5,type:"float",display:15},{defval:!1,group:"Bands Settings",id:"calculate_stDev_2",inline:"band_2",name:" ",type:"bool",display:0},{defval:2,group:"Bands Settings",id:"bands_multiplier_2",inline:"band_2",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #2",step:.5,type:"float",display:15},{defval:!1,
|
||||
group:"Bands Settings",id:"calculate_stDev_3",inline:"band_3",name:" ",type:"bool",display:0},{defval:3,group:"Bands Settings",id:"bands_multiplier_3",inline:"band_3",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #3",step:.5,type:"float",display:15},{defval:"hlc3",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"source"}],plots:[{id:"VWAP",type:"line"},{id:"UpperBand",type:"line"},{id:"LowerBand",type:"line"},{id:"UpperBand_2",type:"line"},{id:"LowerBand_2",type:"line"},{id:"UpperBand_3",type:"line"},{id:"LowerBand_3",type:"line"}],styles:{VWAP:{histogramBase:0,title:"VWAP"},LowerBand:{histogramBase:0,title:"Lower Band #1"},LowerBand_2:{histogramBase:0,title:"Lower Band #2"},LowerBand_3:{histogramBase:0,title:"Lower Band #3"},UpperBand:{histogramBase:0,title:"Upper Band #1"},UpperBand_2:{histogramBase:0,title:"Upper Band #2"},UpperBand_3:{histogramBase:0,title:"Upper Band #3"}},filledAreas:[{title:"Background #1",id:"Background_1",objAId:"UpperBand",objBId:"LowerBand",type:"plot_plot"}],area:[{name:"UpperBand",visible:!0},{name:"LowerBand",visible:!0}]};var r=i(50151),n=i(49581);const o={name:"Anchored VWAP",metainfo:s,constructor:class{constructor(){this._isNewSession=null,this._firstBarTime=0}init(e,t){this._firstBarTime=t(0),this._isNewSession=null}main(e,t,i){if(void 0===i)return[NaN];(0,r.assert)(e.symbol.time===i.time);const s=i.time;if(s&&s<this._firstBarTime)return[NaN];const o=n.Std.volume(e),a=n.Std[t(8)](e),l=e.new_unlimited_var(),c=e.new_unlimited_var(),h=e.new_unlimited_var(),d=e.symbol.time;null!==d&&(null===this._isNewSession&&(this._isNewSession=n.Std.createNewSessionCheck(e)),this._isNewSession&&this._isNewSession(d)&&(this._resetHist(l),this._resetHist(c),this._resetHist(h))),l.set(n.Std.nz(l.get())+a*o),c.set(n.Std.nz(c.get())+o),h.set(n.Std.nz(h.get())+a*a*o);const u=l.get()/c.get(),p=h.get()/c.get()-Math.pow(u,2),_=Math.sqrt(Math.max(0,p)),m="Standard Deviation"===t(1)?_:.01*u,g=t(2),f=t(3),v=t(4),y=t(5),S=t(6),b=t(7);return[u,g?u+m*f:NaN,g?u-m*f:NaN,v?u+m*y:NaN,v?u-m*y:NaN,S?u+m*b:NaN,S?u-m*b:NaN]}_resetHist(e){e.reset_hist()}}}},2543:(e,t,i)=>{"use strict";i.d(t,{OHLCV:()=>r});var s=i(49581);class r{main(e){return[s.Std.open(e),s.Std.high(e),s.Std.low(e),s.Std.close(e),s.Std.volume(e),s.Std.updatetime(e),void 0,void 0,void 0,void 0]}}},82808:(e,t,i)=>{"use strict";i.d(t,{pivotPointsStandardStudyItem:()=>d});var s=i(36274),r=i(47609),n=i(49581);class o{constructor(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}}class a{constructor(){this.pivots=[]}}function l(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function c(e,t){if(n.Std.ismonthly(e)){let i=new Date(t);return i.getUTCDay()<function(e,t){return new Date(t,e,0).getDate()}(i.getUTCMonth(),i.getUTCFullYear())?(l(i,n.Std.interval(e)),i=n.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=n.Std.add_days_considering_dst("Etc/UTC",i,1),l(i,n.Std.interval(e))),
|
||||
i.valueOf()}return t+s.Interval.parse(e.symbol.resolution).inMilliseconds(t)}function h(e,t){switch(t){case"Auto":return function(e){const t=s.Interval.parse(e.symbol.interval+e.symbol.resolution);switch(t.kind()){case s.ResolutionKind.Weeks:case s.ResolutionKind.Months:return"12M";case s.ResolutionKind.Days:return"1M";case s.ResolutionKind.Minutes:return t.multiplier()>=1&&t.multiplier()<=15?"1D":"1W";case s.ResolutionKind.Seconds:case s.ResolutionKind.Ticks:return"1D"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}const d={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla","Floor"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:1,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots",format:{type:"price",precision:4}},constructor:class{constructor(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}init(e,t){const i=t(0),s=t(1),o=t(2),l=t(3);this._data=new a,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;case"Floor":return 6;default:throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=s,this._historicalPivotsToKeep=l,this._pivTimeFrame=o,this._isValidResolution=function(e,t){return!(n.Std.isdaily(e)&&"Daily"===t||n.Std.isweekly(e)&&("Daily"===t||"Weekly"===t)||n.Std.ismonthly(e)&&("Daily"===t||"Weekly"===t||"Monthly"===t))}(e,this._pivTimeFrame),this._isValidResolution||n.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=h(e,this._pivTimeFrame),void 0!==e.symbol.info&&(0,r.findSuitableResolutionToBuildFrom)(this._secondaryRes,e.symbol.info).error&&(this._isValidResolution=!1,n.Std.error(`Resolution ${this._secondaryRes} is not supported for this symbol`))),e.new_sym(e.symbol.tickerid,this._secondaryRes)}main(e,t,i){if(!this._isValidResolution)return null;if(e.is_main_symbol(i))return isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null;e.select_sym(1)
|
||||
;const s=e.new_var(n.Std.open(e)),r=e.new_var(n.Std.high(e)),a=e.new_var(n.Std.low(e)),l=e.new_var(n.Std.close(e)),h=e.new_var(n.Std.time(e)),d=this._data,u=s.get(0),p=h.get(0),_=s.get(1),m=r.get(1),g=a.get(1),f=l.get(1),v=e.symbol.isLastBar;if(0!==d.pivots.length&&e.symbol.isNewBar){const e=d.pivots[d.pivots.length-1];e.endIndex__t!==p&&(e.endIndex__t=p)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;const y=function(e,t,i,s,r,a,l,c){const h=new o;let d=NaN;const u=i-s;switch(c){case 0:d=(i+s+r)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+(i-s),h.s2=d-(i-s),h.r3=2*d+(i-2*s),h.s3=2*d-(2*i-s),h.r4=3*d+(i-3*s),h.s4=3*d-(3*i-s),h.r5=4*d+(i-4*s),h.s5=4*d-(4*i-s);break;case 1:d=(i+s+r)/3,h.p=d,h.r1=d+.382*u,h.s1=d-.382*u,h.r2=d+.618*u,h.s2=d-.618*u,h.r3=d+u,h.s3=d-u;break;case 2:d=(i+s+2*e)/4,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+u,h.s2=d-u,h.r3=i+2*(d-s),h.s3=s-2*(i-d),h.r4=h.r3+u,h.s4=h.s3-u;break;case 3:d=(i+s+r)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+u,h.s2=d-u,h.r3=d+2*u,h.s3=d-2*u,h.r4=d+3*u,h.s4=d-3*u;break;case 4:let o=NaN;o=n.Std.equal(t,r)?i+s+2*r:n.Std.greater(r,t)?2*i+s+r:2*s+i+r,d=o/4,h.p=d,h.r1=o/2-s,h.s1=o/2-i;break;case 5:d=(i+s+r)/3,h.p=d,h.r1=r+1.1*u/12,h.s1=r-1.1*u/12,h.r2=r+1.1*u/6,h.s2=r-1.1*u/6,h.r3=r+1.1*u/4,h.s3=r-1.1*u/4,h.r4=r+1.1*u/2,h.s4=r-1.1*u/2;break;case 6:d=(i+s+r)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+(i-s),h.s2=d-(i-s),h.r3=d-h.s1+h.r2,h.s3=2*d-(2*i-s);break;default:throw new Error("Unknown kind")}return h.startIndex__t=a,h.endIndex__t=l,h}(u,_,m,g,f,p,c(e,p),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(d.pivots=[]),d.pivots.push(y),d.pivots.length>this._historicalPivotsToKeep&&d.pivots.shift(),v?this._createResponse():null}_createResponse(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}}_removeUnusedPivots(){const e=Math.max(this._data.pivots.findIndex((e=>e.startIndex__t>this._firstMainSeriesBarTime))-1,0);e>0&&this._data.pivots.splice(0,e)}}}},81821:(e,t,i)=>{"use strict";i.d(t,{ratioStudyItem:()=>n});var s=i(87302);class r extends s.SpreadRatioBase{_doCalculation(e,t,i,s){return e*t/(i*s)}}const n={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:s.spreadRatioDefaults,plots:s.spreadRatioPlots,styles:s.spreadRatioStyles,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:s.spreadRatioInputs,id:"Ratio@tv-basicstudies-1",format:{type:"price",precision:2}},constructor:r}},65097:(e,t,i)=>{"use strict";i.d(t,{regressionTrendStudyItem:()=>n});var s=i(49581);function r(e,t,i){const r={slope:NaN,average:NaN,intercept:NaN,stdDev:NaN,upDev:NaN,downDev:NaN,pearsons:NaN};return 0===e.length||(function(e,t){let i=0,s=0,r=0,n=0;for(let t=0;t<e.length;++t){const o=e[t],a=t+1;i+=a,s+=o,r+=a*a,n+=o*a}t.slope=(e.length*n-i*s)/(e.length*r-i*i),t.average=s/e.length,t.intercept=t.average-t.slope*i/e.length+t.slope}(e,r),function(e,t,i,r){let n=0,o=0,a=0,l=0,c=0,h=0,d=r.intercept;const u=e.length-1,p=r.intercept+r.slope*u/2;for(let s=0;s<=u;++s){let u=t[s]-d;u>n&&(n=u),u=d-i[s],u>o&&(o=u),u=e[s]
|
||||
;const _=u-r.average,m=d-p;u-=d,a+=u*u,l+=_*_,c+=m*m,h+=_*m,d+=r.slope}r.stdDev=Math.sqrt(a/(0===u?1:u)),r.pearsons=s.Std.isZero(l)||s.Std.isZero(c)?0:h/Math.sqrt(l*c),r.upDev=n,r.downDev=o}(e,t,i,r)),r}const n={name:"Regression Trend",metainfo:{_metainfoVersion:51,description:"Regression Trend",format:{type:"inherit"},id:"RegressionTrend@tv-basicstudies-144",is_hidden_study:!0,is_price_study:!0,shortDescription:"Reg Trend",defaults:{inputs:{"first bar time":0,"last bar time":0,"lower diviation":-2,source:"close","upper diviation":2,"use lower diviation":!0,"use upper diviation":!0},styles:{}},inputs:[{defval:2,id:"upper diviation",max:500,min:-500,name:"Upper Deviation",type:"float"},{defval:-2,id:"lower diviation",max:500,min:-500,name:"Lower Deviation",type:"float"},{defval:!0,id:"use upper diviation",name:"Use Upper Deviation",type:"bool"},{defval:!0,id:"use lower diviation",name:"Use Lower Deviation",type:"bool"},{defval:0,id:"first bar time",isHidden:!0,max:253370764800,min:-253370764800,name:"First bar time",type:"time"},{defval:0,id:"last bar time",isHidden:!0,max:253370764800,min:-253370764800,name:"Last bar time",type:"time"},{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"source"}],plots:[]},constructor:class{constructor(){this._resultSent=!1}init(e,t){this._resultSent=!1,this._data={baseLine:{startPrice:NaN,endPrice:NaN},upLine:{startPrice:NaN,endPrice:NaN},downLine:{startPrice:NaN,endPrice:NaN},pearsons:NaN,startIndex__t:NaN,endIndex__t:NaN}}main(e,t){const i=t(6),n=e.new_unlimited_var(s.Std.time(e)),o=e.new_unlimited_var(s.Std.high(e)),a=e.new_unlimited_var(s.Std.low(e)),l=e.new_unlimited_var(s.Std[i](e));if(!e.symbol.isLastBar)return null;if(this._resultSent)return null;const c=t(0),h=t(1),d=t(2),u=t(3),p=t(4),_=t(5),m=n.indexOf(p),g=n.indexOf(_),f=[],v=[],y=[],S=[];for(let e=m;e>=g;--e)f.push(n.get(e)),v.push(o.get(e)),y.push(a.get(e)),S.push(l.get(e));return this._updateData(f,d,c,u,h,p,_,r(S,v,y)),this._resultSent=!0,{type:"non_series_data",nonseries:!0,data:{data:this._data}}}_updateData(e,t,i,s,r,n,o,a){const l=e.length-1;this._data.baseLine.startPrice=a.intercept,this._data.baseLine.endPrice=a.intercept+a.slope*l;const c=a.intercept+(t?a.stdDev*i:a.upDev);this._data.upLine.startPrice=c,this._data.upLine.endPrice=c+a.slope*l;const h=a.intercept+(s?a.stdDev*r:-a.downDev);this._data.downLine.startPrice=h,this._data.downLine.endPrice=h+a.slope*l,this._data.pearsons=a.pearsons,this._data.startIndex__t=n,this._data.endIndex__t=o}}}},87302:(e,t,i)=>{"use strict";i.d(t,{SpreadRatioBase:()=>l,spreadRatioDefaults:()=>c,spreadRatioFilledAreas:()=>_,spreadRatioInputs:()=>h,spreadRatioPalettes:()=>p,spreadRatioPlots:()=>d,spreadRatioStyles:()=>u});var s=i(33013),r=i(72877),n=i(49581),o=i(87095);const a="rgba(0, 0, 0, 0)";class l{init(e,t){e.new_sym(t(1),n.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1}main(e,t){const i=e.symbol.time,s=n.Std[this._source](e);e.select_sym(1)
|
||||
@@ -1,6 +1,6 @@
|
||||
(()=>{"use strict";var e,a,d,c,t,f={},b={};function r(e){var a=b[e];if(void 0!==a)return a.exports;var d=b[e]={id:e,loaded:!1,exports:{}};return f[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=f,r.c=b,e=[],r.O=(a,d,c,t)=>{if(!d){var f=1/0;for(i=0;i<e.length;i++){for(var[d,c,t]=e[i],b=!0,n=0;n<d.length;n++)(!1&t||f>=t)&&Object.keys(r.O).every((e=>r.O[e](d[n])))?d.splice(n--,1):(b=!1,t<f&&(f=t));if(b){e.splice(i--,1);var o=c();void 0!==o&&(a=o)}}return a}t=t||0;for(var i=e.length;i>0&&e[i-1][2]>t;i--)e[i]=e[i-1];e[i]=[d,c,t]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var t=Object.create(null);r.r(t);var f={};a=a||[null,d({}),d([]),d(d)];for(var b=2&c&&e;"object"==typeof b&&!~a.indexOf(b);b=d(b))Object.getOwnPropertyNames(b).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,r.d(t,f),t},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>9417===e?"__LANG__.9417.7ff64779d43389a1bb41.js":3175===e?"__LANG__.3175.e0a2c845c5cba23f42fb.js":3951===e?"__LANG__.3951.babac9be598102fb0d92.js":5362===e?"__LANG__.5362.311bfba5d2c84b13ec2b.js":2578===e?"__LANG__.2578.ab3178e0160c259eac53.js":2547===e?"__LANG__.2547.28b713bedf796244795d.js":2285===e?"__LANG__.2285.1268ecef367debd2960b.js":344===e?"__LANG__.344.a9e566fa1091368f40c7.js":178===e?"__LANG__.178.dd03c0163a8373c0fc5b.js":6306===e?"__LANG__.6306.b88dcc3f0d7db89ebfc1.js":3236===e?"__LANG__.3236.e12bb9a536432e97ec0c.js":({92:"chart-screenshot-hint",139:"get-error-card",507:"study-pane-views",607:"study-property-pages-with-definitions",731:"add-compare-dialog",1583:"lt-pane-views",1584:"context-menu-renderer",1702:"manage-drawings-dialog",1754:"symbol-search-dialog",1859:"go-to-date-dialog-impl",1890:"line-tools-icons",2077:"change-interval-dialog",2183:"study-inputs-pane-views",2306:"floating-toolbars",2377:"hammerjs",2616:"svg-renderer",2704:"currency-label-menu",2878:"drawing-toolbar",3005:"header-toolbar",3030:"new-confirm-inputs-dialog",3596:"general-property-page",4013:"custom-intervals-add-dialog",4079:"series-pane-views",4389:"take-chart-image-impl",4665:"share-chart-to-social-utils",4862:"object-tree-dialog",5009:"load-chart-dialog",5093:"chart-widget-gui",5516:"restricted-toolset",5551:"favorite-drawings-api",5565:"ichart-storage",5598:"lt-stickers-atlas",6124:"chart-storage-library-http",6166:"chart-event-hint",6265:"new-edit-object-dialog",6456:"study-market",6631:"study-template-dialog",6780:"source-properties-editor",7078:"general-chart-properties-dialog",7129:"line-tools-synchronizer",7260:"chart-bottom-toolbar",7271:"compare-model",7648:"show-theme-save-dialog",7987:"lt-icons-atlas",8020:"user-defined-bars-marks-tooltip",8313:"chart-storage-external-adapter",
|
||||
8537:"lt-property-pages-with-definitions",8643:"full-tooltips-popup",8890:"simple-dialog",9039:"lollipop-tooltip-renderer",9374:"symbol-info-dialog-impl",9498:"export-data",9685:"series-icons-map",9754:"global-search-dialog"}[e]||e)+"."+{6:"a03a8ff024d47ed075c6",92:"795900ef9e075c847a64",139:"83ba0cba4c0538851e0a",507:"51d0897ba74454ec3423",524:"2b350163c328ac8dce2e",607:"1d3c58ff151a9c7c19a3",731:"5039a5ac2f3556b18cb1",750:"e16edadfacd60574d861",826:"906374d84a8e6c40c6e8",855:"61db310932f8af2c5989",898:"b63568700f1380e37b1a",956:"a325fc0a9a24da09a622",962:"9f54d549868e21286372",1033:"bb804c64fe58de0bace7",1109:"845f0f111ff830ab93c8",1553:"c076714f5e24887f0b94",1583:"077de067da0763f84cb2",1584:"4170e3d150582097504c",1702:"5f8ccee744105adf029e",1740:"4c61de525e940eee4f3c",1754:"e5850d7e02343ee54c52",1762:"9511e5b410d7d629bc49",1803:"5799aa316db71b2f13e5",1859:"851f6bf2bf36fe8fbac4",1890:"ecc8d3a4af49afed6b6d",2052:"e9d07fdfb896fca26166",2077:"ebdeefbf84f9e033ed5b",2109:"291fa715b6ded706c3dd",2183:"6caf467f12b1d6ee408a",2191:"2197cc1b66a1db8969cc",2260:"95dc0a20b147b6b2eeed",2306:"96ac7a46b7738535bc92",2377:"6e30e0c48af40bf2f6c0",2443:"66f44a8bfe8d49aaeaee",2486:"2b718a16270e4168ea54",2544:"225f38946afc6ad55a35",2587:"615babc52637decdb6e2",2616:"f065beaf6b5b37da27d9",2639:"a55d77a7912be54f7b9d",2666:"d28c0fa0a323b8118f22",2676:"a9a5ede4d514162164fa",2704:"8bac01cc43d3f2cbf903",2731:"55eed17fefac5e82c077",2846:"fbbd62afe04b4f9387f2",2878:"37a00c1b0c7a68cc1d44",3005:"df1a95078c18a5da785c",3030:"5ce0d1c060e0d28cde15",3066:"8b1d2ceb22d9fedde67b",3263:"238cd2d620e004adee5a",3353:"de1d5e3e034ab68aa9fc",3502:"1985af3fa836c4248178",3596:"e4f9354142134a911ace",3610:"c79c6bddd919cb78428a",3717:"6f65e91a870250a6e450",3780:"ef366b87d104534e68d8",3842:"8758110ab553b5368121",3896:"14d9e7509c300245c219",3914:"33b17e48eb923e015932",3939:"2ee1e71dbe0bc0d85625",3980:"9d7eeb2bacce45c508b3",3986:"b50fcad4f1b77533bda7",4013:"1aa54900370f7317d3f0",4015:"9b6607a6f543f077c5a5",4062:"9229fac3ef3db26fd5bc",4079:"d3299bca6e9fad2c340a",4102:"67b3d1107a6ec8d571eb",4215:"8934b190aaed2663c300",4370:"18ca7d93e5073f0446c0",4389:"600804a9c180df6a83b1",4403:"bf44a542113a4440984b",4648:"7172f75bb866b3438c6f",4665:"d7331dbca4a2aa0909e7",4713:"d82fc553d710da1606f0",4781:"e8294ba5c7c6aef1fce7",4788:"d3e8ad5f514051fcc835",4862:"0b6cab4cb55e2cef2c40",4894:"035fecc664874bb752b0",4987:"a23484dfcca6d5fae195",5009:"9a37c608b4849a6f8a11",5057:"5382614553878fcf337d",5093:"75a373be3b6816e8b55a",5128:"57de9f218989cee8119d",5145:"da831552b3b54ca47682",5163:"953e65e04ed31b0ea0b3",5164:"a45b25a7ca6a0c16f810",5166:"979eb8cba5281ffcb38b",5516:"78732f5a01aa118efb81",5551:"340e60e2342b0d93ebe7",5565:"1144e5a1b4f8503ee572",5598:"52ad6e6d7d7b134ab0ba",5649:"5c1e55c9dad604880876",5664:"87e81959e880fa8ba65d",5866:"039e25226b82968cca61",5940:"c058b0e0ef421f740684",5983:"3c0ae13972f5d3433a77",5993:"0e5f49179c6a516963de",6025:"d669a0315da9d6fda6b3",6036:"5b373caaaa6e1ba4495f",6106:"1d31df88e63bf542ea7b",6124:"f1f53155460ee314f062",6166:"9fb712c61440c609af69",
|
||||
6214:"5a578175aab923a979dc",6221:"56c4d15c823c019ddb39",6265:"b3553940c9159e24d8aa",6408:"e58aaf98d9306e8d9b77",6456:"6dd3b88a86eba6172f5c",6494:"7f264af8142cb9910c06",6625:"364cf21fe24d7e675de8",6631:"711ba6ae5b343ace8691",6639:"a1bd5bf1d51c681561a1",6747:"ae7a7ec28d22057d6d0d",6752:"912872ffa56a7243d664",6780:"3b96f58f66e0caa61b15",6884:"07642217627127113fb0",6918:"c8f3265e9286a784038b",6925:"665969c4af4481df0691",6949:"f50051a55eaa8dd5e780",6985:"8d289318ce5fe6dc7763",7051:"ba50ecafb4527628fb40",7078:"cddce4ed266fd9e0629e",7111:"4716f3208dc337521c10",7129:"0bc2d3617dda7143f094",7149:"d450e8145ad7e6fbd67f",7194:"098c1a8da1ddbbda98f6",7260:"4d02fadc540256bf733e",7271:"f7e796a37129a93179ee",7350:"aa555ff9e17c4029aedd",7391:"c63bd39c42093cc4130c",7413:"3a52b91975b98e6fe8e4",7550:"087936b2aa6ea51cd6bf",7555:"ea682716c26bc13db765",7648:"02c87d9b20f743b5cf16",7663:"6fabc58c7ddf7c2b076f",7807:"6adfcf6c0792dc9c9363",7871:"df6a9177c293c0c53e80",7987:"5d7c9d668ac98bd5bce1",8020:"71213c4f755723965a80",8056:"c06a1c8fb4a1f18cf217",8149:"9fb525d10e5c8ba95701",8167:"3edae41386acc976c9f8",8287:"7a7977ba76726177fb3c",8313:"9c1267d07e48b8d8f53f",8450:"757d38443ea38bd0165f",8537:"ae758430950906d90d11",8643:"3a92633d0497afb5344c",8882:"9838a8b1e0e6766b6408",8890:"6a6e7744cd3263ce2887",8904:"87e94e93ade13962a48f",9039:"19bbb3fc39665da2e3e6",9138:"f516266ddcf6ca8c7064",9327:"0c38440ca52f144413ac",9374:"6ef1056ef156ddb4caf1",9403:"61498701a4dae3f700c2",9465:"ca5284cff2560957cdd6",9498:"f43b3c60275506b2198a",9685:"f25fb7b89b7e831b726c",9754:"91018047180ff0d9e40b",9789:"458feb5c8c0263b0618b",9842:"581808dd4a8651b16779",9916:"0c2cb2d12479a20efce1"}[e]+".js",r.miniCssF=e=>e+"."+{6:"362fa6a7ab1f3e3b06c4",524:"ef662c4bc3e57dd91171",826:"2effba57f47544e58368",855:"56a5e53c97d91a9f96f7",898:"f909d7c1efc95f635922",956:"1e89775cfd644d656c56",1033:"5197f9f8b8500206d06c",1109:"b1ced88f4a839badfff1",1762:"7ff6b353c441db2276da",1803:"4653bb65d2b0d594d6af",2109:"4d5de3fbde1cd7dc5e9f",2191:"bb0aa12f5e562fd483f3",2260:"b98824e4829a1aa9b444",2486:"82c7dba4839761a57f28",2587:"1f1100dc01693edfe269",2639:"7b1d42eef7b89e0e96d3",2666:"fbb750fd312778403036",2676:"2d3cabbd39a3b0d6e9ea",2731:"ec19f123cabf8efd03a4",3066:"58a325f25b087530293d",3353:"860146c59230ab4bd938",3502:"c49903f7222870ff8aca",3610:"11b7ad14e26429fdfa5d",3717:"856421c70a4dff35762a",3780:"a289557f2e0bcabcc4ca",3842:"8cf6b523fd5a5b6fb022",3896:"96db838d3467bcf68051",3914:"d2b6c577f350629b6837",3939:"4d0187960a564ff5a557",3980:"b2ff45a2d8bb6a131d7c",4015:"1d0e3a62a59d173c81f3",4102:"4abd8542fa3aa3e7fd5d",4215:"d24836a292b1969ab4bb",4781:"cf1365a3bf51d9989978",4788:"3cff897925f7a8dbc837",4894:"99d4c2794da9feef3c70",4987:"ca5d16a7e990d39bfb0e",5145:"a2b224fd27ab2941c565",5163:"950dd1d584f76da1ed3b",5166:"a12c50ad6225ca6de843",5649:"b60ed09c5ea8c55827d4",5866:"f164dd2a584ab0f493cf",5940:"aedc1bdbd324e6042b17",5993:"4705829d0834140ee3f2",6025:"263b457b1a7f9ca139b2",6036:"3b493a9f0ab052e6447c",6106:"f01163745d787b60c86c",6214:"65b7dbf8be6cca5ac143",6221:"bc53670dfb8f982908a2",
|
||||
8537:"lt-property-pages-with-definitions",8643:"full-tooltips-popup",8890:"simple-dialog",9039:"lollipop-tooltip-renderer",9374:"symbol-info-dialog-impl",9498:"export-data",9685:"series-icons-map",9754:"global-search-dialog"}[e]||e)+"."+{6:"a03a8ff024d47ed075c6",92:"795900ef9e075c847a64",139:"83ba0cba4c0538851e0a",507:"51d0897ba74454ec3423",524:"2b350163c328ac8dce2e",607:"1d3c58ff151a9c7c19a3",731:"5039a5ac2f3556b18cb1",750:"5d5f4dea4acc51a7ba4b",826:"906374d84a8e6c40c6e8",855:"61db310932f8af2c5989",898:"b63568700f1380e37b1a",956:"a325fc0a9a24da09a622",962:"9f54d549868e21286372",1033:"bb804c64fe58de0bace7",1109:"845f0f111ff830ab93c8",1553:"c076714f5e24887f0b94",1583:"077de067da0763f84cb2",1584:"4170e3d150582097504c",1702:"5f8ccee744105adf029e",1740:"4c61de525e940eee4f3c",1754:"e5850d7e02343ee54c52",1762:"9511e5b410d7d629bc49",1803:"5799aa316db71b2f13e5",1859:"851f6bf2bf36fe8fbac4",1890:"ecc8d3a4af49afed6b6d",2052:"e9d07fdfb896fca26166",2077:"ebdeefbf84f9e033ed5b",2109:"291fa715b6ded706c3dd",2183:"6caf467f12b1d6ee408a",2191:"2197cc1b66a1db8969cc",2260:"95dc0a20b147b6b2eeed",2306:"96ac7a46b7738535bc92",2377:"6e30e0c48af40bf2f6c0",2443:"66f44a8bfe8d49aaeaee",2486:"2b718a16270e4168ea54",2544:"225f38946afc6ad55a35",2587:"615babc52637decdb6e2",2616:"f065beaf6b5b37da27d9",2639:"a55d77a7912be54f7b9d",2666:"d28c0fa0a323b8118f22",2676:"a9a5ede4d514162164fa",2704:"8bac01cc43d3f2cbf903",2731:"55eed17fefac5e82c077",2846:"fbbd62afe04b4f9387f2",2878:"37a00c1b0c7a68cc1d44",3005:"df1a95078c18a5da785c",3030:"5ce0d1c060e0d28cde15",3066:"8b1d2ceb22d9fedde67b",3263:"238cd2d620e004adee5a",3353:"de1d5e3e034ab68aa9fc",3502:"1985af3fa836c4248178",3596:"e4f9354142134a911ace",3610:"c79c6bddd919cb78428a",3717:"6f65e91a870250a6e450",3780:"ef366b87d104534e68d8",3842:"8758110ab553b5368121",3896:"14d9e7509c300245c219",3914:"33b17e48eb923e015932",3939:"2ee1e71dbe0bc0d85625",3980:"9d7eeb2bacce45c508b3",3986:"b50fcad4f1b77533bda7",4013:"1aa54900370f7317d3f0",4015:"9b6607a6f543f077c5a5",4062:"9229fac3ef3db26fd5bc",4079:"d3299bca6e9fad2c340a",4102:"67b3d1107a6ec8d571eb",4215:"8934b190aaed2663c300",4370:"18ca7d93e5073f0446c0",4389:"600804a9c180df6a83b1",4403:"bf44a542113a4440984b",4648:"7172f75bb866b3438c6f",4665:"d7331dbca4a2aa0909e7",4713:"d82fc553d710da1606f0",4781:"e8294ba5c7c6aef1fce7",4788:"d3e8ad5f514051fcc835",4862:"0b6cab4cb55e2cef2c40",4894:"035fecc664874bb752b0",4987:"a23484dfcca6d5fae195",5009:"9a37c608b4849a6f8a11",5057:"5382614553878fcf337d",5093:"75a373be3b6816e8b55a",5128:"57de9f218989cee8119d",5145:"da831552b3b54ca47682",5163:"953e65e04ed31b0ea0b3",5164:"a45b25a7ca6a0c16f810",5166:"979eb8cba5281ffcb38b",5516:"78732f5a01aa118efb81",5551:"340e60e2342b0d93ebe7",5565:"1144e5a1b4f8503ee572",5598:"52ad6e6d7d7b134ab0ba",5649:"5c1e55c9dad604880876",5664:"87e81959e880fa8ba65d",5866:"039e25226b82968cca61",5940:"c058b0e0ef421f740684",5983:"3c0ae13972f5d3433a77",5993:"0e5f49179c6a516963de",6025:"d669a0315da9d6fda6b3",6036:"5b373caaaa6e1ba4495f",6106:"1d31df88e63bf542ea7b",6124:"f1f53155460ee314f062",6166:"9fb712c61440c609af69",
|
||||
6214:"5a578175aab923a979dc",6221:"56c4d15c823c019ddb39",6265:"b3553940c9159e24d8aa",6408:"e58aaf98d9306e8d9b77",6456:"6dd3b88a86eba6172f5c",6494:"7f264af8142cb9910c06",6625:"364cf21fe24d7e675de8",6631:"711ba6ae5b343ace8691",6639:"a1bd5bf1d51c681561a1",6747:"ae7a7ec28d22057d6d0d",6752:"912872ffa56a7243d664",6780:"3b96f58f66e0caa61b15",6884:"07642217627127113fb0",6918:"c8f3265e9286a784038b",6925:"665969c4af4481df0691",6949:"f50051a55eaa8dd5e780",6985:"8d289318ce5fe6dc7763",7051:"ba50ecafb4527628fb40",7078:"cddce4ed266fd9e0629e",7111:"4716f3208dc337521c10",7129:"0bc2d3617dda7143f094",7149:"d450e8145ad7e6fbd67f",7194:"098c1a8da1ddbbda98f6",7260:"4d02fadc540256bf733e",7271:"da9eebe3af491996707c",7350:"aa555ff9e17c4029aedd",7391:"c63bd39c42093cc4130c",7413:"3a52b91975b98e6fe8e4",7550:"087936b2aa6ea51cd6bf",7555:"ea682716c26bc13db765",7648:"02c87d9b20f743b5cf16",7663:"6fabc58c7ddf7c2b076f",7807:"6adfcf6c0792dc9c9363",7871:"df6a9177c293c0c53e80",7987:"5d7c9d668ac98bd5bce1",8020:"71213c4f755723965a80",8056:"c06a1c8fb4a1f18cf217",8149:"9fb525d10e5c8ba95701",8167:"3edae41386acc976c9f8",8287:"7a7977ba76726177fb3c",8313:"9c1267d07e48b8d8f53f",8450:"757d38443ea38bd0165f",8537:"ae758430950906d90d11",8643:"3a92633d0497afb5344c",8882:"9838a8b1e0e6766b6408",8890:"6a6e7744cd3263ce2887",8904:"87e94e93ade13962a48f",9039:"19bbb3fc39665da2e3e6",9138:"f516266ddcf6ca8c7064",9327:"0c38440ca52f144413ac",9374:"6ef1056ef156ddb4caf1",9403:"61498701a4dae3f700c2",9465:"ca5284cff2560957cdd6",9498:"f43b3c60275506b2198a",9685:"f25fb7b89b7e831b726c",9754:"91018047180ff0d9e40b",9789:"458feb5c8c0263b0618b",9842:"581808dd4a8651b16779",9916:"0c2cb2d12479a20efce1"}[e]+".js",r.miniCssF=e=>e+"."+{6:"362fa6a7ab1f3e3b06c4",524:"ef662c4bc3e57dd91171",826:"2effba57f47544e58368",855:"56a5e53c97d91a9f96f7",898:"f909d7c1efc95f635922",956:"1e89775cfd644d656c56",1033:"5197f9f8b8500206d06c",1109:"b1ced88f4a839badfff1",1762:"7ff6b353c441db2276da",1803:"4653bb65d2b0d594d6af",2109:"4d5de3fbde1cd7dc5e9f",2191:"bb0aa12f5e562fd483f3",2260:"b98824e4829a1aa9b444",2486:"82c7dba4839761a57f28",2587:"1f1100dc01693edfe269",2639:"7b1d42eef7b89e0e96d3",2666:"fbb750fd312778403036",2676:"2d3cabbd39a3b0d6e9ea",2731:"ec19f123cabf8efd03a4",3066:"58a325f25b087530293d",3353:"860146c59230ab4bd938",3502:"c49903f7222870ff8aca",3610:"11b7ad14e26429fdfa5d",3717:"856421c70a4dff35762a",3780:"a289557f2e0bcabcc4ca",3842:"8cf6b523fd5a5b6fb022",3896:"96db838d3467bcf68051",3914:"d2b6c577f350629b6837",3939:"4d0187960a564ff5a557",3980:"b2ff45a2d8bb6a131d7c",4015:"1d0e3a62a59d173c81f3",4102:"4abd8542fa3aa3e7fd5d",4215:"d24836a292b1969ab4bb",4781:"cf1365a3bf51d9989978",4788:"3cff897925f7a8dbc837",4894:"99d4c2794da9feef3c70",4987:"ca5d16a7e990d39bfb0e",5145:"a2b224fd27ab2941c565",5163:"950dd1d584f76da1ed3b",5166:"a12c50ad6225ca6de843",5649:"b60ed09c5ea8c55827d4",5866:"f164dd2a584ab0f493cf",5940:"aedc1bdbd324e6042b17",5993:"4705829d0834140ee3f2",6025:"263b457b1a7f9ca139b2",6036:"3b493a9f0ab052e6447c",6106:"f01163745d787b60c86c",6214:"65b7dbf8be6cca5ac143",6221:"bc53670dfb8f982908a2",
|
||||
6494:"4c212043f24336e170d5",6625:"0ed88fc3a989c98408cc",6639:"885b5577e3fb71ee2bea",6747:"c7d403ae692f88568278",6752:"207eb3cc75b3ed2c6754",6884:"bb7d30a7bbbe5af36556",6925:"a3a09d7303a96edb77cb",6949:"19355e81a60b640ea097",6985:"2cd225354e2fd236e8e9",7111:"b16b4eb739a7e8577559",7149:"12adbb19fdefe9b66b18",7194:"e04f69c8933166966874",7350:"00632eec360f0cf2d9a0",7391:"9c809fa91ed0c8f75bc0",7413:"f830ad1ad6ee6f9b1cb3",7555:"8c1e3939e7666b0f8c69",7807:"8577632fdab29ee53ddf",7871:"fff454908cba03863eb7",8056:"1f54f717d8e522c55c89",8149:"21f2b01074a4d082e268",8287:"2b6f71ec5c0064590ffd",8450:"f75ab24e1ecb22d29183",8904:"a302177fe7e3ccd50cb0",9138:"03b8fbcfabcae851949a",9327:"97be240031495a68333f",9403:"db9859ab09623682562c",9465:"fd61e82b3c912f2e9fad",9789:"cb5ad20bc727d3820b6c",9842:"ceaeabba258d065497c8",9916:"60c48148a54dba9504a0"}[e]+".css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},t="tradingview:",r.l=(e,a,d,f)=>{if(c[e])c[e].push(a);else{var b,n;if(void 0!==d)for(var o=document.getElementsByTagName("script"),i=0;i<o.length;i++){var l=o[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==t+d){b=l;break}}b||(n=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,r.nc&&b.setAttribute("nonce",r.nc),b.setAttribute("data-webpack",t+d),b.src=e,0!==b.src.indexOf(window.location.origin+"/")&&(b.crossOrigin="anonymous")),c[e]=[a];var s=(a,d)=>{b.onerror=b.onload=null,clearTimeout(u);var t=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),t&&t.forEach((e=>e(d))),a)return a(d)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=s.bind(null,b.onerror),b.onload=s.bind(null,b.onload),n&&document.head.appendChild(b)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var a=r.g.document;if(!e&&a&&(a.currentScript&&(e=a.currentScript.src),!e)){var d=a.getElementsByTagName("script");d.length&&(e=d[d.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.g.location&&r.p.startsWith(r.g.location.origin)&&(r.p=r.p.slice(r.g.location.origin.length)),(()=>{const e=r.u;r.u=a=>e(a).replace("__LANG__",r.g.language)})(),(()=>{const e={ca_ES:(e=1)=>+(1!=e),cs:(e=1)=>+(1==e?0:e>=2&&e<=4?1:2),el:(e=1)=>+(1!=e),da_DK:(e=1)=>+(1!=e),en:(e=1)=>+(1!=e),et_EE:(e=1)=>+(1!=e),fa:(e=1)=>0,hu_HU:(e=1)=>0,id_ID:(e=1)=>0,it:(e=1)=>+(1!=e),ms_MY:(e=1)=>0,
|
||||
no:(e=1)=>+(1!=e),nl_NL:(e=1)=>+(1!=e),ro:(e=1)=>+(1==e?0:e%100>19||e%100==0&&0!=e?2:1),sk_SK:(e=1)=>+(1==e?0:e>=2&&e<=4?1:2),sv:(e=1)=>+(1!=e),zh:(e=1)=>0,zh_TW:(e=1)=>0,de:(e=1)=>+(1!=e),es:(e=1)=>+(1!=e),fr:(e=1)=>+(e>1),he_IL:(e=1)=>+(1==e?0:2==e?1:e>10&&e%10==0?2:3),ko:(e=1)=>0,ja:(e=1)=>0,pl:(e=1)=>+(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),pt:(e=1)=>+(1!=e),tr:(e=1)=>+(1!=e),vi:(e=1)=>0,ar:(e=1)=>+(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11&&e%100<=99?4:5),ru:(e=1)=>+(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),th:(e=1)=>0};r.tf=(a,d={},c)=>{if(null===a){if(Array.isArray(c)){if(r.g.customTranslateFunction){const e=r.g.customTranslateFunction(c[0],d.plural?{...d,plural:c.length>2?c.slice(1):c[1]}:d,!0);if(null!==e)return e}return(c[e[r.g.language](d.count)]||c[0]).replace(/{(\w+)}/g,((e,a)=>void 0!==(d.replace||d)[a]?(d.replace||d)[a]:e))}return"object"==typeof c?r.tf(null,d,c[r.g.language||"en"]):r.tf(c,d)}if(c&&a){const e=`${a}${d.context?`_${d.context}`:""}`;if(c[e])return r.tf(null,d,c[e])}if("number"==typeof a)return a.toString();if("string"!=typeof a)return"";if(r.g.customTranslateFunction){const e=r.g.customTranslateFunction(a,d,!1);if(null!==e)return e}return(d.plural&&1!=+d.count?d.plural:a).replace(/{(\w+)}/g,((e,a)=>void 0!==(d.replace||d)[a]?(d.replace||d)[a]:e))}})(),r.p=r.g.WEBPACK_PUBLIC_PATH||r.p;var n=r.e,o=Object.create(null);function i(e,a){return n(e).catch((function(){return new Promise((function(d){var c=function(){self.removeEventListener("online",c,!1),!1===navigator.onLine?self.addEventListener("online",c,!1):d(a<2?i(e,a+1):n(e))};setTimeout(c,a*a*1e3)}))}))}r.e=function(e){if(!o[e]){o[e]=i(e,0);var a=function(){delete o[e]};o[e].then(a,a)}return o[e]},(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((a,d)=>{var c=r.miniCssF(e),t=r.p+c;if(((e,a)=>{for(var d=document.getElementsByTagName("link"),c=0;c<d.length;c++){var t=(b=d[c]).getAttribute("data-href")||b.getAttribute("href");if("stylesheet"===b.rel&&(t===e||t===a))return b}var f=document.getElementsByTagName("style");for(c=0;c<f.length;c++){var b;if((t=(b=f[c]).getAttribute("data-href"))===e||t===a)return b}})(c,t))return a();((e,a,d,c,t)=>{var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onerror=f.onload=d=>{if(f.onerror=f.onload=null,"load"===d.type)c();else{var b=d&&("load"===d.type?"missing":d.type),r=d&&d.target&&d.target.href||a,n=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");n.code="CSS_CHUNK_LOAD_FAILED",n.type=b,n.request=r,f.parentNode&&f.parentNode.removeChild(f),t(n)}},f.href=a,0!==f.href.indexOf(window.location.origin+"/")&&(f.crossOrigin="anonymous"),d?d.parentNode.insertBefore(f,d.nextSibling):document.head.appendChild(f)})(e,t,null,a,d)})),a={3666:0};r.f.miniCss=(d,c)=>{a[d]?c.push(a[d]):0!==a[d]&&{6:1,524:1,826:1,855:1,898:1,956:1,1033:1,1109:1,1762:1,1803:1,2109:1,2191:1,2260:1,2486:1,2587:1,2639:1,2666:1,2676:1,2731:1,3066:1,3353:1,3502:1,3610:1,3717:1,3780:1,3842:1,3896:1,3914:1,3939:1,3980:1,4015:1,4102:1,4215:1,4781:1,
|
||||
4788:1,4894:1,4987:1,5145:1,5163:1,5166:1,5649:1,5866:1,5940:1,5993:1,6025:1,6036:1,6106:1,6214:1,6221:1,6494:1,6625:1,6639:1,6747:1,6752:1,6884:1,6925:1,6949:1,6985:1,7111:1,7149:1,7194:1,7350:1,7391:1,7413:1,7555:1,7807:1,7871:1,8056:1,8149:1,8287:1,8450:1,8904:1,9138:1,9327:1,9403:1,9465:1,9789:1,9842:1,9916:1}[d]&&c.push(a[d]=e(d).then((()=>{a[d]=0}),(e=>{throw delete a[d],e})))}}})(),(()=>{var e={3666:0,6150:0};r.f.j=(a,d)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1(033|109|762|803)|2(6(39|66|76)|109|191|260|486|587|731)|3(9(14|39|80)|(06|66|89)6|353|502|610|717|780|842)|4(78[18]|[02]15|102|894|987)|5(1(45|63|66)|24|649|866|940|993)|6(9(25|49|85)|[06]25|(21|49|88)4||036|106|150|221|639|747|752)|7(1(11|49|94)|350|391|413|555|807|871)|8(056|149|26|287|450|55|904|98)|9(138|327|403|465|56|789|842|916))$/.test(a))e[a]=0;else{var t=new Promise(((d,t)=>c=e[a]=[d,t]));d.push(c[2]=t);var f=r.p+r.u(a),b=new Error;r.l(f,(d=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var t=d&&("load"===d.type?"missing":d.type),f=d&&d.target&&d.target.src;b.message="Loading chunk "+a+" failed.\n("+t+": "+f+")",b.name="ChunkLoadError",b.type=t,b.request=f,c[1](b)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var c,t,[f,b,n]=d,o=0;if(f.some((a=>0!==e[a]))){for(c in b)r.o(b,c)&&(r.m[c]=b[c]);if(n)var i=n(r)}for(a&&a(d);o<f.length;o++)t=f[o],r.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return r.O(i)},d=self.webpackChunktradingview=self.webpackChunktradingview||[];d.forEach(a.bind(null,0)),d.push=a.bind(null,d.push.bind(d))})(),(()=>{const{miniCssF:e}=r;r.miniCssF=a=>self.document&&"rtl"===self.document.dir?e(a).replace(/\.css$/,".rtl.css"):e(a)})()})();
|
||||
File diff suppressed because one or more lines are too long
74
charting_library/charting_library.d.ts
vendored
74
charting_library/charting_library.d.ts
vendored
@@ -8621,8 +8621,25 @@ export interface IBoxedValueReadOnly<T> {
|
||||
value(): T;
|
||||
}
|
||||
export interface IBrokerAccountInfo {
|
||||
/**
|
||||
* The library calls `accountsMetainfo` to get a list of accounts for a particular user.
|
||||
* The method should return an array that contains an ID and name for each account.
|
||||
*
|
||||
* Note that if `accountsMetainfo` returns an array containing more than one element, you should implement the {@link setCurrentAccount} method.
|
||||
* Refer to [User accounts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/user-accounts.md) for more information.
|
||||
*/
|
||||
accountsMetainfo(): Promise<AccountMetainfo[]>;
|
||||
/**
|
||||
* The library calls `currentAccount` to get the current account ID.
|
||||
*/
|
||||
currentAccount(): AccountId;
|
||||
/**
|
||||
* The library calls `setCurrentAccount` when users switch accounts using the drop-down menu in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/account-manager.md).
|
||||
* This method provides your backend server with the ID of the selected account.
|
||||
*
|
||||
* Note that `setCurrentAccount` is required if {@link accountsMetainfo} returns an array containing more than one element.
|
||||
* Refer to [Multiple accounts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/user-accounts.md#multiple-accounts) for more information.
|
||||
*/
|
||||
setCurrentAccount?(id: AccountId): void;
|
||||
}
|
||||
export interface IBrokerCommon {
|
||||
@@ -8633,19 +8650,19 @@ export interface IBrokerCommon {
|
||||
*/
|
||||
chartContextMenuActions(context: TradeContext, options?: DefaultContextMenuActionsParams): Promise<ActionMetaInfo[]>;
|
||||
/**
|
||||
* This function is required for the Floating Trading Panel.
|
||||
* The ability to trade via the panel depends on the result of this function: `true` or `false`.
|
||||
* You don't need to implement this method if all symbols can be traded.
|
||||
*
|
||||
* If you want to show a custom message with the reason why the symbol cannot be traded then you can return an object `IsTradableResult`.
|
||||
* The library calls this method to check if a symbol can be traded.
|
||||
* If the method returns `false`, users will see the *Non-tradable symbol* message in the UI when creating orders.
|
||||
* You can also show a custom message with the reason why the symbol cannot be traded and the possible solution to resolve the issue.
|
||||
* To do this, return an `IsTradableResult` object.
|
||||
* @param {string} symbol - symbol identifier
|
||||
*/
|
||||
isTradable(symbol: string): Promise<boolean | IsTradableResult>;
|
||||
/**
|
||||
* Connection status for the Broker API.
|
||||
* Defines the connection status for the Broker API.
|
||||
* You don't need to return values other than `1` (`Connected`) since the broker is already connected when you create the widget.
|
||||
*
|
||||
* You don't need to return values other than `1` (`Connected`) typically since the broker is already connected when you create the widget.
|
||||
* You can use it if you want to display a spinner in the bottom panel while the data is being loaded.
|
||||
* If the method is not implemented, the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/account-manager.md) will have a spinner instead of the user's trading data.
|
||||
* In the console, the *Trading.Core:Broker broker creation error* will also be displayed.
|
||||
*/
|
||||
connectionStatus(): ConnectionStatus;
|
||||
/**
|
||||
@@ -8675,12 +8692,12 @@ export interface IBrokerCommon {
|
||||
*/
|
||||
executions(symbol: string): Promise<Execution[]>;
|
||||
/**
|
||||
* Called by the internal Order dialog, DOM panel, and floating trading panel to get symbol information.
|
||||
* Called by the Order Ticket and DOM panel to get symbol information.
|
||||
* @param {string} symbol - symbol identifier
|
||||
*/
|
||||
symbolInfo(symbol: string): Promise<InstrumentInfo>;
|
||||
/**
|
||||
* This function should return the information that will be used to build an Account manager.
|
||||
* This function should return the information that will be used to build the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/account-manager.md).
|
||||
*/
|
||||
accountManagerInfo(): AccountManagerInfo;
|
||||
/**
|
||||
@@ -8857,13 +8874,13 @@ export interface IBrokerConnectionAdapterHost {
|
||||
*/
|
||||
individualPositionPLUpdate(individualPositionId: string, pl: number): void;
|
||||
/**
|
||||
* Call this method when a broker connection has received an equity update. This method is required by the standard Order Dialog to calculate risks.
|
||||
* Call this method when a broker connection has received an equity update. This method is required by the standard Order Ticket to calculate risks.
|
||||
* @param {number} equity - updated equity
|
||||
*/
|
||||
equityUpdate(equity: number): void;
|
||||
/**
|
||||
* Call this method when a broker connection has received a margin available update.
|
||||
* This method is required by the standard Order Dialog to display the margin meter.
|
||||
* This method is required by the standard Order Ticket to display the margin meter.
|
||||
* This method should be used when {@link BrokerConfigFlags.supportMargin} is set to `true` in {@link SingleBrokerMetaInfo.configFlags}.
|
||||
* The Trading Platform subscribes to margin available updates using {@link IBrokerWithoutRealtime.subscribeMarginAvailable}.
|
||||
* @param {number} marginAvailable - updated available margin
|
||||
@@ -8871,7 +8888,7 @@ export interface IBrokerConnectionAdapterHost {
|
||||
marginAvailableUpdate(marginAvailable: number): void;
|
||||
/**
|
||||
* Call this method when a broker connection has received a balance update.
|
||||
* This method is required by the crypto Order Dialog.
|
||||
* This method is required by the crypto Order Ticket.
|
||||
* It should be implemented when the {@link BrokerConfigFlags.supportBalances} flag is set to `true` in {@link SingleBrokerMetaInfo.configFlags}.
|
||||
* @param {string} symbol - symbol ID
|
||||
* @param {CryptoBalance} balance - updated crypto balance
|
||||
@@ -8911,7 +8928,7 @@ export interface IBrokerConnectionAdapterHost {
|
||||
*/
|
||||
unsubscribeSuggestedQtyChange(symbol: string, listener: SuggestedQtyChangedListener): void;
|
||||
/**
|
||||
* Shows the order dialog
|
||||
* Shows the Order Ticket
|
||||
* @param {T extends PreOrder} order - order to show in the dialog
|
||||
* @param {OrderTicketFocusControl} [focus] - input control to focus on when dialog is opened
|
||||
*/
|
||||
@@ -8924,13 +8941,13 @@ export interface IBrokerConnectionAdapterHost {
|
||||
*/
|
||||
showNotification(title: string, text: string, notificationType?: NotificationType): void;
|
||||
/**
|
||||
* Shows the cancel order dialog for specified order
|
||||
* Shows the cancel Order Ticket for specified order
|
||||
* @param {string} orderId - id of order to potentially cancel
|
||||
* @param {()=>Promise<void>} handler - cancel order confirmation handler (called when order should be cancelled)
|
||||
*/
|
||||
showCancelOrderDialog(orderId: string, handler: () => Promise<void>): Promise<void>;
|
||||
/**
|
||||
* Shows the cancel order dialog for multiple orders
|
||||
* Shows the cancel Order Ticket for multiple orders
|
||||
* @param {string} symbol - symbol for which to cancel orders
|
||||
* @param {Side} side - side of the order
|
||||
* @param {number} qty - quantity of the order
|
||||
@@ -9137,20 +9154,20 @@ export interface IBrokerWithoutRealtime extends IBrokerCommon, IBrokerAccountInf
|
||||
*/
|
||||
previewLeverage?(leverageSetParams: LeverageSetParams): Promise<LeveragePreviewResult>;
|
||||
/**
|
||||
* The method should be implemented if you use the standard Order dialog and support stop loss. Equity is used to calculate Risk in Percent.
|
||||
* The method should be implemented if you use the standard Order Ticket and support stop loss. Equity is used to calculate Risk in Percent.
|
||||
*
|
||||
* Once this method is called the broker should provide equity (Balance + P/L) updates via {@link IBrokerConnectionAdapterHost.equityUpdate} method.
|
||||
*/
|
||||
subscribeEquity?(): void;
|
||||
/**
|
||||
* The method should be implemented if you use the standard Order dialog and want to show the margin meter.
|
||||
* The method should be implemented if you use the standard Order Ticket and want to show the margin meter.
|
||||
*
|
||||
* Once this method is called the broker should provide margin available updates via {@link IBrokerConnectionAdapterHost.marginAvailableUpdate} method.
|
||||
* @param {string} symbol - symbol identifier
|
||||
*/
|
||||
subscribeMarginAvailable?(symbol: string): void;
|
||||
/**
|
||||
* The method should be implemented if you use a standard Order dialog.
|
||||
* The method should be implemented if you use a standard Order Ticket.
|
||||
* `pipValues` is displayed in the Order info and it is used to calculate the Trade Value and risks.
|
||||
* If this method is not implemented then `pipValue` from the `symbolInfo` is used in the order panel/dialog.
|
||||
*
|
||||
@@ -9159,21 +9176,21 @@ export interface IBrokerWithoutRealtime extends IBrokerCommon, IBrokerAccountInf
|
||||
*/
|
||||
subscribePipValue?(symbol: string): void;
|
||||
/**
|
||||
* The method should be implemented if you use a standard Order dialog and implement `subscribePipValue`.
|
||||
* The method should be implemented if you use a standard Order Ticket and implement `subscribePipValue`.
|
||||
*
|
||||
* Once this method is called the broker should stop providing `pipValue` updates.
|
||||
* @param {string} symbol - symbol identifier
|
||||
*/
|
||||
unsubscribePipValue?(symbol: string): void;
|
||||
/**
|
||||
* The method should be implemented if you use the standard Order dialog want to show the margin meter.
|
||||
* The method should be implemented if you use the standard Order Ticket want to show the margin meter.
|
||||
*
|
||||
* Once this method is called the broker should stop providing margin available updates.
|
||||
* @param {string} symbol - symbol identifier
|
||||
*/
|
||||
unsubscribeMarginAvailable?(symbol: string): void;
|
||||
/**
|
||||
* The method should be implemented if you use the standard Order dialog and support stop loss.
|
||||
* The method should be implemented if you use the standard Order Ticket and support stop loss.
|
||||
*
|
||||
* Once this method is called the broker should stop providing equity updates.
|
||||
*/
|
||||
@@ -13952,7 +13969,7 @@ export interface LibrarySymbolInfo {
|
||||
/**
|
||||
* Format of displaying labels on the price scale:
|
||||
*
|
||||
* `price` - formats decimal or fractional numbers based on `minmov`, `pricescale`, `minmove2`, `fractional` and `variableMinTick` values. See [Price Formatting](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format) for more details
|
||||
* `price` - formats decimal or fractional numbers based on `minmov`, `pricescale`, `minmove2`, `fractional` and `variableMinTick` values. See [Price format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology.md#price-format) for more details.
|
||||
* `volume` - formats decimal numbers in thousands, millions, billions or trillions
|
||||
*/
|
||||
format: SeriesFormat;
|
||||
@@ -24872,6 +24889,11 @@ export interface SubscribeEventsMap {
|
||||
* Panes' order has changed.
|
||||
*/
|
||||
panes_order_changed: () => void;
|
||||
/**
|
||||
* Chart's widget bar is shown/hidden.
|
||||
* @param {boolean} isVisible - if the widget bar is currently hidden
|
||||
*/
|
||||
widgetbar_visibility_changed: (isVisible: boolean) => void;
|
||||
}
|
||||
export interface SuccessFormatterParseResult<T> extends FormatterParseResult {
|
||||
/** @inheritDoc */
|
||||
@@ -25428,9 +25450,9 @@ export interface TradingTerminalWidgetOptions extends Omit<ChartingLibraryWidget
|
||||
* See {@link ChartingLibraryWidgetOptions.favorites}
|
||||
*/
|
||||
favorites?: Favorites<TradingTerminalChartTypeFavorites>;
|
||||
/** configuration flags for the Trading Platform. */
|
||||
/** Defines the [configuration flags](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/trading-features-configuration.md) for the Trading Platform. */
|
||||
brokerConfig?: SingleBrokerMetaInfo;
|
||||
/** configuration flags for the Trading Platform. */
|
||||
/** Defines the [configuration flags](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/trading-features-configuration.md) for the Trading Platform. */
|
||||
broker_config?: SingleBrokerMetaInfo;
|
||||
/** Connection configuration settings for Rest Broker API */
|
||||
restConfig?: RestBrokerConnectionInfo;
|
||||
@@ -27612,7 +27634,7 @@ export type TradingTerminalFeatureset = ChartingLibraryFeatureset |
|
||||
"right_toolbar" |
|
||||
/** Shows the Order Panel @default true */
|
||||
"order_panel" |
|
||||
/** Shows the Order info section in the Order dialog @default true */
|
||||
/** Shows the Order info section in the Order Ticket @default true */
|
||||
"order_info" |
|
||||
/** Shows the Buy/Sell Buttons in Legend @default true */
|
||||
"buy_sell_buttons" |
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
charting_library/datafeed-api.d.ts
vendored
2
charting_library/datafeed-api.d.ts
vendored
@@ -478,7 +478,7 @@ export interface LibrarySymbolInfo {
|
||||
/**
|
||||
* Format of displaying labels on the price scale:
|
||||
*
|
||||
* `price` - formats decimal or fractional numbers based on `minmov`, `pricescale`, `minmove2`, `fractional` and `variableMinTick` values. See [Price Formatting](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format) for more details
|
||||
* `price` - formats decimal or fractional numbers based on `minmov`, `pricescale`, `minmove2`, `fractional` and `variableMinTick` values. See [Price format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology.md#price-format) for more details.
|
||||
* `volume` - formats decimal numbers in thousands, millions, billions or trillions
|
||||
*/
|
||||
format: SeriesFormat;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "CL v27.004 (internal id 1ca8700b @ 2024-04-17T14:32:06.723Z)",
|
||||
"description": "CL v27.005 (internal id d937bee0 @ 2024-05-07T15:20:48.667Z)",
|
||||
"type": "module",
|
||||
"main": "charting_library.cjs.js",
|
||||
"module": "charting_library.esm.js",
|
||||
|
||||
Reference in New Issue
Block a user