733 lines
2.1 MiB
733 lines
2.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["library"],{"+6II":function(e,t,i){"use strict";i.r(t);var s=i("mrSG");i("EsMY");let r=0,n=0,o=0;function a(){clearTimeout(r),clearTimeout(n),clearTimeout(o)}const l="tooltip-root-element";let c;function h(){const e=document.getElementById(l);e?c=e:(c=document.createElement("div"),c.id=l,document.body.appendChild(c))}function u(){c&&(c.innerHTML="")}"interactive"===document.readyState?h():document.addEventListener("DOMContentLoaded",h);var d=i("Eyy1");const p={default:"",white:"theme-white","round-shadow":"theme-round-shadow"},_=Object.keys(p);var m=i("CPmC"),f=i("/DW5"),g=i("gWrr"),v=i("Ialn"),b=(i("HbRj"),i("XAms")),S=i("Hr11"),y=i("qFKp"),w=i("Wo0S");function C(e){const t=e.getAttribute("title");return t&&(Object(m.b)(e,"text",t),e.removeAttribute("title")),Object(m.a)(e,"text")||""}function P(e){const t=A.cloneNode(!0),i=D(t),{content:s}=e;switch(s.type){case"element":i.innerHTML="",i.appendChild(s.data);break;case"html":i.innerHTML=s.data;break;case"text":if(e.hotkey){const e=k.cloneNode(!0);e.innerText=s.data,i.appendChild(e)}else i.innerText=s.data}if(e.hotkey){const t="none"!==s.type,r=E.cloneNode(!0),n=Object(f.a)(e.hotkey),o=n.keys.map(e=>`<span class="${w["common-tooltip__hotkey-button"]}">${e}</span>`);r.innerHTML=n.text.format(...o).replace(/\s\+\s/g,`<span class="${w["common-tooltip__plus-sign"]}">+</span>`),i.classList.add(w["common-tooltip__body--with-hotkey"]),t&&r.classList.add(w["common-tooltip__hotkey-block--divider"]),i.appendChild(r)}return t.addEventListener("contextmenu",b.a),t}function x(e,t){const i=t.rect;if(!i)return;!function(e,t){const i=_.includes(t)?p[t]:"";e.classList.remove(..._.map(e=>p[e]).filter(e=>!!e)),i&&!e.classList.contains(i)&&e.classList.add(i)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass);const s=D(e),r=e.querySelector("."+w["common-tooltip__button-container"]);s.classList.toggle(w["common-tooltip__body--width_wide"],Boolean(t.wide)),s.classList.toggle(w["common-tooltip__body--no-padding"],Boolean(t.noPadding)),s.classList.toggle(w["common-tooltip__body--width_narrow"],Boolean(t.narrow)),s.classList.toggle(w["common-tooltip__body--no-buttons"],!0),e.classList.toggle(w["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),s.style.left=M(0),s.style.width=M(s.clientWidth+(Boolean(t.noPadding)?0:2));const n=document.body.clientWidth,o=y.CheckMobile.iOS()||Object(y.supportTouch)()&&Object(y.isMac)()?window.innerHeight:document.body.clientHeight,a=t.vertical,l=t.extendMargin||a&&i.w<20||!a&&i.h<20;e.classList.toggle(w["common-tooltip--farther"],l),e.classList.toggle(w["common-tooltip--vertical"],a),e.classList.toggle(w["common-tooltip--horizontal"],!a);const c=function(e){return e.querySelector("."+w["common-tooltip__ear-holder"])}(e);let h="";if(a){const a=10,l=o-10,u=12,d=a+u,p=l-u,_=Object(S.clamp)(i.y+i.h/2,d,p),m=e.offsetHeight,f=_-m/2,g=f+m;e.style.left=M(i.x+i.w),e.style.top=M(f),f<a?s.style.top=r.style.top=M(a-f):g>l&&(s.style.top=r.style.top=M(l-g))
|
||
;const{right:b}=(e.querySelector(":last-child")||s).getBoundingClientRect(),y=b+10>n;e.classList.toggle(w["common-tooltip--direction_reversed"],y),e.classList.toggle(w["common-tooltip--direction_normal"],!y),h=y?"after":"before",Object(v.isRtl)()?(h=t.otr?"after":h,h=t.otl?"before":h):(h=t.otr?"before":h,h=t.otl?"after":h),c.classList.toggle(w["common-tooltip__ear-holder--before"],"before"===h),c.classList.toggle(w["common-tooltip__ear-holder--after"],"after"===h),"after"===h&&(e.style.left="auto",e.style.right=M(n-i.x))}else{const a=i.x-(s.offsetWidth-i.w)/2,l=n-10-e.offsetWidth,u=Math.max(10,Math.min(a,l));e.style.bottom=M(o-i.y),e.style.left=M(u);const d=l<a;e.classList.toggle(w["common-tooltip--direction_reversed"],d),e.classList.toggle(w["common-tooltip--direction_normal"],!d);const{top:p}=s.getBoundingClientRect();h=p<10?"below":"above",h=t.above?"above":h,h=t.below?"below":h,c.classList.toggle(w["common-tooltip__ear-holder--above"],"above"===h),c.classList.toggle(w["common-tooltip__ear-holder--below"],"below"===h),"below"===h&&(e.style.bottom="auto",e.style.top=M(i.y+i.h));const{left:_}=s.getBoundingClientRect();let m=Math.trunc(i.x+i.w/2-(_+s.clientWidth/2));e.style.left=M(u+m),e.style.width=M(s.clientWidth+r.clientWidth),m=d?Math.max(0,m):Math.min(0,m),r.style.left=M(-m),s.style.left=M(-m)}}function T(e){e.classList.toggle(w["common-tooltip--hidden"],!0)}function M(e){return Math.floor(e)+"px"}const I=`\n\t<div id="common-tooltip-wrapper" class="${w["common-tooltip"]}">\n\t\t<div class="${w["common-tooltip__ear-holder"]}" >\n\t\t\t<div class="${w["common-tooltip__body"]} js-tooltip-body"></div>\n\t\t</div>\n\t\t<div class="${w["common-tooltip__button-container"]}"></div>\n\t</div>\n`,L=`\n\t<div class="${w["common-tooltip__hotkey-block"]}"></div>\n`,O=`\n\t<div class="${w["common-tooltip__hotkey-text"]}"></div>\n`,A=Object(g.b)(I),E=Object(g.b)(L),k=Object(g.b)(O);function D(e){return e.querySelector("."+w["common-tooltip__body"])}var V=i("lxNp");i.d(t,"showOnElement",(function(){return F})),i.d(t,"show",(function(){return W})),i.d(t,"updateTooltipText",(function(){return H})),i.d(t,"hide",(function(){return z}));let B=!1,R=null,N=null;Modernizr.mobiletouch||document.addEventListener("mouseover",(function(e){const t=e.target,i=e.currentTarget,s=function(e,t,i){const s=[];for(;e&&e!==t;)e.classList&&e.classList.contains(i)&&s.push(e),e=e.parentElement||(r=e.parentNode)&&(r.nodeType===Node.ELEMENT_NODE?r:null);var r;return s}(t,i,"apply-common-tooltip");for(const r of s){if("buttons"in e){if(1&e.buttons)continue}else if(1===e.which)continue;const t=()=>F(r);if(t()){const e=()=>{r.removeEventListener("common-tooltip-update",t),r.removeEventListener("mouseleave",e),r.removeEventListener("mousedown",e),document.removeEventListener("scroll",e),N&&(N.destroy(),N=null),z()};r.addEventListener("common-tooltip-update",t),r.addEventListener("mouseleave",e),r.addEventListener("mousedown",e),document.addEventListener("scroll",e),null===N&&(N=Object(V.createGroup)({desc:"Tooltip"}),N.add({desc:"Hide",hotkey:27,handler:e
|
||
}));break}}}),!0);const j=new MutationObserver(()=>{if(R&&R.options.target){let e;e="isConnected"in R.options.target?R.options.target.isConnected:document.body.contains(R.options.target),e||z()}}),F=(e,t={})=>{const i=G(t),{content:r}=i,n=Object(s.a)(i,["content"]),o=function(e){const t=C(e),i=e.getBoundingClientRect(),s={h:i.height,w:i.width,x:i.left,y:i.top},r=e.getAttribute("data-color-theme")||"",n=e.classList.contains("common-tooltip-html"),o=parseInt(e.getAttribute("data-tooltip-delay")||"");let a={type:"none"};return t&&(a={type:n?"html":"text",data:t}),{above:e.classList.contains("common-tooltip-above"),below:e.classList.contains("common-tooltip-below"),otl:e.classList.contains("common-tooltip-otl"),otr:e.classList.contains("common-tooltip-otr"),vertical:e.classList.contains("common-tooltip-vertical"),hotkey:e.getAttribute("data-tooltip-hotkey"),narrow:e.classList.contains("common-tooltip-narrow"),wide:e.classList.contains("common-tooltip-wide"),colorTheme:r,tooltipDelay:o,rect:s,content:a,target:e}}(e),a=Object.assign(o,n);return"none"!==r.type&&(a.content=r),!("none"===a.content.type&&!a.hotkey)&&(a.target=e,W(a),!0)},W=e=>{const t=G(e),i=P(t);var s,n,o;R={options:t,element:i},s=i,u(),c&&c.appendChild(s),a(),B?U(i):(T(i),n=()=>U(i),o=function(e){return"number"!=typeof e.tooltipDelay||isNaN(e.tooltipDelay)?500:e.tooltipDelay}(t),r=setTimeout(n,o))},H=e=>C(e);const z=()=>{if(a(),j.disconnect(),!B||!R)return;const{element:e,options:t}=R,i=()=>{e.removeEventListener("mouseleave",i),T(e),o=setTimeout(()=>{u(),B=!1,R=null},250)};var s,r;t.tooltipHideDelay?(s=()=>{e.querySelector(":hover")?e.addEventListener("mouseleave",i):i()},r=t.tooltipHideDelay,n=setTimeout(s,r)):i()};function U(e){const{options:t}=Object(d.ensureNotNull)(R);if(x(e,t),function(e){e.classList.toggle(w["common-tooltip--hidden"],!1)}(e),j.observe(document,{childList:!0,subtree:!0}),B=!0,t.forceHideOnMove){const e=()=>{document.removeEventListener("mousemove",e),z()};document.addEventListener("mousemove",e)}}function G(e){if(function(e){return"content"in e}(e))return e;const{inner:t,html:i,text:r}=e,n=Object(s.a)(e,["inner","html","text"]);let o={type:"none"};return t&&(o={type:"element",data:t}),r&&(o={type:i?"html":"text",data:r}),Object.assign({content:o},n)}},"+6ja":function(e,t,i){"use strict";i.r(t),i.d(t,"availableTimezones",(function(){return o})),i.d(t,"timezoneIsAvailable",(function(){return a}));i("YFKU");var s=i("/+9u");const r=[{id:"Etc/UTC",title:window.t("UTC")},{id:"exchange",title:window.t("Exchange")}],n=[{id:"Africa/Cairo",title:window.t("Cairo"),offset:0},{id:"Africa/Johannesburg",title:window.t("Johannesburg"),offset:0},{id:"Africa/Lagos",title:window.t("Lagos"),offset:0},{id:"America/Argentina/Buenos_Aires",title:window.t("Buenos Aires"),offset:0},{id:"America/Bogota",title:window.t("Bogota"),offset:0},{id:"America/Caracas",title:window.t("Caracas"),offset:0},{id:"America/Chicago",title:window.t("Chicago"),offset:0},{id:"America/El_Salvador",title:window.t("San Salvador"),offset:0},{id:"America/Juneau",
|
||
title:window.t("Juneau"),offset:0},{id:"America/Lima",title:window.t("Lima"),offset:0},{id:"America/Los_Angeles",title:window.t("Los Angeles"),offset:0},{id:"America/Mexico_City",title:window.t("Mexico City"),offset:0},{id:"America/New_York",title:window.t("New York"),offset:0},{id:"America/Phoenix",title:window.t("Phoenix"),offset:0},{id:"America/Santiago",title:window.t("Santiago"),offset:0},{id:"America/Sao_Paulo",title:window.t("Sao Paulo"),offset:0},{id:"America/Toronto",title:window.t("Toronto"),offset:0},{id:"America/Vancouver",title:window.t("Vancouver"),offset:0},{id:"US/Mountain",title:window.t("Denver"),offset:0},{id:"Asia/Almaty",title:window.t("Almaty"),offset:0},{id:"Asia/Ashkhabad",title:window.t("Ashkhabad"),offset:0},{id:"Asia/Bahrain",title:window.t("Bahrain"),offset:0},{id:"Asia/Bangkok",title:window.t("Bangkok"),offset:0},{id:"Asia/Chongqing",title:window.t("Chongqing"),offset:0},{id:"Asia/Dubai",title:window.t("Dubai"),offset:0},{id:"Asia/Ho_Chi_Minh",title:window.t("Ho Chi Minh"),offset:0},{id:"Asia/Hong_Kong",title:window.t("Hong Kong"),offset:0},{id:"Asia/Jakarta",title:window.t("Jakarta"),offset:0},{id:"Asia/Jerusalem",title:window.t("Jerusalem"),offset:0},{id:"Asia/Kolkata",title:window.t("Kolkata"),offset:0},{id:"Asia/Kuwait",title:window.t("Kuwait"),offset:0},{id:"Asia/Muscat",title:window.t("Muscat"),offset:0},{id:"Asia/Qatar",title:window.t("Qatar"),offset:0},{id:"Asia/Riyadh",title:window.t("Riyadh"),offset:0},{id:"Asia/Seoul",title:window.t("Seoul"),offset:0},{id:"Asia/Shanghai",title:window.t("Shanghai"),offset:0},{id:"Asia/Singapore",title:window.t("Singapore"),offset:0},{id:"Asia/Taipei",title:window.t("Taipei"),offset:0},{id:"Asia/Tehran",title:window.t("Tehran"),offset:0},{id:"Asia/Tokyo",title:window.t("Tokyo"),offset:0},{id:"Atlantic/Reykjavik",title:window.t("Reykjavik"),offset:0},{id:"Australia/Adelaide",title:window.t("Adelaide"),offset:0},{id:"Australia/Brisbane",title:window.t("Brisbane"),offset:0},{id:"Australia/Perth",title:window.t("Perth"),offset:0},{id:"Australia/Sydney",title:window.t("Sydney"),offset:0},{id:"Europe/Amsterdam",title:window.t("Amsterdam"),offset:0},{id:"Europe/Athens",title:window.t("Athens"),offset:0},{id:"Europe/Belgrade",title:window.t("Belgrade"),offset:0},{id:"Europe/Berlin",title:window.t("Berlin"),offset:0},{id:"Europe/Brussels",title:window.t("Brussels"),offset:0},{id:"Europe/Copenhagen",title:window.t("Copenhagen"),offset:0},{id:"Europe/Dublin",title:window.t("Dublin"),offset:0},{id:"Europe/Helsinki",title:window.t("Helsinki"),offset:0},{id:"Europe/Istanbul",title:window.t("Istanbul"),offset:0},{id:"Europe/Lisbon",title:window.t("Lisbon"),offset:0},{id:"Europe/London",title:window.t("London"),offset:0},{id:"Europe/Luxembourg",title:window.t("Luxembourg"),offset:0},{id:"Europe/Madrid",title:window.t("Madrid"),offset:0},{id:"Europe/Malta",title:window.t("Malta"),offset:0},{id:"Europe/Moscow",title:window.t("Moscow"),offset:0},{id:"Europe/Oslo",title:window.t("Oslo"),offset:0},{id:"Europe/Paris",title:window.t("Paris"),offset:0},{
|
||
id:"Europe/Riga",title:window.t("Riga"),offset:0},{id:"Europe/Rome",title:window.t("Rome"),offset:0},{id:"Europe/Stockholm",title:window.t("Stockholm"),offset:0},{id:"Europe/Tallinn",title:window.t("Tallinn"),offset:0},{id:"Europe/Vilnius",title:window.t("Vilnius"),offset:0},{id:"Europe/Warsaw",title:window.t("Warsaw"),offset:0},{id:"Europe/Zurich",title:window.t("Zurich"),offset:0},{id:"Pacific/Auckland",title:window.t("New Zealand"),offset:0},{id:"Pacific/Chatham",title:window.t("Chatham Islands"),offset:0},{id:"Pacific/Fakaofo",title:window.t("Tokelau"),offset:0},{id:"Pacific/Honolulu",title:window.t("Honolulu"),offset:0},{id:"Pacific/Norfolk",title:window.t("Norfolk Island"),offset:0}];for(const l of n){const e=Object(s.a)(l.id);l.title=`(${e.string}) ${l.title}`,l.offset=e.offset}n.sort((e,t)=>{const i=e.offset-t.offset;return 0!==i?i:e.title.localeCompare(t.title)});const o=r.concat(n);function a(e){for(let t=0;t<o.length;t++)if(e===o[t].id)return!0;return!1}},"+DwS":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("hY0g"),r=i.n(s);function n(e,t){const i=new r.a(e()),s={};t.subscribe(s,()=>{i.setValue(e())});return i.readonly().spawn(()=>t.unsubscribeAll(s))}},"+FzY":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("VymR");function r(e,t){let i="";return s.a.parse(e,e=>(i=s.a.base+("svg"===t?`svg/${e}.svg`:`72x72/${e}.png`),!1)),i}},"+GxX":function(e,t,i){"use strict";var s=i("VVxS").TVLocalStorage,r=i("aIyQ");i("qFKp");var n=new r;TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",onChanged:new r,enableFeature:function(e){s.setItem(this.force_prefix+e,"true"),n.fire(e)},disableFeature:function(e){s.setItem(this.force_prefix+e,"false"),n.fire(e)},resetFeature:function(e){s.removeItem(this.force_prefix+e),n.fire(e)},onFeaturesStateChanged:function(){return n}},TradingView.isFeatureEnabled=function(e){function t(e){try{var t=(void 0)(e+function(){if(window.user&&window.user.id)return window.user.id;var e=s.getItem("featuretoggle_seed");return null!==e||(e=Math.floor(1e6*Math.random()),s.setItem("featuretoggle_seed",e)),e}());return new DataView(t).getUint32(0,!0)/4294967296}catch(i){return.5}}return function(i){return!("local"!==window.environment||!function(e){
|
||
return-1===["broker_FXCM_token_v2","broker_TRADESTATION_V3","broker_TRADOVATE_dev","black_friday_mainpage","black_friday_popup","datawindow","hide-copy-readonly","trading-fast-renew-oauth-token","switching_trial_year_to_month_disabled","switching_year_to_month_disabled","default_year_billing_cycle_switcher","marketing-analytics","disable_obs_streaming","google-ads","visible_address_fields_by_default","slow-support-warning","hide-trading-floating-toolbar","tvcoins_donations","save-short-streams","details_disable_bid_ask","vat_disabled","pro_plan_upgrades_disabled","new_date_range","video-ideas-new-api","currency_conversion","unit_conversion","hide_non_valuable_zeros_on_scale","disable_recaptcha_on_signup","braintree-trial-implementation","braintree-apple-pay","braintree-google-pay","allow_inserting_images","hide_gopro_popup_upgrade_button","yandex_metric_enabled","broker_id_session","remove_line_tools_from_content","oanda-european-accounts-warning","mobile_show_bottom_panel","disable_save_settings","enable_non_unique_watch_sections","desktop_version_notification_enabled","paperrest_2fa","paperrest_preview","screener_snowplow_enabled","favorites-in-broker-dropdown","enable_overlay_for_widget_bar","hide_chart_autosave_toggle"].indexOf(e)&&-1===e.indexOf("-maintenance")&&!1===/broker_[A-Z]+[a-zA-Z0-9_]+_dev/g.test(e)}(i))||(!e[i]||-1!==e[i])&&(!!("true"===s.getItem(TradingView.FeatureToggle.force_prefix+i)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"true"===user.settings[TradingView.FeatureToggle.force_prefix+i])||!("false"===s.getItem(TradingView.FeatureToggle.force_prefix+i)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"false"===user.settings[TradingView.FeatureToggle.force_prefix+i])&&(!!e[i]&&(1===e[i]||t(i)<=e[i])))}}(window.featureToggleState||{}),t.FeatureToggle=TradingView.FeatureToggle,t.isFeatureEnabled=TradingView.isFeatureEnabled,t.onFeaturesStateChanged=TradingView.FeatureToggle.onFeaturesStateChanged.bind(TradingView.FeatureToggle)},"+cnz":function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7 5" width="7" height="5" fill="none"><path stroke="currentColor" stroke-width="1.2" d="M1 1.5l2.5 2 2.5-2"/></svg>'},"+hLl":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBrush",(function(){return o}));var s=i("Ocx9"),r=i("DVnF"),n=i("j3hX");class o extends r.a{constructor(e,t){super(e,t||o.createProperties()),this._loadPaneViews(e)}properties(){return super.properties()}smooth(){return this.properties().childs().smooth.value()}name(){return"Brush"}hasEditableCoordinates(){return!1}static createProperties(e){const t=new s.DefaultProperty("linetoolbrush",e);return o._configureProperties(t),t}_loadPaneViews(e){i.e("lt-pane-views").then(i.bind(null,"00XE")).then(t=>{this._setPaneViews([new t.BrushPaneView(this,e)])})}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"ZSes")).then(e=>e.BrushDefinitionsViewModel)}static _configureProperties(e){r.a._configureProperties(e),
|
||
e.addChild("backgroundsColors",new n.LineToolColorsProperty([e.childs().backgroundColor],e.childs().fillBackground))}}},"/+9u":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("jCNj");function r(e,t=Date.now()){const i=Object(s.get_timezone)(e).offset_utc(t);let r="";const n=i/1e3/60/60;n%1&&(r=":"+n%1*60);let o="";return o=n>0?"+"+(n-n%1)+r:0===n?"":String(n-n%1+r),{offset:i,string:"UTC"+o}}},"//lZ":function(e,t,i){"use strict";i.r(t),i.d(t,"doAnimate",(function(){return n}));const s={from:0,duration:250,easing:i("9uLv").easingFunc.easeOutCubic};class r{constructor(e){this._doing=!0,this._completed=!1,this._options=Object.assign(Object.assign({},s),e);const t=performance.now();window.requestAnimationFrame(e=>{this._animation(t,this._options.from,e)})}stop(){this._doing=!1}completed(){return this._completed}_animation(e,t,i){if(!this._doing)return void this._finishAnimation();const s=(i=!i||i<1e12?performance.now():i)-e,r=s>=this._options.duration||t===this._options.to,n=(o=this._options.from,a=this._options.to,l=this._options.easing(s/this._options.duration),o*(1-l)+a*l);var o,a,l;const c=r?this._options.to:n,h=c-t;this._options.onStep(h,c),r?this._finishAnimation():window.requestAnimationFrame(t=>{this._animation(e,c,t)})}_finishAnimation(){this._options.onComplete&&this._options.onComplete(),this._completed=!0}}function n(e){return new r(e)}},"//lt":function(e,t,i){"use strict";var s;i.r(t),i.d(t,"PaneCursorType",(function(){return s})),function(e){e[e.Default=0]="Default",e[e.Pointer=1]="Pointer",e[e.Eraser=2]="Eraser",e[e.Dot=3]="Dot",e[e.Grabbing=4]="Grabbing",e[e.ZoomIn=5]="ZoomIn",e[e.VerticalResize=6]="VerticalResize",e[e.HorizontalResize=7]="HorizontalResize",e[e.DiagonalNeSwResize=8]="DiagonalNeSwResize",e[e.DiagonalNwSeResize=9]="DiagonalNwSeResize"}(s||(s={}))},"/3z9":function(e,t,i){"use strict";i.r(t),i.d(t,"isMacKeyboard",(function(){return r})),i.d(t,"Modifiers",(function(){return n})),i.d(t,"modifiersFromEvent",(function(){return o})),i.d(t,"hashFromEvent",(function(){return a})),i.d(t,"humanReadableModifiers",(function(){return l})),i.d(t,"humanReadableHash",(function(){return h}));var s=i("qFKp");const r=Object(s.isMac)()||s.CheckMobile.iOS();var n;function o(e){let t=0;return e.shiftKey&&(t+=1024),e.altKey&&(t+=512),e.ctrlKey&&(t+=256),e.metaKey&&(t+=2048),t}function a(e){return o(e)|e.keyCode}function l(e){let t="";return 256&e&&(t+=r?"^":"Ctrl + "),512&e&&(t+=r?"⌥":"Alt + "),1024&e&&(t+=r?"⇧":"Shift + "),2048&e&&(t+=r?"⌘":"Win + "),t}!function(e){e[e.None=0]="None",e[e.Alt=512]="Alt",e[e.Shift=1024]="Shift",e[e.Mod=r?2048:256]="Mod",e[e.Control=256]="Control",e[e.Meta=2048]="Meta"}(n||(n={}));const c={9:"⇥",13:"↵",27:"Esc",8:r?"⌫":"Backspace",32:"Space",35:"End",36:"Home",37:"←",38:"↑",39:"→",40:"↓",45:"Ins",46:"Del",191:"/"};for(let u=1;u<=16;u++)c[u+111]="F"+u;function h(e){let t=l(e);const i=255&e;return t+=i in c?c[i]:String.fromCharCode(i),t}},"/5ju":function(e,t,i){"use strict";i.r(t)
|
||
;var s=i("Kxc7"),r=i("hY0g"),n=i.n(r),o=i("FQhm"),a=i("htUT"),l=i("/z0S"),c=i("YFKU");i("HbRj"),i("+GxX");i("zUrt");async function h(){return!0}var u=i("fZEr");class d{constructor(e,t){this._visibility=new n.a(!1),this._chartWidgetCollection=e,this._doSave=t}hide(){var e;null===(e=this._hide)||void 0===e||e.call(this),this._visibility.setValue(!1)}visible(){return this._visibility.readonly()}}class p extends d{cloneChart(){this._cloneChart().then(()=>this._visibility.setValue(!0))}show(){Object(l.a)(this.cloneChart.bind(this),{source:"Clone chart"})}async _cloneChart(){const e=this._chartWidgetCollection;await h()&&(this._hide=await Object(u.b)({title:Object(c.t)("Copy Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:Object(c.t)("{0} copy",{context:"ex: AAPL chart copy"}).format(e.metaInfo.name.value()),onRename:({newValue:t,dialogClose:i})=>{s.enabled("saveload_storage_customization")&&(e.metaInfo.uid.deleteValue(),e.metaInfo.id.deleteValue(),e.metaInfo.name.setValue(t),this._doSave()),i()},onClose:()=>this._visibility.setValue(!1)}))}}class _ extends d{show(e,t,i){this._saveNewChart(e,t,i).then(()=>this._visibility.setValue(!0))}async _saveNewChart(e,t,i){const s=this._chartWidgetCollection,r=s.metaInfo.name.value();await h()&&(this._hide=await Object(u.b)({title:Object(c.t)("Save New Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:r,onRename:({newValue:r,dialogClose:n})=>{s.metaInfo.name.setValue(r),this._doSave(e,t,i),n()},onClose:()=>this._visibility.setValue(!1)}))}}class m extends d{show(){this._renameChart(),this._visibility.setValue(!0)}_renameChart(){Object(l.a)(async()=>{const e=this._chartWidgetCollection,t=e.metaInfo.name.value();this._hide=await Object(u.b)({title:Object(c.t)("Rename Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:t,onRename:({newValue:t,dialogClose:i})=>{e.metaInfo.name.setValue(t),this._doSave(),i()},onClose:()=>this._visibility.setValue(!1)})},{source:"Rename chart"})}}i.d(t,"SaveChartService",(function(){return f}));class f{constructor(e,t){this._autosaveTimer=null,this._watchedAutoSaveEnabled=new n.a,this._toggleAutoSaveEnabledHandler=this._toggleAutoSaveEnabled.bind(this),this._doSave=(e,t,i,s)=>{const r=this._chartWidgetCollection;void 0!==e&&e(),this._chartSaver.saveChartSilently(e=>{var i;i=r.metaInfo.uid.value(),"/chart/"===location.pathname&&(location.href="/chart/"+i),void 0!==t&&t(e)},()=>{void 0!==i&&i()},{autoSave:Boolean(s)})},this._chartWidgetCollection=e,this._chartSaver=t,this._createController=new _(e,this._doSave),this._renameController=new m(e,this._doSave),this._saveAsController=new p(e,this._doSave),this._chartChangesWatcher=new a.ChartChangesWatcher(e.undoHistory,t,o),e.saveKeysPressed().subscribe(this,this.saveChartOrShowTitleDialog),this._chartChangesWatcher.getOnChange().subscribe(this,this._onStateChanged)}autoSaveEnabled(){return this._watchedAutoSaveEnabled}destroy(){0}getCreateController(){return this._createController}
|
||
getRenameController(){return this._renameController}getSaveAsController(){return this._saveAsController}cloneChart(){this._saveAsController.cloneChart()}saveChartAs(){this._saveAsController.show()}renameChart(){this._renameController.show()}saveNewChart(e,t,i){this._createController.show(e,t,i)}saveExistentChart(e,t,i){this._doSave(e,t,i)}saveChartOrShowTitleDialog(e,t,i){const s=window.saver.isSaveInProcess(),r=this._chartChangesWatcher.hasChanges(),n=!!this._chartWidgetCollection.metaInfo.id.value();window.is_authenticated&&(s||!r&&n)||Object(l.a)(()=>{null!=this._chartWidgetCollection.metaInfo.id.value()?this.saveExistentChart(e,t,i):this.saveNewChart(e,t,i)},{source:"Save chart",sourceMeta:"Chart"})}whenReadyToSave(e){this._chartSaver.whenReadyToSave(e)}saveToJSON(){return this._chartSaver.saveToJSON()}saveChartSilently(e,t,i){this._chartSaver.saveChartSilently(e,t,i)}setAutoSaveEnabled(e){window.is_authenticated&&window.saver.isSaveInProcess()||Object(l.a)(()=>{this._watchedAutoSaveEnabled.setValue(e)},{source:"AutoSave chart"})}saveChartLineTools(e,t){return this._chartSaver.saveChartLineTools(e,t)}_autoSaveEnabledSettingHandler(e){0}_toggleAutoSaveEnabled(e){0}_enableAutoSave(){0}_disableAutoSave(){0}_onStateChanged(e){e?this._startAutosave():this._stopAutosave()}_startAutosave(){s.enabled("charts_auto_save")&&null===this._autosaveTimer&&(this._autosaveTimer=setTimeout(()=>{this._autosaveTimer=null,this._chartWidgetCollection.metaInfo.id.value()&&this._doSave(void 0,void 0,void 0,!0)},6e4))}_stopAutosave(){null!==this._autosaveTimer&&(clearInterval(this._autosaveTimer),this._autosaveTimer=null)}}},"/DW5":function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return n}));var s=i("CLNU");function r(e){return Object(s.clean)(JSON.stringify(e))}function n(e){return JSON.parse(Object(s.clean)(e,!0))}},"/DxK":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolHorzLine",(function(){return l}));var s=i("tc+8"),r=i.n(s),n=i("Ocx9"),o=i("Ss5c"),a=i("p1SQ");class l extends o.LineDataSource{constructor(e,t){super(e,t||l.createProperties()),this._priceAxisView=new a.LineToolHorzLinePriceAxisView(this),i.e("lt-pane-views").then(i.bind(null,"ckl+")).then(({HorzLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}state(e){const t=super.state(e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t}pointsCount(){return 1}name(){return"Horizontal Line"}priceAxisViews(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null}timeAxisViews(){return null}timeAxisPoints(){return[]}updateAllViews(){super.updateAllViews(),this._priceAxisView.update()}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new n.DefaultProperty("linetoolhorzline",e);return l._configureProperties(t),t}_getAlertPlots(){return[this.points()[0].price]}_getPropertyDefinitionsViewModelClass(){
|
||
return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"NEbb")).then(e=>e.HorizontalLineDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){o.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new r.a("")),e.addExclusion("text")}}},"/G2Z":function(e,t,i){"use strict";(function(e){i("xdS3");var t=i("Eyy1").assert;i("fPdn"),i("wZIs"),i("WmDe"),JSON.parse(urlParams.disabledFeatures).forEach((function(t){e.setEnabled(t,!1)})),JSON.parse(urlParams.enabledFeatures).forEach((function(t){e.setEnabled(t,!0)}));var s=i("UlDV").RestrictedToolsetBootloader,r=i("I4UZ").HeaderToolbarBootloader,n=i("9zVu").DrawingToolbarBootloader,o=i("OiSa").isDrawingToolbarVisible,a=i("EsvI"),l=i("oiZD").setTheme,c=i("JcHK"),h=i("Ery9"),u=i("lxNp"),d=i("n0Bl").migrateShortcut,p=i("RXmj").ChartSaver,_=i("/5ju").SaveChartService,m=i("lA7n").LoadChartService,f=i("F58L").StudyTemplates,g=i("54XG").FavoriteStudyTemplateService,v=i("PT1i").linking,b=i("FQhm"),S=i("kcTO"),y=S.formatterOptions,w=S.customFormatters,C=i("JT5O").StudyMarket,P=i("FBuY").TVXWindowEvents,x=i("jofe").createDeferredPromise,T=i("FIi8").deepExtend,M=i("UXvI").default,I=i("LxhU").Interval,L=i("lW/c").Root,O=i("NsVT").ChartPage,A=i("IWXC").destroyQuoteSessions,E=i("ULlu"),k=i("uDHo").TIMEFRAMETYPE,D=new O(new L(window).allocate()),V=D.allocate({areaName:"center"}),B=(D.allocate({areaName:"tradingpanel"}),window.parent[urlParams.uid].brokerFactory,Boolean(!1)),R=i("vPbs").CHART_WIDGET_COLLECTION_SERVICE,N=i("eqEH");i("Wh/T");var j=i("/Y2c"),F=i("g5Qf").createFavoriteDrawingToolbar,W=i("x5Tw").setupChartEventHint,H=i("EX27"),z=i("0YCj"),U=i("9nLJ");i("2cgs"),i("vIQA");var G=i("u5Q5").setSearchRequestDelay,q=i("K5cv").setSearchRequestDelay,Y=i("dfhE"),K=i("ocLq"),J=i("qE4g").addBrandingSource,Z=i("6vtU").setAdditionalSymbolInfoFields,X=window.parent[urlParams.uid].getCustomIndicators,$=x(),Q=x(),ee=e.enabled("left_toolbar");if(Promise.all([$.promise,Q.promise]).then((function(){window.ChartApiInstance.start()})),"function"==typeof X){var te=X(K);te&&te.then?te.then((function(e){if(!Array.isArray(e))return console.warn("custom_indicators_getter should be a function that returns a Promise object which result is an array of custom indicators"),void $.resolve();JSServer.studyLibrary.push.apply(JSServer.studyLibrary,e),$.resolve(),console.log("{0} custom indicators loaded.".format(e.length))})).catch((function(e){console.warn("Error loading custom indicators "+e),$.resolve()})):(console.warn("custom_indicators_getter should be a function that returns a Promise object"),$.resolve())}else $.resolve();window.widgetReady=function(e){b.subscribe("onChartReady",e)};var ie=urlParams.theme&&urlParams.theme.toLowerCase();function se(e){window.__defaultsOverrides=window.__defaultsOverrides||{},T(window.__defaultsOverrides,e),
|
||
void 0!==TradingView.defaultProperties&&void 0!==TradingView.defaultProperties.chartproperties&&(window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools())}!function(e){a.themes[e]&&l(e)}(ie),window.applyStudiesOverrides=function(e){e&&window.chartWidgetCollection.applyStudiesOverrides(e)},window.applyOverrides=function(e){se(e),window.chartWidgetCollection.applyOverrides(e)},window.applyTradingCustomization=function(e){for(var t in e.order)TradingView.defaultProperties.linetoolorder[t]=e.order[t];for(var t in e.position)TradingView.defaultProperties.linetoolposition[t]=e.position[t]},window.changeTheme=function(e,t){var i=a.themes[e.toLowerCase()];i&&window.tradingViewApi.themes().setStdTheme(i.name,!0,t&&t.disableUndo)},window.getTheme=function(){return window.tradingViewApi.themes().getCurrentThemeName()},window.is_authenticated=!1;JSON.parse(window.urlParams.brokerConfig);window.t("charts by TradingView"),window.t("powered by TradingView"),window.t("by TradingView");var re=null,ne=x(),oe=null,ae=function(){if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");if(e.setEnabled("charting_library_debug_mode","true"===urlParams.debug),e.setEnabled("chart_property_page_trading",!1),e.enabled("remove_library_container_border")){var l=document.querySelector("#library-container");null!==l&&(l.style.border="0px",l.style.padding="1px")}e.enabled("no_min_chart_width")&&(window.document.body.style.minWidth="0px"),null!=urlParams.studiesOverrides&&z.setDefaultsOverrides(JSON.parse(urlParams.studiesOverrides)),t(void 0===TradingView.defaultProperties,"Default properties are inited before applying overrides"),se(JSON.parse(urlParams.overrides)),urlParams.numeric_formatting=urlParams.numeric_formatting&&JSON.parse(urlParams.numeric_formatting),urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(y.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new H(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(w.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(w.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),window.ChartApiInstance.setStudiesAccessController(window.ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess));var h=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,u=urlParams.chartContentExtendedData?JSON.parse(urlParams.chartContentExtendedData):h?h.extendedData:void 0,d=urlParams.interval||"D",S=function(e){var t=/(\d+)(\w+)/;return e.map((function(e){var i=t.exec(e.text),s=i[2].toLowerCase(),r=parseInt(i[1]),n="y"===s?12*r+"M":r+s,o=I.parse(e.resolution);return{text:window.t(e.title)||r+window.t(s,{context:"dates",count:r}),description:e.description||"",value:{value:n.toUpperCase(),
|
||
type:k.PeriodBack},targetResolution:o.value(),requiresIntraday:o.isIntraday()}}))}(JSON.parse(urlParams.timeFrames));window.containerElement=window.parent.document.getElementById(urlParams.uid).parentElement;var x={resizerBridge:V,padding:e.enabled("border_around_the_chart")?2:0,content:h,widgetOptions:{hideIdeas:!0,addVolume:window.ChartApiInstance.studiesAccessController.isToolEnabled("Volume"),handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:d,compareSymbols:urlParams.compareSymbols&&JSON.parse(urlParams.compareSymbols),defTimeframe:urlParams.timeframe,paneContextMenuEnabled:e.enabled("pane_context_menu"),paneContextMenu:{mainSeriesTrade:B},priceScaleContextMenuEnabled:e.enabled("scales_context_menu"),currencyConversionEnabled:e.enabled("pricescale_currency"),unitConversionEnabled:e.enabled("pricescale_unit"),legendWidgetEnabled:e.enabled("legend_widget"),legendWidget:{contextMenu:{settings:e.enabled("show_chart_property_page"),showOpenMarketStatus:e.enabled("display_market_status")}},sourceStatusesWidget:{errorSolution:!1},marketStatusWidgetEnabled:e.enabled("display_market_status"),marketStatusWidget:{preMarketSolution:!1,postMarketSolution:!1},chartWarningWidget:{subscriptionFullInfo:!1},timeScaleWidget:{contextMenuEnabled:e.enabled("scales_context_menu"),timezoneMenuEnabled:e.enabled("timezone_menu"),priceAxisLabelsOptions:{showLabels:e.enabled("main_series_scale_menu")}},timeScale:{preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:e.enabled("lock_visible_time_range_on_resize"),rightBarStaysOnScroll:e.enabled("right_bar_stays_on_scroll"),minBarSpacing:urlParams.time_scale&&JSON.parse(urlParams.time_scale).min_bar_spacing},goToDateEnabled:e.enabled("go_to_date"),crossHair:{menuEnabled:e.enabled("chart_crosshair_menu")},handleScale:{mouseWheel:e.enabled("mouse_wheel_scale"),pinch:e.enabled("pinch_scale"),axisPressedMouseMove:{time:e.enabled("axis_pressed_mouse_move_scale"),price:e.enabled("axis_pressed_mouse_move_scale")}},handleScroll:{mouseWheel:e.enabled("mouse_wheel_scroll"),pressedMouseMove:e.enabled("pressed_mouse_move_scroll"),horzTouchDrag:e.enabled("horz_touch_drag_scroll"),vertTouchDrag:e.enabled("vert_touch_drag_scroll")},shiftVisibleRangeOnNewBar:e.enabled("shift_visible_range_on_new_bar"),croppedTickMarks:e.enabled("cropped_tick_marks"),countdownEnabled:e.enabled("countdown")},seriesControlBarEnabled:e.enabled("timeframes_toolbar"),seriesControlBar:{timeFramesWidgetEnabled:!0,timeFramesWidget:{goToDateEnabled:e.enabled("go_to_date"),availableTimeFrames:function(e,t){return e?t!==Y.STATUS_DELAYED&&t!==Y.STATUS_DELAYED_STREAMING&&t!==Y.STATUS_READY?[]:S.filter((function(t){return!(t.requiresIntraday&&!e.has_intraday)&&!(e.supported_resolutions&&!e.supported_resolutions.includes(t.targetResolution))})):[]}},timeWidgetEnabled:!0,timeWidget:{timezoneMenuEnabled:e.enabled("timezone_menu")},adjustForDividendsButtonEnabled:!1,extendedHoursButtonEnabled:!1,percentageScaleButtonEnabled:!0,logScaleButtonEnabled:!0,autoScaleButtonEnabled:!0,
|
||
fullscreenButtonEnabled:!0,mobileChangeLayoutEnabled:!1},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl,mobileForceChartMaximizeEnabled:!1,saveChartEnabled:e.enabled("save_shortcut")};ee&&(F(),x.widgetOptions.isDrawingToolbarVisible=o),u&&(x.metaInfo={id:u.uid,name:u.name,description:u.description,uid:u.uid,username:"",tags:""}),window.parent[urlParams.uid].additionalSymbolInfoFields&&Z(window.parent[urlParams.uid].additionalSymbolInfoFields);var T=window.chartWidgetCollection=new j(x);J(T),window.studyMarket=new C(T),void 0!==N&&N.registerService(R,T),T.activeChartWidget.subscribe((function(e){b.emit("activeChartChanged",T.getAll().indexOf(e))})),window.saver=new p(T);var L=new _(T,window.saver),O=new m(T);window.chartWidget=T.activeChartWidget.value(),window.pro=new TradingView.Pro;var A=function(t){if(!e.enabled("header_widget"))return null;var n=D.allocate({areaName:"top"}),o=new(0,i("htUT").ChartChangesWatcher)(t.chartWidgetCollection.undoHistory,window.saver,b),a=JSON.parse(urlParams.favorites);a.intervals=a.intervals.map((function(e){var t=""+e;return t.match(/1[DWMYdwmy]/)&&(t=t.slice(1)),t}));var l=null;e.enabled("study_templates")&&(l=new g(P,TVSettings),oe=new f({chartWidgetCollection:t.chartWidgetCollection,favoriteStudyTemplatesService:l}));var c=void 0,h=urlParams.header_widget_buttons_mode;"fullsize"===h&&(c=["full"]);"compact"===h&&(c=["small"]);return new r(new s,{chartSaver:window.saver,chartApiInstance:ChartApiInstance,chartWidgetCollection:t.chartWidgetCollection,defaultFavoriteStyles:a.chartTypes,defaultFavoriteIntervals:a.intervals,hideStudyTemplates:!0,resizerBridge:n,studyMarket:window.studyMarket,studyTemplates:oe,favoriteStudyTemplatesService:l,allowedModes:c,saveChartService:t.saveChartService,loadChartService:t.loadChartService,chartChangesWatcher:o,onClick:_e})}({chartWidgetCollection:T,saveChartService:L,loadChartService:O});null!==A?A.load().then((function(e){re=e.getComponent(),ne.resolve()})):(ne.promise.catch((function(){})),ne.reject("header widget is not loaded"));var E=function(e){if(ee){var t=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?String(urlParams.toolbarbg):void 0;if(t){var i=document.createElement("style");i.textContent="body,.chart-controls-bar,#footer-chart-panel{background-color:#"+t+" !important}",document.head.appendChild(i)}return new n({bgColor:t,chartWidgetCollection:e,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,resizerBridge:D.allocate({areaName:"left"}),onClick:_e})}return null}(T),K=null;window.tradingViewApi=new U({chartWidgetCollection:T,chartApiInstance:window.ChartApiInstance,saveChartService:L,loadChartService:O});var X=null;if(v.bindToChartWidgetCollection(T),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),!TradingView.isNaN(urlParams.ssreqdelay)){var $=Math.max(0,+urlParams.ssreqdelay);G($),q($)}window.ChartApiInstance.connect(),
|
||
Promise.all([i.e("react"),i.e(1),i.e(2),i.e(7),i.e(11),i.e(15),i.e(16),i.e(18),i.e(20),i.e(22),i.e(24),i.e(28),i.e(42),i.e(47),i.e(50),i.e(63),i.e(69),i.e(79),i.e(0),i.e(4),i.e(25),i.e(32),i.e(38),i.e("line-tools-icons"),i.e(52),i.e(55),i.e("floating-toolbars")]).then(i.t.bind(null,"tPkB",7)).then(({default:e})=>{window.lineToolPropertiesToolbar=new e(T)});var te=document.querySelector(".tv-content");function ae(){E&&E.load(),K&&K.load().then((function(e){window.footerWidget=e.getComponent()})),X&&X.load().then((function(e){window.widgetbar=e}))}null!==te&&te.addEventListener("contextmenu",(function(e){null!==e.target&&"input"!==e.target.tagName.toLowerCase()&&"textarea"!==e.target.tagName.toLowerCase()&&e.preventDefault()})),Q.resolve(),T.undoHistory.undoStack().onChange().subscribe(null,M((function(){b.emit("onAutoSaveNeeded")}),1e3*(urlParams.autoSaveDelay||5),{leading:!1,trailing:!0})),window.chartWidget.withModel(null,(function(){if(ChartApiInstance.on("realtime_tick",(function(e){b.emit("onTick",e)})),!a.savedThemeName()&&ie){var t=a.getStdTheme(ie);t&&t.content&&void 0===h&&(T.applyTheme(t.content,!1,!1,ie,!0,!0),window.applyOverrides(window.__defaultsOverrides))}e.enabled("charting_library_debug_mode")&&b.subscribeToAll((function(){var e=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(e[0],JSON.stringify(e.slice(1))))})),W&&(W(T),W=null)})),c.isAnyChartWidgetInitialized(T)?ae():c.waitAnyChartWidgetInitialized(T,ae),b.subscribe("chart_load_requested",(function(e){window.tradingViewApi.loadChart({json:JSON.parse(e.content),extendedData:e})}))};window.addEventListener("unload",(function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.containerElement=null,A(),window.ChartApiInstance&&(window.ChartApiInstance.destroy(),window.ChartApiInstance=null)})),e.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?h.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?h.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(e.setEnabled("saveload_storage_customization",!1),e.setEnabled("header_saveload",!1)));var le,ce=x();function he(){ce.resolve()}window.parent[urlParams.uid].loadLastChart&&e.enabled("saveload_storage_customization")?h.getCharts((function(e){if(0!==e.length){var t=e.sort((function(e,t){return t.modified_iso-e.modified_iso}))[0];h.getChartContent(t,(function(e){var t=JSON.parse(e.content);t.extendedData=e,urlParams.chartContent=JSON.stringify({json:t}),he()}),he)}else he()}),he):he(),null!=(le=window.parent[window.urlParams.uid].settingsAdapter)?(TVSettings.setSettingsAdapter(le),TVSettings.sync()):e.enabled("use_localstorage_for_settings")&&TVSettings.sync();var ue,de,pe=x();function _e(e){var t=TradingView.bottomWidgetBar;t&&t.turnOffMaximize()}
|
||
Promise.all([pe.promise,ce.promise]).then((function(){E.trigger(window,"resize");var t,i,s,r,n,o,a=document.querySelector(".loading-indicator");if(a&&(a.style.display="none"),setTimeout(ae,0),e.enabled("14851")&&Math.random()<=.02){t=window,i=document,s="script",r="ga",t.GoogleAnalyticsObject=r,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,n=i.createElement(s),o=i.getElementsByTagName(s)[0],n.async=1,n.src="//www.google-analytics.com/analytics.js",o.parentNode.insertBefore(n,o);var l=document.URL.match(new RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-112911840-1","auto"),ga("set","anonymizeIp",!0),ga("set",{hostname:l,page:l,referrer:l}),ga("send","pageview")}})),ue=!0,window.parent[urlParams.uid].datafeed.onReady((function(e){ue&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,pe.resolve()})),ue=!1,window.getFunctionFromArguments=function(e){return window.parent[urlParams.uid][e]},window.createShortcutAction=(de=u.createGroup({desc:"API"}),function(e,t){de.add({hotkey:d(e),handler:t})}),window.initializationFinished=function(){window.chartWidgetCollection.undoHistory.clearStack()},window.headerReady=function(){return ne.promise},window.createButton=function(e){if(null===re)throw new Error("Cannot create button: header widget is not ready or is not loaded - use `headerReady` to wait until header is ready");var t=(e=e||{}).align||"left";return re.addButton(t)},window.getAllFeatures=function(){const t=e.getAllFeatures();return Object.keys(t).forEach((function(e){isNaN(parseFloat(e))||delete t[e]})),t}}).call(this,i("Kxc7"))},"/McG":function(e){
|
||
e.exports=JSON.parse('{"content":{"chartProperties":{"scalesProperties":{"textColor":"#131722","lineColor":"rgba(42, 46, 57, 0.14)","backgroundColor":"#ffffff"},"paneProperties":{"vertGridProperties":{"color":"rgba(42, 46, 57, 0.06)"},"horzGridProperties":{"color":"rgba(42, 46, 57, 0.06)"},"crossHairProperties":{"color:":"#9598A1"},"background":"#ffffff","backgroundGradientStartColor":"#ffffff","backgroundGradientEndColor":"#ffffff"}},"sessions":{"graphics":{"backgrounds":{"outOfSession":{"color":"#2196F3","transparency":92},"preMarket":{"color":"#FF9800","transparency":92},"postMarket":{"color":"#2196F3","transparency":92}},"vertlines":{"sessBreaks":{"color":"#4985e7","style":2,"width":1}}}},"mainSourceProperties":{"baseLineColor":"#B2B5BE","candleStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#737375","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"haStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#737375","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"barStyle":{"downColor":"#ef5350","upColor":"#26a69a"},"pnfStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"},"baselineStyle":{"baselineColor":"rgba( 117, 134, 150, 1)","topFillColor1":"rgba( 38, 166, 154, 0.28)","topFillColor2":"rgba( 38, 166, 154, 0.05)","bottomFillColor1":"rgba( 239, 83, 80, 0.05)","bottomFillColor2":"rgba( 239, 83, 80, 0.28)","topLineColor":"rgba( 38, 166, 154, 1)","bottomLineColor":"rgba( 239, 83, 80, 1)"},"areaStyle":{"transparency":100,"color1":"rgba(33, 150, 243, 0.28)","color2":"#2196f3","linecolor":"#2196f3","linewidth":2,"linestyle":0},"renkoStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","wickUpColor":"#26a69a","wickDownColor":"#ef5350"},"lineStyle":{"color":"#2196f3","linewidth":2,"linestyle":0},"kagiStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"},"pbStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae"},"rangeStyle":{"upColor":"#26a69a","downColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"}}}}')},"/ToI":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));var s=i("Eyy1"),r=i("3u3j");class n extends r.a{constructor(e,t,i,s){super(e,t,s),this._sourcePaneRemoved=!1,this._targetPaneIndex=e.panes().indexOf(i)}redo(){
|
||
const e=this._chartModel.panes()[this._initialPaneIndex],t=this._chartModel.panes()[this._targetPaneIndex],i=e!==t,r=this._targetPriceScale(t),n=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),o=this._chartModel.children(n,!0);for(const s of o)i?(this._chartModel.detachSource(s),t.addDataSource(s,r,!1)):t.move(s,r);i?(this._sourcePaneRemoved=this._chartModel.detachSource(n),t.addDataSource(n,r,!1)):t.move(n,r);const a=t.priceScalePosition(r);t.movePriceScale(r,a,this._targetPriceScaleIndex(n)),this._chartModel.fullUpdate()}undo(){this._sourcePaneRemoved&&this._chartModel.createPane(this._initialPaneIndex);const e=this._chartModel.panes()[this._initialPaneIndex],t=e!==this._chartModel.panes()[this._targetPaneIndex],i=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId));let r=e.getPriceScaleById(this._initialPriceScaleId);null===r&&(r=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex));const n=this._chartModel.children(i,!0);for(const s of n)t?(this._chartModel.detachSource(s),e.addDataSource(s,r,!1)):e.move(s,r);t?(this._chartModel.detachSource(i),e.addDataSource(i,r,!1)):e.move(i,r),Object(s.ensureNotNull)(i.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()}}class o extends n{constructor(e,t,i,s,r){super(e,t,i,r),this._targetPriceScalePosition=s}_targetPriceScale(e){const t=e.createPriceScaleAtPosition(this._targetPriceScalePosition);return t.restoreState(this._newPriceScaleState("overlay"===this._targetPriceScalePosition)),t}_targetPriceScaleIndex(e){return e===this._chartModel.mainSeries()?0:void 0}}class a extends n{constructor(e,t,i,s,r){super(e,t,i,r),this._targetPriceScaleId=s.id()}_targetPriceScale(e){return Object(s.ensureNotNull)(e.getPriceScaleById(this._targetPriceScaleId))}_targetPriceScaleIndex(e){}}},"/Y2c":function(e,t,i){"use strict";(function(t){var s=i("Eyy1").assert,r=i("jofe").createDeferredPromise,n=i("VNzU").layouts,o=i("Zo2/"),a=i("qFKp").supportTouch,l=i("qFKp").isIE,c=i("qFKp").isEdge,h=i("x8jL").createUndoHistory,u=i("mMWL"),d=i("lxNp"),p=i("/3z9"),_=i("FQhm"),m=i("l7mP"),f=i("Kxc7"),g=i("ijBy").SetChartLayoutCommand,v=i("hY0g"),b=i("HySD").ResizerDetacherState,S=i("HV/F").delegateToPromise,y=i("sEk5"),w=i("lJvs"),C=i("txPx").getLogger("Chart.ChartWidgetCollection"),P=(i("JWMC").trackEvent,i("wamh").ChangeToolBarsThemeUndoCommand),x=i("EsvI").getCurrentTheme,T=i("dfhE"),M=i("ufwo").rangesAreEqual,I=i("0psP").GeneralChartPropertiesRenderer,L=i("NSoL").clientSnapshot,O=i("pPtI").setLastUsedResolution,A=i("E3Wt"),E=A.applyIndicatorsToAllChartsImpl,k=A.applyIndicatorToAllChartsImpl,D=i("v+eZ").ChartClipboardHandler,V={saveChartEnabled:!0,takeScreenshotEnabled:!0,publishedChartsEnabled:!0};e.exports=function(e){var A=this,B=Object.assign({},V,e),R=1,N=2,j=0,F=0,W=new v,H=B.readOnly||!1,z=[],U=0,G=new v,q=new v,Y=null,K="s",J=new v,Z=[],X=!1,$=!1,Q=!1,ee=new v(!1),te=new v(!1),ie=new v(!1),se=new v(TVSettings.getBool("chart.syncCrosshair",!0)),re=d.createGroup({
|
||
desc:"Layout"}),ne=null,oe=se.value();se.subscribe((function(e){oe=e=!!e,TVSettings.setValue("chart.syncCrosshair",e);for(var t=0;t<z.length;++t){var i=z[t].chartWidget.model();i&&i.model().lightUpdate()}}));var ae=new v(K),le=B.resizerBridge.width,ce=B.resizerBridge.height,he=null;void 0!==B.padding&&(N=B.padding),void 0!==B.topOffset&&(R=B.topOffset),void 0!==B.edge&&(j=B.edge),void 0!==B.border&&(F=B.border);var ue=B.widgetOptions||{},de=B.metaInfo||{},pe={id:new v(de.id||null),name:new v(de.name),description:new v(de.description),username:new v(de.username),uid:new v(de.uid),lastModified:new v(de.lastModified)},_e=h();_e.onChange().subscribe(null,(function(e){_.emit("undo_redo_state_changed",e)}));var me=B.resizerBridge.container.value(),fe=r(),ge=new t,ve=new t,be=new t;function Se(){z.forEach((function(e){e.chartWidget.onZoom().unsubscribeAll(this)}))}function ye(){z.forEach((function(e){e.chartWidget.onScroll().unsubscribeAll(this)}))}var we,Ce=null,Pe=null,xe=null,Te=null;B.seriesControlBarEnabled&&(we=j+F+"px",(Ce=document.createElement("div")).style.left=we,Ce.style.right=we,Ce.style.bottom=we,Ce.classList.add("chart-toolbar","chart-controls-bar"),me.appendChild(Ce),Promise.all([i.e("react"),i.e(1),i.e(7),i.e(8),i.e(11),i.e(16),i.e(18),i.e(22),i.e(23),i.e(24),i.e(42),i.e(44),i.e(47),i.e(76),i.e(0),i.e(4),i.e(10),i.e(14),i.e(38),i.e("chart-bottom-toolbar")]).then(i.bind(null,"MfqI")).then(({BottomToolbarRenderer:e})=>{var i=B.resizerBridge,s=[i.container.spawn(),i.width.spawn(),i.height.spawn()],r=i.container.value(),n=new t,o=function(){n.fire()};s.forEach((function(e){e.subscribe(o)})),Pe=new e(Ce,n,(function(){var e=r.getBoundingClientRect(),t=Le();return t.top=e.top+t.top,t.left=e.left+t.left,t}),A,ChartApiInstance,ue,B.seriesControlBar),xe=function(){null!==Pe&&(Pe.destroy(),Pe=null,Ce.remove(),Ce=null),s.forEach((function(e){e.destroy()})),n.destroy()}}));var Me=new I(A);function Ie(){return{undoHistory:_e,chartWidgetsDefs:z}}function Le(){var e=j+F,t=Ce?Ce.offsetHeight:0;return{width:le.value()-2*e,height:ce.value()-R-t-e,top:R,left:e}}function Oe(){return Ae()}function Ae(){return n[K].count}function Ee(e,t,i,s,r){if(e<z.length){var n=z[e].chartWidget;return e<Ae()||n.shouldBeSavedEvenIfHidden()?n.state(t,i,s,r):null}return Z[e-z.length].content}function ke(){return Promise.resolve(null)}function De(){var e;e=he?[he]:z.slice(0,Y.count).filter((function(e){return!e.hiddenInLayout.value()}));for(var t=0;t<e.length;t++)Ve(e[t],t,e.length)}function Ve(e,t,i){var s=Y.sizer(Le(),t,i,N+F);s.width=Math.max(Math.round(s.width),0),s.height=Math.max(Math.round(s.height),0),s.top=Math.round(s.top),s.left=Math.round(s.left),e.metrics=s;var r=e.container.value();r&&(r.style.width=s.width+"px",r.style.height=s.height+"px",r.style.top=s.top+"px",r.style.left=s.left+"px"),e.width.setValue(s.width),e.height.setValue(s.height)}function Be(e){return e.rdState.owner.value()!==e}function Re(e){var t;e=Object.assign({chartWidgetCollection:A,isActive:0===z.length,barsMarksContainersFactory:Ne,undoHistory:_e,readOnly:H,
|
||
initialLoading:Q,getToasts:ke},e||{}),void 0!==ot&&(e.customLegendWidgetFactories=new Map(ot));var i=document.createElement("div");i.classList.add("chart-container"),i.style.position="absolute",i.style.overflow="hidden",me.appendChild(i),(l||c)&&(i.style.touchAction="none",i.style.msTouchAction="none"),B.className&&i.addClass(B.className);var s={alive:new v(!0),container:new v(i),width:new v,height:new v,hiddenInLayout:new v(!1),visible:new v,rdState:new b,requestFullscreen:function(){G.value()&&(je(s),W.setValue(s.chartWidget))},exitFullscreen:function(){W.value()===s.chartWidget&&je(null)},detachable:G,fullscreenable:G,fullscreen:new v};function r(){s.visible.setValue(!s.hiddenInLayout.value()&&B.resizerBridge.visible.value())}s.rdState.pushOwner(s),z.push(s),s.hiddenInLayout.subscribe(r),B.resizerBridge.visible.subscribe(r),r(),function(e){for(var t=0,i=0,s=0;s<Y.count;s++){z[s]&&Be(z[s])||(z[s]===e&&(i=t),t++)}Ve(e,i,t)}(s),Object.assign(e,s.rdState.bridge());var n=e.content?e.content.chartId:We(Fe);return s.chartWidget=t=new o.ChartWidget(e,n,pe.uid.value()),ne&&s.chartWidget.setSaveChartService(ne),e.containsData?t.finishInitWithoutConnect():t.connect(),t.withModel(null,(function(){var e=t.model().model();nt.forEach((function(t,i){e.addCustomSource(i,t.factory,t.layer)}))})),ze(),Ue(),ge.fire(t),t}function Ne(e){var t=[],i=new y(e);t.push(i);var s=new w(e);return t.push(s),t}function je(e){he!==e&&(he=e,He(K))}function Fe(e){return z.some((function(t){return t.chartWidget&&t.chartWidget.id()===e}))}function We(e){for(var t=1;e(""+t);)t++;return""+t}function He(e){function t(){z.every((function(e){return null!==e.chartWidget.model()}))&&(ze(),_.emit("layout_changed"))}function i(){t()}function s(e){var t=e.state();return t.chartId=We(Fe),t.shouldBeSavedEvenIfHidden=!1,t}function r(e){e.hiddenInLayout.setValue(!0);var t=e.container.value();t.parentNode&&t.parentNode.removeChild(t),e.fullscreen.setValue(!1)}e in n||(e="s"),Se(),ye();var o,a=K,l=n[e].count;_.emit("layout_about_to_be_changed",e),K=e,Y=n[e];for(var c=l;c<z.length;c++){Be(h=z[c])&&h.rdState.bridge().attach()}a!==e&&he&&(he=null),he&&W.setValue(he.chartWidget);for(c=0;c<l||c<z.length;c++){var h=z[c];if(he?he===h:c<l&&(!h||!Be(h))){if(h){if(me.appendChild(h.container.value()),h.hiddenInLayout.setValue(!1),$){var u=Z.shift();u&&(X=!0,h.chartWidget.loadContent(u.content,Q),X=!1)}}else o=c,Re(Object.assign({},ue,Z.shift()||(W.value()?{content:s(W.value())}:null)||{},0===o||ee.value()?{}:{defSymbol:null})).modelCreated().subscribe(null,i,!0),h=z[c];h.container.value().classList.toggle("multiple",l>1),h.fullscreen.setValue(he===h)}else h&&r(h)}De(),ze(),function(){for(var e=Y.count,t=e,i=0;i<e;i++)z[i]&&Be(z[i])&&t--;q.setValue(t),G.setValue(t>1)}(),t(),z.forEach((function(e){e.chartWidget.onZoom().subscribe(this,(function(e){ve.fire(e)}))})),z.forEach((function(e){e.chartWidget.onScroll().subscribe(this,(function(){be.fire()}))})),q.value()<1&&l>0&&z[l-1].rdState.bridge().attach()}function ze(){var e=Math.min(Y.count,z.length)-1;if(e<0)W.deleteValue();else{
|
||
var t=U;t<0&&(t=0),t>e&&(t=e),W.setValue(z[t].chartWidget)}}function Ue(){for(var e=z.length;e--;){var t=e===U;z[e].container.value().classList.toggle("active",t),z[e].container.value().classList.toggle("inactive",!t)}}function Ge(e){}le.subscribe(De),ce.subscribe(De),this.updateLayout=De;var qe=new t,Ye=new v,Ke=new v,Je=null;function Ze(e){var t=e.mainSeries().properties();t.style.subscribe(null,Xe),Xe(t.style),e.model().onSelectedSourceChanged().subscribe(null,$e),$e(e.selection().allSources())}function Xe(e){Ye.setValue(e.value())}function $e(){var e=Je.model();Ke.setValue(e.selection().allSources())}function Qe(e){for(var t=!1,i=0;i<z.length;i++){var s=z[i].chartWidget,r=s.model();r&&(r.mainSeries().properties().symbol.value()!==e&&(t||(_e.beginUndoMacro("Change Symbol"),t=!0),s.setSymbol(e)))}t&&_e.endUndoMacro()}W.subscribe((function(e){if(e){for(var t,i=z.length;i--;)if(z[i].chartWidget===e){t=i;break}if(!isFinite(t))throw new Error("Cannot make detached ChartWidget active");if(U!==t){he&&(Be(z[t])||(he=z[t])),U=t,Ue();for(i=z.length;i--;)z[i].chartWidget!==e&&z[i].chartWidget.setActive(!1);ht(),e.setActive(!0)}!function(e){if(Je!==e){if(Je){Je.modelCreated().unsubscribe(null,Ze);var t=Je.model();if(t)t.mainSeries().properties().style.unsubscribe(null,Xe),t.model().onSelectedSourceChanged().unsubscribe(null,$e),Je=null}if(e){Je=e;var i=e.model();i?Ze(i):e.modelCreated().subscribe(null,Ze)}}}(e)}}),{callWithLast:!0});var et=!1,tt=!1;function it(e){var t=Math.max(1,window.devicePixelRatio||1);if(e&&e.onlyActiveChart||he)return{layout:"s",hidpiRatio:t,theme:x().name,charts:[W.value().images()]};for(var i=[],s=Y.count,r={showCollapsedLegend:(e=e||{}).showCollapsedLegend,status:e.status},n=0;n<z.length&&n<s;n++)i.push(z[n].chartWidget.images(r));return{layout:K,hidpiRatio:t,theme:x().name,charts:i}}function st(){var e={snapshotUrl:B.snapshotUrl},t=f.enabled("show_dialog_on_snapshot_ready")?m.getImageOfChart:m.getImageOfChartSilently;return new Promise((function(i){t(A,e,(function(e){_.emit("onScreenshotReady",e),i(e)}))}))}function rt(e){if(0!==z.length){for(var t=z.length;t--;)z[t].chartWidget.setActive(!1);z[U].chartWidget.setActive(e)}}H||(re.add({desc:"Switch active chart",hotkey:9,handler:function(){}}),re.add({desc:"Switch active chart",hotkey:p.Modifiers.Shift+9,handler:function(){}})),B.takeScreenshotEnabled&&re.add({desc:"Screenshot",hotkey:p.Modifiers.Alt+83,handler:st}),B.saveChartEnabled&&re.add({desc:"Save Chart Layout",hotkey:p.Modifiers.Mod+83,handler:function(){qe.fire()}});var nt=new Map,ot=new Map;const at=new D({copyRequested:(e,t)=>{W.value().model().clipboardCopy(e,t)},cutRequested:(e,t)=>{W.value().model().clipboardCut(e,t)},pasteRequested:(e,t)=>{(t?t.model().undoModel():W.value().model()).clipboardPaste(e,t)}});function lt(e){if(f.enabled("charting_library_base"))return e;if("s"===e||ue.containsData||H||(void 0)((void 0).MULTIPLE_CHARTS)&&(void 0)((void 0).MULTIPLE_CHARTS).limit>=n[e].count)return e;return"s"}function ct(e,t){if($=!0,Q=Boolean(t),Z=[],e){e.charts||(e={layout:"s",charts:[e]
|
||
});var i=new Set;e.charts.forEach((function(e){e.chartId&&i.add(e.chartId)})),e.charts.forEach((function(e){if(!e.chartId){var t=We((function(e){return i.has(e)}));i.add(t),e.chartId=t}})),K=lt(e.layout||"s");for(var s=0;s<e.charts.length;s++){var r=e.charts[s];Z.push({content:r})}e.symbolLock&&ee.setValue(!0),e.intervalLock&&te.setValue(!0),e.trackTimeLock&&ie.setValue(!0)}ae.setValue(K),He(K),u.init(),u.tool.subscribe(ut),u.tool.subscribe(ht),$=!1,Q=!1}function ht(){var e=W.value();z.forEach((function(t){t.chartWidget!==e&&t.chartWidget.updateCrossHairPositionIfNeeded()})),e&&e.updateCrossHairPositionIfNeeded()}function ut(){z.forEach((function(e){e.chartWidget.onToolChanged()}))}B.globalEvents&&at.listen(),Object.assign(this,{createChartWidget:Re,getAll:function(){return z.map((function(e){return e.chartWidget}))},destroy:function(){rt(!1),null!==xe&&(xe(),xe=null),Se(),ye(),z.forEach((function(e){void 0!==e.timingsMeter&&e.timingsMeter.destroy(),e.chartWidget.destroy()})),B.resizerBridge.remove(),window.removeEventListener("resize",De),u.tool.unsubscribe(ht),u.tool.unsubscribe(ut),fe.resolve(),me.remove(),nt.clear(),ot.clear(),re.destroy(),at&&at.destroy()},layout:ae,activeChartWidget:W,viewMode:J,activeChartStyle:Ye.readonly(),setChartStyleToWidget:function(e,t){t||(t=W.value()),t&&function(e,t){var i=e.model(),s=i.mainSeries().properties().style;i.setChartStyleProperty(s,t,"Change Series Style")}(t,e)},selectedSources:Ke.readonly(),metaInfo:pe,state:function(e,t,i,s){for(var r=[],n=Oe(),o=0;o<n;o++){var a=Ee(o,e,t,i,s);a&&r.push(a)}var l={name:A.metaInfo.name.value(),layout:K,charts:r};return ee.value()&&(l.symbolLock=1),te.value()&&(l.intervalLock=1),ie.value()&&(l.trackTimeLock=1),l},lineToolsAndGroupsDTOs:function(){for(var e=new Map,t=0;t<z.length;t++){var i=z[t].chartWidget;if(i){var s=i.id(),r=i.lineToolsAndGroupsDTO();e.set(s,r)}}return e},resetLineToolsInvalidated:function(e,t){for(var i=0;i<z.length;i++){var s=z[i].chartWidget;if(s){var r=s.id(),n=t.get(r);s.resetLineToolsInvalidated(e,n)}}},asyncState:function(){for(var e,t=[],i=Oe(),s=0;s<i;s++)t.push((e=s)<z.length?z[e].chartWidget.asyncState():Promise.resolve({}));return Promise.all(t).then((function(e){for(var t={charts:[]},i=0;i<e.length;i++)t.charts.push(e[i]);return t}))},readOnly:function(){return H},onZoom:function(){return ve},onScroll:function(){return be},lock:{symbol:ee,setSymbolLockWithUndo:function(e){if(e!==ee.value()){if(_e.beginUndoMacro("Symbol Lock"),e)for(var t=W.value(),i=t.getSymbol(),s=0;s<z.length;s++){var r=z[s].chartWidget;r!==t&&(r.getSymbol()!==i&&r.setSymbol(i))}_e.setWatchedValue(ee,e,"Symbol Lock"),_e.endUndoMacro()}},interval:te,setIntervalLockWithUndo:function(e){if(e!==te.value()){if(_e.beginUndoMacro("Interval Lock"),e)for(var t=W.value(),i=t.getResolution(),s=0;s<z.length;s++){var r=z[s].chartWidget;r!==t&&(r.getResolution()!==i&&r.setResolution(i))}_e.setWatchedValue(te,e,"Resolution Lock"),_e.endUndoMacro()}},crosshair:se,trackTime:ie,setTrackTimeWithUndo:function(e){
|
||
ie.value()!==e&&_e.setWatchedValue(ie,e,"Track Time")}},setSymbol:function(e){ee.value()?Qe(e):W.value().setSymbol(e)},setResolution:function(e){X||tt||et||function(e){if(O(e),et=!0,te.value()){for(var t=!1,i=0;i<z.length;i++){var s=z[i].chartWidget;s.model().mainSeries().properties().interval.value()!==e&&(t||(_e.beginUndoMacro("Change Resolution"),t=!0),s.setResolution(e))}t&&_e.endUndoMacro()}else W.value().setResolution(e);et=!1}(e)},setTimeFrame:function(e){if(!X&&!tt){if(tt=!0,te.value())for(var t=0;t<z.length;t++){var i,s=z[t].chartWidget;null!==(i=s.model().model().appliedTimeFrame().value())&&M(i,e)||s.loadRange(e)}else null!==(i=W.value().model().model().appliedTimeFrame().value())&&M(i,e)||W.value().loadRange(e);tt=!1}},updateLayout:De,setChartLayoutWithUndo:function(e){return e=lt(e),ae.value()!==e&&(_e.pushUndoCommand(new g(A,e)),!0)},images:it,clientSnapshot:function(e){const t={hideResolution:e&&e.hideResolution},i=e&&e.hideResolution;return L(it({showCollapsedLegend:!0,status:t,hideResolution:i}),e)},tags:function(){for(var e=[],t=0;t<z.length&&t<Y.count;t++)e=e.concat(z[t].chartWidget.tags());return e=(e=Array.from(new Set(e))).map((function(e){return e.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}))},syncCrosshair:function(e,t,i,s){if(i||oe)for(var r=Y.count,n=0;n<z.length&&n<r;n++){var o=z[n].chartWidget;if(o!==t&&z[n].rdState.bridge().visible.value()){var a=o.model();a&&a.model().setExternalPosition(e,s)}}},syncScroll:function(e,t){if(ie.value()){var i=Y.count;_e.beginUndoMacro("Sync Time");for(var s=0;s<z.length&&s<i;s++){var r=z[s].chartWidget.model();if(r){var n=r.model();if(n===t)continue;n.syncTimeWithModel(t,e)}}_e.endUndoMacro()}},setSymbolAll:Qe,clearChartMetaInfo:function(){pe.id.setValue(null),pe.uid.setValue(void 0),pe.name.setValue(void 0)},takeScreenshot:st,loadContent:ct,purgeUnusedWidgets:function(){for(var e=n[K].count;e<z.length;e++)z[e].chartWidget.destroy();z.splice(n[K].count)},applyOverrides:function(e){for(var t=0;t<z.length;t++)z[t].chartWidget.applyOverrides(e)},applyStudiesOverrides:function(e){for(var t=0;t<z.length;t++)z[t].chartWidget.applyStudiesOverrides(e)},switchChart:Ge,startFullscreen:function(){B.resizerBridge.requestFullscreen()},exitFullscreen:function(){B.resizerBridge.exitFullscreen()},destroyPromise:function(){return fe.promise()},chartWidgetCreated:function(){return ge},saveKeysPressed:function(){return qe},getContainer:function(){return me},onWidget:ue.onWidget,applyTheme:function(e,t,i,s,r,n,o){void 0===n&&(n=!0);var a=x().name,l=t?[{chartWidget:W.value()}]:z;o?(r&&new P(a,s,n).redo(),l.forEach((function(t){t.chartWidget._model.model().restoreTheme(e,i,o)}))):(_e.beginUndoMacro("Apply Chart Theme"),r&&_e.pushUndoCommand(new P(a,s,n)),l.forEach((function(t){t.chartWidget._model.model().restoreTheme(e,i)})),_e.endUndoMacro())},applyIndicatorsToAllCharts:function(e){E(Ie(),e)},applyIndicatorsToAllChartsAvailable:function(){return!H&&Ae()>1},applyIndicatorToAllCharts:function(e,t,i,s){k(Ie(),e,t,i,s)},setActive:rt,
|
||
inlineChartsCount:q.readonly(),revertToInline:function(){je(null);for(var e=0;e<z.length;e++)z[e].rdState.bridge().attach()},chartMarketStatuses:function(){return z.map((function(e){return"-"}))},chartSeriesStatuses:function(){return z.map((function(e){var t=e.chartWidget.model(),i=t?t.mainSeries().status():null;return(null===i?"":T.SERIES_STATUS_TEXT[i])+" ("+i+")"}))},undoHistory:_e,toggleAddCompareDialog:function(){if(null!==Te)return Te.isOpened()?(Te.hide(),Promise.resolve(null)):Promise.resolve(Te.show());var e=this;return Promise.all([i.e("dialogs-core"),i.e(60),i.e(83),i.e(0),i.e(32),i.e("create-dialog"),i.e("add-compare-dialog")]).then(i.bind(null,"GhZA")).then((function(t){return null===Te&&(Te=new t.AddCompareDialog(e)),Te.isOpened()?null:Te.show()}))},applyPreferencesToAllCharts:function(e){},getToasts:ke,addCustomSource:function(e,t,i){s(!nt.has(e),"Cannot create the same custom source multiple times"),nt.set(e,{factory:t,layer:i});for(var r=0;r<z.length;++r){var n=z[r].chartWidget.model();n&&n.model().addCustomSource(e,t,i)}},removeCustomSource:function(e){s(nt.has(e),"Cannot remove not created custom source"),nt.delete(e);for(var t=0;t<z.length;++t){var i=z[t].chartWidget.model();i&&i.model().removeCustomSource(e)}},addCustomWidgetToLegend:function(e,t){s(!ot.has(e),"Cannot create the same custom widget in legend multiple times"),ot.set(e,t);for(var i=0;i<z.length;++i)z[i].chartWidget.addCustomWidgetToLegend(e,t)},setViewMode:function(e){J.setValue(e)},moveActiveChartWithUndo:function(e){},activeChartCanBeMoved:function(){return!1},generalPropertiesDefinitions:function(){return W.value().generalPropertiesDefinitions()},reconnectChartApi:function(e){(void 0)(e)},setBroker:function(e){0},setSaveChartService:function(e){ne=e;for(var t=0;t<z.length;++t){z[t].chartWidget.setSaveChartService(e)}},getCompareDialogRenderer:function(){return null},getChartPropertiesDialogRenderer:function(){return Me},clipboard:at}),ct(B.content,!0),ae.subscribe((function(e){Ue(),He(e)})),ae.hook=function(e){return e===this.value()?e:lt(e)},H&&(ae.writeLock=!0),window.addEventListener("resize",De);var dt=0;function pt(){0===--dt&&_.emitOnce("onChartReady")}if(z.forEach((function(e){if(e){dt++;var t=e.chartWidget;t.withModel(null,(function(){B.metaInfo&&t.model().model().setChartSaveTime(1e3*B.metaInfo.lastModified);var e=t.model().mainSeries();if(e.bars().size()>0||e.status()===T.STATUS_INVALID_SYMBOL||e.status()===T.STATUS_NO_BARS)pt();else{var i=e.dataEvents(),s=function(){pt(),i.barReceived().unsubscribe(null,s),i.completed().unsubscribe(null,s),i.error().unsubscribe(null,s)};i.barReceived().subscribe(null,s),i.completed().subscribe(null,s),i.error().subscribe(null,s)}}))}})),a()){var _t=u.tool.setValue;u.tool.setValue=function(){A.selectedSources.value()&&A.activeChartWidget.value().model().lineBeingCreated()&&A.activeChartWidget.value().model().cancelCreatingLine(),_t.apply(u.tool,arguments)}}Promise.all(z.map((function(e){return S(e.chartWidget.modelCreated()).promise}))).then((function(){
|
||
return Promise.all(z.map((function(e){return S(e.chartWidget.model().mainSeries().dataEvents().symbolResolved()).promise})))})).then((function(){window.saver&&window.is_authenticated&&B.widgetOptions.justCloned&&window.saver.saveChartSilently()})).catch(C.logError.bind(C))}}).call(this,i("aIyQ"))},"/YGI":function(e,t,i){"use strict";i.r(t);var s,r=i("0YCj"),n=i.n(r);!function(e){e.StudyCannotBeChild="cannot_be_child",e.StubWasRemoved="stub_was_removed",e.CannotGetMetainfo="cannot_get_metainfo",e.Cancelled="cancelled",e.Unknown="unknown"}(s||(s={}));var o=i("txPx");i.d(t,"StudyInserter",(function(){return l}));const a=Object(o.getLogger)("Chart.Studies.StudyInserter");class l{constructor(e,t,i){this._parentSource=void 0,this._propsState=void 0,this._preferredPriceScale=void 0,this._allowChangeCurrency=!1,this._allowChangeUnit=!1,this._paneSize=void 0,this._forceOverlay=!1,this._studyMetaInfoRepository=t,this._inserterImpl=i,this._studyDescriptor=e}setParentSource(e){this._parentSource=e||void 0}setPaneSize(e){this._paneSize=e}setPreferredPriceScale(e){this._preferredPriceScale=e}setAllowChangeCurrency(e){this._allowChangeCurrency=e}setAllowChangeUnit(e){this._allowChangeUnit=e}setForceOverlay(e){this._forceOverlay=e}setPropertiesState(e){this._propsState=e}setTargetPriceScaleMode(e){this._targetPriceScaleMode=e}async insert(e,t){const i=void 0!==(r=this._inserterImpl).createStub&&void 0!==r.removeStub?this._inserterImpl.createStub():null;var r;let n,o=!0;try{n=await this._studyMetaInfoRepository.findById(this._studyDescriptor)}catch(u){return a.logWarn("Cannot get study "+JSON.stringify(this._studyDescriptor)),Promise.reject(s.CannotGetMetainfo)}finally{null!==i&&(o=this._inserterImpl.removeStub(i))}if(!o)return Promise.reject(s.StubWasRemoved);if(void 0!==t&&t.cancelled)return Promise.reject(s.Cancelled);if(!this._canApplyStudyToParent(n))return Promise.reject(s.StudyCannotBeChild);const l=Object.assign({},n.defaults.inputs),c=void 0!==e?await e(l,n.inputs,n):{};if(void 0!==t&&t.cancelled)return Promise.reject(s.Cancelled);const h=this._insertStudy(n,c);return null===h?Promise.reject(s.Unknown):h}_insertStudy(e,t){return this._inserterImpl.createStudy(e,t,null,this._propsState,this._forceOverlay,this._parentSource,this._preferredPriceScale,this._allowChangeCurrency,this._allowChangeUnit,this._paneSize,this._targetPriceScaleMode)}_canApplyStudyToParent(e){return void 0===this._parentSource||n.a.canBeChild(e)}}},"/bs+":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));var s=i("E6p6");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}},
|
||
"/hKg":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCandles",(function(){return l}));var s=i("Eyy1"),r=i("VdBB"),n=i("gAom"),o=i("Zp/P"),a=i("ExCE");class l extends a.a{constructor(e){super(),this._barSpacing=1,this._barWidth=1,this._borderVisible=!1,this._barBorderWidth=1,this._wickVisible=!1,this._bodyVisible=!0,this._borderColor=void 0,this._wickColor=void 0,this._hittest=void 0,e&&this.setData(e)}setData(e){this._bars=e.bars,this._barSpacing=e.barSpacing,this._borderVisible=e.borderVisible,this._bodyVisible=e.bodyVisible,this._wickVisible=e.wickVisible,this._borderColor=e.borderColor,this._wickColor=e.wickColor,this._hittest=e.hittest}hitTest(e){return this._wickVisible||this._borderVisible||this._bodyVisible?super.hitTest(e):null}draw(e,t){if(0===this._bars.length)return;const i=t.pixelRatio;if(this._barWidth=Object(o.optimalCandlestickWidth)(this._barSpacing,i),this._barWidth>=2){Math.floor(i)%2!=this._barWidth%2&&this._barWidth--}this._wickVisible&&this._drawWicks(e,i),this._borderVisible&&this._drawBorder(e,i),this._bodyVisible&&this._drawCandles(e,i)}_getTolerance(){return Object(o.interactionTolerance)().series+this._barBorderWidth/2}_getBarSpacing(){return this._barSpacing}_getHitTest(){return this._hittest||new r.HitTestResult(r.HitTestResult.REGULAR)}_isPointAtBar(e,t,i){const s=this._bodyVisible||this._borderVisible,r=this._wickVisible;if(!s&&!r)return!1;if(s){const s=r?Math.min(e.high,e.low):Math.min(e.open,e.close),n=r?Math.max(e.high,e.low):Math.max(e.open,e.close);return s-i<=t&&t<=n+i}{const s=Math.min(e.open,e.close),r=Math.max(e.open,e.close);return e.high-i<=t&&t<=s+i||r-i<=t&&t<=e.low+i}}_drawWicks(e,t){const i=this._bars;let r="",n=Math.min(Math.floor(t),Math.floor(this._barSpacing*t));n=Math.max(Math.floor(t),Math.min(n,this._barWidth));const o=Math.floor(.5*n);let a=null;for(const l of i){const i=l.wickColor?l.wickColor:Object(s.ensureDefined)(this._wickColor);i!==r&&(e.fillStyle=i,r=i);const c=Math.round(Math.min(l.open,l.close)*t),h=Math.round(Math.max(l.open,l.close)*t),u=Math.round(l.high*t),d=Math.round(l.low*t);let p=Math.round(t*l.time)-o;const _=p+n-1;null!==a&&(p=Math.max(a+1,p),p=Math.min(p,_));const m=_-p+1;e.fillRect(p,u,m,c-u),e.fillRect(p,h+1,m,d-h),a=_}}_calculateBorderWidth(e){let t=Math.floor(1*e);this._barWidth<=2*t&&(t=Math.floor(.5*(this._barWidth-1)));const i=Math.max(Math.floor(e),t);return this._barWidth<=2*i?Math.max(Math.floor(e),Math.floor(1*e)):i}_drawBorder(e,t){let i="";const r=this._calculateBorderWidth(t);let o=null;for(const a of this._bars){if(a.borderColor!==i&&(e.fillStyle=a.borderColor?a.borderColor:Object(s.ensureDefined)(this._borderColor),i=a.borderColor),this._bodyVisible&&a.hollow)continue;let l=Math.round(a.time*t)-Math.floor(.5*this._barWidth);const c=l+this._barWidth-1,h=Math.round(Math.min(a.open,a.close)*t),u=Math.round(Math.max(a.open,a.close)*t);if(null!==o&&(l=Math.max(o+1,l),l=Math.min(l,c)),this._barSpacing*t>2*r)Object(n.fillRectInnerBorder)(e,l,h,c-l+1,u-h+1,r);else{const t=c-l+1;e.fillRect(l,h,t,u-h+1)}o=c}}_drawCandles(e,t){
|
||
let i="";const s=this._calculateBorderWidth(t);for(const r of this._bars){if(this._borderVisible&&this._barWidth<=2*s&&!r.hollow)continue;let o=Math.round(Math.min(r.open,r.close)*t),a=Math.round(Math.max(r.open,r.close)*t),l=Math.round(r.time*t)-Math.floor(.5*this._barWidth),c=l+this._barWidth-1;if(r.color!==i){const t=r.color;e.fillStyle=t,i=t}if(r.hollow)e.fillStyle=r.color,Object(n.fillRectInnerBorder)(e,l,o,c-l+1,a-o+1,s);else{if(this._borderVisible&&(l+=s,o+=s,c-=s,a-=s),o>a)continue;e.fillRect(l,o,c-l+1,a-o+1)}}}}},"/kal":function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" transform="translate(4 5)"><path fill="currentColor" d="M3 1h1v13.5H3z"/><circle stroke="currentColor" cx="3.5" cy="16.5" r="2"/><path fill="currentColor" d="M5.5 16H18v1H5.5z"/><path stroke="currentColor" d="M0 4L3.5.5 7 4m8 9l3.5 3.5L15 20"/></g></svg>'},"/tGj":function(e,t,i){"use strict";function s(e){return e.symbolSource()===e}i.r(t),i.d(t,"isSymbolSource",(function(){return s}))},"/z0S":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Kxc7");function r(e,t){s.enabled("saveload_requires_authentication")?window.runOrSignIn(e,t):e()}},"08i5":function(e,t,i){"use strict";var s,r;i.r(t),i.d(t,"AlertStatus",(function(){return s})),i.d(t,"Direction",(function(){return r})),function(e){e[e.Waiting=0]="Waiting",e[e.Success=1]="Success",e[e.Failure=2]="Failure"}(s||(s={})),function(e){e[e.Up=1]="Up",e[e.Down=2]="Down"}(r||(r={}))},"0F0w":function(e,t,i){"use strict";i.r(t);var s=i("aIyQ"),r=i.n(s),n=i("Eyy1"),o=i("hY0g"),a=i.n(o),l=i("e3/o"),c=i("txPx");const h=Object(c.getLogger)("ChartApi.AbstractSession");var u=i("ogJP");i.d(t,"ChartSession",(function(){return d}));Object(c.getLogger)("ChartSession");class d extends class{constructor(e,t,i){this._isConnected=new a.a(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId="",this._sessionIdChanged=new r.a,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}destroy(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")}isConnected(){return this._isConnected}sessionId(){return this._sessionId}onSessionIdChanged(){return this._sessionIdChanged}connect(){0===this._state&&(Object(n.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(`${this._sessionPrefix}_${Object(l.randomHash)()}`),this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))}disconnect(){0!==this._state&&(Object(n.assert)(""!==this._sessionId,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile(()=>{this._chartApi.connected()&&this._sendRemoveSession(),this._processDestroyingOnServer()}))}onMessage(e){switch(e.method){case"connected":return void this._onChartApiConnected()
|
||
;case"disconnected":return void this._onChartApiDisconnected();case"critical_error":const t=String(e.params[0]),i=String(e.params[1]);return void this._onCriticalError(t,i)}this._onMessage(e)}_getChartApi(){return this._chartApi}_generateLogMessage(e){return`[${this._sessionId}] ${e}`}_onCriticalError(e,t){this._logError(`Critical error. Reason=${e}, info=${t}.`),this._forbidConnectWhile(()=>{this._processDestroyingOnServer()}),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")}_onChartApiConnected(){Object(n.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)}_onChartApiDisconnected(){this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile(()=>{this._processDestroyingOnServer()}),this.connect()}_setSessionId(e){const t=this._sessionId;this._logNormal(`Changing sessionId: old=${t}, new=${e}`),this._sessionId=e,this._sessionIdChanged.fire(e,t)}_logNormal(e){h.logNormal(this._generateLogMessage(e))}_logError(e){h.logError(this._generateLogMessage(e))}_processDestroyingOnServer(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId("")}_forbidConnectWhile(e){this._isConnectForbidden=!0,e(),this._isConnectForbidden=!1}}{constructor(e,t=!1){super(e,"cs",!1),this._sessionDisabled=!1,this._handler=null,this._criticalError=new r.a,this._disableStatistics=t}destroy(){this._criticalError.destroy(),this._handler=null,super.destroy()}serverTimeOffset(){return this._getChartApi().serverTimeOffset()}switchTimezone(e){return this._getChartApi().switchTimezone(this.sessionId(),e)}defaultResolutions(){return this._getChartApi().defaultResolutions()}availableCurrencies(){return this._getChartApi().availableCurrencies()}availableUnits(){return this._getChartApi().availableUnits()}resolveSymbol(e,t,i){return this._getChartApi().resolveSymbol(this.sessionId(),e,t,i)}requestFirstBarTime(e,t,i){return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)}createSeries(e,t,i,s,r,n,o){return this._getChartApi().createSeries(this.sessionId(),e,t,i,s,r,n,o)}modifySeries(e,t,i,s,r,n){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,s,r,n)}removeSeries(e,t){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e,t)}requestMoreData(e,t,i){return"number"==typeof e?this._getChartApi().requestMoreData(this.sessionId(),e):this._getChartApi().requestMoreData(this.sessionId(),e,t,i)}requestMoreTickmarks(e,t,i){return Object(u.isNumber)(e)?this._getChartApi().requestMoreTickmarks(this.sessionId(),e):this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)}requestMetadata(e,t){(()=>{this._getChartApi().requestMetadata(this.sessionId(),e,t)})()}isCanCreateStudy(e){return this._getChartApi().isCanCreateStudy(e)}createStudy(e,t,i,s,r,n,o){
|
||
return this._getChartApi().createStudy(this.sessionId(),e,t,i,s,r,n,o)}rebindStudy(e,t,i,s,r,n,o){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,s,r,n,o)}modifyStudy(e,t,i,s){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,s)}removeStudy(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)}createPointset(e,t,i,s,r,n){return this._getChartApi().createPointset(this.sessionId(),e,t,i,s,r,n)}modifyPointset(e,t,i,s){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,s)}removePointset(e){return this._getChartApi().removePointset(this.sessionId(),e)}setVisibleTimeRange(e,t,i,s,r){this._getChartApi().setVisibleTimeRange(this.sessionId(),e,t,i,s,r)}criticalError(){return this._criticalError}connect(e=null){null!==e&&(this._handler=e),super.connect()}setHandler(e){this._handler=e}connected(){return this.isConnected().value()&&!this._sessionDisabled}disable(){this._sessionDisabled=!0}chartApi(){return this._getChartApi()}_sendCreateSession(){Object.keys(this).forEach(e=>{/^(s|st|symbol_)\d+$/.test(e)&&delete this[e]}),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)}_sendRemoveSession(){this._getChartApi().chartDeleteSession(this.sessionId())}_onMessage(e){this._handler&&this._handler(e)}_onCriticalError(e,t){this._criticalError.fire(e,t),super._onCriticalError(e,t)}}},"0Pxc":function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("GEp6").distanceToLine,n=i("hfHJ"),o=n.rotationMatrix,a=n.scalingMatrix,l=n.translationMatrix,c=n.transformPoint,h=i("Ss5c").LineDataSource,u=i("Ocx9").DefaultProperty,d=i("j3hX").LineToolColorsProperty;class p extends h{constructor(e,t){super(e,t||p.createProperties()),this.version=p.version,i.e("lt-pane-views").then(i.t.bind(null,"dKqZ",7)).then(({ArcPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){var i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0];this._dist=r(i,n,o).distance;var a=n.subtract(i),l=new s(-a.y,a.x),c=i.add(n).scaled(.5);o.subtract(c).dotProduct(l)<0&&(this._dist=-this._dist)}}pointsCount(){return 3}name(){return"Arc"}hasEditableCoordinates(){return!1}setPoint(e,t){var i=Object.assign({},t),n=this.pointToScreenPoint(this._points[0])[0],h=this.pointToScreenPoint(this._points[1])[0],u=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:n=this.pointToScreenPoint(i)[0];var d=h.subtract(n),p=n.add(h).scaled(.5);m=(m=new s(-d.y,d.x)).normalized(),u=p.add(m.scaled(this._dist)),u=this.screenPointToPoint(u),this._points[0]=i,this._points[2]=u;break;case 1:var _=r(n,h,u).distance;d=(h=this.pointToScreenPoint(i)[0]).subtract(n),p=n.add(h).scaled(.5);m=(m=new s(-d.y,d.x)).normalized(),u=p.add(m.scaled(this._dist)),u=this.screenPointToPoint(u),this._points[1]=i,this._points[2]=u;break;case 2:i=this.pointToScreenPoint(i)[0];var m;_=r(n,h,i).distance,d=h.subtract(n),p=n.add(h).scaled(.5);m=(m=new s(-d.y,d.x)).normalized(),
|
||
u=p.add(m.scaled(_));var f=p.add(m.scaled(-_)),g=d.length(),v=d.x/g,b=d.y/g,S=Math.acos(v);b<0&&(S=-S);var y=l(-p.x,-p.y);i=c(y,i);var w=c(y,u);y=o(-S),i=c(y,i),w=c(y,w),y=a(1,g/(2*_)),i=c(y,i),w=c(y,w);var C=i.y*w.y>=0?new s(u.x,u.y):new s(f.x,f.y);C=this.screenPointToPoint(C),this._points[2]=C}this.normalizePoints()}migrateVersion(e,t,i){if(1===e&&2===this._points.length){var s=(2*this._points[0].price+3*this._points[1].price)/5;this._points.append({price:s,index:this._points[1].index})}if(1===e&&2===this._timePoint.length){var r={price:s=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t};this._timePoint.append(r)}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Zd1D"))).GeneralFiguresDefinitionsViewModel}static createProperties(e){var t=new u("linetoolarc",e);return p._configureProperties(t),t}static _configureProperties(e){h._configureProperties(e),e.addChild("linesColors",new d([e.color]))}}p.version=2,t.LineToolArc=p},"0YCj":function(e,t,i){"use strict";(function(e,t){i("Eyy1").assert;var s=i("txPx").getLogger("Chart.Study.MetaInfo"),r=i("9iCb").applyOverridesToStudyDefaults,n=null;function o(e){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,e);var t=e.fullId||e.id;TradingView.merge(this,o.parseIdString(t)),this.name=this.id}o.VERSION_STUDY_ARG_SOURCE=41,o.METAINFO_FORMAT_VERSION_SOS_V2=42,o.VERSION_PINE_PROTECT_TV_4164=43,o.CURRENT_METAINFO_FORMAT_VERSION=52,o.VERSION_NEW_STUDY_PRECISION_FORMAT=46,o.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],o.canPlotBeSourceOfChildStudy=function(e){return o.CHILD_STUDY_ALLOWED_PLOT_TYPES.includes(e)},o.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies","Correlation - Log@tv-basicstudies-1"],o.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],o.FilledArea={},o.FilledArea.TYPE_PLOTS="plot_plot",o.FilledArea.TYPE_HLINES="hline_hline",o.versionOf=function(e){var t="_metainfoVersion"in e&&isNumber(e._metainfoVersion)?e._metainfoVersion:0;return t<0&&s.logError("Metainfo format version cannot be negative: "+t),t},o.parseIdString=function(e){var t={};if(-1===e.indexOf("@"))t.shortId=e,t.packageId="tv-basicstudies",t.id=e+"@"+t.packageId,t.version=1;else{var i=e.split("@");t.shortId=i[0];var s=i[1].split("-");if(3===s.length)t.packageId=s.slice(0,2).join("-"),t.id=t.shortId+"@"+t.packageId,t.version=s[2];else if(1===s.length&&"decisionbar"===s[0])t.packageId="les-"+s[0],t.id=t.shortId+"@"+t.packageId,t.version=1;else{if(1!==s.length)throw new Error("unexpected study id:"+e);t.packageId="tv-"+s[0],t.id=t.shortId+"@"+t.packageId,t.version=1}}if(t.fullId=t.id+"-"+t.version,"tv-scripting"===t.packageId){var r=t.shortId;if(0===r.indexOf("Script$")||0===r.indexOf("StrategyScript$")){var n=r.indexOf("_");t.productId=n>=0?r.substring(0,n):t.packageId}else t.productId=t.packageId}else t.productId=t.packageId;return t},o.getPackageName=function(e){
|
||
return(/^[^@]+@([^-]+-[^-]+)/.exec(e||"")||[0,"tv-basicstudies"])[1]},o.cutDollarHash=function(e){var t=e.indexOf("$"),i=e.indexOf("@");return-1===t?e:e.substr(0,t)+(i>=0?e.substr(i):"")},o.hasUserIdSuffix=function(e){return/^USER;[\d\w]+;\d+$/.test(e)},o.isStandardPine=function(e){return/^(Strategy)?Script\$STD;.*@tv-scripting$/.test(e)},o.getSourceIdByInputs=function(e,t){if(!Array.isArray(e)||!t)return null;for(var i=0;i<e.length;++i){var s=e[i];if(o.isSourceInput(s)&&"string"==typeof t[s.id]){var r=t[s.id];return~r.indexOf("$")&&(r=r.split("$")[0]),r}}return null},o.getSourceInputIds=function(e){for(var t=[],i=e.inputs,s=0;s<i.length;++s){var r=i[s];o.isSourceInput(r)&&t.push(r.id)}return t},o.setChildStudyMetaInfoPropertiesSourceId=function(t,i,s){for(var r=0;r<t.inputs.length;++r){var n=t.inputs[r];if(o.isSourceInput(n)&&(s instanceof e&&s.inputs&&s.inputs[n.id])){var a=s.inputs[n.id].value();if(a.indexOf("$")>0){var l=a.replace(/^[^\$]+/,i);s.inputs[n.id].setValue(l)}}}},o.patchChildStudyMetaInfoState=function(e){e.state&&function e(t){if("object"==typeof t)for(var i in t)"string"==typeof t[i]&&/^[^\$]+\$\d+$/.test(t[i])?t[i]=t[i].replace(/^[^\$]+/,"{pid}"):e(t[i])}(e.state.inputs),e.state.isChildStudy=!0},o.prototype.parseValue=function(e,t){return"bool"===e?TradingView.parseBool(t):t},o.prototype.defaultInputs=function(){for(var e=[],t=0;t<this.inputs.length;t++)e.push(this.inputs[t].defval);return e},o.prototype.state=function(e){var t={};for(var i in this)this.hasOwnProperty(i)&&(t[i]=this[i],!0!==e&&"id"===i&&(t[i]+="-"+this.version));return t},o.prototype.symbolInputId=function(){var e=this.inputs.filter((function(e){return"symbol"===e.type}));return e.length>0?e[0].id:null},o.prototype.createDefaults=function(){if(this.defaults){var e=TradingView.clone(this.defaults);e.precision="default";var t=o.getStudyPropertyRootName(this);defaults.create(t,e)}},o.prototype.removeDefaults=function(){defaults.remove(o.getStudyPropertyRootName(this))},o.findStudyMetaInfoByDescription=function(e,t){if(e){for(var i=0;i<e.length;++i)if(e[i].description.toLowerCase()===t.toLowerCase())return e[i];throw new Error("unexpected study id:"+t)}throw new Error("There is no studies metainfo")},o.isParentSourceId=function(e){return"string"==typeof e&&/^[^\$]+\$\d+$/.test(e)},o.isSourceInput=function(e){return e.id&&(("source"===e.id||"src"===e.id)&&("text"===e.type||"source"===e.type)||"source"===e.type)},o.getChildSourceInputTitles=function(e,t,i){var s={};if(t.plots&&t.plots.length&&e.options&&e.options.length)for(var r,n,a,l=0;l<e.options.length;++l)n=(r=e.options[l])&&+r.split("$")[1],(a=isFinite(n)&&t.plots[n])&&~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type)&&(s[r]=t.styles&&t.styles[a.id]&&t.styles[a.id].title||a.id,i&&(s[r]=i+": "+s[r]));return s};var a=new Map([["AnchoredVWAP@tv-basicstudies","linetoolanchoredvwap"],["RegressionTrend@tv-basicstudies","linetoolregressiontrend"]]);o.getStudyPropertyRootName=function(e){var t=a.get(e.id);if(void 0!==t)return t;var i="study_"+e.id
|
||
;return e.pine&&e.pine.version&&(i+="_"+e.pine.version.replace(".","_")),i},o.getStudyPropertyRootNameById=function(e){var t=a.get(e);return void 0!==t?t:"study_"+e},o.overrideDefaults=function(e){null!==n&&0!==e.length&&r(n,e,(function(e){return TradingView.defaultProperties[o.getStudyPropertyRootName(e)]||null}))},o.setDefaultsOverrides=function(e){n=e},o.isScriptStrategy=function(e){if(e.extra&&e.extra.kind)return e.extra.kind===TVScript.Kinds.STRATEGY;if(!0===e.isTVScriptStrategy)return!0;var t=e.TVScriptSourceCode||e.scriptSource;return!!t&&TVScript.isStrategy(t)},o.getOrderedInputIds=function(e){for(var t=[],i=e.inputs,s=0;s<i.length;++s){var r=i[s];t.push(r.id)}return t},o.canBeChild=function(e){if(e&&"string"==typeof e)return!0;if(!e||e.extra&&!o.isAllowedSourceInputsCount(e.extra.sourceInputsCount)||!0===e.canNotBeChild||!1===e.canBeChild||~o.CHILD_STUDY_EXCLUDE_IDS.indexOf(e.id))return!1;for(var t=e.inputs,i=0,s=0;s<t.length;++s)o.isSourceInput(t[s])&&++i;return o.isAllowedSourceInputsCount(i)},o.isAllowedSourceInputsCount=function(e){return 1===e},o.canHaveChildren=function(e){if(e){if(e.isTVScriptStrategy||e.TVScriptSourceCode&&TVScript.isStrategy(e.TVScriptSourceCode))return!1;if(e.id&&!~o.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(e.id)&&Array.isArray(e.plots))for(var t=0;t<e.plots.length;++t)if(~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(e.plots[t].type))return!0}return!1},TradingView.StudyMetaInfo=o,t&&t.exports&&(t.exports=o)}).call(this,i("tc+8"),i("YuTi")(e))},"0psP":function(e,t,i){"use strict";i.r(t),i.d(t,"GeneralChartPropertiesRenderer",(function(){return r}));var s=i("sQaR");class r extends s.a{constructor(e){super(),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)},this._chartWidgetCollection=e}show(){const e=this._chartWidgetCollection,t=e.activeChartWidget.value();return t.generalPropertiesDefinitions().then(s=>Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(15),i.e(16),i.e(19),i.e(20),i.e(21),i.e(23),i.e(28),i.e(30),i.e(31),i.e(34),i.e(39),i.e(46),i.e(53),i.e(70),i.e(90),i.e(0),i.e(5),i.e(4),i.e(10),i.e(12),i.e(17),i.e(29),i.e(25),i.e(26),i.e(27),i.e(33),i.e(36),i.e(51),i.e("general-chart-properties-dialog")]).then(i.bind(null,"PI1I")).then(i=>{var r,n;const o=new i.GeneralChartPropertiesDialogRenderer({chartWidgetCollection:e,propertyPages:s,activePageId:this._activePageId,model:t.model()});return null===(r=this._dialog)||void 0===r||r.hide(),null===(n=this._dialog)||void 0===n||n.visible().unsubscribe(this._subscribe),this._dialog=o,o.visible().subscribe(this._subscribe),o.show(),this._activePageId=void 0,o}))}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}isVisible(){return this.visible().value()}focusOnText(){}setActivePage(e){this._activePageId=e}}},"0qMc":function(e,t,i){"use strict";i.r(t),i.d(t,"lineToolsLocalizedNames",(function(){return r}));i("YFKU");var s=i("+GxX");const r={LineTool5PointsPattern:window.t("XABCD Pattern"),LineToolABCD:window.t("ABCD Pattern"),LineToolArc:window.t("Arc"),
|
||
LineToolArrow:window.t("Arrow"),LineToolArrowMarkDown:window.t("Arrow Mark Down"),LineToolArrowMarkLeft:window.t("Arrow Mark Left"),LineToolArrowMarkRight:window.t("Arrow Mark Right"),LineToolArrowMarkUp:window.t("Arrow Mark Up"),LineToolBalloon:window.t("Balloon"),LineToolBarsPattern:window.t("Bars Pattern"),LineToolBezierCubic:window.t("Double Curve"),LineToolBezierQuadro:window.t("Curve"),LineToolBrush:window.t("Brush"),LineToolCallout:window.t("Callout"),LineToolCircleLines:window.t("Cyclic Lines"),LineToolCypherPattern:window.t("Cypher Pattern"),LineToolDateAndPriceRange:window.t("Date and Price Range"),LineToolDateRange:window.t("Date Range"),LineToolDisjointAngle:window.t("Disjoint Channel"),LineToolElliottCorrection:window.t("Elliott Correction Wave (ABC)"),LineToolElliottDoubleCombo:window.t("Elliott Double Combo Wave (WXY)"),LineToolElliottImpulse:window.t("Elliott Impulse Wave (12345)"),LineToolElliottTriangle:window.t("Elliott Triangle Wave (ABCDE)"),LineToolElliottTripleCombo:window.t("Elliott Triple Combo Wave (WXYXZ)"),LineToolEllipse:window.t("Ellipse"),LineToolExtended:window.t("Extended Line"),LineToolFibChannel:window.t("Fib Channel"),LineToolFibCircles:window.t("Fib Circles"),LineToolFibRetracement:window.t("Fib Retracement"),LineToolFibSpeedResistanceArcs:window.t("Fib Speed Resistance Arcs"),LineToolFibSpeedResistanceFan:window.t("Fib Speed Resistance Fan"),LineToolFibSpiral:window.t("Fib Spiral"),LineToolFibTimeZone:window.t("Fib Time Zone"),LineToolFibWedge:window.t("Fib Wedge"),LineToolFlagMark:window.t("Flag Mark"),LineToolImage:window.t("Image"),LineToolFlatBottom:window.t("Flat Top/Bottom"),LineToolAnchoredVWAP:window.t("Anchored VWAP"),LineToolGannComplex:window.t("Gann Square"),LineToolGannFixed:window.t("Gann Square Fixed"),LineToolGannFan:window.t("Gann Fan"),LineToolGannSquare:window.t("Gann Box"),LineToolHeadAndShoulders:window.t("Head and Shoulders"),LineToolHorzLine:window.t("Horizontal Line"),LineToolHorzRay:window.t("Horizontal Ray"),LineToolIcon:window.t("Icon"),LineToolInsidePitchfork:window.t("Inside Pitchfork"),LineToolNote:window.t("Note"),LineToolNoteAbsolute:window.t("Anchored Note"),LineToolSignpost:window.t("Signpost"),LineToolParallelChannel:window.t("Parallel Channel"),LineToolPitchfan:window.t("Pitchfan"),LineToolPitchfork:window.t("Pitchfork"),LineToolPolyline:window.t("Polyline"),LineToolPath:window.t("Path"),LineToolPrediction:window.t("Forecast"),LineToolPriceLabel:window.t("Price Label"),LineToolArrowMarker:window.t("Arrow Marker"),LineToolPriceRange:window.t("Price Range"),LineToolProjection:window.t("Projection"),LineToolRay:window.t("Ray"),LineToolRectangle:window.t("Rectangle"),LineToolRegressionTrend:window.t("Regression Trend"),LineToolRiskRewardLong:window.t("Long Position"),LineToolRiskRewardShort:window.t("Short Position"),LineToolFixedRangeVolumeProfile:window.t("Fixed Range Volume Profile"),LineToolRotatedRectangle:window.t("Rotated Rectangle"),LineToolSchiffPitchfork:window.t("Modified Schiff Pitchfork"),
|
||
LineToolSchiffPitchfork2:window.t("Schiff Pitchfork"),LineToolSineLine:window.t("Sine Line"),LineToolText:window.t("Text",{context:"tool"}),LineToolTextAbsolute:window.t("Anchored Text"),LineToolThreeDrivers:window.t("Three Drives Pattern"),LineToolTimeCycles:window.t("Time Cycles"),LineToolTrendAngle:window.t("Trend Angle"),LineToolTrendBasedFibExtension:window.t("Trend-Based Fib Extension"),LineToolTrendBasedFibTime:window.t("Trend-Based Fib Time"),LineToolTrendLine:window.t("Trend Line"),LineToolInfoLine:window.t("Info Line"),LineToolTriangle:window.t("Triangle"),LineToolTrianglePattern:window.t("Triangle Pattern"),LineToolVertLine:window.t("Vertical Line"),LineToolCrossLine:window.t("Cross Line"),LineToolHighlighter:window.t("Highlighter"),LineToolPriceNote:window.t("Price Note")};Object(s.isFeatureEnabled)("remove-line-tool-ghost-feed")||(r.LineToolGhostFeed=window.t("Ghost Feed"))},"1AAW":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("hY0g"),r=i.n(s);function n(e,...t){const i=(...t)=>e(...t.map(e=>e.value())),s=new r.a(i(...t)),n=()=>s.setValue(i(...t)),o=t.map(e=>e.spawn());for(const r of o)r.subscribe(n);return s.readonly().spawn(()=>o.forEach(e=>e.destroy()))}},"1IXQ":function(e,t,i){"use strict";i("jJ9X");var s=i("aO4+").Point,r=i("/3z9"),n=i("qFKp").CheckMobile,o=i("7KDR"),a=o.Action,l=o.Separator,c=i("H0vP").InvalidationLevel,h=i("ikwP"),u=h.getContext2D,d=h.hardResizeCanvas,p=h.clearRect,_=i("gAom").clearRectWithGradient,m=h.fillRect,f=i("S8xo").MouseEventHandler,g=i("YmeR").ActionBinder,v=i("T6Of").LimitedPrecisionNumericFormatter,b=i("HZKX").createLinesAction,S=i("EsvI").themes,y=i("3/8U").axesHighlightColor,w=i("xzdg").PriceAxisWidgetBase,C=i("Kxc7"),P=window.t("Merge All Scales Into One");class x extends w{constructor(e,t,i,s,r,n,o,a){super(e,t,i,r,n,s),this._axisInfo=o,this._backgroundBasedTheme=a,this._offset=0,this.restoreDefaultCursor(),this.update(),this._mouseEventHandler=new f(this._topCanvasBinding.canvas,this,{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0}),this.contextMenu=null,this.actions=null,this._highlighted=!1}destroy(){null!==this.actions&&this.actions.reset&&this.actions.reset.destroy(),this._mouseEventHandler.destroy(),super.destroy()}dataSourceAtPoint(e,t){var i=this._grouppedSources(),r=i.sources.concat(Array.from(i.topLevelSources)).concat(this._pane.state().customSources()),n=null,o=null;if(!this._priceScale)return null;function a(e,t){var i=o?o.result():0;e.result()>i&&(o=e,n=t)}for(var l=new s(e,t),c=this._pane.state(),h=r.length-1;h>=0;--h){var u=r[h],d=u.priceAxisViews(c,this._priceScale);if(d&&0!==d.length)for(var p=d.length-1;p>=0;--p){var _=d[p].renderer();if(null!==_&&void 0!==_.hitTest){var m=_.hitTest(l,this._size.w,this._isLeft?"left":"right");null!==m&&a(m,u)}}}return n}_initActions(e){if(this._pane.hasState()&&null===this.actions){this.actions={};var t=this,s=this._pane.chart().model();this.actions.reset=new a({label:window.t("Reset Price Scale"),icon:i("LdoW"),shortcut:"Alt+R",
|
||
shortcutHint:r.humanReadableHash(r.Modifiers.Alt+82),statName:"ResetScale",onExecute:x.prototype.reset.bind(this)}),this.actions.setAutoScale=new a({label:window.t("Auto (Fits Data To Screen)"),checkable:!0,checked:!0,statName:"ToggleAutoScale",onExecute:function(){s.togglePriceScaleAutoScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setPercentage=new a({label:window.t("Percent",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isPercentage(),statName:"TogglePercantage",onExecute:function(){s.togglePriceScalePercentageScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setIndexedTo100=new a({label:window.t("Indexed to 100",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isIndexedTo100(),statName:"ToggleIndexedTo100",onExecute:function(){s.togglePriceScaleIndexedTo100ScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setLog=new a({label:window.t("Logarithmic",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isLog(),statName:"ToggleLogScale",onExecute:function(){s.togglePriceScaleLogScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setRegular=new a({label:window.t("Regular",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isRegular(),statName:"ToggleRegularScale",onExecute:function(){s.setPriceScaleRegularScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.alignLabels=new a({label:window.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new g(this.actions.alignLabels,this.priceScale().properties().alignLabels,this._pane.chart().model(),"No Overlapping Labels"),this.actions.invertScale=new a({label:window.t("Invert Scale",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isInverted(),statName:"Invert Scale",onExecute:function(){s.invertPriceScale(t.priceScale()),t._updateScalesActions()}}),this._updateScalesActions()}}_logAction(){return this._isMainSeriesAxis()?this._pane.chart().actions().logSeriesScale:this.actions.setLog}_percentageAction(){return this._isMainSeriesAxis()?this._pane.chart().actions().percentSeriesScale:this.actions.setPercentage}_indexedTo100Action(){return this._isMainSeriesAxis()?this._pane.chart().actions().indexedTo100SeriesScale:this.actions.setIndexedTo100}_autoScaleAction(){return this._isMainSeriesAxis()?this._pane.chart().actions().autoSeriesScale:this.actions.setAutoScale}_regularScaleAction(){return this._isMainSeriesAxis()?this._pane.chart().actions().regularSeriesScale:this.actions.setRegular}_lockScaleAction(){var e=this._pane.chart().actions().lockSeriesScale,t=M(this.priceScale(),this._pane.chart().model().model().mainSeriesScaleRatio());return e.update({hint:t}),e}_invertAction(){return this._isMainSeriesAxis()?this._pane.chart().actions().invertSeriesScale:this.actions.invertScale}_isMainSeriesAxis(){return this.priceScale().hasMainSeries()}_updateMainSeriesScalesActions(){
|
||
this._isMainSeriesAxis()&&null!==this.actions&&this._updateScalesActions()}_updateScalesActions(){var e=this.priceScale(),t=this._isMainSeriesAxis(),i=e.mainSource().properties(),s=t&&e.isLockScale(),r=t&&i.style.value()===TradingView.Series.STYLE_PNF;this.actions.setRegular.update({checked:e.isRegular(),disabled:s||r}),this.actions.setPercentage.update({checked:e.isPercentage(),disabled:s||r}),this.actions.setIndexedTo100.update({checked:e.isIndexedTo100(),disabled:s||r}),this.actions.setLog.update({checked:e.isLog(),disabled:s||r}),this.actions.setAutoScale.update({checked:e.isAutoScale(),disabled:e.properties().autoScaleDisabled.value()})}_createMergeScalesAction(){var e=this._pane.chart().actions(),t=this._pane.chart().model().model().priceScaleSlotsCount();if(t.left+t.right===1)return 0===t.left?e.moveScaleToLeft:e.moveScaleToRight;var i=[];return i.push(e.mergeLeftScalesAction),i.push(e.mergeRightScalesAction),new a({label:P,subItems:i})}getContextMenuActions(){this._initActions();var e=this._pane.chart().actions(),t=[];if(t.push(this.actions.reset,new l,this._autoScaleAction()),this._isMainSeriesAxis()&&t.push(this._lockScaleAction()),t.push(e.scaleSeriesOnly,this._invertAction(),new l,this._regularScaleAction(),this._percentageAction(),this._indexedTo100Action(),this._logAction(),new l),n.any()||(t.push(this._createMergeScalesAction()),t.push(new l)),!C.enabled("fundamental_widget")){t.push(new a({label:window.t("Labels"),subItems:[e.showSymbolLabelsAction,e.showSeriesLastValue,null,null,e.showHighLowPriceLabels,e.showAverageClosePriceLabel,null,e.showStudyPlotNamesAction,e.showStudyLastValue,null,null,this.actions.alignLabels].filter(Boolean)}))}return t.push(b(this._pane.chart())),this._options.countdownEnabled&&t.push(e.showCountdown),this._options.currencyConversionEnabled&&t.push(e.showCurrency),this._options.unitConversionEnabled&&t.push(e.showUnit),this._pane.chart().model().crossHairSource().isMenuEnabled()&&t.push(e.addPlusButton),!TradingView.onWidget()&&C.enabled("show_chart_property_page")&&C.enabled("chart_property_page_scales")&&e.scalesProperties&&t.push(new l,e.scalesProperties),t}_sameSideSources(){var e=this._pane.state().sourcesByGroup();return this._isLeft?e.leftPriceScalesSources():e.rightPriceScalesSources()}_grouppedSources(){var e=this._pane,t=e.chart().model(),i=this._sameSideSources().slice(),s=e.state(),r=this.priceScale(),n=new Set,o=t.lineBeingEdited()||t.lineBeingCreated();if(o&&n.add(o),t.sourcesBeingMoved().forEach((function(e){n.add(e)})),t.selection().allSources().forEach((function(e){n.add(e)})),t.hoveredSource()&&n.add(t.hoveredSource()),r===s.defaultPriceScale())for(var a=this._pane.state().dataSources(),l=0;l<a.length;l++)s.isOverlay(a[l])&&i.push(a[l]);return{sources:i,topLevelSources:n}}backLabels(e){var t=[],i=this._grouppedSources(),s=function(s){for(var r=0;r<s.length;++r){var n=s[r];if(e||!i.topLevelSources.has(n)){var o=n.priceAxisViews(this._pane.state(),this.priceScale());if(o)for(var a=0;a<o.length;a++)t.push(o[a])}}}.bind(this);return s(i.sources),
|
||
s(this._pane.state().customSources()),t}setSizeAndOffset(e,t){if(e.w<0||e.h<0)throw new Error("Try to set invalid size to PriceAxisWidget "+JSON.stringify(e));this._size.equals(e)||(this._size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._topCanvasBinding.resizeCanvas({width:e.w,height:e.h}),this._cell.style.width=e.w+"px",this._cell.style.height=e.h+"px",this._cell.style.minWidth=e.w+"px"),this._offset!==t&&(this._offset=t,this._cell.style.left=t+"px")}getWidth(){return this._size.w}update(){}_hightlightBackground(e,t,i,s){if(i){for(var r=t[0].price,n=t[0].price,o=1;o<t.length;o++)r=Math.min(r,t[o].price),n=Math.max(n,t[o].price);var a=i.firstValue(),l=Math.floor(this.priceScale().priceToCoordinate(r,a)*s),c=Math.ceil(this.priceScale().priceToCoordinate(n,a)*s),h=this._backgroundBasedTheme.value(),u=y(h);m(e,Math.floor(s),l,Math.ceil((this._size.w-1)*s)+1,c-l,u)}}drawBackground(e,t){var i=Math.ceil(this._size.w*t),s=Math.ceil(this._size.h*t);const r=this.backgroundTopColor(),n=this.backgroundColor();if(r===n?p(e,0,0,i+1,s+1,this.backgroundColor()):_(e,0,0,i+1,s+1,r,n),this._highlighted){e.globalAlpha=.5;var o=S[this._backgroundBasedTheme.value()].getThemedColor("color-price-axis-highlight");m(e,0,0,i+1,s+1,o),e.globalAlpha=1}var a=this._pane.chart().model(),l=this.priceScale(),c=a.model().selection().lineDataSources().filter((function(e){return e.priceScale()===l})).reduce((function(e,t){var i=t.priceAxisPoints();return 0===i.length?e:e.concat(i)}),[]);c.length>0&&this._hightlightBackground(e,c,this.priceScale().mainSource(),t);var h=a.model().crossHairSource();h.startMeasurePoint()&&this._hightlightBackground(e,h.measurePoints(),this.priceScale().mainSource(),t)}drawBorder(e,t){e.save(),e.fillStyle=this.lineColor();var i,s=Math.max(1,Math.floor(this.rendererOptions().borderSize*t));i=this._isLeft?Math.floor(this._size.w*t)-s:0,e.fillRect(i,0,s,Math.ceil(this._size.h*t)+1),e.restore()}drawBackLabels(e,t){e.save();for(var i=this.backLabels(),s=this.rendererOptions(),r=this._isLeft?"right":"left",n=0;n<i.length;n++){var o=i[n];o.isAxisLabelVisible()&&(e.save(),o.renderer().draw(e,s,this._widthCache,this._size.w,r,t),e.restore())}e.restore()}_minMaxViews(e){var t=this._pane.state(),i=this.priceScale(),s=[],r={value:null,view:null},n={value:null,view:null};return e.forEach((function(e){var s=e.priceAxisViews(t,i);if(s&&s.length)for(var o=0;o<s.length;o++){var a=s[o],l=a.coordinate();(null===r.value||r.value<=l)&&(r={value:l,view:a}),(null===n.value||n.value>=l)&&(n={value:l,view:a})}})),r.view&&s.push(r.view),n.view&&s.push(n.view),s}_isFromSameSide(e){return(this._isLeft?this._pane.state().leftPriceScales():this._pane.state().rightPriceScales()).includes(e)}_addViewsOrMaxMin(e,t){var i=this._pane.state(),s=this.priceScale();if(s!==i.defaultPriceScale()&&(e=e.filter(function(e){return i.isOverlay(e)||this._isFromSameSide(e.priceScale())}.bind(this))),0!==e.length)if(1===e.length){var r=e[0].priceAxisViews(i,s);r&&r.length&&t.push(r)}else t.push(this._minMaxViews(e))}drawCrossHairLabel(e,t){e.save()
|
||
;var i=this._pane.chart().model().model(),s=this._pane.state(),r=this.priceScale(),n=[],o=this._pane.state(),a=this.priceScale()===s.defaultPriceScale(),l=i.lineBeingEdited()||i.lineBeingCreated();l&&(l.priceScale()===r||a&&s.isOverlay(l))&&((h=l.priceAxisViews(o,r))&&h.length&&n.push(h));this._addViewsOrMaxMin(i.sourcesBeingMoved(),n),this._addViewsOrMaxMin(i.selection().allSources(),n);var c=i.hoveredSource();if(c){var h,u=s.customSources().includes(c)?r:c.priceScale();if(!i.selection().isSelected(c)&&(this._isFromSameSide(u)||a&&s.isOverlay(c)))(h=i.hoveredSource().priceAxisViews(o,r))&&h.length&&n.push(h)}(h=i.crossHairSource().priceAxisViews(o,r))&&h.length&&n.push(h);var d=this.rendererOptions(),p=this._isLeft?"right":"left";n.forEach((function(i){i.forEach((function(i){e.save(),i.renderer().draw(e,d,this._widthCache,this._size.w,p,t),e.restore()}),this)}),this),e.restore()}hardResetCanvas(){null!==this._size&&(d(this._canvasBinding,this._size),d(this._topCanvasBinding,this._size))}_isMainPane(){return this._pane.state().containsMainSeries()}paint(e){if(this._isVisible&&e!==c.None){if(e>c.Cursor){var t=u(this._canvasBinding.canvas);this._alignLabels(),this.drawBackground(t,this._canvasBinding.pixelRatio),this.drawBorder(t,this._canvasBinding.pixelRatio),this._pane.hasState()&&(this._updateCurrencyLabel(),this._drawTickMarks(t,this._canvasBinding.pixelRatio),this.drawBackLabels(t,this._canvasBinding.pixelRatio))}if(this._pane.hasState()){var i=u(this._topCanvasBinding.canvas),s=this._topCanvasBinding.pixelRatio;i.clearRect(0,0,Math.ceil(this._size.w*s)+1,Math.ceil(this._size.h*s)+1),this.drawCrossHairLabel(i,s)}}}restoreDefaultCursor(){this.setCursor("")}setCursor(e){var t="";"grabbing"!==e&&"ns-resize"!==e||(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t,this._cell.style.cursor)}axisInfo(){return this._axisInfo}setHighlighted(e){this._highlighted!==e&&(this._highlighted=e)}}function T(e){var t=new v(e);return function(e,i){return isNumber(i)&&!e.isLog()?t.format(i):""}}var M=T(4);e.exports={PriceAxisWidget:x,scaleRatioForContextMenuTransformer:T}},"1Ky4":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyPlotBarsPaneView",(function(){return a}));var s=i("Zy3/"),r=i("vq8G"),n=i("29fS"),o=i("ehkz");class a extends o.a{renderer(){if(!this._study.properties().ohlcPlots[this._plotName].visible.value())return null;this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:this._model.timeScale().barSpacing(),dontDrawOpen:this._series.properties().barStyle.dontDrawOpen.value(),thinBars:this._series.properties().barStyle.thinBars.value()},t=new s.CompositeRenderer;return t.append(new n.PaneRendererBars(e)),this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&this._selectionData&&t.append(new r.SelectionRenderer(this._selectionData)),t}}},"1Wlv":function(e,t,i){"use strict";(function(e){
|
||
var s=i("Yj6H").PriceScaleBase,r=i("7ktv").PriceDataSource,n=i("kcTO").PriceFormatter,o=i("GH0z").PercentageFormatter,a=i("Qb4w").PriceRange,l=i("e3/o").randomHash,c=i("3ClC").isStudy,h=i("lTLF").PriceTickMarkBuilder,u=i("TTFo"),d=u.fromPercent,p=u.toPercent,_=u.fromIndexedTo100,m=u.toIndexedTo100,f=u.fromLog,g=u.toLog,v=new o,b=new n(100,1);class S extends s{constructor(t,i){super(i),this._scalesProperties=t,this.m_scrollStartPoint=null;var s=this;this._modeChanged=new e,this._properties.isInverted.listeners().subscribe(this,S.prototype._onIsInvertedChanged),this._properties.listeners().subscribe(null,(function(){if(s.mainSource()&&s.mainSource().model()){var e=s.mainSource().model().paneForSource(s.mainSource());s.mainSource().model().updatePane(e)}})),this._scalesProperties.listeners().subscribe(this,(function(){this._marksCache=null})),this.setId(l())}id(){return this._id}setId(e){this._id=e}_convertPriceRangeFromLog(e){if(null===e)return null;var t=f(e.minValue()),i=f(e.maxValue());return new a(t,i)}_convertPriceRangeToLog(e){if(null===e)return null;var t=g(e.minValue()),i=g(e.maxValue());return new a(t,i)}_canConvertPriceRangeFromLog(e){if(null===e)return!1;var t=f(e.minValue()),i=f(e.maxValue());return isFinite(t)&&isFinite(i)}mode(){return{autoScale:this._properties.autoScale.value(),lockScale:this._properties.lockScale.value(),percentage:this._properties.percentage.value(),indexedTo100:this._properties.indexedTo100.value(),log:this._properties.log.value()}}setMode(e){var t={},i=this.mode(),s=this._properties.state(),r=null;void 0!==e.autoScale&&e.autoScale!==s.autoScale&&(t.autoScale=e.autoScale,this._setAutoScaleValueWithDependentProperties(e.autoScale)),void 0!==e.lockScale&&e.lockScale!==s.lockScale&&(t.lockScale=e.lockScale,this._setLockScaleValueWithDependentProperties(e.lockScale)),void 0!==e.percentage&&e.percentage!==s.percentage&&(t.percentage=e.percentage,this._setPercentageValueWithDependentProperties(e.percentage),this._invalidatedForRange.isValid=!1),void 0!==e.indexedTo100&&e.indexedTo100!==s.indexedTo100&&(t.indexedTo100=e.indexedTo100,this._setIndexedTo100ValueWithDependentProperties(e.indexedTo100),this._invalidatedForRange.isValid=!1),void 0!==e.log&&e.log!==s.log&&(t.log=e.log,this._setLogValueWithDependentProperties(e.log)),s.log&&!this._properties.log.value()&&(this._canConvertPriceRangeFromLog(this.m_priceRange)?null!==(r=this._convertPriceRangeFromLog(this.m_priceRange))&&this.setPriceRange(r):this.properties().autoScale.setValue(!0)),!s.log&&this._properties.log.value()&&null!==(r=this._convertPriceRangeToLog(this.m_priceRange))&&this.setPriceRange(r),s.autoScale!==this._properties.autoScale.value()&&this._properties.autoScale.listeners().fire(this._properties.autoScale),s.autoScaleDisabled!==this._properties.autoScaleDisabled.value()&&this._properties.autoScaleDisabled.listeners().fire(this._properties.autoScaleDisabled),s.lockScale!==this._properties.lockScale.value()&&this._properties.lockScale.listeners().fire(this._properties.lockScale),
|
||
s.percentage!==this._properties.percentage.value()&&(this._properties.percentage.listeners().fire(this._properties.percentage),this.updateFormatter()),s.indexedTo100!==this._properties.indexedTo100.value()&&(this._properties.indexedTo100.listeners().fire(this._properties.indexedTo100),this.updateFormatter()),s.percentageDisabled!==this._properties.percentageDisabled.value()&&this._properties.percentageDisabled.listeners().fire(this._properties.percentageDisabled),s.log!==this._properties.log.value()&&this._properties.log.listeners().fire(this._properties.log),s.logDisabled!==this._properties.logDisabled.value()&&this._properties.logDisabled.listeners().fire(this._properties.logDisabled),void 0===t.log&&void 0===t.percentage&&void 0===t.lockScale&&void 0===t.autoScale&&void 0===t.indexedTo100||this._modeChanged.fire(i,this.mode())}modeChanged(){return this._modeChanged}fontSize(){return this._scalesProperties.fontSize.value()}isEmpty(){return this._makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()}priceToCoordinate(e,t){return this.isPercentage()?e=p(e,t):this.isIndexedTo100()&&(e=m(e,t)),this._logicalToCoordinate(e,t)}pointsArrayToCoordinates(e,t){this._makeSureItIsValid();var i=this.bottomPixelMargin(),s=this.priceRange().minValue(),r=this.priceRange().maxValue(),n=this.internalHeight()-1,o=this.isInverted(),a=n/(r-s);if(this.isPercentage())for(var l=0;l<e.length;l++)e[l].y=p(e[l].y,t);if(this.isIndexedTo100())for(l=0;l<e.length;l++)e[l].y=m(e[l].y,t);if(this.isLog())for(l=0;l<e.length;l++)e[l].y=this.priceToLogical(e[l].y);for(l=0;l<e.length;l++){var c=e[l].y;if(!TradingView.isNaN(c)&&null!=c){var h=i+a*(c-s),u=o?h:this.m_height-1-h;e[l].y=u}}}barPricesToCoordinates(e,t){this._makeSureItIsValid();var i=e,s=this.bottomPixelMargin(),r=this.priceRange().minValue(),n=this.priceRange().maxValue(),o=this.internalHeight()-1,a=null;if(this.isPercentage()?a=p:this.isIndexedTo100()?a=m:this.isLog()&&(a=function(e){return e?g(e):e}),null!==a)for(var l=0;l<i.length;l++)i[l]&&(i[l].open=a(i[l].open,t),i[l].high=a(i[l].high,t),i[l].low=a(i[l].low,t),i[l].close=a(i[l].close,t),void 0!==i[l].additionalPrice&&(i[l].additionalPrice=a(i[l].additionalPrice,t)));var c=o/(n-r),h=this.isInverted();for(l=0;l<i.length;l++){var u=i[l];if(u){var d=s+c*(u.open-r),_=h?d:this.m_height-1-d;u.open=_;d=s+c*(u.high-r);var f=h?d:this.m_height-1-d;u.high=f;d=s+c*(u.low-r);var v=h?d:this.m_height-1-d;u.low=v;d=s+c*(u.close-r);var b=h?d:this.m_height-1-d;if(u.close=b,void 0!==u.additionalPrice){d=s+c*(u.additionalPrice-r);var S=h?d:this.m_height-1-d;u.additionalPrice=S}}}}coordinateToPrice(e,t){var i=this._coordinateToLogical(e,t);return this.isPercentage()?i=d(i,t):this.isIndexedTo100()&&(i=_(i,t)),i}startScroll(e){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this._priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=e,this._priceRangeSnapshot=this.priceRange().clone()))}scrollTo(e){if(!this.isAutoScale()&&null!==this.m_scrollStartPoint){
|
||
var t=this.priceRange().length()/(this.internalHeight()-1),i=e-this.m_scrollStartPoint;this.isInverted()&&(i*=-1);var s=i*t,r=this._priceRangeSnapshot.clone();r.shift(s),this.setPriceRange(r,!0),this._marksCache=null}}endScroll(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this._priceRangeSnapshot=null)}state(){var e={};return e.id=this._id,e.m_priceRange=!this.priceRange()||this.isPercentage()||this.isIndexedTo100()?null:this.priceRange().serialize(),e.m_isAutoScale=this.isAutoScale(),e.m_isPercentage=this._properties.percentage.value(),e.m_isIndexedTo100=this._properties.indexedTo100.value(),e.m_isLog=this._properties.log.value(),e.m_isLockScale=this.isLockScale(),e.m_isInverted=this.isInverted(),e.m_height=this.m_height,e.m_topMargin=this._margins.top,e.m_bottomMargin=this._margins.bottom,e.alignLabels=this._properties.alignLabels.value(),e}restoreState(e){var t=e.m_priceRange;if(void 0===t)throw new TypeError("invalid state");if(void 0===e.m_isAutoScale)throw new TypeError("invalid state");void 0!==e.id&&(this._id=e.id);var i={autoScale:e.m_isAutoScale};void 0!==e.m_isPercentage&&(i.percentage=e.m_isPercentage),void 0!==e.m_isIndexedTo100&&(i.indexedTo100=e.m_isIndexedTo100),void 0!==e.m_isLog&&(i.log=e.m_isLog),void 0!==e.m_isLockScale&&(i.lockScale=e.m_isLockScale),void 0!==e.m_isInverted&&this._properties.isInverted.setValue(e.m_isInverted),void 0!==e.m_height&&this.setHeight(Math.max(0,e.m_height)),this.setMode(i),t?(t instanceof a||(t=new a(t)),this.setPriceRange(t,!0)):this.m_priceRange=null,void 0!==e.m_topMargin&&(this._margins.top=e.m_topMargin),void 0!==e.m_bottomMargin&&(this._margins.bottom=e.m_bottomMargin),void 0!==e.alignLabels&&this._properties.alignLabels.setValue(e.alignLabels),this._mainSource=null,this._scaleSeriesOnly=!1}formatter(){return this._formatter||this.updateFormatter(),this._formatter}formatPrice(e,t){return this.isPercentage()?e=p(e,t):this.isIndexedTo100()&&(e=m(e,t)),this.formatter().format(e)}formatPriceAbsolute(e){return this._mainSourceFormatter().format(e)}formatPricePercentage(e,t){return e=p(e,t),v.format(e)}updateFormatter(){this._marksCache=null;var e=this.mainSource(),t=100;e&&(t=e.base()),this._formatter=null,this.isPercentage()?(this._formatter=v,t=100):this.isIndexedTo100()?(this._formatter=new n(100,1),t=100):this._formatter=e?e.formatter():b,this._markBuilder=new h(this,t,this._coordinateToLogical.bind(this),this._logicalToCoordinate.bind(this)),this._markBuilder.rebuildTickMarks()}_onIsInvertedChanged(){this._marksCache=null,this._markBuilder.rebuildTickMarks()}_mainSourceFormatter(){return this.mainSource().formatter()||b}canDetachSource(e){return this.m_dataSources.some((function(t){return t!==e&&t instanceof r&&!(c(t)&&t.isLinkedToSeries())}))}}t.PriceScale=S}).call(this,i("aIyQ"))},"1pHB":function(e,t){
|
||
e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" transform="translate(4 5)"><circle stroke="currentColor" cx="9.5" cy="9.5" r="9"/><path stroke="currentColor" d="M7 14.5h2.5v-5H7"/><path stroke="currentColor" stroke-linecap="square" d="M9.5 14.5h2"/><path fill="currentColor" d="M9.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"/></g></svg>'},"2+aH":function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aO4+"),n=i("fgLi"),o=i("hY0g"),a=i.n(o),l=i("HGP3"),c=i("KcY8");class h extends c.a{constructor(e,t,i){super(),this._source=e,this._priceScale=t,this._priceProvider=i}setHitTestData(e){this._hitTestData=e}additionalPadding(e){return 0}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._priceScale.mainSource(),r=null!==s?s.firstValue():null;if(!this._isVisible()||this._priceScale.isEmpty()||null===r)return;const n=this._priceProvider(this._priceScale);if(null===n)return;i.background=this._bgColor(),i.textColor=this.generateTextColor(i.background);const o=this.additionalPadding(this._priceScale.fontSize());i.additionalPaddingTop=o,i.additionalPaddingBottom=o,i.coordinate=this._priceScale.priceToCoordinate(n,r),e.text=this._priceScale.formatPrice(n,r),e.visible=!0,t.visible=!0,t.hitTestData=this._hitTestData}}const u={normalBgColor:l.a["color-cold-gray-750"],hoveredBgColor:l.a["color-cold-gray-600"]},d={normalBgColor:l.a["color-cold-gray-900"],hoveredBgColor:l.a["color-cold-gray-650"]};class p extends h{additionalPadding(e){return 2/12*e}_isVisible(){return this._source.visible&&null!==this._source.pane}_bgColor(){return this._getThemedColors().normalBgColor}_updateRendererData(e,t,i){const s=t.visible;super._updateRendererData(e,t,i),this._source.isHovered()?t.backgroung=this._getThemedColors().hoveredBgColor:t.backgroung=void 0,s||(t.visible=s)}_getThemedColors(){return this._source.model().isDark()?u:d}}class _ extends h{_isVisible(){return null!==this._source.measurePane()}_bgColor(){return this._source.model().isDark()?"#1E88E5":"#2196F3"}}var m=i("mMWL"),f=(i("YFKU"),i("FQhm")),g=i("KtbP"),v=i("JWMC"),b=(i("7KDR"),i("5VQP")),S=(i("Kxc7"),i("/tGj"));function y(e){const t=e.priceScale();return null===t?0:t.isPercentage()||t.isIndexedTo100()?2:1}class w extends g.PanePriceAxisView{constructor(e,t,i,s,r){super(e,t,s),this._crossHairMenuCachedState=null,this._hasActions=!1,this._tooltipText=null,this._gaOrigin="CH menu",this._crosshairPriceAxisView=e,e.setPaneRendererLabelIcon(0),this._crosshair=t,this._scale=i,this._options=r}_updateImpl(e,t){super._updateImpl(e,t);const i=this._crosshair.y,s=this._chartModel.properties().scalesProperties.fontSize.value(),r=this._chartModel.timeScale().width(),n=this._crosshair.model().priceAxisRendererOptions(),o=s+2*this._crosshairPriceAxisView.additionalPadding(s)+n.paddingTop+n.paddingBottom,a=o,l=i-o/2,c=r-a,h=this._crosshair.pane,u=this._mainDataSourceOnPane(),d=u&&u.symbolSource(),p=!!d&&(d.isConvertedToOtherCurrency()||d.isConvertedToOtherUnit());if(null!==u){
|
||
const e=y(u),t=u.idForAlert(),i=this._crossHairMenuCachedState;null!==i&&i.id===t&&i.priceScale===e&&i.isCurrencyOrUnitConverted===p||(this._updateTooltipAndActionsAvaliability(u,e,p),this._crossHairMenuCachedState={id:t,priceScale:e,isCurrencyOrUnitConverted:p})}const _=null!==u&&Object(S.isSymbolSource)(u)?u.symbol():null,m=Boolean(_)||!1;this._crosshairPriceAxisView.setPaneLabelVisible(m);const f=null!==h&&0!==h.leftPriceScales().length&&m,g=null!==h&&0!==h.rightPriceScales().length&&m,v=r-a/2,b=this._tooltipText?{text:this._tooltipText,rect:{x:v,y:l,w:0,h:0}}:void 0;this._data={left:f,right:g,xl:0,xr:c,y:l,containerWidth:a,containerHeight:o,clickHandler:this._handleClick.bind(this),tooltip:b},this._crosshairPriceAxisView.setHitTestData(this._data)}_priceScale(){return this._scale}_updateTooltipAndActionsAvaliability(e,t,i){this._tooltipText=null,this._hasActions=!1;if(!(1===t))return;const s=!i&&!1;let r=0;s&&r++;let n=0;1===r&&(s?(n=1,this._tooltipText=window.t("Add Alert")):this._tooltipText=window.t("Add Horizontal Line")),this._crosshairPriceAxisView.setPaneRendererLabelIcon(n),this._hasActions=0!==r}_handleClick(e,t,i){Object(v.trackEvent)(this._gaOrigin,"click");const s=this._mainDataSourceOnPane(),r=null!==s&&Object(S.isSymbolSource)(s)?s.symbol():null,n={pageX:i.pageX,pageY:i.pageY,clientX:i.clientX,clientY:i.clientY,screenX:i.screenX,screenY:i.screenY,price:this._crosshair.price,symbol:r};f.emit("onPlusClick",n)}_getMenuItems(e){return Promise.resolve([])}_createAlertMenuItems(e){return Promise.resolve([])}_createTradingMenuItems(){return Promise.resolve([])}_createAddHorizontalLineMenuItem(){return[]}_getActionAddAlert(e){return null}_getActionAddHorizontalLine(e){return null}_getValue(e,t){const i=e.priceScale(),s=e.firstValue();if(null===i||null===s)return null;return i.isPercentage()||i.isIndexedTo100()?null:i.coordinateToPrice(t,s)}_formatValue(e,t){return t.formatter().format(e)}_addAlert(e,t){}_addHorizontalLineTool(e,t){}_showContextMenu(e,t,i,r){const n="left"===r;setTimeout(()=>{b.ContextMenuManager.createMenu(e).then(e=>{e.show((e,t)=>{const r=Object(s.ensureDefined)(this._data),o=Object(s.ensureNotNull)(i.view).innerHeight,a=n?r.xl:r.xr,l=i.localX-a,c={left:i.clientX-l,right:i.clientX-l+r.containerWidth,top:i.clientY-r.containerHeight/2,bottom:i.clientY+r.containerHeight/2};return{clientX:n?c.left:c.right-e,clientY:o<c.bottom+t?c.top-t:c.bottom}})})})}_mainDataSourceOnPane(){const e=this._crosshair.pane;return null!==e?e.mainDataSource():null}}var C=i("Tmoa"),P=i("8Uy/"),x=i("VaSN"),T=i("jFln"),M=i("VdBB"),I=i("gAom");class L{constructor(e){this._data=e}hitTest(e){return void 0===this._data.clickHandler?null:new M.HitTestResult(M.HitTestResult.CUSTOM,{clickHandler:this._data.clickHandler,tapHandler:this._data.clickHandler})}draw(e,t){const i=t.pixelRatio,s=this._data.vertLinesVisible,r=this._data.horzLinesVisible;if(!s&&!r)return;e.save(),e.lineWidth=Math.max(1,Math.floor(this._data.lineWidth*i)),e.strokeStyle=this._data.color,e.fillStyle=this._data.color,e.lineCap="butt",
|
||
Object(T.setLineStyle)(e,this._data.lineStyle);const n=Math.round(this._data.x*i),o=Math.round(this._data.y*i),a=Math.ceil(this._data.w*i),l=Math.ceil(this._data.h*i);s&&n>=0&&Object(I.drawVerticalLine)(e,n,0,l),r&&o>=0&&Object(I.drawHorizontalLine)(e,o,0,a),this._data.drawCenter&&(e.beginPath(),e.arc(n,o,Math.round(3*i),0,2*Math.PI,!0),e.fillStyle=this._data.color,e.fill()),e.restore()}}var O=i("CW80");class A{constructor(e,t,i){this._rendererData={},this._renderer=new L(this._rendererData),this._source=e,this._pane=t,this._horzVisible=i}update(){}renderer(e,t){const i=this._source.visible&&this._source.areLinesVisible&&!this._source.linesShouldBeHidden(),s=Object(m.lockTimeAxis)().value(),r=this._rendererData;if(!i||null===this._pane)return null;r.horzLinesVisible=i&&this._horzVisible,r.vertLinesVisible=i||s;const n=this._source.model(),o=this._source.properties(),a=this._source.selectBarMode().value()&&this._source.isOnHoveredChartWidget(),l=n.currentTool(),c=Object(x.lastEventIsTouch)()&&(Object(O.isLineToolName)(l)||Object(m.toolIsMeasure)(l))&&!a;let h;h=c?n.isDark()?"#1E88E5":"#2196F3":o.childs().color.value();const u=o.childs().transparency.value();return!c&&u>0&&(h=Object(C.generateColor)(h,u)),r.color=h,r.lineWidth=o.childs().width.value(),r.lineStyle=o.childs().style.value(),r.drawCenter=c&&this._pane===this._source.pane,r.w=this._pane.width(),r.h=this._pane.height(),r.x=void 0!==this._source.lockedX&&isFinite(this._source.lockedX)&&this._source.lockedX||this._source.x,r.y=this._source.y,a&&(r.vertLinesVisible=!0,r.lineStyle=P.LINESTYLE_SOLID,r.lineWidth=2,r.color="#ff0000"),this._renderer}}var E=i("IjC5");class k{constructor(e){this._renderer=new E.RectangleRenderer,this._rectangle=null,this._crosshair=e}update(){const e=this._crosshair.selection();null!==e&&null!==this._crosshair.pane?this._rectangle=this._crosshair.pane.logicalRectToPixels(e):this._rectangle=null}renderer(e,t){if(!this._rectangle)return null;const i=this._crosshair.model().isDark(),s={backcolor:i?"rgba(21, 101, 192, 0.3)":"rgba(33, 150, 243, 0.3)",color:i?"rgba(21, 101, 192, 0.8)":"rgba(33, 150, 243, 0.8)",fillBackground:!0,linewidth:1,points:[this._rectangle.min,this._rectangle.max],extendLeft:!1,extendRight:!1};return this._renderer.setData(s),this._renderer}}var D=i("Ialn"),V=i("GH0z"),B=i("5C6T"),R=i("nda6"),N=i("pJOz"),j=i("qgcf"),F=i("Zy3/"),W=i("a7Ha"),H=i("zDbI");const z=window.t("{0} bars"),U=new R.TimeSpanFormatter;class G{constructor(e,t){this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new N.TrendLineRenderer,this._vertTrenRenderer=new N.TrendLineRenderer,this._bgRenderer=new E.RectangleRenderer,this._labelRenderer=new j.TextRenderer,this._p1=null,this._p2=null,this._label=null,this._source=e,this._pane=t}update(){const[e,t]=this._source.measurePoints();if(void 0===t)return this._p1=null,void(this._p2=null);const i=Object(s.ensureNotNull)(this._source.measurePane()),n=e.price,o=t.price,a=t.price-n,l=t.index-e.index,c=Object(D.forceLTRStr)(""+l),h=Object(s.ensureNotNull)(i.mainDataSource())
|
||
;let u=Object(s.ensureNotNull)(h.formatter()).format(a);if(Math.abs(n)>1e-8){const e=a/Math.abs(n);u+=" ("+(new V.PercentageFormatter).format(100*e)+")"}const d=Object(D.forceLTRStr)(u);this._label=d+"\n"+z.format(c);const p=Object(s.ensureNotNull)(h.firstValue()),_=this._source.model().timeScale().indexToCoordinate(e.index),m=this._source.model().timeScale().indexToCoordinate(t.index),f=i.defaultPriceScale().priceToCoordinate(n,p),g=i.defaultPriceScale().priceToCoordinate(o,p);this._p1=new r.Point(_,f),this._p2=new r.Point(m,g);const v=this._source.model().timeScale().indexToUserTime(e.index),b=this._source.model().timeScale().indexToUserTime(t.index);let S=null;if(null!==v&&null!==b){const e=this._pane.model().mainSeries().symbolInfo();null!==e&&e!==this._lastSymbolInfo&&(this._pipFormatter=new B.PipFormatter(e.pricescale,e.minmov,e.type,e.minmove2),this._lastSymbolInfo=e),S=(b.valueOf()-v.valueOf())/1e3}const y=this._pipFormatter?this._pipFormatter.format(a):null,w=null!==y?" , "+y:"",C=null!==S?U.format(S):null,x=null!==C?", "+Object(D.startWithLTR)(C):"";this._label=Object(D.forceLTRStr)(d+w)+"\n"+z.format(c)+x;const T=o<n?"rgba(239,83,80,0.2)":"rgba(30,136,229,0.2)",M=o<n?"#EF5350":"#1E88E5",I=o<n?"#EF5350":"#2196F3",L={points:[this._p1,this._p2],linewidth:0,fillBackground:!0,color:T,backcolor:T,extendLeft:!1,extendRight:!1};this._bgRenderer.setData(L);const O=this._p1.add(this._p2).scaled(.5);{const e=Math.round(O.y),t=new r.Point(this._p1.x,e),i=new r.Point(this._p2.x,e),s={points:[t,i],color:M,linewidth:1,linestyle:P.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W.LineEnd.Normal,rightend:Math.abs(t.x-i.x)>=50?W.LineEnd.Arrow:W.LineEnd.Normal};this._horzTrenRenderer.setData(s)}{const e=Math.round(O.x),t=new r.Point(e,this._p1.y),i=new r.Point(e,this._p2.y),s={points:[t,i],color:M,linewidth:1,linestyle:P.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W.LineEnd.Normal,rightend:Math.abs(t.y-i.y)>=50?W.LineEnd.Arrow:W.LineEnd.Normal};this._vertTrenRenderer.setData(s)}const A={x:0,y:10},E=.5*(this._p1.x+this._p2.x),k=this._p2.y,R=new r.Point(E,k),N=(F=Object(s.ensureNotNull)(this._label),{points:[R],text:F,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:H.CHART_FONT_FAMILY,offsetX:A.x,offsetY:A.y,bold:!1,italic:!1,fontsize:12,padding:8,highlightBorder:!1,backgroundColor:I,backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4});var F;this._labelRenderer.setData(N);const G=this._labelRenderer.measure(),q=Object(j.calculateLabelPosition)(G,this._p1,this._p2,A,this._pane.height());this._labelRenderer.setPoints([q])}renderer(){if(null===this._p1||null===this._p2)return null;const e=new F.CompositeRenderer;return e.append(this._bgRenderer),e.append(this._horzTrenRenderer),e.append(this._vertTrenRenderer),e.append(this._labelRenderer),e}}var q=i("cPgM");class Y extends q.ScaledPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){return null}_drawImpl(e){e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),
|
||
e.strokeStyle="rgba(153,153,153,.3)",e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle="rgba(153,153,153,.7)",e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle="#777",e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle="rgba(255,255,255,.7)",e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle="#777",e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)}_drawShackle(e){const t=(this._data.width-3)/2,i=this._data.height-this._data.bodyHeight;e.moveTo(1.5,t),e.arc(this._data.width/2,t,t,Math.PI,2*Math.PI),i>t&&(e.moveTo(1.5,t),e.lineTo(1.5,i),e.moveTo(this._data.width-1.5,t),e.lineTo(this._data.width-1.5,i))}}class K{constructor(e,t,i){this._horzVisible=!1,this._source=e,this._pane=t,this._axis=i||"x"}update(){}renderer(e,t){const i=this._source.visible&&this._source.areLinesVisible,r=Object(m.lockTimeAxis)().value(),n=i&&this._horzVisible,o=i||r;if("y"===this._axis&&!n||!o)return null;const a="y"===this._axis?this._pane.width()-4.5:Object(s.ensureDefined)(this._source.lockedX)+1,l="y"===this._axis?this._source.y:this._pane.height()-5.5-1;return new Y({x:a,y:l,width:9,height:11,bodyHeight:7})}}var J=i("qFKp"),Z=i("aIyQ"),X=i.n(Z),$=i("GDWD"),Q=i("ivNn"),ee=i("4miz");const te=window.t("n/a");class ie extends ee.b{constructor(e){super(),this._invalidated=!0,this._dateItem=new ee.a(window.t("Date"),""),this._timeItem=new ee.a(window.t("Time"),""),this._model=e,this._items.push(this._dateItem),this._items.push(this._timeItem)}update(){this._invalidated=!0}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}_updateImpl(){const e=this._model.mainSeries().isDWM();if(this._timeItem.setVisible(!e),this._timeItem.setValue(te),this._dateItem.setValue(te),this._model.timeScale().isEmpty())return;let t=this._model.crossHairSource().appliedIndex();if(!Object(Q.isNumber)(t)){const e=this._model.mainSeries().data().last();if(null===e)return;t=e.index}const i=this._model.timeScale().indexToUserTime(t);null!==i&&(this._dateItem.setValue(this._model.dateFormatter().format(i)),e||this._timeItem.setValue(this._model.timeFormatter().format(i)))}}var se=i("cgFQ");class re extends se.a{constructor(e,t,i=!1){super(e),this._indexProvider=t,this._highlighted=i}_getBgColor(){const e=this._model.isDark();return this._highlighted?e?"#1E88E5":"#2196F3":e?l.a["color-cold-gray-750"]:l.a["color-cold-gray-900"]}_getIndex(){return this._model.crossHairSource().visible?this._indexProvider():null}}i.d(t,"Crosshair",(function(){return oe}));const ne={menuEnabled:!1,menuForMainSourceOnly:!1,disableTradingMenuActions:!1,disableDrawHorizLineMenuAction:!1};class oe extends n.DataSource{constructor(e,t,i){
|
||
super(),this.pane=null,this.price=NaN,this.index=NaN,this.visible=!0,this.areLinesVisible=!0,this.x=NaN,this.y=NaN,this._measuringStarted=new X.a,this._measurePane=null,this._startMeasurePoint=null,this._endMeasurePoint=null,this._lastValidMeasurePoint=null,this._isOnHoveredChartWidget=!1,this._selectBarMode=new a.a(!1),this._selectionPane=null,this._selectionView=new k(this),this._selectionStartPoint=null,this._measurePaneView=null,this._timeLockPaneView=null,this._priceAxisViews=new Map,this._panePriceAxisViews=new Map,this._startMeasurePriceAxisViews=new Map,this._endMeasurePriceAxisViews=new Map,this._originX=NaN,this._originY=NaN,this._subscribed=!1,this._movedDelegate=new X.a,this._barSelectedDelegate=new X.a,this._model=e,this._options=Object.assign({},ne,i||{}),this._linesShouldBeHidden=this._model.readOnly(),this._dataWindowView=new ie(e),this.setSelectionEnabled(!1);const r=e=>t=>t===Object(s.ensureNotNull)(this._measurePane).defaultPriceScale()?e():null;this._currentPosPriceProvider=e=>{const t=Object(s.ensureNotNull)(this.pane);if(e===t.defaultPriceScale())return this.price;const i=Object(s.ensureNotNull)(t.defaultPriceScale().mainSource()).firstValue();if(null===i)return null;const r=t.defaultPriceScale().priceToCoordinate(this.price,i),n=Object(s.ensureNotNull)(e.mainSource()).firstValue();return null===n?null:e.coordinateToPrice(r,n)},this._startMeasurePriceProvider=r(()=>Object(s.ensureNotNull)(this._startMeasurePoint).price),this._endMeasurePriceProvider=r(()=>Object(s.ensureNotNull)(this._lastMeasurePoint()).price),this._properties=t;this._timeAxisView=new re(e,()=>this.appliedIndex(),!1),this._startMeasureTimeAxisView=new re(e,()=>Object(s.ensureNotNull)(this._startMeasurePoint).index,!0),this._endMeasureTimeAxisView=new re(e,()=>Object(s.ensureNotNull)(this._lastMeasurePoint()).index,!0),e.readOnly()||m.cursorTool.subscribe(e=>this.areLinesVisible="arrow"!==e,{callWithLast:!0})}moved(){return this._movedDelegate}originX(){return this._originX}originY(){return this._originY}saveOriginCoords(e,t){this._originX=e,this._originY=t}clearOriginCoords(){this._originX=NaN,this._originY=NaN}currentPoint(){return new r.Point(this.x,this.y)}model(){return this._model}appliedIndex(){return Number.isFinite(this.lockedIndex)&&this.lockedIndex||this.index}startMeasurePoint(){return this._startMeasurePoint||null}endMeasurePoint(){return this._endMeasurePoint||null}measurePane(){return this._measurePane||null}startMeasuring(e,t){this._startMeasurePoint=e,this._measurePane=t,this._measuringStarted.fire()}finishMeasure(e){this._endMeasurePoint=e}clearMeasure(){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.lightUpdate()}measuringStarted(){return this._measuringStarted}measurePoints(){this.updateAllViews();const e=[Object(s.ensureNotNull)(this._startMeasurePoint)],t=this._lastMeasurePoint();return null!==t&&e.push(t),e}startSelection(e){this._selectionStartPoint=this.currentLogicalPoint(),this._selectionPane=e}clearSelection(){
|
||
this._selectionStartPoint=null,this._selectionPane=null}selection(){return this._selectionStartPoint?{p1:this._selectionStartPoint,p2:this.currentLogicalPoint()}:null}currentLogicalPoint(){return{index:this.appliedIndex(),price:this.price}}selectBarMode(){return this._selectBarMode}toggleSelectBarMode(){this._setSelectBarModeState(!this._selectBarMode.value())}onBarSelected(){return this._barSelectedDelegate}trySelectCurrentBar(){if(!this._model.mainSeries().bars().contains(this.index))return;const e=this._model.timeScale().indexToTimePoint(this.index);null!==e&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(e))}isOnHoveredChartWidget(){return this._isOnHoveredChartWidget}setOnHoveredChartWidget(e){this._isOnHoveredChartWidget=e}clearPosition(){this.visible=!1,this.index=NaN,this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoords()}setPosition(e,t,i){return this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,this.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)}setLinesShouldBeHidden(e){this._linesShouldBeHidden=e}linesShouldBeHidden(){return this._linesShouldBeHidden}handleContextMenuEvent(e){this._selectBarMode.value()&&this._setSelectBarModeState(!1)}properties(){return this._properties}priceAxisViews(e,t){const i=[];return this._selectBarMode.value()&&this._isOnHoveredChartWidget||this.pane!==e||i.push(this._createPriceAxisViewOnDemand(this._priceAxisViews,this._panePriceAxisViews,e,t,this._currentPosPriceProvider,p,!0)[0]),this._startMeasurePoint&&i.push(this._createPriceAxisViewOnDemand(this._startMeasurePriceAxisViews,null,e,t,this._startMeasurePriceProvider,_)[0]),this._lastMeasurePoint()&&i.push(this._createPriceAxisViewOnDemand(this._endMeasurePriceAxisViews,null,e,t,this._endMeasurePriceProvider,_)[0]),i}timeAxisViews(){const e=[];return this._linesShouldBeHidden||!this.visible&&!Object(m.lockTimeAxis)().value()||e.push(this._timeAxisView),this._startMeasurePoint&&e.push(this._startMeasureTimeAxisView),this._lastMeasurePoint()&&e.push(this._endMeasureTimeAxisView),e}paneViews(e){if(void 0===e)return null;const t=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=e===this.pane&&!t,s=[new A(this,e,i)];if(e===this._selectionPane&&s.push(this._selectionView),e===this._measurePane&&(null===this._measurePaneView&&(this._measurePaneView=new G(this,e)),this._measurePaneView.update(),s.push(this._measurePaneView)),$.addPlusButtonProperty.value()){const i=e===this.pane,r=!J.CheckMobile.any()||window.screen.width>=320,n=m.tool.value(),o=Object(O.isLineToolName)(n),a=this._model.customSourceMovingHitTestData(),l=null!==this._model.lineBeingEdited()||null!==this._model.lineBeingCreated()||this._model.sourcesBeingMoved().length>0||null!==a&&a.beingMoved||Object(m.toolIsMeasure)(n);if(i&&this._isOnHoveredChartWidget&&!t&&r&&!o&&!l){const t=e.mainDataSource();if(null!==t){const i=t.priceScale();if(null!==i){
|
||
const t=this._createPriceAxisViewOnDemand(this._priceAxisViews,this._panePriceAxisViews,e,i,this._currentPosPriceProvider,p,!0)[1];null!==t&&s.push(t)}}}}return Object(m.lockTimeAxis)().value()&&(null===this._timeLockPaneView&&(this._timeLockPaneView=new K(this,e)),s.push(this._timeLockPaneView)),s}dataWindowView(){return this._dataWindowView}updateAllViews(){this._priceAxisViews.forEach(e=>{e.forEach(e=>e.update())}),this._panePriceAxisViews.forEach(e=>{e.forEach(e=>e.update())}),this._startMeasurePoint&&(this._startMeasurePriceAxisViews.forEach(e=>{e.forEach(e=>e.update())}),this._startMeasureTimeAxisView.update()),this._lastMeasurePoint()&&(this._endMeasurePriceAxisViews.forEach(e=>{e.forEach(e=>e.update())}),this._endMeasureTimeAxisView.update()),this._timeAxisView.update(),this._selectionView.update(),this._dataWindowView.update()}setLockedPosition(e){delete this.lockedIndex,delete this.lockedX,e!==this._measurePane&&Object(m.lockTimeAxis)().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),null!==this.lockedIndex&&(this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex)))}isMenuEnabled(){return this._options.menuEnabled}isHoveredEnabled(){return $.addPlusButtonProperty.value()}isHovered(){return this._model.hoveredSource()===this}_lastMeasurePoint(){return this._endMeasurePoint?this._endMeasurePoint:(null!==this.pane&&this._measurePane===this.pane&&(this._lastValidMeasurePoint={price:this._model.magnet().align(this.price,this.index,this.pane),index:this.index}),this._lastValidMeasurePoint||null)}_createPriceAxisViewOnDemand(e,t,i,r,n,o,a=!1){let l=e.get(i),c=null!==t?t.get(i):void 0;void 0===l&&(l=new Map,e.set(i,l),this._options.menuEnabled&&null!==t&&(c=new Map,t.set(i,c)),a&&i.onDestroyed().subscribe(this,()=>this._onPaneDestroyed(i)));let h=l.get(r);if(void 0===h){if(h=new o(this,r,n),l.set(r,h),void 0!==c){const e=new w(h,this,r,this._model,this._options);c.set(r,e)}a&&r.lastSourceRemoved().subscribe(this,()=>this._onPriceScaleCleared(r))}let u=null;return void 0!==c&&(u=Object(s.ensureDefined)(c.get(r))),[h,u]}_onPaneDestroyed(e){e.onDestroyed().unsubscribeAll(this),this._priceAxisViews.delete(e),this._panePriceAxisViews.delete(e),this._startMeasurePriceAxisViews.delete(e),this._endMeasurePriceAxisViews.delete(e)}_onPriceScaleCleared(e){e.lastSourceRemoved().unsubscribeAll(this),this._priceAxisViews.forEach(t=>t.delete(e)),this._panePriceAxisViews.forEach(t=>t.delete(e)),this._startMeasurePriceAxisViews.forEach(t=>t.delete(e)),this._endMeasurePriceAxisViews.forEach(t=>t.delete(e))}_tryToUpdateViews(e,t,i){if(this._tryToUpdateData(e,t,i)){this.updateAllViews();const e=this._model.timeScale().points().roughTime(this.index);return null!==e&&this._movedDelegate.fire({time:e,price:this.price}),!0}return!1}_tryToUpdateData(e,t,i){const r=this.x,n=this.y,o=this.price,a=this.index,l=this.pane,c=this._priceScaleByPane(i);if(this.index=e,this.x=isNaN(e)?NaN:this._model.timeScale().indexToCoordinate(e),null!==c&&null!==i){this.pane=i,this.price=t
|
||
;const e=Object(s.ensureNotNull)(i.mainDataSource()).firstValue();this.y=null===e?NaN:c.priceToCoordinate(t,e)}else this.pane=null,this.price=NaN,this.y=NaN;return r!==this.x||n!==this.y||a!==this.index||o!==this.price||l!==this.pane}_priceScaleByPane(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null}_setSelectBarModeState(e){this._selectBarMode.setValue(e),this._model.lightUpdate()}}},"22xp":function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=(i("YFKU"),i("9uLv")),n=i("txPx"),o=i("//lZ"),a=i("aIyQ"),l=i.n(a),c=i("Kxc7"),h=i("Hr11"),u=i("ogJP"),d=i("FIi8"),p=i("ZJKN");class _{constructor(e,t){Object(s.assert)(e<=t,"The left value should be greater than or equal to the right value"),this._left=e,this._right=t}left(){return this._left}right(){return this._right}length(){return this._right-this._left+1}contains(e){return this._left<=e&&e<=this._right}equals(e){return this._left===e.left()&&this._right===e.right()}static compare(e,t){return null===e||null===t?e===t:e.equals(t)}}const m=Object(n.getLogger)("Chart.TimePoints");class f{constructor(){this._zoffset=0,this._items=[]}clear(){this._zoffset=0,this._items=[]}size(){return this._items.length}firstIndex(){return this._offsetToIndex(0)}lastIndex(){return this._offsetToIndex(this._items.length-1)}merge(e,t,i){if(0===i.length)return m.logError("merge: 'values' does not contain any time points"),[];if(t>this._zoffset&&e+t>0)return m.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=t,[{change:"rebuild",index:this._validOffsetToIndex(0)}];const s=e+this._zoffset;if(s<0){const r=Math.abs(s);if(i.length<r)return m.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+e.toString()+", previous 'zoffset': "+this._zoffset.toString()+", new 'zoffset': "+t.toString()+", 'values.length': "+i.length),[];this._items=new Array(r).concat(this._items),this._zoffset=t;for(let s=0;s<i.length;++s)this._items[e+s+t]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}const r=[];let n=s;for(;n<this._items.length&&n-s<i.length;++n)this._items[n]=i[n-s],r.push({change:"update",index:this._validOffsetToIndex(n),value:i[n-s]});const o=s+i.length;if(o>this._items.length){const e=o-this._items.length;for(let t=n;t<n+e;++t){const e=this._items.length;this._items.push(i[t-s]),r.push({change:"append",index:this._validOffsetToIndex(e),value:i[t-s]})}}else{for(let e=o;e<this._items.length;++e)r.push({change:"remove",index:this._validOffsetToIndex(e),value:this._items[e]});this._items.length=o}return this._zoffset=t,r}addTail(e,t){for(let i=t?1:0;i<e.length;i++)this._items.push(e[i])}remove(e){const t=this._indexToOffset(e);if(null===t)return[];const i=this._items.splice(t),s=[];for(let r=0;r<i.length;r++)s.push({change:"remove",index:e+r,value:i[r]});return s}valueAt(e){const t=this._indexToOffset(e);return null!==t?this._items[t]:null}indexOf(e,t){if(this._items.length<1)return null
|
||
;if(e>this._items[this._items.length-1])return t?this._validOffsetToIndex(this._items.length-1):null;for(let i=0;i<this._items.length;++i){if(e===this._items[i])return this._validOffsetToIndex(i);if(e<this._items[i])return t?this._validOffsetToIndex(i):null}return null}state(){return{items:this._items,zoffset:this._zoffset}}restoreState(e){null!==e&&(this._items=e.items,this._zoffset=e.zoffset)}roughTime(e,t=null){const i=this.valueAt(e);if(null!==i)return i;const s=this._items;if(!s.length||s.length<2)return null;const r=s.length-1,n=this._validOffsetToIndex(0),o=this._validOffsetToIndex(r),a=s[0],l=s[r],c=(l-a)/(o-n);if(e<n){return a-(n-e)*c}if(e>o){const i=e-o;if(i<500&&null!=t)return t(l,i);return l+i*c}return null}roughIndex(e,t=null){const i=this._items;if(!i.length||i.length<2)return null;const s=i.length-1,r=this._validOffsetToIndex(0),n=this._validOffsetToIndex(s),o=i[0],a=i[s];if(e>=o&&e<=a)return this.closestIndexLeft(e);const l=(a-o)/(n-r);if(e<o){const t=o-e;return r-Math.round(t/l)}if(e>a){const i=e-a;let s=Math.trunc(i/l);if(s<500&&null!==t){const i=t(a,e);i.success&&(s=i.result)}return n+s}return null}closestIndexLeft(e){const t=this._items;if(!t.length)return null;if(Number.isNaN(e))return null;let i=t.length-1;if(e>=t[i])return this._validOffsetToIndex(i);let s=0;const r=t[s];if(e<r)return null;if(e===r)return this._validOffsetToIndex(s);for(;i>s+1;){const r=s+i>>1,n=t[r];if(n>e)i=r;else{if(!(n<e))return n===e?this._validOffsetToIndex(r):null;s=r}}return this._validOffsetToIndex(s)}_validOffsetToIndex(e){return e-this._zoffset}_offsetToIndex(e){return 0<=e&&e<this.size()?this._validOffsetToIndex(e):null}_indexToOffset(e){const t=e+this._zoffset;return 0<=t&&t<this.size()?t:null}}var g=i("tc+8"),v=i.n(g);const b=new Map([[0,.1],[11,.1],[1,.35],[9,.35],[12,.35],[8,.35]]);class S{constructor(e,t){this._styleSpecificRanges=new Map,this._logicalRange=e,this._defaultStyle=t}strictRange(e){if(null===this._logicalRange)return null;void 0===e&&(e=this._defaultStyle);let t=this._styleSpecificRanges.get(e);if(void 0===t){const i=(b.get(e)||0)/2;t=new p.BarsRange(Math.ceil(this._logicalRange.left()+i),Math.ceil(this._logicalRange.right()-i)),this._styleSpecificRanges.set(e,t)}return t}logicalRange(){return this._logicalRange}isValid(){return null!==this._logicalRange}static invalid(){return new S(null,1)}}var y=i("Ocx9"),w=i("GhVi"),C=i("8OdW");class P{constructor(e,t=50){this._actualSize=0,this._usageTick=1,this._oldestTick=1,this._cache=new Map,this._tick2Labels=new Map,this._format=e,this._maxSize=t}format(e){const t=this._cache.get(e.valueOf());if(void 0!==t)return t.string;if(this._actualSize===this._maxSize){const e=this._tick2Labels.get(this._oldestTick);this._tick2Labels.delete(this._oldestTick),this._cache.delete(Object(s.ensureDefined)(e)),this._oldestTick++,this._actualSize--}const i=this._format(e);return this._cache.set(e.valueOf(),{string:i,tick:this._usageTick}),this._tick2Labels.set(this._usageTick,e.valueOf()),this._actualSize++,this._usageTick++,i}}var x=i("kcTO")
|
||
;i.d(t,"TimeScale",(function(){return E}));const T={preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!0,minBarSpacing:.5},M=c.enabled("low_density_bars"),I=M?1:5,L=Object(n.getLogger)("Chart.TimeScale"),O=new Map([[0,.9],[11,.9],[1,.8],[9,.8],[12,.8],[8,.8]]);let A;class E{constructor(e,t){this._width=0,this._widthChanged=new l.a,this._rightOffset=10,this._maxRightOffsetChanged=new l.a,this._defaultRightOffsetProperty=new v.a(10),this._baseIndex=null,this._leftEdgeIndex=null,this._barSpacingChanged=new l.a,this._barSpacing=6,this._visibleBars=S.invalid(),this._visibleBarsInvalidated=!0,this._visibleBarsChanged=new l.a,this._logicalRangeChanged=new l.a,this._points=new f,this._tickMarks=new w.Tickmarks,this._onScroll=new l.a,this._resetDelegate=new l.a,this._scrollStartPoint=null,this._scaleStartPoint=null,this._commonTransitionStartState=null,this._formattedBySpan=new Map,this._requestingMoreData=!1,this._requestedTickmarksCount=0,this._endOfData=!1,this._options=Object(d.deepExtend)({},T,t),this._model=e,this._scalesProperties=e.properties().scalesProperties,this._defaultRightOffsetProperty.listeners().subscribe(this,e=>{this.setRightOffset(e.value())}),this._options.preserveBarSpacing&&(this._barSpacing=this._scalesProperties.childs().barSpacing.value()||6),this._barSpacingChanged.subscribe(this,this._maxRightOffsetOnChanged),this._widthChanged.subscribe(this,this._maxRightOffsetOnChanged)}destroy(){this._barSpacingChanged.unsubscribeAll(this),this._barSpacingChanged.destroy(),this._widthChanged.unsubscribeAll(this),this._widthChanged.destroy()}isEmpty(){return 0===this._width||0===this._points.size()}update(e,t,i,s){this._visibleBarsInvalidated=!0,i.length>0&&this._points.merge(e,t,i),this._tickMarks.merge(s),this._correctOffset()}addTail(e,t,i){this._tickMarks.removeTail(t);const r=e.params,n=Object(s.ensureDefined)(this._tickMarks.maxIndex)+(i?0:1);for(let s=0;s<r.marks.length;s++)r.marks[s].index=n+s;this._tickMarks.addTail(r.marks),this._points.addTail(r.changes,i),this._rightOffset-=r.changes.length}state(e){const t={m_barSpacing:this.barSpacing(),m_rightOffset:e?this._rightOffset:this._defaultRightOffsetProperty.value()};return e&&(t.points=this._points.state(),t.tickmarks=this._tickMarks.state(),t.width=this._width),t}restoreState(e,t){if(void 0===e.m_barSpacing)return void L.logDebug("restoreState: invalid state");if(void 0===e.m_rightOffset)return void L.logDebug("restoreState: invalid state");let i=e.m_barSpacing;const s=e.m_rightOffset<0&&!t?this.rightOffsetDefaultValue():e.m_rightOffset,r=s<0?this.rightOffsetDefaultValue():Math.round(s);this._defaultRightOffsetProperty.setValue(r),this._rightOffset=s,t&&(this._requestedTickmarksCount=1/0,this._endOfData=!0,this._points.restoreState(e.points||null),this._tickMarks.restoreState(e.tickmarks||null),e.width&&this._width>0&&(i*=this._width/e.width)),this._tryToUpdateBarSpacing(this._barSpacing,i),this._correctOffset()}marks(){if(this.isEmpty())return null
|
||
;const e=this._barSpacing,t=5*((this._scalesProperties.childs().fontSize.value()||0)+4),i=Math.round(t/e),r=Object(s.ensureNotNull)(this.visibleBarsStrictRange()),n=Math.max(r.firstBar(),r.firstBar()-i),o=Math.max(r.lastBar(),r.lastBar()-i),a=this._tickMarks.build(e,t),l=[];for(const s of a){if(!(n<=s.index&&s.index<=o))continue;const e=this._tickMarks.indexToTime(s.index);null!==e&&l.push({coord:this.indexToCoordinate(s.index),label:this.formatLabel(e,s.span),span:s.span,major:s.label>=C.DAY_SPAN})}return l}visibleBarsStrictRange(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars.strictRange()}visibleBarsStrictRangeChanged(){return this._visibleBarsChanged}logicalRangeChanged(){return this._logicalRangeChanged}tickMarks(){return this._tickMarks}points(){return this._points}width(){return this._width}setWidth(e,t){if(!Number.isFinite(e)||e<=0)L.logWarn("setWidth: invalid argument: "+e);else if(this._width!==e){if(this._visibleBarsInvalidated=!0,(t||this._options.lockVisibleTimeRangeOnResize)&&this._width){const t=this._barSpacing*e/this._width;this._tryToUpdateBarSpacing(this._barSpacing,t)}if(null!==this._leftEdgeIndex){if(Object(s.ensureNotNull)(this.visibleBarsStrictRange()).firstBar()<=this._leftEdgeIndex){const t=this._width-e;this._rightOffset-=Math.round(t/this._barSpacing)+1}}this._width=e,this._widthChanged.fire(e),this._correctOffset(),this._requestMoreData()}}setLeftEdgeFix(e){this._leftEdgeIndex=e;const t=this.visibleBarsStrictRange();if(null===t)return;const i=t.firstBar()-e;if(i<0){const e=this._rightOffset-i-1;this.scrollToOffsetAnimated(e,500)}}indexToCoordinate(e){if(this.isEmpty())return 0;if(!Object(u.isInteger)(e))return 0;const t=this.baseIndex()+this._rightOffset-e;return this._width-(t+.5)*this._barSpacing-1}indexToUserTime(e){return this._tickMarks.indexToTime(e)}timePointToIndex(e){return this._points.indexOf(e,!0)}indexToTimePoint(e){return this._points.valueAt(e)}timeToCoordinate(e){const t=this._points.closestIndexLeft(e);if(null===t)return null;const i=Object(s.ensureNotNull)(this._points.valueAt(t)),r=this.indexToCoordinate(t);if(r<=0||r>=this._width)return null;const n=this.barSpacing(),o=this.baseIndex(),a=r+(e-i)/(Object(s.ensureNotNull)(this._points.valueAt(o))-Object(s.ensureNotNull)(this._points.valueAt(o-1)))*n+1;return a<=0||a>=this._width?null:a}barIndexesToCoordinates(e){const t=this.baseIndex();for(const i of e){const e=i.time,s=t+this._rightOffset-e,r=this._width-(s+.5)*this._barSpacing-1;i.time=r,i.exactTime=r}}timedValuesToCoordinates(e){const t=this.baseIndex()+this._rightOffset,i=this._width-t*this._barSpacing-.5*this._barSpacing-1;for(const s of e)s.x=i+s.x*this._barSpacing}indexesToCoordinates(e,t){if(this.isEmpty())return;void 0===t&&(t=e.length);const i=this.baseIndex()+this._rightOffset,s=this._width-i*this._barSpacing-.5*this._barSpacing-1,r=this._barSpacing,n=e;for(let o=0;o<t;++o)Object(u.isInteger)(e[o])?n[o]=s+e[o]*r:n[o]=0}rightOffsetForTimePoint(e){const t=this.timeToCoordinate(e)
|
||
;return null===t?null:this._rightOffsetForCoordinate(t)}scrollToRealtime(e,t){let i=this._defaultRightOffsetProperty.value();i<0&&(i=this.rightOffsetDefaultValue());const s=()=>{void 0!==t&&t(),this._requestMoreData()};if(e){const e=this._rightOffset,t=this.maxRightOffset();t>0&&i>t&&(i=t);const n=this._model;Object(o.doAnimate)({from:e,to:i,duration:1e3,easing:r.easingFunc.easeInOutQuint,onComplete:s,onStep:(e,t)=>{this._visibleBarsInvalidated=!0,this._rightOffset=t,this._correctOffset(),n.recalculateAllPanes(),n.lightUpdate(),n.recalcVisibleRangeStudies()}})}else this._visibleBarsInvalidated=!0,this._rightOffset=i,this._correctOffset(),s()}scrollToOffsetAnimated(e,t){if(!isFinite(e))throw new RangeError("offset is required and must be finite number");const i=void 0===t?400:t;if(!isFinite(i)||i<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const s=this._rightOffset,r=Date.now(),n=()=>{this._visibleBarsInvalidated=!0;const t=(Date.now()-r)/i;if(t>=1)return this._rightOffset=e,this._correctOffset(),this._visibleBarsInvalidated=!0,this._model.recalculateAllPanes(),void this._model.lightUpdate();this._rightOffset=s+(e-s)*t,this._correctOffset(),this._model.recalculateAllPanes(),setTimeout(n,20)};n()}defaultRightOffsetProperty(){return this._defaultRightOffsetProperty}rightOffsetDefaultValue(){return 10}barSpacing(){return this._barSpacing}setBarSpacing(e){Number.isFinite(e)?(e=this.getValidBarSpacing(e),this._tryToUpdateBarSpacing(this._barSpacing,e)&&(this._correctOffset(),this._options.preserveBarSpacing&&(Object(y.saveDefaultProperties)(!0),this._scalesProperties.childs().barSpacing.setValue(this._barSpacing),Object(y.saveDefaultProperties)(!1)))):L.logWarn("setBarSpacing: invalid argument: "+e)}barSpacingChanged(){return this._barSpacingChanged}getValidBarSpacing(e){return null==e&&(e=this.barSpacing()),e<this.minBarSpacing()?this.minBarSpacing():e>this.maxBarSpacing()?this.maxBarSpacing():e}isValidBarSpacing(e){return e>=this.minBarSpacing()&&e<=this.maxBarSpacing()}preserveBarSpacing(){return this._options.preserveBarSpacing}normalizeBarIndex(e){let t=0,i=0;const r=this.baseIndex(),n=Object(s.ensureNotNull)(this._points.firstIndex());return e<n?(t=Object(s.ensureNotNull)(this._points.valueAt(n)),i=e-n):e>r?(t=Object(s.ensureNotNull)(this._points.valueAt(r)),i=e-r):(t=Object(s.ensureNotNull)(this._points.valueAt(e)),i=0),{time_t:t,offset:i}}denormalizeTimePoint(e){const t=this._points.indexOf(e.time_t,!1);if(null!==t)return t+e.offset}rightOffset(){return this._rightOffset}minRightOffset(){const e=this.points().firstIndex(),t=this._baseIndex;if(null===e||null===t)return null;if(null!==this._leftEdgeIndex){const e=this.width()/this._barSpacing;return this._leftEdgeIndex-t+e-1}return e-t-1+I}maxRightOffset(){return this.width()/this._barSpacing-I}maxRightOffsetChanged(){return this._maxRightOffsetChanged}onReset(){return this._resetDelegate}scrollStartPoint(){return this._scrollStartPoint}baseIndex(){return this._baseIndex||0}zoom(e,t,i){
|
||
if(!Number.isFinite(e)||!Number.isFinite(t))return void L.logWarn(`zoom: invalid arguments: ${e}, ${t}, ${i}`);const s=this.coordinateToIndex(e),r=this.barSpacing(),n=r+t*(r/10);this.setBarSpacing(n);(void 0!==i?!i:this._options.rightBarStaysOnScroll)||this.setRightOffset(this.rightOffset()-.5+(s-this._coordinateToFloatIndex(e))),this._requestMoreData()}zoomToBarsRange(e,t){if(t<=e)return;const i=this.baseIndex();this._rightOffset=t-i;const s=O.get(this._model.mainSeries().style())||.6,r=Math.max(t-e+s,I);this.setBarSpacing(this.width()/r),this._visibleBarsInvalidated=!0,this._requestMoreData()}coordinateToIndex(e){return Math.ceil(this._coordinateToFloatIndex(e))}canZoomIn(){return this.barSpacing()<this.maxBarSpacing()}canZoomOut(){return this.barSpacing()>this._options.minBarSpacing}minBarSpacing(){return this._options.minBarSpacing}maxBarSpacing(){return M?this.width():50}resetRightOffset(){this.setRightOffset(this._defaultRightOffsetProperty.value())}reset(){this._visibleBarsInvalidated=!0,this._points=new f,this._scrollStartPoint=null,this._scaleStartPoint=null,this._clearCommonTransitionsStartState(),this._tickMarks.reset(),this._leftEdgeIndex=null,this._resetDelegate.fire(),this.disconnect()}disconnect(){this._requestingMoreData=!1,this._requestedTickmarksCount=0,this._endOfData=!1}setBaseIndex(e){Number.isFinite(e)?(this._visibleBarsInvalidated=!0,this._baseIndex=e,this._correctOffset()):L.logDebug("setBaseIndex: invalid argument: "+e)}setRightOffset(e){Number.isFinite(e)?(this._visibleBarsInvalidated=!0,this._rightOffset=e,this._correctOffset()):L.logWarn("setRightOffset: invalid argument: "+e)}correctBarSpacing(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setRightOffset(this._defaultRightOffsetProperty.value()),this.setBarSpacing(this.width()/(this.points().size()+this.rightOffset())))}logicalRange(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars.logicalRange()}restoreDefault(){this._visibleBarsInvalidated=!0,this.setBarSpacing(6),this.resetRightOffset(),this._requestMoreData()}restoreRightOffsetPropertyToDefault(){this._defaultRightOffsetProperty.setValue(this.rightOffsetDefaultValue())}startScale(e){this._scrollStartPoint&&this.endScroll(),null===this._scaleStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this._scaleStartPoint=e,this._saveCommonTransitionsStartState()))}scaleTo(e){if(null===this._commonTransitionStartState)return;const t=Object(h.clamp)(this._width-e,0,this._width),i=Object(h.clamp)(this._width-Object(s.ensureNotNull)(this._scaleStartPoint),0,this._width);0!==t&&0!==i&&this.setBarSpacing(this._commonTransitionStartState.barSpacing*t/i)}endScale(){null!==this._scaleStartPoint&&(this._scaleStartPoint=null,this._clearCommonTransitionsStartState(),this._requestMoreData())}startScroll(e){null===this._scrollStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this._scrollStartPoint=e,this._saveCommonTransitionsStartState()))}scrollTo(e){
|
||
if(this._visibleBarsInvalidated=!0,null===this._scrollStartPoint)return;const t=(this._scrollStartPoint-e)/this.barSpacing();this._rightOffset=Object(s.ensureNotNull)(this._commonTransitionStartState).rightOffset+t,this._correctOffset(),this._onScroll.fire()}endScroll(){null!==this._scrollStartPoint&&(this._scrollStartPoint=null,this._clearCommonTransitionsStartState(),this._requestMoreData())}formatLabel(e,t){let i=this._formattedBySpan.get(t);return void 0===i&&(i=new P(e=>this.formatLabelImpl(e,t)),this._formattedBySpan.set(t,i)),i.format(new Date(e))}formatLabelImpl(e,t){if(!(e&&e instanceof Date))return"incorrect time";const i=this._model.mainSeries().isDWM();return t<C.MINUTE_SPAN&&!i?Object(x.numberToStringWithLeadingZero)(e.getUTCHours(),2)+":"+Object(x.numberToStringWithLeadingZero)(e.getUTCMinutes(),2)+":"+Object(x.numberToStringWithLeadingZero)(e.getUTCSeconds(),2):t<C.DAY_SPAN&&!i?Object(x.numberToStringWithLeadingZero)(e.getUTCHours(),2)+":"+Object(x.numberToStringWithLeadingZero)(e.getUTCMinutes(),2):t<C.WEEK_SPAN||t<C.MONTH_SPAN?e.getUTCDate().toString():t<C.YEAR_SPAN?(void 0===A&&(A=[window.t("Jan"),window.t("Feb"),window.t("Mar"),window.t("Apr"),window.t("May"),window.t("Jun"),window.t("Jul"),window.t("Aug"),window.t("Sep"),window.t("Oct"),window.t("Nov"),window.t("Dec")]),A)[e.getUTCMonth()]:e.getUTCFullYear().toString()}onScroll(){return this._onScroll}invalidateVisibleBars(){this._visibleBarsInvalidated=!0}onTimeScaleCompleted(e){this._requestingMoreData=!1,this._endOfData=e,this._requestMoreData()}requestMoreHistoryPoints(e){this._requestHistoryPoints(e)}_requestMoreData(){this._requestFutureTickmarksIfNeeded(),this._requestHistoryPointsIfNeeded()}_requestFutureTickmarksIfNeeded(){if(this.isEmpty()||!this._model.chartApi().isConnected().value())return;const e=this.visibleBarsStrictRange();if(null===e)return;const t=e.lastBar()-Object(s.ensureNotNull)(this._points.lastIndex());if(t<=this._requestedTickmarksCount)return;const i=t-this._requestedTickmarksCount;this._requestedTickmarksCount=t,this._model.chartApi().requestMoreTickmarks(i)}_requestHistoryPointsIfNeeded(){if(this.isEmpty())return;if(this._endOfData)return void L.logNormal("Skipping loading more data due end of data state");const e=this.visibleBarsStrictRange();if(null===e)return;const t=Object(s.ensureNotNull)(this._points.firstIndex())-e.firstBar();t<=0||this._requestHistoryPoints(t)}_requestHistoryPoints(e){this._model.chartApi().isConnected().value()&&(this._requestingMoreData?L.logNormal("Skipping loading more data due active loading"):(this._requestingMoreData=!0,this._model.chartApi().requestMoreData(e)))}_updateVisibleBars(){const e=this._visibleBars;if(this.isEmpty())return void(this._visibleBars.isValid()&&(this._visibleBars=S.invalid(),this._visibleBarsChanged.fire(null,e.strictRange()),this._logicalRangeChanged.fire(null,e.logicalRange())));const t=this.baseIndex(),i=this.width()/this._barSpacing,s=this._rightOffset+t,r=s-i
|
||
;Number.isFinite(r)&&Number.isFinite(s)?(this._visibleBars=new S(new _(r,s),this._model.mainSeries().style()),p.BarsRange.compare(e.strictRange(),this._visibleBars.strictRange())||this._visibleBarsChanged.fire(this._visibleBars.strictRange(),e.strictRange()),_.compare(e.logicalRange(),this._visibleBars.logicalRange())||this._logicalRangeChanged.fire(this._visibleBars.logicalRange(),e.logicalRange())):L.logWarn(`updateVisibleBars error: baseIndex: ${t}, barSpacing: ${this._barSpacing}, rightOffset: ${this._rightOffset}`)}_rightOffsetForCoordinate(e){return(this._width-1-e)/this._barSpacing}_correctOffset(){const e=this.maxRightOffset();this._rightOffset>e&&(this._rightOffset=e,this._visibleBarsInvalidated=!0);const t=this.minRightOffset();null!==t&&this._rightOffset<t&&(this._rightOffset=t,this._visibleBarsInvalidated=!0)}_tryToUpdateBarSpacing(e,t){return e!==t&&(this._visibleBarsInvalidated=!0,this._barSpacing=t,this._barSpacingChanged.fire(e,t),!0)}_coordinateToFloatIndex(e){const t=this._rightOffsetForCoordinate(e),i=this.baseIndex()+this.rightOffset()-t;return Math.round(1e6*i)/1e6}_saveCommonTransitionsStartState(){this._commonTransitionStartState={barSpacing:this.barSpacing(),rightOffset:this.rightOffset()}}_clearCommonTransitionsStartState(){this._commonTransitionStartState=null}_maxRightOffsetOnChanged(){this._maxRightOffsetChanged.fire(this.maxRightOffset())}}},"23IT":function(e,t,i){"use strict";var s,r;function n(e){return"line"===e.type}function o(e){return"shapes"===e.type}function a(e){return"chars"===e.type}function l(e){return"arrows"===e.type}function c(e){return"dataoffset"===e.type}function h(e){return"ohlc_open"===e.type}function u(e){return"ohlc_high"===e.type}function d(e){return"ohlc_low"===e.type}function p(e){return"ohlc_close"===e.type}function _(e){return h(e)||u(e)||d(e)||p(e)}function m(e){return"colorer"===e.type}function f(e){return"bar_colorer"===e.type}function g(e){return"bg_colorer"===e.type}function v(e){return"text_colorer"===e.type}function b(e){return"ohlc_colorer"===e.type}function S(e){return"wick_colorer"===e.type}function y(e){return"border_colorer"===e.type}function w(e){return"up_colorer"===e.type}function C(e){return"down_colorer"===e.type}function P(e){return"alertcondition"===e.type}function x(e){return"Plot"!==e}function T(e){return"ohlc_bars"===e.plottype}function M(e){return"ohlc_candles"===e.plottype}function I(e){return m(e)||f(e)||g(e)||c(e)||b(e)||P(e)||w(e)||C(e)||y(e)||S(e)||v(e)}function L(e){return m(e)||v(e)||f(e)||c(e)||b(e)||S(e)||y(e)||w(e)||C(e)||P(e)}i.r(t),i.d(t,"LineStudyPlotStyle",(function(){return s})),i.d(t,"isLinePlot",(function(){return n})),i.d(t,"isShapesPlot",(function(){return o})),i.d(t,"isCharsPlot",(function(){return a})),i.d(t,"isArrowsPlot",(function(){return l})),i.d(t,"isDataOffsetPlot",(function(){return c})),i.d(t,"isOhlcOpenPlot",(function(){return h})),i.d(t,"isOhlcHighPlot",(function(){return u})),i.d(t,"isOhlcLowPlot",(function(){return d})),i.d(t,"isOhlcClosePlot",(function(){return p})),i.d(t,"isOhlcPlot",(function(){return _
|
||
})),i.d(t,"isColorerPlot",(function(){return m})),i.d(t,"isBarColorerPlot",(function(){return f})),i.d(t,"isBgColorerPlot",(function(){return g})),i.d(t,"isTextColorerPlot",(function(){return v})),i.d(t,"isOhlcColorerPlot",(function(){return b})),i.d(t,"isCandleWickColorerPlot",(function(){return S})),i.d(t,"isCandleBorderColorerPlot",(function(){return y})),i.d(t,"isUpColorerPlot",(function(){return w})),i.d(t,"isDownColorerPlot",(function(){return C})),i.d(t,"isAlertConditionPlot",(function(){return P})),i.d(t,"isPlotTitleDefined",(function(){return x})),i.d(t,"isOhlcPlotStyleBars",(function(){return T})),i.d(t,"isOhlcPlotStyleCandles",(function(){return M})),i.d(t,"PlotSymbolSize",(function(){return r})),i.d(t,"isPlotWithTechnicalValues",(function(){return I})),i.d(t,"isNonVisualPlot",(function(){return L})),function(e){e[e.Line=0]="Line",e[e.Histogram=1]="Histogram",e[e.Cross=3]="Cross",e[e.Area=4]="Area",e[e.Columns=5]="Columns",e[e.Circles=6]="Circles",e[e.LineWithBreaks=7]="LineWithBreaks",e[e.AreaWithBreaks=8]="AreaWithBreaks",e[e.StepLine=9]="StepLine"}(s||(s={})),function(e){e.Auto="auto",e.Tiny="tiny",e.Small="small",e.Normal="normal",e.Large="large",e.Huge="huge"}(r||(r={}))},"25b6":function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"d",(function(){return o})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return l}));const s=/[<"'&>]/g,r=e=>`&#${e.charCodeAt(0)};`;function n(e){return e.replace(s,r)}function o(e=""){return e.replace(/(<([^>]+)>)/gi,"")}function a(e=""){return e.replace(/\s+/g,"")}function l(e=""){return e.replace(/\b\w/g,e=>e.toUpperCase())}},"29fS":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererBars",(function(){return n}));var s=i("Zp/P"),r=i("ExCE");class n extends r.a{constructor(e){super(),this._bars=e.bars,this._barSpacing=e.barSpacing,this._dontDrawOpen=e.dontDrawOpen,this._thinBars=e.thinBars}draw(e,t){e.save();const i=t.pixelRatio;if(this._barWidth=this._calcBarWidth(i),this._barWidth>=2){Math.max(1,Math.floor(i))%2!=this._barWidth%2&&this._barWidth--}this._barLineWidth=this._thinBars?Math.min(this._barWidth,Math.floor(i)):this._barWidth;let s=null;const r=this._barLineWidth<=this._barWidth&&this._barSpacing>=Math.floor(1.5*t.pixelRatio);for(const n of this._bars){s!==n.color&&(e.fillStyle=n.color,s=n.color);const t=Math.floor(.5*this._barLineWidth),o=Math.round(n.time*i),a=o-t,l=this._barLineWidth,c=a+l-1,h=Math.min(n.high,n.low),u=Math.max(n.high,n.low),d=Math.round(h*i)-t,p=Math.round(u*i)+t,_=Math.max(p-d,this._barLineWidth);e.fillRect(a,d,l,_);const m=Math.ceil(1.5*this._barWidth);if(r){const s=o-m,r=o+m,h=Math.min(a-s,r-c);if(!this._dontDrawOpen){let r=Math.max(d,Math.round(n.open*i)-t),o=r+l-1;o>d+_-1&&(o=d+_-1,r=o-l+1),e.fillRect(s,r,h,o-r+1)}let u=Math.max(d,Math.round(n.close*i)-t),p=u+l-1;p>d+_-1&&(p=d+_-1,u=p-l+1),e.fillRect(c+1,u,h,p-u+1)}}e.restore()}_getTolerance(){const e=this._calcBarWidth(1),t=this._thinBars?Math.min(e,1):e;return Object(s.interactionTolerance)().series+t/2}_getBarSpacing(){return this._barSpacing}
|
||
_calcBarWidth(e){const t=Math.floor(e);return Math.max(t,Math.floor(Object(s.optimalBarWidth)(this._barSpacing,e)))}}},"2EnG":function(e,t,i){"use strict";i.r(t),i.d(t,"StandardPivotPointsImageCache",(function(){return n}));var s=i("ikwP"),r=i("Eyy1");class n{constructor(e,t,i,r){this._priceAxisFontSize=11,this._prices=[],this._labelWidth=0,this._paneRenderParams=e,this._recreateCanvasAndContext(new s.Size(0,0)),this.reset({font:t,fontSize:i,backColors:r})}destroy(){delete this._canvas,delete this._cache}canvas(){return this._canvas}reset(e){this._renderParams=e,this._prices=[],this._cache.font=e.fontSize+"px "+e.font,this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce((e,t)=>{const i=this._cache.measureText(t).width;return Math.max(i,e)},0)}rowHeight(){return this._priceAxisFontSize+4}labelRectByIndex(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:Math.round(this._renderParams.fontSize+8)}}setPrices(e){let t=!1;const i=(e,t)=>{const i=void 0===e,s=void 0===t;return(!i&&!s||i===s)&&Object(r.ensureDefined)(e).formatted===Object(r.ensureDefined)(t).formatted};if(e.length!==this._prices.length)t=!0;else for(let s=0;s<this._prices.length;s++)if(!i(this._prices[s],e[s])){t=!0;break}if(t){const t=this._labelWidth+6,i=this._renderParams.fontSize,r=Math.max(e.length,22)*(i+8);this._recreateCanvasAndContext(new s.Size(t,r)),this._prices=e,this._cache.save(),Object(s.drawScaled)(this._cache,this._paneRenderParams.pixelRatio,()=>{this._cache.translate(.5,.5),this._cache.font=this._renderParams.fontSize+"px "+this._renderParams.font,this._cache.textBaseline="middle";for(let e=0;e<this._prices.length;e++){if(!this._prices[e])continue;const t=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"][e];this._cache.fillStyle=this._renderParams.backColors[e],this._cache.fillText(t,0,this._centerByIndex(e)),this._cache.fillText("/",0,this._centerByIndex(e+11))}}),this._cache.restore(),this._prices=e}}_recreateCanvasAndContext(e){this._canvas=document.createElement("canvas"),this._canvas.width=e.w*this._paneRenderParams.pixelRatio,this._canvas.height=e.h*this._paneRenderParams.pixelRatio,this._cache=Object(r.ensureNotNull)(this._canvas.getContext("2d"))}_centerByIndex(e){return Math.round((e+.5)*(this._renderParams.fontSize+8))}_topByIndex(e){return Math.round(e*(this._renderParams.fontSize+8))}}},"2S76":function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("hY0g"),n=i.n(r),o=i("+DwS"),a=i("dfhE"),l=i("8woN"),c=i.n(l);const h=["DJ","CBOE"];var u=i("txPx"),d=i("Cf1E");i.d(t,"DataUpdatedModeModel",(function(){return f}));const p=Object(u.getLogger)("Chart.Definitions.Series");function _(e){const t=[];return!function(e){return"index"===e.type&&h.includes(e.listed_exchange)}(e)?t.push("DelayToRealtime"):t.push("DelayNoRealtime"),t}function m(e,t){const i=[];return void 0!==(s=e.delay)&&s>0?_(e):function(e,t){return c.a.hasEodSymbols(e.full_name)||t===a.STATUS_EOD}(e,t)?(i.push("EOD"),i):i;var s}class f{constructor(e,t,i){
|
||
this._dataUpdatedModeStatus=new n.a(null),this._symbolInfo=Object(o.a)(e.getter,e.onChange),this._status=Object(o.a)(t.getter,t.onChange),this._symbolInfo.subscribe(this._update.bind(this)),this._status.subscribe(this._update.bind(this)),this._resetSubscription=i,this._resetSubscription.subscribe(this,this._resetStatus)}destroy(){this._symbolInfo.destroy(),this._status.destroy(),this._resetSubscription.unsubscribeAll(this)}status(){return this._dataUpdatedModeStatus.readonly()}symbolName(){const e=this._symbolInfo.value();return null!==e?e.name:""}time(){const e=this._symbolInfo.value(),t=null!==e&&e.delay&&e.delay>0?e.delay:900;return Math.round(t/60)}listedExchange(){const e=this._symbolInfo.value();return null!==e?e.listed_exchange:""}async description(){const e=this._symbolInfo.value();if(null===e)return"";let t={};try{t=Object(s.ensureNotNull)(await async function(e){return null}())}catch(i){p.logWarn("Cannot get exchange "+Object(d.a)(i))}return t.description||e.listed_exchange}exchange(){const e=this._symbolInfo.value();return null!==e?e.exchange:""}_resetStatus(){this._dataUpdatedModeStatus.setValue(null)}_update(){const e=this._symbolInfo.value();if(null===e)return void this._dataUpdatedModeStatus.setValue(null);const t=this._status.value();if("string"==typeof t)return void this._dataUpdatedModeStatus.setValue(null);if(t===a.STATUS_LOADING||t===a.STATUS_RESOLVING)return;const i=m(e,t);0!==i.length?this._dataUpdatedModeStatus.setValue(i):this._dataUpdatedModeStatus.setValue(null)}}},"2WC2":function(e,t,i){"use strict";var s=i("Eyy1"),r=i("aO4+"),n=i("f6yo"),o=i("VdBB");function a(e,t,i){const s=e.get(t);return void 0!==s?s:(e.set(t,i),i)}function l(e,t,i,s){const r=a(e,t,new Map);return a(r,i,s)}class c{constructor(){this._map=new Map,this._size=0}size(){return this._size}clear(){this._map.clear(),this._size=0}}var h=i("gBDZ");class u extends c{constructor(e){super(),this._maxSize=e,this._keysQueue=[]}get(e){if(!e.text||!e.fontSize||!e.align)return null;const t=e.fontSize,i=e.text,s=e.align,r=l(this._map,t,s,new Map);let n=r.get(i);return void 0!==n||(this._size>=this._maxSize?this._deleteFirstKey():++this._size,this._keysQueue.push([t,i,s]),n=new h.b(e.text,e.bold,e.italic,e.font,e.fontSize,e.align),r.set(i,n)),n}_deleteFirstKey(){const e=this._keysQueue.shift(),t=e[0],i=e[1],s=this._map.get(t);s.delete(i),0===s.size&&this._map.delete(t)}}var d=i("zDbI"),p=i("ikwP");i.d(t,"b",(function(){return _})),i.d(t,"c",(function(){return m})),i.d(t,"a",(function(){return f}));class _{constructor(e,t={skipRenderingOptimizations:!1}){this._height=void 0!==e.height?e.height:e.width,this._width=void 0!==e.width?e.width:e.height,this._items=[],this._barSpacing=0,this._textCache=t.textCache||new u(5e3),this._drawOperation=t.skipRenderingOptimizations?this._drawWithoutOptimizations.bind(this):this._drawWithOptimizations.bind(this),this._color=e.color,this._borderColor=e.borderColor,this._vertOffset=e.vertOffset||0,e.text&&(this._text=e.text,this._fontSize=e.fontSize,this._textColor=e.textColor,
|
||
this._textAlign=e.textAlign||"center"),void 0!==e.items&&void 0!==e.barSpacing&&this.setData(e.items,e.barSpacing)}draw(e,t){this._preDrawInit(),this._drawOperation(e,t)}hitTest(e){const t=o.HitTestResult.REGULAR;let i=null;for(const s of this._items){if(!s)continue;const r=this._calcBoundingBox(s);if(r&&Object(n.pointInBox)(e,r)){const e={tooltip:this._getTooltip(s,r)};i=new o.HitTestResult(t,e)}}return i}setData(e,t){this._setBaseData(e,t)}_calcBoundingBox(e){const t=e.vertOffset,i=this._getTextCache(e);if(!i)return;const s=i.textImageWidth,n=i.textImageHeight,o=s/2,a=e.y+t+e.textVertOffset,l=t>0?0:-n,c=t>0?n:0,h=new r.Point(e.x-o,a+l),u=new r.Point(e.x+o,a+c);return Object(r.box)(h,u)}_unionBox(e,t){const i=Math.min(e.min.x,t.min.x),s=Math.max(e.max.x,t.max.x),n=Math.min(e.min.y,t.min.y),o=Math.max(e.max.y,t.max.y),a=new r.Point(i,n),l=new r.Point(s,o);return Object(r.box)(a,l)}_getTooltip(e,t){if(e.tooltip)return{content:{type:"text",data:e.tooltip},tooltipDelay:200,extendMargin:!0,rect:{x:t.min.x,y:t.min.y,w:Math.abs(t.max.x-t.min.x),h:Math.abs(t.max.y-t.min.y)}}}_setBaseData(e,t){this._items.length=0,this._barSpacing=t;for(const i of e){const e=void 0===i.width?Object(s.ensureDefined)(this._width):i.width,t=void 0===i.height?Object(s.ensureDefined)(this._height):i.height,r=void 0===i.vertOffset?this._vertOffset:i.vertOffset,n=r>0?t:-t;this._items.push(Object.assign({width:e,height:t,vertOffset:r,textVertOffset:n,shapeWidth:0,shapeHeight:0,stepX:0,stepY:0},i))}}_drawItemText(e,t,i){const s=this._getTextCache(i);if(null===s)return;const r=i.x,n=i.vertOffset,o=i.y+n+i.textVertOffset;let a;a=i.style&&void 0!==i.style.textColor?i.style.textColor:this._textColor,s.paintTo(e,t,a,r,o,h.a.Center,n>0?h.c.Top:h.c.Bottom)}_drawWithOptimizations(e,t){let i,s,r=null,n=!1;for(const o of this._items)o.style&&void 0!==o.style.color?(i=o.style.color,s=o.style.borderColor):(i=this._color,s=this._borderColor),r!==i&&(r=i,n&&this._endPath(e),this._startPath(e,t,i,s)),this._drawItemShape(e,t,o),n=!0;n&&this._endPath(e);for(const o of this._items)this._drawItemText(e,t,o)}_drawWithoutOptimizations(e,t){let i,r;for(const n of this._items){const o=Object(s.ensureDefined)(n.style);i=Object(s.ensureDefined)(o.color),r=o.borderColor,this._startPath(e,t,i,r),this._drawItemShape(e,t,n),this._endPath(e),this._drawItemText(e,t,n)}}_drawItemShape(e,t,i){Object(p.drawScaled)(e,t.pixelRatio,()=>this._drawItemShapeUsingCSSPixels(e,i))}_drawItemShapeUsingCSSPixels(e,t){}_preDrawInit(){}_startPath(e,t,i,s){}_endPath(e){}_getTextCache(e){const t=e.text||this._text,i=e.fontSize||this._fontSize,s=e.textAlign||this._textAlign;return this._textCache.get({text:t,bold:!1,italic:!1,font:d.CHART_FONT_FAMILY,fontSize:i,align:s})}}class m extends _{_startPath(e,t,i,s){e.beginPath(),e.lineWidth=this._lineWidth(t),e.lineCap="butt",e.strokeStyle=i}_endPath(e){e.stroke()}_lineWidth(e){return Math.max(1,Math.floor(2*e.pixelRatio))}}class f extends _{_startPath(e,t,i,s){e.beginPath(),e.lineWidth=this._lineWidth(t),e.lineCap="butt",e.fillStyle=i,e.strokeStyle=s}
|
||
_endPath(e){e.fill(),e.stroke()}_lineWidth(e){return Math.max(1,Math.floor(e.pixelRatio))}}},"2bPF":function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("7KDR").Action,n=i("Ocx9").DefaultProperty,o=i("k9/m").PlotRowSearchMode,a=i("Ye2/").LineToolBarsPatternMode;class l extends s{constructor(e,t){var s=t||l.createProperties();super(e,s),s.mirrored.listeners().subscribe(this,l.prototype.mirror),s.flipped.listeners().subscribe(this,l.prototype.flip),this._scaleCoeff=1,this.version=l.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,l.prototype.onModeChanged),i.e("lt-pane-views").then(i.t.bind(null,"c6sA",7)).then(({BarsPatternPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}isSynchronizable(){return!1}onModeChanged(){var e=this.patternPriceDiff();e*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+e}additionalActions(e){var t=this;return[new r({checked:this.properties().mirrored.value(),checkable:!0,label:window.t("Mirrored"),payload:{target:this},onExecute:function(t){var i=t.getPayload().target;e.setProperty(i.properties().mirrored,!i.properties().mirrored.value(),"Bats Pattern Mirroring"),i.updateAllViews(),i._model.updateSource(i)}}),new r({checked:this.properties().flipped.value(),checkable:!0,label:window.t("Flipped"),payload:{target:this},onExecute:function(t){var i=t.getPayload().target;e.setProperty(i.properties().flipped,!i.properties().flipped.value(),"Bats Pattern Flipping"),i.updateAllViews(),i._model.updateSource(i)}}),new r({checkable:!0,label:window.t("Restore Size"),onExecute:function(i){var s=t.points()[0],r=t.patternPriceDiff(),n=s.price+r,o=s.index+t._pattern.length-1;e.startChangingLinetool(t,{price:n,index:o},1,{}),e.changeLinePoint({price:n,index:o},{}),e.endChangingLinetool()}})]}pointsCount(){return 2}_preparePoint(e,t){e=this._alignPointToRangeOfActualData(e);var i=this._model.mainSeries();this.properties().mode.value()===a.Bars?e.price=i.bars().valueAt(e.index)[TradingView.HIGH_PLOT]:e.price=i.bars().valueAt(e.index)[TradingView.CLOSE_PLOT];var r=this.priceScale(),n=this.ownerSource().firstValue(),o=.05*r.height(),l=r.priceToCoordinate(e.price,n)-o;return e.price=r.coordinateToPrice(l,n),s.prototype._preparePoint.call(this,e,t)}state(e){var t=s.prototype.state.call(this,e);return t.pattern=this._pattern,t}restoreData(e){e.pattern&&(this._pattern=e.pattern)}name(){return"Bars Pattern"}hasEditableCoordinates(){return!1}cloneData(e){this._pattern=TradingView.clone(e._pattern)}mirror(){for(var e=this._pattern,t=e[0][TradingView.HIGH_PLOT],i=Math.min(e[0][TradingView.LOW_PLOT],e[0][TradingView.HIGH_PLOT]),s=Math.max(e[0][TradingView.LOW_PLOT],e[0][TradingView.HIGH_PLOT]),r=1;r<e.length;r++)i=Math.min(i,e[r][TradingView.LOW_PLOT]),s=Math.max(s,e[r][TradingView.HIGH_PLOT]);if(i<s){var n=(i+s)/2,o=function(e){return n-(e-n)};for(r=0;r<e.length;r++)e[r][TradingView.HIGH_PLOT]=o(e[r][TradingView.HIGH_PLOT]),e[r][TradingView.LOW_PLOT]=o(e[r][TradingView.LOW_PLOT]),
|
||
e[r][TradingView.OPEN_PLOT]=o(e[r][TradingView.OPEN_PLOT]),e[r][TradingView.CLOSE_PLOT]=o(e[r][TradingView.CLOSE_PLOT])}var a=e[0][TradingView.HIGH_PLOT]-t,l=e[e.length-1][TradingView.LOW_PLOT]-e[0][TradingView.HIGH_PLOT];this._points[0].price+=a,this._points[1].price=this._points[0].price+l,this.updateAllViews()}flip(){this._points[0].price=this._points[1].price;for(var e=0;e<this._pattern.length/2;e++){var t=this._pattern[e];this._pattern[e]=this._pattern[this._pattern.length-e-1],this._pattern[this._pattern.length-e-1]=t}var i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT];this._points[1].price=this._points[0].price+i,this.updateAllViews()}firstPatternPrice(){var e=parseInt(this.properties().mode.value(),10);if(e===a.LineHL2)return(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2;var t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT}[e];return this._pattern[0][t]}lastPatternPrice(){var e=parseInt(this.properties().mode.value(),10);if(e===a.LineHL2)return(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2;var t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT}[e];return this._pattern[this._pattern.length-1][t]}patternPriceDiff(){return this.lastPatternPrice()-this.firstPatternPrice()}pressCoeff(){var e=this.patternPriceDiff(),t=this.points()[0].price,i=(this.points()[1].price-t)/e;return this._pressCoeff=i,i}addPoint(e,t){var i=s.prototype.addPoint.call(this,e,t,!0);if(i){var r=Math.min(this.points()[0].index,this.points()[1].index),n=Math.max(this.points()[0].index,this.points()[1].index),a=this._model.mainSeries().nearestIndex(r,o.NearestRight),l=this._model.mainSeries().nearestIndex(n,o.NearestLeft);this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[];for(var c=a;c<=l;c++){var h=this._model.mainSeries().data().valueAt(c);this._pattern.push(TradingView.clone(h))}if(this._pattern.length>0){var u=this.patternPriceDiff();this._points[1].price=this._points[0].price+u,this._points[1].index=this._points[0].index+(l-a),this.normalizePoints(),this.createServerPoints()}}return i}setPoint(e,t,i){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),super.setPoint(e,t,i)}migrateVersion(e,t,i){if(1===e&&this._pattern.length>0){var s=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+s),2===this._points.length&&(this._points[1].price=this._points[0].price+s)}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"8ioM"))).BarsPatternDefinitionsViewModel}static createProperties(e){
|
||
var t=new n("linetoolbarspattern",e);return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.addExclusion("mirrored"),e.addExclusion("flipped")}}l.version=2,t.LineToolBarsPattern=l},"2cgs":function(e,t,i){"use strict";var s=i("ocLq");JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i,r){return s.Std.or(s.Std.and(s.Std.eq(e,t),s.Std.eq(e,i)),s.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*r},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0(s.Std.close(this._context),s.Std.high(this._context),s.Std.low(this._context),s.Std.volume(this._context));return[s.Std.cum(i,this._context)]}}},{name:"Accumulative Swing Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){var i=t.new_var(s.Std.open(t)),r=t.new_var(s.Std.high(t)),n=t.new_var(s.Std.low(t)),o=t.new_var(s.Std.close(t)),a=s.Std.abs(r-o.get(1)),l=s.Std.abs(n-o.get(1)),c=s.Std.abs(r-n),h=s.Std.abs(o.get(1)-i.get(1)),u=s.Std.max(a,l),d=s.Std.iff(a>=s.Std.max(l,c),a-.5*l+.25*h,s.Std.iff(l>=s.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return s.Std.iff(0===d,0,(o-o.get(1)+.5*(o-i)+.25*(o.get(1)-i.get(1)))/d*u/e*50)},this.f_1=function(e,t){var i=this.f_0(e,t);return s.Std.cum(i,t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);return[this.f_1(i,this._context)]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline",format:{precision:2,type:"price"}},
|
||
constructor:function(){this.f_0=function(e,t){return s.Std.gt(e,t)},this.f_1=function(e,t){return s.Std.lt(e,t)},this.f_2=function(e,t){return 0===t?e:e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(s.Std.close(this._context),s.Std.open(this._context)),n=this._context.new_var(r),o=s.Std.sum(n,i,this._context),a=this.f_1(s.Std.close(this._context),s.Std.open(this._context)),l=this._context.new_var(a),c=s.Std.sum(l,i,this._context);return[this.f_2(o,c)]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._input(2),a=this._context.new_var(i);return[s.Std.alma(a,r,n,o)]}}},{name:"Aroon",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FB8C00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon",format:{precision:2,type:"percent"}},constructor:function(){this.f_0=function(e,t){return 100*(e+t)/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.high(this._context),n=i+1,o=this._context.new_var(r),a=s.Std.highestbars(o,n,this._context),l=this.f_0(a,i),c=s.Std.low(this._context),h=this._context.new_var(c),u=s.Std.lowestbars(h,n,this._context);return[l,this.f_0(u,i)]}}},{name:"Average Price",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"AveragePrice@tv-basicstudies-1",scriptIdPart:"",name:"Average Price",description:"Average Price",shortDescription:"Average Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{}},styles:{plot_0:{
|
||
title:"Plot"}},inputs:[],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[s.Std.ohlc4(this._context)]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF5252"}},inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e){var t=this._context.new_var(s.Std.high(this._context)),i=s.Std.change(t),r=this._context.new_var(s.Std.low(this._context)),n=-s.Std.change(r),o=this._context.new_var(s.Std.tr(void 0,this._context)),a=s.Std.rma(o,e,this._context),l=this._context.new_var(s.Std.and(s.Std.gt(i,n),s.Std.gt(i,0))?i:0),c=s.Std.fixnan(100*s.Std.rma(l,e,this._context)/a,this._context),h=this._context.new_var(s.Std.and(s.Std.gt(n,i),s.Std.gt(n,0))?n:0);return[c,s.Std.fixnan(100*s.Std.rma(h,e,this._context)/a,this._context)]},this.f_1=function(e,t){var i=this.f_0(e),r=i[0],n=i[1],o=r+n,a=this._context.new_var(s.Std.abs(r-n)/(s.Std.eq(o,0)?1:o));return[100*s.Std.rma(a,t,this._context)]},this.main=function(e,t){return this._context=e,this._input=t,this._context.setMinimumAdditionalDepth(this._input(0)+this._input(1)),this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#B71C1C"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.tr(this._context),n=this._context.new_var(r);return[s.Std.rma(n,i,this._context)]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:0,visible:!0,color:"#000080"}},palettes:{palette_0:{colors:{0:{color:"#F44336",width:1,style:0},1:{color:"#009688",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,
|
||
joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){return s.Std.le(e,0)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.hl2(this._context),r=this._context.new_var(i),n=s.Std.sma(r,5,this._context),o=this._context.new_var(i),a=s.Std.sma(o,34,this._context),l=this.f_0(n,a),c=l,h=this._context.new_var(l),u=s.Std.change(h);return[c,this.f_1(u)]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF5252"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i,s){return(e-t)/(i-s)},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0(s.Std.close(this._context),s.Std.open(this._context),s.Std.high(this._context),s.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._context.new_var(i),a=s.Std.sma(o,r,this._context),l=this._context.new_var(i),c=s.Std.stdev(l,r,this._context),h=this.f_0(n,c);return[a,this.f_1(a,h),this.f_2(a,h)]}
|
||
}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#26A69A"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#26A69A",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/(i-t)},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._context.new_var(i),a=s.Std.sma(o,r,this._context),l=this._context.new_var(i),c=s.Std.stdev(l,r,this._context),h=this.f_0(n,c),u=this.f_1(a,h),d=this.f_2(a,h);return[this.f_3(i,d,u)]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/i},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._context.new_var(i),a=s.Std.sma(o,r,this._context),l=this._context.new_var(i),c=s.Std.stdev(l,r,this._context),h=this.f_0(n,c),u=this.f_1(a,h),d=this.f_2(a,h);return[this.f_3(u,d,a)]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],
|
||
styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i,r){return s.Std.or(s.Std.and(s.Std.eq(e,t),s.Std.eq(e,i)),s.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*r},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(s.Std.close(this._context),s.Std.high(this._context),s.Std.low(this._context),s.Std.volume(this._context)),n=this._context.new_var(r),o=s.Std.sum(n,i,this._context),a=s.Std.volume(this._context),l=this._context.new_var(a),c=s.Std.sum(l,i,this._context);return[this.f_1(o,c)]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#EC407A"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.accdist(this._context),o=this._context.new_var(n),a=s.Std.ema(o,i,this._context),l=this._context.new_var(n),c=s.Std.ema(l,r,this._context);return[this.f_0(a,c)]}}},{name:"Chaikin Volatility",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Chaikin Volatility@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Volatility",description:"Chaikin Volatility",shortDescription:"Chaikin Volatility",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#AB47BC"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{periods:10,rocLookback:10}},styles:{plot_0:{title:"Plot"}},bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"periods",type:"integer",name:"Periods"},{id:"rocLookback",type:"integer",name:"Rate of Change Lookback"}],format:{type:"volume"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.rocLookback=this._input(1)},this.main=function(e,t){this._context=e,this._input=t,this._context.setMinimumAdditionalDepth(this.period+this.rocLookback)
|
||
;var i=this._context.new_var(s.Std.high(this._context)-s.Std.low(this._context)),r=this._context.new_var(s.Std.ema(i,this.period,this._context));return[s.Std.roc(r,this.rocLookback)]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t,i){return e-t*i},this.f_1=function(e,t,i){return e+t*i},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2),o=s.Std.high(this._context),a=this._context.new_var(o),l=s.Std.highest(a,i,this._context),c=s.Std.atr(i,this._context),h=this.f_0(l,r,c),u=this._context.new_var(o),d=s.Std.lowest(u,i,this._context),p=this.f_1(d,r,c),_=this._context.new_var(h),m=s.Std.highest(_,n,this._context),f=this._context.new_var(p);return[s.Std.lowest(f,n,this._context),m]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator",format:{type:"price",precision:2}},constructor:function(){this.f_0=function(e){return s.Std.ge(e,0)?e:0},this.f_1=function(e){return s.Std.ge(e,0)?0:-e},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return this.f_2(e-t,e+t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.close(this._context),n=this._context.new_var(r),o=s.Std.change(n),a=this.f_0(o),l=this.f_1(o),c=this._context.new_var(a),h=s.Std.sum(c,i,this._context),u=this._context.new_var(l),d=s.Std.sum(u,i,this._context);return[this.f_3(h,d)]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:0,visible:!0,color:"#000080"}},palettes:{palette_0:{
|
||
colors:{0:{color:"#26C6DA",width:1,style:0},1:{color:"#43A047",width:1,style:0},2:{color:"#A5D6A7",width:1,style:0},3:{color:"#009688",width:1,style:0},4:{color:"#D50000",width:1,style:0},5:{color:"#E91E63",width:1,style:0},6:{color:"#FF6D00",width:1,style:0},7:{color:"#FFB74D",width:1,style:0},8:{color:"#FDD835",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone",format:{precision:0,type:"price"}},constructor:function(){this.f_0=function(){var e=s.Std.close(this._context),t=s.Std.hlc3(this._context),i=this._context.new_var(s.Std.high(this._context)),r=s.Std.highest(i,30,this._context),n=s.Std.lowest(i,30,this._context),o=25/(r-n)*n,a=this._context.new_var(e),l=this._context.new_var(s.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/t*o,h=s.Std.sqrt(1+c*c),u=s.Std.round(180*s.Std.acos(1/h)/3.141592653589793),d=s.Std.iff(s.Std.gt(c,0),-u,u),p=s.Std.and(s.Std.gt(d,-2.14),s.Std.le(d,-.71))?7:8,_=s.Std.and(s.Std.gt(d,-3.57),s.Std.le(d,-2.14))?6:p,m=s.Std.and(s.Std.gt(d,-5),s.Std.le(d,-3.57))?5:_,f=s.Std.le(d,-5)?4:m,g=s.Std.and(s.Std.lt(d,2.14),s.Std.ge(d,.71))?3:f,v=s.Std.and(s.Std.lt(d,3.57),s.Std.ge(d,2.14))?2:g,b=s.Std.and(s.Std.lt(d,5),s.Std.ge(d,3.57))?1:v;return[1,s.Std.ge(d,5)?0:b]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index",format:{type:"price",precision:2}},constructor:function(){this.f_0=function(e,t,i,r){return 100*s.Std.log10(e/(t-i))/r},this.main=function(e,t){this._context=e,this._input=t
|
||
;var i=this._input(0),r=s.Std.atr(1,this._context),n=this._context.new_var(r),o=s.Std.sum(n,i,this._context),a=s.Std.high(this._context),l=this._context.new_var(a),c=s.Std.highest(l,i,this._context),h=s.Std.low(this._context),u=this._context.new_var(h),d=s.Std.lowest(u,i,this._context),p=s.Std.log10(i);return[this.f_0(o,c,d,p)]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i){return(e-t)/(.015*i)},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.hlc3(this._context),r=this._input(0),n=this._context.new_var(i),o=s.Std.sma(n,r,this._context),a=this._context.new_var(i),l=s.Std.dev(a,r,this._context);return[this.f_0(i,o,l)]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI",format:{precision:2,type:"price"}},constructor:function(){var e;this.f_1=function(e,t,i){var r=i.new_var(s.Std.max(s.Std.change(e),0));return s.Std.rma(r,t,i)},this.f_2=function(e,t,i){var r=i.new_var(-s.Std.min(s.Std.change(e),0));return s.Std.rma(r,t,i)},this.f_3=(e=0,function(t){var i=t.get(0),r=t.get(1)
|
||
;return e=i===r?0:i>r?s.Std.nz(e)<=0?1:s.Std.nz(e)+1:s.Std.nz(e)>=0?-1:s.Std.nz(e)-1,this._context.new_var(e)}),this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._context.new_var(i),n=this._input(0),o=this._input(1),a=this._input(2);this._context.setMinimumAdditionalDepth(a);var l=s.Std.rsi(this.f_1(r,n,this._context),this.f_2(r,n,this._context)),c=this.f_3(r),h=s.Std.rsi(this.f_1(c,o,this._context),this.f_2(c,o,this._context)),u=this._context.new_var(s.Std.roc(r,1)),d=s.Std.percentrank(u,a);return[s.Std.avg(l,h,d)]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e+t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2);this._context.setMinimumAdditionalDepth(i+Math.max(r,n));var o=s.Std.close(this._context),a=this._context.new_var(o),l=s.Std.roc(a,r),c=this._context.new_var(o),h=s.Std.roc(c,n),u=this.f_0(l,h),d=this._context.new_var(u);return[s.Std.wma(d,i,this._context)]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff",format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),s.Std.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_unlimited_var(this._context.symbol.time),r=(this._input(0),s.Std.period(this._context),s.Std.close(this._context)),n=this._input(1);this._context.select_sym(1);var o=this._context.new_unlimited_var(this._context.symbol.time),a=s.Std.close(this._context),l=this._context.new_unlimited_var(a);this._context.select_sym(0);var c=l.adopt(o,i,0),h=this._context.new_var(r),u=this._context.new_var(c)
|
||
;return[s.Std.correlation(h,u,n,this._context)]}}},{name:"Correlation - Log",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Correlation - Log@tv-basicstudies-1",scriptIdPart:"",name:"Correlation - Log",description:"Correlation - Log",shortDescription:"Correlation - Log",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{instrument:"INTC",instrument2:"AMZN",periods:25}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"instrument",name:"Instrument 1",type:"symbol",defval:"INTC"},{id:"instrument2",name:"Instrument 2",type:"symbol",defval:"AMZN"},{id:"periods",name:"Periods",type:"integer",defval:25}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),s.Std.period(this._context)),this._context.new_sym(this._input(1),s.Std.period(this._context)),this.period=this._input(2)},this.correlationLog=function(e,t,i,r){var n=s.Std.sma(e,i,r),o=s.Std.sma(t,i,r),a=r.new_var(e.get()*t.get());return(s.Std.sma(a,i,r)-n*o)/Math.sqrt(s.Std.variance2(e,n,i)*s.Std.variance2(t,o,i))},this.main=function(e,t){this._context=e,this._input=t,this._context.select_sym(1);var i=this._context.new_var(this._context.symbol.time);this._context.select_sym(2);var r=this._context.new_var(s.Std.close(this._context)),n=this._context.new_var(s.Std.log(r.get()/r.get(1))),o=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var a=this._context.new_var(s.Std.close(this._context)),l=this._context.new_var(s.Std.log(a.get()/a.get(1))),c=this._context.new_var(n.adopt(o,i,0));return[this.correlationLog(l,c,this.period,this._context)]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator",format:{type:"price",precision:2}},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1);this._context.setMinimumAdditionalDepth(e+i);var r=this._context.new_var(s.Std.close(this._context)),n=this._context.new_var(s.Std.sma(r,e,this._context)),o=this._context.new_var(s.Std.close(this._context)).get(i)-n,a=s.Std.close(this._context)-n.get(i);return[t?o:a,t?-i:0]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0()
|
||
;return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"}},inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index",format:{precision:4,type:"price"}},constructor:function(){this.f_0=function(e){return-e},this.f_1=function(e,t){return s.Std.and(s.Std.gt(e,t),s.Std.gt(e,0))?e:0},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return e+t},this.f_4=function(e,t,i){return s.Std.abs(e-t)/(s.Std.eq(i,0)?1:i)},this.f_5=function(e){return 100*e},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1);this._context.setMinimumAdditionalDepth(i+r);var n=s.Std.high(this._context),o=this._context.new_var(n),a=s.Std.change(o),l=s.Std.low(this._context),c=this._context.new_var(l),h=s.Std.change(c),u=this.f_0(h),d=s.Std.tr(this._context),p=this._context.new_var(d),_=s.Std.rma(p,i,this._context),m=this.f_1(a,u),f=this._context.new_var(m),g=s.Std.rma(f,i,this._context),v=this.f_2(g,_),b=s.Std.fixnan(v,this._context),S=this.f_1(u,a),y=this._context.new_var(S),w=s.Std.rma(y,i,this._context),C=this.f_2(w,_),P=s.Std.fixnan(C,this._context),x=this.f_3(b,P),T=this.f_4(b,P,x),M=this._context.new_var(T),I=s.Std.rma(M,r,this._context);return[b,P,this.f_5(I)]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",
|
||
type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.low(this._context),n=this._context.new_var(r),o=s.Std.lowest(n,i,this._context),a=s.Std.high(this._context),l=this._context.new_var(a),c=s.Std.highest(l,i,this._context);return[o,c,s.Std.avg(c,o)]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);this._context.setMinimumAdditionalDepth(2*i);var r=s.Std.close(this._context),n=this._context.new_var(r),o=s.Std.ema(n,i,this._context),a=this._context.new_var(o),l=s.Std.ema(a,i,this._context);return[this.f_0(o,l)]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i,s,r){return e*t*(i-s)/r},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.hl2(this._context),o=this._context.new_var(n),a=s.Std.change(o),l=this.f_0(i,a,s.Std.high(this._context),s.Std.low(this._context),s.Std.volume(this._context)),c=this._context.new_var(l);return[s.Std.sma(c,r,this._context)]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{
|
||
id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){return e*t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.close(this._context),n=this._context.new_var(r),o=s.Std.change(n),a=this.f_0(o,s.Std.volume(this._context)),l=this._context.new_var(a);return[s.Std.ema(l,i,this._context)]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.close(this._context),o=this._context.new_var(n),a=s.Std.ema(o,i,this._context),l=this._context.new_var(n),c=s.Std.ema(l,r,this._context),h=a,u=c,d=s.Std.cross(a,c,this._context);return[h,u,this.f_0(d,a)]}}},{name:"Envelopes",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,in_1:10,in_2:10,in_3:"Simple",in_4:"close"}},plots:[{id:"plot_1",type:"line"},{id:"plot_0",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Average",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelopes",shortDescription:"Envelopes",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Upper Percentage",defval:2,type:"float",min:0},{id:"in_2",name:"Lower Percentage",defval:2,type:"float",
|
||
min:0},{id:"in_3",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]},{id:"in_4",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelopes",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e*(1+t)},this.f_1=function(e,t){return e*(1-t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(s.Std[this._input(4)](this._context)),r=s.Std.sma(i,this._input(0),this._context);return"Exponential"===this._input(3)?r=s.Std.ema(i,this._input(0),this._context):"Weighted"===this._input(3)&&(r=s.Std.wma(i,this._input(0),this._context)),[this.f_0(r,this._input(1)/100),r,this.f_1(r,this._input(2)/100)]}}},{name:"Standard Error",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Standard Error@tv-basicstudies-1",scriptIdPart:"",name:"Standard Error",description:"Standard Error",shortDescription:"Standard Error",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},inputs:{length:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"length",type:"integer",name:"Length"}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0)},this.main=function(e,t){this._context=e,this._input=t;for(var i,r,n=this._context.new_var(s.Std.close(this._context)),o=0,a=0,l=0;l<this.period;l++)o+=l+1,a+=n.get(l);i=o/this.period,r=a/this.period;var c=0,h=0,u=0;for(l=0;l<this.period;l++)u+=Math.pow(r-n.get(l),2),h+=(i-l-1)*(r-n.get(l)),c+=Math.pow(i-l-1,2);return h=Math.pow(h,2),[Math.sqrt((u-h/c)/(this.period-2))]}}},{name:"Standard Error Bands",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Standard Error Bands@tv-basicstudies-1",scriptIdPart:"",name:"Standard Error Bands",description:"Standard Error Bands",shortDescription:"Standard Error Bands",plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#2196F3"},plot_1:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#FF6D00"},plot_2:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{periods:21,errors:2,method:"Simple",averagePeriods:3}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"},plot_2:{title:"Plot 3"}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Background"}],inputs:[{id:"periods",type:"integer",name:"Periods"},{id:"errors",type:"float",name:"Standard Errors"},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]},{id:"averagePeriods",
|
||
type:"integer",name:"Averaging Periods"}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.errorDeviation=this._input(1),this.maMethod=this._input(2),this.averagePeriod=this._input(3)},this.main=function(e,t){this._context=e,this._input=t;for(var i,r,n=this._context.new_var(s.Std.close(this._context)),o=0,a=0,l=0;l<this.period;l++)o+=l+1,a+=n.get(l);i=o/this.period,r=a/this.period;var c=0,h=0,u=0;for(l=0;l<this.period;l++)u+=Math.pow(r-n.get(l),2),h+=(i-l-1)*(r-n.get(l)),c+=Math.pow(i-l-1,2);h=Math.pow(h,2);var d,p,_,m=Math.sqrt((u-h/c)/(this.period-2)),f=s.Std.linreg(n,this.period,0),g=this._context.new_var(f+this.errorDeviation*m),v=this._context.new_var(f),b=this._context.new_var(f-this.errorDeviation*m);return"Simple"===this.maMethod?(d=s.Std.sma(g,this.averagePeriod,this._context),p=s.Std.sma(v,this.averagePeriod,this._context),_=s.Std.sma(b,this.averagePeriod,this._context)):"Exponential"===this.maMethod?(d=s.Std.ema(g,this.averagePeriod,this._context),p=s.Std.ema(v,this.averagePeriod,this._context),_=s.Std.ema(b,this.averagePeriod,this._context)):(d=s.Std.wma(g,this.averagePeriod,this._context),p=s.Std.wma(v,this.averagePeriod,this._context),_=s.Std.wma(b,this.averagePeriod,this._context)),[d,p,_]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},bands:[{color:"#E91E63",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#E91E63",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#E91E63",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e){var t=s.Std.lt(e,-.99)?-.999:e;return[s.Std.gt(e,.99)?.999:t]},this.f_1=function(){
|
||
var e=this._input(0),t=this._context.new_var(s.Std.hl2(this._context)),i=s.Std.highest(t,e,this._context),r=this._context.new_var(s.Std.hl2(this._context)),n=s.Std.lowest(r,e,this._context),o=this._context.new_var(),a=this.f_0(.66*((s.Std.hl2(this._context)-n)/s.Std.max(i-n,.001)-.5)+.67*s.Std.nz(o.get(1)));o.set(a[0]);var l=this._context.new_var();l.set(.5*s.Std.log((1+o.get(0))/s.Std.max(1-o.get(0),.001))+.5*s.Std.nz(l.get(1)));var c=l.get(1);return[l.get(0),c]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"Historical Volatility",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Historical Volatility",shortDescription:"HV",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1e12}],id:"historical_volatility@tv-basicstudies-1",scriptIdPart:"",name:"Historical Volatility",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(){var e=this._input(0),t=s.Std.or(s.Std.isintraday(this._context),s.Std.and(s.Std.isdaily(this._context),s.Std.eq(s.Std.interval(this._context),1)))?1:7,i=this._context.new_var(s.Std.close(this._context)),r=this._context.new_var(s.Std.log(s.Std.close(this._context)/i.get(1)));return[100*s.Std.stdev(r,e,this._context)*s.Std.sqrt(365/t)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Hull MA",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull Moving Average",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Hull MA@tv-basicstudies-1",scriptIdPart:"",name:"Hull MA",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=r/2;this._context.setMinimumAdditionalDepth(Math.ceil(r+n));var o=this._context.new_var(i),a=s.Std.wma(o,n,this._context),l=this._context.new_var(i),c=s.Std.wma(l,r,this._context),h=this.f_0(a,c),u=s.Std.sqrt(r),d=s.Std.round(u),p=this._context.new_var(h);return[s.Std.wma(p,d,this._context)]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#B71C1C"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_3:{
|
||
linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#A5D6A7"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#EF9A9A"}},palettes:{palette_0:{colors:{0:{color:"#43A047",width:1,style:0},1:{color:"#F44336",width:1,style:0}}}},filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",palette:"palette_0",target:"fill_0",type:"colorer"}],styles:{plot_0:{title:"Conversion Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Base Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Lagging Span",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Lead 1",histogramBase:0,joinPoints:!1,isHidden:!1},plot_4:{title:"Lead 2",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ichimoku Cloud",shortDescription:"Ichimoku",is_price_study:!0,is_hidden_study:!1,id:"Ichimoku Cloud@tv-basicstudies-1",palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background",isHidden:!1,palette:"palette_0"}],inputs:[{id:"in_0",name:"Conversion Line Periods",defval:9,type:"integer",min:1,max:1e12},{id:"in_1",name:"Base Line Periods",defval:26,type:"integer",min:1,max:1e12},{id:"in_2",name:"Lagging Span 2 Periods",defval:52,type:"integer",min:1,max:1e12},{id:"in_3",name:"Displacement",defval:26,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"Ichimoku Cloud",format:{type:"inherit"}},constructor:function(){this.donchian=function(e){var t=this._context.new_var(s.Std.low(this._context)),i=this._context.new_var(s.Std.high(this._context));return s.Std.avg(s.Std.lowest(t,e,this._context),s.Std.highest(i,e,this._context))},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),r=this._input(3),n=this.donchian(e),o=this.donchian(t),a=s.Std.avg(n,o),l=this.donchian(i);return[n,o,s.Std.close(this._context),a,l,1-r,r-1,r-1,s.Std.gt(a,l)?0:1]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_1();return[i[0],i[1],{value:i[2],offset:i[5]},{value:i[3],offset:i[6]},{value:i[4],offset:i[7]},i[8]]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",
|
||
histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"mult",defval:1,type:"float",min:-1e12,max:1e12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t,i,s){return e?t:i-s},this.f_1=function(e,t,i){return e+t*i},this.f_2=function(e,t,i){return e-t*i},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._input(2),a=this._context.new_var(i),l=s.Std.ema(a,n,this._context),c=this.f_0(r,s.Std.tr(this._context),s.Std.high(this._context),s.Std.low(this._context)),h=this._context.new_var(c),u=s.Std.ema(h,n,this._context);return[this.f_1(l,u,o),l,this.f_2(l,u,o)]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){return s.Std.ge(e,0)?t:-t},this.f_1=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.hlc3(this._context);this._context.setMinimumAdditionalDepth(66);var r=this._context.new_var(i),n=s.Std.change(r),o=this.f_0(n,s.Std.volume(this._context)),a=this._context.new_var(o),l=s.Std.ema(a,34,this._context),c=this._context.new_var(o),h=s.Std.ema(c,55,this._context),u=this.f_1(l,h),d=this._context.new_var(u);return[u,s.Std.ema(d,13,this._context)]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#009688"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{
|
||
id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:2e3},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:2e3},{id:"in_3",name:"roclen4",defval:30,type:"integer",min:1,max:2e3},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:2e3},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:2e3},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:2e3},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:2e3}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing",format:{type:"price",precision:4}},constructor:function(){this.f_0=function(e,t,i,s){return e+2*t+3*i+4*s},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2),o=this._input(3),a=this._input(4),l=this._input(5),c=this._input(6),h=this._input(7),u=this._input(8);this._context.setMinimumAdditionalDepth(Math.max(a+i,l+r,c+n,h+o)+u);var d=s.Std.close(this._context),p=i,_=this._context.new_var(d),m=s.Std.roc(_,p),f=a,g=this._context.new_var(m),v=s.Std.sma(g,f,this._context),b=r,S=this._context.new_var(d),y=s.Std.roc(S,b),w=l,C=this._context.new_var(y),P=s.Std.sma(C,w,this._context),x=n,T=this._context.new_var(d),M=s.Std.roc(T,x),I=c,L=this._context.new_var(M),O=s.Std.sma(L,I,this._context),A=o,E=this._context.new_var(d),k=s.Std.roc(E,A),D=h,V=this._context.new_var(k),B=s.Std.sma(V,D,this._context),R=this.f_0(v,P,O,B),N=this._context.new_var(R);return[R,s.Std.sma(N,u,this._context)]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:1,max:1e12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1e12,max:1e12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.close(this._context),o=this._context.new_var(n);return[s.Std.linreg(o,i,r)]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3}],
|
||
id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._context.new_var(i);return[s.Std.linreg(n,r,0)]}}},{name:"Linear Regression Slope",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Linear Regression Slope@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Slope",description:"Linear Regression Slope",shortDescription:"Linear Regression Slope",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},inputs:{periods:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",type:"integer",name:"Periods"}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0)},this.linregSlope=function(e,t,i){var s,r,n,o=0,a=0,l=0,c=0;for(s=0;s<t;++s)o+=n=t-1-s+1,a+=r=e.get(s),l+=n*n,c+=r*n;return(t*c-o*a)/(t*l-o*o)},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(s.Std.close(this._context));return[this.linregSlope(i,this.period,0)]}}},{name:"MA Cross",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.close(this._context),o=this._context.new_var(n),a=s.Std.sma(o,i,this._context),l=this._context.new_var(n),c=s.Std.sma(l,r,this._context),h=a,u=c,d=s.Std.cross(a,c,this._context);return[h,u,this.f_0(d,a)]}}},{name:"MA with EMA Cross",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:0,
|
||
visible:!0,color:"#2196F3"}},inputs:{in_0:10,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"MA",histogramBase:0,joinPoints:!1},plot_1:{title:"EMA",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA with EMA Cross",shortDescription:"MA/EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Length MA",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Length EMA",defval:10,type:"integer",min:1,max:2e3}],id:"MA with EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA with EMA Cross",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.close(this._context),o=this._context.new_var(n),a=s.Std.sma(o,i,this._context),l=this._context.new_var(n),c=s.Std.ema(l,r,this._context),h=a,u=c,d=s.Std.cross(a,c,this._context);return[h,u,this.f_0(d,a)]}}},{name:"Mass Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(s.Std.high(this._context),s.Std.low(this._context)),n=this._context.new_var(r),o=s.Std.ema(n,9,this._context),a=this._context.new_var(o),l=s.Std.ema(a,9,this._context),c=this.f_1(o,l),h=this._context.new_var(c);return[s.Std.sum(h,i,this._context)]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic",format:{type:"inherit"}},constructor:function(){this.f_0=function(){var e=this._input(0),t=s.Std.close(this._context),i=this._context.new_var(t),r=s.Std.ema(i,e,this._context),n=this._context.new_var(),o=n.get(1)+(t-n.get(1))/(e*s.Std.pow(t/n.get(1),4));return n.set(s.Std.na(n.get(1))?r:o),[n.get(0)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Median Price",metainfo:{_metainfoVersion:52,isTVScript:!1,
|
||
isTVScriptStub:!1,is_hidden_study:!1,id:"Median Price@tv-basicstudies-1",scriptIdPart:"",name:"Median Price",description:"Median Price",shortDescription:"Median Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},inputs:{}},styles:{plot_0:{title:"Plot"}},inputs:[],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[s.Std.hl2(this._context)]}}},{name:"Momentum",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std[this._input(1)](this._context),n=this._context.new_var(r).get(i);return[n?r-n:null]}}},{name:"Money Flow Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#7E57C2"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow Index",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i){return e*(s.Std.le(t,0)?0:i)},this.f_1=function(e,t,i){return e*(s.Std.ge(t,0)?0:i)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.hlc3(this._context),n=this._context.new_var(r),o=s.Std.change(n),a=this.f_0(s.Std.volume(this._context),o,r),l=this._context.new_var(a),c=s.Std.sum(l,i,this._context),h=this.f_1(s.Std.volume(this._context),o,r),u=this._context.new_var(h),d=s.Std.sum(u,i,this._context);return[s.Std.rsi(c,d)]}}},{name:"Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,
|
||
trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std[this._input(1)](this._context),r=this._input(0),n=this._input(2),o=this._context.new_var(i);return[{value:s.Std.sma(o,r,this._context),offset:n}]}}},{name:"Moving Average Channel",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:20,in_1:20,in_2:0,in_3:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_1",type:"plot_plot",title:"Plots Background"}],description:"Moving Average Channel",shortDescription:"MAC",is_price_study:!0,inputs:[{id:"in_0",name:"Upper Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"Lower Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_2",name:"Upper Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"in_3",name:"Lower Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Channel@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Channel",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.high(this._context),r=s.Std.low(this._context),n=this._input(0),o=this._input(1),a=this._input(2),l=this._input(3),c=this._context.new_var(i),h=this._context.new_var(r);return[{value:s.Std.sma(c,n,this._context),offset:a},{value:s.Std.sma(h,o,this._context),offset:l}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:0,visible:!0,color:"#FF5252"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},palettes:{palette_0:{colors:{0:{color:"#26A69A",width:1,style:0},1:{color:"#B2DFDB",width:1,style:0},2:{color:"#FFCDD2",width:1,style:0},3:{color:"#FF5252",width:1,style:0}}}},inputs:{in_0:12,in_1:26,
|
||
in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"}}}},inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){var t=e>0?1:3,i=s.Std.change(this._context.new_var(e));return t-(s.Std.le(i,0)?0:1)},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std[this._input(2)](this._context),r=this._input(0),n=this._input(1),o=this._input(3);this._context.setMinimumAdditionalDepth(Math.max(r,n)+o);var a=this._context.new_var(i),l=s.Std.ema(a,r,this._context),c=this._context.new_var(i),h=s.Std.ema(c,n,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=s.Std.ema(d,o,this._context),_=this.f_0(u,p);return[_,u,p,this.f_1(_)]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std[this._input(1)](this._context),r=this._input(0),n=this._input(2),o=this._context.new_var(i);return[{value:s.Std.ema(o,r,this._context),offset:n}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",
|
||
is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std[this._input(1)](this._context),r=this._input(0),n=this._input(2),o=this._context.new_var(i);return[{value:s.Std.wma(o,r,this._context),offset:n}]}}},{name:"Moving Average Double",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"Moving Average Double@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Double",description:"Moving Average Double",shortDescription:"Moving Average Double",is_price_study:!0,plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{firstPeriods:14,secondPeriods:21,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,r,n=this._context.new_var(s.Std.close(this._context));return"Exponential"===this._input(2)?(i=s.Std.ema(n,this._input(0),this._context),r=s.Std.ema(n,this._input(1),this._context)):"Weighted"===this._input(2)?(i=s.Std.wma(n,this._input(0),this._context),r=s.Std.wma(n,this._input(1),this._context)):(i=s.Std.sma(n,this._input(0),this._context),r=s.Std.sma(n,this._input(1),this._context)),[i,r]}}},{name:"Moving Average Triple",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Triple@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Triple",description:"Moving Average Triple",shortDescription:"Moving Average Triple",plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#2196F3"},plot_2:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#26C6DA"}},inputs:{firstPeriods:14,secondPeriods:21,thirdPeriods:35,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"},plot_2:{title:"Plot 3"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",
|
||
type:"integer",defval:21,min:1,max:1e4},{id:"thirdPeriods",name:"3rd Period",type:"integer",defval:35,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,r,n,o=this._context.new_var(s.Std.close(this._context));return"Exponential"===this._input(3)?(i=s.Std.ema(o,this._input(0),this._context),r=s.Std.ema(o,this._input(1),this._context),n=s.Std.ema(o,this._input(2),this._context)):"Weighted"===this._input(3)?(i=s.Std.wma(o,this._input(0),this._context),r=s.Std.wma(o,this._input(1),this._context),n=s.Std.wma(o,this._input(2),this._context)):(i=s.Std.sma(o,this._input(0),this._context),r=s.Std.sma(o,this._input(1),this._context),n=s.Std.sma(o,this._input(2),this._context)),[i,r,n]}}},{name:"Moving Average Adaptive",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Adaptive@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Adaptive",description:"Moving Average Adaptive",shortDescription:"Moving Average Adaptive",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#AB47BC"}},inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0),this.amaPrev=NaN},this.ama=function(e,t){var i=this.periods,r=e.get(),n=s.Std.stdev(t,i,this._context),o=s.Std.log(r/e.get(i))/(n*Math.sqrt(i)),a=.1*Math.abs(o),l=(r-this.amaPrev)*a+this.amaPrev;return this.amaPrev=isNaN(l)?r:l,l},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(s.Std.close(this._context)),r=this._context.new_var(s.Std.log(i.get()/i.get(1)));return[this.ama(i,r)]}}},{name:"Moving Average Hamming",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Hamming@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Hamming",description:"Moving Average Hamming",shortDescription:"Moving Average Hamming",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#4CAF50"}},inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0);for(var i=[],s=0,r=1;r<=this.periods;++r){var n=Math.sin((1+r)/this.periods*Math.PI/2);i.unshift(n),s+=n}this.hmaFactors=i,this.hmaFactorsSum=s},this.hma=function(e){for(var t=this.periods,i=0,s=0;s<t;++s)i+=e.get(t-s-1)*this.hmaFactors[s];return i/=this.hmaFactorsSum},this.main=function(e,t){this._context=e,this._input=t
|
||
;var i=this._context.new_var(s.Std.close(this._context));return[this.hma(i)]}}},{name:"Moving Average Multiple",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Multiple@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Multiple",description:"Moving Average Multiple",shortDescription:"Moving Average Multiple",plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#9C27B0"},plot_1:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#FF6D00"},plot_2:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#43A047"},plot_3:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#26C6DA"},plot_4:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#F50057"},plot_5:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#2196F3"}},inputs:{firstPeriods:14,secondPeriods:21,thirdPeriods:35,fourthPeriods:50,fifthPeriods:100,sixthPeriods:200,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"},plot_2:{title:"Plot 3"},plot_3:{title:"Plot 4"},plot_4:{title:"Plot 5"},plot_5:{title:"Plot 6"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4},{id:"thirdPeriods",name:"3rd Period",type:"integer",defval:35,min:1,max:1e4},{id:"fourthPeriods",name:"4th Period",type:"integer",defval:50,min:1,max:1e4},{id:"fifthPeriods",name:"5th Period",type:"integer",defval:100,min:1,max:1e4},{id:"sixthPeriods",name:"6th Period",type:"integer",defval:200,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,r,n,o,a,l,c=this._context.new_var(s.Std.close(this._context));return"Exponential"===this._input(6)?(i=s.Std.ema(c,this._input(0),this._context),r=s.Std.ema(c,this._input(1),this._context),n=s.Std.ema(c,this._input(2),this._context),o=s.Std.ema(c,this._input(3),this._context),a=s.Std.ema(c,this._input(4),this._context),l=s.Std.ema(c,this._input(5),this._context)):"Weighted"===this._input(6)?(i=s.Std.wma(c,this._input(0),this._context),r=s.Std.wma(c,this._input(1),this._context),n=s.Std.wma(c,this._input(2),this._context),o=s.Std.wma(c,this._input(3),this._context),a=s.Std.wma(c,this._input(4),this._context),l=s.Std.wma(c,this._input(5),this._context)):(i=s.Std.sma(c,this._input(0),this._context),r=s.Std.sma(c,this._input(1),this._context),n=s.Std.sma(c,this._input(2),this._context),o=s.Std.sma(c,this._input(3),this._context),a=s.Std.sma(c,this._input(4),this._context),l=s.Std.sma(c,this._input(5),this._context)),[i,r,n,o,a,l]}}
|
||
},{name:"Majority Rule",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Majority Rule@tv-basicstudies-1",scriptIdPart:"",name:"Majority Rule",description:"Majority Rule",shortDescription:"Majority Rule",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},inputs:{rollingPeriod:14}},styles:{plot_0:{title:"Majority Rule"}},inputs:[{id:"rollingPeriod",type:"integer",name:"Rolling Period"}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.rollingPeriod=this._input(0)},this.main=function(e,t){this._context=e,this._input=t;var i,r=s.Std.close(this._context);return i=r>this._context.new_var(r).get(1)?1:0,[100*s.Std.sma(this._context.new_var(i),this.rollingPeriod,this._context)]}}},{name:"Net Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i){return s.Std.gt(e,0)?t:s.Std.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._context.new_var(i),n=s.Std.change(r);return[this.f_0(n,s.Std.volume(this._context),n)]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i){return s.Std.gt(e,0)?t:s.Std.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._context.new_var(i),n=s.Std.change(r),o=this.f_0(n,s.Std.volume(this._context),n);return[s.Std.cum(o,this._context)]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,
|
||
max:1e12},{id:"in_2",name:"maximum",defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2);return[s.Std.sar(i,r,n,this._context)]}}},{name:"Price Channel",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.high(this._context),r=this._context.new_var(i),n=s.Std.low(this._context),o=this._context.new_var(n),a=this._input(0),l=this._input(1),c=s.Std.highest(r,a,this._context),h=s.Std.lowest(o,a,this._context);return[{value:c,offset:l},{value:h,offset:l},{value:s.Std.avg(c,h),offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#009688"}},inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator",format:{type:"price",precision:2}},constructor:function(){this.f_0=function(e,t){return(e-t)/t*100},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._context.new_var(i),a=s.Std.sma(o,r,this._context),l=this._context.new_var(i),c=s.Std.sma(l,n,this._context);return[this.f_0(a,c)]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,
|
||
joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend",format:{type:"volume"}},constructor:function(){this.f_0=function(){var e=this._context.new_var(s.Std.close(this._context));return[s.Std.cum(s.Std.change(e)/e.get(1)*s.Std.volume(this._context),this._context)]},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change",format:{precision:2,type:"price"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(s.Std.close(this._context)),r=this._input(0);return[100*(i.get(0)-i.get(r))/i.get(r)]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#7E57C2"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e){return s.Std.max(e,0)},this.f_1=function(e){return-s.Std.min(e,0)},this.f_2=function(e,t){return s.Std.eq(e,0)?100:s.Std.eq(t,0)?0:100-100/(1+t/e)},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._context.new_var(i),o=s.Std.change(n),a=this.f_0(o),l=this._context.new_var(a),c=s.Std.rma(l,r,this._context),h=this.f_1(o),u=this._context.new_var(h),d=s.Std.rma(u,r,this._context);return[this.f_2(d,c)]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{
|
||
plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#009688"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index",format:{precision:4,type:"price"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(s.Std.close(this._context),s.Std.open(this._context)),n=this._context.new_var(r),o=s.Std.swma(n,this._context),a=this._context.new_var(o),l=s.Std.sum(a,i,this._context),c=this.f_0(s.Std.high(this._context),s.Std.low(this._context)),h=this._context.new_var(c),u=s.Std.swma(h,this._context),d=this._context.new_var(u),p=s.Std.sum(d,i,this._context),_=this.f_1(l,p),m=this._context.new_var(_);return[_,s.Std.swma(m,this._context)]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#7E57C2"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return s.Std.le(e,0)?0:t},this.f_1=function(e,t){return s.Std.gt(e,0)?0:t},this.f_2=function(e,t){return e/(e+t)*100},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);this._context.setMinimumAdditionalDepth(i+12);var r=s.Std.close(this._context),n=this._context.new_var(r),o=s.Std.stdev(n,i,this._context),a=this._context.new_var(r),l=s.Std.change(a),c=this.f_0(l,o),h=this._context.new_var(c),u=s.Std.ema(h,14,this._context),d=this.f_1(l,o),p=this._context.new_var(d),_=s.Std.ema(p,14,this._context);return[this.f_2(u,_)]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,
|
||
plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:0,visible:!0,color:"#FF5252"}},inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2);this._context.setMinimumAdditionalDepth(i+r+n);var o=s.Std.close(this._context),a=this._context.new_var(o),l=s.Std.tsi(a,i,r,this._context),c=this._context.new_var(l),h=s.Std.ema(c,n,this._context);return[l,h,this.f_0(l,h)]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#673AB7"}},inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average",format:{type:"inherit"}},constructor:function(){this.f_0=function(){var e=this._input(0),t=s.Std[this._input(1)](this._context),i=this._context.new_var(t),r=s.Std.sma(i,e,this._context),n=this._context.new_var(),o=(n.get(1)*(e-1)+t)/e;return n.set(s.Std.na(n.get(1))?r:o),[n.get(0)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Standard Deviation",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"Standard Deviation@tv-basicstudies-1",scriptIdPart:"",name:"Standard Deviation",description:"Standard Deviation",shortDescription:"Standard Deviation",is_price_study:!1,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#009688"}},inputs:{periods:5,deviations:1}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer"},{id:"deviations",name:"Deviations",
|
||
type:"float"}],format:{precision:2,type:"price"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._context.new_var(s.Std.close(this._context));return[s.Std.stdev(n,i,this._context)*r]}}},{name:"Stochastic",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"K",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"D",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smooth",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic",format:{precision:2,type:"price"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2);this._context.setMinimumAdditionalDepth(i+r+n);var o=s.Std.close(this._context),a=s.Std.high(this._context),l=s.Std.low(this._context),c=this._context.new_var(o),h=this._context.new_var(a),u=this._context.new_var(l),d=s.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=s.Std.sma(p,r,this._context),m=this._context.new_var(_);return[_,s.Std.sma(m,n,this._context)]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",
|
||
defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI",format:{precision:2,type:"price"}},constructor:function(){this.f_1=function(e,t,i){var r=i.new_var(s.Std.max(s.Std.change(e),0));return s.Std.rma(r,t,i)},this.f_2=function(e,t,i){var r=i.new_var(-s.Std.min(s.Std.change(e),0));return s.Std.rma(r,t,i)},this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._input(1),o=this._input(2),a=this._input(3);e.setMinimumAdditionalDepth(r+n+o+a);var l=this._context.new_var(i),c=s.Std.rsi(this.f_1(l,r,this._context),this.f_2(l,r,this._context)),h=this._context.new_var(c),u=this._context.new_var(c),d=this._context.new_var(c),p=s.Std.stoch(h,u,d,n,this._context),_=this._context.new_var(p),m=s.Std.sma(_,o,this._context),f=this._context.new_var(m);return[m,s.Std.sma(f,a,this._context)]}}},{name:"TRIX",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e){return s.Std.log(e)},this.f_1=function(e){return 1e4*e},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);e.setMinimumAdditionalDepth(3*i);var r=this.f_0(s.Std.close(this._context)),n=this._context.new_var(r),o=s.Std.ema(n,i,this._context),a=this._context.new_var(o),l=s.Std.ema(a,i,this._context),c=this._context.new_var(l),h=s.Std.ema(c,i,this._context),u=this._context.new_var(h),d=s.Std.change(u);return[this.f_1(d)]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t,i){return 3*(e-t)+i},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);this._context.setMinimumAdditionalDepth(3*i)
|
||
;var r=s.Std.close(this._context),n=this._context.new_var(r),o=s.Std.ema(n,i,this._context),a=this._context.new_var(o),l=s.Std.ema(a,i,this._context),c=this._context.new_var(l),h=s.Std.ema(c,i,this._context);return[this.f_0(o,l,h)]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25,type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator",format:{precision:4,type:"price"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2);this._context.setMinimumAdditionalDepth(this._input(0)+this._input(1)+this._input(2));var o=s.Std.close(this._context),a=this._context.new_var(o),l=s.Std.tsi(a,r,i,this._context),c=this._context.new_var(l);return[l,s.Std.ema(c,n,this._context)]}}},{name:"Trend Strength Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Trend Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Trend Strength Index",description:"Trend Strength Index",shortDescription:"Trend Strength Index",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},inputs:{periods:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",type:"integer",name:"Periods"}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.invertedPeriod=1/this.period,this.sumX=(this.period-1)*this.period/2,this.sumXX=(this.period-1)*this.period*(2*this.period-1)/6,this.invertedPeriodSumXSumX=this.invertedPeriod*this.sumX*this.sumX},this.trendStrengthIndex=function(){for(var e=this._context.new_var(s.Std.close(this._context)),t=s.Std.sum(e,this.period,this._context),i=0,r=0,n=0;n<this.period;n++){var o=e.get(n);r+=(this.period-1-n)*o,i+=o*o}var a=r-this.invertedPeriod*this.sumX*t,l=(this.sumXX-this.invertedPeriodSumXSumX)*(i-this.invertedPeriod*t*t);return l<0?0==a?0:a>0?1:-1:a/(l=Math.sqrt(l))},this.main=function(e,t){return this._context=e,this._input=t,[this.trendStrengthIndex()]}}},{name:"Typical Price",metainfo:{
|
||
_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"TypicalPrice@tv-basicstudies-1",scriptIdPart:"",name:"Typical Price",description:"Typical Price",shortDescription:"Typical Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},inputs:{}},styles:{plot_0:{title:"Plot"}},inputs:[],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[s.Std.hlc3(this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i){var r=this._context.new_var(e),n=this._context.new_var(t);return[s.Std.sum(r,i,this._context)/s.Std.sum(n,i,this._context)]},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),r=this._context.new_var(s.Std.close(this._context)),n=s.Std.max(s.Std.high(this._context),r.get(1)),o=this._context.new_var(s.Std.close(this._context)),a=s.Std.min(s.Std.low(this._context),o.get(1)),l=s.Std.close(this._context)-a,c=n-a,h=this.f_0(l,c,e),u=this.f_0(l,c,t),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"Volatility Close-to-Close",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Volatility Close-to-Close@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Close-to-Close",description:"Volatility Close-to-Close",shortDescription:"Volatility Close-to-Close",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{periods:10,daysPerYear:252}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer",defval:10},{id:"daysPerYear",name:"Days Per Year",type:"integer",defval:252}],format:{precision:2,type:"percent"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.daysPerYear=this._input(1)},this.stdev=function(e,t,i){var r=this.variance(e,t,i);return s.Std.sqrt(r)},this.variance=function(e,t,i){var r=s.Std.sma(e,t,i);return this.variance2(e,r,t)},this.variance2=function(e,t,i){var s,r,n=0;for(s=0;s<i;s++)n+=(r=e.get(s)-t)*r
|
||
;return n/(i-1)},this.standardHistVol=function(){var e=this._context.new_var(s.Std.close(this._context)),t=this._context.new_var(s.Std.log(e.get()/e.get(1)));return 100*this.stdev(t,this.period,this._context)*s.Std.sqrt(this.daysPerYear)},this.main=function(e,t){return this._context=e,this._input=t,[this.standardHistVol()]}}},{name:"Volatility Zero Trend Close-to-Close",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Volatility Zero Trend Close-to-Close@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Zero Trend Close-to-Close",description:"Volatility Zero Trend Close-to-Close",shortDescription:"Volatility Zero Trend Close-to-Close",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{periods:10,daysPerYear:252}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer",min:0,max:1e4},{id:"daysPerYear",name:"Days Per Year",type:"integer"}],format:{precision:2,type:"percent"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.daysPerYear=this._input(1),this.currTime=NaN,this.prevTime=NaN},this.volatliityZTCTC=function(){this._context.setMinimumAdditionalDepth(this._input(0)+1);var e=this._context.new_var(s.Std.close(this._context));this.prevTime=this.currTime,this.currTime=e.symbol.time;for(var t=Math.sqrt((this.currTime-this.prevTime)/864e5/this.daysPerYear),i=Math.log(s.Std.close(this._context)/e.get(1)),r=this._context.new_var(i/t),n=this._context.new_var(Math.pow(r,2)),o=0,a=0;a<this.period;a++)o+=n.get(a);return 100*Math.sqrt(o/this.period)},this.main=function(e,t){return this._context=e,this._input=t,[this.volatliityZTCTC()]}}},{name:"Volatility O-H-L-C",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Volatility O-H-L-C@tv-basicstudies-1",scriptIdPart:"",name:"Volatility O-H-L-C",description:"Volatility O-H-L-C",shortDescription:"Volatility O-H-L-C",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},inputs:{periods:10,marketClosedPercentage:0,daysPerYear:252}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",type:"integer",name:"Periods"},{id:"marketClosedPercentage",type:"float",name:"Market Closed Percentage",min:0,max:.999},{id:"daysPerYear",type:"integer",name:"Days Per Year"}],format:{precision:2,type:"percent"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.marketClosedPercentage=this._input(1),this.daysPerYear=this._input(2),this.secondsPerYear=86400*this.daysPerYear,this.currTime=NaN,this.prevTime=NaN},this.square=function(e){return e*e},this.volatilityOHLC=function(){
|
||
var e=this._context.new_var(Math.log(s.Std.open(this._context))),t=this._context.new_var(Math.log(s.Std.high(this._context))),i=this._context.new_var(Math.log(s.Std.low(this._context))),r=this._context.new_var(Math.log(s.Std.close(this._context))),n=this._context.new_var(s.Std.close(this._context));this.prevTime=this.currTime,this.currTime=n.symbol.time;var o=(this.currTime-this.prevTime)/1e3,a=.5*this.square(t.get()-i.get());a-=(Math.log(4)-1)*this.square(r.get()-e.get()),this.marketClosedPercentage>0&&(a=.12*this.square(e.get()-r.get(1))/this.marketClosedPercentage+.88*a/(1-this.marketClosedPercentage)),a/=o,a*=this.secondsPerYear;var l=this._context.new_var(a);return 100*Math.sqrt(s.Std.sum(l,this.period,this._context)/this.period)},this.main=function(e,t){return this._context=e,this._input=t,[this.volatilityOHLC()]}}},{name:"Volatility Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Index",description:"Volatility Index",shortDescription:"Volatility Index",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},inputs:{periods:10,atrMult:3,method:"Wilder Smoothing"}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer"},{id:"atrMult",name:"ATR Mult",type:"float"},{id:"method",name:"Method",type:"text",defval:"Exponential",options:["Exponential","Wilder Smoothing"]}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.atrMult=this._input(1),this.maMethod=this._input(2),this.nextsar=null,this.position=null,this.sic=null,this.bars=[],this.count=0,this.lastSar=null,this._context.setMinimumAdditionalDepth("Exponential"===this.maMethod?2*this.period+2:this.period)},this.highest=function(e,t){for(var i=this.bars.length-this.period,s=this.bars[i],r=i+1;r<this.bars.length;r++)this.bars[r]>s&&(s=this.bars[r]);return s},this.computeATR=function(){var e=s.Std.high(this._context)-s.Std.low(this._context),t=s.Std.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-s.Std.low(this._context);return this.tr=Math.max(e,t,i),"Exponential"===this.maMethod?this.atr=s.Std.ema(this._context.new_var(this.tr),this.period,this._context):this.atr=this.tr/this.period+(1-1/this.period)*this.atr,this.atr*this.atrMult},this.calculateVolatility=function(){if(s.Std.close(this._context)===this.bars[this.bars.length-1])return this.lastSar;if(this.bars.push(s.Std.close(this._context)),1===this.count)this.atr=s.Std.high(this._context)-s.Std.low(this._context),this.sic=s.Std.close(this._context);else if(this.count<this.period){var e=s.Std.high(this._context)-s.Std.low(this._context),t=s.Std.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-s.Std.low(this._context);this.atr+=Math.max(e,t,i),
|
||
s.Std.close(this._context)>this.sic&&(this.sic=s.Std.close(this._context))}else if(this.count===this.period){e=s.Std.high(this._context)-s.Std.low(this._context),t=s.Std.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-s.Std.low(this._context);this.atr+=Math.max(e,t,i),this.atr*=1/this.period,s.Std.close(this._context)>this.sic&&(this.sic=s.Std.close(this._context)),this.position="LONG",this.nextsar=this.sic-this.atr*this.atrMult}else{var r=this.nextsar;"LONG"===this.position?s.Std.close(this._context)<r?(this.position="SHORT",this.sic=s.Std.close(this._context),this.nextsar=this.sic+this.computeATR()):(this.position="LONG",this.sic=Math.max(s.Std.close(this._context),this.sic),this.nextsar=this.sic-this.computeATR()):"SHORT"===this.position&&(s.Std.close(this._context)>r?(this.position="LONG",this.sic=s.Std.close(this._context),this.nextsar=this.sic-this.computeATR()):(this.position="SHORT",this.sic=Math.min(s.Std.close(this._context),this.sic),this.nextsar=this.sic+this.computeATR())),this.lastSar=r}return this.count++,r},this.main=function(e,t){return this._context=e,this._input=t,this._context.select_sym(0),[this.calculateVolatility()]}}},{name:"VWAP",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#2196F3"}}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP",format:{type:"inherit"}},constructor:function(){this.f_1=function(e){e.hist=null,e.add_hist()},this.init=function(e,t){this._isNewSession=null},this.main=function(e,t){this._context=e,this._input=t;var i=e.new_var(),r=e.new_var(),n=this._context.symbol.time;return n&&(null===this._isNewSession&&(this._isNewSession=s.Std.createNewSessionCheck(e)),this._isNewSession(n)&&(this.f_1(i),this.f_1(r))),i.set(s.Std.nz(i.get(1))+s.Std.hlc3(this._context)*s.Std.volume(this._context)),r.set(s.Std.nz(r.get(1))+s.Std.volume(this._context)),[i.get(0)/r.get(0)]}}},{name:"VWMA",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=s.Std.close(this._context),r=this._input(0),n=this._context.new_var(i);return[s.Std.vwma(n,r,this._context)]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{
|
||
linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator",format:{precision:2,type:"percent"}},constructor:function(){this.f_0=function(e,t){return 100*(e-t)/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=s.Std.volume(this._context),o=this._context.new_var(n),a=s.Std.ema(o,i,this._context),l=this._context.new_var(n),c=s.Std.ema(l,r,this._context);return[this.f_0(a,c)]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator",format:{precision:4,type:"price"}},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(s.Std.low(this._context)),i=this._context.new_var(s.Std.abs(s.Std.high(this._context)-t.get(1))),r=s.Std.sum(i,e,this._context),n=this._context.new_var(s.Std.high(this._context)),o=this._context.new_var(s.Std.abs(s.Std.low(this._context)-n.get(1))),a=s.Std.sum(o,e,this._context),l=this._context.new_var(s.Std.atr(1,this._context)),c=s.Std.sum(l,e,this._context);return[r/c,a/c]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Willams %R",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#7E57C2"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",
|
||
type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i){return 100*(e-t)/(t-i)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=s.Std.high(this._context),n=this._context.new_var(r),o=s.Std.highest(n,i,this._context),a=s.Std.low(this._context),l=this._context.new_var(a),c=s.Std.lowest(l,i,this._context);return[this.f_0(s.Std.close(this._context),o,c)]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#66BB6A"}},inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),n=this._input(2),o=s.Std.hl2(this._context),a=this._context.new_var(o),l=s.Std.ema(a,i,this._context),c=this._context.new_var(o),h=s.Std.ema(c,r,this._context),u=this._context.new_var(o);return[{value:l,offset:8},{value:h,offset:5},{value:s.Std.ema(u,n,this._context),offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",transparency:0,color:"#F44336"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#009688"}},inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0,format:{type:"inherit"}},constructor:function(){this.f_0=function(){
|
||
for(var e=this._input(0),t=this._context.new_var(s.Std.high(this._context)),i=!0,r=!0,n=!0,o=!0,a=!0,l=!0,c=1;c<=e;c++)i=s.Std.and(i,s.Std.lt(t.get(e-c),t.get(e))),r=s.Std.and(r,s.Std.lt(t.get(e+c),t.get(e))),n=s.Std.and(n,s.Std.and(s.Std.le(t.get(e+1),t.get(e)),s.Std.lt(t.get(e+c+1),t.get(e)))),o=s.Std.and(o,s.Std.and(s.Std.le(t.get(e+1),t.get(e)),s.Std.and(s.Std.le(t.get(e+2),t.get(e)),s.Std.lt(t.get(e+c+2),t.get(e))))),a=s.Std.and(a,s.Std.and(s.Std.le(t.get(e+1),t.get(e)),s.Std.and(s.Std.le(t.get(e+2),t.get(e)),s.Std.and(s.Std.le(t.get(e+3),t.get(e)),s.Std.lt(t.get(e+c+3),t.get(e)))))),l=s.Std.and(l,s.Std.and(s.Std.le(t.get(e+1),t.get(e)),s.Std.and(s.Std.le(t.get(e+2),t.get(e)),s.Std.and(s.Std.le(t.get(e+3),t.get(e)),s.Std.and(s.Std.le(t.get(e+4),t.get(e)),s.Std.lt(t.get(e+c+4),t.get(e)))))));var h=s.Std.or(r,s.Std.or(n,s.Std.or(o,s.Std.or(a,l)))),u=s.Std.and(i,h),d=this._context.new_var(s.Std.low(this._context)),p=1,_=1,m=1,f=1,g=1,v=1;for(c=1;c<=e;c++)p=s.Std.and(p,s.Std.gt(d.get(e-c),d.get(e))),_=s.Std.and(_,s.Std.gt(d.get(e+c),d.get(e))),m=s.Std.and(m,s.Std.and(s.Std.ge(d.get(e+1),d.get(e)),s.Std.gt(d.get(e+c+1),d.get(e)))),f=s.Std.and(f,s.Std.and(s.Std.ge(d.get(e+1),d.get(e)),s.Std.and(s.Std.ge(d.get(e+2),d.get(e)),s.Std.gt(d.get(e+c+2),d.get(e))))),g=s.Std.and(g,s.Std.and(s.Std.ge(d.get(e+1),d.get(e)),s.Std.and(s.Std.ge(d.get(e+2),d.get(e)),s.Std.and(s.Std.ge(d.get(e+3),d.get(e)),s.Std.gt(d.get(e+c+3),d.get(e)))))),v=s.Std.and(v,s.Std.and(s.Std.ge(d.get(e+1),d.get(e)),s.Std.and(s.Std.ge(d.get(e+2),d.get(e)),s.Std.and(s.Std.ge(d.get(e+3),d.get(e)),s.Std.and(s.Std.ge(d.get(e+4),d.get(e)),s.Std.gt(d.get(e+c+4),d.get(e)))))));var b=s.Std.or(_,s.Std.or(m,s.Std.or(f,s.Std.or(g,v))));return[s.Std.and(p,b),u]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:-this._input(0)},{value:i[1],offset:-this._input(0)}]}}},{name:"Guppy Multiple Moving Average",metainfo:{isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,description:"Guppy Multiple Moving Average",shortDescription:"GMMA",is_price_study:!0,id:"Guppy Multiple Moving Average@tv-basicstudies-1",_metainfoVersion:52,format:{type:"inherit"},defaults:{inputs:{traderEMA1Length:3,traderEMA2Length:5,traderEMA3Length:8,traderEMA4Length:10,traderEMA5Length:12,traderEMA6Length:15,investorEMA1Length:30,investorEMA2Length:35,investorEMA3Length:40,investorEMA4Length:45,investorEMA5Length:50,investorEMA6Length:60},styles:{traderEMA1:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},traderEMA2:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:12,visible:!0},traderEMA5:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},investorEMA6:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0},traderEMA3:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},traderEMA4:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,
|
||
visible:!0},traderEMA5:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},traderEMA6:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0},investorEMA1:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},investorEMA2:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:12,visible:!0},investorEMA3:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},investorEMA4:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,visible:!0}}},inputs:[{defval:3,id:"traderEMA1Length",max:1e3,min:1,name:"Trader EMA 1 length",type:"integer"},{defval:5,id:"traderEMA2Length",max:1e3,min:1,name:"Trader EMA 2 length",type:"integer"},{defval:8,id:"traderEMA3Length",max:1e3,min:1,name:"Trader EMA 3 length",type:"integer"},{defval:10,id:"traderEMA4Length",max:1e3,min:1,name:"Trader EMA 4 length",type:"integer"},{defval:12,id:"traderEMA5Length",max:1e3,min:1,name:"Trader EMA 5 length",type:"integer"},{defval:15,id:"traderEMA6Length",max:1e3,min:1,name:"Trader EMA 6 length",type:"integer"},{defval:30,id:"investorEMA1Length",max:1e3,min:1,name:"Investor EMA 1 length",type:"integer"},{defval:35,id:"investorEMA2Length",max:1e3,min:1,name:"Investor EMA 2 length",type:"integer"},{defval:40,id:"investorEMA3Length",max:1e3,min:1,name:"Investor EMA 3 length",type:"integer"},{defval:45,id:"investorEMA4Length",max:1e3,min:1,name:"Investor EMA 4 length",type:"integer"},{defval:50,id:"investorEMA5Length",max:1e3,min:1,name:"Investor EMA 5 length",type:"integer"},{defval:60,id:"investorEMA6Length",max:1e3,min:1,name:"Investor EMA 6 length",type:"integer"}],plots:[{id:"traderEMA1",type:"line"},{id:"traderEMA2",type:"line"},{id:"traderEMA3",type:"line"},{id:"traderEMA4",type:"line"},{id:"traderEMA5",type:"line"},{id:"traderEMA6",type:"line"},{id:"investorEMA1",type:"line"},{id:"investorEMA2",type:"line"},{id:"investorEMA3",type:"line"},{id:"investorEMA4",type:"line"},{id:"traderEMA5",type:"line"},{id:"investorEMA6",type:"line"}],styles:{traderEMA1:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 1"},traderEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 2"},traderEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 3"},traderEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 4"},traderEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 5"},traderEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 6"},investorEMA1:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 1"},investorEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 2"},investorEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 3"},investorEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 4"},investorEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 5"},investorEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,
|
||
title:"Investor EMA 6"}}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(s.Std.close(this._context)),r=this._input(0),n=this._input(1),o=this._input(2),a=this._input(3),l=this._input(4),c=this._input(5),h=s.Std.ema(i,r,this._context),u=s.Std.ema(i,n,this._context),d=s.Std.ema(i,o,this._context),p=s.Std.ema(i,a,this._context),_=s.Std.ema(i,l,this._context),m=s.Std.ema(i,c,this._context),f=this._input(6),g=this._input(7),v=this._input(8),b=this._input(9),S=this._input(10),y=this._input(11);return[h,u,d,p,_,m,s.Std.ema(i,f,this._context),s.Std.ema(i,g,this._context),s.Std.ema(i,v,this._context),s.Std.ema(i,b,this._context),s.Std.ema(i,S,this._context),s.Std.ema(i,y,this._context)]}}}]},"2h0C":function(e,t,i){var s=i("txPx").getLogger("Chart.PropertyPage.Binding");function r(e,t,i,r,n,o){e?(this._control=e,this._property=t,this._applyOnFly=i,this._undoModel=r,this._undoText=n,this._doesNotAffectSave=!1,t&&(this._formatters=[],this._changed=!1,this.setValue(t.value()),t.subscribe(this,this.propertyChanged))):s.logDebug("Missing control")}r.prototype.addFormatter=function(e){this._formatters.push(e),this.setValue(this._property.value())},r.prototype._formatValue=function(e){return this._formatters.reduce((function(e,t){return t(e)}),e)},r.prototype._setValueToProperty=function(e){this._setter?this._setter.call(this,e):this.setValueToProperty(e)},r.prototype._attachToControl=function(e,t){var i=this;t?e.on("keyup change input",(function(e){var t=i.value();i._setValueToProperty(t),i.setValue(t)})):(e.keypress((function(e){if(i._changed=!0,13===e.which){var t=i.value();i._setValueToProperty(t),i.setValue(t)}})),e.focusout((function(e){var t=i.value();i.changed()&&(i._setValueToProperty(t),i.setValue(t))})),e.change((function(e){var t=i.value();$(e.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout((function(){i._setValueToProperty(t)}),250)):i._setValueToProperty(t),i.setValue(t)})))},r.prototype.control=function(){return this._control},r.prototype.changed=function(){return this._changed},r.prototype.setValueToProperty=function(e){this._undoModel.setProperty(this._property,e,this._undoText,this._doesNotAffectSave),this._changed=!1},r.prototype.property=function(){return this._property},r.prototype.propertyChanged=function(e){this.setValue(e.value())},r.prototype.destroy=function(){this._property&&this._property.unsubscribe(this,this.propertyChanged)},r.prototype.disableAffectingSave=function(){this._doesNotAffectSave=!0},t.Binding=r},"2ijp":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("l4sv"),r=i("8Uy/");class n{constructor(){this._lineRendererData={y:0,color:"rgba(0, 0, 0, 0)",linewidth:1,linestyle:r.LINESTYLE_SOLID,visible:!1},this._lineRenderer=new s.HorizontalLineRenderer,this._invalidated=!0,this._lineRenderer.setData(this._lineRendererData)}update(){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._lineRenderer}}},
|
||
"2jXJ":function(e,t,i){"use strict";i.r(t),i.d(t,"supportedLineTools",(function(){return s}));const s={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush"},highlighter:{name:"LineToolHighlighter"},text:{name:"LineToolText"},anchored_text:{name:"LineToolTextAbsolute"},note:{name:"LineToolNote"},anchored_note:{name:"LineToolNoteAbsolute"},signpost:{name:"LineToolSignpost"},callout:{name:"LineToolCallout"},balloon:{name:"LineToolBalloon"},arrow_up:{name:"LineToolArrowMarkUp"},arrow_down:{name:"LineToolArrowMarkDown"},arrow_left:{name:"LineToolArrowMarkLeft"},arrow_right:{name:"LineToolArrowMarkRight"},price_label:{name:"LineToolPriceLabel"},price_note:{name:"LineToolPriceNote"},arrow_marker:{name:"LineToolArrowMarker"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},cross_line:{name:"LineToolCrossLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},info_line:{name:"LineToolInfoLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fixed:{name:"LineToolGannFixed"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{
|
||
name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},path:{name:"LineToolPath"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},"2kV1":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyStatusView",(function(){return r}));var s=i("nBJD");class r extends s.a{constructor(e){super(e.statusProvider({}))}color(){return this._statusProvider.color()}getSplitTitle(){return this._statusProvider.getSplitTitle()}update(){this._text=this._statusProvider.text()}}},"2uTr":function(e,t,i){"use strict";function s(e){return e+"…"}i.r(t),i.d(t,"appendEllipsis",(function(){return s}))},"3/8U":function(e,t,i){"use strict";function s(e){return"dark"===e?"rgba(30,136,229,0.25)":"rgba(33,150,243,0.25)"}i.r(t),i.d(t,"axesHighlightColor",(function(){return s}))},"38az":function(e,t,i){"use strict";var s=i("k9/m").PlotRowSearchMode,r=i("Tmoa").rgbaFromInteger;function n(){this.backColorers=[]}function o(e){n.call(this),this._series=e}function a(e,t){n.call(this),this._study=e,this._plotIndex=t}n.prototype.barStyle=function(e,t,i){for(var s={},r=this.backColorers.length-1;r>=0;r--)this.backColorers[r].applyBarStyle(e,t,s,i);return this.applyBarStyle(e,t,s,i),s},n.prototype.pushBackBarColorer=function(e){this.backColorers.push(e)},n.prototype.applyBarStyle=function(e,t,i){throw new Error("This function is supposed to be reimplemented in a subclass")},inherit(o,n),o.upColor=function(e,t){switch(e.style.value()){case TradingView.Series.STYLE_LINE:return e.lineStyle.color.value();case TradingView.Series.STYLE_AREA:return e.areaStyle.linecolor.value();case TradingView.Series.STYLE_BARS:return e.barStyle.upColor.value();case TradingView.Series.STYLE_CANDLES:return e.candleStyle.upColor.value();case TradingView.Series.STYLE_HOLLOW_CANDLES:return e.hollowCandleStyle.upColor.value();case TradingView.Series.STYLE_HEIKEN_ASHI:return e.haStyle.upColor.value();case TradingView.Series.STYLE_BASELINE:return e.baselineStyle.topLineColor.value();case TradingView.Series.STYLE_HILO:return e.hiloStyle.color.value()}throw new Error("Unknown series style")},o.downColor=function(e,t){switch(e.style.value()){case TradingView.Series.STYLE_LINE:return e.lineStyle.color.value();case TradingView.Series.STYLE_AREA:return e.areaStyle.linecolor.value();case TradingView.Series.STYLE_BARS:return e.barStyle.downColor.value();case TradingView.Series.STYLE_CANDLES:return e.candleStyle.downColor.value();case TradingView.Series.STYLE_HOLLOW_CANDLES:return e.hollowCandleStyle.downColor.value();case TradingView.Series.STYLE_HEIKEN_ASHI:
|
||
return e.haStyle.downColor.value();case TradingView.Series.STYLE_BASELINE:return e.baselineStyle.bottomLineColor.value();case TradingView.Series.STYLE_HILO:return e.hiloStyle.color.value()}throw new Error("Unknown series style")},o.prototype._applyLineStyle=function(e,t,i,s,r){i.barColor=o.upColor(r)},o.prototype._applyAreaStyle=function(e,t,i,s,r){i.barColor=o.upColor(r)},o.prototype._applyBarStyle=function(e,t,i,s,r){var n=o.upColor(r),a=o.downColor(r),l=this.findBar(e,!1,s);if(r.barStyle.barColorsOnPrevClose.value()){var c=this.findPrevBar(e,!1,s);i.barColor=c[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?n:a,i.barBorderColor=c[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?n:a}else i.barColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?n:a,i.barBorderColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?n:a},o.prototype._applyCandleStyle=function(e,t,i,s,r){var n,a=o.upColor(r,t),l=o.downColor(r,t),c=r.candleStyle.borderUpColor?r.candleStyle.borderUpColor.value():r.candleStyle.borderColor.value(),h=r.candleStyle.borderDownColor?r.candleStyle.borderDownColor.value():r.candleStyle.borderColor.value(),u=r.candleStyle.wickUpColor?r.candleStyle.wickUpColor.value():r.candleStyle.wickColor.value(),d=r.candleStyle.wickDownColor?r.candleStyle.wickDownColor.value():r.candleStyle.wickColor.value(),p=this.findBar(e,!1,s);r.candleStyle.barColorsOnPrevClose.value()?n=this.findPrevBar(e,!1,s)[TradingView.CLOSE_PLOT]<=p[TradingView.CLOSE_PLOT]:n=p[TradingView.OPEN_PLOT]<=p[TradingView.CLOSE_PLOT];i.barColor=n?a:l,i.barBorderColor=n?c:h,i.barWickColor=n?u:d},o.prototype._applyHollowCandleStyle=function(e,t,i,s,r){var n=o.upColor(r,t),a=o.downColor(r,t),l=r.hollowCandleStyle.borderUpColor?r.hollowCandleStyle.borderUpColor.value():r.hollowCandleStyle.borderColor.value(),c=r.hollowCandleStyle.borderDownColor?r.hollowCandleStyle.borderDownColor.value():r.hollowCandleStyle.borderColor.value(),h=r.hollowCandleStyle.wickUpColor?r.hollowCandleStyle.wickUpColor.value():r.hollowCandleStyle.wickColor.value(),u=r.hollowCandleStyle.wickDownColor?r.hollowCandleStyle.wickDownColor.value():r.hollowCandleStyle.wickColor.value(),d=this.findBar(e,!1,s);this.findPrevBar(e,!1,s)[TradingView.CLOSE_PLOT]<=d[TradingView.CLOSE_PLOT]?(i.barColor=n,i.barBorderColor=l,i.barWickColor=h):(i.barColor=a,i.barBorderColor=c,i.barWickColor=u),i.isBarHollow=d[TradingView.OPEN_PLOT]<=d[TradingView.CLOSE_PLOT]},o.prototype._applyHAStyle=function(e,t,i,s,r){var n,a=o.upColor(r,t),l=o.downColor(r,t),c=r.haStyle.borderUpColor.value(),h=r.haStyle.borderDownColor.value(),u=r.haStyle.wickUpColor.value(),d=r.haStyle.wickDownColor.value(),p=this.findBar(e,t,s);r.haStyle.barColorsOnPrevClose.value()?n=this.findPrevBar(e,t,s)[TradingView.CLOSE_PLOT]<=p[TradingView.CLOSE_PLOT]:n=p[TradingView.OPEN_PLOT]<=p[TradingView.CLOSE_PLOT];i.barColor=n?a:l,i.barBorderColor=n?c:h,i.barWickColor=n?u:d},o.prototype._applyBaseLineStyle=function(e,t,i,s,r){
|
||
var n=this.findBar(e,t,s),a=r.baselineStyle,l=this._series.priceScale(),c=Math.round(l.height()*(Math.abs(100-a.baseLevelPercentage.value())/100)),h=this._series.firstValue(),u=l.coordinateToPrice(c,h);n[TradingView.CLOSE_PLOT]>u?i.barColor=o.upColor(r,t):i.barColor=o.downColor(r,t)},o.prototype._applyHiLoStyle=function(e,t,i,s,r){i.barColor=o.upColor(r,t),i.barBorderColor=r.hiloStyle.borderColor.value()},o.prototype.applyBarStyle=function(e,t,i,s){i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,i.isMergedBar=null;var r=this._series.properties();switch(r.style.value()){case TradingView.Series.STYLE_LINE:this._applyLineStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_AREA:this._applyAreaStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_BARS:this._applyBarStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_CANDLES:this._applyCandleStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._applyHollowCandleStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._applyHAStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_BASELINE:this._applyBaseLineStyle(e,t,i,s,r);break;case TradingView.Series.STYLE_HILO:this._applyHiLoStyle(e,t,i,s,r)}return i},o.prototype.getSeriesBars=function(e){return e?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(e,t,i){var s=this.getSeriesBars(i).valueAt(e);if(null!==s)return s[t]},o.prototype.findBar=function(e,t,i){return i?i.value:this.getSeriesBars(t).valueAt(e)||[]},o.prototype.findPrevBar=function(e,t,i){if(i&&i.previousValue)return i.previousValue;var r=this._series.bars().search(e-1,s.NearestLeft,TradingView.CLOSE_PLOT);return null!==r?r.value:[]},inherit(a,n),a.prototype.getBars=function(){return this._study.series().bars()},a.prototype.firstColoredBar=function(e){for(var t=e,i=0;i<this.backColorers.length;i++)t=Math.min(t,this.backColorers[i].firstColoredBar(e));var s=this.getOffset(this._plotIndex);t=Math.min(t,e+s);var r=this.getBars().firstIndex();return Math.max(t,r)},a.prototype.getOffset=function(){var e=this._study.metaInfo().plots[this._plotIndex];return this._study.offset(e.id)},a.prototype.applyBarStyle=function(e,t,i){if(i||(i={}),t)return i;var s=this._study.properties();if(!s.visible.value())return i;var n=this._study.metaInfo(),o=this._study.data();if(!o||0===o.size())return i;var a=n.plots[this._plotIndex],l=this.getOffset();if(this._study.getMinFirstBarIndexForPlot(a.id)>e+l)return i;var c=s.styles[a.id];if(c.visible&&!c.visible.value())return i;var h=o.valueAt(e-l);if(null===h)return i;var u=h[this._plotIndex+1];if(null==u)return i;if(u=Math.round(u),n.isRGB)i.barColor=r(u),i.upColor=i.barColor,i.downColor=i.barColor;else{var d=n.plots[this._plotIndex].palette,p=s.palettes[d],_=n.palettes[d].valToIndex?n.palettes[d].valToIndex[u]:u,m=p.colors[_].color.value();i.barColor=m,i.upColor=m.color,i.downColor=m.color}return i},t.SeriesBarColorer=o,t.StudyBarColorer=a},"3ClC":function(e,t,i){
|
||
"use strict";i.r(t);var s=i("0YCj"),r=i.n(s),n=i("GVHu"),o=i("PL0c"),a=i("cKqi"),l=i("YzC7"),c=i("TMWk"),h=i("8sOK");class u extends n.Study{constructor(e,t,i,s){super(e,t,i,s),this.properties().styles.vol_ma.visible.listeners().subscribe(this,()=>this.invalidateTitleCache())}base(){return 1}destroy(){this.properties().styles.vol_ma.visible.listeners().unsubscribeAll(this),super.destroy()}_titleInputs(){const e={symbolsForDisplay:!0,skipHiddenInputs:!0,fakeInputsForDisplay:!0,asObject:!1};return this.properties().styles.vol_ma.visible.value()?this.inputs(e):this.inputs(Object.assign(Object.assign({},e),{skippedInputs:["length"]}))}}var d=i("Eyy1"),p=i("Qb4w");class _ extends n.Study{priceRange(e,t){let i=!1;this.graphics().hhists().forEach((e,t)=>{i=i||this.properties().child("graphics").child("hhists").child(t).child("showValues").value()});const s=function(e,t,i,s){let r=null;return e.forEach((e,s)=>{e.forEach(e=>{e.firstBarTime<=i&&e.lastBarTime>=t&&(null===r?r={low:{l:e.priceLow,h:e.priceHigh},high:{h:e.priceHigh}}:(e.priceLow<r.low.l&&(r.low.l=e.priceLow,r.low.h=e.priceHigh),r.high.h=Math.max(r.high.h,e.priceHigh)))})}),null===r?null:s?new p.PriceRange(r.low.l-.8*(r.low.h-r.low.l),r.high.h):new p.PriceRange(r.low.l,r.high.h)}(this.graphics().hhists(),e,t,i);if(null===s)return null;const r=Object(d.ensureNotNull)(this.priceScale());return r.isLog()?new p.PriceRange(r.priceToLogical(s.minValue()),r.priceToLogical(s.maxValue())):s}}function m(e,t="shift"){return{studyConstructor:e,colorRotationMode:t}}i.d(t,"isStudy",(function(){return g})),i.d(t,"isStudyStrategy",(function(){return v})),i.d(t,"isStudyStub",(function(){return b})),i.d(t,"isFundamentalStudy",(function(){return S})),i.d(t,"isESDStudy",(function(){return y})),i.d(t,"isFundamentalStudyMetaInfo",(function(){return w})),i.d(t,"createStudy",(function(){return P})),i.d(t,"studyColorRotationMode",(function(){return x}));const f={study_PivotPointsStandard:m(o.study_PivotPointsStandard),study_Overlay:m(a.study_Overlay,"loop"),study_Compare:m(l.a,"loop"),study_Volume:m(u),study_VbPVisible:m(class extends _{}),study_ScriptWithDataOffset:m(c.study_ScriptWithDataOffset)};for(const T in f)f.hasOwnProperty(T)&&(TradingView[T]=f[T].studyConstructor);function g(e){return e instanceof n.Study}function v(e){return!1}function b(e){return e instanceof h.StudyStub}function S(e){return e instanceof Fundamental}function y(e){return!1}function w(e){return"study_Internal$STD;Fund_"===C(e)}function C(e){const t="study_"+(e.classId||e.shortId);return t.startsWith("study_Internal$STD;Fund_")?"study_Internal$STD;Fund_":t}function P(e,t,i,s,r){const o=C(s),a=new(o in f?f[o].studyConstructor:n.Study)(e,t,i,s);return void 0!==r&&a.setId(r),a}function x(e){const t=C(e);return t in f?f[t].colorRotationMode:void 0===e.pine||r.a.isStandardPine(e.id)?1!==e.plots.length?"shift":"loop":null}},"3FNV":function(e,t,i){"use strict";i.r(t);var s=i("CLNU"),r=i("Tmoa"),n=i("Zy3/"),o=i("vq8G"),a=i("/SnT"),l=i.n(a),c=i("Eyy1"),h=i("aO4+"),u=i("2WC2"),d=i("VdBB"),p=i("Zp/P"),_=i("zDbI"),m=i("gBDZ")
|
||
;class f extends u.b{constructor(e,t){super(e,t),this._heightEnsured=Object(c.ensureDefined)(this._height);const i=e.char.slice(0,40);this._ch=l()(i)[0]||" ",this._fontFamily=e.fontFamily||_.CHART_FONT_FAMILY,this._charCache=new m.b(this._ch,!1,!1,this._fontFamily,this._heightEnsured)}hitTest(e){const t=Object(p.interactionTolerance)().series+this._heightEnsured/2;for(const i of this._items){if(new h.Point(i.x,i.y+i.vertOffset).subtract(e).length()<=t)return new d.HitTestResult(d.HitTestResult.REGULAR)}return null}_drawItemShape(e,t,i){const s=i.x,r=i.vertOffset>0?1:-1,n=i.y+i.vertOffset-r*Math.round(this._heightEnsured/2);let o;o=i.style&&void 0!==i.style.color?i.style.color:this._color,this._charCache.paintTo(e,t,o,s,n,m.a.Center,i.vertOffset>0?m.c.Top:m.c.Bottom)}_startPath(e,t,i,s){}_endPath(e){}}var g=i("GSwP");i.d(t,"StudyPlotCharsPaneView",(function(){return v}));class v extends g.a{renderer(){const e=this._study.properties().styles[this._plotName];if(!e.visible||!e.visible.value())return null;if(!this._scalesReady())return null;const t=this._model.timeScale();this._invalidated&&(this._updateImpl(),this._invalidated=!1);const i={},a=this._getTranspValue(),l=t.barSpacing();let c;if(e.size){const t=e.size.value();c=this._calculateShapeHeight(50,t)}else c=Math.round(l);const h=e.location.value(),u=Object(r.generateColor)(e.color.value(),a),d=this._calculateVerticalOffset(h,c);i.items=this.items(),i.barSpacing=l,i.char=e.char.value(),i.height=c,i.vertOffset=d,i.color=u;const p=new n.CompositeRenderer,_=e.text?e.text.value():void 0;if(void 0!==_&&""!==_.trim()){let t=_.trim().replace(/\\n/gm,"\n");t=Object(s.cleanButAmpersand)(t,!0),i.text=t,i.fontSize=12;const n=e.textColor?e.textColor.value():void 0;i.textColor=n?Object(r.generateColor)(n,a):u}return p.append(new f(i)),this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&null!==this._selectionData&&(this._selectionData.vertOffset=d,p.append(new o.SelectionRenderer(this._selectionData))),p}}},"3UA0":function(e,t){e.exports.tzData={"America/New_York":{
|
||
time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
|
||
offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{
|
||
time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{
|
||
time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
|
||
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
|
||
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
|
||
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
|
||
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
|
||
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
|
||
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,1541289600,1550361600,1924981200],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],
|
||
offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{
|
||
time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
|
||
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
|
||
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Luxembourg":{time:[-2069712e3,-1692493200,-1680476400,-1662339600,-165015e4,-1632002400,-1618693200,-1612656e3,-1604278800,-1585515600,-1574038800,-1552255200,-1539997200,-1520546400,-1507510800,-1490569200,-1473642e3,-1459116e3,-1444006800,-142767e4,-1411866e3,-1396220400,-1379293200,-1364770800,-1348448400,-1333321200,-1316394e3,-1301266800,-1284339600,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-935182800,-85725e4,-844552800,-828219600,-812498400,-797979600,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[1476,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Madrid":{time:[-2177453684,-1631926800,-1616886e3,-1601168400,-158535e4,-1442451600,-142767e4,-1379293200,-1364770800,-1348448400,-1333321200,-1316390400,-1301266800,-1284339600,-1269817200,-1026954e3,-1017615600,-1001898e3,-999478800,-986083200,-951433200,-940208400,-873075600,-862614e3,-842835600,-828313200,-811386e3,-796863600,-779936400,-765414e3,-748486800,-733964400,-652323600,-639010800,135126e3,150253200,166575600,181702800,196815600,212547600,22887e4,243997200,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3252096e3,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931046400,-922665600,-917827200,-892425600,-875836800,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-62208e4,-60696e4,-590025600,-575510400,-235612800,-194832e3,-177724800,-165715200,107917200,121226400,133927200,152676e3,164685600,184125600,196221600,215575200,228880800,245815200,260330400,267926400,428464800,433908e3,468122400,482806800,496720800,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
|
||
time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
|
||
offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
|
||
offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{
|
||
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-683769600,-672274800,-654739200,-640825200,-620265600,-609375600,-588816e3,-577926e3,1925024400],offset:[33539,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-1600646400,-1585872e3,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{
|
||
time:[-1948752e3,-1830384e3,-767318400,-681177600,-672192e3,-654739200,-640828800,-623376e3,-609379200,-588816e3,-577929600,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-3645216e3,-3155673600,-2019686400,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,19270,19800,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056663398,-900882e3,-891547200,-884217600,-761176800,-747878400,-728508600,-717021e3,-697059e3,-683757e3,-668028600,-654726600,-636579e3,-623277e3,-605129400,-591827400,-573679800,-559773e3,-541625400,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],
|
||
offset:[27402,28800,32400,30600,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-1600646400,-1585872e3,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232e4,-636415200,-62208e4,-608936400,-59184e4,-572475600,-558568800,-542840400,-527724e3,-514414800,-490838400,-482976e3,-459468e3,-451526400,-428544e3,-418251600,-400024800,-387417600,142387200,150854400,167184e3,178675200,334022400,337654800,452563200,462243600,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],
|
||
offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuwait":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],
|
||
offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-769429800,-765410400,-712188e3,1924956e3],
|
||
offset:[-37886,-37800,-34200,-37800,-34200,-34200,-37800,-36e3]},"America/Mexico_City":{time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Cairo":{time:[-2185401600,-929836800,-923097600,-906163200,-892857600,-875836800,-857779200,-844300800,-825811200,-812678400,-794188800,-779846400,-762652800,-399081600,-38664e4,-368323200,-355104e3,-336783600,-323643600,-305161200,-292021200,-273625200,-260485200,-242089200,-228949200,-210553200,-197413200,-178930800,-165790800,-147394800,-134254800,-115858800,-102632400,-84322800,-71096400,-52700400,-39474e3,-21164400,-7938e3,10371600,23598e3,41907600,55134e3,7353e4,86756400,105066e3,118292400,136602e3,149828400,168138e3,181364400,199760400,212986800,231296400,244522800,262832400,276058800,294368400,307594800,325990800,339217200,357526800,370753200,396406800,402289200,426819600,433825200,452221200,465447600,483757200,496983600,515293200,528519600,546829200,560055600,578451600,591678e3,610419600,623214e3,641523600,65475e4,673059600,686286e3,704682e3,717908400,736218e3,749444400,767754e3,780980400,799027200,812332800,830476800,843782400,861926400,875232e3,893376e3,906681600,925430400,938736e3,95688e4,970185600,988329600,1001635200,1019779200,1033084800,1051228800,1064534400,1083283200,1096588800,1114732800,1128038400,1146182400,1158883200,1177632e3,1189123200,1209081600,1219968e3,1240531200,1250812800,1272585600,1281484800,1284076800,1285891200,1400198400,1403827200,1406851200,1411689600,1924999200],
|
||
offset:[7509,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
|
||
offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"Europe/Helsinki":{time:[-2890252800,-1535932800,-875664e3,-859762800,354679200,370407600,386128800,401857200,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5989,5989,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Stockholm":{
|
||
time:[-2871676800,-2208988800,-1692493200,-1680476400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4332,3614,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Copenhagen":{time:[-2524521600,-2398291200,-1692493200,-1680483600,-935107200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-769381200,-747007200,-736376400,-715212e3,-706741200,-683157600,-675291600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
|
||
offset:[3020,3020,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Atlantic/Reykjavik":{time:[-1956614400,-1668214800,-1647212400,-1636678800,-161343e4,-1605142800,-1581894e3,-1539565200,-153135e4,-968029200,-952293600,-942012e3,-920239200,-909961200,-888789600,-877906800,-857944800,-846457200,-826495200,-815007600,-795045600,-783558e3,-762991200,-752108400,-731541600,-717634800,-700092e3,-686185200,-668642400,-654735600,-636588e3,-623286e3,-605743200,-591836400,-573688800,-559782e3,-542239200,-528332400,-510789600,-496882800,-47934e4,-465433200,-447890400,-433983600,-415836e3,-401929200,-384386400,-370479600,-352936800,-33903e4,-321487200,-307580400,-290037600,-276130800,-258588e3,-244681200,-226533600,-212626800,-195084e3,-181177200,-163634400,-149727600,-132184800,-118278e3,-100735200,-86828400,-68680800,-54774e3,1924992e3],offset:[-5280,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0]},"Europe/Tallinn":{time:[-2840140800,-1638316800,-1632002400,-1618693200,-1593820800,-1535932800,-927936e3,-892944e3,-85725e4,-844552800,-828219600,-812498400,-797644800,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909288e3,92259e4,941342400,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
|
||
offset:[5940,5940,3600,7200,3600,5940,7200,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Riga":{time:[-2840140800,-1632002400,-1618693200,-1601676e3,-1597266e3,-1377302400,-928022400,-899510400,-85725e4,-844552800,-828219600,-812498400,-79677e4,-795830400,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,843966e3,859690800,877838400,891140400,909288e3,92259e4,941342400,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5794,5794,9394,5794,9394,5794,7200,10800,7200,3600,7200,3600,7200,3600,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Vilnius":{
|
||
time:[-2840140800,-1672531200,-1585094400,-1561248e3,-1553558400,-928195200,-900115200,-85725e4,-844552800,-828219600,-812498400,-802137600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891140400,909284400,922586400,941338800,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[6076,5040,5736,3600,7200,3600,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,7200,3600,7200,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"America/Lima":{time:[-2524521600,-1938556800,-1009843200,-1002067200,-986774400,-971049600,-955324800,-9396e5,504921600,512697600,536457600,544233600,631152e3,638928e3,757382400,765158400,1924974e3],offset:[-18492,-18516,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Santiago":{
|
||
time:[-2524521600,-1892678400,-1688428800,-1619222400,-1593820800,-1336003200,-13176e5,-1304380800,-1286064e3,-1272844800,-1254528e3,-1241308800,-1222992e3,-1209772800,-1191369600,-1178150400,-870566400,-865296e3,-740534400,-736387200,-718070400,-713667600,-36633600,-23932800,-3369600,7516800,24451200,37756800,55900800,69206400,87955200,100656e3,118195200,132105600,150854400,163555200,182304e3,195609600,213753600,227059200,245203200,258508800,277257600,289958400,308707200,321408e3,340156800,353462400,371606400,384912e3,403056e3,416361600,434505600,447811200,46656e4,479260800,498009600,510710400,529459200,545184e3,560908800,574214400,592358400,605664e3,624412800,637113600,653443200,668563200,687312e3,700617600,718761600,732067200,750211200,763516800,781660800,794966400,813715200,826416e3,845164800,85968e4,876614400,88992e4,906854400,923184e3,939513600,952819200,971568e3,984268800,1003017600,1015718400,1034467200,1047168e3,1065916800,1079222400,1097366400,1110672e3,1128816e3,1142121600,1160870400,1173571200,119232e4,1206835200,1223769600,1237075200,1255219200,1270339200,1286668800,1304812800,1313884800,1335657600,1346544e3,1367107200,1378598400,1398556800,1410048e3,1463270400,1471132800,149472e4,1502582400,1526169600,1534032e3,1554595200,1567900800,1586044800,1599350400,1617494400,16308e5,1648944e3,1662249600,1680393600,1693699200,1712448e3,1725753600,1743897600,1757203200,1775347200,1788652800,1806796800,1820102400,1838246400,1851552e3,1870300800,1883001600,1901750400,1915056e3,19332e5],offset:[-16966,-16966,-18e3,-16966,-14400,-16966,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-10800,-14400,-18e3,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800]},"Asia/Bahrain":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Jakarta":{time:[-3231273600,-1451693568,-117288e4,-876614400,-766022400,-683856e3,-620784e3,-189388800,1925017200],offset:[25632,25632,26400,27e3,32400,27e3,28800,27e3,25200]},"Africa/Lagos":{time:[-1588464e3,1924995600],offset:[816,3600]},"Pacific/Norfolk":{
|
||
time:[-2177452800,-599616e3,152071200,162961200,1443924e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[40312,40320,41400,45e3,41400,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200]},"America/Juneau":{time:[-3225169588,-2188987200,-880236e3,-769420800,-765410400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[54139,-32261,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-28800,-28800,-25200,-28800,-25200,-28800,-25200,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Asia/Ho_Chi_Minh":{time:[-2004048e3,-1851552e3,-852080400,-782614800,-767836800,-718070400,-457747200,-315622800,171849600,1925017200],offset:[25600,25590,25200,28800,32400,25200,28800,25200,28800,25200]},"Australia/Perth":{
|
||
time:[-2337897600,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,152071200,162961200,436327200,447217200,690343200,699418800,1165111200,1174791600,1193536800,1206846e3,1224986400,1238295600,1925020800],offset:[27804,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Europe/Malta":{time:[-2403475200,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812584800,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,102384e3,118112400,135734400,148525200,167191200,180496800,198640800,211946400,230090400,243396e3,26154e4,274845600,292989600,306295200,323316e3,338349600,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3484,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Amsterdam":{
|
||
time:[-4260211200,-1693699200,-168048e4,-1663452e3,-1650142800,-1633212e3,-1617483600,-1601157600,-1586034e3,-1569708e3,-1554584400,-1538258400,-1523134800,-15075e5,-1490562e3,-1470175200,-1459112400,-1443996e3,-1427662800,-1406671200,-1396213200,-1376949600,-1364763600,-1345413600,-1333314e3,-1313791200,-1301259600,-1282255200,-126981e4,-1250719200,-1238360400,-1219183200,-1206910800,-1186956e3,-1175461200,-1156024800,-1143406800,-1124488800,-1111957200,-1092952800,-1080507600,-1061330400,-1049058e3,-1029189600,-1025740800,-1017608400,-998258400,-986158800,-966722400,-954104400,-935020800,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-766616400,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[1172,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,4800,1200,4800,1200,4800,1200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Brussels":{
|
||
time:[-2840140800,-2450994150,-1740355200,-1693699200,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1613822400,-1604278800,-1585526400,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1473642e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-934664400,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[1050,1050,0,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Lisbon":{
|
||
time:[-1830386205,-1689555600,-1677798e3,-1667437200,-1647734400,-1635814800,-1616198400,-1604365200,-1584662400,-1572742800,-155304e4,-1541206800,-1521504e3,-1442451600,-1426809600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1221440400,-1206921600,-1191200400,-1175472e3,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942022800,-922665600,-906944400,-891129600,-877309200,-873680400,-864e6,-857952e3,-845859600,-842835600,-831340800,-825897600,-81441e4,-810781200,-799891200,-794448e3,-782960400,-779331600,-768441600,-762998400,-749091600,-733363200,-717631200,-701902800,-686181600,-670453200,-654732e3,-639003600,-591832800,-575499600,-559778400,-54405e4,-528328800,-512600400,-496879200,-481150800,-465429600,-449701200,-43398e4,-417646800,-401925600,-386197200,-370476e3,-354747600,-339026400,-323298e3,-307576800,-291848400,-276127200,-260398800,-244677600,-228344400,-212623200,-196894800,-181173600,-165445200,-149724e3,-133995600,-118274400,212547600,228268800,243997200,260323200,276051600,291772800,307504800,323222400,338954400,354675600,370404e3,386125200,401853600,417578400,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-2205,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,7200,3600,7200,3600,7200,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Dublin":{
|
||
time:[-2821651200,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-733352400,-719445600,-699483600,-684972e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-1500,-1521,2079,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Oslo":{
|
||
time:[-2366755200,-1691881200,-1680566400,-927507600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-340840800,-324507600,-308786400,-293058e3,-277336800,-261608400,-245887200,-230158800,-214437600,-198709200,-182988e3,-166654800,-147909600,-135205200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]}}},"3t3b":function(e,t,i){"use strict";i.r(t),i.d(t,"dateFormatProperty",(function(){return a})),i.d(t,"restoreDateFormatSettingsValue",(function(){return l}));var s=i("Vdly"),r=i("m/cY"),n=i("e1ZQ");function o(){return s.getValue("date_format",Object(n.c)())}const a=Object(r.a)(o());function l(){a.setValue(Object(n.c)()),s.remove("date_format")}s.onSync.subscribe(null,()=>a.setValue(o())),a.listeners().subscribe(null,()=>s.setValue("date_format",a.value()))},"3u3j":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("Eyy1"),r=i("RDU5");class n extends r.UndoCommand{constructor(e,t,i){super(i),this._chartModel=e,this._sourceId=t.id();const r=Object(s.ensureNotNull)(t.priceScale());this._initialPriceScaleId=r.id(),this._initialPriceScaleState=Object(s.ensureNotNull)(t.priceScale()).state();const n=Object(s.ensureNotNull)(e.paneForSource(t));this._initialPriceScalePosition=n.priceScalePosition(r),this._initialPriceScaleIndex=n.priceScaleIndex(r,this._initialPriceScalePosition),this._initialPaneIndex=e.panes().indexOf(n)}_newPriceScaleState(e){
|
||
const t=Object.assign({},this._initialPriceScaleState);return delete t.m_isLockScale,delete t.id,delete t.m_topMargin,delete t.m_bottomMargin,t}_originalPriceScaleState(){return this._initialPriceScaleState}}},"4TVt":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolPriceAxisView",(function(){return n}));var s=i("Eyy1"),r=i("KcY8");class n extends r.a{constructor(e,t){super(),this._active=!1,this._source=e,this._data=t}setActive(e){this._active=e}_updateRendererData(e,t,i){e.visible=!1;const s=this._source.model();if(!s.timeScale()||s.timeScale().isEmpty())return;const r=this._source.priceScale();if(null===r||r.isEmpty())return;if(!s.selection().isSelected(this._source)&&!this._source.isForcedDrawPriceAxisLabel())return;if(null===s.timeScale().visibleBarsStrictRange())return;const n=this._source.priceAxisPoints(),o=this._data.pointIndex;if(n.length<=o)return;const a=n[o];if(!isFinite(a.price))return;const l=this._source.ownerSource(),c=null!==l?l.firstValue():null;if(null===c)return;let h=this._active?"#1565C0":s.isDark()?"#1E88E5":"#2196F3";this._data.backgroundProperty?h=this._data.backgroundProperty.value():this._data.backgroundPropertyGetter&&(h=this._data.backgroundPropertyGetter()),i.background=h,i.borderColor="#2E84A6",i.textColor=this.generateTextColor(h),i.coordinate=r.priceToCoordinate(a.price,c),e.text=this._formatPrice(a.price,c),e.visible=!0}_formatPrice(e,t){return Object(s.ensureNotNull)(this._source.priceScale()).formatPrice(e,t)}}},"4bfY":function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"FzRY",7)).then(({FibCirclesPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 2}name(){return"Fib Circles"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}static createProperties(e){var t=new r("linetoolfibcircles",e,!1,{range:[1,11]});return l._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"6U6r"))).FibCirclesDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,t.LineToolFibCircles=l},"4kQX":function(e,t,i){"use strict";i.r(t),i.d(t,"TimeFormatter",(function(){return r}));var s=i("kcTO");class r{constructor(e){this._formatStr=e||"%h:%m:%s"}format(e){
|
||
return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(s.numberToStringWithLeadingZero)(e.getUTCHours(),2)).replace("%m",Object(s.numberToStringWithLeadingZero)(e.getUTCMinutes(),2)).replace("%s",Object(s.numberToStringWithLeadingZero)(e.getUTCSeconds(),2))}formatLocal(e){return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.formatLocal?s.customFormatters.timeFormatter.formatLocal(e):s.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(s.numberToStringWithLeadingZero)(e.getHours(),2)).replace("%m",Object(s.numberToStringWithLeadingZero)(e.getMinutes(),2)).replace("%s",Object(s.numberToStringWithLeadingZero)(e.getSeconds(),2))}}},"4miz":function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r}));class s{constructor(e,t){this._visible=!0,this._title=e,this._value=t}title(){return this._title}setTitle(e){this._title=e}text(){return this._value}value(){return this._value}setValue(e){this._value=e}visible(){return this._visible}setVisible(e){this._visible=e}color(){return this._color}setColor(e){this._color=e}}class r{constructor(){this._items=[],this._header="",this._title=""}header(){return this._header}title(){return this._title}items(){return this._items}update(){}}},"4o++":function(e,t,i){"use strict";var s;i.r(t),i.d(t,"MagnetMode",(function(){return s})),function(e){e[e.WeakMagnet=0]="WeakMagnet",e[e.StrongMagnet=1]="StrongMagnet"}(s||(s={}))},"4u8j":function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"ZJWf",7)).then(({GannFanPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 2}name(){return"Gann Fan"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"ASG6"))).GannFanDefinitionsViewModel}static createProperties(e){var t=new r("linetoolgannfan",e,!1,{range:[1,9]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[],i=[],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=9,t.LineToolGannFan=l},"4vW/":function(e,t,i){"use strict";var s;i.r(t),i.d(t,"ColorType",(function(){return s})),function(e){e.Solid="solid",e.Gradient="gradient"}(s||(s={}))},"54XG":function(e,t,i){"use strict";i.r(t),i.d(t,"FavoriteStudyTemplateService",(function(){return r}));var s=i("ulZB");class r extends s.b{constructor(e,t){super(e,t,"FAVORITE_STUDY_TEMPLATES_CHANGED","StudyTemplates.quicks",[])}remove(e){this.set(this.get().filter(t=>t!==e))}}},
|
||
"55Xp":function(e,t,i){"use strict";function s(e){const t=e.toString(),i=t.split(".")[1];let s=2;if(i){const e=i.match(/^([0]+)/);e&&(s=e[1].length+1)}return parseFloat(t).toFixed(s)}i.r(t),i.d(t,"roundToFirstValuable",(function(){return s}))},"5B3K":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyError",(function(){return s}));class s extends Error{constructor(e){super(e),this.studyError=!0}}},"5C6T":function(e,t,i){"use strict";i.r(t),i.d(t,"PipFormatter",(function(){return r}));var s=i("kcTO");class r extends s.PriceFormatter{constructor(e,t,i,s){t||(t=1),"forex"!==i&&"cfd"!==i||!s?(super(1),this._isForex=!1):(super(s),this._isForex=!0),this._pipPriceScale=e,this._pipMinMove=t,this._pipMinMove2=s}format(e,t,i){let s=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===s&&(s=NaN),super.format(e*this._pipPriceScale/s,t,i)}}},"5JMW":function(e,t,i){"use strict";i.r(t),i.d(t,"isLineToolRiskReward",(function(){return a})),i.d(t,"LineDataSourceApi",(function(){return c}));var s=i("Eyy1"),r=i("ogJP");const n=new Map([["LineToolRiskRewardLong",2],["LineToolRiskRewardShort",2],["LineToolBezierQuadro",3],["LineToolBezierCubic",4]]);function o(e){const t=n.get(e.toolname);if(void 0!==t)return t;const i=e.pointsCount();return-1===i?e.points().length:i}function a(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}const l=["alwaysShowStats","entryPrice","interval","lastUpdateTime","points","snapTo45Degrees","stopPrice","symbol","targetPrice"];class c{constructor(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}isSelectionEnabled(){return this._source.isSelectionEnabled()}setSelectionEnabled(e){this._source.setSelectionEnabled(e)}isSavingEnabled(){return this._source.isSavedInChart()}setSavingEnabled(e){this._source.setSavingInChartEnabled(e)}isShowInObjectsTreeEnabled(){return this._source.showInObjectTree()}setShowInObjectsTreeEnabled(e){this._source.setShowInObjectsTreeEnabled(e)}isUserEditEnabled(){return this._source.userEditEnabled()}setUserEditEnabled(e){this._source.setUserEditEnabled(e)}bringToFront(){this._model.bringToFront([this._source])}sendToBack(){this._model.sendToBack([this._source])}getProperties(){return this._source.properties().state(l,!0)}setProperties(e){this._setProps(this._source.properties(),e,"")}getPoints(){let e=this._source.points();const t=o(this._source);return e.length>t&&(Object(s.assert)(a(this._source.toolname)),e=e.slice(0,t)),this._pointsConverter.dataSourcePointsToPriced(e)}setPoints(e){if(this._source.isFixed())return;const t=o(this._source);if(t!==e.length)throw new Error(`Wrong points count. Required: ${t}, provided: ${e.length}`);const i=this._pointsConverter.apiPointsToDataSource(e);this._model.startChangingLinetool(this._source),this._model.changeLinePoints(this._source,i),this._model.endChangingLinetool(!0),this._source.createServerPoints()}changePoint(e,t){if(this._source.isFixed())return;const i=this._pointsConverter.apiPointsToDataSource([e])[0];this._model.startChangingLinetool(this._source,Object.assign({},i),t),
|
||
this._model.changeLinePoint(Object.assign({},i)),this._model.endChangingLinetool(!1),this._source.createServerPoints()}isHidden(){return this._source.isSourceHidden()}getRawPoints(){return this._source.points()}setRawPoint(e,t){this._model.startChangingLinetool(this._source,Object.assign({},t),e),this._model.changeLinePoint(Object.assign({},t)),this._model.endChangingLinetool(!1)}move(e,t){this._model.startMovingSources([this._source],{logical:e},null,new Map),this._model.moveSources({logical:t},new Map),this._model.endMovingSources(!1)}dataAndViewsReady(){return this._source.dataAndViewsReady()}zorder(){return this._source.zorder()}_setProps(e,t,i){for(const s in t){if(!t.hasOwnProperty(s))continue;const n=0===i.length?s:`${i}.${s}`;if(e.hasOwnProperty(s)){const i=t[s];Object(r.isHashObject)(i)?this._setProps(e[s],i,n):e[s].setValue(i)}else console.warn(`Unknown property "${n}"`)}}}},"5VQP":function(e,t,i){"use strict";i.r(t),i.d(t,"ContextMenuManager",(function(){return s}));var s,r=i("tWVy");!function(e){const t=[];function s(){Object(r.b)()}e.createMenu=async function(e,r={},n){const o=new((await Promise.all([i.e("react"),i.e(7),i.e(16),i.e(18),i.e(20),i.e(47),i.e(63),i.e(0),i.e(4),i.e(55),i.e("context-menu-renderer")]).then(i.bind(null,"cbq4"))).ContextMenuRenderer)(e,r,()=>{const e=t.indexOf(o);-1!==e&&t.splice(e,1),void 0!==n&&n()},s);return t.push(o),o},e.hideAll=s,e.getShown=function(){for(let e=0;e<t.length;e++)if(t[e].isShown())return t[e];return null}}(s||(s={}))},"5ZUI":function(e,t,i){"use strict";var s=i("WPQD").LineToolTrendLine,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties())}name(){return"Ray"}static createProperties(e){var t=new r("linetoolray",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolRay=n},"5fI3":function(e,t,i){"use strict";function s(e){return function(e){return"="+JSON.stringify(e)}(e)}function r(e){return"="===e[0]}function n(e){if(!r(e))return{symbol:e};try{return JSON.parse(e.slice(1))}catch(t){return{symbol:e}}}i.r(t),i.d(t,"encodeExtendedSymbolOrGetSimpleSymbolString",(function(){return s})),i.d(t,"isEncodedExtendedSymbol",(function(){return r})),i.d(t,"decodeExtendedSymbol",(function(){return n}))},"5mo2":function(e,t,i){"use strict";i.r(t);var s=i("jCNj"),r=i("Y7w9"),n=i("txPx"),o=i("OBgQ");const a=Object(n.getLogger)("Chart.Model.SessionSpec");function l(e){return e>=48&&e<=57}class c{constructor(){this.entries=[],this.firstDayOfWeek=s.MONDAY,this.weekEndsCount=-1}parseSessions(e,t){if(this._clear(),this.timezone=e,"24x7"===(t=this._parseFirstDayOfWeek(t)).toLowerCase())for(const s of u)this.entries.push(c._createSessionEntry(s,0,0,0,0));else{let e=!1;const i=new Map;for(const s of t.split("|")){const t=s.split(":");if(1!==t.length&&2!==t.length){a.logError("Bad session section: "+s);continue}const r=1===t.length;if(r){if(e){a.logError("Duplicated default section: "+s);continue}e=!0}const n=r?h:c._parseWorkingDays(t[1]);for(const e of n)r&&i.has(e)||i.set(e,t[0])}
|
||
for(const t of u){const e=i.get(t);if(void 0!==e)for(const i of e.split(","))this.entries.push(c._parseSessionEntry(t,i))}}this.entries.sort(p);const i=new Set;for(const s of this.entries)i.add(s.dayOfWeek());this.weekEndsCount=7-i.size}static parseHolidaysAndCorrections(e,t,i){const r=new Map,n=new Map,o=e=>{const t=this._parseDay(e),i=t.toString(),s=n.get(i);return void 0!==s?s:(n.set(i,t),t)};if(""!==t){const e=[];for(const i of t.split(",")){if(8!==i.length)throw new Error("bad holiday date: "+i);const t=o(i);r.set(t,e)}}if(""===i)return r;const a=s.get_timezone("Etc/UTC");for(const l of i.split(";")){const e=l.split(":");if(2!==e.length)throw new Error("bad correction section: "+l);const t=[];if("dayoff"!==e[0])for(const i of e[0].split(","))t.push(this._parseSessionEntry(1,i));for(const i of e[1].split(",")){if(8!==i.length)throw new Error("bad correction date: "+i);const e=o(i),n=s.get_day_of_week(s.get_cal(a,e.year,e.month-1,e.day)),l=[];for(const i of t)l.push(new _(n,i.startOffset(),i.length()));r.set(e,l)}}return r}_clear(){this.entries=[],this.timezone="",this.firstDayOfWeek=s.MONDAY,this.weekEndsCount=-1}_parseFirstDayOfWeek(e){const t=e.split(";");if(t.length>2)return a.logError("Only one `first day` specification expected @ session "+e),e;if(1===t.length)return e;let i=1;let r=t[0].indexOf("-")>=0?NaN:parseInt(t[0]);return isNaN(r)&&(i=0,r=parseInt(t[1])),r<s.SUNDAY||r>s.SATURDAY?(a.logError(`Unexpected day index @ session: ${e}; day index ${r}`),e):(this.firstDayOfWeek=r,t[i])}static _parseDay(e){const t=parseInt(e.substring(0,4)),i=parseInt(e.substring(4,6)),s=parseInt(e.substring(6,8));return new o.a(t,i,s)}static _parseSessionEntry(e,t){let i=t.split("-");2!==i.length&&(a.logError("Bad sessions entry: "+t),i=["0000","0000"]);let s=0,r=i[0];if(r.includes("F")){const e=r.split("F");r=e[0],s=""!==e[1]?parseInt(e[1]):1}let n=0,o=i[1];if(o.includes("F")){const e=o.split("F");o=e[0],n=""!==e[1]?parseInt(e[1]):1}if(!this._isCorrectSession(r)||!this._isCorrectSession(o))throw new Error("Incorrect entry syntax: "+t);const l=r,h=o;return this._createSessionEntry(e,c._minutesFromHHMM(l),c._minutesFromHHMM(h),s,n)}static _isCorrectSession(e){return 4===e.length&&l(e.charCodeAt(0))&&l(e.charCodeAt(1))&&l(e.charCodeAt(2))&&l(e.charCodeAt(3))}static _parseWorkingDays(e){const t=[];for(let i=0;i<e.length;i++){const s=+e[i];-1===t.indexOf(s)&&t.push(s)}return t}static _minutesFromHHMM(e){return s.get_minutes_from_hhmm(e)}static _createSessionEntry(e,t,i,r,n){0===i&&(i=s.minutesPerDay),r===n&&i<=t&&(r+=1),r>0&&(t-=r*s.minutesPerDay),n>0&&(i-=n*s.minutesPerDay);return new _(e,t,i-t)}}i.d(t,"workingDays",(function(){return h})),i.d(t,"workingDaysAndWeekEnds",(function(){return u})),i.d(t,"compareSessionEntries",(function(){return p})),i.d(t,"SessionEntry",(function(){return _})),i.d(t,"EntryIndex",(function(){return m})),i.d(t,"SessionSpec",(function(){return g}));const h=[s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY],u=[s.SUNDAY,s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY,s.SATURDAY];function d(e,t){
|
||
return e.compareTo(t)<0}function p(e,t){return e.compareTo(t)}class _{constructor(e,t,i){this._dayOfWeek=e,this._start=t,this._length=i}start(){return this._start+s.minutesPerDay*this.sessionStartDaysOffset()}startOffset(){return this._start}sessionStartDaysOffset(){return this._start>=0?0:this._start%s.minutesPerDay==0?-Math.ceil(this._start/s.minutesPerDay):-Math.floor(this._start/s.minutesPerDay)}sessionEndDaysOffset(){const e=this._start+this._length;return e>=0?0:e%s.minutesPerDay==0?-Math.ceil(e/s.minutesPerDay):-Math.floor(e/s.minutesPerDay)}isOvernight(){return this._start<0}dayOfWeek(){return this._dayOfWeek}sessionStartDayOfWeek(){let e=this._dayOfWeek-this.sessionStartDaysOffset();return e<s.SUNDAY&&(e+=7),e}length(){return this._length}weight(){return this._dayOfWeek*s.minutesPerDay+this._start}compareTo(e){const t=this.weight(),i=t+this._length,s=e.weight(),r=s+e._length;return t<=s&&s<i||s<=t&&t<r?0:t>s?1:-1}contains(e){const t=60*s.get_hours(e)+s.get_minutes(e);let i=s.get_day_of_week(e)-this._dayOfWeek;i>0&&(i-=7);const r=i*s.minutesPerDay+t;return r>=this._start&&r<this._start+this._length}}class m{constructor(e,t,i){this.weekIndex=e,this.entryIndex=t,this.entries=i}getEntry(){return this.entries[this.entryIndex]}}function f(e,t){const i=Object(r.lowerbound)(e,t,(e,t)=>-1===e.day.compareTo(t));return i===e.length?null:e[i]}class g{constructor(e="Etc/UTC",t="0000-0000",i="",r=""){this._entries=[],this._firstDayOfWeek=s.MONDAY,this._entriesHash=new Map,this._holidayAndCorrectionMap=new Map,this._holidaySessions=[];const n=new c;n.parseSessions(e,t),this._entries=n.entries,this._timezone=n.timezone,this._firstDayOfWeek=n.firstDayOfWeek,this._weekEndsCount=n.weekEndsCount;const o=c.parseHolidaysAndCorrections(e,i,r),a=s.get_timezone(e);this._isThereCorrections=""!==i||""!==r,o.forEach((e,t)=>{this._holidayAndCorrectionMap.set(t.toString(),e),this._holidaySessions.push({day:t,sessions:e});const i=this.getWeekIndex(t.toCalendar(a));this._entriesHash.set(i,null)}),this._holidaySessions.sort((e,t)=>e.day.compareTo(t.day))}entries(){return this._entries}timezone(){return this._timezone}firstDayOfWeek(){return this._firstDayOfWeek}addSessionEntry(e,t,i,r,n){0===i&&(i=s.minutesPerDay),r===n&&i<=t&&(r+=1),r>0&&(t-=r*s.minutesPerDay),n>0&&(i-=n*s.minutesPerDay);const o=i-t;this._entries.push(new _(e,t,o))}longestSessionLength(){let e=0,t=0;for(const i of this._holidaySessions)i.sessions.forEach(t=>{e=Math.max(e,t.length())});return this._entries.forEach(e=>{t=Math.max(t,e.length())}),Math.max(e,t)}isWeekEnd(e){const t=Object(r.lowerbound)(this._entries,new _(e,0,0),(e,t)=>e.dayOfWeek()<t.dayOfWeek());return t>this._entries.length-1||this._entries[t].dayOfWeek()!==e}isCalWeekEnd(e){const t=s.get_day_of_week(e);if(!this._isThereCorrections)return this.isWeekEnd(t);const i=o.a.fromCalendar(e),r=this._holidayAndCorrectionMap.get(i.toString());return void 0===r?this.isWeekEnd(t):0===r.length}hasWeekEnds(){return this.weekEndsCount()>0}weekEndsCount(){return this._weekEndsCount}holidaysFromYearStart(e){
|
||
if(!this._isThereCorrections)return 0;const t=s.get_timezone(this._timezone),i=new o.a(s.get_year(e),s.JANUARY,1),r=o.a.fromCalendar(e);let n=0;const a=this._selectHolidays(i,r);for(let o=0;o<a.length;o++){const e=a[o].day.toCalendar(t);this.isWeekEnd(s.get_day_of_week(e))?n+=0===a[o].sessions.length?0:-1:n+=0===a[o].sessions.length?1:0}return n}intradayCanBeBuiltFrom24x7(e){return this._entries.every(t=>t.start()%e==0&&t.length()%e==0)}indexOfSession(e,t,i){const n=this._getEntriesForWeek(e);let o=Object(r.lowerbound)(n,new _(t,i,0),d);if(o!==n.length)return new m(e,o,n);let a=e;const l=7-t+this._firstDayOfWeek-1;for(i=-(s.minutesPerDay-i+l*s.minutesPerDay);;){a++;const e=this._getEntriesForWeek(a);if(0!==e.length)return o=Object(r.lowerbound)(e,new _(this._firstDayOfWeek,i,0),d),new m(a,o,e)}}findSession(e,t,i,s=0){const r=this.indexOfSession(e,t,i),n=r.entries;let o=r.entryIndex;if(0!==s){const e=n[o].dayOfWeek(),t=s>0?1:-1;for(;;){const i=o+t;if(i<0||i>=n.length||n[i].dayOfWeek()!==e)break;o=i}}return new m(r.weekIndex,o,n)}getWeekIndex(e){if(!this._isThereCorrections)return 0;const t=s.get_day_of_week(e)-s.SUNDAY,i=s.get_timezone("Etc/UTC"),r=s.get_cal(i,s.get_year(e),s.get_month(e),s.get_day_of_month(e)-t);return Math.floor((r.getTime()+621672192e5)/1e3/86400/7)}correctTradingDay(e){const t=s.get_day_of_week(e),i=60*s.get_hours(e)+s.get_minutes(e),r=this.getWeekIndex(e),n=this.findSession(r,t,i,0),o=n.getEntry().dayOfWeek()-t+7*(n.weekIndex-r);return 0!==o&&s.add_date(e,o),e}alignToSessionStart(e,t=0){const i=s.get_day_of_week(e),r=60*s.get_hours(e)+s.get_minutes(e),n=this.getWeekIndex(e),o=this.findSession(n,i,r,t),a=o.getEntry(),l=a.dayOfWeek()-i+7*(o.weekIndex-n);0!==l&&s.add_date(e,l);const c=a.startOffset();return s.set_hms(e,c/60,c%60,0,0,s.get_timezone(this._timezone)),a.length()}businessDaysToCalendarDays(e,t){let i=this.getWeekIndex(e),r=s.get_day_of_week(e),n=0,o=0;for(;o<t;){const e=this._getEntriesForWeek(i);let a=0;for(let i=r;i<=s.SATURDAY;i++){n++;let s=!0;for(;a<e.length&&!(e[a].dayOfWeek()>i);)e[a].dayOfWeek()<i||s&&(s=!1,o++),a++;if(o>=t)return n}i++,r=s.SUNDAY}return n}calendarDaysToBusinessDays(e,t){let i=this.getWeekIndex(e),r=s.get_day_of_week(e),n=0,o=0;for(;n<t;){const e=this._getEntriesForWeek(i);let a=0;for(let i=r;i<=s.SATURDAY;i++){n++;let s=!0;for(;a<e.length&&!(e[a].dayOfWeek()>i);)e[a].dayOfWeek()<i||s&&(s=!1,o++),a++;if(n>=t)return o}i++,r=s.SUNDAY}return o}alignToNearestSessionStart(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionStart.bind(this))}alignToNearestSessionEnd(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionEnd.bind(this))}leftBorderOfDailyBar(e){const t=this._getEntriesForDay(e);return 0===t.length?null:(t.sort(p),this._getLeftEntryBorder(e,t[0]))}bordersOfDailyBar(e){const t=this._getEntriesForDay(e);if(0===t.length)return null;t.sort(p);const i=this._getLeftEntryBorder(e,t[0]),r=t[t.length-1],n=s.clone(e);let o=60*(r.startOffset()+r.length())-1;const a=Math.floor(o/3600);return o-=3600*a,
|
||
s.set_hms(n,a,o/60,o%60,0,s.get_timezone(this._timezone)),{from:i,to:n}}_getEntriesForWeek(e){let t=this._entriesHash.get(e);if(void 0===t)return this._entries;if(null!==t)return t;const i=s.get_timezone(this._timezone);t=this._entries.slice();const r=this._weekIndexToCalendar(e),n=this._weekIndexToCalendar(e+1),a=o.a.fromCalendar(r),l=o.a.fromCalendar(n),c=this._selectHolidays(a,l);for(const o of c){const e=o.day.toCalendar(i),r=s.get_day_of_week(e);t=t.filter(e=>e.dayOfWeek()!==r),t=t.concat(o.sessions)}return t.sort(p),this._entriesHash.set(e,t),t}_selectHolidays(e,t){const i=[];let s=e;for(;;){const e=f(this._holidaySessions,s);if(null===e)return i;if(!e.day.before(t))return i;i.push(e),s=e.day.addDays(1)}}_weekIndexToCalendar(e){const t=1e3*(86400*e*7+86400)-621672192e5,i=s.get_cal_from_unix_timestamp_ms(s.get_timezone("Etc/UTC"),t),r=s.get_timezone("Etc/UTC");return s.get_cal(r,s.get_year(i),s.get_month(i),s.get_day_of_month(i))}_alignToNearestSessionValue(e,t,i){const r=s.get_day_of_week(e),n=60*s.get_hours(e)+s.get_minutes(e),o=this.getWeekIndex(e);let a=this.findSession(o,r,n);if(a.getEntry().contains(e)&&o===a.weekIndex||1===t)return i(a,s.clone(e),t);let l=a.entryIndex-1;if(l<0){let e=a.weekIndex,t=a.entries;for(;l<0;)e--,t=this._getEntriesForWeek(e),l+=t.length;a=new m(e,l,t)}else a=new m(a.weekIndex,l,a.entries);return i(a,s.clone(e),t)}_entrySessionStart(e,t,i){return this._entrySessionValue(e,t,i,e=>60*e.start())}_entrySessionEnd(e,t,i){return this._entrySessionValue(e,t,i,e=>60*(e.start()+e.length())-1)}_entrySessionValue(e,t,i,r){let n=s.get_day_of_week(t);const o=e.getEntry();let a=o.dayOfWeek()-o.sessionStartDaysOffset();const l=this.getWeekIndex(t);let c=e.weekIndex-l,h=!1;if(a<s.SUNDAY&&(c<=0?h=!0:c--,a+=7),(c>0&&i>=0||c<0&&i<0)&&s.add_date(t,7*c),!o.contains(t)){let e=a-n;h&&i<0&&(e=-(7-a+n)),s.add_date(t,e),n=s.get_day_of_week(t)}o.isOvernight()&&n===o.dayOfWeek()&&s.add_date(t,-o.sessionStartDaysOffset());let u=r(o);const d=Math.floor(u/3600);return u-=3600*d,s.set_hms(t,d,u/60,u%60,0,s.get_timezone(this._timezone)),t}_getEntriesForDay(e){const t=s.get_day_of_week(e);return this._getEntriesForWeek(this.getWeekIndex(e)).filter(e=>e.dayOfWeek()===t)}_getLeftEntryBorder(e,t){const i=s.clone(e),r=t.startOffset();return s.set_hms(i,r/60,r%60,0,0,s.get_timezone(this._timezone)),i}}},"5rJj":function(e,t,i){"use strict";(function(t){var s=i("ogJP").isSameType,r=i("Ocx9").DefaultProperty;function n(e,t,i,s){this._map=Object.assign({},this._map,s),t&&(t=this.unpackLevels(t)),r.call(this,e,t,i)}inherit(n,r),n.prototype.state=function(e,i){e=e||[];var s=t.prototype.state.call(this,e);return i?s:this.packLevels(s)},n.prototype.clone=function(){for(var e=this.state(),t=new n(this._defaultName,e),i=0;i<this._exclusions.length;++i)t.addExclusion(this._exclusions[i]);return t},n.prototype.merge=function(e,i){return t.prototype.merge.call(this,this.unpackLevels(e),i)},n.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},
|
||
n.prototype._packLvlTpl=function(){return[]},n.prototype._unpackLvlTpl=function(){return{}},n.prototype._packLvlFill=function(e,t,i,s){return s.push(i[t]),s},n.prototype._unpackLvlFill=function(e,t,i,s){return s[t]=i[e],s},n.prototype._iterateLevels=function(e,t){for(var i in this._map.prefixes)for(var r=(this._map.prefixes[i]||"")+"level",n=this._map.range[0];n<=this._map.range[1];n++)if(e[r+n]&&s(e[r+n],t.typecheck())){var o=t.tpl();for(var a in this._map.names)o=t.fill(a,this._map.names[a],e[r+n],o);e[r+n]=o}return e},n.prototype.packLevels=function(e){return this._iterateLevels(e,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},n.prototype.unpackLevels=function(e){return this._iterateLevels(e,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},n.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},e.exports=n}).call(this,i("tc+8"))},"68at":function(e,t,i){"use strict";var s=i("5rJj"),r=i("7ADh").LineToolFibWedgeBase,n=i("j3hX").LineToolColorsProperty;class o extends r{constructor(e,t){super(e,t||o.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"jlk4",7)).then(({ProjectionLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return 1}name(){return"Projection"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"LzAw"))).ProjectionDefinitionsViewModel}static createProperties(e){var t=new s("linetoolprojection",e,!1,{range:[1,1]});return o._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e),e.addChild("linesColors",new n([e.trendline.color]))}}t.LineToolProjection=o},"6I19":function(e,t,i){"use strict";i.d(t,"b",(function(){return y})),i.d(t,"c",(function(){return w})),i.d(t,"a",(function(){return C}));var s=i("Eyy1"),r=i("ivNn"),n=i("eJTA"),o=i("YFKU"),a=i("qFKp"),l=i("Tmoa"),c=i("Ialn"),h=i("k9/m"),u=i("CW80"),d=i("mMWL"),p=i("GH0z"),_=i("38az"),m=i("7qT/");const f=a.CheckMobile.any(),g=f&&!0,v=new p.PercentageFormatter,b=window.t("n/a"),S=`${b} (${b}%)`;function y(e,t){const i=Object(n.parseRgb)(t),s=Object(n.parseRgb)(e);return Object(n.distanceRgb)(i,s)<70?Object(n.rgbToHexString)(Object(n.invertRgb)(i)):t}function w(e){if(null===e)return null;const t=e.properties().child("background");return void 0===t?null:t.value()}class C{constructor(e,t){this._series=e,this._model=t,this._emptyValues=[{title:Object(o.t)("Open"),visible:!1,value:"",index:0,id:""},{title:Object(o.t)("High"),visible:!1,value:"",index:1,id:""},{title:Object(o.t)("Low"),visible:!1,value:"",index:2,id:""},{title:Object(o.t)("Close"),visible:!1,value:"",index:3,id:""},{title:"",visible:!1,value:"",index:4,id:""},{title:"",visible:!1,value:"",index:5,id:""},{title:Object(o.t)("Change"),visible:!1,value:"",index:6,id:""}]}getItems(){return this._emptyValues}getValues(e){const t=this._emptyValues.map(e=>Object.assign({},e)),i=this._showLastPriceAndChangeOnly()
|
||
;for(const s of t)s.visible=!i;t[0].value=b,t[1].value=b,t[2].value=b,t[3].value=b,t[6].value=S,t[5].visible=!1;const n=t[4];if(n.value=b,n.visible=!1,this._model.timeScale().isEmpty()||0===this._series.bars().size()||this._series.priceScale().isEmpty())return t;Object(r.isNumber)(e)||(e=Object(s.ensureNotNull)(this._series.data().last()).index);const o=this._series.nearestIndex(e,h.PlotRowSearchMode.NearestLeft);if(void 0===o)return t;const a=this._series.data().valueAt(o),u=w(this._series.model().paneForSource(this._series));if(null===a||null===u)return t;const d=a[1],p=a[2],m=a[3],f=a[4];if(null==d||null==p||null==m||null==f)return t;const C=this._series.formatter();let P=S;const x=this._changesData(f,o,i);void 0!==x.values&&(P=Object(c.forceLTRStr)(`${C.format(x.values.change,!0)} (${v.format(x.values.percentChange,!0)})`)),t[6].value=P,i?(t[5].value=C.format(f),t[5].visible=!0,t[6].visible=!0):(t[0].value=C.format(d),t[1].value=C.format(p),t[2].value=C.format(m),t[3].value=C.format(f),t[4].value=C.format(this._series.barFunction()(a)));let T=null;if(i&&!g)T=void 0===x.values||x.values.change>=0?_.SeriesBarColorer.upColor(this._series.properties()):_.SeriesBarColorer.downColor(this._series.properties());else{const e=this._series.barColorer().barStyle(o,!1);T=y(u,null!=e.barBorderColor?e.barBorderColor:e.barColor)}T=Object(l.resetTransparency)(y(u,T));for(const s of t)s.color=T;return t}_showLastPriceAndChangeOnly(){return f&&(null===this._model.crossHairSource().pane||Object(u.isLineToolName)(d.tool.value())||null!==this._model.lineBeingEdited())}_changesData(e,t,i){if(i&&!g){const e=this._series.quotes();if(null!==e)return{values:{change:e.change,percentChange:e.change_percent}}}else{const i=this._series.data().valueAt(t-1),s=i&&i[4]||null;if(null!==s)return{values:{change:e-s,percentChange:Object(m.a)(s,e)}}}return{}}}},"6ctS":function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor" transform="translate(3 6)"><path d="M.964 8C3 4 6.679.5 11 .5 15.32.5 19 4 21.036 8 19 12 15.32 15.5 11 15.5 6.679 15.5 3 12 .964 8z"/><circle cx="11" cy="8" r="3.5"/></g></svg>'},"6et/":function(e,t,i){"use strict";i.r(t),i.d(t,"listen",(function(){return l})),i.d(t,"registerListener",(function(){return c})),i.d(t,"removeListener",(function(){return h})),i.d(t,"pushBackListener",(function(){return u})),i.d(t,"disable",(function(){return d})),i.d(t,"enable",(function(){return p}));var s=i("e3/o");const r=[];let n=null;function o(e){for(let t=0;t<r.length;t++)if(r[t].name===e)return t;return-1}function a(e){if(!n)for(let t=r.length-1;t>=0&&!0!==r[t].func(e);t--);}function l(e){e.addEventListener("keypress",a,!1)}function c(e,t){const i={name:e,func:t},s=o(i.name);s>-1?r[s]=i:r.push(i)}function h(e){r.forEach((t,i)=>{t.name===e&&r.splice(i,1)})}function u(e,t){const i={name:e,func:t},s=o(i.name);s>-1&&r.splice(s,1),r.unshift(i)}function d(){return n?null:(n=Object(s.randomHashN)(4),n)}function p(e){if(e!==n)throw Error("Lock id is outdated");n=null
|
||
}l(window)},"6sst":function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayStudyPriceLineAxisView",(function(){return r}));var s=i("TmNs");class r extends s.PriceLineAxisView{constructor(e){super(),this._study=e}_value(){return this._study.lastValueData("",!0)}_priceLineColor(e){return e}_lineWidth(){return 1}_isVisible(){const e=this._study.model().properties().scalesProperties.showSeriesLastValue.value();return this._study.properties().childs().showPriceLine.value()&&e}}},"6vtU":function(e,t,i){"use strict";i.r(t),i.d(t,"setAdditionalSymbolInfoFields",(function(){return r})),i.d(t,"getAdditionalSymbolInfoFields",(function(){return n}));let s=[];function r(e){s=e}function n(){return s}},"704P":function(e,t,i){"use strict";(function(e){var s=i("Ss5c").LineDataSource,r=i("jkoZ"),n=i("Ocx9").DefaultProperty,o=i("k9/m").PlotRowSearchMode,a=i("s1Gx").sortSourcesPreOrdered.LineToolExecution;class l{constructor(e,t){this._pane=e,this._timeScale=t}static recreateOrderedByBarsSourcesCache(e){l.clearOrderedByBarsSourcesCache();for(var t=l.prototype,i=e.sourcesByGroup().all(),s=0;s<i.length;++s){var r=i[s];if(r._adapter&&void 0!==r._adapter._index){var n=t._cachedByBarIndexOrderedExecutions[r._adapter._index];t._cachedByBarIndexOrderedExecutions[r._adapter._index]=n||[],t._cachedByBarIndexOrderedExecutions[r._adapter._index].push(r)}}}static clearOrderedByBarsSourcesCache(){l.prototype._cachedByBarIndexOrderedExecutions={}}getXYCoordinate(e,t,i){var s=0,r=e.getDirection(),n="buy"===r,a=this._pane.model().mainSeries();if(a.bars){var l=n?10:-10,c=a.bars().search(i,o.NearestLeft);if(null!==c){i=c.index;var u=n?c.value[TradingView.LOW_PLOT]:c.value[TradingView.HIGH_PLOT],d=a.priceScale(),p=a.firstValue();s=d.priceToCoordinate(u,p)+l}}e._index=i;var _=t.visibleBarsStrictRange();if(!isFinite(i)||null===_||i>_.lastBar()||i<_.firstBar())return{x:-1,y:-1};for(var m=this._cachedByBarIndexOrderedExecutions[i]||this._pane.sourcesByGroup().all(),f=m.length-1;f>=0;--f){var g=m[f];if(g instanceof h&&g._adapter._index===i&&g._adapter.getDirection()===r){if(g===e._line)break;var v=g._adapter._height();s=n?s+v:s-v}}return{x:t.indexToCoordinate(i),y:s}}}l.prototype._cachedByBarIndexOrderedExecutions={};class c{constructor(e){this._line=e}_height(){var e=this.getArrowHeight(),t=this.getArrowSpacing();this.getText()&&r.fontHeight(this.getFont());return e+t+0+10}getIndex(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index}setIndex(e){var t=this._line._model.timeScale().baseIndex()-Math.abs(e);this._line.startMoving({logical:this._line.points()[0]});var i=TradingView.merge({},this._line.points()[0]);return i.index=t,this._line.move({logical:i}),this._line.endMoving(),this}getTime(){return this._unixtime}setTime(e){return this._unixtime=e,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0}setPrice(e){
|
||
return this._line.points().length>0&&(this._line.points()[0].price=e),this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this}getText(){return this._line.properties().text.value()}setText(e){return this._line.properties().text.setValue(e||""),this._line.updateAllViewsAndRedraw(),this}getArrowHeight(){return this._line.properties().arrowHeight.value()}setArrowHeight(e){return this._line.properties().arrowHeight.setValue(e||5),this}getArrowSpacing(){return this._line.properties().arrowSpacing.value()}setArrowSpacing(e){return this._line.properties().arrowSpacing.setValue(e||1),this}getDirection(){return this._line.properties().direction.value()}setDirection(e){return this._line.properties().direction.setValue(e||"buy"),this}getArrowColor(){var e=this._line.properties();return"buy"===this.getDirection()?e.arrowBuyColor.value():e.arrowSellColor.value()}setArrowColor(e){return"buy"===this.getDirection()?this.setArrowBuyColor(e):this.setArrowSellColor(e),this}setArrowBuyColor(e){return this._line.properties().arrowBuyColor.setValue(e),this}setArrowSellColor(e){return this._line.properties().arrowSellColor.setValue(e),this}getTextColor(){return r.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)}setTextColor(e){return r.setColorToProperties(e,this._line.properties().textColor,this._line.properties().textTransparency),this}getFont(){return r.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)}setFont(e){return r.setFontToProperties(e,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this}setTooltip(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this}getTooltip(){return this._line.properties().tooltip.value()}remove(){this._line._model.removeSource(this._line),delete this._line}getPoints(){return this._line.points()}}class h extends s{constructor(e,t){super(e,t||h.createProperties()),this._adapter=new c(this),this.customization.forcePriceAxisLabel=!1,this.customization.disableErasing=!0,this.customization.showInObjectTree=!1,this.setSelectionEnabled(!1),i.e("lt-pane-views").then(i.t.bind(null,"tjxb",7)).then(({ExecutionPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}zorder(){return a}pointsCount(){return h.POINTS_COUNT}name(){return"Execution"}hasContextMenu(){return!1}state(){return null}updateAllViews(){return this._isVisible()?s.prototype.updateAllViews.call(this):null}priceAxisViews(e,t){return this._isVisible()?s.prototype.priceAxisViews.call(this,e,t):null}_isVisible(){return this._model.properties().tradingProperties.showExecutions.value()}paneViews(){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?s.prototype.paneViews.call(this):null}userEditEnabled(){return!1}showInObjectTree(){return!1}cloneable(){return!1}copiable(){return!1}
|
||
isSynchronizable(){return!1}static createProperties(e){var t=new n("linetoolexecution",e,!1,!1);return h._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}h.POINTS_COUNT=1,t.ExecutionsPositionController=l,t.LineToolExecution=h}).call(this,i("Kxc7"))},"7ADh":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolFibWedgeBase",(function(){return o}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ss5c");class o extends n.LineDataSource{pointsCount(){return 3}hasEditableCoordinates(){return!1}setPoint(e,t){if(super.setPoint(e,t),!this._recursiveGuard)try{if(this._recursiveGuard=!0,2===e){const e=this.pointToScreenPoint(this._points[0])[0];let t=this.pointToScreenPoint(this._points[1])[0];const i=this.pointToScreenPoint(this._points[2])[0].subtract(e).length();let s=t.subtract(e);s.length()<=0&&(s=new r.Point(1,0)),t=e.add(s.normalized().scaled(i));const n=this.screenPointToPoint(t),o=this._pointsProperty.childs().points[1];o.childs().price.setValue(n.price),o.childs().bar.setValue(n.index)}else{const e=this.pointToScreenPoint(this._points[0])[0],t=this.pointToScreenPoint(this._points[1])[0];let i=this.pointToScreenPoint(this._points[2])[0];const s=t.subtract(e).length();let n=i.subtract(e);n.length()<=0&&(n=new r.Point(1,0)),i=e.add(n.normalized().scaled(s));const o=this.screenPointToPoint(i),a=this._pointsProperty.childs().points[2];a.childs().price.setValue(o.price),a.childs().bar.setValue(o.index)}}finally{this._recursiveGuard=!1}}addPoint(e){if(2===this._points.length){const t=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0];let r=this.pointToScreenPoint(e)[0];const n=i.subtract(t).length(),o=r.subtract(t).normalized();r=t.add(o.scaled(n));const a=Object(s.ensureNotNull)(this.ownerSource()),l=Object(s.ensureNotNull)(a.firstValue()),c=Object(s.ensureNotNull)(this.priceScale()).coordinateToPrice(r.y,l);e={index:Math.round(this._model.timeScale().coordinateToIndex(r.x)),price:c}}return n.LineDataSource.prototype.addPoint.call(this,e)}}},"7ETO":function(e,t,i){"use strict";i.r(t);var s=i("ocLq");class r{main(e){const t=e.new_var(s.Std.open(e)),i=e.new_var(s.Std.close(e)),r=t.get(1),n=i.get(1),o=s.Std.ohlc4(e),a=s.Std.na(t.get(1))?(s.Std.open(e)+s.Std.close(e))/2:(r+n)/2;t.set(a),i.set(o);const l=s.Std.max(s.Std.high(e),s.Std.max(a,o)),c=s.Std.min(s.Std.low(e),s.Std.min(a,o)),h=s.Std.volume(e),u=e.symbol;return[u.time,a,l,c,o,h,u.updatetime,u.isBarClosed]}}function n(e){if(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-"))return new r;const t="unknown builder type: "+e.type;throw console.error(t),new Error(t)}i.d(t,"getChartStyleStudy",(function(){return n}))},"7Fue":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));const s=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists","dwglabels","dwglines","dwgboxes","dwgtables","dwgtablecells"];function r(e){return!s.some(t=>e[t]().size>0)}function n(e){const t=new Map;return e.forEach((e,i)=>{
|
||
e.forEach(e=>{const s=Object.assign(Object.assign({},e),{styleId:i}),r=e.firstBarTime;let n=t.get(r);void 0===n&&(n=new Set,t.set(r,n)),n.add(s)})}),t}},"7KDR":function(e,t,i){"use strict";i.r(t),i.d(t,"Action",(function(){return l})),i.d(t,"ActionAsync",(function(){return c})),i.d(t,"Separator",(function(){return h}));var s=i("zRdu"),r=i("aIyQ"),n=i.n(r),o=i("/3z9"),a=i("e3/o");class l{constructor(e,t=a.guid()){this.type=s.a.Action,this._destroyed=!1,this._binding=null,this.id=t,this._onUpdate=new n.a,this._options=e,this.update(e)}execute(){this._options.checkable&&this.update({checked:!this._options.checked}),this._options.onExecute&&this._options.onExecute(this)}getLabel(){return this._options.label||""}getSubItems(){return this._options.subItems||[]}isDisabled(){return!0===this._options.disabled}isActive(){return!0===this._options.active}isCheckable(){return!0===this._options.checkable}isChecked(){return!0===this._options.checked}getPayload(){return this._options.payload}update(e){this._destroyed||(this._unbindShortcut(),e.hotkeyHash&&(this._options.shortcutHint=Object(o.humanReadableHash)(e.hotkeyHash)),this._options=Object.assign(this._options,e),this._bindShortcut(),this._onUpdate.fire(this))}onUpdate(){return this._onUpdate}getState(){return{label:this.getLabel(),disabled:this.isDisabled(),active:this.isActive(),subItems:this.getSubItems(),checkable:this.isCheckable(),checked:this.isChecked(),doNotCloseOnClick:this._options.doNotCloseOnClick||!1,shortcutHint:this._options.shortcutHint,hint:this._options.hint,icon:this._options.icon,iconChecked:this._options.iconChecked,toolbox:this._options.toolbox,showToolboxOnHover:this._options.showToolboxOnHover||!1,statName:this._options.statName,name:this._options.name,fullWidthLabel:this._options.fullWidthLabel}}getBinding(){return this._binding}setBinding(e){this._binding=e}destroy(){this._destroyed=!0,this._onUpdate.destroy(),null!==this._binding&&this._binding.destroy(),this._unbindShortcut()}_bindShortcut(){if(!this._options.hotkeyGroup||!this._options.hotkeyHash)return;const e="string"==typeof this._options.label?this._options.label:this._options.name;this._hotkeyAction=this._options.hotkeyGroup.add({hotkey:this._options.hotkeyHash,desc:e,handler:()=>this.execute(),isDisabled:()=>this.isDisabled()})}_unbindShortcut(){this._hotkeyAction&&(this._hotkeyAction.destroy(),delete this._hotkeyAction)}}class c extends l{constructor(e,t){super({},t),this.type=s.a.ActionAsync,this._loader=e,this._loaded=!1}loadOptions(){return this._loadingPromise||(this._loadingPromise=this._loader().then(e=>{this.update(e),this._loaded=!0})),this._loadingPromise}isLoaded(){return this._loaded}}class h{constructor(e,t=a.guid()){this.type=s.a.Separator,this.id=t,this._hint=e}getHint(){return this._hint}}},"7MWe":function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleChangeUndoCommand",(function(){return a}));var s=i("Eyy1"),r=i("txPx"),n=i("RDU5");const o=Object(r.getLogger)("Chart.ChartUndoModel");class a extends n.UndoCommand{constructor(e,t,i,s){super("Scale price",!1),
|
||
this._newPriceScaleState=null,this._model=e,this._paneIndex=e.panes().indexOf(t),this._priceScaleId=i.id(),this._state=s}undo(){if(null!==this._newPriceScaleState)return void o.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");const[e,t]=this._paneAndScale();this._newPriceScaleState=t.state(),this._model.restorePriceScaleState(e,t,this._state)}redo(){if(null===this._newPriceScaleState)return void o.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");const[e,t]=this._paneAndScale();this._model.restorePriceScaleState(e,t,this._newPriceScaleState),this._newPriceScaleState=null}_paneAndScale(){const e=this._model.panes()[this._paneIndex],t=Object(s.ensureNotNull)(e.getPriceScaleById(this._priceScaleId));return[e,t]}}},"7RN7":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));const s=52,r=5},"7dm8":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"d",(function(){return a})),i.d(t,"e",(function(){return l}));var s=i("ocLq");class r{init(e,t){e.new_sym(t(1),s.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1}main(e,t){const i=e.symbol.time,r=s.Std[this._source](e);e.select_sym(1);const n=s.Std[this._source](e),o=e.new_unlimited_var(n),a=e.new_unlimited_var(e.symbol.time);if(e.select_sym(0),isNaN(i))return null;let l=a.indexOf(i);-1!==l&&a.get(l)!==i&&(l=-1);const c=l<0?NaN:o.get(l);return[this._doCalculation(this._scaleFactor1,r,this._scaleFactor2,c)]}}const n={styles:{plot1:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:2,inputs:{source:"close",symbol2:""}},o=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],a=[{id:"plot1",type:"line"}],l={plot1:{title:"Plot",histogramBase:0}}},"7ktv":function(e,t,i){"use strict";i.r(t),i.d(t,"PriceDataSource",(function(){return a}));var s=i("fgLi"),r=i("aIyQ"),n=i.n(r),o=i("/tGj");class a extends s.DataSource{constructor(e){super(),this._formatterChanged=new n.a,this._priceStepChanged=new n.a,this._currencyChanged=new n.a,this._unitChanged=new n.a,this._priceRangeReadyChanged=new n.a,this._metaInfo=null,this._priceStep=null,this._priceRangeReady=!0,this._model=e}firstValue(){return null}barColorer(){return null}base(){return 0}model(){return this._model}currencyChanged(){return this._currencyChanged}isCurrencySource(){return!0}unitChanged(){return this._unitChanged}isUnitSource(){return!0}priceRange(e,t){return null}isDraggable(){return!this._metaInfo||!this._metaInfo.linkedToSeries}priceLineColor(e){return e}formatterChanged(){return this._formatterChanged}priceStep(e){return this._priceStep}priceStepChanged(){return this._priceStepChanged}hasStateForAlert(){return!1}isIncludedInAutoScale(){return!0}correctScaleMargins(e){return e}priceRangeReady(){return this._priceRangeReady}priceRangeReadyChanged(){
|
||
return this._priceRangeReadyChanged}disablePriceRangeReady(){const e=this.priceScale();null===e||e.isAutoScale()||e.mainSource()!==this||(this._priceRangeReady=!1,e.recalculatePriceRangeOnce()),this._priceRangeReadyChanged.fire(!1)}_enablePriceRangeReady(){this._priceRangeReady=!0,this._priceRangeReadyChanged.fire(!0)}_onSourceCurrencyChanged(){Object(o.isSymbolSource)(this)||this._currencyChanged.fire()}_onSourceUnitChanged(){Object(o.isSymbolSource)(this)||this._unitChanged.fire()}_onSourcePriceRangeReadyChanged(e){Object(o.isSymbolSource)(this)||e||this.disablePriceRangeReady()}}},"7nsU":function(e,t,i){"use strict";i.r(t),i.d(t,"showConfirmInputsDialog",(function(){return s}));i("YFKU");function s(e,t,s,r,n="default"){Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(15),i.e(19),i.e(21),i.e(28),i.e(30),i.e(31),i.e(34),i.e(39),i.e(49),i.e(59),i.e(100),i.e(0),i.e(5),i.e(4),i.e(12),i.e(17),i.e(25),i.e(26),i.e(27),i.e(36),i.e(45),i.e(54),i.e("new-confirm-inputs-dialog")]).then(i.bind(null,"iqv3")).then(i=>{const o=new i.ConfirmInputsDialogRenderer(function(e){if("symbol"===e)return window.t("Add Symbol");return window.t("Confirm Inputs")}(n),e,t,n,s,r);return o.show(),o})}},"7qI1":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolRectangle",(function(){return c}));var s=i("aO4+"),r=i("Ocx9"),n=i("tc+8"),o=i.n(n),a=i("Ss5c"),l=i("j3hX");class c extends a.LineDataSource{constructor(e,t){const s=t||c.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"GW0y")).then(({RectanglePaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)})}pointsCount(){return 2}textColorsProperty(){return this.properties().childs().showLabel.value()?super.textColorsProperty():null}properties(){return super.properties()}name(){return"Rectangle"}setPoint(e,t,i){if(e<2&&super.setPoint(e,t,i),i&&i.shift()&&this.properties().childs().snapTo45Degrees){const i=this._getAnchorPointForIndex(e);if(e>=4)return this._correctMiddlePoints(e,t,i),void this.normalizePoints();this._snapPoint45Degree(t,i)}switch(e){case 2:this._points[1].price=t.price,this._points[0].index=t.index;break;case 3:this._points[0].price=t.price,this._points[1].index=t.index;break;case 4:this._points[0].index=t.index;break;case 5:this._points[1].index=t.index;break;case 6:this._points[0].price=t.price;break;case 7:this._points[1].price=t.price}this.normalizePoints()}getPoint(e){return e<2?super.getPoint(e):this._getAnchorPointForIndex(e)}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new r.DefaultProperty("linetoolrectangle",e);return c._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"K4wI")).then(e=>e.RectangleDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_snapPoint45Degree(e,t,i){const s=this.m_priceScale,r=this.ownerSource();if(null===s||null===r)return
|
||
;const n=r.firstValue();if(null===n)return;const o=this._model.timeScale(),a=this.pointToScreenPoint(e)[0],l=this.pointToScreenPoint(t)[0],c=a.x-l.x,h=a.y-l.y,u=c<0?-1:1,d=h<0?-1:1,p=Math.max(Math.abs(c),Math.abs(h)),_=Math.round(o.coordinateToIndex(l.x+p*u)),m=Math.abs(o.indexToCoordinate(_)-l.x),f=s.coordinateToPrice(l.y+m*d,n);e.index=_,e.price=f}_correctMiddlePoints(e,t,i){e<6?this._correctRightLeftMiddlePoint(e,t,i):this._correctTopBottomMiddlePoint(e,t,i)}_correctRightLeftMiddlePoint(e,t,i){const r=this.pointToScreenPoint(t)[0],n=this.pointToScreenPoint(i)[0],o=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0];let l=r.x-n.x;if(0===l)return;const c=o.x<a.x?1:-1,h=o.y<a.y?1:-1;switch(l*=c,e){case 4:{const e=a.y-h*l/2,t=this.screenPointToPoint(new s.Point(a.x,e));this._points[1].price=t.price;const i=this.screenPointToPoint(new s.Point(o.x+c*l,o.y+h*l/2));this._points[0].price=i.price,this._points[0].index=i.index;break}case 5:{const e=o.y-h*l/2,t=this.screenPointToPoint(new s.Point(o.x,e));this._points[0].price=t.price;const i=this.screenPointToPoint(new s.Point(a.x+c*l,a.y+h*l/2));this._points[1].price=i.price,this._points[1].index=i.index;break}}}_correctTopBottomMiddlePoint(e,t,i){const r=this.m_priceScale,n=this.ownerSource();if(null===r||null===n)return;const o=this._model.timeScale(),a=n.firstValue();if(null===a)return;const l=this.pointToScreenPoint(t)[0],c=this.pointToScreenPoint(i)[0],h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=l.y-c.y,p=d<0?-1:1,_=h.x<u.x?1:-1,m=h.y<u.y?1:-1;switch(e){case 6:{const e=Math.floor(u.x-_*d/2),t=this.screenPointToPoint(new s.Point(e,u.y)),i=Math.abs(this._points[1].index-t.index),n=_*m*p*Math.ceil(i/2);if(0===n)return;this._points[1].index=this._points[1].index-n;const l=p*Math.abs(o.indexToCoordinate(this._points[1].index)-u.x);this._points[0].price=r.coordinateToPrice(h.y+l,a),this._points[0].index=this._points[0].index+n;break}case 7:{const e=Math.floor(h.x-_*d/2),t=this.screenPointToPoint(new s.Point(e,h.y)),i=Math.abs(this._points[0].index-t.index),n=_*m*p*Math.ceil(i/2);if(0===n)return;this._points[0].index=this._points[0].index-n;const l=p*Math.abs(o.indexToCoordinate(this._points[0].index)-h.x);this._points[1].price=r.coordinateToPrice(u.y+l,a),this._points[1].index=this._points[1].index+n;break}}}static _configureProperties(e){a.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.a("")),e.addExclusion("text"),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().textColor],e.childs().showLabel))}_getAnchorPointForIndex(e){const t=this.points(),i=t[0],s=t[1];let r=0,n=0;switch(e){case 0:r=i.price,n=i.index;break;case 1:r=s.price,n=s.index;break;case 2:r=s.price,n=i.index;break;case 3:r=i.price,n=s.index;break;case 4:r=(s.price+i.price)/2,n=i.index;break;case 5:r=(s.price+i.price)/2,n=s.index;break;case 6:r=i.price,n=(s.index+i.index)/2;break;case 7:r=s.price,
|
||
n=(s.index+i.index)/2}return{index:n,price:r}}}},"7qT/":function(e,t,i){"use strict";function s(e,t){return 100*(t-e)/Math.abs(e)}i.d(t,"a",(function(){return s}))},"8Blv":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolImage",(function(){return l}));var s=i("Eyy1"),r=i("Ocx9"),n=i("tc+8"),o=i.n(n),a=i("Ss5c");class l extends a.LineDataSource{constructor(e,t){super(e,t||l.createProperties()),this._cssWidth=0,this._cssHeight=0,this._angle=0,this._image=document.createElement("img");const r=this.properties();this._image.src=Object(s.ensureDefined)(r.child("url")).value(),this._image.onload=()=>{if(this._cssWidth&&this._cssHeight)return;const t=e.timeScale().width()/4,i=Object(s.ensureNotNull)(this.priceScale()).height()/4,r=this._image.width,n=this._image.height,o=Math.min(1,t/r),a=Math.min(1,i/n),l=Math.min(o,a),c=Math.round(l*r),h=Math.round(l*n);this._cssWidth=c,this._cssHeight=h},i.e("lt-pane-views").then(i.bind(null,"xiOp")).then(({ImagePaneView:t})=>{this._setPaneViews([new t(this,e)])})}state(e){const t=super.state(e);return Object.assign(Object.assign({},t),{cssWidth:this._cssWidth,cssHeight:this._cssHeight,angle:this._angle})}restoreData(e){this._cssWidth=e.cssWidth,this._cssHeight=e.cssHeight,this._angle=e.angle}cssWidth(){return this._cssWidth}cssHeight(){return this._cssHeight}angle(){return this._angle}pointsCount(){return 1}name(){return"Image"}image(){return this._image}setPoint(e,t,i){const r=this._model.timeScale(),n=Object(s.ensureNotNull)(this.priceScale()),o=Object(s.ensureNotNull)(this._model.paneForSource(this)),a=Object(s.ensureNotNull)(o.mainDataSource()),l=Object(s.ensureNotNull)(a.firstValue()),c=this._image.width,h=this._image.height,u=r.indexToCoordinate(t.index),d=n.priceToCoordinate(t.price,l),p=r.indexToCoordinate(this._points[0].index),_=n.priceToCoordinate(this._points[0].price,l),m=2*Math.abs(u-p)/c,f=2*Math.abs(d-_)/h,g=Math.min(m,f),v=Math.round(c*g),b=Math.round(h*g);this._cssWidth=v,this._cssHeight=b}static createProperties(e){const t=new r.DefaultProperty("linetoolimage",e);return l._configureProperties(t),t}static _configureProperties(e){a.LineDataSource._configureProperties(e),e.hasChild("url")||e.addChild("url",new o.a("")),e.addExclusion("url")}}},"8C8C":function(e,t,i){"use strict";i.r(t),i.d(t,"RestoreFactoryDefaultsUndoCommand",(function(){return r}));var s=i("RDU5");class r extends s.UndoCommand{constructor(e,t,i="Restore Defaults"){super(i),this._chartModel=e,this._defaultProperty=t,this._state=t.state()}redo(){this._chartModel.restoreFactoryDefaults(this._defaultProperty)}undo(){this._defaultProperty.mergeAndFire(this._state),this._chartModel.mainSeries().onChartStyleChanged()}}},"8OdW":function(e,t,i){"use strict";i.r(t),i.d(t,"MINUTE_SPAN",(function(){return s})),i.d(t,"HOUR_SPAN",(function(){return r})),i.d(t,"DAY_SPAN",(function(){return n})),i.d(t,"WEEK_SPAN",(function(){return o})),i.d(t,"MONTH_SPAN",(function(){return a})),i.d(t,"YEAR_SPAN",(function(){return l})),i.d(t,"DEFAULT_BAR_SPACING",(function(){return c}));const s=20,r=30,n=40,o=50,a=60,l=70,c=6},
|
||
"8Uy/":function(e,t,i){"use strict";i.r(t),i.d(t,"LINESTYLE_SOLID",(function(){return s})),i.d(t,"LINESTYLE_DOTTED",(function(){return r})),i.d(t,"LINESTYLE_DASHED",(function(){return n})),i.d(t,"LINESTYLE_LARGE_DASHED",(function(){return o})),i.d(t,"LINESTYLE_SPARSE_DOTTED",(function(){return a})),i.d(t,"LINESTYLE_SMALL_DASHED",(function(){return l}));const s=0,r=1,n=2,o=3,a=4,l=5},"8gnj":function(e,t,i){"use strict";var s=i("LxhU").Interval,r=i("OLhd").isAlignmentEnabled,n=i("7ETO").getChartStyleStudy,o=i("5fI3").decodeExtendedSymbol,a=function(){var e=i("ocLq"),t=e.StudyEngine,a=e.BarBuilder,l=e.BarSet;function c(e){this.host=e,this.cache={}}function h(e){throw console.error(e),e}c.prototype.getCache=function(e){return this.cache[e]},c.prototype.putCache=function(e,t){this.cache[e]=t},c.prototype.subscribe=function(e,t,i,s,r,n,o,a,l,c){var h=l(o),u=function(e,t,i,s,r,n,o,a){var l=r.has_empty_bars?"_":"";return n+e+s+(t||"")+(i||"")+l+"_"+o.countBack+"_"+o.to+"_"+Boolean(a)}(e,t,i,s,o,a,h,c),d=this.getCache(u);return d||(d=this.createItem(e,t,i,s,o,h,a,c),this.putCache(u,d)),d.listeners.addListener(r,n),{key:u,listener:r}},c.prototype.unsubscribe=function(e){var t=this.getCache(e.key);t&&t.listeners.removeListener(e.listener)},c.prototype.removeUnused=function(){var e=[];for(var t in this.cache){if(this.cache[t])0===this.cache[t].listeners.listenersCount()&&e.push(t)}if(0!==e.length){for(var i=0;i<e.length;i++){var s=e[i],r=this.cache[s];this.cache[s]=null,r.stop()}this.removeUnused()}},c.prototype.rebuildFrom=function(e,t){var i=s.parse(e);if((i.isWeeks()||i.isMonths())&&t.has_weekly_and_monthly)return"1"+i.letter();if(i.isDWM()&&(void 0===t.has_daily||t.has_daily))return"1D";if(i.isDWM())return String(t.intraday_multipliers?t.intraday_multipliers[0]:1);if(i.isMinutes()&&void 0!==t.has_intraday&&!t.has_intraday&&h("Misconfiguration error: it is trying to request intraday resolution but symbol does not support it"),i.isSeconds()&&!t.has_seconds&&h("Misconfiguration error: it is trying to request seconds resolution but symbol does not support it"),i.isTicks())return t.has_ticks||h("Misconfiguration error: it is trying to request tick resolution but symbol does not support it"),"1T";var r=i.multiplier(),n=i.isSeconds()?t.seconds_multipliers:t.intraday_multipliers;if(n&&-1===n.indexOf(String(r))){for(var o=n.length-1;o>=0;o--){var a=Number(n[o]);if(r%a==0)return a+i.letter()}h("Misconfiguration error: it is trying to request "+i.value()+" but we cannot build it from lower resolution")}return i.value()};var u=s.parse("1M").inMilliseconds(0);c.prototype.createItem=function(e,t,i,l,c,m,f,g){var v=new _,b=o(e),S="string"!=typeof b.symbol?b.symbol:b;t=S["currency-id"]||t,i=S["unit-id"]||i;var y=S.symbol,w=S.session&&"extended"!==S.session;if("type"in b){var C=Object.assign({},c);return c.has_empty_bars&&(C.has_empty_bars=!1),new p(v,y,t,i,l,n(b),C,m,f)}g&&!r()&&h("Internal error: rebuilding is requested but it is disabled."),
|
||
!g&&c.has_empty_bars&&h('Misconfiguration error: attempt to request data for symbol with "has_empty_bars" flag, but "disable_resolution_rebuild" featureset is enabled');var P,x,T=this.rebuildFrom(l,c);if(!s.isTicks(l)&&(!s.isEqual(l,T)||g)){r()||h('Misconfiguration error: remove "disable_resolution_rebuild" featureset or provide '+l+" data by yourself");var M=c.has_empty_bars;C=Object.assign({},c);c.has_empty_bars&&(C.has_empty_bars=!1);var I=Math.ceil((P=s.parse(l),x=s.parse(T),P.kind()===x.kind()?P.multiplier()/x.multiplier():(P.isMonths()?P.multiplier()*u:P.inMilliseconds())/(x.isMonths()?x.multiplier()*u:x.inMilliseconds())));return m=Object.assign({},m,{countBack:m.countBack*I}),new p(v,y,t,i,T,new a(l,M),C,m,f)}return new d(v,y,{currency:t,unit:i},l,w,this.host,c,m)};var d=function(e,t,i,s,r,n,o,a){this.listeners=e,this.host=n;var l=this;this.host.resolve(t,i,(function(e){r&&e.regular_session&&(e.session=e.regular_session),l.subs=l.host.subscribe(e,s,a,(function(e){l.listeners.fire(e)}),(function(e){l.listeners.onError(e)}))}),(function(e){l.listeners.onError(e)}))};d.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)};var p=function(e,i,s,r,n,o,a,l,c){this.listeners=e,this.isRecalculated=!1,this.symbolInfo=a;var h=this;this.engine=new t({tickerid:i,currencyCode:s,unitId:r,period:n,body:o,sessionId:c,symbolInfo:a,dataRange:l,forceAlignBars:!1,recalc:function(e,t){h._recalc(t)},out:function(e,t){h._out(e,t)},nonseriesOut:function(e,t){h._nonseriesOut(e,t)},setNoMoreData:function(){h.barset&&(h.barset.endOfData=!0)},onErrorCallback:function(e){h.listeners.onError(e)}})};p.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},p.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new l(this.symbolInfo)),e&&(this.barset.firstLoadedTimeMs=e.firstLoadedTimeMs,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},p.prototype._nonseriesOut=function(e,t){var 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)},p.prototype._out=function(e,t){var i=t[0];if(!isNaN(i)){var s={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},r=t[7];this.barset||(this.barset=new l(e.info));var n=t[8];if(n instanceof Array)for(var o=0;o<n.length;o++){var a=t[9],c=n[o],h={time:c,open:a,high:a,low:a,close:a,volume:0,updatetime:c};this.barset.add(h,!0),this.isRecalculated&&this.listeners.fire(this.barset)}this.barset.add(s,r),this.barset.isBarClosed=r,this.isRecalculated&&this.listeners.fire(this.barset)}};var _=function(){this.listeners=[]};return _.prototype.listenersCount=function(){return this.listeners.reduce((function(e,t){return e+(t?1:0)}),0)},_.prototype.addListener=function(e,t){this.listeners.push({dataListener:e,onErrorCallback:t}),this.barset&&e(this.barset),this.errorMsg&&t(this.errorMsg)},
|
||
_.prototype.removeListener=function(e){var t=this.listeners.filter((function(t){return t.dataListener===e}));if(0!==t.length){var i=this.listeners.indexOf(t[0]);delete this.listeners[i]}},_.prototype.onError=function(e){this.errorMsg=e||"unspecified error";for(var t=this.listeners,i=t.length,s=0;s<i;s++){var r=t[s];r&&r.onErrorCallback&&r.onErrorCallback(e)}},_.prototype.fire=function(e,t){t||(this.barset=e);for(var i=this.listeners,s=i.length,r=0;r<s;r++){var n=i[r];n&&n.dataListener(e)}},{setupFeed:function(t){c.instance=new c(t),e.setupFeed(c.instance)},unsubscribeUnused:function(){c.instance.removeUnused()}}}();e.exports=a},"8pII":function(e){
|
||
e.exports=JSON.parse('{"content":{"chartProperties":{"scalesProperties":{"textColor":"#B2B5BE","lineColor":"rgba(240, 243, 250, 0.12)","backgroundColor":"#ffffff"},"paneProperties":{"vertGridProperties":{"color":"rgba(240, 243, 250, 0.06)"},"horzGridProperties":{"color":"rgba(240, 243, 250, 0.06)"},"crossHairProperties":{"color:":"#9598A1"},"background":"#131722","backgroundGradientStartColor":"#181C27","backgroundGradientEndColor":"#131722","backgroundType":"gradient"}},"sessions":{"graphics":{"backgrounds":{"outOfSession":{"color":"#2196F3","transparency":92},"preMarket":{"color":"#FF9800","transparency":92},"postMarket":{"color":"#2196F3","transparency":92}},"vertlines":{"sessBreaks":{"color":"#4985e7","style":2,"width":1}}}},"mainSourceProperties":{"baseLineColor":"#5d606b","candleStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#B5B5B8","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"haStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#B5B5B8","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"barStyle":{"downColor":"#ef5350","upColor":"#26a69a"},"pnfStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#336854","downColorProjection":"#7f323f"},"baselineStyle":{"baselineColor":"rgba( 117, 134, 150, 1)","topFillColor1":"rgba( 38, 166, 154, 0.28)","topFillColor2":"rgba( 38, 166, 154, 0.05)","bottomFillColor1":"rgba( 239, 83, 80, 0.05)","bottomFillColor2":"rgba( 239, 83, 80, 0.28)","topLineColor":"rgba( 38, 166, 154, 1)","bottomLineColor":"rgba( 239, 83, 80, 1)"},"areaStyle":{"transparency":100,"color1":"rgba(33, 150, 243, 0.28)","color2":"#2196f3","linecolor":"#2196f3","linewidth":2,"linestyle":0},"renkoStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#336854","downColorProjection":"#7f323f","borderUpColorProjection":"#336854","borderDownColorProjection":"#7f323f","wickUpColor":"#26a69a","wickDownColor":"#ef5350"},"lineStyle":{"color":"#2196f3","linewidth":2,"linestyle":0},"kagiStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#336854","downColorProjection":"#7f323f"},"pbStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#336854","downColorProjection":"#7f323f","borderUpColorProjection":"#336854","borderDownColorProjection":"#7f323f"},"rangeStyle":{"upColor":"#26a69a","downColor":"#ef5350","upColorProjection":"#336854","downColorProjection":"#7f323f"}}}}')},"8qoI":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyLegendView",(function(){return n}));var s=i("it7y"),r=i("e1Hy");class n extends s.StudyDataWindowView{constructor(e,t){super(e,t),this._showStudyValues=t.properties().paneProperties.legendProperties.showStudyValues,this._showStudyValues.subscribe(this,this.update)}isValuesVisible(){return this._showStudyValues.value()}additional(){
|
||
return null}destroy(){this._showStudyValues.unsubscribeAll(this)}_createValuesProvider(e,t){return new r.a(e,t)}}},"8sOK":function(e,t,i){"use strict";i.r(t);var s=i("2kV1"),r=i("7ktv"),n=i("kcTO"),o=i("aIyQ"),a=i.n(o),l=i("tc+8"),c=i.n(l),h=i("ww0J");class u extends h.a{text(){return`${this._source.title()} ${this._source.status()}`}}i.d(t,"StudyStub",(function(){return p}));class d{getItems(){return[]}getValues(e){return[]}}class p extends r.PriceDataSource{constructor(e,t,i){super(e),this._priceStep=.01,this._status=window.t("compiling..."),this._statusChanged=new a.a,this._formatter=new n.PriceFormatter(100),this._failed=!1,this._loading=!0,this._origState=t,this._title=i;this._properties=new c.a({visible:!0}),this._statusView=new s.StudyStatusView(this)}properties(){return this._properties}statusView(){return this._statusView}legendView(){return null}state(e){return this._origState}setStatus(e){this._status=e,this._statusChanged.fire()}formatter(){return this._formatter}title(){return this._title}titleInParts(){return[this._title]}isFailed(){return this._failed}isLoading(){return this._loading}setFailed(e){this._failed=e,this._failed&&(this._loading=!1),this._model.updateSource(this)}isSymbolInvalid(){return!1}start(){}status(){return this._status}onStatusChanged(){return this._statusChanged}firstValue(){return null}currency(){return null}unit(){return null}symbolSource(){return this._model.mainSeries()}valuesProvider(){return new d}statusProvider(e){return new u(this,this._model.properties().scalesProperties.textColor)}}},"8woN":function(e,t,i){"use strict";var s=i("Kxc7"),r=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],n=function(){var e=[{pattern:"(",ctor:o},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:.&]))|\.\d+/,ctor:g},{pattern:/\./,ctor:S},{pattern:s.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:.&]*|'.+?'/,ctor:f},{pattern:/'[^']*/,ctor:b},{pattern:/[\0-\x20\s]+/,ctor:n}];function t(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function i(){}function n(e){this.value=e}function o(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}i.prototype.toString=function(){return this.value},t(n,i),t(o,i),o.prototype.value="(",t(a,i),a.prototype.value=")",t(l,i),t(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,t(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,t(u,l),
|
||
u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,t(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,t(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1;var _=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,m=/[+\-/*]/;function f(e){this.value=e}function g(e){this.value=e}function v(e){this.value=e}function b(){f.apply(this,arguments)}function S(){g.apply(this,arguments)}t(f,i),f.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=m.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},f.prototype.parse=function(){var e=_.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},f.prototype.parseAsFutures=function(){this.hasOwnProperty("_ticker")||this.parse();for(var e=function(e){return r.some((function(t){return t.t===e}))},t=2;t>=1;--t){var i=this._ticker.slice(0,t);if(e(i)){this._root=i,this._contract=this._ticker.slice(t);break}}},f.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null==e?delete this._exchange:this._exchange=e+""},f.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null==e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},f.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},f.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},t(g,i),g.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},g.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},v.prototype.toString=function(){return this.value},t(b,f),b.prototype.isIncomplete=!0,b.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},t(S,g),S.prototype.isIncomplete=!0;var y=new RegExp(e.map((function(e){return"("+("string"==typeof e.pattern?e.pattern.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&"):e.pattern.source)+")"})).concat(".").join("|"),"g");function w(t,i){var s,r=[];e:for(;s=y.exec(t);){for(var o=e.length;o--;)if(s[o+1]){if(e[o].ctor){var a=new e[o].ctor(s[o+1]);a._offset=s.index,r.push(a)}continue e}var l=new v(s[0]);l._offset=s.index,r.push(l)}if(i&&i.recover){var c;for(o=r.length;o--;){var h=r[o];if(h instanceof g||h instanceof f){if(void 0!==c){var u=new f(""),d=r.splice(o,c-o+1,u);u.value=d.map((function(e){return e.value})).join("")}c=o}else h instanceof n||(c=void 0)}}return r}function C(e){for(var t=[],i=0;i<e.length;i++)e[i]instanceof n||t.push(e[i]);return t}function P(e){e=C(e)
|
||
;for(var t,i=[],s=[],r=0;r<e.length;r++){var n=e[r];if(n instanceof l)s.length&&s[s.length-1].minPrecedence>n.precedence&&(s[s.length-1].minPrecedence=n.precedence);else if(n instanceof o)s.push(t={minPrecedence:1/0,openBraceIndex:r});else if(n instanceof a){var c=e[(t=s.pop()).openBraceIndex-1],h=e[r+1];h instanceof l&&!(h.precedence<=t.minPrecedence)||!(!(c instanceof l)||c.precedence<t.minPrecedence||c.precedence===t.minPrecedence&&c.commutative)||(i.unshift(t.openBraceIndex),i.push(r),s.length&&s[s.length-1].minPrecedence>t.minPrecedence&&(s[s.length-1].minPrecedence=t.minPrecedence))}}for(r=i.length;r--;)e.splice(i[r],1);return e}function x(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return(e=w(e)).filter((function(e){return e instanceof f})).map((function(e){return e.exchange()})).filter((function(e){return e}))}function T(e){return 1!==(e=x(e)).length?null:e[0]}function M(e,t){return(e=x(e)).some((function(e){return t.includes((e||"").toUpperCase())}))}function I(e){return e.join("")}return{tokenize:w,validate:function(e){if(s.enabled("charting_library_base"))return{currentState:"var"};for(var t="init",i={warnings:[],errors:[],isEmpty:!0},r=[],c=0;c<e.length;c++){if(!((u=e[c])instanceof n)){if(delete i.isEmpty,u.isIncomplete){var h={status:"incomplete",reason:"incomplete_token",offset:u._offset,token:u};if(u.incompleteSuggest&&(h.recover={append:u.incompleteSuggest()}),i.warnings.push(h),c!==e.length-1){h.status="error";continue}}if(u instanceof f||u instanceof g){if("var"===t){i.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}t="var"}else if(u instanceof l){if("var"!==t){i.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}t="operator"}else if(u instanceof o){if("var"===t){i.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}r.push(u),t="init"}else if(u instanceof a){if("var"!==t){i.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}r.pop()||i.errors.push({status:"error",reason:"unbalanced_brace",offset:u._offset,token:u,recover:{prepend:new o}}),t="var"}else u instanceof v&&i.errors.push({status:"error",reason:"unparsed_entity",offset:u._offset,token:u})}}for(i.braceBalance=r.length,"var"!==t&&i.warnings.push({status:"incomplete"});r.length;){var u;h={status:"incomplete",reason:"unbalanced_brace",offset:(u=r.pop())._offset,token:u};"var"===t&&(h.recover={append:new a}),i.warnings.push(h)}return i.currentState=t,0===i.warnings.length&&delete i.warnings,0===i.errors.length&&delete i.errors,i},factorOutBraces:P,normalizeTokens:function(e){for(var t=0;t<e.length;t++)e[t].parse&&e[t].parse();return e},flip:function(e){var t=function(e){for(var t,i=0,s=0,r=0;r<e.length;r++){var c=e[r];if(!(c instanceof n))switch(i){case 0:if(!(c instanceof g&&1==+c.value))return!1;i=1;break;case 1:if(!(1===i&&c instanceof d))return!1;i=2,t=r+1;break;case 2:if(c instanceof o)i=3,s=1;else if(c instanceof l)return!1;break;case 3:
|
||
c instanceof o?s++:c instanceof a&&--s<=0&&(i=2)}}return e.slice(t)}(e);return P(t||[new g("1"),new d,new o].concat(e).concat(new a))},hasBatsSymbols:function(e){return M(e,["BATS"])},hasEodSymbols:function(e){return(e=T(e))&&-1!==e.toUpperCase().indexOf("_EOD")},hasChxjpySymbols:function(e){return M(e,["CHXJPY"])},hasFreeDelaySymbols:function(e){return M(e,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map((function(e){return e.exchange.toUpperCase()+"_DLY"})))},getExchange:T,isExchange:function(e,t){return!!(e=T(e))&&e.substr(0,t.length)===t},SymbolToken:f,IncompleteSymbolToken:b,NumberToken:g,BinaryOperatorToken:l,OpenBraceToken:o,CloseBraceToken:a,ticker:function(e){return new f(e).ticker()},shortName:function(e){if("string"!=typeof e)throw new TypeError("expression must be a string");var t=P(C(w(e)));return t.forEach((function(e){e instanceof f&&e.exchange(null)})),I(t)},normalize:function(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return I(P(C(w(e))))}}}();e.exports=n},"96Yh":function(e,t,i){"use strict";i.r(t),i.d(t,"lineToolEntityInfo",(function(){return o})),i.d(t,"studyEntityInfo",(function(){return a})),i.d(t,"seriesEntityInfo",(function(){return l})),i.d(t,"entityForDataSource",(function(){return c}));var s=i("3ClC"),r=i("2jXJ"),n=i("CW80");function o(e){return{id:e.id(),name:(t=e.toolname,Object.keys(r.supportedLineTools).find(e=>r.supportedLineTools[e].name===t)||null)};var t}function a(e){return{id:e.id(),name:e.metaInfo().description}}function l(e){return{id:e.id(),name:"Main Series"}}function c(e,t){return t===e.mainSeries()?l(e.mainSeries()):Object(s.isStudy)(t)?a(t):Object(n.isLineTool)(t)?o(t):null}},"972a":function(e,t,i){"use strict";var s,r,n,o;i.r(t),i.d(t,"MarkLocation",(function(){return s})),i.d(t,"HAlign",(function(){return r})),i.d(t,"VAlign",(function(){return n})),i.d(t,"LineStyle",(function(){return o})),function(e){e.AboveBar="AboveBar",e.BelowBar="BelowBar",e.Top="Top",e.Bottom="Bottom",e.Right="Right",e.Left="Left",e.Absolute="Absolute",e.AbsoluteUp="AbsoluteUp",e.AbsoluteDown="AbsoluteDown"}(s||(s={})),function(e){e.Left="left",e.Center="center",e.Right="right"}(r||(r={})),function(e){e.Top="top",e.Middle="middle",e.Bottom="bottom"}(n||(n={})),function(e){e[e.Solid=0]="Solid",e[e.Dotted=1]="Dotted",e[e.Dashed=2]="Dashed"}(o||(o={}))},"9Jkk":function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("XlJ7"),n=i("x0JF"),o=i("Y7w9"),a=i("Zp/P"),l=i("VdBB"),c=i("cPgM");class h extends c.ScaledPaneRenderer{constructor(){super(...arguments),this._data=null,this._barWidth=null}setData(e){this._data=e,this._barWidth=Math.max(1,Math.round(Object(a.optimalHiLoWidth)(e.barSpacing)))}hitTest(e){if(null===this._data||null===this._barWidth)return null;const t=this._data.bars,i=.5*this._data.barSpacing;if(0===t.length)return null;if(e.x<t[0].time-i)return null;if(e.x>t[t.length-1].time+i)return null;const s=t[Object(o.lowerbound)(t,e.x-i,(e,t)=>e.time<t)];if(e.x<s.time-i||e.x>s.time+i)return null
|
||
;const r=Object(a.interactionTolerance)().series+this._barWidth/2,n=Math.min(s.high,s.low),c=Math.max(s.high,s.low),h=this._data.fontSize;return n-r-h<=e.y&&e.y<=n+r||c-r<=e.y&&e.y<=c+r+h?new l.HitTestResult(l.HitTestResult.REGULAR):null}_drawImpl(e){if(null===this._data||null===this._barWidth)return;e.save(),e.translate(.5,.5),e.textAlign="center",e.fillStyle=this._data.labelColor,e.font=Object(r.makeFont)(this._data.fontSize,this._data.font);const t=this._data.bars,i=this._data.inverted;for(let s=0;s<t.length;++s){const r=t[s],n=Math.min(r.high,r.low),o=Math.max(r.high,r.low);e.fillText(i?r.lowLabel:r.highLabel,r.time,n-this._data.labelsPadding),e.fillText(i?r.highLabel:r.lowLabel,r.time,o+this._data.labelsPadding+this._data.fontSize)}e.restore()}}var u=i("/hKg"),d=i("Zy3/"),p=i("vq8G"),_=i("u+0B"),m=i("zDbI");function f(e){return null!=e}i.d(t,"SeriesHiLoPaneView",(function(){return g}));class g extends n.SeriesBarCandlesPaneView{constructor(e,t){super(e,t),this._widthsCache=new _.a,this._labelsRenderer=new h,this._candlesRenderer=new u.PaneRendererCandles,this._canvas=document.createElement("canvas"),this._context=Object(s.ensureNotNull)(this._canvas.getContext("2d"));const i=e.properties();this._context.font=Object(r.makeFont)(i.hiloStyle.fontSize.value(),m.CHART_FONT_FAMILY)}renderer(e,t,i){if(this._invalidated){const e=this._series().formatter(),t=this._needLabels();this._updateImpl(this._barUpdater.bind(this,e,t)),this._invalidated=!1}const s=this._series().properties().hiloStyle,r=this._model().timeScale().barSpacing(),n=this._needLabels()&&this._bars().every(e=>e.highLabelWidth<=r&&e.lowLabelWidth<=r),o={bars:this._bars(),wickVisible:!1,bodyVisible:s.drawBody.value(),barSpacing:r,borderVisible:s.showBorders.value(),barWidth:Object(a.optimalHiLoWidth)(r),font:m.CHART_FONT_FAMILY,fontSize:s.fontSize.value(),labelColor:s.labelColor.value(),inverted:this._series().priceScale().isInverted(),labelsPadding:3},l=new d.CompositeRenderer;return this._candlesRenderer.setData(o),l.append(this._candlesRenderer),n&&(this._labelsRenderer.setData(o),l.append(this._labelsRenderer)),this._model().selection().isSelected(this._series())&&this._isMarkersEnabled&&l.append(new p.SelectionRenderer(this._selectionData)),l}topPixelMargin(){return this._margin()}bottomPixelMargin(){return this._margin()}_margin(){const e=this._series().properties().hiloStyle;return e.showLabels.value()?e.fontSize.value()+6:0}_barUpdater(e,t,i,s){const r=i[2],n=i[3];return!(!f(r)||!f(n))&&(s.high=s.open=r,s.low=s.close=n,t&&(s.highLabel=e.format(r),s.highLabelWidth=this._getLabelWidth(s.highLabel),s.lowLabel=e.format(n),s.lowLabelWidth=this._getLabelWidth(s.lowLabel)),!0)}_needLabels(){const e=this._model().timeScale().barSpacing();return this._series().properties().hiloStyle.showLabels.value()&&e>5}_getLabelWidth(e){return this._widthsCache.measureText(this._context,e)}}},"9QkW":function(e,t,i){"use strict";var s=i("7ADh").LineToolFibWedgeBase,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{
|
||
constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"1SUO",7)).then(({FibWedgePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}isSynchronizable(){return!1}levelsCount(){return l.LevelsCount}name(){return"Fib Wedge"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}static createProperties(e){var t=new r("linetoolfibwedge",e,!1,{range:[1,11]});return l._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"6mGk"))).FibWedgeDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,t.LineToolFibWedge=l},"9dnG":function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="M13.39 3.84a1 1 0 0 1 1.22 0l8.19 6.37a1 1 0 0 1 0 1.58l-8.19 6.37a1 1 0 0 1-1.22 0L5.2 11.79a1 1 0 0 1 0-1.58l8.19-6.37zm.61.8L5.81 11 14 17.37 22.19 11 14 4.63zM5.3 13.6l8.7 6.76 8.7-6.76.6.78-8.69 6.77a1 1 0 0 1-1.22 0l-8.7-6.77.62-.78zm8.09 10.55l-8.7-6.77.62-.78L14 23.37l8.7-6.76.6.78-8.69 6.77a1 1 0 0 1-1.22 0z"/></svg>'},"9iCb":function(e,t,i){"use strict";i.r(t),i.d(t,"applyOverridesToStudy",(function(){return h})),i.d(t,"applyOverridesToStudyDefaults",(function(){return u}));var s=i("Eyy1"),r=i("23IT"),n=i("txPx");const o=Object(n.getLogger)("Chart.Model.StudyPropertiesOverrider");var a,l;function c(e,t,i,s){const r=i.split(".");if(0===r.length||0===r[0].length)return;const n=function(e){const t=e.split(":");return{name:t[0],type:2===t.length?t[1]:null}}(r[0]),c=n.name,h=n.type,u=null!==h,d=!u||"band"===h,p=!u||"area"===h,_=!u||"input"===h,m=!u||"plot"===h?l.getPlotIdByTitle(e,c):null,f=d?l.getBandIndexByName(e,c):null,g=p?l.getFilledAreaIdByTitle(e,c):null,v=_?l.getInputByName(e,c):null,b=t.hasOwnProperty(c);if((null!==m?1:0)+(null!==f?1:0)+(null!==g?1:0)+(null!==v?1:0)+(b?1:0)>1)return void o.logWarn(`Study '${e.description}' has ambiguous identifier '${c}'`);const S=r[1];if(null!==m){if(1===r.length)return void o.logWarn(`Path of sub-property of '${c}' plot for study '${e.description}' must be not empty`);const i=r.slice(1);a.applyPlotProperty(e,t,m,i,s)}else if(null!==v)a.applyInputValue(t,v,s);else if(null!==f){if(void 0===S)return void o.logWarn(`Property name of '${c}' band for study '${e.description}' must be set`);a.applyBandProperty(t,f,S,s)}else if(null!==g){if(void 0===S)return void o.logWarn(`Property name of '${c}' area for study '${e.description}' must be set`);a.applyFilledAreaProperty(t,g,S,s)}else b?a.setRootProperty(t,r,s):o.logWarn(`Study '${e.description}' has no plot or input '${c}'`)}function h(e,t){
|
||
const i=e.properties(),s=i.state();for(const r in t)t.hasOwnProperty(r)&&c(e.metaInfo(),s,r,t[r]);i.mergeAndFire(s)}function u(e,t,i){for(const s in e){if(!e.hasOwnProperty(s))continue;const r=s.indexOf(".");if(-1===r)continue;const n=s.substr(0,r),a=l.getMetaInfoByDescription(t,n);if(null===a){o.logWarn("There is no such study "+n);continue}const h=i(a);null!==h?c(a,h,s.substr(r+1),e[s]):o.logWarn("Cannot apply overrides for study "+n)}}!function(e){const t={line:r.LineStudyPlotStyle.Line,histogram:r.LineStudyPlotStyle.Histogram,cross:r.LineStudyPlotStyle.Cross,area:r.LineStudyPlotStyle.Area,columns:r.LineStudyPlotStyle.Columns,circles:r.LineStudyPlotStyle.Circles,line_with_breaks:r.LineStudyPlotStyle.LineWithBreaks,area_with_breaks:r.LineStudyPlotStyle.AreaWithBreaks};e.applyPlotProperty=function(e,i,n,a,l){if(void 0===i.styles)return void o.logWarn("Study does not have styles");const c=a[0];if("color"===c){return void function(e,t,i,r,n){if(void 0!==e.styles)if(null===t&&!isNaN(r)&&r>0)o.logWarn("Study plot does not have color #"+r);else{if(0===r||isNaN(r)){Object(s.ensureDefined)(e.styles[i]).color=String(n),r=0}null!==t&&(Object(s.ensureDefined)(t.colors[r]).color=String(n))}else o.logWarn("Study does not have styles")}(i,function(e,t,i){if(void 0===e.plots)return null;for(const s of e.plots){if(!Object(r.isColorerPlot)(s)||void 0===t.palettes)continue;const e=t.palettes[s.palette];if(s.target===i&&void 0!==e)return e}return null}(e,i,n),n,a.length>1?parseInt(a[1]):NaN,l)}const h=i.styles[n];if(void 0!==h&&h.hasOwnProperty(c)){if("plottype"===c){const e=t[String(l)];if(void 0===e)return void o.logWarn("Unsupported plot type for plot: "+l);l=e}h[c]=l}else o.logWarn(`Study plot does not have property '${c}'`)},e.applyBandProperty=function(e,i,s,r){if(void 0===e.bands)return void o.logWarn("Study does not have bands");const n=e.bands[i];if(void 0!==n&&n.hasOwnProperty(s)){if("plottype"===s){const e=t[String(r)];if(void 0===e)return void o.logWarn("Unsupported plot type for band: "+r);r=e}n[s]=r}else o.logWarn(`Study band does not have property '${s}'`)},e.applyFilledAreaProperty=function(e,t,i,s){if(void 0===e.filledAreasStyle)return void o.logWarn("Study does not have areas");const r=e.filledAreasStyle[t];void 0!==r&&r.hasOwnProperty(i)?r[i]=s:o.logWarn(`Study area does not have property '${i}'`)},e.applyInputValue=function(e,t,i){void 0!==e.inputs&&e.inputs.hasOwnProperty(t)?e.inputs[t]=i:o.logWarn(`Study does not have input '${t}'`)},e.setRootProperty=function(e,t,i){if(0===t.length)return;let s=e;for(const n of t.slice(0,-1)){if(null==s||!s.hasOwnProperty(n))break;s=s[n]}const r=t[t.length-1];null!=s&&s.hasOwnProperty(r)?s[r]=i:o.logWarn("Study does not have property "+t.join("."))}}(a||(a={})),function(e){e.getInputByName=function(e,t){if(void 0===e.inputs)return null;t=t.toLowerCase();for(const i of e.inputs)if(i.name.toLowerCase()===t)return i.id;return null},e.getPlotIdByTitle=function(e,t){if(void 0===e.styles)return null;t=t.toLowerCase();for(const i in e.styles){const s=e.styles[i]
|
||
;if((void 0!==s&&void 0!==s.title?s.title:i).toLowerCase()===t)return i}return null},e.getFilledAreaIdByTitle=function(e,t){if(void 0===e.filledAreas)return null;t=t.toLowerCase();for(const i of e.filledAreas)if(i.title.toLowerCase()===t)return i.id;return null},e.getBandIndexByName=function(e,t){if(void 0===e.bands)return null;t=t.toLowerCase();for(let i=0;i<e.bands.length;++i)if(e.bands[i].name.toLowerCase()===t)return i;return null},e.getMetaInfoByDescription=function(e,t){t=t.toLowerCase();for(const i of e)if(i.description.toLowerCase()===t||i.shortDescription.toLowerCase()===t)return i;return null}}(l||(l={}))},"9nLJ":function(e,t,i){"use strict";(function(t,s){var r=i("PT1i").linking,n=i("Q19o"),o=i("VNzU").layouts,a=i("FQhm"),l=i("5VQP").ContextMenuManager,c=i("mMWL"),h=i("pPtI"),u=i("zUrt").backend,d=i("txPx"),p=i("brCa").createNoticeDialog,_=i("oNDq").createConfirmDialog,m=i("2jXJ"),f=i("sJA2").ThemesApi,g=i("pZll").symbolSearchUIService,v=i("ZjKI").CLOSE_POPUPS_AND_DIALOGS_COMMAND,b=i("LxhU").Interval,S=i("Ocx9").saveDefaultProperties,y=i("htUT").ChartChangesWatcher,w=i("xt3Q").TradingViewApiBase;e.exports=class extends w{constructor(e){const{chartWidgetCollection:i,chartApiInstance:s=null,saveChartService:r,loadChartService:n,alertsDispatcher:o,supportTicketData:a,favoriteServices:l,studyMarket:c=null,financialsDialog:h=null}=e;super({chartApiInstance:s,chartWidgetCollection:i,studyMarket:c,financialsDialog:h,saveChartService:r,loadChartService:n}),this._chartApiInstance=s,this._loadChartService=n,this._alertsDispatcher=o,this._supportTicketData=a,this._favoriteServices=l,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._hideIndicatorsWatchedValue=null,this._magnetEnabledWatchedValue=null,this._magnetModeWatchedValue=null,this._replayApi=null,this._chartChangesWatcher=null,this._hasChartChangesWatchedValue=null,this._getDataSourceHub=function(){return i.activeChartWidget.value().model().model()},this._chartWidgetCollection.getResizerDetacher=function(){return i.activeChartWidget.value().getResizerDetacher()},this._alertService=this._alertsDispatcher?new(void 0)(this._alertsDispatcher,this._getDataSourceHub):null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap,this._activateChart=function(e){i.activeChartWidget.setValue(e)}}subscribe(e,t){a.subscribe(e,t)}unsubscribe(e,t){a.unsubscribe(e,t)}onContextMenu(e){a.subscribe("onContextMenu",(function(t){t.callback(e(t.unixtime,t.price))}))}onGrayedObjectClicked(e){a.subscribe("onGrayedObjectClicked",e)}activeChart(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())}_getChartWidgetApi(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new n(e,this._activateChart.bind(null,e)),this._chartWidgets.set(e,t)),t}onActiveChartChanged(){return this._activeChangedChangedDelegate}changeSymbol(e,t,i){
|
||
r.interval.setValue(b.normalize(t)),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)}setLayout(e){this._chartWidgetCollection.layout.setValue(e)}layout(){return this._chartWidgetCollection.layout.value()}layoutName(){return this._chartWidgetCollection.metaInfo.name.value()}layoutNameWatchedValue(){return this._chartWidgetCollection.metaInfo.name.readonly()}layoutSettingsDrawer(){throw new Error("not implemented")}chartsCount(){return o[this.layout()].count}viewMode(){throw new Error("not implemented")}viewModeWatchedValue(){throw new Error("not implemented")}setForceFullscreenMode(){throw new Error("not implemented")}setMultichartMode(){throw new Error("not implemented")}setActiveChart(e){throw new Error("not implemented")}chart(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])}getSymbolInterval(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t}saveChart(e){var t=this;this._saveChartService.whenReadyToSave((function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))}))}loadChart(e){this._chartApiInstance.disconnect(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),this._chartApiInstance.connect(),r.symbol.setValue(this.activeChart().symbol()),a.emit("chart_loaded")}getStudiesList(){return this._chartApiInstance.allStudiesMetadata().filter((function(e){return!e.is_hidden_study})).map((function(e){return e.description}))}getSavedCharts(e){u.getCharts(e)}loadChartFromServer(e){u.loadChart(e)}saveChartToServer(e,t,i){this._saveChartService.saveChartSilently(e,t,i)}removeChartFromServer(e,t){u.removeChart(e,t)}getIntervals(){var e=[],t=h.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),h.mergeResolutions(e,t)}closePopupsAndDialogs(){for(var e=document.querySelectorAll("._tv-dialog-title-close"),t=0;t<e.length;t++)e[t].click();var s=i.c.KHon;s&&s.exports.closeAllDialogs(),l.hideAll(),a.emit(v)}selectLineTool(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,c.tool.value()!==e&&c.tool.setValue(e))}selectedLineTool(){for(var e=Object.keys(m.supportedLineTools),t=c.tool.value(),i=0;i<e.length;++i)if(m.supportedLineTools[e[i]].name===t)return e[i];return""}lockAllDrawingTools(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new s(c.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe((function(e){c.lockDrawings().setValue(e)})),c.lockDrawings().subscribe(this,(function(){this._lockDrawingsWatchedValue.setValue(c.lockDrawings().value())}))),this._lockDrawingsWatchedValue}hideAllDrawingTools(){
|
||
return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new s(c.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe((function(e){c.hideAllDrawings().setValue(e)})),c.hideAllDrawings().subscribe(this,(function(){this._hideDrawingsWatchedValue.setValue(c.hideAllDrawings().value())}))),this._hideDrawingsWatchedValue}hideAllIndicators(){return null===this._hideIndicatorsWatchedValue&&(this._hideIndicatorsWatchedValue=new s(c.hideAllIndicators().value()),this._hideIndicatorsWatchedValue.subscribe((function(e){c.hideAllIndicators().setValue(e)})),c.hideAllIndicators().subscribe(this,(function(){this._hideIndicatorsWatchedValue.setValue(c.hideAllIndicators().value())}))),this._hideIndicatorsWatchedValue}magnetEnabled(){return null===this._magnetEnabledWatchedValue&&(this._magnetEnabledWatchedValue=new s(c.properties().magnet.value()),this._magnetEnabledWatchedValue.subscribe((function(e){S(!0),c.properties().magnet.setValue(e),S(!1)})),c.properties().magnet.subscribe(this,(function(){this._magnetEnabledWatchedValue.setValue(c.properties().magnet.value())}))),this._magnetEnabledWatchedValue}magnetMode(){return null===this._magnetModeWatchedValue&&(this._magnetModeWatchedValue=new s(c.properties().magnetMode.value()),this._magnetModeWatchedValue.subscribe((function(e){S(!0),c.properties().magnetMode.setValue(e),S(!1)})),c.properties().magnetMode.subscribe(this,(function(){this._magnetModeWatchedValue.setValue(c.properties().magnetMode.value())}))),this._magnetModeWatchedValue}mainSeriesPriceFormatter(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()}showNoticeDialog(e){var t=(e=e||{}).callback;function i(){t&&(t(),t=null)}p({title:e.title,content:e.body||""}).then((function(e){e.on("action:ok",i),e.on("afterClose",i),e.open()}))}showConfirmDialog(e){if(!(e=e||{}).callback)throw Error("callback must be exist");var t=e.callback;function i(e){t&&(t(e),t=null)}_({title:e.title,content:e.body||""}).then((function(e){e.on("action:yes",(function(){e.close(),i(!0)})),e.on("action:no",i.bind(null,!1)),e.on("afterClose",i.bind(null,!1)),e.open()}))}logs(){return{getLogHistory:d.getLogHistory,enable:d.loggingOn,disable:d.loggingOff}}watchlist(){throw new Error("not implemented")}setWatchlistApi(e){throw new Error("not implemented")}showLoadChartDialog(){var e=this._loadChartService;e&&e.showLoadDialog()}showSaveAsChartDialog(){var e=this._saveChartService;e&&window.runOrSignIn((function(){e.saveChartAs()}),{source:"Save as chart dialogue"})}drawOnAllCharts(e){return c.drawOnAllCharts().setValue(e)}themes(){return new f({chartWidgetCollection:this._chartWidgetCollection})}undoRedoState(){return this._chartWidgetCollection.undoHistory.state()}clearUndoHistory(){return this._chartWidgetCollection.undoHistory.clearStack()}undo(){return this._chartWidgetCollection.undoHistory.undo()}redo(){return this._chartWidgetCollection.undoHistory.redo()}trading(){throw new Error("Not implemented")}waitTrading(){throw new Error("Not implemented")}
|
||
symbolSearch(){throw new Error("Not implemented")}saveChartOrShowTitleDialog(e,t,i){throw new Error("Not implemented")}showRenameChartDialog(){throw new Error("Not implemented")}setUserInfo(e){throw new Error("Not implemented")}connect(){throw new Error("Not implemented")}disconnect(){throw new Error("Not implemented")}loginRequired(){throw new Error("Not implemented")}onConnectionStatusChanged(e){throw new Error("Not implemented")}isConnected(){throw new Error("Not implemented")}showCreateAlertDialog(){throw new Error("Not implemented")}alertService(){throw new Error("Not implemented")}publishChart(e){throw new Error("Not implemented")}setPublishChartOptions(e){throw new Error("Not implemented")}showSupportDialog(){throw new Error("Not implemented")}openMobileChartPicker(){throw new Error("Not implemented")}closeMobileChartPicker(){throw new Error("Not implemented")}replayApi(){throw new Error("Not implemented")}takeScreenshot(){return this._chartWidgetCollection.takeScreenshot()}setSymbolSearchUI(e){g().setSymbolGetter(e)}setIntervalLinkingEnabled(e){this._chartWidgetCollection.lock.interval.setValue(e)}setTimeFrame(e){this._chartWidgetCollection.setTimeFrame(e)}symbolSync(){return this._chartWidgetCollection.lock.symbol}intervalSync(){return this._chartWidgetCollection.lock.interval}crosshairSync(){return this._chartWidgetCollection.lock.crosshair}timeSync(){return this._chartWidgetCollection.lock.trackTime}startFullscreen(){return this._chartWidgetCollection.startFullscreen()}exitFullscreen(){return this._chartWidgetCollection.exitFullscreen()}takeClientScreenshot(e){return this._chartWidgetCollection.clientSnapshot(e)}getFavoriteIntervalsService(){throw new Error("not implemented")}getFavoriteChartStylesService(){throw new Error("not implemented")}getLinetoolsFavoritesStore(){throw new Error("not implemented")}supportTicketData(){return this._supportTicketData}hasChartChanges(){return null===this._chartChangesWatcher&&null===this._hasChartChangesWatchedValue&&(this._chartChangesWatcher=new y(this._chartWidgetCollection.undoHistory,window.saver,a),this._hasChartChangesWatchedValue=new s(this._chartChangesWatcher.hasChanges()),this._chartChangesWatcher.getOnChange().subscribe(this,(function(){this._hasChartChangesWatchedValue.setValue(this._chartChangesWatcher.hasChanges())}))),this._hasChartChangesWatchedValue}}}).call(this,i("aIyQ"),i("hY0g"))},"9uLv":function(e,t,i){"use strict";i.r(t);var s=i("K9GE");i.d(t,"dur",(function(){return s.c})),i.d(t,"easingFunc",(function(){return s.d})),i.d(t,"CubicBezier",(function(){return s.a})),i.d(t,"color",(function(){return s.b}))},"9zVu":function(e,t,i){"use strict";i.r(t),i.d(t,"DrawingToolbarBootloader",(function(){return a}));var s=i("OiSa"),r=i("7RN7"),n=i("cZRT"),o=i("YuHv");class a extends n.a{constructor(e){super(),this._opts=e,s.isDrawingToolbarVisible.value()&&(this._opts.resizerBridge.negotiateWidth(r.b),this._opts.resizerBridge.container.value().appendChild(Object(o.a)()))}_startLoading(){
|
||
return Promise.all([i.e("react"),i.e(1),i.e(2),i.e(7),i.e(11),i.e(16),i.e(23),i.e(35),i.e(69),i.e(73),i.e(81),i.e(0),i.e(4),i.e(10),i.e(14),i.e("line-tools-icons"),i.e(52),i.e(57),i.e("drawing-toolbar")]).then(i.bind(null,"5f7t")).then(e=>new e.DrawingToolbarRenderer(this._opts.resizerBridge.container.value(),Object.assign({},this._opts)))}}},AE9l:function(e,t,i){},"AWC/":function(e,t,i){e.exports={container:"container-e6Js9pSl",inner:"inner-e6Js9pSl","border-left":"border-left-e6Js9pSl","border-right":"border-right-e6Js9pSl","border-top":"border-top-e6Js9pSl","border-bottom":"border-bottom-e6Js9pSl","top-right-radius":"top-right-radius-e6Js9pSl","top-left-radius":"top-left-radius-e6Js9pSl","bottom-right-radius":"bottom-right-radius-e6Js9pSl","bottom-left-radius":"bottom-left-radius-e6Js9pSl"}},AXy7:function(e,t,i){"use strict";var s=i("Eyy1").assert,r=i("aO4+").Point,n=i("Hr11").clamp,o=i("l4sv").HorizontalLineRenderer,a=i("0YCj"),l=i("Tmoa"),c=i("cPgM").ScaledPaneRenderer;class h extends c{constructor(){super(),this._data=null}setData(e){this._data=e}_drawImpl(e){if(null!==this._data&&0!==this._data.points.length){var t=e.canvas.width;e.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency);var i=Math.min(this._data.points[0],this._data.points[1]),s=Math.max(this._data.points[0],this._data.points[1]);e.fillRect(0,i,t,s-i)}}hitTest(e){return null}}t.BandPaneView=class{constructor(e,t){this._source=t,this._properties=e,this._points=[new r(-1,-1)],this._invalidated=!0,this._lineRenderer=new o}update(){this._invalidated=!0}updateImpl(){var e=this._source.priceScale();if(e&&!e.isEmpty()){var t=this._properties.value.value();if(isNumber(t)){var i=this._source.firstValue();this._points[0]=new r(-1,e.priceToCoordinate(t,i))}else this._points[0]=new r(-1,NaN)}else this._points[0]=new r(-1,-1)}renderer(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var e={};return e.width=this._source.model().timeScale().width(),e.height=this._source.priceScale().height(),e.y=this._points[0].y,e.color=this._properties.color.value(),e.linewidth=this._properties.linewidth.value(),e.linestyle=this._properties.linestyle.value(),this._lineRenderer.setData(e),this._lineRenderer}},t.BandBackgroundPaneView=class{constructor(e){this._source=e,this._points=[],this._bandBgRenderer=new h}update(){if(this._points=[],this._source.properties().bandsBackground.fillBackground.value()){var e=this._source.properties().bands[0],t=this._source.properties().bands[1],i=this._source.priceScale();if(i&&!i.isEmpty()){var s=this._source.firstValue();this._points.push(i.priceToCoordinate(e.value.value(),s)),this._points.push(i.priceToCoordinate(t.value.value(),s))}}}renderer(){var e={};return e.points=this._points,e.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),e.transparency=this._source.properties().bandsBackground.transparency.value(),this._bandBgRenderer.setData(e),this._bandBgRenderer}},t.HlineFillPaneView=class{constructor(e,t,i){this._source=e,this._points=[],
|
||
s(t.type===a.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+t.type),this._initBandIndexes(t.objAId,t.objBId),this._fillStyleProps=i,this._bandBgRenderer=new h}_initBandIndexes(e,t){this._bandAKey=null,this._bandBKey=null;for(var i=0;i<this._source.metaInfo().bands.length;++i){var s=this._source.metaInfo().bands[i];null===this._bandAKey&&s.id===e&&(this._bandAKey=i),null===this._bandBKey&&s.id===t&&(this._bandBKey=i)}}update(){if(this._points=[],this._fillStyleProps.visible.value()){var e=this._source.properties().bands[this._bandAKey],t=this._source.properties().bands[this._bandBKey],i=this._source.priceScale();if(i&&!i.isEmpty()){var s=this._source.firstValue();this._points.push(i.priceToCoordinate(e.value.value(),s)),this._points.push(i.priceToCoordinate(t.value.value(),s))}}}renderer(){var e=this._fillStyleProps.transparency.value();e=n(e,0,100);var t={};return t.points=this._points,t.backcolor=l.generateColor(this._fillStyleProps.color.value(),e),t.transparency=this._fillStyleProps.transparency.value(),this._bandBgRenderer.setData(t),this._bandBgRenderer}}},"Aba+":function(e,t,i){},ApcL:function(e,t,i){"use strict";i.r(t);var s=i("ogJP"),r=i("vTIA");var n=i("txPx"),o=i("oXaB"),a=i("wZIs"),l=i("KUek"),c=i("FIi8"),h=i("4vW/");i.d(t,"gridPreferencesDefault",(function(){return d})),i.d(t,"crossHairPreferencesDefault",(function(){return p})),i.d(t,"legendPreferencesDefault",(function(){return _})),i.d(t,"priceScalePreferencesDefault",(function(){return m})),i.d(t,"panePreferencesDefault",(function(){return f})),i.d(t,"scalesPreferencesBaseDefault",(function(){return g})),i.d(t,"scalesPreferencesToApplyDefault",(function(){return v})),i.d(t,"chartEventsSourceBreaksPreferencesDefault",(function(){return b})),i.d(t,"chartEventsSourcePreferencesDefault",(function(){return S})),i.d(t,"timeScalePreferencesDefault",(function(){return y})),i.d(t,"statusViewPreferencesDefault",(function(){return w})),i.d(t,"highLowAvgPreferencesDefault",(function(){return C})),i.d(t,"mainSeriesPreferencesDefault",(function(){return P})),i.d(t,"chartPreferencesBaseDefault",(function(){return x})),i.d(t,"chartPreferencesToApplyDefault",(function(){return T})),i.d(t,"chartPreferencesToRestoreDefault",(function(){return M})),i.d(t,"createPreferencesObject",(function(){return I})),i.d(t,"preferencesByWhiteList",(function(){return L})),i.d(t,"defaultsPreferencesByWhiteList",(function(){return O}));const u=Object(n.getLogger)("Chart.ApplyPreferencesToAllCharts"),d={color:"",style:0},p={color:"",style:0,transparency:0,width:0},_={showStudyArguments:!1,showStudyTitles:!1,showStudyValues:!1,showSeriesTitle:!1,showSeriesOHLC:!1,showLegend:!1,showBarChange:!0,showBackground:!0,backgroundTransparency:0,wrapText:!1},m={autoScale:!1,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!1,isInverted:!1,indexedTo100:!1},f={backgroundType:h.ColorType.Solid,background:"",backgroundGradientStartColor:"",backgroundGradientEndColor:"",topMargin:0,bottomMargin:0,rightOffset:0,
|
||
horzGridProperties:Object(c.deepExtend)({},d),vertGridProperties:Object(c.deepExtend)({},d),crossHairProperties:Object(c.deepExtend)({},p),legendProperties:Object(c.deepExtend)({},_),axisProperties:Object(c.deepExtend)({},m)},g={lineColor:"",textColor:"",fontSize:0,scaleSeriesOnly:!1,showSeriesLastValue:!1,seriesLastValueMode:o.PriceAxisLastValueMode.LastValueAccordingToScale,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1,showBidAskLabels:!1,showPrePostMarketPriceLabel:!0,showFundamentalLastValue:!1,showFundamentalNameLabel:!1,showCurrency:!0,showUnit:!0},v=Object.assign({},g),b={color:"",visible:!1,style:0,width:0},S={visible:!1,futureOnly:!1,breaks:Object(c.deepExtend)({},b)},y={defaultRightOffset:0},w={fontSize:16,showExchange:!0,showInterval:!0,symbolTextSource:"description"},C={highLowPriceLinesVisible:!1,highLowPriceLabelsVisible:!1,averageClosePriceLineVisible:!1,averageClosePriceLabelVisible:!1},P={style:0,minTick:0,showPriceLine:!1,priceLineWidth:0,priceLineColor:"",showPrevClosePriceLine:!1,showCountdown:!0,prevClosePriceLineWidth:0,extendedHours:!1,prevClosePriceLineColor:"",esdShowDividends:!1,esdShowSplits:!1,esdShowEarnings:!1,esdShowBreaks:!1,dividendsAdjustment:!1,statusViewStyle:Object(c.deepExtend)({},w),priceAxisProperties:Object(c.deepExtend)({},m),esdBreaksStyle:Object(c.deepExtend)({},{color:"",style:0,width:0}),highLowAvgPrice:Object(c.deepExtend)({},C),candleStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:"",barColorsOnPrevClose:!1}),hollowCandleStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:""}),barStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0}),lineStyle:Object(c.deepExtend)({},{color:"",linestyle:0,linewidth:0,styleType:0}),areaStyle:Object(c.deepExtend)({},{color1:"",color2:"",linecolor:"",linestyle:0,linewidth:0,transparency:0}),baselineStyle:Object(c.deepExtend)({},{topFillColor1:"",topFillColor2:"",bottomFillColor1:"",bottomFillColor2:"",topLineColor:"",bottomLineColor:"",topLineWidth:0,bottomLineWidth:0,transparency:0,baseLevelPercentage:0}),hiloStyle:Object(c.deepExtend)({},{color:"",showBorders:!1,borderColor:"",showLabels:!1,labelColor:"",fontSize:0,drawBody:!0}),haStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:"",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{}}),renkoStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",borderUpColor:"",borderDownColor:"",upColorProjection:"",downColorProjection:"",borderUpColorProjection:"",borderDownColorProjection:"",wickUpColor:"",wickDownColor:"",inputs:{boxSize:0,style:"",atrLength:0,wicks:!1,sources:"",source:""}}),
|
||
pbStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",borderUpColor:"",borderDownColor:"",upColorProjection:"",downColorProjection:"",borderUpColorProjection:"",borderDownColorProjection:"",inputs:{source:"",lb:0}}),kagiStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",inputs:{style:"",atrLength:0,reversalAmount:0}}),pnfStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",inputs:{reversalAmount:0,boxSize:0,style:"",atrLength:0}}),rangeStyle:Object(c.deepExtend)({},{upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",thinBars:!1,inputs:{range:0,phantomBars:!1}})},x={priceScaleSelectionStrategyName:"auto",timeScale:Object(c.deepExtend)({},y),mainSeries:Object(c.deepExtend)({},P),sessions:Object(c.deepExtend)({},l.sessionsPreferencesDefault),paneProperties:Object(c.deepExtend)({},f),chartEventsSourceProperties:Object(c.deepExtend)({},S),tradingProperties:Object(c.deepExtend)({},r.b)},T=Object.assign({timezone:"",scalesProperties:Object(c.deepExtend)({},v)},x),M=Object.assign({scalesProperties:Object(c.deepExtend)({},g)},x);function I(e,t,i,r,n=!0){if(void 0===t[e])return u.logDebug(`We haven't had this property ${r}.${e} yet, please, remove it from whiteList`),null;if(Object(s.isObject)(i[e])){const s=Object.keys(i[e]);let o="";return s.map(s=>({[s]:I(s,t[e],i[e],`${r}.${e}`,n)})).reduce((e,t)=>(o=Object.keys(t)[0],e[o]=t[o],e),{})}return n?t[e].value():t[e]}function L(e,t,i=T){const s={timezone:"",priceScaleSelectionStrategyName:"auto",timeScale:{defaultRightOffset:e.timeScale().defaultRightOffsetProperty().value()},mainSeries:{},sessions:{},paneProperties:{},scalesProperties:{},chartEventsSourceProperties:{},tradingProperties:{}},r=["timeScale","mainSeries","sessions"],n=i.mainSeries,o=Object.keys(i),a=Object.keys(n),l=t.properties(),c=e.properties(),h=i.sessions,u=Object.keys(h),d=e.sessions().properties();return a.forEach(e=>{s.mainSeries[e]=I(e,l,n,"mainSeries")}),u.forEach(e=>{s.sessions[e]=I(e,d,h,"sessions")}),o.forEach(e=>{r.includes(e)||(s[e]=I(e,c,i,"preferences"))}),s}function O(e,t,i=M){const s={timeScale:{defaultRightOffset:e.timeScale().rightOffsetDefaultValue()},mainSeries:{},sessions:Object(c.deepExtend)({},l.sessionsPreferencesDefault),paneProperties:{},scalesProperties:{},chartEventsSourceProperties:{},tradingProperties:{},priceScaleSelectionStrategyName:"auto"},r=["timeScale","mainSeries","sessions"],n=i.mainSeries,o=Object.keys(i),h=Object.keys(n),u=Object(a.factoryDefaults)("chartproperties.mainSeriesProperties"),d=Object(a.factoryDefaults)("chartproperties");return h.forEach(e=>{s.mainSeries[e]=I(e,u,n,"mainSeries",!1)}),o.forEach(e=>{r.includes(e)||(s[e]=I(e,d,i,"preferences",!1))}),s}},Az04:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("GEp6").distanceToLine,n=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty,a=i("j3hX").LineToolColorsProperty;class l extends n{constructor(e,t){super(e,t||l.createProperties()),
|
||
i.e("lt-pane-views").then(i.t.bind(null,"lZ9F",7)).then(({RotatedRectanglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){var i=this._getPaneViews()[0],s=i._points[0],n=i._points[1],o=i._points[2];this._distance=r(s,n,o).distance}}setPoint(e,t,i){if(super.setPoint(e,t,i),0===e||1===e){var r=this._getPaneViews()[0];r.update();var n=r._points[0],o=r._points[1].subtract(n),a=new s(o.y,-o.x).normalized().scaled(this._distance),l=n.add(a),c=this.screenPointToPoint(l);this._points[2]=c}}endChanging(e,t){delete this._distance,super.endChanging(e,t)}pointsCount(){return 3}name(){return"Rotated Rectangle"}hasEditableCoordinates(){return!1}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Zd1D"))).GeneralFiguresDefinitionsViewModel}static createProperties(e){var t=new o("linetoolrotatedrectangle",e);return l._configureProperties(t),t}static _configureProperties(e){n._configureProperties(e),e.addChild("linesColors",new a([e.color]))}}t.LineToolRotatedRectangle=l},B0lp:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("eJTA"),n=i("Hr11"),o=i("Tmoa"),a=i("Zy3/"),l=i("i6cO"),c=i("aO4+"),h=i("VdBB");class u extends c.Point{constructor(e,t,i,s){super(e,t),this.height=i,this.isUp=s,this.style={}}}function d(e){return Math.round(e/4)}function p(e){return Math.round(e/2)}class _{constructor(e){this._data=e}draw(e,t){var i;const s=t.pixelRatio,r=this._data,o=p(r.barSpacing),a=d(r.barSpacing),l=o<4,c=Math.max(o/2,1),h=Object(n.ceiledEven)(o*s),u=h/2,_=Math.round(o*s);e.lineCap="butt",e.lineWidth=Math.max(1,Math.floor(s));const m=e.lineWidth%2?.5:0;for(const n of r.items){const t=n.isUp?-1:1,o=Math.round(Math.abs(n.height)*s),d=Math.round(n.x*s)+m,p=Math.round((n.y-t*a)*s)+m;e.beginPath(),e.translate(d,p);const f=null!==(i=n.style&&n.style.color)&&void 0!==i?i:n.isUp?r.colorup:r.colordown;l?(e.moveTo(0,0),e.lineTo(-u,-u*t),e.moveTo(0,0),e.lineTo(u,-u*t),e.moveTo(0,0),e.lineTo(0,-o*t),e.moveTo(-u,-o*t),e.lineTo(u,-o*t),e.lineWidth=c,e.strokeStyle=f,e.stroke()):(e.moveTo(0,0),o<_?(e.lineTo(h,-o*t),e.lineTo(-h,-o*t)):(e.lineTo(h,-_*t),e.lineTo(u,-_*t),e.lineTo(u,-o*t),e.lineTo(-u,-o*t),e.lineTo(-u,-_*t),e.lineTo(-h,-_*t)),e.lineTo(0,0),e.strokeStyle=n.isUp?r.colorBorderUp:r.colorBorderDown,e.stroke(),e.fillStyle=f,e.fill()),e.translate(-d,-p)}}hitTest(e){const t=this._data,i=p(t.barSpacing),s=Math.round(i/2),r=Math.round(i),n=d(t.barSpacing);for(const o of t.items){if(!o)continue;if(!Number.isFinite(o.x)||!Number.isFinite(o.y))continue;const t=Math.abs(o.height),i=o.isUp?-1:1,a=t+r,l=o.y-i*n,c=l-i*a,u=o.x-s,d=o.x+s;if(u<e.x&&e.x<d&&(o.isUp?l<e.y&&e.y<c:c<e.y&&e.y<l))return new h.HitTestResult(h.HitTestResult.REGULAR)}return null}}var m=i("vq8G");class f extends m.SelectionRenderer{_drawMarker(e,t,i,r,n){const o=Object(s.ensureNotNull)(this._data),a=t.isUp?1:-1;const l=i+a*d(o.barSpacing)+a*p(o.barSpacing);let c=Math.round(3.5*n*2);c%2!=r%2&&(c+=1)
|
||
;const h=r%2/2,u=Math.round(t.x*n)+h,_=Math.round((t.y+l)*n)+h;e.beginPath(),e.arc(u,_,c/2,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()}}var g=i("GSwP");i.d(t,"StudyPlotArrowsPaneView",(function(){return v}));class v extends g.a{constructor(){super(...arguments),this._maxAbsValue=0}renderer(){if(!this._study.properties().styles[this._plotName].visible)return null;if(!this._study.properties().styles[this._plotName].visible.value())return null;if(!this._scalesReady())return null;this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={},t=Object(n.clamp)(this._getTranspValue(),0,100),i=this._model.timeScale().barSpacing();e.items=this._items,e.barSpacing=i,e.colorup=Object(o.generateColor)(this._study.properties().styles[this._plotName].colorup.value(),t),e.colordown=Object(o.generateColor)(this._study.properties().styles[this._plotName].colordown.value(),t);const s=Object(r.parseRgba)(e.colorup),l=s?100*(1-s[3]):0,c=Object(r.parseRgba)(e.colordown),h=c?100*(1-c[3]):0;e.colorBorderUp=Object(o.generateColor)("#000000",l),e.colorBorderDown=Object(o.generateColor)("#000000",h),e.minHeight=this._study.properties().styles[this._plotName].minHeight.value(),e.maxHeight=this._study.properties().styles[this._plotName].maxHeight.value();const u=new a.CompositeRenderer;if(u.append(new _(e)),this._model.selection().isSelected(this._study)&&null!==this._selectionData){const e=this._selectionData;e.barSpacing=i,u.append(new f(e))}return u}_fillItemWithPointStyle(e,t,i){const r=Object(s.ensureDefined)(e.style);e.isUp?void 0!==t.colors[l.ColorerType.Up]?r.color=Object(o.generateColor)(Object(s.ensureDefined)(t.colors[l.ColorerType.Up]),i):r.color=Object(o.generateColor)(this._study.properties().styles[this._plotName].colorup.value(),i):void 0!==t.colors[l.ColorerType.Down]?r.color=Object(o.generateColor)(Object(s.ensureDefined)(t.colors[l.ColorerType.Down]),i):r.color=Object(o.generateColor)(this._study.properties().styles[this._plotName].colordown.value(),i)}_createItem(e,t,i,s){if(0===t)return null;Math.abs(t)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(t));const r=t>0;let n;if(r){const t=this._getSeriesVal(s,e);if(null===t)return null;n=t}else{const t=this._getSeriesVal(i,e);if(null===t)return null;n=t}return new u(e,n,t,r)}_convertItemsToCoordinates(){const e=this._model.timeScale(),t=Object(s.ensureNotNull)(this._study.priceScale());e.timedValuesToCoordinates(this._items),t.pointsArrayToCoordinates(this._items,Object(s.ensureNotNull)(this._study.firstValue()));let i=Math.abs(this._study.properties().styles[this._plotName].minHeight.value()),r=Math.abs(this._study.properties().styles[this._plotName].maxHeight.value());if(i>r){const e=i;i=r,r=e}const n=(r-i)/this._maxAbsValue,o=this._items;for(let s=0;s<o.length;s++){const e=o[s],t=Math.abs(e.height);e.height=t*n+i}}}},"B4/o":function(e,t,i){"use strict";(function(e){var s=i("QIuV").LineToolTrading,r=i("4TVt").LineToolPriceAxisView,n=i("jkoZ"),o=i("Ss5c").LineDataSource,a=i("Ocx9").DefaultProperty,l=i("s1Gx").sortSourcesPreOrdered.LineToolOrder;function c(e){
|
||
return null==e?e="":e+="",e}class h{constructor(e){this._line=e,this._data={bodyText:"order",quantityText:"0"},this._editable=!0,this._cancellable=!0,this._mode="",this._direction="buy",this._active=!0}setMode(e){return this._mode=e,this._line.updateAllViewsAndRedraw(),this}setDirection(e){return this._direction=e,this._line.updateAllViewsAndRedraw(),this}setActive(e){return this._active=e,this._line.updateAllViewsAndRedraw(),this}setEditable(e){return this._editable=e,this._line.updateAllViewsAndRedraw(),this}getEditable(){return this._editable}setCancellable(e){return this._cancellable=e,this._line.updateAllViewsAndRedraw(),this}getCancellable(){return this._cancellable}hasMoveCallback(){return this.isFunction(this._onMoveCallback)}hasModifyCallback(){return this.isFunction(this._onModifyCallback)}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0}setPrice(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this}getText(){return this._data.bodyText}setText(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this}setTooltip(e){return this._line.properties().tooltip.setValue(c(e)),this}getTooltip(){return this._line.properties().tooltip.value()}setModifyTooltip(e){return this._line.properties().modifyTooltip.setValue(c(e)),this}getModifyTooltip(){return this._line.properties().modifyTooltip.value()}setCancelTooltip(e){return this._line.properties().cancelTooltip.setValue(c(e)),this}getCancelTooltip(){return this._line.properties().cancelTooltip.value()}getQuantity(){return this._data.quantityText}setQuantity(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this}getExtendLeft(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e}setExtendLeft(e){return this._line.properties().extendLeft.setValue(e),this}getLineLength(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e}setLineLength(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this}getLineColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.lineActiveBuyColor.value():e.lineInactiveBuyColor.value():this._active?e.lineActiveSellColor.value():e.lineInactiveSellColor.value()}setLineColor(e){return"buy"===this._direction?this._active?this.setLineActiveBuyColor(e):this.setLineInactiveBuyColor(e):this._active?this.setLineActiveSellColor(e):this.setLineInactiveSellColor(e),this}setLineActiveBuyColor(e){return this._line.properties().lineActiveBuyColor.setValue(e),this}setLineInactiveBuyColor(e){return this._line.properties().lineInactiveBuyColor.setValue(e),this}setLineActiveSellColor(e){
|
||
return this._line.properties().lineActiveSellColor.setValue(e),this}setLineInactiveSellColor(e){return this._line.properties().lineInactiveSellColor.setValue(e),this}getLineStyle(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e}setLineStyle(e){return this._line.properties().lineStyle.setValue(e),this}getLineWidth(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e}setLineWidth(e){return this._line.properties().lineWidth.setValue(e),this}getBodyBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.bodyBorderActiveBuyColor.value():e.bodyBorderInactiveBuyColor.value():this._active?e.bodyBorderActiveSellColor.value():e.bodyBorderInactiveSellColor.value()}setBodyBorderColor(e){return"buy"===this._direction?this._active?this.setBodyBorderActiveBuyColor(e):this.setBodyBorderInactiveBuyColor(e):this._active?this.setBodyBorderActiveSellColor(e):this.setBodyBorderInactiveSellColor(e),this}setBodyBorderActiveBuyColor(e){return this._line.properties().bodyBorderActiveBuyColor.setValue(e),this}setBodyBorderInactiveBuyColor(e){return this._line.properties().bodyBorderInactiveBuyColor.setValue(e),this}setBodyBorderActiveSellColor(e){return this._line.properties().bodyBorderActiveSellColor.setValue(e),this}setBodyBorderInactiveSellColor(e){return this._line.properties().bodyBorderInactiveSellColor.setValue(e),this}getBodyBackgroundColor(){return n.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)}setBodyBackgroundColor(e){return n.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this}getBodyTextColor(){var e=this._line.properties();return"limit"===this._mode?this._active?e.bodyTextActiveLimitColor.value():e.bodyTextInactiveLimitColor.value():"stop"===this._mode?this._active?e.bodyTextActiveStopColor.value():e.bodyTextInactiveStopColor.value():"buy"===this._direction?this._active?e.bodyTextActiveBuyColor.value():e.bodyTextInactiveBuyColor.value():this._active?e.bodyTextActiveSellColor.value():e.bodyTextInactiveSellColor.value()}setBodyTextColor(e){return"limit"===this._mode?this._active?this.setBodyTextActiveLimitColor(e):this.setBodyTextInactiveLimitColor(e):"stop"===this._mode?this._active?this.setBodyTextActiveStopColor(e):this.setBodyTextInactiveStopColor(e):"buy"===this._direction?this._active?this.setBodyTextActiveBuyColor(e):this.setBodyTextInactiveBuyColor(e):this._active?this.setBodyTextActiveSellColor(e):this.setBodyTextInactiveSellColor(e),this}setBodyTextInactiveLimitColor(e){return this._line.properties().bodyTextInactiveLimitColor.setValue(e),this}setBodyTextActiveLimitColor(e){return this._line.properties().bodyTextActiveLimitColor.setValue(e),this}setBodyTextInactiveStopColor(e){return this._line.properties().bodyTextInactiveStopColor.setValue(e),this}
|
||
setBodyTextActiveStopColor(e){return this._line.properties().bodyTextActiveStopColor.setValue(e),this}setBodyTextInactiveBuyColor(e){return this._line.properties().bodyTextInactiveBuyColor.setValue(e),this}setBodyTextActiveBuyColor(e){return this._line.properties().bodyTextActiveBuyColor.setValue(e),this}setBodyTextInactiveSellColor(e){return this._line.properties().bodyTextInactiveSellColor.setValue(e),this}setBodyTextActiveSellColor(e){return this._line.properties().bodyTextActiveSellColor.setValue(e),this}getBodyFont(){return n.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)}setBodyFont(e){return n.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this}getQuantityBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBorderActiveBuyColor.value():e.quantityBorderInactiveBuyColor.value():this._active?e.quantityBorderActiveSellColor.value():e.quantityBorderInactiveSellColor.value()}setQuantityBorderColor(e){return"buy"===this._direction?this._active?this.setQuantityBorderActiveBuyColor(e):this.setQuantityBorderInactiveBuyColor(e):this._active?this.setQuantityBorderActiveSellColor(e):this.setQuantityBorderInactiveSellColor(e),this}setQuantityBorderActiveBuyColor(e){return this._line.properties().quantityBorderActiveBuyColor.setValue(e),this}setQuantityBorderInactiveBuyColor(e){return this._line.properties().quantityBorderInactiveBuyColor.setValue(e),this}setQuantityBorderActiveSellColor(e){return this._line.properties().quantityBorderActiveSellColor.setValue(e),this}setQuantityBorderInactiveSellColor(e){return this._line.properties().quantityBorderInactiveSellColor.setValue(e),this}getQuantityBackgroundColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBackgroundActiveBuyColor.value():e.quantityBackgroundInactiveBuyColor.value():this._active?e.quantityBackgroundActiveSellColor.value():e.quantityBackgroundInactiveSellColor.value()}setQuantityBackgroundColor(e){return"buy"===this._direction?this._active?this.setQuantityBackgroundActiveBuyColor(e):this.setQuantityBackgroundInactiveBuyColor(e):this._active?this.setQuantityBackgroundActiveSellColor(e):this.setQuantityBackgroundInactiveSellColor(e),this}setQuantityBackgroundActiveBuyColor(e){return this._line.properties().quantityBackgroundActiveBuyColor.setValue(e),this}setQuantityBackgroundInactiveBuyColor(e){return this._line.properties().quantityBackgroundInactiveBuyColor.setValue(e),this}setQuantityBackgroundActiveSellColor(e){return this._line.properties().quantityBackgroundActiveSellColor.setValue(e),this}setQuantityBackgroundInactiveSellColor(e){return this._line.properties().quantityBackgroundInactiveSellColor.setValue(e),this}getQuantityTextColor(){
|
||
return n.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)}setQuantityTextColor(e){return n.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this}getQuantityFont(){return n.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)}setQuantityFont(e){return n.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this}getCancelButtonBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.cancelButtonBorderActiveBuyColor.value():e.cancelButtonBorderInactiveBuyColor.value():this._active?e.cancelButtonBorderActiveSellColor.value():e.cancelButtonBorderInactiveSellColor.value()}setCancelButtonBorderColor(e){return"buy"===this._direction?this._active?this.setCancelButtonBorderActiveBuyColor(e):this.setCancelButtonBorderInactiveBuyColor(e):this._active?this.setCancelButtonBorderActiveSellColor(e):this.setCancelButtonBorderInactiveSellColor(e),this}setCancelButtonBorderActiveBuyColor(e){return this._line.properties().cancelButtonBorderActiveBuyColor.setValue(e),this}setCancelButtonBorderInactiveBuyColor(e){return this._line.properties().cancelButtonBorderInactiveBuyColor.setValue(e),this}setCancelButtonBorderActiveSellColor(e){return this._line.properties().cancelButtonBorderActiveSellColor.setValue(e),this}setCancelButtonBorderInactiveSellColor(e){return this._line.properties().cancelButtonBorderInactiveSellColor.setValue(e),this}getCancelButtonBackgroundColor(){return n.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)}setCancelButtonBackgroundColor(e){return n.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this}getCancelButtonIconColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.cancelButtonIconActiveBuyColor.value():e.cancelButtonIconInactiveBuyColor.value():this._active?e.cancelButtonIconActiveSellColor.value():e.cancelButtonIconInactiveSellColor.value()}setCancelButtonIconColor(e){return"buy"===this._direction?this._active?this.setCancelButtonIconActiveBuyColor(e):this.setCancelButtonIconInactiveBuyColor(e):this._active?this.setCancelButtonIconActiveSellColor(e):this.setCancelButtonIconInactiveSellColor(e),this}setCancelButtonIconActiveBuyColor(e){return this._line.properties().cancelButtonIconActiveBuyColor.setValue(e),this}setCancelButtonIconInactiveBuyColor(e){return this._line.properties().cancelButtonIconInactiveBuyColor.setValue(e),this}setCancelButtonIconActiveSellColor(e){return this._line.properties().cancelButtonIconActiveSellColor.setValue(e),this}
|
||
setCancelButtonIconInactiveSellColor(e){return this._line.properties().cancelButtonIconInactiveSellColor.setValue(e),this}block(){this._blocked=!0,this._line.updateAllViewsAndRedraw()}unblock(){this._blocked=!1,this._line.updateAllViewsAndRedraw()}getBlocked(){return this._blocked}isFunction(e){return"function"==typeof e}onCancel(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this}callOnCancel(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)}isOnCancelCallbackPresent(){return this.isFunction(this._onCancelCallback)}onModify(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this}callOnModify(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)}onMove(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this}callOnMove(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)}onContextMenu(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this}shouldShowContextMenu(){return this.isFunction(this._onContextMenuCallback)}callOnContextMenu(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)}remove(){this._line._model.removeSource(this._line),delete this._line}}class u extends s{constructor(e,t){super(e,t||u.createProperties()),this._adapter=new h(this),this.setSelectionEnabled(!0),i.e("lt-pane-views").then(i.bind(null,"LMGK")).then(({OrderPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}zorder(){return l}setPoint(e,t,i){this._points[e]=t,this.normalizePoints()}addPoint(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}name(){return"Order"}endMoving(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.logical.price!==this._currentMovingPoint.logical.price;super.endMoving(),!e&&t&&this._adapter.callOnMove()}createPriceAxisView(e){var t={pointIndex:e,backgroundPropertyGetter:()=>this._adapter.getLineColor()};return this._priceAxisView=new r(this,t),this._priceAxisView}paneViews(){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?o.prototype.paneViews.call(this):null}priceAxisViews(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?o.prototype.priceAxisViews.call(this,t,i):null}adapter(){return this._adapter}hasContextMenu(){return this._adapter.shouldShowContextMenu()}contextMenuItems(){return this._adapter.callOnContextMenu()}movable(){return Boolean(this._adapter._onMoveCallback)}static createProperties(e){var t=new a("linetoolorder",e,!1,!1)
|
||
;return u._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolOrder=u}).call(this,i("Kxc7"))},BBCR:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="square" d="M6.145 11.968L14 5.5l7.855 6.468a.3.3 0 0 1-.191.532H6.336a.3.3 0 0 1-.19-.532zm0 4.064L14 22.5l7.855-6.468a.3.3 0 0 0-.191-.532H6.336a.3.3 0 0 0-.19.532z"/></svg>'},BOPY:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("f6yo").pointInCircle,n=i("VdBB").HitTestResult,o=i("zDbI").CHART_FONT_FAMILY,a=i("cPgM").ScaledPaneRenderer;class l extends a{constructor(e,t){super(),this._barWidth=e.barWidth,this._plates=e.plates,this._tooltip=e.tooltip,this._model=t}_drawImpl(e){e.save();for(var t=0;t<this._plates.length;t++)if(this._plates[t].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,e)),this._tooltip.draw(this._plates.map(function(e){return this._plateTransform(e)}.bind(this)),e),this._tooltip.endDraw(),e.restore()}_drawItem(e,t){e.save(),this._highlightByAuthor&&!t.highlightByAuthor&&(e.globalAlpha=.4);var i=this._dotTransform(t);i.mine?this._drawTriangle(e,i):this._drawDot(e,i),e.restore()}_commonTransform(e){var t=Math.max(1.4*e.minSize,this._barWidth+4),i={up:-1,down:1}[e.direction]*(e.yInverted?-1:1)*(t*(e.order+.6)+.25*t),s=e.y+i,r=TradingView.clone(e.overridedTheme||this.themes[e.theme]);return r.dotBorderWidth=e.hovered||e.highlightByAuthor?4:2,{id:e.id,theme:r,themeName:e.theme,x:Math.round(e.x+1),y:Math.round(s),yInverted:e.yInverted,pinned:e.pinned,hovered:e.hovered}}_dotTransform(e){var t=this._commonTransform(e);return t.radius=Math.max(e.minSize/2,.4*this._barWidth),t.label=e.label,t.labelFontColor=e.labelFontColor,t.labelFontSize=Math.ceil(Math.max(10,Math.min(t.radius,20))),this._model.updateDotData(e,t)}_plateTransform(e){var t=this._commonTransform(e);return this._model.updatePlateData(e,t)}_drawTriangle(e,t){e.strokeStyle=t.theme.border,e.fillStyle=t.theme.background,e.lineWidth=t.theme.dotBorderWidth;var i=t,s=t.radius,r=Math.cos(Math.PI/6)*s,n=Math.sin(Math.PI/6)*s;e.translate(i.x,i.y),"up"===t.direction!==t.yInverted&&e.rotate(Math.PI),t.public||(e.lineWidth/=2),e.beginPath(),e.moveTo(0,-s),e.lineTo(r,n),e.lineTo(-r,n),e.lineTo(0,-s),e.closePath(),e.stroke(),t.public&&e.fill()}_drawDot(e,t){e.strokeStyle=t.theme.border,e.fillStyle=t.theme.background,e.lineWidth=t.theme.dotBorderWidth,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!0),e.closePath(),e.stroke(),e.fill(),t.label&&t.radius>6&&(e.textAlign="center",e.textBaseline="middle",e.font="bold "+t.labelFontSize+"px "+o,e.fillStyle=t.labelFontColor,e.fillText(t.label,t.x,t.y))}hitTest(e){for(var t,i=this._plates.length-1;i>=0;--i)if(t=this._hitTestDot(this._plates[i],e))return t;return null}_hitTestDot(e,t){var i=this._dotTransform(e),o=new s(i.x,i.y);return r(t,o,Math.max(i.radius,8))?new n(n.REGULAR,e):null}}l.prototype.themes={green:{border:"#78C143",background:"#8DDD54"},red:{
|
||
border:"#CC4545",background:"#ED5A5A"},neutral:{border:"#EAC300",background:"#FFD400"},yellow:{border:"#EAC300",background:"#FFD400"},blue:{border:"#047ACE",background:"#0496FF"}},t.BarsMarksContainerPaneView=class{constructor(e,t){this.source=e,this._rendererFactory=t}update(){}renderer(e,t){return this._rendererFactory(this.source)}},t.BarsMarksContainerRenderer=l},BZtw:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("ogJP"),n=i("5fI3"),o=i("LxhU"),a=i("XPit"),l=i("hsV8"),c=i("YWnQ"),h=i("aIyQ"),u=i.n(h);class d{constructor(){this._loading=new u.a,this._completed=new u.a,this._error=new u.a,this._symbolError=new u.a,this._symbolResolved=new u.a,this._seriesError=new u.a,this._symbolNotPermitted=new u.a,this._symbolGroupNotPermitted=new u.a,this._extendedHoursNotPermitted=new u.a,this._chartTypeNotPermitted=new u.a,this._intradaySpreadNotPermitted=new u.a,this._intradayExchangeNotPermitted=new u.a,this._customIntervalNotPermitted=new u.a,this._secondsIntervalNotPermitted=new u.a,this._tickMarksRangeChanged=new u.a,this._barReceived=new u.a,this._seriesTimeFrame=new u.a,this._dataUpdated=new u.a}destroy(){this._loading.destroy(),this._completed.destroy(),this._error.destroy(),this._symbolError.destroy(),this._symbolResolved.destroy(),this._seriesError.destroy(),this._symbolNotPermitted.destroy(),this._symbolGroupNotPermitted.destroy(),this._extendedHoursNotPermitted.destroy(),this._chartTypeNotPermitted.destroy(),this._intradaySpreadNotPermitted.destroy(),this._intradayExchangeNotPermitted.destroy(),this._customIntervalNotPermitted.destroy(),this._secondsIntervalNotPermitted.destroy(),this._tickMarksRangeChanged.destroy(),this._barReceived.destroy(),this._seriesTimeFrame.destroy(),this._dataUpdated.destroy()}loading(){return this._loading}completed(){return this._completed}error(){return this._error}symbolError(){return this._symbolError}symbolResolved(){return this._symbolResolved}seriesError(){return this._seriesError}symbolNotPermitted(){return this._symbolNotPermitted}symbolGroupNotPermitted(){return this._symbolGroupNotPermitted}extendedHoursNotPermitted(){return this._extendedHoursNotPermitted}chartTypeNotPermitted(){return this._chartTypeNotPermitted}intradaySpreadNotPermitted(){return this._intradaySpreadNotPermitted}intradayExchangeNotPermitted(){return this._intradayExchangeNotPermitted}customIntervalNotPermitted(){return this._customIntervalNotPermitted}secondsIntervalNotPermitted(){return this._secondsIntervalNotPermitted}tickMarksRangeChanged(){return this._tickMarksRangeChanged}barReceived(){return this._barReceived}seriesTimeFrame(){return this._seriesTimeFrame}dataUpdated(){return this._dataUpdated}fireCompleted(e,t){this._completed.fire(e,t)}fireLoading(e){this._loading.fire(e)}fireError(){this._error.fire()}fireSymbolError(e){this._symbolError.fire(e),this.fireError()}fireSymbolResolved(e){this._symbolResolved.fire(e)}fireSeriesError(e){this._seriesError.fire(e),this.fireError()}fireSymbolNotPermitted(e){this._symbolNotPermitted.fire(e),this.fireError()}fireSymbolGroupNotPermitted(e){
|
||
this._symbolGroupNotPermitted.fire(e),this.fireError()}fireExtendedHoursNotPermitted(){this._extendedHoursNotPermitted.fire(),this.fireError()}fireChartTypeNotPermitted(e){this._chartTypeNotPermitted.fire(e),this.fireError()}fireIntradaySpreadNotPermitted(){this._intradaySpreadNotPermitted.fire(),this.fireError()}fireIntradayExchangeNotPermitted(){this._intradayExchangeNotPermitted.fire(),this.fireError()}fireCustomIntervalNotPermitted(){this._customIntervalNotPermitted.fire(),this.fireError()}fireSecondsIntervalNotPermitted(){this._secondsIntervalNotPermitted.fire(),this.fireError()}fireTickMarksRangeChanged(e){this._tickMarksRangeChanged.fire(e)}fireBarReceived(e){this._barReceived.fire(e)}fireSeriesTimeFrame(e,t,i,s,r){this._seriesTimeFrame.fire(e,t,i,s,r)}fireDataUpdated(e,t){this._dataUpdated.fire(e,t)}}var p=i("txPx");i.d(t,"initialRequestOptionsToNumBars",(function(){return v})),i.d(t,"SeriesDataSource",(function(){return b})),i.d(t,"parseJapaneseProjectionBars",(function(){return S}));const _=Object(p.getLogger)("Chart.SeriesDataSource");var m;!function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingFirstDataUpdate=2]="AwaitingFirstDataUpdate",e[e.Active=3]="Active"}(m||(m={}));let f=1;let g=1;function v(e){return e.startDate?e.endDate||e.count?e.endDate?["from_to",e.startDate,e.endDate]:["bar_count",e.startDate,Object(s.ensure)(e.count)]:["from_to",e.startDate]:e.count||300}class b{constructor(e,t,i){this._instanceId=null,this._symbolInstanceId=null,this._symbol=null,this._resolution=null,this._timeFrame=null,this._data=new a.SeriesData,this._dataEvents=new d,this._status=m.Idle,this._turnaroundCounter=1,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._turnaroundPrefix=t,this._createSeriesParams=v(null!=i?i:{count:300}),this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}destroy(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged)}modifySeries(e,t,i=null,n=!1){n&&(_.logNormal("Due to force flag clearing symbol & resolution to force re-requesting data."),this._symbol=null,this._resolution=null);const a=this._symbol,l=this._resolution;if(this._symbol=e,this._resolution=t,null===this._instanceId)return void(this._timeFrame=i);const c=!Object(r.deepEquals)(a,e)[0],h=null===l||!o.Interval.isEqual(l,t);(c||h||null!==i)&&(this._timeFrame=null,(c||h)&&this._turnaroundCounter++,c&&this._resolveSymbol(),this._gateway.modifySeries(this._instanceId,this.turnaround(),Object(s.ensureNotNull)(this._symbolInstanceId),this._resolution,i,this._onMessage.bind(this)))}requestMoreData(e){null!==this._instanceId&&this._gateway.requestMoreData(this._instanceId,e,this._onMessage.bind(this))}requestMoreTickmarks(e){null!==this._instanceId&&this._gateway.requestMoreTickmarks(this._instanceId,e,this._onMessage.bind(this))}isStarted(){return this._status!==m.Idle}isActive(){return this._status===m.Active}start(){
|
||
this.isStarted()?_.logNormal("start: data source is already started, nothing to do"):(Object(s.assert)(null!==this._symbol,"symbol must be set before start"),Object(s.assert)(null!==this._resolution,"resolution must be set before start"),this._gateway.isConnected().value()?this._createSeries():this._changeStatusTo(m.AwaitingConnection))}stop(){this.isStarted()?(null!==this._instanceId&&(this._gateway.removeSeries(this._instanceId),this._instanceId=null),this._changeStatusTo(m.Idle)):_.logNormal("stop: data source is already stopped, nothing to do")}instanceId(){return this._instanceId}data(){return this._data}clearData(){this.isStarted()?this._enqueueUpdate(()=>this._clearDataImpl()):this._clearDataImpl()}dataEvents(){return this._dataEvents}turnaround(){return`${this._turnaroundPrefix}${this._turnaroundCounter}`}symbolInstanceId(){return this._symbolInstanceId}moveData(e){this._enqueueUpdate(()=>this._data.moveData(e))}_clearDataImpl(){this._data.clear()}_resolveSymbol(){null!==this._symbol&&(this._symbolInstanceId="sds_sym_"+f++,this._gateway.resolveSymbol(this._symbolInstanceId,Object(n.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol),this._onMessage.bind(this)))}_changeStatusTo(e){Object(s.assert)(this._status!==e,"Source and destination status should be distinct"),_.logNormal(`Status changed from ${m[this._status]} to ${m[e]}`),this._status=e}_createSeries(){Object(s.assert)(this._status!==m.Active,'Status should not be "Active" when creating a study'),this._instanceId="sds_"+g++,this._resolveSymbol(),this._gateway.createSeries(this._instanceId,this.turnaround(),Object(s.ensureNotNull)(this._symbolInstanceId),Object(s.ensureNotNull)(this._resolution),this._createSeriesParams,this._timeFrame,this._onMessage.bind(this)),this._timeFrame=null,this._changeStatusTo(m.AwaitingFirstDataUpdate)}_onGatewayIsConnectedChanged(e){e?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===m.AwaitingConnection&&this._createSeries()}_onGatewayDisconnected(){this._status!==m.Idle&&this._status!==m.AwaitingConnection&&(this._instanceId=null,this._changeStatusTo(m.AwaitingConnection)),this._turnaroundCounter=1}_onMessage(e){this._enqueueUpdate(()=>this._onMessageImpl(e))}async _onMessageImpl(e){switch(e.method){case"symbol_resolved":{const[t,i]=e.params;if(t!==this._symbolInstanceId){_.logNormal(`Resolve for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolResolved(i);break}case"symbol_error":if(e.params[0]!==this._symbolInstanceId){_.logNormal(`Symbol error for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolError(e);break;case"series_timeframe":{const[t,i,s,r,n,o,a]=e.params;if(!this._checkTurnaround(t,i)){_.logNormal(`Time frame for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${i})`);break}this._onSeriesTimeFrame(s,r,n,o,a);break}case"series_error":{const[t,i]=e.params;if(!this._checkTurnaround(t,i)){
|
||
_.logNormal(`Series error for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${i})`);break}this._onSeriesError(e.params[2]);break}case"series_loading":{const[t,i]=e.params;if(!this._checkTurnaround(t,i))break;this._onSeriesLoading(e.time);break}case"series_completed":{const[t,i,s]=e.params;if(!this._checkTurnaround(t,s)){_.logNormal(`Series completed for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${s})`);break}this._onSeriesCompleted(i,e.time);break}case"data_update":if(!this._checkTurnaround(e.params.customId,e.params.turnaround)){_.logNormal(`Data update for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e.params.customId} (${e.params.turnaround})`);break}await this._onDataUpdate(e.params.plots,e.params.nonseries,e.params.lastBar);break;case"clear_data":if(e.params.turnaround!==this.turnaround()){_.logNormal(`Clear data for old data, expected: ${this.turnaround()}, actual ${e.params.turnaround}`);break}this._clearDataImpl(),this._dataEvents.fireDataUpdated(void 0,!1)}}_onSeriesError(e){if(e.startsWith("study_not_auth:")){const t=e.split(":",2)[1].split("@",2)[0];["BarSetRenko","BarSetPriceBreak","BarSetKagi","BarSetPnF"].includes(t)?this._dataEvents.fireChartTypeNotPermitted(t):"BarSetSpread"===t?this._dataEvents.fireIntradaySpreadNotPermitted():"BarSetRange"===t&&this._dataEvents.fireCustomIntervalNotPermitted()}else"resolution_not_entitled"===e?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===e?this._dataEvents.fireCustomIntervalNotPermitted():"seconds_not_entitled"===e&&this._dataEvents.fireSecondsIntervalNotPermitted();this._dataEvents.fireSeriesError(e)}_onSeriesTimeFrame(e,t,i,s,r){this._dataEvents.fireSeriesTimeFrame(e,t,i,null==s||s,r)}_onSymbolError(e){if(e.params[1]===c.permissionDenied)switch(e.params[2]){case c.SymbolErrorPermissionDeniedReason.ExtendedHours:this._dataEvents.fireExtendedHoursNotPermitted();break;case c.SymbolErrorPermissionDeniedReason.Symbol:this._dataEvents.fireSymbolNotPermitted(e.params[3]);break;case c.SymbolErrorPermissionDeniedReason.GroupPermission:this._dataEvents.fireSymbolGroupNotPermitted(e.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(e.params[2])}this._dataEvents.fireSymbolError(e.params[1])}_onSymbolResolved(e){this._dataEvents.fireSymbolResolved(e)}async _onDataUpdate(e,t,i){this._onDataUnpacked(e,i,await S(t))}_enqueueUpdate(e){return this._ongoingDataUpdate=this._ongoingDataUpdate.then(e,e),this._ongoingDataUpdate}_onDataUnpacked(e,t,i){if(this._status===m.Idle)return;this._status===m.AwaitingFirstDataUpdate&&(this._changeStatusTo(m.Active),this._clearDataImpl());const s=this._data.bars().size(),r=this._data.bars().firstIndex(),n=this._data.bars().merge(e);null!==i&&(this._data.nsBars().clear(),this._data.nsBars().merge(i.projectionPlots),this._data.lastProjectionPrice=i.lastPrice,null!==i.boxSize&&(this._data.boxSize=i.boxSize),this._data.reversalAmount=i.reversalAmount);const o=null===r||null!==n&&n.index<r
|
||
;this._dataEvents.fireDataUpdated(t,o),s!==this._data.bars().size()&&null!==n&&this._dataEvents.fireBarReceived(n)}_onSeriesLoading(e){this._dataEvents.fireLoading(e)}_onSeriesCompleted(e,t){this._dataEvents.fireCompleted(e,t)}_checkTurnaround(e,t){return this._instanceId===e&&(void 0===t||t===this.turnaround())}}async function S(e){if(void 0===e)return{projectionPlots:[],boxSize:null};if(""===e.d||"nochange"===e.indexes)return null;const t=await Object(l.unpackNonSeriesData)(e.d);if(null===t||t.indexes_replace)return null;const i=e.indexes,{bars:s,price:r,boxSize:n,reversalAmount:o}=t.data;return{lastPrice:r,projectionPlots:(s||[]).map(e=>{let t;return"factor"in e?t=e.factor:"additionalPrice"in e&&(t=e.additionalPrice),{index:i[e.time],value:[0,e.open,e.high,e.low,e.close,e.volume,t]}}),reversalAmount:o,boxSize:n}}},Bt3k:function(e,t,i){"use strict";function s(e,t){this.tooltips={},this.tooltipFactory=e,this.source=t}function r(e,t){this.renderer=e,this._tooltip=t,this.visible=!1}s.prototype.findOrCreateTooltip=function(e){var t=this.tooltips[e.id];return null==t&&(e.hovered||e.pinned)&&(t=this._createTooltip(),this.tooltips[e.id]=t),t},s.prototype.showPlate=function(e,t){var i=this.findOrCreateTooltip(e);null!=i&&(i._drawPlate(e,t),i.plateData=e)},s.prototype.draw=function(e,t){this.hoveredId=null;for(var i=0;i<e.length;i++)e[i].hovered&&(this.hoveredId=e[i].id);e.forEach(function(e){this.showPlate(e,t)}.bind(this))},s.prototype.endDraw=function(){for(var e in this.tooltips)if(this.tooltips.hasOwnProperty(e)){var t=this.tooltips[e];t.toggleVisibility(),this.hoveredId&&t.plateData.id!==this.hoveredId&&!t.plateData.pinned&&(t.remove(),delete this.tooltips[e])}},s.prototype.removeAll=function(){for(var e in this.tooltips){if(this.tooltips.hasOwnProperty(e))this.tooltips[e].remove()}this.tooltips={}},s.prototype.removeTooltip=function(e){delete this.tooltips[e]},s.prototype._createTooltip=function(){return new r(this,this.tooltipFactory())},r.prototype._drawPlate=function(e,t){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(e,t),e.hovered||e.pinned||this._tooltip.hide((function(){i.renderer.removeTooltip(e.id)}))},r.prototype.remove=function(){this._tooltip._removeLayout()},r.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},t.TooltipRenderer=s},"C2K+":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("YFKU"),r=i("6I19"),n=i("n5al");const o={open:Object(s.t)("O",{context:"in_legend"}),high:Object(s.t)("H",{context:"in_legend"}),low:Object(s.t)("L",{context:"in_legend"}),close:Object(s.t)("C",{context:"in_legend"}),hl2:Object(s.t)("HL2",{context:"in_legend"}),hlc3:Object(s.t)("HLC3",{context:"in_legend"}),ohlc4:Object(s.t)("OHLC4",{context:"in_legend"})};class a extends r.a{constructor(e,t){super(e,t),this._showBarChange=t.properties().paneProperties.legendProperties.showBarChange,this._showSeriesOHLC=t.properties().paneProperties.legendProperties.showSeriesOHLC,
|
||
this._seriesStyle=e.properties().childs().style,this._emptyValues[0].title=o.open,this._emptyValues[1].title=o.high,this._emptyValues[2].title=o.low,this._emptyValues[3].title=o.close,this._emptyValues[6].title="",this._emptyValues[4].title=""}getValues(e){const t=super.getValues(e),i=this._showSeriesOHLC.value(),s=this._showBarChange.value(),r=12===this._series.style(),o=t[6];if(o.visible=o.visible&&s&&!r,this._showLastPriceAndChangeOnly()){const e=t[5];return e.visible=e.visible&&i,t}const a=Object(n.isPriceSourceStyle)(this._seriesStyle.value()),l=i&&!a,c=i&&a;return t[0].visible=l&&!r,t[1].visible=l,t[2].visible=l,t[3].visible=l&&!r,t[4].visible=c,t}}},CCPt:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1");function r(e,t,i){return new Promise(s=>{i&&e.classList.remove(i),e.classList.add(t);const r=i=>{i.target===e&&i.animationName===t&&(e.removeEventListener(i.type,r),s(i))};e.addEventListener("animationend",r,!1),e.addEventListener("webkitAnimationEnd",r,!1),e.addEventListener("MSAnimationEnd",r,!1)})}function n(e){return r(e,"tv-transition--fade-in","tv-transition--fade-out")}i.d(t,"UserDefinedBarsMarksTooltip",(function(){return o}));class o extends class{constructor(){this._source=null,this._tooltipHovered=!1,this._layout=null,this._container=null,this._context=null,this._plateArrowSize=14}showPlate(e,t){if(this._currentId!==e.id||!this._layout||null===this._layout.parentNode){this._currentId=e.id,this._createLayout();const i=Object(s.ensureNotNull)(this._layout);this._getContainer(t).appendChild(i),i.addEventListener("mouseenter",()=>{this._tooltipHovered=!0,n(Object(s.ensureNotNull)(this._layout))}),i.addEventListener("mouseleave",()=>{this._tooltipHovered=!1})}const i=Object(s.ensureNotNull)(this._layout);let r=Math.round(e.barWidth/2);r>15&&(r=15),r<10&&(r=10),this._updatePlate(e);const o=t.canvas.getBoundingClientRect(),a=e.x-i.offsetWidth<this._plateArrowSize;let l=o.width-e.x+Math.round(e.barWidth/2+r);a&&(l-=i.offsetWidth+2*this._plateArrowSize);const c=o.height,h=Math.min(Math.max(e.y,20),c-i.offsetHeight-10)+"px";i.classList.toggle("right",a),i.style.display="block",i.style.top=h,i.style.right=l+"px",i.style.fontSize=r+"px"}hide(e){const t=Object(s.ensureNotNull)(this._layout);var i;this._tooltipHovered?n(t):(i=t,r(i,"tv-transition--fade-out","tv-transition--fade-in")).then(()=>{t.remove(),e()})}setSource(e){this._source=e}_getContainer(e){return this._container&&this._context===e||(this._context=e,this._container=e.canvas.parentElement),Object(s.ensureNotNull)(this._container)}_removeLayout(){var e;this._tooltipHovered||null===(e=this._layout)||void 0===e||e.remove()}_toggleLayout(e){Object(s.ensureNotNull)(this._layout).style.visibility=e?"visible":"hidden"}}{constructor(){super(...arguments),this._layoutText=null}_createLayout(){this._layout=document.createElement("div"),this._layout.classList.add("bar-mark-tooltip"),this._layoutText=document.createElement("div"),this._layoutText.classList.add("text"),this._layout.appendChild(this._layoutText)}_updatePlate(e){this._currentId=e.id
|
||
;const t=Object(s.ensureNotNull)(this._layout);t.style.borderColor=e.theme.border,t.style.marginTop=e.tooltipMargin+"px";const i=Object(s.ensureNotNull)(this._layoutText);i.innerHTML=e.text,t.appendChild(i)}}},CHw2:function(e,t,i){"use strict";var s=i("WPQD").LineToolTrendLine,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties())}name(){return"Extended Line"}static createProperties(e){var t=new r("linetoolextended",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolExtended=n},CJIV:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("p1SQ").LineToolHorzLinePriceAxisView,n=i("tc+8"),o=i("Ocx9").DefaultProperty;class a extends s{constructor(e,t){super(e,t||a.createProperties()),this._priceAxisView=new r(this),i.e("lt-pane-views").then(i.t.bind(null,"1oDZ",7)).then(({HorzRayPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 1}name(){return"Horizontal Ray"}priceAxisViews(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null}updateAllViews(){super.updateAllViews(),this._priceAxisView.update()}canHasAlert(){return!0}_getAlertPlots(){var e=this._points[0],t={index:e.index+1,price:e.price};return[this._linePointsToAlertPlot([e,t],null,!1,!0)]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"e0H+"))).HorizontalRayDefinitionsViewModel}template(){var e=s.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static createProperties(e){var t=new o("linetoolhorzray",e);return a._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.hasChild("text")||e.addChild("text",new n("")),e.addExclusion("text")}}t.LineToolHorzRay=a},CLNU:function(e,t,i){(function(e){TradingView.cleanButAmpersand=function(e,t){var i=t?["&"]:["&"];return TradingView.clean(e,t,i)},TradingView.strip_tags=function(e){return e&&e.replace?e.replace(/(<([^>]+)>)/gi,""):e},TradingView.encodeSpread=function(e){return encodeURIComponent(e)},TradingView.clean=function(e,t,i){var s=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"],["'","'"]],r=e;if(!e||!e.replace)return r;for(var n=0;n<s.length;n++){var o=s[n][0],a=s[n][1];i&&i.indexOf&&-1!==i.indexOf(t?a:o)||(r=t?r.replace(new RegExp(a,"g"),o):r.replace(new RegExp(o,"g"),a))}return r},e&&e.exports&&(e.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand,stripTags:TradingView.strip_tags})}).call(this,i("YuTi")(e))},CPmC:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));const s=new WeakMap;function r(e,t){const i=s.get(e);return i instanceof Function?i(t):i&&i[t]}function n(e,t,i){
|
||
if(i instanceof Function)return void s.set(e,i);const r=s.get(e),n=void 0===r||r instanceof Function?{}:r;n[t]=i,s.set(e,n)}},CW80:function(e,t,i){"use strict";i.r(t),i.d(t,"setNewToolProperties",(function(){return h})),i.d(t,"unsetNewToolProperties",(function(){return u})),i.d(t,"getNewToolProperties",(function(){return d})),i.d(t,"createLineTool",(function(){return p})),i.d(t,"createLineToolProperties",(function(){return _})),i.d(t,"createStudyLineToolProperties",(function(){return m})),i.d(t,"supportsPhantomMode",(function(){return f})),i.d(t,"isLineTool",(function(){return g})),i.d(t,"isStudyLineTool",(function(){return v})),i.d(t,"isTrading",(function(){return b})),i.d(t,"tryFindStudyLineToolNameByStudyId",(function(){return S})),i.d(t,"cloneLineTool",(function(){return y}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ss5c"),o=i("OH2X"),a=i("e92V"),l=i("QIuV");i.d(t,"isLineToolName",(function(){return a.isLineToolName})),i.d(t,"isStudyLineToolName",(function(){return a.isStudyLineToolName})),i.d(t,"isLineDrawnWithPressedButton",(function(){return a.isLineDrawnWithPressedButton})),function(e){for(const t of Object.keys(e))TradingView[t]=e[t]}(o);let c=null;function h(e,t){return null!==c&&c.tool===e&&c.toolData===t||(c={properties:_(e),tool:e,toolData:t}),c.properties}function u(){c=null}function d(e){return null!==c&&c.tool===e?c.properties:null}function p(e,t,i,r,n){let l;Object(s.assert)(Object(a.isLineToolName)(e),"Unknown line tool: "+e),n||i||(i=d(e)||void 0);l=new(Object(s.ensureDefined)(o[e]))(t,i,n);return l.toolname=e,u(),l}function _(e,t){Object(s.assert)(Object(a.isLineToolName)(e),e+" should be name of the line tool");return Object(s.ensureDefined)(o[e]).createProperties(t)}function m(e,t,i,r,n){throw Object(s.assert)(Object(a.isStudyLineToolName)(e),e+" should be name of the study line tool"),new Error("Property creation is not implemented for study line tool "+e)}function f(e){Object(s.assert)(Object(a.isLineToolName)(e),e+" should be name of the line tool");const t=o[e];return void 0!==t&&Boolean(t.supportPhantomMode)}function g(e){return e instanceof n.LineDataSource}function v(e){return!1}function b(e){return e instanceof l.LineToolTrading}function S(e){return null}function y(e,t,i,n){const o=t.toolname,a=_(t.toolname,t.properties().state());a.childs().visible.setValue(!0);const l=Object(s.ensureNotNull)(t.ownerSource()),c=p(o,e,a);void 0!==n&&c.setId(n),c.setOwnerSource(l),c.toolname=o;const h=c.clonePositionOffset(),u=t.fixedPoints();(i?u.map(e=>e.add(new r.Point(h.xCoordOffset,h.yCoordOffset))):u).forEach(e=>c.addFixedPoint(e));const d=t.normalizedPoints(),m=i?function(e,t,i){const r=Object(s.ensureNotNull)(t.priceScale()),n=Object(s.ensureNotNull)(t.firstValue());return e.map(e=>{const t=e.price,s=r.priceToCoordinate(t,n)+i.yCoordOffset,o=r.coordinateToPrice(s,n);return{time_t:e.time_t,price:o,offset:e.offset+i.barOffset}})}(d,l,h):d,f=t.points();return c.restorePoints(m,f),c.cloneData&&c.cloneData(t),c.checkAlert&&c.checkAlert(),c}},Cf1E:function(e,t,i){"use strict";function s(e){
|
||
if(void 0===e)return"";if(e instanceof Error){let t=e.message;return e.stack&&(t+=" "+e.stack),t}return"string"==typeof e?e.toString():JSON.stringify(e)}i.d(t,"a",(function(){return s}))},CsKN:function(e,t,i){"use strict";i.r(t),i.d(t,"SetScaleRatioPropertiesCommand",(function(){return n}));var s=i("RDU5"),r=i("Ocx9");class n extends s.UndoCommand{constructor(e,t,i,s){super(i),this._property=e,this._newValue=t,this._model=s,this._priceScale=this._model.mainSeries().priceScale(),this._oldValue=this._property.value(),this._oldMode=this._priceScale.mode()}redo(){this._oldValue=this._property.value(),this._oldMode=this._priceScale.mode(),Object(r.saveDefaultProperties)(!0),this._priceScale.setMode({autoScale:!1,percentage:!1,log:!1}),this._property.setValue(this._newValue),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()}undo(){Object(r.saveDefaultProperties)(!0),this._property.setValue(this._oldValue),this._priceScale.setMode(this._oldMode),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()}}},CwKc:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor"><path stroke-linecap="square" d="M11.5 21.5v-7m3 7v-5m3 5v-3m-9 3v-5"/><path d="M5.5 22v-3"/><path stroke-linecap="square" d="M5.5 13.5l4.297-4.297a2.406 2.406 0 0 1 3.406 0l2.594 2.594c.94.94 2.463.943 3.406 0L23.5 7.5M22.5 12.5v6m-3-3h6"/></g></svg>'},CxTi:function(e,t,i){e.exports={css_value_currency_label_top:"6",css_value_currency_label_radius:"4",css_value_currency_label_text_horizontal_padding:"4",css_value_border_color_light:"#D1D4DC",css_value_border_color_dark:"#363A45","price-axis-currency-label-wrapper":"price-axis-currency-label-wrapper-25tFaE37","price-axis-currency-label":"price-axis-currency-label-25tFaE37",readonly:"readonly-25tFaE37",multiline:"multiline-25tFaE37","price-axis-currency-label-dropdown":"price-axis-currency-label-dropdown-25tFaE37","price-axis-currency-label-text":"price-axis-currency-label-text-25tFaE37","price-axis-currency-label-arrow-down":"price-axis-currency-label-arrow-down-25tFaE37"}},DVnF:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Ss5c");class r extends s.LineDataSource{constructor(){super(...arguments),this._finished=!1}pointsCount(){return-1}finished(){return this._finished}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}hasEditableCoordinates(){return!1}addPoint(e,t,i){if(this._finished)return!0;if(this._lastPoint=null,this._points.length>0){const t=this._points[this._points.length-1],i=this.pointToScreenPoint(t)[1];if(this.pointToScreenPoint(e)[1].subtract(i).length()<2)return this._finished}return super.addPoint(e),this._finished}restorePoints(e,t,i){super.restorePoints(e,t,i),this._finished=!0}}},Daqx:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));const s=["Z","Y","X","W","V","U","T","S"],r=["A","B","C","D","E","F","G","H"];class n{constructor(e){
|
||
this.label=e}equals(e){return null!==e&&this.label===e.label}}function o(e,t){const i="left"===e?s:r;return new n(t<i.length?i[t]:"")}},Dq3s:function(e){e.exports=JSON.parse('{"4":["v",["h",0,2],["h",1,3]],"6":["v",["h",0,2,4],["h",1,3,5]],"8":["v",["h",0,2,4,6],["h",1,3,5,7]],"2h":["h",0,1],"2v":["v",0,1],"2-1":["v",["h",0,2],1],"3s":["h",0,["v",1,2]],"3h":["h",0,1,2],"3v":["v",0,1,2],"1-2":["v",0,["h",1,2]],"3r":["h",["v",0,1],2],"4h":["h",0,1,2,3],"4v":["v",0,1,2,3],"4s":["h",0,["v",1,2,3]],"1-3":["v",0,["h",1,2,3]],"2-2":["v",["h",0,1],["v",2,3]],"1-4":["v",0,["h",1,2,3,4]],"5s":["h",0,["v",1,2,3,4]],"6c":["v",["h",0,1],["h",2,3],["h",4,5]],"8c":["v",["h",0,1],["h",2,3],["h",4,5],["h",6,7]],"s":0}')},DsEq:function(e,t,i){"use strict";i.r(t),i.d(t,"DataProblemModel",(function(){return n}));var s=i("QfUd"),r=i("ogJP");class n{constructor(e,t){this._dataProblem=new s.a(null),this._quotesProvider=e,this._quotesProvider.quotesUpdate().subscribe(this,this._update.bind(this)),this._resetSubscription=t,this._resetSubscription.subscribe(this,this._resetStatus)}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._resetSubscription.unsubscribeAll(this)}status(){return this._dataProblem}_resetStatus(){this._dataProblem.setValue(null)}_update(e){void 0===e.values||void 0===e.values.data_problem?this._resetStatus():this._dataProblem.setValue(Object(r.clone)(e.values.data_problem))}}},E3Wt:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("RDU5");class n extends r.UndoCommand{constructor(e,t){super(""),this._chartModel=e,this._targetIndex=t}redo(){const e=this._chartModel.createPane(this._targetIndex,void 0,this._paneId);this._paneId=e.id()}undo(){const e=Object(s.ensureDefined)(this._paneId),t=this._chartModel.panes().find(t=>t.id()===e);void 0!==t&&this._chartModel.removePane(t)}createdPaneId(){return this._paneId}}function o(e,t){const i=t.model().model().studyTemplate();e.undoHistory.beginUndoMacro("Apply Indicators to Entire Layout");for(let s=0;s<e.chartWidgetsDefs.length;s++){const r=e.chartWidgetsDefs[s].chartWidget;if(r===t)continue;const n=r.model();n&&n.applyStudyTemplate(i,"")}e.undoHistory.endUndoMacro()}function a(e,t,i,r,o){e.undoHistory.beginUndoMacro(o);for(let a=0;a<e.chartWidgetsDefs.length;a++){const l=e.chartWidgetsDefs[a].chartWidget;if(l===t)continue;const c=l.model();if(c){let t;if(r.isOnMainPane)t=Object(s.ensureNotNull)(c.model().paneForSource(l.model().model().mainSeries()));else{const i=new n(c.model(),r.paneIndex);e.undoHistory.pushUndoCommand(i);const o=Object(s.ensureDefined)(i.createdPaneId());t=Object(s.ensureDefined)(c.model().panes().find(e=>e.id()===o))}const a=c.pasteSourceFromClip(t,i,!0);if(a&&1===a.length){const e=a[0];if(r.asCompare){const i=Object(s.ensureNotNull)(c.mainSeries().priceScale());c.moveToScale(e,Object(s.ensureDefined)(t),i,o),c.setPriceScaleMode({percentage:!0},i,"")}}c.model().lightUpdate()}}e.undoHistory.endUndoMacro()}i.d(t,"applyIndicatorsToAllChartsImpl",(function(){return o})),i.d(t,"applyIndicatorToAllChartsImpl",(function(){return a}))},
|
||
E6p6:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"SessionStage",(function(){return s})),function(e){e[e.PRE_SESSION=-1]="PRE_SESSION",e[e.POST_SESSION=-2]="POST_SESSION",e[e.LASTBAR_SESSION=-3]="LASTBAR_SESSION"}(s||(s={}))},EJcV:function(e,t,i){"use strict";var s=i("rQHv"),r=i("ocLq"),n=i("8gnj"),o=i("XRI5").SymbolExtrapolator,a=i("ViuT").SessionTimeScale,l=i("gzUS").PointsetsManager,c=i("IiTo"),h=i("OLhd").createDwmAligner,u=i("LxhU").Interval,d=i("FQhm"),p=i("TlGQ").visitObject,_=i("ogJP").isObject;i("2cgs"),i("MrEN");var m=i("WIS0").DatafeedRequestsCachedProcessor,f=i("+6ja").timezoneIsAvailable,g=i("OLhd").isAlignmentEnabled,v=i("5fI3"),b=v.isEncodedExtendedSymbol,S=v.decodeExtendedSymbol,y=i("dUJ+").replaceGraphicsTimesWithTimePointIndexIndex,w=i("Kxc7");function C(e){var t=e.findIndex((function(e){return-5e6!==e.index}));return-1===t?[]:0===t?e:e.slice(t)}var P=function(e){var t=this;this._studiesCache={},this._objectsDataCache={},this._studiesNonSeriesTimes={},this._metainfoCache=[],this._barsCoefficientsCache={},this._externalDatafeed=e,e.getVolumeProfileResolutionForPeriod&&r.overwriteVolumeProfileResolutionForPeriodGetter((function(t,i,s,r){return e.getVolumeProfileResolutionForPeriod(t,i,s,r)})),this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,t._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),t._datafeedConfiguration=t._adoptConfigurationData(window.configurationData),t._fireEvent("configuration_received"),t._externalDatafeed.getServerTime&&t._externalDatafeed.getServerTime((function(e){t._serverTimeOffset=e-(new Date).valueOf()/1e3})),this._invalidatedPointsetSessions=new Set,this._refreshPointsetsTimerId=null,this._pointsetsManagers={},this._quotesInfo=[],this._depthInfo=[],this._endOfData={},this._computeStudyCounter=0,this._symbolExtrapolators={},this._timeScales={},this._cachedDatafeed=new m(e,this.serverTimeOffset.bind(this),this._datafeedConfiguration.reset_cache_timeout),n.setupFeed({resolve:function(e,i,s,r){t._resolveSymbolByName(e,i,s,r)},subscribe:function(e,i,s,r,n){return t._cachedDatafeed.subscribe(e,i,s,function(e,i,s){var r=new c.SessionInfo(e.timezone,e.session,e.holidays,e.corrections),n=c.newBarBuilder(i,r,r);return function(e){if(e&&e.count()){var i=1e3*t.getCurrentUTCTime();n.moveTo(i),n.indexOfBar(i)>=0&&e.setLastBarClosed(!1)}s(e)}}(e,i,r),n)},unsubscribe:function(e){return t._cachedDatafeed.unsubscribe(e)}})};function x(e,t){return e+"_"+t}P.prototype._getSymbolExtrapolator=function(e,t,i){var s=u.normalize(i),r=function(e,t,i){return e+","+t.full_name+","+i}(e,t,s),n=this._symbolExtrapolators[r];return void 0===n&&(n=new o(t,s),this._symbolExtrapolators[r]=n),n},P.prototype._barsCoefficients=function(e,t){if(void 0===S(e).type)return{};var i=e+t;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},P.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null,
|
||
Object.keys(this._pointsetsManagers).forEach((function(e){this._pointsetsManagers[e].destroy()}),this),this._pointsetsManagers={}},P.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={},this._objectsDataCache={},this._studiesNonSeriesTimes={},this._studiesCache={},Object.keys(this._pointsetsManagers).forEach((function(e){this._pointsetsManagers[e].destroy()}),this),this._pointsetsManagers={},Object.keys(this._timeScales).forEach((function(e){this._timeScales[e].destroy()}),this),this._timeScales={},Object.keys(this._symbolExtrapolators).forEach((function(e){this._symbolExtrapolators[e].destroy()}),this),this._symbolExtrapolators={}},P.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},P.prototype._logMessage=function(e){w.enabled("charting_library_debug_mode")&&console.log(e)},P.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},P.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){for(var s=this._callbacks[e],r=0;r<s.length;++r)s[r](t);i||(this._callbacks[e]=[])}},P.prototype._adoptConfigurationData=function(e){var t=TradingView.merge({},e),i=t.supported_resolutions;if(!i||0===i.length)return t.supported_resolutions=void 0,t;for(var s=[],r=0;r<i.length;r++){var n=i[r];if(-1!==s.indexOf(n))throw new Error("Duplicating resolution `"+n+"`");s.push(n)}return t.supported_resolutions=s,t},P.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},P.prototype.supportedCurrencies=function(){return this._datafeedConfiguration.currency_codes||[]},P.prototype.supportedUnits=function(){return this._datafeedConfiguration.units||[]},P.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},P.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},P.prototype.symbolsGrouping=function(){return this._datafeedConfiguration.symbols_grouping||{futures:/$a/}},P.prototype._findStudyObject=function(e){var t=e.split("@")[0],i=JSServer.studyLibrary.filter((function(i){return i.metainfo.id===e||i.metainfo.shortDescription===t}));return 0===i.length?null:i[0]},P.prototype.getMarks=function(e,t,i,s,r){var n={red:6,green:5,blue:4,yellow:3};if(this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks){this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,r,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var o=this;this._externalDatafeed.getMarks(e,t,i,(function(t){var i=t.map((function(e){return e.time=parseInt(e.time),e}));o._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,r,JSON.stringify(i)));var a=h(r,e),l=i.map((function(e){return e.tickmark=null!==a?a.timeToSessionStart(1e3*e.time)/1e3:e.time,e.direction=n[e.color],e.onClicked=function(){d.emit("onMarkClick",e.id)},e.label=!!e.label&&e.label[0],e}));s(l)}),r)}},
|
||
P.prototype.getTimescaleMarks=function(e,t,i,s,r){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,r,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var n=this;this._externalDatafeed.getTimescaleMarks(e,t,i,(function(t){n._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,r,JSON.stringify(t)));var i=h(r,e),o=t.map((function(e){return e.tickmark=null!==i?i.timeToSessionStart(1e3*e.time)/1e3:e.time,e}));s(o)}),r)}},P.prototype.getSeriesLastBarTime=function(e,t){var i=this._getSeriesData(e,t);return null===i||0===i.length?null:i[i.length-1].timeMs},P.prototype.getSeriesInterval=function(e,t){var i=this._studiesCache[e][t];return i?i.resolution:null},P.prototype.getSeriesSymbolInfo=function(e,t){var i=this._studiesCache[e][t];return i?i.symbolInfo:null},P.prototype.getSeriesInterval=function(e,t){var i=this._studiesCache[e][t];return i?i.resolution:null},P.prototype.getSeriesSymbolInfo=function(e,t){var i=this._studiesCache[e][t];return i?i.symbolInfo:null},P.prototype._getSeriesData=function(e,t){return this._objectsDataCache[x(e,t)]||null},P.prototype._computeStudy=function(e,t,i,s,n,o,a,l,c,d){var p=!0,_=[];null!==l&&(this._objectsDataCache[l]=null);var m=this._computeStudyCounter++;function f(e,t){if(e<c())return-5e6;if(0===t)return 0;var i=_[t-1].index;return-5e6===i?0:i+1}var v={},b=0,S=!1,y=this,C=function(c){if(!u.parse(s).isIntraday()||c.has_intraday){if(u.isDWM(s)&&void 0!==a.to){var m=h(s,c);null!==m&&(a.to=m.timeToExchangeTradingDay(a.to))}try{var C=new r.StudyEngine({tickerid:i,symbolInfo:c,period:s,body:t,sessionId:e,onErrorCallback:d.onErrorCallback,dataRange:a,forceAlignBars:!w.enabled("disable_sameinterval_aligning")&&g(),input:function(e){return o[e]},out:function(e,t){!function(e,t,i){for(var s=e.time,r="number"==typeof t?[t]:t,n=0;n<r.length;++n){var o=r[n];o&&"object"==typeof o&&(v["plot_"+n]=o.offset,o=o.value,b++),"number"==typeof o&&isNaN(o)&&(o=void 0),r[n]=o}var a=_.length-1,l=a<0||s>_[a].timeMs;l?_.push({index:f(s,_.length),value:[s/1e3].concat(r),timeMs:s}):(_[a].index=f(s,a),_[a].value=[s/1e3].concat(r),_[a].timeMs=s),p||d.onRealtimeCallback([_[_.length-1]],l,_.length,b>0?v:void 0,i)}(e,t,c)},nonseriesOut:function(e,t){d.onNonSeriesDataUpdate(t,c)},setNoMoreData:function(){S=!0},recalc:function(e,i){p=!1,_.endOfData=S,t.error&&null!==t.error()||(null!==l&&(y._objectsDataCache[l]=_),d.onDataReadyCallback(_,b>0?v:void 0,c,i))}});if(!y._studiesCache[e]||!y._studiesCache[e][n])throw Error("This should never happen");y._studiesCache[e][n].engine=C}catch(P){if(!P.studyError)throw P;d.onErrorCallback(P.message)}}else d.onErrorCallback("Unsupported resolution. Did you forget to set has_intraday to true?")},P=function(e){d.onErrorCallback(e)},x=function(){return y._studiesCache[e]&&y._studiesCache[e][n]&&y._studiesCache[e][n].activeResolve===m}
|
||
;y._studiesCache[e][n].activeResolve=m,this.resolveSymbol(i,(function(){x()&&C.apply(y,arguments)}),(function(){x()&&P.apply(y,arguments)}))},P.prototype._createStudy=function(e,t,i,s,r,n,o,a){var l=this;function c(e,t,i){e=C(e),l._timeScales[s].fillIndexesInRows(e),TradingView.ChartapiMessagerInstances[s].onDataUpdate(r,n,e,t),TradingView.ChartapiMessagerInstances[s].onStudyCompleted(r,n)}a=function(e){if(Array.isArray(e))return e;for(var t=[],i=l._studiesCache[s][r].metainfo.inputs,n=0;n<i.length;n++)t[n]=e[i[n].id];return t}(a),TradingView.ChartapiMessagerInstances[s].onStudyLoading(r,n);var h=null,u=!1;l._computeStudy(s,i,e,t,r,a,this._seriesDataRange(s,o),null,(function(){if(null===h){var e=l._getSeriesData(s,o)[0];if(void 0===e)return 1/0;h=e.timeMs}return h}),{onDataReadyCallback:function(e,t,i){u&&0===e.length||c(e,t?{data:{offsets:t}}:{})},onRealtimeCallback:function(e,t,i,o,a){e=C(e),l._timeScales[s].fillIndexesInRows(e);var c=o?{data:{offsets:o}}:{};TradingView.ChartapiMessagerInstances[s].onDataUpdate(r,n,e,c)},onErrorCallback:function(e){TradingView.ChartapiMessagerInstances[s].onStudyError(r,n,e)},onNonSeriesDataUpdate:function(e,t){switch(u=!0,e.type){case"projection":break;case"study_graphics":var i={data:e.data,indexes:[]},n=y(i);l._studiesNonSeriesTimes[s][r]=n,i.indexes=l._timeScales[s].convertTimesToIndexes(n),c([],i);break;case"non_series_data":n=function(e){var t={};p(e,(function(e){_(e)&&Object.keys(e).forEach((function(i){i.endsWith("__t")&&(t[e[i]]=!0)}))}),{visitInstances:!0});var i=Object.keys(t).map(Number).sort((function(e,t){return e-t}));return i.forEach((function(e,i){t[e]=i})),Object.assign(e,p(e,(function(e){return _(e)&&Object.keys(e).forEach((function(i){i.endsWith("__t")&&(e[i.slice(0,-3)]=t[e[i]])})),e}),{visitInstances:!0})),i}(i={data:e.data,indexes:[]});l._studiesNonSeriesTimes[s][r]=n,i.indexes=l._timeScales[s].convertTimesToIndexes(n),c([],i);break;default:console.warn("unsupported non-series data type for study "+e.type)}}})},P.prototype.onMainSeriesError=function(e){this.stopSources(e),this._mainSeriesRecord(e).error=!0,this._applyTimeScaleUpdate(e,this._timeScales[e].clearTimeScale())},P.prototype.modifySeries=function(e,t,i,s,r){var n=this._mainSeriesRecord(e);if(n.guid!==t){if(n.error)return this._studiesCache[e][t].requestedSymbol=i,this._studiesCache[e][t].resolution=s,void(this._studiesCache[e][t].turnaround=r);for(var o in this._stopSourcesTree(e,t),this.createSeries(i,s,e,t,r,{countBack:0},!0),this._studiesCache[e]){var a=this._studiesCache[e][o];if(a&&"study"===a.type&&a.parentId===t){this._studiesNonSeriesTimes[e][o]=null;var l=this._studiesCache[e][a.parentId];this._createStudy(l.requestedSymbol,l.resolution,a.studyObject,e,o,a.turnaround,a.parentId,a.inputs)}}}else this._modifyMainSeries(e,i,s,r)},P.prototype._modifyMainSeries=function(e,t,i,s){this.stopSources(e);var r=this._mainSeriesRecord(e);for(var n in this._studiesCache[e]){(o=this._studiesCache[e][n])&&"series"===o.type&&(o.guid===r.guid?this.createSeries(t,i,e,r.guid,s,{countBack:0
|
||
},!0):this.createSeries(o.requestedSymbol,i,e,o.guid,o.turnaround,{countBack:0},!0))}for(var n in this._studiesCache[e]){var o;if((o=this._studiesCache[e][n])&&"study"===o.type){this._studiesNonSeriesTimes[e][n]=null;var a=this._studiesCache[e][o.parentId];this._createStudy(a.requestedSymbol,a.resolution,o.studyObject,e,n,o.turnaround,o.parentId,o.inputs)}}this._applyTimeScaleUpdate(e,this._timeScales[e].clearTimeScale())},P.prototype.stopSources=function(e){for(var t in this._studiesCache[e]){var i=this._studiesCache[e][t];i&&"series"===i.type&&this._stopSourcesTree(e,t)}},P.prototype._stopSourcesTree=function(e,t){for(var i in this._studiesCache[e]){var s=this._studiesCache[e][i];s&&(("series"===s.type&&i===t||"study"===s.type&&s.parentId===t)&&(s.engine&&s.engine.isStarted()&&s.engine.stop(),s.activeResolve=-1))}n.unsubscribeUnused()},P.prototype._recreateSourcesForDataRange=function(e,t){var i=[];for(var s in this._studiesCache[e]){(r=this._studiesCache[e][s])&&"series"===r.type&&!this._isEndOfData(e,s,r.turnaround)&&(this._stopSourcesTree(e,s),i.push(s))}for(var s in i.forEach((function(i){this._startSourcesTree(e,i,Object.assign({},t))}),this),this._studiesCache[e]){var r;"series"===(r=this._studiesCache[e][s]).type&&this._isEndOfData(e,s,r.turnaround)&&TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(s,r.turnaround,r.engine.runner.host.symbolInfo.data_status)}this._updateTimeScaleState(e)},P.prototype._startSourcesTree=function(e,t,i){var s=this._studiesCache[e][t];for(var r in this.createSeries(s.requestedSymbol,s.resolution,e,t,s.turnaround,i,!0),this._studiesCache[e]){var n=this._studiesCache[e][r];n&&"study"===n.type&&n.parentId===t&&this._createStudy(s.requestedSymbol,s.resolution,n.studyObject,e,r,n.turnaround,n.parentId,n.inputs)}},P.prototype.removeStudy=function(e,t){this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),n.unsubscribeUnused()),delete this._studiesCache[e][t],delete this._studiesNonSeriesTimes[e][t]},P.prototype.removeSeries=function(e,t){this._stopSourcesTree(e,t),delete this._studiesCache[e][t],this._updateMainTsBuilder(e),this._timeScales[e].isCompleted()&&this._timeScales[e].setCompleted(!1);var i=this._timeScales[e].setSeriesBarsTimes(t,[]);this._applyTimeScaleUpdate(e,i),this._updateTimeScaleState(e)},P.prototype.recomputeStudy=function(e,t,i,s){var r=this._studiesCache[i][e];if(!r)throw Error("This should never happen");var o=this._studiesCache[i][r.parentId];r.inputs=t,r.turnaround=s,r.engine&&(r.engine.stop(),n.unsubscribeUnused()),this._studiesNonSeriesTimes[i][e]=null,this._createStudy(o.requestedSymbol,o.resolution,r.studyObject,i,e,s,r.parentId,t)},P.prototype.createStudy=function(e,t,i,s,r,n){var o=this._studiesCache[e][i],a=this._findStudyObject(r);if(null===a)return console.warn("Study does not exist: "+r),void TradingView.ChartapiMessagerInstances[e].onStudyError(t,s,"unknown study name");var l=new a.constructor;this._studiesCache[e]=this._studiesCache[e]||{},this._studiesCache[e][t]={
|
||
studyObject:l,guid:t,type:"study",inputs:n,metainfo:a.metainfo,turnaround:s,parentId:i},this._studiesNonSeriesTimes[e][t]=null,this._createStudy(o.requestedSymbol,o.resolution,l,e,t,s,i,n)},P.prototype.sessionTimeScale=function(e){return this._timeScales[e]||null},P.prototype.isTimeScaleExtendedTo=function(e,t){var i=this._mainSeriesRecord(e);if(u.isDWM(i.resolution)&&null!=i.symbolInfo){var s=h(i.resolution,i.symbolInfo);null!==s&&(t=s.timeToSessionStart(t))}var r=this._timeScales[e].indexOfTime(t);return null!==r&&r.index>=0},P.prototype.ensureExtendedTo=function(e,t,i){if(!this._studiesCache[t][e])throw Error("This should never happen");var s=this;setTimeout((function(){s._recreateSourcesForDataRange(t,{to:i})}),0)},P.prototype.extendSeriesRange=function(e,t){var i=this._timeScales[e].firstSeriesBarTime();if(null!==i){var s=this._mainSeriesRecord(e);if(u.isDWM(s.resolution)&&null!=s.symbolInfo){var r=h(s.resolution,s.symbolInfo);null!==r&&(i=r.timeToExchangeTradingDay(i))}var n=this._barsCoefficients(s.requestedSymbol,s.resolution),o=n.barsCoefficient||1;if(!n.barsCoefficient){var a=this._getSeriesData(e,s.guid);null!==a&&(n.expectedBarsCount=a.length+t)}var l=this;setTimeout((function(){l._recreateSourcesForDataRange(e,{to:i,countBack:(t+2)*o})}),0)}else this._logMessage("Nothing to extend - there is no points on time scale")},P.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},P.prototype._seriesDataRange=function(e,t){var i=this._studiesCache[e][t];return null!==i.firstLoadedTimeMs?{to:i.firstLoadedTimeMs,countBack:0}:i.dataRange},P.prototype._applyTimeScaleUpdate=function(e,t){if(null!==t){var i=[];for(var s in this._studiesCache[e]){var r=this._studiesCache[e][s];if(r&&"study"===r.type){var n=this._studiesNonSeriesTimes[e][s];if(n){var o={indexes:this._timeScales[e].convertTimesToIndexes(n),data:{indexes_replace:!0}};i.push({objId:s,turnaround:r.turnaround,data:[],nonSeriesData:o})}}}TradingView.ChartapiMessagerInstances[e].onTimescaleUpdate(t,i),Promise.resolve().then(function(){var t=this._mainSeriesRecord(e);if(null!==t&&null!=t.symbolInfo){var i=this._getSymbolExtrapolator(e,t.symbolInfo,t.resolution);this._pointsetsManagers[e].getUpdatesForSymbol(t.symbolInfo.full_name,t.resolution,i,this._timeScales[e]).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t)}))}}.bind(this))}},P.prototype._updateMainTsBuilder=function(e){var t=this._mainSeriesRecord(e);if(null!==t&&null!=t.symbolInfo){var i=this._getSymbolExtrapolator(e,t.symbolInfo,t.resolution);this._timeScales[e].setMainSymbolExtrapolator(i)}},P.prototype._updateTimeScaleState=function(e){var t=!0,i=!0;for(var s in this._studiesCache[e]){var r=this._studiesCache[e][s];"series"===r.type&&(i=i&&this._isEndOfData(e,s,r.turnaround),t=t&&r.completed)}this._timeScales[e].isCompleted()!==t&&(this._timeScales[e].setCompleted(t),t&&TradingView.ChartapiMessagerInstances[e].onTimescaleCompleted(i))},
|
||
P.prototype._mainSeriesRecord=function(e){var t=null,i=null;for(var s in this._studiesCache[e]){var r=this._studiesCache[e][s];if("series"===r.type&&(null===t&&(t=r),r.isMain)){i=r;break}}return null===i&&(i=t),null!==i&&(i.isMain=!0),i},P.prototype._seriesCount=function(e){var t=0;for(var i in this._studiesCache[e]){"series"===this._studiesCache[e][i].type&&(t+=1)}return t},P.prototype._prepareSeriesNonSeriesData=function(e,t,i){var s=i.data[i.data.length-1],r=this._getSeriesData(e,t),n=null===r?[]:i.data;return{data:{data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:s?s[4]:i.price,bars:n.map((function(e,t){return{time:t,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],factor:e[6],additionalPrice:e[6]}}))}},indexes:this._timeScales[e].convertTimesToIndexes(n.map((function(e){var t=e[0]||0;return t<0?r[r.length+t].timeMs:i.projectionTime+t})))}},P.prototype.createSeries=function(e,t,i,s,n,o,a){this._setEndOfData(i,s,n,!1);var l=new r.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{};var c=this._getSeriesData(i,s),h=this._studiesCache[i][s],d=this._seriesCount(i),p=this._mainSeriesRecord(i);if(!h||u.isEqual(h.resolution,t)&&h.requestedSymbol===e)void 0!==o.countBack&&null!==c&&0!==c.length&&(o.to=c[0].timeMs),h&&null!=h.firstLoadedTimeMs?o.to=void 0!==o.to?Math.min(h.firstLoadedTimeMs,o.to):h.firstLoadedTimeMs:h||0===d||null!==p&&(null!=p.firstLoadedTimeMs?(o.to=p.firstLoadedTimeMs,o.countBack=0):o=Object.assign({},p.dataRange));else if(1===d)void 0!==o.countBack&&null!==c&&(o.countBack+=c.length);else{var _=this._timeScales[i].firstSeriesBarTime();(void 0===o.to||null!==_&&_<o.to)&&(o.to=_,o.countBack=0)}if(void 0===o.countBack&&(o.countBack=0),void 0===o.to&&0===o.countBack&&(o.countBack=100),this._studiesCache[i][s]={requestedSymbol:e,resolution:t,studyObject:l,guid:s,type:"series",turnaround:n,dataRange:o,firstLoadedTimeMs:null,symbolInfo:null,isMain:h&&h.isMain||0===d,completed:!1},null===p||p.guid===s||!p.error){this._updateMainTsBuilder(i),this._updateTimeScaleState(i),TradingView.ChartapiMessagerInstances[i].onSeriesLoading(s,n);var m=this;this._computeStudy(i,l,e,t,s,[],o,x(i,s),(function(){return-1/0}),{onDataReadyCallback:function(r,o,l,c){var h=m._studiesCache[i][s];if(!h)throw Error("This should never happen");if(h.symbolInfo=l,h.firstLoadedTimeMs=c.firstLoadedTimeMs,h.completed=!0,m._updateMainTsBuilder(i),a&&m._pointsetsManagers[i].invalidatePointsetsForSymbol(l.full_name,t),0!==r.length){var u=m._barsCoefficients(e,t);u.expectedBarsCount&&u.barsCount&&(u.barsCoefficient=Math.min(Math.max(u.barsCoefficient||1,parseInt(u.expectedBarsCount/(r.length-u.barsCount)+.5)),100)),u.barsCount=r.length,m._clearSeriesData(i,s)}else!c.endOfData&&h.isMain&&setTimeout((function(){m._studiesCache[i]&&m._recreateSourcesForDataRange(i,{countBack:10})}),0);f(l),c.endOfData&&(m._logMessage("Series has no more data on server: {0}".format(l.full_name)),m._setEndOfData(i,s,n)),0===r.length&&m._clearSeriesData(i,s),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(s,n,l.data_status),
|
||
m._updateTimeScaleState(i)},onRealtimeCallback:function(e,t,r,o,a){f(a,e),m._timeScales[i].fillIndexesInRows(e);var l=e[e.length-1];if(t){if(!m._studiesCache[i][s])throw Error("This should never happen");m._logMessage("New bar arrived: symbol {0}, bar {1}".format(a.full_name,JSON.stringify(l)))}else m._logMessage("Last bar update: symbol {0}, bar {1}".format(a.full_name,JSON.stringify(l))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(s,n,e,null);m._fireEvent("realtime_tick",e[e.length-1],!0)},onErrorCallback:function(e){var t=m._studiesCache[i][s];t.completed=!0,m._logMessage("Series error: {0}".format(e)),TradingView.ChartapiMessagerInstances[i].onSeriesError(s,n,e),w.enabled("clear_bars_on_series_error")&&(t.isMain?m.onMainSeriesError(i):m._clearSeriesData(i,s))},onNonSeriesDataUpdate:function(e,t){if("projection"!==e.type)throw new Error("unexpected non-series data type for series "+e.type);var r=m._getSeriesData(i,s);if(null!==r)f(t,0===r.length?void 0:[r[r.length-1]],e);else{e=m._prepareSeriesNonSeriesData(i,s,e);TradingView.ChartapiMessagerInstances[i].onDataUpdate(s,n,[],e)}}})}function f(e,r,o){var a=[];if(void 0!==o){var l=(o.data||[]).reduce((function(e,t){return Math.max(e,t[0]||0)}),-1);if(null!=o.projectionTime)for(var c=0;c<=l;++c)a.push(o.projectionTime+c)}var h=null,u=null,d=e?m._getSymbolExtrapolator(i,e,t):null;if(void 0!==r){var p=r.map((function(e){return e.timeMs})).concat(a);null!==d&&d.replaceBarsTimesTail(p,r.length),u=m._timeScales[i].replaceSeriesBarsTimesTail(s,p),h=r}else{var _=m._getSeriesData(i,s)||[],f=_.map((function(e){return e.timeMs})).concat(a);null!==d&&d.setBarsTimes(f,_.length),u=m._timeScales[i].setSeriesBarsTimes(s,f),h=_}if(m._applyTimeScaleUpdate(i,u),0!==h.length||void 0!==o){m._timeScales[i].fillIndexesInRows(h);var g=void 0!==o?m._prepareSeriesNonSeriesData(i,s,o):null;TradingView.ChartapiMessagerInstances[i].onDataUpdate(s,n,h,g)}}},P.prototype._clearSeriesData=function(e,t){var i={};for(var s in i[t]={turnaround:this._studiesCache[e][t].turnaround},this._studiesCache[e]){var r=this._studiesCache[e][s];"study"===r.type&&r.parentId===t&&(i[s]={turnaround:r.turnaround})}TradingView.ChartapiMessagerInstances[e].onClearData(i)},P.prototype.requestMoreTickmarks=function(e,t){var i=this._timeScales[e];i.setMinFutureBarsCount(i.minFutureBarsCount()+t);var s=i.firstFutureBarIndex(),r=i.tickMarks(s);TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(s,r)},P.prototype.chartCreateSession=function(e){this._pointsetsManagers[e]=new l,this._timeScales[e]=new a,this._studiesNonSeriesTimes[e]={}},P.prototype.chartDeleteSession=function(e){this._pointsetsManagers[e].destroy(),delete this._pointsetsManagers[e],this._timeScales[e].destroy(),delete this._timeScales[e],delete this._studiesNonSeriesTimes[e]},P.prototype.removePointset=function(e,t){this._pointsetsManagers[e].removePointset(t)},P.prototype.createPointset=function(e,t,i,s,r){var n=this._getSymbolExtrapolator(e,i,s);if(this._pointsetsManagers[e].createPointset(t,i.full_name,s,r,n),
|
||
null===this._refreshPointsetsTimerId){var o=this;this._refreshPointsetsTimerId=setTimeout((function(){o._refreshPointsetsTimerId=null,o._refreshPointsets(o._invalidatedPointsetSessions),o._invalidatedPointsetSessions.clear()}),0)}this._invalidatedPointsetSessions.add(e)},P.prototype._refreshPointsets=function(e){var t=this;e.forEach((function(e){var i=t._studiesCache[e];if(null!=i){var s=null;for(var r in i){var n=i[r];if("series"===n.type){s=n;break}}if(null!==s&&null!=s.symbolInfo){var o=t._getSymbolExtrapolator(e,s.symbolInfo,s.resolution);t._pointsetsManagers[e].getUpdatesForSymbol(s.symbolInfo.full_name,s.resolution,o,t._timeScales[e]).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t)}))}}}))},P.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map((function(e){return e.metainfo})),this._metainfoCache.push({palettes:{},inputs:[],plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"},{id:"volume",type:"line"}],graphics:{},_metainfoVersion:48,description:"Unnamed Study",format:{type:"inherit"},is_hidden_study:!0,is_price_study:!1,shortDescription:"Unnamed Study",description_localized:"Unnamed Study",id:"BarSetHeikenAshi@tv-prostudies",shortId:"BarSetHeikenAshi",packageId:"tv-basicstudies",version:"13",fullId:"BarSetHeikenAshi@tv-basicstudies-13",productId:"tv-basicstudies",name:"BarSetHeikenAshi@tv-basicstudies"})),this._metainfoCache},P.prototype.searchSymbols=function(e,t,i,s){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,(function(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),s(e)}))},P.prototype.resolveSymbol=function(e,t,i){b(e)||console.error("Expect to get symbol encoded string, but got the following instead: "+e);var s=S(e),r="string"==typeof s.symbol?s:s.symbol,n=r.symbol,o=r["currency-id"],a=r["unit-id"];this._resolveSymbolByName(n,{currency:o,unit:a},t,i)},P.prototype._resolveSymbolByName=function(e,t,i,s){var r,n=t&&t.currency,o=t&&t.unit,a=e+(n?"_#_"+n:"")+(o?"_#_"+o:"");this._resolveRequests[a]?r=this._resolveRequests[a]:(r=this._resolveSymbolInternal(e,n||void 0,o||void 0),this._resolveRequests[a]=r),r.then(i).catch(s)},P.prototype._resolveSymbolInternal=function(e,t,i){var s=this;return new Promise(function(r,n){this._logMessage("Symbol resolve requested: `{0}` ".format(e));var o=!0;this._externalDatafeed.resolveSymbol(e,(function(t){o&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),s._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(t))),function(e){if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),
|
||
e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.currency_code&&(e.currency_id=e.currency_code),e.original_currency_code&&(e.original_currency_id=e.original_currency_code),e.supported_resolutions)for(var t=0;t<e.supported_resolutions.length;t++){var i=u.parse(e.supported_resolutions[t]);i.isValid()&&(e.supported_resolutions[t]=i.value())}}(t),function(e){function t(e){console.warn("SymbolInfo validation: "+e)}if(e.has_empty_bars&&!g()&&t('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&t("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&t("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||t("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||t("session must be non-empty string"),void 0===e.timezone||0===e.timezone.length?t("timezone must be non-empty string"):"exchange"!==e.timezone&&f(e.timezone)||"UTC"!==e.timezone&&t('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers){var i=e.intraday_multipliers;if(Array.isArray(i))for(var s=0;s<i.length;++s)"string"!=typeof i[s]&&t('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(s+1,i[s],typeof i[s]));else t("intraday_multipliers must be array")}(e.supported_resolutions||[]).filter((function(e){return!u.isValid(e)})).forEach((function(e){t("supported_resolutions field contains invalid value: "+e)}))}(t),s._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(t))),r(t)}),(function(t){s._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,t)),n(t)}),{currencyCode:t,unitId:i}),o=!1}.bind(this))},P.prototype._createMarketStatusWatchers=function(e,t){void 0===this._marketStatusWatchers[e]&&(this._marketStatusWatchers[e]={});var i=this;t.forEach((function(t){void 0===i._marketStatusWatchers[e][t]&&(i._marketStatusWatchers[e][t]=new s(i._resolveSymbolByName.bind(i),e,t))}))},P.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach((function(i){t._marketStatusWatchers[e][i].stop()})),this._marketStatusWatchers[e]={}},P.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},P.prototype._startQuotesSubscription=function(e){var t={},i=this;function s(t,s){var r=i._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||r&&r.marketStatus(),t.values.pricescale=s.pricescale,t.values.minmov=s.minmov,t.values.minmove2=s.minmove2||0,t.values.fractional=s.fractional||!1,
|
||
r&&t.v.cs&&r.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}function r(e){e.forEach((function(e){void 0!==t[e.n]?null!==t[e.n]&&s(e,t[e.n]):i._resolveSymbolByName(e.n,null,(function(i){t[e.n]=i,s(e,i)}),(function(){t[e.n]=null}))}))}var n=this._quotesInfo[e].symbols;0!==n.length&&(this._externalDatafeed.getQuotes&&!w.enabled("charting_library")?this._externalDatafeed.getQuotes(n,(function(t){i._quotesInfo[e]&&(r(t),i._quotesInfo[e].listenerGUID=e,i._externalDatafeed.subscribeQuotes(n,i._quotesInfo[e].fastSymbols,r,i._quotesInfo[e].listenerGUID))}),(function(e){})):!this._externalDatafeed.getQuotes&&w.enabled("trading_terminal")&&setTimeout((function(){r(n.map((function(e){return{n:e,s:"ok",v:{}}})))})),this._createMarketStatusWatchers(e,n))},P.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},P.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},P.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},P.prototype.quoteSetFields=function(e,t){},P.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},P.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter((function(e){return t.indexOf(e)<0})),this._restartQuotesSubscription(e)},P.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},P.prototype.quoteHibernateAll=function(e){},P.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},P.prototype._startDepthSubscription=function(e){var t=this,i=this._depthInfo[e].symbol;function s(e){return e.map((function(e){return{p:e.price,v:e.volume}}))}function r(e){var t={};return t.s=i,t.bids=s(e.bids),t.asks=s(e.asks),t}i&&this._externalDatafeed.subscribeDepth&&(t._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(i,(function(i){var s;t._depthInfo[e]&&((s=i).snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([r(s)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([r(s)])))})))},P.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},P.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},P.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},P.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},P.prototype._filteredSymbols=function(e){var t=[];return e.forEach((function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)})),t},P.prototype._isEndOfData=function(e,t,i){var s=e+"!"+t+"@"+i
|
||
;return!!this._endOfData[s]},P.prototype._setEndOfData=function(e,t,i,s){var r=e+"!"+t+"@"+i;this._endOfData[r]=!1!==s},P.prototype.serverTimeOffset=function(){return this._serverTimeOffset},P.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},P.prototype.switchTimezone=function(e,t){this._timeScales[e].setTimezone(t);var i=this._timeScales[e].tickMarks();null!==i&&TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(0,i)},e.exports=P},EX27:function(e,t,i){"use strict";var s=i("IiTo"),r=i("LxhU").Interval,n=i("EJcV"),o=i("MrEN"),a=i("XzZr"),l=a.ChartApiInterface,c=a.HandlerInfo,h=i("ogJP").requireFullInterfaceImplementation,u=i("txPx").getLogger("Chart.ChartApiLocal"),d=i("uDHo").TIMEFRAMETYPE,p=i("OLhd").createDwmAligner;function _(e,t,i){if(e[t])if(void 0!==i)e[t][i]&&(clearTimeout(e[t][i]),delete e[t][i]);else{for(var s in e[t])e[t].hasOwnProperty(s)&&_(e,t,s);delete e[t]}}function m(e,t,i,s){_(e,t,i),e[t]||(e[t]={}),e[t][i]=s}TradingView.STUDY_COUNT_LIMIT=210,JSServer.ChartApi=function(e){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._seriesTimers={},this._studyTimers={},this._seriesTurnarounds={},this._connected=!1,this._enabled=!1,this._studyEngine=new n(e),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0;var t=this;this._studyEngine.on("configuration_received",(function(){t._fireEvent("configuration_received")})),this._studyEngine.on("realtime_tick",(function(e){var i={time:e.value[0]/1e3,open:e.value[1],high:e.value[2],low:e.value[3],close:e.value[4],volume:e.value[5]};t._fireEvent("realtime_tick",i,!0)})),this._setVisibleRangeTimeout={}},JSServer.ChartApi.prototype._makeSymbolKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype._makeSeriesKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(e){this._studyEngine.purgeCache(),this._studyEngine.purgeDataCache(),this._symbolIdCache={},this._seriesIdCache={}},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(e){this._enabledMoreBarsRequest=e},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||["1","3","5","15","30","45","60","120","180","240","1D","1W","1M"]},JSServer.ChartApi.prototype.availableCurrencies=function(){var e=this._studyEngine.supportedCurrencies().map((function(e){return{id:e,code:e,convertible:!0}}));return Promise.resolve(e)},JSServer.ChartApi.prototype.availableUnits=function(){return Promise.resolve(this._studyEngine.supportedUnits())},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},
|
||
JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.symbolsGrouping=function(){return this._studyEngine.symbolsGrouping()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(e){this._enableLogging&&console.log(e)},JSServer.ChartApi.prototype.unsubscribe=function(e,t){var i=this._callbacks[e];i&&i.splice(i.indexOf(t),1)},JSServer.ChartApi.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},JSServer.ChartApi.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){var s=this._callbacks[e].slice(0);i||(this._callbacks[e]=[]);for(var r=0;r<s.length;++r)s[r](t)}},JSServer.ChartApi.prototype.chartCreateSession=function(e,t){this._studyEngine.chartCreateSession(e),this._seriesTurnarounds[e]={}},JSServer.ChartApi.prototype.chartDeleteSession=function(e){this._studyEngine.chartDeleteSession(e)},JSServer.ChartApi.prototype.createSession=function(e,t){TradingView.ChartapiMessagerInstances[e]=new o(this,e),this._sessions[e]=t,this._notificationHandlers[e]={},this.connected()&&t.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(e){delete this._sessions[e],delete this._notificationHandlers[e],this._studyEngine.stopSources(e),_(this._seriesTimers,e),_(this._studyTimers,e)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(this._enabled)this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}));else{var e=this;this.on("start_enabled",(function(){e.connect()}))}},JSServer.ChartApi.prototype.disconnect=function(){this._connected=!1,this._notifySessions({method:"disconnected",params:[]}),this.purgeCache(),this.studyCounter=0},JSServer.ChartApi.prototype.switchTimezone=function(e,t){this._studyEngine.switchTimezone(e,t)},JSServer.ChartApi.prototype.receiveLocalResponse=function(e){this._logMessage("< "+e.method),this._dispathNotification(e),this._fireEvent("message_"+e.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(e,t,i,s,r){this._studyEngine.getMarks(e,t,i,s,r)},JSServer.ChartApi.prototype.getTimescaleMarks=function(e,t,i,s,r){this._studyEngine.getTimescaleMarks(e,t,i,s,r)},JSServer.ChartApi.prototype.resolveSymbol=function(e,t,i,s,r){this._notificationHandlers[e][t]=new c(s,t),this._symbolIdCache[this._makeSymbolKey(e,t)]=null;var n=this;function o(t,s){void 0!==Object.keys(n._seriesIdCache).find((function(e){return n._seriesIdCache[e].symbolId===t}))&&n._studyEngine.onMainSeriesError(e),TradingView.ChartapiMessagerInstances[e].onSymbolError(t,s),n._symbolIdCache[n._makeSymbolKey(e,t)]={requestedSymbol:i,status:"invalid_symbol"},n._fireEvent("resolve_fail",{session:e,symbolId:t},!0),n._fireEvent(n._makeSymbolKey(e,t)+"_resolve_fail")}
|
||
this._studyEngine.resolveSymbol(i,(function(s){s.errmsg?o(t,s.errmsg):(n._symbolIdCache[n._makeSymbolKey(e,t)]={requestedSymbol:i,symbolInfo:s,status:"ok"},n._fireEvent("symbol_resolved",{symbolInfo:s,symbolId:t,session:e},!0),n._fireEvent(n._makeSymbolKey(e,t)+"_resolved",s),TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,s))}),(function(e){o(t,e)}))},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(e,t,i){var s=this,r=!0;function n(){r&&(i({requestedSymbol:s._symbolIdCache[s._makeSymbolKey(e,t)].requestedSymbol,symbolInfo:s._symbolIdCache[s._makeSymbolKey(e,t)].symbolInfo}),r=!1,s.unsubscribe(s._makeSymbolKey(e,t)+"_resolved",n),s.unsubscribe(s._makeSymbolKey(e,t)+"_resolve_fail",n))}this._symbolIdCache[this._makeSymbolKey(e,t)]?n():(this.on(this._makeSymbolKey(e,t)+"_resolved",n),this.on(this._makeSymbolKey(e,t)+"_resolve_fail",n))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(e,t){TradingView.ChartapiMessagerInstances[e].seriesCompleted.subscribe(null,t,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(e,t,i,s){var r=this,n=this._seriesIdCache[e+"_"+t].symbolId;function o(){var t;i({requestedSymbol:(t=r._symbolIdCache[r._makeSymbolKey(e,n)]).requestedSymbol,symbolInfo:t.symbolInfo})}function a(){r.unsubscribe("symbol_resolved",c),r.unsubscribe("resolve_fail",l)}function l(t){t.symbolId===n&&t.session===e&&(a(),s&&s())}function c(t){t.symbolId===n&&t.session===e&&(a(),o())}this._symbolIdCache[this._makeSymbolKey(e,n)]?o():(this.on("symbol_resolved",c),this.on("resolve_fail",l))},JSServer.ChartApi.prototype.createSeries=function(e,t,i,s,r,n,o,a){i=i||"";var l=this;this._notificationHandlers[e][t]=new c((function(r){"series_completed"===r.method&&null!==o&&(l._applyTimeFrame(e,s,t,i,o),o=null),a(r)}),t),this._seriesIdCache[e+"_"+t]={symbolId:s,resolution:r,timeframe:o,turnaround:i},this._seriesTurnarounds[e][t]=i,this._doWhenSeriesSymbolIdIsReady(e,t,(function(s){l._seriesTurnarounds[e][t]===i&&l._studyEngine.createSeries(s.requestedSymbol,r,e,t,i,{countBack:n||300})}))},JSServer.ChartApi.prototype.removeSeries=function(e,t,i){this._notificationHandlers[e][t]=new c(i,t),this._studyEngine.removeSeries(e,t),_(this._seriesTimers,e,t)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(e,t,i,s,r,n){var o=i,a=!0!==(r=r||{}).applyDefaultRightMargin&&void 0===r.percentRightMargin&&void 0!==s?s:null,l=p(this._studyEngine.getSeriesInterval(e,t),this._studyEngine.getSeriesSymbolInfo(e,t));null!==l&&(o=l.timeToSessionStart(1e3*o)/1e3,null!==a&&(a=l.timeToSessionStart(1e3*a)/1e3));var c=this._seriesIdCache[e+"_"+t].turnaround,h=this;function u(){var i=h._studyEngine.sessionTimeScale(e);if(null!==i){var s,l=i.indexOfTime(1e3*o);if(null===a)s=i.lastSessionBarIndex();else{var u=i.indexOfTime(1e3*a);s=u&&u.index}if(null!==l&&null!==s){var d=l.index;l.timeMs<1e3*o&&(d+=1),d>s||(TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(t,c,d,s,r),n&&setTimeout(n,0))}}}if(this._studyEngine.isTimeScaleExtendedTo(e,1e3*i))u();else{
|
||
var d=TradingView.ChartapiMessagerInstances[e].seriesCompleted,_=TradingView.ChartapiMessagerInstances[e].seriesError;void 0!==this._setVisibleRangeTimeout[e]&&clearTimeout(this._setVisibleRangeTimeout[e]),this._setVisibleRangeTimeout[e]=setTimeout(function(){delete this._setVisibleRangeTimeout[e],d.subscribe(null,m,!0),_.subscribe(null,f,!0),this._studyEngine.ensureExtendedTo(t,e,1e3*i)}.bind(this),0)}function m(e,i){e===t&&i===c&&(d.unsubscribe(null,m),_.unsubscribe(null,f),u())}function f(e,i){e===t&&i===c&&d.unsubscribe(null,m)}},JSServer.ChartApi.prototype._applyTimeFrame=function(e,t,i,n,o){var a,l;if(o.type===d.PeriodBack){var c=this._studyEngine.getSeriesLastBarTime(e,i);if(null===c)return;l=c/1e3;var h=r.parse(o.value),u=this._symbolIdCache[this._makeSymbolKey(e,t)].symbolInfo;a=s.alignPeriodsBackForVisibleRange(u.session,u.holidays,u.corrections,h.letter(),h.multiplier(),1,c)/1e3;var _=p(this._studyEngine.getSeriesInterval(e,i),u);null!==_&&(l=_.timeToExchangeTradingDay(1e3*l)/1e3,a=_.timeToExchangeTradingDay(1e3*a)/1e3)}else a=o.from,l=o.to;this.setVisibleTimeRange(e,i,a,l,{applyDefaultRightMargin:!0})},JSServer.ChartApi.prototype.modifySeries=function(e,t,i,s,r,n,o,a){i=i||"";var l=this;this._notificationHandlers[e][t]=new c((function(r){"series_completed"===r.method&&null!==n&&(l._applyTimeFrame(e,s,t,i,n),n=null),o(r)}),t),this._seriesTurnarounds[e][t]=i,a&&(this._seriesIdCache[this._makeSeriesKey(e,a)]=null),this._seriesIdCache[this._makeSymbolKey(e,t)]={symbolId:s,resolution:r,turnaround:i},this._doWhenSeriesSymbolIdIsReady(e,t,(function(s){l._studyEngine.modifySeries(e,t,s.requestedSymbol,r,i)}))},JSServer.ChartApi.prototype.requestMoreData=function(e,t){if(this._enabledMoreBarsRequest){var i=this,s=setTimeout((function(){i._studyEngine.extendSeriesRange(e,t)}),0);m(this._seriesTimers,e,"requestMoreData",s)}},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.setWatchlistSettings=function(e){this._watchlistSettings=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(e,t,i){this._notificationHandlers[e][t]=new c(i,t);var s=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[e].onRequestMetadata(t,s)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(e,t,i,s,r,n,o){if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");var a=this;i=i||"",this._notificationHandlers[e][t]=new c(o,t);var l=this._seriesIdCache[this._makeSeriesKey(e,s)].symbolId;this._doWhenSymbolIdIsReady(e,l,(function(o){a._studyEngine.createStudy(e,t,s,i,r,n),a.studyCounter++}))},JSServer.ChartApi.prototype.rebindStudy=function(e,t,i,s,r,n,o,a){throw new Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(e,t){this._notificationHandlers[e][t]=null,
|
||
this._studyEngine.removeStudy(e,t),this.studyCounter--,_(this._studyTimers,e,t)},JSServer.ChartApi.prototype.modifyStudy=function(e,t,i,s,r){var n=this,o=setTimeout((function(){i=i||"",n._notificationHandlers[e][t]=new c(r,t),n._studyEngine.recomputeStudy(t,s,e,i)}),0);m(this._studyTimers,e,t,o)},JSServer.ChartApi.prototype.createPointset=function(e,t,i,s,r,n,o){i=i||"",this._notificationHandlers[e][t]=new c(o,t);var a=this;this._doWhenSymbolIdIsReady(e,s,(function(i){a._studyEngine.createPointset(e,t,i.symbolInfo,r,n)}))},JSServer.ChartApi.prototype.modifyPointset=function(e,t,i,s,r){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(e,t,i){this._notificationHandlers[e][t]=null,this._studyEngine.removePointset(e,t)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(e,t){this._studyEngine.requestMoreTickmarks(e,t)},JSServer.ChartApi.prototype.requestFirstBarTime=function(e,t,i,s){this._notificationHandlers[e][t]=new c(s,t)},JSServer.ChartApi.prototype._invokeHandler=function(e,t){e&&e(t)},JSServer.ChartApi.prototype._sendRequest=function(e,t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._dispathNotification=function(e){var t=e.params.shift();if(this._notificationHandlers[t])switch(e.method){case"timescale_update":var i=e.params[0],s=e.params[1];for(var r in s.clear=0===s.changes.length&&0===s.marks.length,this._sessions[t].onMessage({method:"timescale_update",params:s}),i){var n={method:"data_update",params:{customId:r,plots:i[r].series,nonseries:i[r].nonseries,turnaround:i[r].turnaround}};this._invokeNotificationHandler(t,r,n)}break;case"tickmark_update":this._sessions[t].onMessage({method:"timescale_update",params:e.params[0]});break;case"data_update":for(var r in e.params[0]){var o=e.params[0][r];n={method:"data_update",params:{customId:r,plots:o.series?o.series:o.plots,nonseries:o.nonseries,turnaround:o.turnaround}};this._invokeNotificationHandler(t,r,n)}break;case"index_update":for(var r in e.params[0]){n={method:"index_update",params:e.params[0][r]};this._invokeNotificationHandler(t,r,n)}break;case"critical_error":u.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+e.params[0]),this._sessions[t].onMessage({method:"critical_error",params:e.params});break;case"timescale_completed":case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[t].onMessage({method:e.method,params:e.params});break;case"clear_data":for(var a in e.params[0])this._invokeNotificationHandler(t,a,{method:"clear_data",params:e.params[0][a]});break;default:var l=e.params[0];this._invokeNotificationHandler(t,l,e)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(e,t,i){if(void 0!==t){var s=this._notificationHandlers[e][t];void 0!==s&&s&&this._invokeHandler(s.handler,i),
|
||
"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[e][t]}},JSServer.ChartApi.prototype.searchSymbols=function(e,t,i,s,r,n,o,a,l,c){this._studyEngine.searchSymbols(e,t,i,c)},JSServer.ChartApi.prototype._notifySessions=function(e){for(var t in this._sessions){if(!this._sessions.hasOwnProperty(t))return;var i=this._sessions[t];"function"==typeof i.onMessage&&i.onMessage(e)}},JSServer.ChartApi.prototype.unpack=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(e){return this._studyEngine.quoteCreateSession(e)},JSServer.ChartApi.prototype.quoteDeleteSession=function(e){return this._studyEngine.quoteDeleteSession(e)},JSServer.ChartApi.prototype.quoteSetFields=function(e,t){return this._studyEngine.quoteSetFields(e,t)},JSServer.ChartApi.prototype.quoteAddSymbols=function(e,t){return-1!==t.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),t=t.filter((function(e){return!!e}))),this._studyEngine.quoteAddSymbols(e,t)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(e,t){return this._studyEngine.quoteRemoveSymbols(e,t)},JSServer.ChartApi.prototype.quoteFastSymbols=function(e,t){return this._studyEngine.quoteFastSymbols(e,t)},JSServer.ChartApi.prototype.quoteHibernateAll=function(e){return this._studyEngine.quoteHibernateAll(e)},JSServer.ChartApi.prototype.depthCreateSession=function(e){return this._studyEngine.depthCreateSession(e)},JSServer.ChartApi.prototype.depthDeleteSession=function(e){return this._studyEngine.depthDeleteSession(e)},JSServer.ChartApi.prototype.depthSetSymbol=function(e,t){return this._studyEngine.depthSetSymbol(e,t)},JSServer.ChartApi.prototype.depthClearSymbol=function(e){},JSServer.ChartApi.prototype.depthSetScale=function(e,t){},JSServer.ChartApi.prototype.createStudiesAccessController=function(e,t,i){return new this.StudiesAccessController(this._studyEngine,e&&JSON.parse(e)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(e,t){this._studyEngine=e,this._studiesAccess=t},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(e){for(var t=null,i=0;i<this._studiesAccess.tools.length;++i){var s=this._studiesAccess.tools[i];if(s.name===e||s===e){t=s;break}}return t},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter((function(e){return this.isToolEnabled(e.description)||e.is_hidden_study}),this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolEnabled=function(e){var t=this._findTool(e);return"black"===this._studiesAccess.type?!t||t.grayed:!!t},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(e){var t=this._findTool(e);return t&&t.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},h(JSServer.ChartApi,"JSServer.ChartApi",l,"ChartApiInterface"),
|
||
e.exports=JSServer.ChartApi},EYFt:function(e,t,i){"use strict";i.d(t,"a",(function(){return g}));var s=i("ivNn"),r=i("YFKU"),n=i("qFKp"),o=i("Tmoa"),a=i("Kxc7"),l=i("k9/m"),c=i("CW80"),h=i("mMWL"),u=i("23IT"),d=i("i6cO"),p=i("UAFa");const _=n.CheckMobile.any(),m=Object(r.t)("n/a"),f=a.enabled("hide_last_na_study_output");class g{constructor(e,t){this._emptyValues=[],this._colorProviders=new Map,this._study=e,this._model=t;const i=e.metaInfo().plots;i&&i.forEach((t,i)=>{if(Object(u.isPlotWithTechnicalValues)(t))return;const s=t.id;this._emptyValues.push({id:s,index:i,title:this._study.guiPlotName(s),value:"",visible:!1});const r=Object(u.isOhlcPlot)(t)?t.target:t.id;this._colorProviders.set(r,Object(p.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),r))})}getItems(){return this._emptyValues}getValues(e){const t=this._emptyValues.map(e=>Object.assign({},e));let i=null;const r=this._study.data().lastIndex();if(null!==r)for(const s of t){if(!this._study.properties().styles[s.id].visible.value())continue;const e=this._study.nearestIndex(r,l.PlotRowSearchMode.NearestLeft,s.index+1);if(void 0===e)continue;const t=e+this._study.offset(s.id);i=null!==i?Math.max(t,i):t}(null===e||null!==i&&e>i)&&(e=i);const n=this._hideValues(),a=this._study.isVisible()&&!n?m:"";for(const s of t)s.value=a;if(n)return t;f&&t.length&&(t[t.length-1].value="");const c=this._study.priceScale();if(!this._study.isVisible()||null===e||null===c||c.isEmpty()||this._model.timeScale().isEmpty())return t;const h=this._study.metaInfo().plots,p=this._study.formatter(),_={};for(const m of t){let t=m.id;const i=this._study.properties().styles[t].visible.value();if(m.visible=i,!i)continue;const n=m.index,a=e-this._study.offset(t),c=null!==r&&a>r?l.PlotRowSearchMode.NearestLeft:l.PlotRowSearchMode.Exact,f=this._study.nearestIndex(a,c);if(void 0===f)continue;let g=_[t];if(void 0===g&&(g=this._study.getMinFirstBarIndexForPlot(t),Number.isFinite(g)&&(_[t]=g)),g>f)continue;const v=this._study.data().last(),b=this._study.data().valueAt(f)||(null!==v?v.value:null);if(null===b)continue;const S=b[n+1];if(!Object(s.isNumber)(S))continue;const y=S>0;m.value=p.format(S);const w=this._study.properties().styles[t];let C=w.color.value();const P=h[n];Object(u.isOhlcPlot)(P)?(t=P.target||t,C=this._study.properties().ohlcPlots[t].color.value()):Object(u.isArrowsPlot)(P)&&(C=y?w.colorup.value():w.colordown.value());let x=C;const T=this._colorProviders.get(t),M=T&&T.getPlotPointStyle(b);M&&(Object(u.isArrowsPlot)(P)?(y&&void 0!==M.colors[d.ColorerType.Up]&&(x=M.colors[d.ColorerType.Up]),y||void 0===M.colors[d.ColorerType.Down]||(x=M.colors[d.ColorerType.Down])):void 0!==M.colors[d.ColorerType.Main]&&(x=M.colors[d.ColorerType.Main])),"transparent"===x&&(x=C),x=Object(o.resetTransparency)(x),m.color=x}return t}_hideValues(){return _&&(null===this._model.crossHairSource().pane||Object(c.isLineToolName)(h.tool.value())||null!==this._model.lineBeingEdited())}}},Ecpn:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));const s={PivotPointsStandard:!0,VbPVisible:!0}
|
||
;function r(e){return e in s}},EqoR:function(e,t,i){"use strict";var s=i("5rJj"),r=i("aDyP").LineToolPitchfork;class n extends r{constructor(e,t){super(e,t||n.createProperties())}name(){return"Inside Pitchfork"}static createProperties(e){var t=new s("linetoolinsidepitchfork",e,!1,{range:[0,8]});return n._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolInsidePitchfork=n},Ery9:function(e,t,i){"use strict";i.r(t),i.d(t,"setCustomAdapter",(function(){return m})),i.d(t,"initialize",(function(){return f})),i.d(t,"updateUser",(function(){return g})),i.d(t,"getChartsCount",(function(){return v})),i.d(t,"getCharts",(function(){return b})),i.d(t,"removeChart",(function(){return S})),i.d(t,"saveChart",(function(){return y})),i.d(t,"getChartContent",(function(){return w})),i.d(t,"loadChart",(function(){return C})),i.d(t,"removeStudyTemplate",(function(){return P})),i.d(t,"getStudyTemplateContent",(function(){return x})),i.d(t,"saveStudyTemplate",(function(){return T})),i.d(t,"getStudyTemplatesList",(function(){return M})),i.d(t,"invalidateStudyTemplatesList",(function(){return I})),i.d(t,"getStudyTemplateContentById",(function(){return L})),i.d(t,"getStandardStudyTemplateContentById",(function(){return O})),i.d(t,"removeStudyTemplateById",(function(){return A})),i.d(t,"renameStudyTemplate",(function(){return E})),i.d(t,"replaceStudyTemplate",(function(){return k})),i.d(t,"getDrawingTemplates",(function(){return D})),i.d(t,"loadDrawingTemplate",(function(){return V})),i.d(t,"removeDrawingTemplate",(function(){return B})),i.d(t,"saveDrawingTemplate",(function(){return R}));var s=i("FQhm"),r=i("ogJP"),n=i("txPx"),o=i("Cf1E");const a=Object(n.getLogger)("Chart.SaveloadAdapter.Library");let l,c,h,u,d=null,p=null;function _(e){return`${h}/${encodeURIComponent(u)}/${e}?client=${encodeURIComponent(l)}&user=${encodeURIComponent(c)}`}function m(e){d=e}function f(e,t,i,s){l=e,c=t,h=i,u=s}function g(e){c=e}function v(e,t){throw new Error("Not implemented")}function b(e,t=(()=>{})){const i=t=>{e(t.map(e=>({id:e.id,name:e.name,image_url:String(e.id),modified_iso:e.timestamp,short_symbol:e.symbol,interval:e.resolution})))};if(!d)return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(h,encodeURIComponent(u),encodeURIComponent(l),encodeURIComponent(c)),type:"GET",crossDomain:!0}).done(e=>{const s=Object(r.parseJSONorNot)(e);if("ok"!==s.status)return a.logWarn("Charts list request failed: "+s.message),void t();i(s.data)}).fail(t);d.getAllCharts().then(i).catch(t)}function S(e,t){d?d.removeChart(e).then(t):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(h,encodeURIComponent(u),encodeURIComponent(l),encodeURIComponent(c),encodeURIComponent(e)),type:"DELETE",crossDomain:!0}).done(e=>{const i=Object(r.parseJSONorNot)(e);"ok"!==i.status&&a.logWarn("Chart delete request failed: "+i.message),t()})}function y(e,t,i,s,n,o,p){const _=n.id.value(),m={name:e,content:JSON.stringify(s),symbol:t,resolution:i};if(d)return void d.saveChart(Object.assign(Object.assign({},m),{id:_
|
||
})).then(o).catch(p);let f="{0}/{1}/charts?client={2}&user={3}".format(h,encodeURIComponent(u),encodeURIComponent(l),encodeURIComponent(c));null!=_&&(f+="&chart="+encodeURIComponent(_)),$.ajax({url:f,data:m,type:"POST",crossDomain:!0}).done(e=>{const t=Object(r.parseJSONorNot)(e);if("ok"!==t.status)return a.logWarn("Chart save request failed: "+t.message),void p();o(t.id)}).fail(()=>{p()})}function w(e,t,i){const s=t=>{const i=JSON.parse(t);return i.uid=e.id,i};d?d.getChartContent(e.id).then(e=>{const i=s(e);t(i)}).catch(i):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(h,encodeURIComponent(u),encodeURIComponent(l),encodeURIComponent(c),encodeURIComponent(e.id)),type:"GET",crossDomain:!0}).done(e=>{const i=Object(r.parseJSONorNot)(e);if("ok"!==i.status)return void a.logWarn("Chart load request failed: "+i.message);const n=s(i.data.content);t(n)}).fail(()=>{i&&i()})}function C(e){w(e,e=>{s.emit("chart_load_requested",e)},()=>{a.logWarn("Error loading chart")})}async function P(e){try{if(d)return d.removeStudyTemplate({name:e});const t=await fetch(`${_("study_templates")}&template=${encodeURIComponent(e)}`,{method:"DELETE",credentials:"same-origin"});if(!t.ok)throw new Error(`Remove study template response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Remove study template request failed: "+i.message)}catch(t){throw a.logWarn(Object(o.a)(t)),t}}async function x(e){try{if(d){return{content:await d.getStudyTemplateContent({name:e})}}const t=await fetch(`${_("study_templates")}&template=${encodeURIComponent(e)}`,{credentials:"same-origin"});if(!t.ok)throw new Error(`Get study template response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Get study template request failed: "+i.message);return i.data}catch(t){throw a.logWarn(Object(o.a)(t)),t}}async function T(e){try{if(d)return d.saveStudyTemplate(e).then(()=>({error:""})).catch(e=>({error:null!=e?Object(o.a)(e):"error"}));const t=new FormData;t.append("name",e.name),t.append("content",e.content);const i=await fetch(_("study_templates"),{method:"POST",body:t,credentials:"same-origin"});if(!i.ok)throw new Error(`Save study template response was not OK. Status: ${i.status}.`);const s=await i.json();return{error:"ok"===s.status?"":s.status}}catch(t){throw a.logWarn(Object(o.a)(t)),t}}async function M(){try{if(p)return p;p=[];const e=e=>(p=e.map(e=>({is_default:!1,name:e.name})),p);if(d)return d.getAllStudyTemplates().then(e);const t=await fetch(_("study_templates"),{method:"GET",credentials:"same-origin"});if(!t.ok)throw new Error(`Study templates list response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Study templates list request failed: "+i.message);return e(i.data)}catch(e){throw a.logWarn(Object(o.a)(e)),e}}function I(){p=null}function L(e,t){throw new Error("Not implemented")}function O(e,t){throw new Error("Not implemented")}function A(e,t){throw new Error("Not implemented")}function E(e,t,i){
|
||
throw new Error("Not implemented")}function k(e,t,i){throw new Error("Not implemented")}async function D(e){throw new Error("Not implemented")}async function V(e,t){throw new Error("Not implemented")}async function B(e,t){throw new Error("Not implemented")}async function R(e,t,i){throw new Error("Not implemented")}},EsvI:function(e,t,i){"use strict";i.r(t);i("bSeV");var s=i("eJTA"),r=i("wZIs"),n=i("Vdly"),o=i("wVAQ"),a=i("txPx");const l=Object(a.getLogger)("Themes.Provider");let c=null;function h(e){return Object(o.fetch)("/theme/?themeName="+encodeURIComponent(e),{credentials:"include",method:"GET"}).then(e=>e.json()).then(e=>{const t={};return e.content&&(t.content=JSON.parse(e.content)),t})}var u=i("zM7N"),d=i("oiZD");var p=i("YFKU"),_=i("IMMp"),m=i("HGP3");const f={[u.a.Light]:{name:u.a.Light,label:()=>Object(p.t)("Light",{context:"colorThemeName"}),order:2,getThemedColor:e=>Object(m.b)(e)},[u.a.Dark]:{name:u.a.Dark,label:()=>Object(p.t)("Dark",{context:"colorThemeName"}),order:1,getThemedColor:e=>{const t=_[e]||e;return Object(m.b)(t)}}};function g(e){return!e.isPrivate}function v(){return f[d.watchedTheme.value()]||f.light}function b(e){return v().getThemedColor(e)}function S(e,t,i,s,n=!0,o=!1,a=!1){const l=t?Promise.resolve(I(e)):P(e);return l.then(l=>{if(void 0!==l.content){const h=!t;a&&(void 0!==(c=l.content).chartProperties&&Object(r.applyDefaultsOverrides)(c.chartProperties),void 0!==c.mainSourceProperties&&Object(r.applyDefaultsOverrides)(c.mainSourceProperties,void 0,!0,"mainSeriesProperties")),s.applyTheme(l.content,h,i,e,t,n,o)}var c}),l}i.d(t,"isPublicTheme",(function(){return g})),i.d(t,"getCurrentTheme",(function(){return v})),i.d(t,"getThemedColor",(function(){return b})),i.d(t,"loadTheme",(function(){return S})),i.d(t,"restoreTheme",(function(){return y})),i.d(t,"savedThemeName",(function(){return w})),i.d(t,"syncTheme",(function(){return C})),i.d(t,"getTheme",(function(){return P})),i.d(t,"getThemeNames",(function(){return x})),i.d(t,"getStdThemeNames",(function(){return T})),i.d(t,"isStdThemeName",(function(){return M})),i.d(t,"getStdTheme",(function(){return I})),i.d(t,"getStdThemedValue",(function(){return L})),i.d(t,"isStdThemedDefaultValue",(function(){return O})),i.d(t,"saveTheme",(function(){return A})),i.d(t,"removeTheme",(function(){return E})),i.d(t,"isThemeExist",(function(){return k})),i.d(t,"translateStdThemeName",(function(){return D})),i.d(t,"isStdTheme",(function(){return V})),i.d(t,"extractThemeFromModel",(function(){return B})),i.d(t,"DEFAULT_THEME",(function(){return"light"})),i.d(t,"themes",(function(){return f}));function y(){Object(d.setTheme)(Object(n.getValue)("current_theme.name")||"light")}function w(){return Object(n.getValue)("current_theme.name")||null}function C(){Object(n.setValue)("current_theme.name",v().name,{forceFlush:!0})}function P(e){return h(e)}function x(){return c||Object(o.fetch)("/themes/",{credentials:"include",method:"GET"}).then(e=>(c=e.json(),c))}function T(){return u.c()}function M(e){return T().includes(e)}function I(e){return u.b(e)||{
|
||
content:void 0}}function L(e,t){const i=t||v().name,s=u.b(i),r=0!==e.length&&e.split(".");return s&&s.content&&r?r.reduce((e,t)=>e[t],s.content):null}function O(e,t,i){const r=L(e,i);return null!==r&&Object(s.areEqualRgba)(Object(s.parseRgba)(r),Object(s.parseRgba)(String(t)))}function A(e,t){return function(e,t){const i=new FormData;return i.append("content",JSON.stringify(t)),i.append("name",e),c=null,Object(o.fetch)("/save-theme/",{credentials:"include",method:"POST",body:i}).then(e=>e.json(),e=>l.logError(e))}(e,t)}function E(e){return function(e){const t=new FormData;return t.append("name",e),c=null,Object(o.fetch)("/remove-theme/",{credentials:"include",method:"POST",body:t}).then(e=>e.json(),e=>l.logError(e))}(e)}function k(e){return function(e){return h(e).then(e=>Boolean(e.content))}(e)}function D(e){return u.e(e)}function V(e){return u.d(e)}function B(e){return{content:{chartProperties:{paneProperties:e.model().properties().paneProperties.state(),scalesProperties:e.model().properties().scalesProperties.state()},sessions:e.model().sessions().properties().state(),mainSourceProperties:e.model().mainSeries().properties().state()}}}},ExCE:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("VdBB");class r{constructor(){this._bars=[]}hitTest(e){const t=this._bars,i=this._getBarSpacing(),s=i/2;if(0===t.length)return null;const r=this._getTolerance(),n=t[0],o=t[t.length-1];if(e.x<n.time-s-r)return null;if(e.x>o.time+s+r)return null;let a=0,l=t.length-1,c=-1;for(;a<=l;){const i=Math.floor((a+l)/2),h=t[i];let u=s;if(h!==n&&h!==o||(u+=r),Math.abs(h.time-e.x)<=u){c=i;break}e.x-h.time>s?a=i+1:l=i-1}if(-1!==c){const n=Math.ceil(r/i);if(0!==n){const i=Math.max(0,c-n),o=Math.min(t.length-1,c+n);for(let n=i;n<=o;n++)if(Math.abs(e.x-t[n].time)<=s+r&&this._isPointAtBar(t[n],e.y,r))return this._getHitTest()}else if(this._isPointAtBar(t[c],e.y,r))return this._getHitTest()}return null}_getHitTest(){return new s.HitTestResult(s.HitTestResult.REGULAR)}_isPointAtBar(e,t,i){const s=Math.min(e.high,e.low),r=Math.max(e.high,e.low);return s-i<=t&&t<=r+i}}},EyEd:function(e,t,i){"use strict";var s=i("lCO3").Version,r=i("txPx").getLogger("Chart.StudyMigration");function n(e){this._studyId=e,this._maxToVers=s.ZERO,this._maxFromVers=s.ZERO,this._migrs=[]}n.prototype.addMigration=function(e,t,i){var r=s.parse(e),n=s.parse(t);r.isGreater(this._maxFromVers)&&(this._maxFromVers=r),n.isGreater(this._maxToVers)&&(this._maxToVers=n),this._migrs.push({fromVers:r,toVers:n,rules:i})},n.prototype.updateInputs=function(e,t,i){if(!i)return i;for(var s=TradingView.clone(i),n=e;n.isLess(t);){var o=this._findMigration(n);if(null==o)break;if(r.logNormal("Migrating study inputs from "+o.fromVers+" to "+o.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(o)+", inputs: "+JSON.stringify(i)),s=this._applyMigration(s,o),!n.isLess(o.toVers))throw new Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");n=o.toVers}
|
||
return n>e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(s)),s},n.prototype._findMigration=function(e){for(var t=-1,i=this._maxFromVers,s=0;s<this._migrs.length;s++){var r=this._migrs[s];r.fromVers.isLess(e)||r.fromVers.isLessOrEqual(i)&&(i=r.fromVers,t=s)}return t<0?null:this._migrs[t]},n.prototype._applyMigration=function(e,t){for(var i=e,s=0;s<t.rules.length;s++){var r=t.rules[s];i=this._getApplyRuleFun(r.type)(i,r)}return i},n.prototype._getApplyRuleFun=function(e){if("inputRemoved"===e)return n._applyInputRemovedRule;if("inputChangedType"===e)return n._applyInputChangedTypeRule;if("inputChangedMinMax"===e)return n._applyInputChangedMinMaxRule;if("inputChangedOptions"===e)return n._applyInputChangedOptionsRule;throw new Error("Unknown migration rule type: "+e)},n._applyInputRemovedRule=function(e,t){if(!(t.inputId in e))return e;if("removeVal"!==t.action)throw new Error("Unexpected rule.action="+t.action+" in rule.type="+t.type);var i=e[t.inputId];return delete e[t.inputId],r.logNormal("Input "+t.inputId+"="+i+" removed"),e},n._applyInputChangedTypeRule=function(e,t){var i=e[t.inputId];if("resetToDefVal"===t.action)return e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal),e;if("convertVal"===t.action){if(null==i)return e;if("float"===t.inputTypeFrom&&"integer"===t.inputType)return e[t.inputId]=Math.round(e[t.inputId]),r.logNormal("Input "+t.inputId+"="+i+" converted to value "+e[t.inputId]),e;if("integer"===t.inputTypeFrom&&"float"===t.inputType)return e;if("text"===t.inputTypeFrom&&"source"===t.inputType)return n._isValidSource(i,t.options)||(e[t.inputId]=t.defVal),e;throw new Error("Cannot convertVal from "+t.inputTypeFrom+" to "+t.inputType)}throw new Error("Unknown action "+t.action+" for rule with type "+t.type)},n._isValidSource=function(e,t){return e.indexOf("$")>=0||t.indexOf(e)>=0},n._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw new Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return i<t.minVal?e[t.inputId]=t.minVal:i>t.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},n._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw new Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=n},Eyy1:function(e,t,i){"use strict";function s(e){if(void 0===e)throw new Error("Value is undefined");return e}function r(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNever=t.ensure=t.ensureNotNull=t.ensureDefined=t.assert=void 0,t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=s,t.ensureNotNull=r,t.ensure=function(e){return r(s(e))},
|
||
t.ensureNever=function(e){}},F58L:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyTemplates",(function(){return p}));var s=i("zUrt"),r=i("JWMC"),n=i("aIyQ"),o=i.n(n),a=i("hY0g"),l=i.n(a),c=i("fZEr"),h=i("txPx");const u=Object(h.getLogger)("Platform.StudyTemplates"),d={confirmDelete:window.t("Do you really want to delete Study Template '{0}' ?")};class p{constructor(e){this._chartWidgetCollection=e.chartWidgetCollection,this._favoriteStudyTemplatesService=e.favoriteStudyTemplatesService,window.loginStateChange.subscribe(null,s.backend.invalidateStudyTemplatesList),this._list=new l.a([]),this._onChange=new o.a,this._list.subscribe(()=>this._onChange.fire())}findRecordByName(e){return this._list.value().find(t=>t.name===e)||null}showSaveAsDialog(){const e=this._chartWidgetCollection.activeChartWidget.value().model();Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(8),i.e(9),i.e(13),i.e(15),i.e(18),i.e(19),i.e(21),i.e(24),i.e(34),i.e(88),i.e(0),i.e(5),i.e(12),i.e(17),i.e("study-template-dialog")]).then(i.bind(null,"IDfV")).then(t=>{new t.StudyTemplateSaver({controller:e,onSave:e=>{this._list.setValue(e)}}).show()})}applyTemplate(e){const t=this.findRecordByName(e);null!==t?window.runOrSignIn(()=>{const e=this._chartWidgetCollection.activeChartWidget.value(),i=i=>{Object(r.trackEvent)("GUI","Load Study Template"),e.model().applyStudyTemplate(JSON.parse(i.content),t.name)};void 0!==t.id?t.is_default?s.backend.getStandardStudyTemplateContentById(t.id,i):s.backend.getStudyTemplateContentById(t.id,i):s.backend.getStudyTemplateContent(t.name).then(i)},{source:"Study templates apply"}):u.logNormal(`Template ${e} not found in cache`)}deleteStudyTemplate(e){const t=this.findRecordByName(e);null!==t?this._removeTemplate(t):u.logNormal(`Template ${e} not found in cache`)}list(){return this._list.value()}getOnChange(){return this._onChange}refreshStudyTemplateList(e){s.backend.getStudyTemplatesList().then(t=>{this._list.setValue(t),void 0!==e&&e()})}invalidate(){s.backend.invalidateStudyTemplatesList()}_removeTemplate(e){window.runOrSignIn(()=>{Object(c.a)({text:d.confirmDelete.format(e.name),onConfirm:({dialogClose:t})=>new Promise(i=>{const r=()=>{this.refreshStudyTemplateList(()=>{const s=this.list();this._list.setValue(s.filter(t=>t!==e)),this._favoriteStudyTemplatesService&&this._favoriteStudyTemplatesService.remove(e.name),i(),t()})};s.backend.invalidateStudyTemplatesList(),void 0!==e.id?s.backend.removeStudyTemplateById(e.id,r):s.backend.removeStudyTemplate(e.name).then(r)})})},{source:"Study templates delete"})}}},FA0h:function(e,t,i){"use strict";function s(){return Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(8),i.e(9),i.e(21),i.e(22),i.e(41),i.e(72),i.e(75),i.e(0),i.e(5),i.e(10),i.e(14),i.e(29),i.e(37),i.e("symbol-search-dialog")]).then(i.bind(null,"GcSm"))}i.d(t,"a",(function(){return s}))},FBsw:function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayPriceAxisView",(function(){return o}));var s=i("KcY8"),r=i("n5al"),n=i("oXaB");class o extends s.a{constructor(e){super(),this._source=e}
|
||
_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._source.lastValueData("close",!1);if(s.noData)return;const r=this._source.model(),o=this._source.priceScale();if(null===o)return;if(!r.isPriceScaleVisible(o))return;i.background=s.color,i.textColor=this.generateTextColor(s.color),i.coordinate=s.coordinate,i.floatCoordinate=s.floatCoordinate;const a=this._source.model().properties().scalesProperties;if(a.showSeriesLastValue.value()){if(a.seriesLastValueMode.value()!==n.PriceAxisLastValueMode.LastPriceAndPercentageValue)e.text=s.text,e.secondLine="";else{const t=o.isPercentage();e.text=t?s.formattedPricePercentage:s.formattedPriceAbsolute,e.secondLine=t?s.formattedPriceAbsolute:s.formattedPricePercentage}e.visible=!0}t.text="",a.showSymbolLabels.value()&&(t.text=this._paneText(),t.visible=t.text.length>0)}_paneText(){let e="";if(this._source.model().properties().scalesProperties.showSymbolLabels.value()){const t=this._source.symbolInfo();e+=(t&&Object(r.symbolCurrentContract)(t)||this._source.symbol())+" "}return e.trim()}}},FBuY:function(e,t,i){"use strict";i.r(t),i.d(t,"TVXWindowEvents",(function(){return o}));i("HbRj");var s=i("txPx"),r=i("VVxS");const n=Object(s.getLogger)("XWindowEvents");var o;!function(e){const t="tvxwevents.",i={};let s;window.BroadcastChannel?(s=new BroadcastChannel("tvxwevents"),s.addEventListener("message",(function(e){const{data:{event:t,value:s}}=e;i[t]&&i[t].forEach(e=>{e(s)})})),function(){const e=[],i=performance.now();for(let n=0;n<r.TVLocalStorage.length;n++){const i=r.TVLocalStorage.key(n);i.startsWith(t)&&e.push(i)}const s=r.TVLocalStorage.length;for(const t of e)r.TVLocalStorage.removeItem(t);const o=performance.now()-i;n.logNormal("Total keys amount in local storage on operation start: "+s),n.logNormal("Keys amount in local storage to be deleted: "+e.length),n.logNormal("Keys to be deleted from local storage: "+JSON.stringify(e)),n.logNormal(`Removing keys from local storage took ${o} ms`)}()):window.addEventListener("storage",(function(e){const{newValue:s,key:n}=e;if(null===s||!n||!n.startsWith(t))return;const o=n.substr(t.length);i[o]&&i[o].forEach(t=>{t(e.newValue)});r.TVLocalStorage.removeItem(n)})),e.on=function(e,t){i[e]||(i[e]=[]),i[e].push(t)},e.off=function(e,t){if(!i[e])return;const s=i[e].indexOf(t);-1!==s&&(1===i[e].length?delete i[e]:i[e].splice(s,1))},e.emit=function(e,i=Date.now()){try{s?s.postMessage({event:e,value:i}):r.TVLocalStorage.setItem(t+e,i.toString())}catch(o){n.logError(o.message)}}}(o||(o={}))},FDyI:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("LxhU"),n=i("IiTo"),o=i("/bs+");class a{constructor(e){this._timeScale=e}coordinateToTime(e){const t=this._timeScale.coordinateToIndex(e);return this._timeScale.indexToTimePoint(t)}barSpacing(){return this._timeScale.barSpacing()}rightOffset(){return this._timeScale.rightOffset()}width(){return this._timeScale.width()}}var l=i("aIyQ"),c=i.n(l),h=i("96Yh"),u=i("pOzK"),d=i("CsKN");i.d(t,"ChartWidgetApiBase",(function(){return p}));class p{constructor(e){this._visibleBarsChanged=new c.a,
|
||
this._ranges=null,this._chartWidget=e}getPriceToBarRatio(){return this._chartWidget.model().model().mainSeriesScaleRatioProperty().value()}setPriceToBarRatio(e,t){const i=this._chartWidget.model(),s=i.model(),r=s.mainSeriesScaleRatioProperty();(null==t?void 0:t.disableUndo)?new d.SetScaleRatioPropertiesCommand(r,e,"",s).redo():i.setScaleRatioProperty(r,e,"Change Price to Bar Ratio")}isPriceToBarRatioLocked(){return this._chartWidget.model().model().mainSeries().priceScale().isLockScale()}setPriceToBarRatioLocked(e,t){const i=this._chartWidget.model(),s=i.model(),r=s.mainSeries().priceScale();(null==t?void 0:t.disableUndo)?new u.SetPriceScaleModeCommand({lockScale:e},r,"",s).redo():i.setPriceScaleMode({lockScale:e},r,"Toggle Lock Scale")}onDataLoaded(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())}onSymbolChanged(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())}onIntervalChanged(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())}onVisibleRangeChanged(){return this._makeSubscriptionFromDelegate(this._visibleBarsChanged)}onChartTypeChanged(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onStyleChanged())}whenChartReady(e){this._chartWidget.withModel(this,e)}crossHairMoved(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().crossHairSource().moved())}setChartType(e){const t=this._chartWidget.model().mainSeries().properties().style;this._chartWidget.model().setChartStyleProperty(t,e,"Change Series Style")}getAllStudies(){return this._chartWidget.model().model().allStudies(!0).map(h.studyEntityInfo)}getAllPanesHeight(){const e=this._chartWidget.model().model().panes();if(this._chartWidget.isMaximizedPane()){let t=0,i=0;e.forEach(e=>{t+=e.height(),i+=e.stretchFactor()});const s=i/t;return e.map(e=>Math.round(e.stretchFactor()/s*100)/100)}return e.map(e=>e.height())}setAllPanesHeight(e){const t=this._chartWidget.model().model(),i=t.panes();Object(s.assert)(i.length===e.length,"There`s a mismatch between the number of heights you provided and the number of panes.");const r=i.reduce((e,t)=>e+t.stretchFactor(),0)/e.reduce((e,t)=>e+t);e.forEach((e,t)=>{const s=e*r;i[t].setStretchFactor(s)}),t.fullUpdate()}sessions(){return this._chartWidget.model().model().sessions()}getTimeScaleLogicalRange(){return this._chartWidget.model().timeScale().logicalRange()}exportData(e){return i.e("export-data").then(i.bind(null,"SIoL")).then(t=>t.exportData(this._chartWidget.model().model(),e))}barTimeToEndOfPeriod(e){const t=this._prepareEndOfPeriodArgs();return Object(o.a)(t.barBuilder,e,t.intervalObj)}endOfPeriodToBarTime(e){const t=this._prepareEndOfPeriodArgs();return Object(o.b)(t.barBuilder,e,t.intervalObj)}properties(){return this._chartWidget.properties()}setBarSpacing(e){this._chartWidget.model().timeScale().setBarSpacing(e)}scrollChartByBar(e){this._chartWidget.model().scrollChartByBar(e)}mergeAllScales(e){
|
||
this._chartWidget.model().mergeAllScales(e)}chartPainted(){return this._chartWidget.chartPainted()}axesSizeReady(){for(const e of this._chartWidget.paneWidgets()){for(const t of e.leftPriceAxisesContainer().axes())if(!t.sizeReady())return!1;for(const t of e.rightPriceAxisesContainer().axes())if(!t.sizeReady())return!1}return!0}ranges(){throw new Error("not implemented")}getTimeScale(){return new a(this._chartWidget.model().timeScale())}_createStudy(e){return Promise.reject("Pine and java studies are not supported")}_makeSubscriptionFromDelegate(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}}_prepareEndOfPeriodArgs(){const e=this._chartWidget.model().model(),t=e.timezone(),i=Object(s.ensureNotNull)(e.mainSeries().symbolInfo()),o=e.mainSeries().interval(),a=new n.SessionInfo(t,i.session,i.holidays,i.corrections);return{barBuilder:Object(n.newBarBuilder)(o,a,a),intervalObj:r.Interval.parse(o)}}}},FIi8:function(e,t,i){"use strict";function s(e,...t){return e&&"object"==typeof e?(0===t.length||t.forEach(t=>{null!=t&&"object"==typeof t&&Object.keys(t).forEach(i=>{const n=e[i],o=t[i];if(o===e)return;const a=Array.isArray(o);if(o&&(r(o)||a)){let t;t=a?n&&Array.isArray(n)?n:[]:n&&r(n)?n:{},e[i]=s(t,o)}else void 0!==o&&(e[i]=o)})}),e):e}function r(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);if(!t)return!0;const i=Object.hasOwnProperty.toString,s=t.hasOwnProperty("constructor")&&t.constructor;return"function"==typeof s&&i.call(s)===i.call(Object)}i.r(t),i.d(t,"deepExtend",(function(){return s}))},FKaq:function(e,t,i){"use strict";i.r(t),i.d(t,"SetPriceScaleSelectionStrategyCommand",(function(){return a}));var s=i("Eyy1"),r=i("RDU5"),n=i("MWAT");class o{constructor(e){this._leftScales=e.leftPriceScales().map(e=>e.id()),this._rightScales=e.rightPriceScales().map(e=>e.id())}restorePane(e){this._leftScales.reverse().map(t=>Object(s.ensureNotNull)(e.getPriceScaleById(t))).forEach(t=>e.movePriceScale(t,"left")),this._rightScales.reverse().map(t=>Object(s.ensureNotNull)(e.getPriceScaleById(t))).forEach(t=>e.movePriceScale(t,"right"))}}class a extends r.UndoCommand{constructor(e,t,i){super(i),this._chartModel=e,this._targetStrategy=Object(n.createPriceScaleSelectionStrategy)(t),this._initialState=e.panes().map(e=>new o(e))}redo(){this._chartModel.panes().forEach(e=>e.setPriceScaleSelectionStrategy(this._targetStrategy)),this._chartModel.fullUpdate()}undo(){const e=this._chartModel.panes();for(let t=0;t<e.length;t++)this._initialState[t].restorePane(e[t]);this._chartModel.fullUpdate()}}},FQhm:function(e,t,i){"use strict";i.r(t),i.d(t,"unsubscribe",(function(){return l})),i.d(t,"on",(function(){return c})),i.d(t,"subscribe",(function(){return h})),i.d(t,"subscribeToAll",(function(){return u})),i.d(t,"emit",(function(){return d})),i.d(t,"emitOnce",(function(){return p}));var s=i("aIyQ"),r=i.n(s);const n={},o=[],a={};function l(e,t,i){n[e].unsubscribe(i,t)}function c(e,t,i){h(e,t,i)}function h(e,t,i,s){
|
||
n.hasOwnProperty(e)||(n[e]=new r.a),a[e]?t.call(i):n[e].subscribe(i,t,s)}function u(e){o.push(e)}function d(e,...t){const i=[e].concat(t);o.forEach(e=>{e.apply(null,i)}),n.hasOwnProperty(e)&&n[e].fire.apply(n[e],t)}function p(e){a[e]&&console.warn(`Something went wrong: emitOnce called multiple times with same event (${e})`),a[e]=!0,d.apply(null,arguments)}},FZIs:function(e,t,i){"use strict";var s;i.d(t,"a",(function(){return s})),function(e){e.Light="light",e.Dark="dark"}(s||(s={}))},FaJS:function(e,t,i){"use strict";i.r(t),i.d(t,"scaleRatio",(function(){return r})),i.d(t,"priceRangeByScaleRatio",(function(){return n})),i.d(t,"barSpacingByScaleRatio",(function(){return o}));var s=i("Qb4w");function r(e,t){if(t.isLog()||e.isEmpty()||t.isEmpty())return null;const i=function(e){if(e.isEmpty())return null;const t=e.priceRange();if(null===t)return null;const i=t.length();return e.internalHeight()/i}(t);if(null===i)return null;return e.getValidBarSpacing()/Math.max(1e-10,i)}function n(e,t,i){if(e.isLog()||null===i||e.isEmpty())return null;const r=e.priceRange();if(null===r||r.isEmpty())return null;const n=e.internalHeight()/(t/i),o=r.length();if(n===o)return r;const a=(n-o)/2;return new s.PriceRange(r.minValue()-a,r.maxValue()+a)}function o(e,t){if(e.isLog()||null===t||e.isEmpty())return null;const i=e.priceRange();if(null===i)return null;const s=i.length();return e.internalHeight()/s*t}},Fdrt:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererStandardPivotLabel",(function(){return r}));var s=i("VdBB");class r{constructor(e,t,i){this._drawRects=[],this._cacheProvider=e,this._point=t,this._label=i}draw(e,t){const i=this._cacheProvider(t);e.save(),e.setTransform(1,0,0,1,0,0);const s=t.pixelRatio;this._drawRects=[];const r=t=>{const r=i.labelRectByIndex(t),n={left:Math.round(this._point.x-r.width+o),top:Math.round(this._point.y-r.height/2),width:r.width,height:r.height};return e.drawImage(i.canvas(),Math.round(r.left*s),Math.round(r.top*s),r.width*s,r.height*s,Math.round(n.left*s),Math.round(n.top*s),n.width*s,n.height*s),this._drawRects.push(n),r.width},n=this._label.split("/");let o=0;for(let a=0;a<n.length;a++){const e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(n[a]);a>0&&(o+=r(e+11)/2),o+=r(e)/2}e.restore()}hitTest(e){for(const t of this._drawRects)if(e.x>=t.left&&e.x<=t.left+t.width&&e.y>=t.top&&e.y<=t.top+t.height)return new s.HitTestResult(s.HitTestResult.REGULAR);return null}}},Fixu:function(e,t,i){"use strict";i.d(t,"c",(function(){return r})),i.d(t,"d",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));i("Eyy1"),i("dfhE");function s(e,t){0}function r(e){s()}function n(e){s()}function o(e){s()}function a(e){0}},FsE7:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"wgWl",7)).then(({FibTimeZonePaneView:e})=>{
|
||
this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}migrateVersion(e,t,i){if(1===e){i.properties.level1.color.setValue(i.properties.baselinecolor.value());for(var s=2;s<=11;s++)i.properties["level"+s].color.setValue(i.properties.linecolor.value());for(s=1;s<=11;s++)i.properties["level"+s].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+s].linestyle.setValue(i.properties.linestyle.value())}}pointsCount(){return 2}name(){return"Fib Time Zone"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"SMr9"))).FibTimezoneDefinitionsViewModel}static createProperties(e){var t=new r("linetoolfibtimezone",e,!1,{range:[1,11]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[],i=[],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));for(t=[],i=[],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.version=2,l.LevelsCount=11,t.LineToolFibTimeZone=l},"GD+X":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e,t){this._chartUndoModel=e,this._chartModel=e.model(),this._priceScale=t}getMode(){const e=this._priceScale.properties().childs();return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0}setMode(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})}isInverted(){return this._priceScale.isInverted()}setInverted(e){this._priceScale.properties().childs().isInverted.setValue(e)}getVisiblePriceRange(){return this._priceScale.priceRangeInPrice()}setVisiblePriceRange(e){this._priceScale.setPriceRangeInPrice(e),this._chartModel.lightUpdate()}hasMainSeries(){return this._priceScale.hasMainSeries()}getStudies(){return this._priceScale.getStudies().map(e=>e.id())}currency(){const e=this._priceScale.currency(this._chartModel.availableCurrencies());return null===e?null:{selectedCurrency:e.selectedCurrency,readOnly:e.readOnly}}setCurrency(e){this._chartUndoModel.setPriceScaleCurrency(this._priceScale,e)}unit(){const e=this._priceScale.unit(this._chartModel.availableUnits());return null===e?null:{selectedUnit:e.selectedUnit,readOnly:0===e.availableGroups.size,availableGroups:Array.from(e.availableGroups)}}setUnit(e){this._chartUndoModel.setPriceScaleUnit(this._priceScale,e)}}},GDWD:function(e,t,i){"use strict";i.r(t),i.d(t,"addPlusButtonProperty",(function(){return o})),i.d(t,"restoreAddPlusButtonSettingsValue",(function(){return a}));var s=i("Vdly"),r=i("m/cY");function n(){return s.getBool("add_plus_button",!0)}const o=Object(r.a)(n());function a(){o.setValue(!0),s.remove("add_plus_button")}s.onSync.subscribe(null,()=>o.setValue(n())),
|
||
o.listeners().subscribe(null,()=>s.setValue("add_plus_button",o.value()))},GEp6:function(e,t,i){"use strict";function s(e,t,i){var s=t.subtract(e),r=i.subtract(e).dotProduct(s)/s.dotProduct(s);return{coeff:r,distance:e.addScaled(s,r).subtract(i).length()}}Object.defineProperty(t,"__esModule",{value:!0}),t.distanceToLine=s,t.distanceToSegment=function(e,t,i){var r=s(e,t,i);if(0<=r.coeff&&r.coeff<=1)return r;var n=e.subtract(i).length(),o=t.subtract(i).length();return n<o?{coeff:0,distance:n}:{coeff:1,distance:o}}},GH0z:function(e,t,i){"use strict";i.r(t),i.d(t,"PercentageFormatter",(function(){return a}));var s=i("kcTO"),r=i("Ialn");const n=/\.0+%$/,o=".";class a extends s.PriceFormatter{constructor(e=100){super(e),this.type="percentage"}state(){const e=s.PriceFormatter.prototype.state.call(this);return e.percent=!0,e}parse(e){return e=e.replace("%",""),super.parse(e)}format(e,t,i,s,n=!0){const o=super.format(e,t,i,s,!1)+"%";return n?Object(r.forceLTRStr)(o):o}withoutEndingZeroes(e){if(-1===e.indexOf(o))return e;const t=e.replace(n,"");return t===e?null:t+"%"}static serialize(e){return e.state()}static deserialize(e){return new a(e.priceScale)}}},GSwP:function(e,t,i){"use strict";var s=i("Eyy1"),r=i("aO4+"),n=i("Kxc7"),o=i("Hr11"),a=i("ogJP"),l=i("Tmoa"),c=i("VdBB"),h=i("Zy3/"),u=i("k9/m"),d=i("o2pV"),p=i("vq8G"),_=i("XPit"),m=i("Nu4p"),f=i("972a"),g=i("i6cO"),v=i("2WC2");class b extends v.a{constructor(){super(...arguments),this._sign=0,this._thinArrow=!1,this._thinArrowLineWidth=0,this._headHeight=0,this._arrowWidth=0}setData(e,t){this._setBaseData(e,t)}_drawItemShape(e,t,i){const s=t.pixelRatio,r=this._lineWidth(t)%2?.5:0,n=this._sign,a=this._arrowWidth,l=this._headHeight,c=Math.abs(i.height),h=Math.round(i.x*s)+r,u=i.vertOffset,d=Math.round((i.y+u+n*c/2)*s)+r,p=Object(o.ceiledEven)(a*s),_=p/2,m=Math.round(c*s),f=Math.round(l*s);e.translate(h,d),this._thinArrow?(e.moveTo(0,0),e.lineTo(-_,-_*n),e.moveTo(0,0),e.lineTo(_,-_*n),e.moveTo(0,0),e.lineTo(0,-m*n),e.moveTo(-_,-m*n),e.lineTo(_,-m*n)):(e.moveTo(0,0),m<f?(e.lineTo(p,-m*n),e.lineTo(-p,-m*n)):(e.lineTo(p,-f*n),e.lineTo(_,-f*n),e.lineTo(_,-m*n),e.lineTo(-_,-m*n),e.lineTo(-_,-f*n),e.lineTo(-p,-f*n)),e.lineTo(0,0)),e.translate(-h,-d)}_preDrawInit(){const e=this._calculateWidth();this._arrowWidth=e,this._sign=this._isUp()?-1:1,this._thinArrow=e<4,this._thinArrowLineWidth=Math.max(e/2,1),this._headHeight=Math.round(e)}_startPath(e,t,i,s){e.beginPath(),e.fillStyle=i,e.strokeStyle=s,e.lineWidth=this._lineWidth(t)}_lineWidth(e){return this._thinArrow?this._thinArrowLineWidth:super._lineWidth(e)}_calcBoundingBox(e){const t=e.vertOffset,i=this._sign,s=this._arrowWidth,n=this._headHeight,o=Math.abs(e.height),a=e.x-s,l=a+2*s,c=e.y+t+i*Math.round(o/2),h=c+(-o-n)*i,u=new r.Point(a,c),d=new r.Point(l,h);let p=Object(r.box)(u,d);const _=super._calcBoundingBox(e);return _&&(p=this._unionBox(p,_)),p}_calculateWidth(){return Math.round(this._barSpacing/4)}}const S=2*Math.PI;class y extends v.a{_drawItemShapeUsingCSSPixels(e,t){
|
||
const i=Math.max(t.width,t.height)/2,s=t.x,r=t.vertOffset,n=t.y+r;e.moveTo(s+i,n),e.arc(s,n,i,0,S,!1)}_calcBoundingBox(e){const t=Math.max(e.width,e.height)/2,i=e.x,s=e.vertOffset,n=e.y+s,o=i-t,a=i+t,l=n-t,c=n+t,h=new r.Point(o,l),u=new r.Point(a,c);let d=Object(r.box)(h,u);const p=super._calcBoundingBox(e);return p&&(d=this._unionBox(d,p)),d}}class w extends v.c{_drawItemShape(e,t,i){const s=i.width,r=i.height,n=i.x-s/2,o=i.vertOffset,a=i.y-r/2+o,l=t.pixelRatio,c=this._lineWidth(t),h=c%2?.5:0,u=Math.round(n*l);let d=Math.round((n+s)*l);(d-u)%2!=c%2&&(d+=1);const p=Math.floor((u+d)/2)+h,_=Math.round(a*l);let m=Math.round((a+r)*l);(m-_)%2!=c%2&&(m+=1);const f=Math.floor((_+m)/2)+h;e.moveTo(p,_),e.lineTo(p,m),e.moveTo(u,f),e.lineTo(d,f)}_calcBoundingBox(e){const t=e.width,i=e.height,s=e.x-t/2,n=e.vertOffset,o=e.y-i/2+n,a=s,l=s+t,c=o,h=o+i,u=new r.Point(a,c),d=new r.Point(l,h);let p=Object(r.box)(u,d);const _=super._calcBoundingBox(e);return _&&(p=this._unionBox(p,_)),p}}class C extends v.a{_drawItemShapeUsingCSSPixels(e,t){const i=Math.round(t.height/2),s=t.x,r=t.vertOffset,n=t.y+r;e.moveTo(s,n-i),e.lineTo(s+i,n),e.lineTo(s,n+i),e.lineTo(s-i,n),e.lineTo(s,n-i)}_calcBoundingBox(e){const t=Math.round(e.height/2),i=e.x,s=e.vertOffset,n=e.y+s,o=i-t,a=i+t,l=n-t,c=n+t,h=new r.Point(o,l),u=new r.Point(a,c);let d=Object(r.box)(h,u);const p=super._calcBoundingBox(e);return p&&(d=this._unionBox(d,p)),d}}class P extends v.a{_drawItemShapeUsingCSSPixels(e,t){const i=t.width,s=t.height,r=s/2,n=(i-3)/3,o=t.x-i/2,a=t.vertOffset,l=t.y-r+a;e.moveTo(o,l),e.lineTo(o+3,l),e.bezierCurveTo(o+n,l-n,o+2*n,l+n,o+i,l),e.lineTo(o+i,l+r),e.bezierCurveTo(o+i-n,l+r+n,o+i-2*n,l+r-n,o+3,l+r),e.lineTo(o+3,l+s),e.lineTo(o,l+s),e.lineTo(o,l)}_calcBoundingBox(e){const t=e.width,i=e.height,s=i/2,n=e.x-t/2,o=e.vertOffset,a=e.y-s+o,l=n,c=n+t,h=a,u=a+i,d=new r.Point(l,h),p=new r.Point(c,u);let _=Object(r.box)(d,p);const m=super._calcBoundingBox(e);return m&&(_=this._unionBox(_,m)),_}}var x,T=i("gBDZ");class M extends v.a{setData(e,t){this._setBaseData(e,t);for(const i of this._items){const e=i.height;i.stepX=Math.round(e/2*.65)+.5,i.stepY=i.stepX;const t=i.stepX/2,s=this._getTextCache(i);if(null===s){i.shapeWidth=2*i.stepX,i.shapeHeight=2.5*i.stepY,i.vertOffset=this._calcVertOffset(i);continue}const r=s.textImageWidth,n=s.textImageHeight;i.shapeWidth=r+2*i.stepX,i.shapeHeight=n+2*t+i.stepY,i.vertOffset=this._calcVertOffset(i),i.textHorizOffset=this._getHorizontalTextOffset(i),i.textVertOffset=this._getVerticalTextOffset(i)}}_calcVertOffset(e){return e.vertOffset}_drawCorner(e,t,i,s,r){const n=Math.max(1,Math.floor(2*r));e.lineTo(t-n*s.prevPointSignX,i-n*s.prevPointSignY),e.arcTo(t,i,t+n*s.nextPointSignX,i+n*s.nextPointSignY,n)}_getArrowSize(e){return e.stepX}_getHorizontalTextOffset(e){return 0}_getVerticalTextOffset(e){return 0}_hasText(e){return Boolean(e.text)||Boolean(this._text)}_drawItemText(e,t,i){var r;const n=this._getTextCache(i);if(null===n)return
|
||
;const o=i.textHorizOffset||0,a=i.x+o,l=i.vertOffset,c=i.y+l+i.textVertOffset,h=(null===(r=i.style)||void 0===r?void 0:r.textColor)||this._textColor;n.paintTo(e,t,Object(s.ensureDefined)(h),a,c,T.a.Center,T.c.Middle)}}class I{constructor(e,t,i,s){this.prevPointSignX=e,this.prevPointSignY=t,this.nextPointSignX=i,this.nextPointSignY=s}}!function(e){e.rightUp=new I(1,0,0,1),e.rightDown=new I(0,1,-1,0),e.leftDown=new I(-1,0,0,-1),e.leftUp=new I(0,-1,1,0)}(x||(x={}));class L extends v.a{_drawItemShape(e,t,i){const s=t.pixelRatio,r=Math.max(1,Math.floor(s))%2?.5:0,n=this._lineWidth(t)%2?.5:0;let o=Math.round(i.height/2*s);(r+o)%1!=n%1&&(o+=.5);const a=Math.round(i.x*s)+r,l=Math.round((i.y+i.vertOffset)*s)+r,c=a-o,h=l-o,u=a+o,d=l+o;e.rect(c,h,u-c,d-h)}_calcBoundingBox(e){const t=e.height,i=Math.round(t/2),s=e.x-i,n=e.vertOffset,o=e.y+n-i,a=s,l=s+t,c=o,h=o+t,u=new r.Point(a,c),d=new r.Point(l,h);let p=Object(r.box)(u,d);const _=super._calcBoundingBox(e);return _&&(p=this._unionBox(p,_)),p}}class O extends v.a{_calcBoundingBox(e){const t=e.width,i=e.height,s=t/2,n=Math.round(i/3),o=e.x,a=e.vertOffset-2*n,l=e.y+a,c=o-s,h=o+s,u=l,d=l+i,p=new r.Point(c,u),_=new r.Point(h,d);let m=Object(r.box)(p,_);const f=super._calcBoundingBox(e);return f&&(m=this._unionBox(m,f)),m}}class A extends v.c{_drawItemShapeUsingCSSPixels(e,t){const i=t.width,s=t.height,r=t.x-i/2,n=t.vertOffset,o=t.y-s/2+n;e.moveTo(r,o),e.lineTo(r+i,o+s),e.moveTo(r,o+s),e.lineTo(r+i,o)}_calcBoundingBox(e){const t=e.width,i=e.height,s=e.x-t/2,n=e.vertOffset,o=e.y-i/2+n,a=s,l=s+t,c=o,h=o+i,u=new r.Point(a,c),d=new r.Point(l,h);let p=Object(r.box)(u,d);const _=super._calcBoundingBox(e);return _&&(p=this._unionBox(p,_)),p}}var E=i("23IT"),k=i("UAFa");i.d(t,"a",(function(){return V}));const D=new Map;D.set("PaneRendererArrowUp",class extends b{_isUp(){return!0}}),D.set("PaneRendererArrowDown",class extends b{_isUp(){return!1}}),D.set("PaneRendererCircleShape",y),D.set("PaneRendererCrossShape",w),D.set("PaneRendererDiamond",C),D.set("PaneRendererFlagShape",P),D.set("PaneRendererLabelUp",class extends M{_calcBoundingBox(e){const t=e.x-e.shapeWidth/2,i=e.x+e.shapeWidth/2,s=e.y+e.vertOffset,n=e.y+e.shapeHeight+e.vertOffset,o=new r.Point(t,s),a=new r.Point(i,n);return Object(r.box)(o,a)}_drawItemShape(e,t,i){const s=t.pixelRatio,r=this._lineWidth(t)%2?.5:0,n=Math.max(1,Math.floor(s))%2?.5:0,o=this._getArrowSize(i);let a=Math.round(o*s);(n+a)%1!=r%1&&(a+=.5);let l=Math.round(i.shapeWidth/2*s);(n+l)%1!=r%1&&(l+=.5);const c=Math.round(i.x*s)+n,h=Math.round((i.y+i.vertOffset)*s)+r,u=c-a,d=Math.round((i.y+i.vertOffset+o)*s)+r,p=c+a,_=c+l,m=Math.round((i.y+i.vertOffset+i.shapeHeight)*s)+r,f=c-l;e.moveTo(u,d),e.lineTo(c,h),e.lineTo(p,d),i.shapeWidth<=2*o?(e.lineTo(_,d),this._drawCorner(e,_,m,x.rightDown,s),this._drawCorner(e,f,m,x.leftDown,s),e.lineTo(f,d)):(this._drawCorner(e,_,d,x.rightUp,s),this._drawCorner(e,_,m,x.rightDown,s),this._drawCorner(e,f,m,x.leftDown,s),this._drawCorner(e,f,d,x.leftUp,s)),e.lineTo(u,d)}_getVerticalTextOffset(e){
|
||
return e.shapeHeight/2+this._getArrowSize(e)/2}_calcVertOffset(e){return Math.sign(e.vertOffset)>=0?e.vertOffset:e.vertOffset-e.shapeHeight}}),D.set("PaneRendererLabelDown",class extends M{_calcBoundingBox(e){const t=e.x-e.shapeWidth/2,i=e.x+e.shapeWidth/2,s=e.y-e.shapeHeight+e.vertOffset,n=e.y+e.vertOffset,o=new r.Point(t,s),a=new r.Point(i,n);return Object(r.box)(o,a)}_drawItemShape(e,t,i){const s=t.pixelRatio,r=this._lineWidth(t)%2?.5:0,n=Math.max(1,Math.floor(s))%2?.5:0,o=this._getArrowSize(i);let a=Math.round(o*s);(n+a)%1!=r%1&&(a+=.5);let l=Math.round(i.shapeWidth/2*s);(n+l)%1!=r%1&&(l+=.5);const c=Math.round(i.x*s)+n,h=Math.round((i.y+i.vertOffset)*s)+r,u=c+a,d=Math.round((i.y+i.vertOffset-o)*s)+r,p=c-a,_=c+l,m=Math.round((i.y+i.vertOffset-i.shapeHeight)*s)+r,f=c-l;e.moveTo(u,d),e.lineTo(c,h),e.lineTo(p,d),i.shapeWidth<=2*o?(e.lineTo(f,d),this._drawCorner(e,f,m,x.leftUp,s),this._drawCorner(e,_,m,x.rightUp,s),e.lineTo(_,d)):(this._drawCorner(e,f,d,x.leftDown,s),this._drawCorner(e,f,m,x.leftUp,s),this._drawCorner(e,_,m,x.rightUp,s),this._drawCorner(e,_,d,x.rightDown,s)),e.lineTo(u,d)}_getVerticalTextOffset(e){return-e.shapeHeight/2-this._getArrowSize(e)/2}_calcVertOffset(e){return Math.sign(e.vertOffset)<=0?e.vertOffset:e.vertOffset+e.shapeHeight}}),D.set("PaneRendererSquare",L),D.set("PaneRendererTriangleApexUp",class extends O{_drawItemShape(e,t,i){const s=i.width,r=i.height,n=Math.round(r/3),o=i.vertOffset-2*n,a=t.pixelRatio,l=this._lineWidth(t)%2?.5:0,c=Math.max(1,Math.floor(a)),h=c%2?.5:0;let u=Math.round(s*a);u%2!=c%2&&(u+=1);const d=Math.round(i.x*a)+h,p=Math.round((i.y+o)*a),_=d+u/2,m=Math.round((i.y+o+r)*a)+l,f=d-u/2;e.moveTo(d,p),e.lineTo(_,m),e.lineTo(f,m),e.lineTo(d,p)}}),D.set("PaneRendererTriangleApexDown",class extends O{_drawItemShape(e,t,i){const s=i.width,r=i.height,n=Math.round(r/3),o=i.vertOffset-n,a=t.pixelRatio,l=this._lineWidth(t)%2?.5:0,c=Math.max(1,Math.floor(a)),h=c%2?.5:0;let u=Math.round(s*a);u%2!=c%2&&(u+=1);const d=Math.round(i.x*a)+h,p=Math.round((i.y+o)*a)+l,_=d+u/2,m=Math.round((i.y+o+r)*a),f=d-u/2;e.moveTo(f,p),e.lineTo(_,p),e.lineTo(d,m),e.lineTo(f,p)}}),D.set("PaneRendererXCross",A);class V{constructor(e,t,i,s){this._items=[],this._invalidated=!1,this._renderer=null,this._isMarkersEnabled=n.enabled("source_selection_markers"),this._selectionData=null,this._plotIndex=null,this._topCoord=0,this._bottomCoord=0,this._study=e,this._series=t,this._model=i,this._plotName=s;const r=e.metaInfo().plots;for(let n=0;n<r.length;n++)if(r[n].id===this._plotName){this._plotIndex=n;break}this._colorProvider=Object(k.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),s),this._selectionIndexer=new d.SelectionIndexes(i.timeScale())}items(){return this._items}update(){this._invalidated=!0}renderer(){if(!this._study.properties().styles[this._plotName].visible)return null;if(!this._study.properties().styles[this._plotName].visible.value())return null;if(!this._scalesReady())return null;if(this._invalidated){const e=this._study.properties().styles[this._plotName];this._updateRenderer(e),
|
||
this._invalidated=!1}return this._renderer}_scalesReady(){const e=this._model.timeScale(),t=this._study.priceScale();return e&&null!==t&&!e.isEmpty()&&!t.isEmpty()}_updateImpl(){if(this._items=[],!this._scalesReady())return;const e=this._model.timeScale(),t=this._study.priceScale(),i=e.visibleBarsStrictRange();if(null===i||null===t)return;let r=this._series.nearestIndex(i.firstBar(),u.PlotRowSearchMode.NearestRight),n=this._series.nearestIndex(i.lastBar(),u.PlotRowSearchMode.NearestLeft);if(void 0===r||void 0===n)return;const o=this._study.offset(this._plotName);o>0?(r-=o,n+=o):(r+=o,n-=o);const a=this._study.getMinFirstBarIndexForPlot(this._plotName);if(a>n)return;r=Math.max(a,r);const l=this._study.data(),h=this._study.firstValue();if(null===h)return;const d=l.rangeIterator(r,n),p=this._getTranspValue();let _=[];const m=this._model.selection().isSelected(this._study);m?(_=this._selectionIndexer.indexes(),this._selectionData={points:[],hittestResult:c.HitTestResult.REGULAR,vertOffset:0,bgColors:[],barSpacing:e.barSpacing(),visible:!0}):(this._selectionIndexer.clear(),this._selectionData=null);const f=this._series.properties().style.value(),v=2===f?"lineStyle":3===f?"areaStyle":null;let b,S;v?(b=this._series.properties()[v].priceSource.value(),S=b):(b="high",S="low");const y=t.isInverted(),w=t.coordinateToPrice(t.height()*t.topMargin(),h),C=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),h);this._topCoord=y?C:w,this._bottomCoord=y?w:C;const P=Object(s.ensureNotNull)(this._model.paneForSource(this._study)).height(),x=this._study.properties().styles[this._plotName],T=x.color.value(),M=x.textColor?x.textColor.value():void 0,I=T,L=T,O=void 0===M?void 0:M,A=Object(s.ensureNotNull)(this._plotIndex),E=Object(g.createEmptyStyle)();for(;d.hasNext();){const e=d.next(),t=e.index,i=e.value,s=Math.floor(t+o),r=i[A+1];if(null==r)continue;const n=this._createItem(s,r,b,S);if(null!==n){if(this._colorProvider.isColorDefined()){n.style={color:I,borderColor:L,textColor:O};const e=this._colorProvider.getPlotPointStyle(i,E);this._fillItemWithPointStyle(n,e,p)}m&&-1!==_.indexOf(t)&&null!==this._selectionData&&(this._selectionData.points.push(n),this._selectionData.bgColors.push(this._model.backgroundColorAtYPercentFromTop(n.y/P))),this._items.push(n)}}this._convertItemsToCoordinates()}_fillItemWithPointStyle(e,t,i){const r=Object(s.ensureDefined)(e.style);if(void 0!==t.colors[g.ColorerType.Main]){r.color=Object(l.generateColor)(Object(s.ensureDefined)(t.colors[g.ColorerType.Main]),i);const e=i>9?i-10:0;r.borderColor=Object(l.generateColor)(r.color,e)}void 0!==t.colors[g.ColorerType.Text]&&(r.textColor=Object(l.generateColor)(Object(s.ensureDefined)(t.colors[g.ColorerType.Text]),i))}_updateRenderer(e){this._updateImpl();const t=this._model.timeScale(),i={},s=this._getTranspValue(),r=t.barSpacing(),n=this._calculateShapeHeight(r),o=this._study.properties().styles[this._plotName].location.value(),a=this._calculateVerticalOffset(o,n+n/2);i.barSpacing=r,i.items=this._items,
|
||
i.color=Object(l.generateColor)(this._study.properties().styles[this._plotName].color.value(),s),i.height=n,i.vertOffset=a;const c=this._study.properties().styles[this._plotName].plottype.value(),u=m.a[c],d=new h.CompositeRenderer;u&&d.append(this._createRenderer(u.paneRendererClass,i)),this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&null!==this._selectionData&&(this._selectionData.vertOffset=a,d.append(new p.SelectionRenderer(this._selectionData))),this._renderer=d}_createRenderer(e,t){const i=D.get(e);return new(Object(s.ensureDefined)(i))(t)}_getSeriesVal(e,t){const i=Object(_.barFunction)(e),s=this._series.data().valueAt(t);return null===s?null:i(s)}_getTranspValue(){let e=0;this._study.properties().transparency&&(e=this._study.properties().transparency.value(),e=Object(a.isNumber)(e)?e:50);const t=this._study.properties().styles[this._plotName];return t.transparency&&(e=t.transparency.value(),e=Object(a.isNumber)(e)?e:50),Object(o.clamp)(e,0,100)}_createItem(e,t,i,n){const o=this._study.properties().styles[this._plotName].location.value();if((null===t||0===t)&&o!==f.MarkLocation.Absolute)return null;let a;switch(o){case f.MarkLocation.AboveBar:const r=this._getSeriesVal(i,e);if(null===r)return null;a=r;break;case f.MarkLocation.BelowBar:const l=this._getSeriesVal(n,e);if(null===l)return null;a=l;break;case f.MarkLocation.Top:a=this._topCoord;break;case f.MarkLocation.Bottom:a=this._bottomCoord;break;case f.MarkLocation.Absolute:a=Object(s.ensureNotNull)(t);break;default:throw new Error("Bad value: "+o)}return new r.Point(e,a)}_convertItemsToCoordinates(){const e=this._model.timeScale(),t=this._study.priceScale();e.timedValuesToCoordinates(this._items);const i=Object(s.ensureNotNull)(this._study.firstValue());Object(s.ensureNotNull)(t).pointsArrayToCoordinates(this._items,i)}_calculateVerticalOffset(e,t){let i=0;switch(e){case f.MarkLocation.AboveBar:case f.MarkLocation.Bottom:i=-t;break;case f.MarkLocation.BelowBar:case f.MarkLocation.Top:i=t}return Object(s.ensureNotNull)(this._study.priceScale()).isInverted()&&(i*=-1),i}_calculateShapeHeight(e,t){let i=e;switch(t){case E.PlotSymbolSize.Tiny:i=.3*e;break;case E.PlotSymbolSize.Small:i=.6*e;break;case E.PlotSymbolSize.Normal:i=e;break;case E.PlotSymbolSize.Large:i=1.5*e;break;case E.PlotSymbolSize.Huge:i=2*e}return i}}},GUQs:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"b",(function(){return o}));var s=i("qFKp");function r(e){e.cancelable&&e.preventDefault()}function n(e){return t=>{r(t),e()}}function o(e){s.isChrome&&e.addEventListener("mousedown",e=>{if(1===e.button)return e.preventDefault(),!1})}},GVHu:function(e,t,i){"use strict";(function(e,s,r){
|
||
var n=i("Eyy1"),o=n.assert,a=n.ensureNotNull,l=i("hsV8").unpackNonSeriesData,c=i("n5al").symbolTitle,h=i("38az").StudyBarColorer,u=i("bGI9").StudyTrackPricePaneView,d=i("AXy7"),p=d.BandPaneView,_=d.BandBackgroundPaneView,m=d.HlineFillPaneView,f=i("hezA").StudyPriceAxisView,g=i("KtbP").PanePriceAxisView,v=i("wYrq").StudyPlotPaneView,b=i("lAUz").StudyBackgroundPaneView,S=i("PdIz").StudyPlotShapesPaneView,y=i("3FNV").StudyPlotCharsPaneView,w=i("B0lp").StudyPlotArrowsPaneView,C=i("1Ky4").StudyPlotBarsPaneView,P=i("KmlC").StudyPlotCandlesPaneView,x=i("kTaq").PlotFillPaneView,T=i("YtI2").AreaBackgroundPaneView,M=i("it7y").StudyDataWindowView,I=i("8qoI").StudyLegendView,L=i("TG9i").HHistDataWindowView,O=i("Kdr6").HHistLegendView,A=i("2kV1").StudyStatusView,E=i("jenN"),k=E.emptyStudyGraphics,D=E.loadStudyGraphics,V=E.saveStudyGraphics,B=E.LiveStudyGraphics,R=E.createGraphicsPaneViews,N=E.createGraphicsPriceAxisViews,j=i("XzZr").ChartApiInterface,F=i("Ocx9").DefaultProperty,W=i("kcTO").PriceFormatter,H=i("nEwK").VolumeFormatter,z=i("GH0z").PercentageFormatter,U=i("k9/m"),G=U.PlotList,q=U.PlotRowSearchMode,Y=U.mergeMinMax,K=i("972a").MarkLocation,J=i("0YCj"),Z=(i("cBZt").extractStudyId,i("TcSq").extractPineId,i("FQhm")),X=i("23IT"),$=X.LineStudyPlotStyle,Q=i("TmNs").StudyPriceLineAxisView,ee=i("w4Ji").studyPlotFunctionMap,te=i("w4Ji").studyEmptyPlotValuePredicate,ie=i("jy4L").makeNextStudyId,se=i("Kxc7"),re=i("IcDj").StudyBase,ne=i("i6cO").ColorerType,oe=i("H0vP").InvalidationMask,ae=i("Tmoa").colorToInteger,le=i("UAFa").createStudyPlotColorProvider,ce=i("txPx").getLogger("Chart.Study"),he=se.enabled("datasource_copypaste"),ue=se.enabled("study_symbol_ticker_description"),de=window.t("loading...");function pe(e,t,i){var s=new F(t,i,!0);s.addExclusion("visible"),s.addExclusion("precision"),s.addExclusion("minTick");for(var r=0;r<e.inputs.length;++r){var n=e.inputs[r];n.isHidden&&(s.addExclusion("inputs."+r.toString()),s.addExclusion("inputs."+n.id))}return s}function _e(e,t){if(t.plots)for(var i=0;i<t.plots.length;i++){var s=t.plots[i],r=s.id;if(!X.isColorerPlot(s)){var n={visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:$.Line,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1};X.isBarColorerPlot(s)&&(n.transparency=0),n.plottype=s.type,n.title=r,e.styles&&r in e.styles&&TradingView.merge(n,e.styles[r]),e.styles[r]=n}}}function me(e,t){var i=e.plots[t].target,s=e.defaults.ohlcPlots[i];return s&&X.isOhlcPlot(e.plots[t])&&X.isOhlcPlotStyleCandles(s)}function fe(e,t){return e&&e[t]&&e[t].hasOwnProperty("showLast")?e[t].showLast.value():null}class ge extends re{constructor(e,t,i,r){super(e,t,i,r),this._resolvedSymbols={},this._priceAxisViewsBase=[],this._graphicsPriceAxisViews=[],this._priceLinesAxisViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],this._chartApi=e._chartApi,this._properties.listeners().subscribe(this,this._onPropertiesChanged),this._properties.visible.listeners().subscribe(this,this.visibleChanged),
|
||
this._properties.visible.listeners().subscribe(this,this.processHibernate);for(var n=0;n<this._metaInfo.plots.length;n++){var o=this._metaInfo.plots[n].id,a=this.properties().styles[o];null!=a&&null!=a.visible&&a.visible.listeners().subscribe(this,this.processHibernate)}for(var l in this._metaInfo.graphics)for(var c in this._metaInfo.graphics[l]){var h=this._properties.graphics[l][c];h.visible&&h.visible.listeners().subscribe(this,this.processHibernate)}this._turnaroundCounter=0,this._turnaround="st"+this._turnaroundCounter,this._plotFields=[];var u=this.metaInfo().plots;if(u){n=0;for(var d=u.length;n<d;n++){c=u[n].id;this._plotFields.push(c)}}this._invalidateLastNonEmptyPlotRowCache(),this.m_data=new G(ee(this._metaInfo),te),this._graphics=new B,this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._studyModified=!1,this._tagsChanged=new s,this._labelPaneViews=[],this.createViews();var p=this;this._handler=function(e){p.onData(e)},this._handler.isTVScriptStrategy=this._metaInfo.isTVScriptStrategy,this._recreatePriceFormattingDependencies();p=this;this._properties.precision.listeners().subscribe(this,this._precisionChanged),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.inputs.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),se.enabled("update_study_formatter_on_symbol_resolve")&&e.mainSeries().dataEvents().symbolResolved().subscribe(this,this._recreatePriceFormattingDependencies),e.mainSeries().dataEvents().symbolResolved().subscribe(this,this.invalidateTitleCache);p=this;var _={};this._simplePlotsCount=r.plots.filter((function(e,t){if(X.isLinePlot(e))return!0;if(X.isOhlcPlot(e)){var i=p.metaInfo().plots[t].target;return!_[i]&&(_[i]=i,!0)}return!1})).length,this._properties.showInDataWindow.listeners().subscribe(e,e.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(e.mainSeries(),e.mainSeries().invalidateBarStylesCache),this._childStudyByRebind=new s,this._formatterChanged=new s,this._priceStepChanged=new s,this._ongoingDataUpdate=Promise.resolve(),this._isDestroyed=!1,this._definitionsViewModel=null}lastValueData(e,t,i){var s={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return s;var r=this._model.timeScale().visibleBarsStrictRange();if(null===r)return s;if(!this.properties().visible.value())return s;var n,o,a=this.properties().styles,l=this.properties().ohlcPlots;if(a&&a[e]&&(n=a[e]),l&&l[e]&&(n=l[e]),!n||!n.visible.value())return s;var c=this.metaInfo().plots;for(o=0;o<c.length&&!(c[o].id===e||X.isOhlcClosePlot(o)&&c[o].target===e);o++);var h=o+1,u=this.offset(e),d=this.nearestIndex(r.lastBar()-u,q.NearestLeft,h);if(null==d)return s
|
||
;var p=this._lastNonEmptyPlotRow(h),_=null!==p&&r.contains(p.index),m=null!==p?p.value:null,f=t||_?m:this.data().valueAt(d);if(!f||!isNumber(f[h]))return s;var g={noData:!1},v=f[h];i&&(g.price=v);var b=this.firstValue(!0);if(!isNumber(b))return s;g.text=this.priceScale().formatPrice(v,b),g.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(v),g.formattedPricePercentage=this.priceScale().formatPricePercentage(v,b);const S=le(this.metaInfo(),this.properties(),e).getPlotPointStyle(f).colors[ne.Main];return g.color=S||n.color.value(),g.floatCoordinate=this.priceScale().priceToCoordinate(v,b),g.coordinate=g.floatCoordinate,g.item=f,g}isFailed(){return this._failed}isLoading(){return this._loading}series(){return this._series}model(){return this._model}_invalidateLastNonEmptyPlotRowCache(){this._lastNonEmptyPlotRowCache={}}clearData(){this._invalidateLastNonEmptyPlotRowCache(),this.data().clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}}onTagsChanged(){return this._tagsChanged}properties(){return this._properties}state(e,t){var i={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};this.metaInfo()instanceof J?i.metaInfo=TradingView.clone(this.metaInfo().state()):(i.metaInfo=TradingView.clone(this.metaInfo()),i.metaInfo.id=J.parseIdString(i.metaInfo.id+(i.metaInfo.version?"-"+i.metaInfo.version:"")).fullId),e&&(i.data=this.data().state(),i.data.symbols=this._resolvedSymbols,i.data.graphics=V(this.graphics()),i.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(i.ownerSource=this.ownerSource().id());for(var s=0;s<this._metaInfo.inputs.length;s++)if("bar_time"===this._metaInfo.inputs[s].type){var r=this._metaInfo.inputs[s].id,n=i.state.inputs[r];if(n<0){var o=this._rightOffsetToUnixTime(-n);i.state.inputs[r]=o&&o>=0?o:0}}return this._isChildStudy&&J.patchChildStudyMetaInfoState(i),i}_plotsForAlert(){var e=this,t=this._metaInfo,i=[X.isLinePlot,X.isShapesPlot,X.isCharsPlot,X.isArrowsPlot,X.isOhlcPlot,X.isAlertConditionPlot];return t.plots.map((function(e,t){return e.pinePlotIndex=t,e})).filter((function(e){return i.some((function(t){return t(e)}))})).map((function(i){var s={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(s.title=t.styles[i.id].title||"",s.text=t.styles[i.id].text||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(s.ohlcTitle=t.ohlcPlots[i.target].title),s}))}_collectDepsForAlert(){throw new Error("Not implemented")}idForAlert(){return re.prototype.idForAlert.call(this)}dependenciesForAlerts(){throw new Error("Not implemented")}_hasAvailableAlertPlots(){return!1}_hasAlertablePlots(){return(this.metaInfo().plots||[]).some((function(e){return"line"===e.type}))}_hasAlertConditions(){if(this.metaInfo().plots.some(X.isAlertConditionPlot))return!0;var e=this.stateForAlert();return Boolean(e.alerts&&e.alerts.conditions)}_hasAlertFunction(){const e=this.metaInfo();return Boolean(e.hasAlertFunction)}_isAlertFeatureEnabled(){return!1}hasStateForAlert(){
|
||
return this._isAlertFeatureEnabled()&&!this.isFailed()&&(this.metaInfo().isTVScript?this._hasAlertConditions()||this._hasAvailableAlertPlots()||this._hasAlertFunction():this._hasAlertablePlots())}stateForAlert(){throw new Error("Not implemented")}isSavedInStudyTemplates(){for(var e=0;e<this._metaInfo.inputs.length;e++)if("bar_time"===this._metaInfo.inputs[e].type)return!1;return!0}restoreData(e){this._invalidateLastNonEmptyPlotRowCache(),this.data().restoreState(e),this._resolvedSymbols=e.symbols,this._graphics=e.graphics?D(e.graphics):k(),this._postProcessGraphics(),this._plotOffsets=e.plotOffsets,this._loading=!1}restart(e){this._restarting=!0,this.clearData(),(e||se.enabled("stop_study_on_restart"))&&this.stop(),setTimeout(this.start.bind(this),0)}stop(e){if(!0===e&&this._children)for(var t=0;t<this._children.length;++t)this._children[t].stop(!0);this._stopStudyOnServer(),this.clearData(),this._unsubscribeExtendedHours(),this.recalculate()}resolvedSymbolInfoBySymbol(e){return this._resolvedSymbols&&e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null}_allInputsAreValid(){for(var e=0;e<this._metaInfo.inputs.length;e++)if("bar_time"===this._metaInfo.inputs[e].type){var t=this._metaInfo.inputs[e].id,i=this._properties.inputs[t].value();if(void 0===i||null==i)return!1}return!0}sourceId(){return this._studyId}parentSource(){return this._source||this._series}symbolSource(){return this.parentSource().symbolSource()}source(){return this.parentSource()}ownerSource(){return this._isChildStudy?this._source:re.prototype.ownerSource.call(this)}getAllOwnerSources(){for(var e=[],t=this.ownerSource();null!=t;)e.push(t),t=t.ownerSource();return e}isChildStudy(){return!!this._isChildStudy}setChild(e){e instanceof ge&&e.source()===this&&(this._children||(this._children=[]),-1===this._children.indexOf(e)&&this._children.push(e))}unsetChild(e){if(e instanceof ge&&e.source()===this&&this._children){var t=this._children.indexOf(e);~t&&this._children.splice(t,1)}}hasChildren(){return!(!this._children||!this._children.length)}getAllChildren(){if(!Array.isArray(this._children))return[];for(var e=this._children.slice(),t=0;t<e.length;++t)for(var i=e[t].getAllChildren(),s=0;s<i.length;++s)~e.indexOf(i[s])||e.push(i[s]);return e}_debugId(){var e=[];return this._studyId&&e.push(this._studyId),e.push(this._metaInfo.fullId),e.push(this._metaInfo.description),JSON.stringify({study:e})}isStarted(){return!!this._studyId}_isStopped(){return!this.isStarted()}isRestarting(){return!!this._restarting}isVisible(){if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)return!0;for(var e in this._metaInfo.graphics)for(var t in this._metaInfo.graphics[e]){var i=this.properties().graphics[e][t];if(!i.visible||i.visible.value())return!0}return!(!this._metaInfo.isTVScriptStrategy&&!this._metaInfo.hasAlertFunction)}start(e,t){var i=this._model.mainSeries();if(i.isStarted()){this._isChildStudy&&this._source.isHibernated()&&this._source.start();var s=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible()
|
||
;!this._chartApi||!this._chartApi.connected()||s&&!0!==t||this._allSymbolsAreResolved().then(function(){this._startAfterSymbolsResolved(e,t)}.bind(this)).catch(function(e){ce.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))}else i.dataEvents().completed().subscribe(this,(function(){this.start(e,t)}),!0)}_getStudyIdWithLatestVersion(){var e=J.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t}_startAfterSymbolsResolved(e,t){if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);J.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs({keepOptionalSymbolsEmpty:!0}),this._createStudyOnServer(),this._subscribeExtendedHours(),this.onStart.fire(),!0===e&&this._children))for(var i=0;i<this._children.length;++i)this._children[i].start(!0,t)}}_createStudyOnServer(){var e=this._getStudyIdWithLatestVersion();this._studyId=ie(),this._incrementTurnaround(),this._studyName=e,this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series.seriesSource().instanceId(),this._studyName,this._inputs,this._handler,this._isChildStudy)}_modifyStudyOnServer(e){this._chartApi.modifyStudy(this._studyId,this._turnaround,e,this._handler)}_stopStudyOnServer(){this._chartApi&&this._chartApi.connected()&&this.isStarted()&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),this._studyId=null}_rightOffsetToUnixTime(e){var t=null;if(this._series.bars().size()>=e){var i=a(this._series.bars().lastIndex())-e;t=a(this._series.bars().valueAt(i))[TradingView.TIME_PLOT]}return t}inputsForAlert(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t}inputsForAlertState(){return this.inputs()}_prepareInputValue(e,t){var i=e.id;if("symbol"===e.type){var s=this._properties.inputs[i].value(),r=this._resolvedSymbols&&this._resolvedSymbols[this._resolvedSymbolKey(s)];if(""===s&&e.optional){if(t&&t.keepOptionalSymbolsEmpty)return s;s=this._model.mainSeries().symbol(),r=this._model.mainSeries().symbolInfo()}if(t&&t.symbolsForDisplay){if(r)if(ue){switch(this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value()){case"description":s=r.description;break;case"ticker-and-description":s=`${r.name}, ${r.description}`;break;case"ticker":s=r.name}}else s=c(r,t.noExchanges)}else r&&(s=r.ticker||r.full_name),!this.isPine()&&t&&t.symbolsForChartApi&&(s=this.getSymbolString(s));return s}if("bar_time"===e.type){var n=this._properties.inputs[i].value();if(n<0){var o=this._rightOffsetToUnixTime(-n);n=o&&o>=0?o:n}return n}if(this._metaInfo.isTVScript||this._metaInfo.pine){if("text"===i)return this._metaInfo.defaults.inputs.text;if("pineId"===i)return this._metaInfo.scriptIdPart
|
||
;if("pineVersion"===i)return this._metaInfo.pine?this._metaInfo.pine.version:"-1";if("color"===e.type&&this._metaInfo.isRGB){var a=this._properties.inputs[i].value();return ae(a)}return this._properties.inputs[i].value()}return this._properties.inputs[i].value()}_rebindToSource(e,t){var i=this.parentSource();if(this._isChildStudy){var s;this._source.unsetChild(this),delete this._nonPriceParent;var r=null;if(e===this._model.mainSeries())delete this._source,delete this._isChildStudy,delete this._ownerSource,s=this._series.seriesSource().instanceId(),r=j.REBIND_STUDY_CHILD_TO_STANDALONE;else{if(!(e instanceof ge))return ce.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source=e,s=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this.disablePriceRangeReady(),this._chartApi.rebindStudy(this._studyId,this._turnaround,s,this._studyName,t,this._handler,r)}else{if(!(e instanceof ge))return ce.logError("Unable to rebind study to source of this type"),!1;var n=e.isHibernated();n&&e.start();var o=!1;if(this._canCreateStudyWithRebindType(j.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),this.disablePriceRangeReady(),o=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,j.REBIND_STUDY_STANDALONE_TO_CHILD)),!o)return n&&e.stop(),!1;this._isChildStudy=!0,this._ownerSource=e,this._source=e,this._source.setChild(this),this._childStudyByRebind.fire()}var a=this.m_priceScale,l=e.priceScale();if(a!==l){var c=this._model.paneForSource(this),h=this._model.paneForSource(e);c===h&&h.move(this,l,!0)}const u=this.parentSource();return i.formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),u.formatterChanged().subscribe(this,this._onSourceFormatterChanged),i.priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),u.priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),i.currencyChanged().unsubscribeAll(this),u.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),i.unitChanged().unsubscribeAll(this),u.unitChanged().subscribe(this,this._onSourceUnitChanged),i.priceRangeReadyChanged().unsubscribeAll(this),u.priceRangeReadyChanged().subscribe(this,this._onSourcePriceRangeReadyChanged),this._recreatePriceFormattingDependencies(),!0}childStudyByRebind(){return this._childStudyByRebind}_changeInputsImpl(e,t){var i=this.source(),s=this._properties.inputs&&this._properties.inputs.state(),r=J.getSourceIdByInputs(this._metaInfo.inputs,s),n=!0;if(r)if("high"===r||"open"===r||"low"===r||"close"===r||"hl2"===r||"ohl3"===r||"ohlc4"===r)i=this._model.mainSeries();else for(var o=this._model.dataSources().filter((function(e){return e instanceof ge&&e.canHaveChildren()})),a=0;a<o.length;++a)if(o[a].sourceId()===r){i=o[a];break}if(i!==this.source()){if(!this._rebindToSource(i,e)&&s)for(var l in t)if(t.hasOwnProperty(l)&&t[l]!==e[l]&&0===e[l].indexOf(r)){var c=this._properties.inputs[l],h=t[l];c.setValue(h),n=!1;break}
|
||
}else this._incrementTurnaround(),this.disablePriceRangeReady(),this._modifyStudyOnServer(e);this.invalidateTitleCache(),n&&(this._studyModified=n)}_incrementTurnaround(){this._turnaround="st"+ ++this._turnaroundCounter}_tryChangeInputs(){var e=TradingView.clone(this._inputs);this.isStarted()&&this._chartApi.connected()?this._allInputsAreValid()?this._allSymbolsAreResolved().then(function(){var t=this.inputs({keepOptionalSymbolsEmpty:!0});const i=JSON.stringify(t)!==JSON.stringify(this._inputs);this._isStopped()?i&&this.disablePriceRangeReady():i&&(this._changeInputsImpl(t,e),this._inputs=t)}.bind(this)).catch(function(e){ce.logError("ERROR: "+this._debugId()+" _tryChangeInputs: cannot modify study, "+e)}.bind(this)):this.stop():(this.stop(!0),this.start(!0)),this._tagsChanged.fire()}testInputValue(e,t){if(!J.canBeChild(this._metaInfo)||!J.isSourceInput(e))return!0;var i=this._properties.inputs&&this._properties.inputs[e.id];if(!i)return!0;var s=ge.getInputRebindType(e,i.value(),t);return!!this._canCreateStudyWithRebindType(s)}_canCreateStudyWithRebindType(e){return e!==j.REBIND_STUDY_STANDALONE_TO_CHILD||this._chartApi.isCanCreateStudy(!0)}changeStyles(){var e=void 0!==this._metaInfo.inputs.find((function(e){return"symbol"===e.type}));!this.isStarted()&&!e||this._restarting||(this._inputs?this._tryChangeInputs():this._chartApi&&this._chartApi.connected()&&this.restart(),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),this.createViews(),this.recalculate(!0),this.updateAllViews())}_onPropertiesChanged(){this.changeStyles(),Z.emit("study_properties_changed",this._id)}_isModifiedStudyInputs(e){if(void 0===this._oldStudyInputs)return this._oldStudyInputs=e,!0;var t=Object.keys(this._oldStudyInputs);return o(t.length===Object.keys(e).length,"keys quantity should be equal"),t.forEach((function(t){o(e.hasOwnProperty(t),"key '"+t+"' should existing in studyInputs"),this._oldStudyInputs[t]!==e[t]&&(this._oldStudyInputs=e)}),this),this._oldStudyInputs===e}_pinePatchProps(){throw new Error("Not implemented")}visibleChanged(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()}processHibernate(){this.isHibernateAllowed()&&(!this.isStarted()&&this.isVisible()&&this.start(),this.isStarted()&&!this.isVisible()&&this.stop())}isHibernated(){return!this.isVisible()&&!this.isStarted()}isHibernateAllowed(){return!this.hasChildren()}priceLabelText(e){var t,i=this._metaInfo.styles,s=this._metaInfo.ohlcPlots;i&&i[e]&&(t=i[e]),s&&s[e]&&(t=s[e]);var r=t.title;return 1!==this._simplePlotsCount||X.isPlotTitleDefined(r)?this._metaInfo.is_price_study&&r!==this._metaInfo.shortDescription?""===r?this._metaInfo.shortDescription:this._metaInfo.shortDescription+":"+r:r:this._metaInfo.shortDescription}createPriceAxisView(e){return new f(this,{plotIndex:e})}createPriceLineAxisView(e){return new Q(this,e)}createViews(){this._priceAxisViewsBase=[],this._priceLinesAxisViews=[],this._paneViews=[],this._labelPaneViews=[];var e,t,i,s,r={};if(this._priceAxisViewsCache={},
|
||
this.metaInfo().plots)for(var n=0;n<this.metaInfo().plots.length;n++){var o=this.metaInfo().plots[n];if(!X.isNonVisualPlot(o)){var a=this.metaInfo().plots[n].id;if(X.isBgColorerPlot(o))this._paneViews.push(new b(this,this._series,this._model,a));else if(X.isShapesPlot(o))this._paneViews.push(new S(this,this._series,this._model,a));else if(X.isCharsPlot(o))this._paneViews.push(new y(this,this._series,this._model,a));else if(X.isArrowsPlot(o))this._paneViews.push(new w(this,this._series,this._model,a));else if(X.isOhlcPlot(o)){var l=this.metaInfo().plots[n].target;if(r[l])continue;r[l]=l,e=this.metaInfo(),t=n,i=void 0,s=void 0,i=e.plots[t].target,(s=e.defaults.ohlcPlots[i])&&X.isOhlcPlot(e.plots[t])&&X.isOhlcPlotStyleBars(s)?this._paneViews.push(new C(this,this._series,this._model,l)):me(this.metaInfo(),n)&&this._paneViews.push(new P(this,this._series,this._model,l));var c=this.createPriceAxisView(l);this._priceAxisViewsCache[l]=c,this._priceAxisViewsBase.push(c),this._labelPaneViews.push(new g(c,this,this._model))}else{c=this.createPriceAxisView(a);this._priceAxisViewsCache[a]=c,this._priceAxisViewsBase.push(c),this._priceLinesAxisViews.push(this.createPriceLineAxisView(a)),this._paneViews.push(new v(this,this._series,this._model,a)),this.properties().styles[a].trackPrice.value()&&this._paneViews.push(new u(this,a)),this._labelPaneViews.push(new g(c,this,this._model))}}}if(this._properties.bands)for(n=0;n<this._properties.bands.childCount();n++)this._properties.bands[n].visible.value()&&this._paneViews.push(new p(this._properties.bands[n],this));this._properties.bandsBackground&&this._paneViews.push(new _(this));var h=this._paneViews;R(this,this.model()).then(function(e){for(var t=0;t<e.length;t++)h.push(e[t]);this._model.lightUpdate()}.bind(this)),this._properties.areaBackground&&this._paneViews.push(new T(this));var d=function(e){return this._metaInfo.plots.some((function(t){return X.isColorerPlot(t)&&t.target===e}))}.bind(this);if(this._properties.filledAreas&&this._metaInfo.filledAreas)for(n=0;n<this._metaInfo.filledAreas.length;++n){var f=this._metaInfo.filledAreas[n],E=this._properties.filledAreasStyle[f.id],k=d(f.id);f.type===J.FilledArea.TYPE_PLOTS||k?this._paneViews.push(new x(this,f,E)):f.type===J.FilledArea.TYPE_HLINES?this._paneViews.push(new m(this,f,E)):ce.logWarn("Unsupported filledArea type: "+f.type)}this._dataWindowView||(this._dataWindowView=this.metaInfo().graphics&&"hhists"in this.metaInfo().graphics?new L(this,this._model):new M(this,this._model)),this._legendView||(this._legendView=this.metaInfo().graphics&&"hhists"in this.metaInfo().graphics?new O(this,this._model):new I(this,this._model)),this._statusView||(this._statusView=new A(this,this._model.properties().scalesProperties.textColor)),this._concatPriceAxisViews()}_concatPriceAxisViews(){this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._graphicsPriceAxisViews,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)}recalculate(e){var t=this._model.paneForSource(this);this._model.recalculatePane(t,e),
|
||
this._model.updateSource(this)}data(){return this.m_data}metaInfo(){return this._metaInfo}graphicsInfo(){return this._metaInfo.graphics}status(){return this._status}graphics(){return this._graphics}turnaround(e){var t=this.source();return!0===e?(t===this._series?t.seriesSource().turnaround():t.turnaround(!0))+"_"+this._turnaround:this._turnaround}_checkTurnaround(e){return e===this._turnaround||e===this._model.mainSeries().seriesSource().turnaround()||e===this.turnaround(!0)}_getStatusTextOnStudyError(e){var t=e.split(":",2)[0];return t.length>0?window.t(t):""}_handleStudyError(e){this._failed=!0,this._loading=!1,this.clearData(),this._setStatus(this._getStatusTextOnStudyError(e)),this._statusView.update(),this._model.updateSource(this)}_onStudyLoading(){this._failed=!1,this._loading=!0,this._setStatus(de),this._statusView.update(),this._model.updateSource(this)}_onStudyError(e){this._handleStudyError(e),this._enablePriceRangeReady()}_onStudyCompleted(e){this._studyModified&&(this.clearData(),this._studyModified=!1),this._loading=!1,this._setStatus(""),this._statusView.update();var t=this._model.paneForSource(this);this._model.recalculatePane(t),this._updateSources();var i=oe.full();null!==this._model.appliedTimeFrame().value()&&i.lockVisibleTimeRangeOnResize(),this._model.invalidate(i)}onData(e){switch(e.method){case"study_loading":this._onStudyLoading();break;case"study_error":this._onStudyError(e.params[2]);break;case"study_completed":if(!this._checkTurnaround(e.params[1]))return;this._onStudyCompleted(e.params[e.params.length-1]);break;case"data_update":if(e.params.customId!==this.sourceId()||!this._checkTurnaround(e.params.turnaround))return;o(!!e.params.nonseries,"data.params.nonseries is missing"),this._onDataUpdate(e.params.plots,e.params.nonseries);break;case"clear_data":this._checkTurnaround(e.params.turnaround)&&this.clearData()}}_onDataUpdate(e,t){this._studyModified&&(this.clearData(),this._studyModified=!1);var i=l(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then((function(){return i}),(function(){return i})).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate}_onDataUnpacked(e,t,i){this._isDestroyed||("nochange"!==t&&this._processPlotOffsets(i),this.transformData(e),this._mergeData(e),null!==i&&(i.indexes_replace?(o("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._onDataUpdated(e,i,t),this.priceRangeReady()||this._enablePriceRangeReady())}_onDataUpdated(e,t,i){if(this.hasBarColorer()&&e.length>0){var s=this.barColorer().firstColoredBar(e[0].index);this._model.mainSeries().invalidateBarStylesCache(s)}null!==t&&this._postProcessGraphics();var r=this._model.paneForSource(this);this._model.recalculatePane(r),this._updateSources()}transformData(e){}moveData(e){this._ongoingDataUpdate=this._ongoingDataUpdate.then(function(){this._invalidateLastNonEmptyPlotRowCache(),this.data().move(e)}.bind(this))}
|
||
replaceData(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.data().remove(e+1),this.data().addTail(i,t)}_updateSources(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())}static processPlotOffsets(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})}_processPlotOffsets(e){ge.processPlotOffsets(this,e)}_mergeData(e){this._invalidateLastNonEmptyPlotRowCache(),this.data().merge(e)}_postProcessGraphics(){this._graphicsPriceAxisViews=N(this),this._concatPriceAxisViews()}_getNonPriceParent(){if(this._nonPriceParent)return this._nonPriceParent;for(var e=this.source();e instanceof ge;){var t=e.metaInfo();if(!t.is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}}firstValue(e){if(!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study){var t=this._model.timeScale().visibleBarsStrictRange();if(null===t)return null;var i=t.firstBar(),s=t.lastBar(),r=null,n=this,o=n._metaInfo.plots;return null===r&&this.data().range(i,s).each((function(t,i){for(var s=0;s<o.length;++s)if(!X.isColorerPlot(o[s])){var a=i[s+1];if(null!=a){var l=o[s].id,c=n.properties().styles[l];if(c.visible&&c.visible.value()&&!(e&&Math.abs(a)<1e-10))return r=a,!0}}return!1})),this._nonPriceFirstValue=r,null!==r?r:this._bandsFirstValue(e)}if(this._isChildStudy){var a=this._getNonPriceParent();if(a&&this.priceScale()===a.priceScale())return void 0!==a._nonPriceFirstValue?a._nonPriceFirstValue:a.firstValue()}return this._series.firstValue()}static offset(e,t){var i=0;return e._plotOffsets&&void 0!==e._plotOffsets[t]&&(i+=e._plotOffsets[t]),void 0!==e._plotOffsetsMetaInfoOverride[t]?i+=e._plotOffsetsMetaInfoOverride[t]:e.properties().offsets&&void 0!==e.properties().offsets[t]&&(i+=e.properties().offsets[t].val.value()),e.properties().offset&&(i+=e.properties().offset.val.value()),i}offset(e){return ge.offset(this,e)}priceRange(e,t){if(TradingView.isInteger(e)){if(TradingView.isInteger(t)){for(var i,s,n=null,o=this._metaInfo,a=[],l=null,c=0;c<o.plots.length;++c){var h=o.plots[c];if(!X.isPlotWithTechnicalValues(h)){var u,d=o.plots[c].id;if(X.isOhlcPlot(h)){var p=o.plots[c].target;u=this.properties().ohlcPlots[p]}else u=this.properties().styles[d];if(u.visible.value()){if(s=null,u.location&&(s=u.location.value()),!i){var _=[K.Absolute,K.Top,K.Bottom].indexOf(s)<0;i=(X.isShapesPlot(h)||X.isCharsPlot(h))&&_||X.isArrowsPlot(h)}if(X.isLinePlot(h)||(X.isShapesPlot(h)||X.isCharsPlot(h))&&u.location.value()===K.Absolute||X.isOhlcPlot(h)){var m={name:d,offset:this.offset(d)},f=this.properties().styles[d].plottype.value();if(!this.properties().skipHistogramBaseOnAutoScale&&[$.Histogram,$.Columns,$.Area].indexOf(f)>=0){var g=this.properties().styles[d].histogramBase.value(),v=this.data().minMaxOnRangeCached(e,t,[m]);isNumber(g)&&null!==v&&(l=Y(l,{min:g,max:g}),l=Y(l,v))}else a.push(m)}}}}var b=this.data().minMaxOnRangeCached(e,t,a);if(b=Y(l,b),i){a=[{name:"low",offset:0},{name:"high",offset:0}]
|
||
;var S=this.series().data().bars().minMaxOnRangeCached(e,t,a);b=Y(b,S)}if(null!==b&&(n=new r(b.min,b.max)),o.bands)for(c=0;c<o.bands.length;c++)if(this.properties().bands[c].visible.value()){g=this.properties().bands[c].value.value();if(!isNumber(g))continue;n?n.apply(g,g):n=new r(g,g)}return this._postProcessPriceRange(n)}ce.logDebug("priceRange: incorrect endBar")}else ce.logDebug("priceRange: incorrect startBar")}_postProcessPriceRange(e){if(e&&e.minValue()===e.maxValue()&&!this.metaInfo().is_price_study){var t=.005*e.minValue();e=new r(e.minValue()-t,e.maxValue()+t)}var i=this.priceScale();return i&&i.isLog()&&e?new r(this.priceScale().priceToLogical(e.minValue()),this.priceScale().priceToLogical(e.maxValue())):e}paneViews(){return this.isSourceHidden()?null:this._paneViews}labelPaneViews(){return this.isSourceHidden()?null:this._labelPaneViews}dataWindowView(){return this._dataWindowView}legendView(){return this._legendView}statusView(){return this._statusView}priceAxisViews(e,t){return this.properties().oldShowLastValue&&!this.properties().oldShowLastValue.value()?null:e.findTargetPriceAxisViews(this,t,this._priceAxisViews,this._priceLinesAxisViews)}_showLastValueOnPriceScale(){return this._model.properties().scalesProperties.showStudyLastValue.value()}hasBarColorer(){for(var e=0;e<this._metaInfo.plots.length;++e)if(X.isBarColorerPlot(this._metaInfo.plots[e]))return!0;return!1}barColorer(){for(var e=null,t=0;t<this._metaInfo.plots.length;++t)if(X.isBarColorerPlot(this._metaInfo.plots[t])){var i=new h(this,t);null==e?e=i:e.pushBackBarColorer(i)}if(null==e)throw new Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return e}base(){return 0}_priceScaleByProperties(){if("default"===this.properties().precision.value())return null;var e=parseInt(this.properties().precision.value());return isFinite(e)?Math.pow(10,e):null}_formatterByProperties(){var e=this._priceScaleByProperties();return null!==e?new W(e):null}_priceScaleByMetaInfo(){var e=this.metaInfo().format,t=isNumber(e.precision)?Math.pow(10,e.precision):void 0;if("price"===e.type||"percent"===e.type)return t||100;if("volume"===e.type){if(void 0===e.precision){var i=this.series().symbolInfo();if(null!==i&&isNumber(i.volume_precision))return Math.pow(10,i.volume_precision)}return 1}return"inherit"===e.type||ce.logWarn("Unsupported format type: "+e.type),null}_formatterByMetaInfo(){var e=this.metaInfo().format,t=isNumber(e.precision)?Math.pow(10,e.precision):void 0;switch(e.type){case"price":return new W(t);case"volume":var i=e.precision;if(void 0===i){var s=this.series().symbolInfo();i=s&&isNumber(s.volume_precision)?s.volume_precision:0}return new H(i);case"percent":return new z(t);case"inherit":return null;default:return ce.logWarn("Unsupported format type: "+e.type),null}}_onSourceFormatterChanged(){null===this._formatter&&(null!==this.priceScale()&&this.priceScale().updateFormatter(),this._formatterChanged.fire())}_onSourcePriceStepChanged(){null===this._priceStep&&this._priceStepChanged.fire()}_precisionChanged(){
|
||
this._recreatePriceFormattingDependencies()}_recreatePriceFormattingDependencies(){this._recreateFormatter(),this._recreatePriceStep()}_recreateFormatter(){this._formatter=this._tryCreateFormatter(),this._formatterChanged.fire(),null!==this.priceScale()&&this.priceScale().updateFormatter(),this._model.fullUpdate()}_recreatePriceStep(){var e=null,t=this._tryToGetPriceScale();null!==t&&(e=1/t),this._priceStep!==e&&(this._priceStep=e,this._priceStepChanged.fire())}_tryToGetPriceScale(){var e=this._priceScaleByProperties();return null===e&&(e=this._priceScaleByMetaInfo()),e}_tryCreateFormatter(){var e=this._formatterByProperties();return null===e&&(e=this._formatterByMetaInfo()),e}formatter(){return this._formatter||this.parentSource().formatter(!1)}priceStep(){return this._priceStep||this.parentSource().priceStep(!1)}setOwnerSource(e){super.setOwnerSource(e),this._recreatePriceFormattingDependencies()}nearestIndex(e,t,i){if(TradingView.isInteger(e)){var s=this.data().search(e,t,i);return null!==s?s.index:void 0}ce.logDebug("nearestIndex: incorrect logicalPoint")}_lastNonEmptyPlotRow(e){if(!TradingView.isInteger(e))return ce.logDebug("_lastNonEmptyPlotRow: incorrect plotIndex"),null;if(void 0!==this._lastNonEmptyPlotRowCache[e])return this._lastNonEmptyPlotRowCache[e];var t=this.data().findLast((function(t,i){return void 0!==i[e]}),1e3);return null===t?null:(this._lastNonEmptyPlotRowCache[e]=t,this._lastNonEmptyPlotRowCache[e])}updateAllViews(){for(var e=0;e<this._paneViews.length;e++)this._paneViews[e].update();for(e=0;e<this._labelPaneViews.length;e++)this._labelPaneViews[e].update();this._dataWindowView.update(),null!==this._legendView&&this._legendView.update(),this._statusView.update();for(e=0;e<this._priceAxisViews.length;e++)this._priceAxisViews[e].update();this._priceLinesAxisViews.forEach((function(e){e.update()}))}tags(){return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]}onExtendedHoursChanged(){this.restart(!0)}hasSymbolInputs(){for(var e=this._metaInfo.inputs.length;e--;)if("symbol"===this._metaInfo.inputs[e].type)return!0;return!1}canOverrideMinTick(){return!1}_subscribeExtendedHours(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.onExtendedHoursChanged().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)}_unsubscribeExtendedHours(){this._isSubscribedToExtendedHours&&(this._series.onExtendedHoursChanged().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)}removeByRemoveAllStudies(){return!0}canHaveChildren(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!J.canHaveChildren(this._metaInfo)),this._canHaveChildren}static getInputRebindType(e,t,i){var s=J.isSourceInput(e);return s&&!~t.indexOf("$")&&~i.indexOf("$")?j.REBIND_STUDY_STANDALONE_TO_CHILD:s&&~t.indexOf("$")&&!~i.indexOf("$")?j.REBIND_STUDY_CHILD_TO_STANDALONE:0}getPlotFields(){
|
||
return this._plotFields}getMinFirstBarIndexForPlot(e){var t=fe(this._properties.styles,e)||fe(this._properties.ohlcPlots,e)||fe(this._properties.filledAreasStyle,e);if(null===t)return-1/0;var i=this.data().lastIndex();return null===i?-1/0:i-t+1}_getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}getPropertyDefinitionsViewModel(){if(null===this._definitionsViewModel){var e=this;return e._getPropertyDefinitionsViewModelClass().then((function(t){return null===t||e._isDestroyed?null:(null===e._definitionsViewModel&&(e._definitionsViewModel=new t(e._model.undoModel(),e)),e._definitionsViewModel)}))}return Promise.resolve(this._definitionsViewModel)}isPine(){return void 0!==this._metaInfo.pine}isStandardPine(){return this.isPine()&&J.isStandardPine(this._metaInfo.id)}isLinkedToSeries(){return!0===this._metaInfo.linkedToSeries}_getTelemetryObjectName(){return"study"}_getTelemetryAdditionalData(){var e="";return this._metaInfo.pine&&this._metaInfo.pine.version&&this._metaInfo.shortId.indexOf("USER")>=0&&(e="_v"+this._metaInfo.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:this._metaInfo.shortId+e}}_sendTelemetryReport(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var s=Object.assign(t,{additional:i});(void 0).sendChartReport(e,s)}_sendTelemetryCounter(e,t){this._sendTelemetryReport(e,{count:1},t)}destroy(){this._isDestroyed=!0,this._legendView&&this._legendView.destroy(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),this._properties.listeners().unsubscribe(this,this.changeStyles),this._properties.visible.listeners().unsubscribe(this,this.visibleChanged),this._properties.visible.listeners().unsubscribe(this,this.processHibernate);for(var e=0;e<this._metaInfo.plots.length;e++){var t=this._metaInfo.plots[e].id,i=this.properties().styles[t];null!=i&&null!=i.visible&&i.visible.listeners().unsubscribe(this,this.processHibernate)}for(var s in this._metaInfo.graphics)for(var r in this._metaInfo.graphics[s]){var n=this._properties.graphics[s][r];n.visible&&n.visible.listeners().unsubscribe(this,this.processHibernate)}this._properties.precision.listeners().unsubscribe(this,this._precisionChanged),this._showStudyArgumentsProperty.listeners().unsubscribe(this,this.invalidateTitleCache),this._properties.description.listeners().unsubscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().unsubscribe(this,this.invalidateTitleCache),this._model.mainSeries().dataEvents().symbolResolved().unsubscribeAll(this),this._properties.showInDataWindow.listeners().unsubscribe(this._model,this._model.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().unsubscribe(this._model.mainSeries(),this._model.mainSeries().invalidateBarStylesCache),this._model.mainSeries().dataEvents().symbolResolved().unsubscribe(this,this._recreatePriceFormattingDependencies),super.destroy()}desiredPriceScalePosition(){
|
||
return this.metaInfo().isTVScriptStub?"overlay":this.metaInfo().linkedToSeries?"as-series":void 0===this.metaInfo().priceScale?null:["right","left","overlay"][this.metaInfo().priceScale]}guiPlotName(e){var t=this.properties().styles;return t&&t[e]&&t[e].title?t[e].title.value():this.title()}defaultPlotIdForAlert(){return this._metaInfo.plots.length?this._metaInfo.plots[0].id:null}formatterChanged(){return this._formatterChanged}copiable(){return he&&!this.isChildStudy()}setPriceScale(e){super.setPriceScale(e),Z.emit("study_event",this.id(),"price_scale_changed")}disconnect(){this._studyId=null}}TradingView.Study=ge,t.Study=ge,t.studyLoadingStatus=de,t.prepareStudyProperties=function(t,s,r,n,a){return function(t,s,r,n,a,l){var c=function(t,s,r,n){var a=i("K4L1");if(J.versionOf(t)<1)throw new Error("This function cannot work with metainfo of the old format version. Required format version >= 1");var l=TradingView.clone(defaults("study"));_e(l,t);var c=J.getStudyPropertyRootName(t),h=TradingView.clone(defaults(c,n));t.isTVScript&&t.TVScriptSourceCode!==h.TVScriptSourceCode&&(h=TradingView.clone(TradingView.factoryDefaults(c,n)));TradingView.merge(l,h),s&&(o(!(s instanceof e),"propsState should not be an instance of Property"),TradingView.merge(l,s));var u=TradingView.clone(t),d={};a.mergeInputsObjPart(d,u.defaults.inputs),a.mergeInputsObjPart(d,l.inputs),l.inputs=d,delete u.inputs,delete u.defaults.inputs;var p={};if(TradingView.merge(p,u.defaults),TradingView.merge(p,TradingView.factoryDefaults(c)),TradingView.merge(p,l),TradingView.merge(p,u),delete p.defaults,l=p,null!==r){var _=r.model().studiesColorRotatorFactory().getColorRotator(t);null!==_&&("Overlay@tv-basicstudies"===t.id?l.lineStyle.color=_.getColor(l.lineStyle.color,t):TradingView.merge(l,function(e,t){for(var i in e.styles){var s=e.styles[i].color;s&&(e.styles[i].color=t.getColor(s))}return e}(l,_)))}s&&TradingView.merge(l.styles,s.styles);return l}(t,s,r,n),h=J.getSourceInputIds(t);if(h.length>0){var u=h[0];l instanceof ge?c.inputs[u]="{pid}$0":void 0!==c.inputs[u]&&-1!==c.inputs[u].indexOf("$")&&(c.inputs[u]="close")}return pe(t,a,c)}(t,s,r,n,J.getStudyPropertyRootName(t),a)},t.prepareStudyPropertiesForLoadChart=function(e,t,s,r,n,o){return function(e,t,s,r,n,o,a){var l=function(e,t,s,r,n){var o=i("K4L1");e.version&&s.version&&e.version!==s.version&&ce.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+s.version);var a=TradingView.clone(defaults("study"));TradingView.merge(a,TradingView.factoryDefaults(J.getStudyPropertyRootName(e))),_e(a,e),TradingView.merge(a,s),a=n.updateStudyState(a,e,t);var l=TradingView.clone(t||e);if(l&&J.versionOf(l)>=1){var c={};o.mergeInputsObjPart(c,(l.defaults||{}).inputs),o.mergeInputsObjPart(c,a.inputs),a.inputs=c,delete l.inputs,l.defaults&&delete l.defaults.inputs;var h={};TradingView.merge(h,l.defaults),TradingView.merge(h,TradingView.factoryDefaults(J.getStudyPropertyRootName(l))),TradingView.merge(h,a),delete l.defaults,TradingView.merge(h,l),a=h}return a}(e,t,s,0,n)
|
||
;return pe(t||e,o,l)}(e,t,s,0,n,J.getStudyPropertyRootName(e))}}).call(this,i("tc+8"),i("aIyQ"),i("Qb4w").PriceRange)},GVQo:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Eyy1"),r=i("3ClC"),n=i("CW80");function o(e,t){if(1===t.length&&Object(r.isStudy)(t[0])){const e=t[0];return{title:e.title(),sources:[{source:Object(s.ensureNotNull)(e.state()),type:"study"}]}}const i={sources:[],title:""};return i.sources=t.filter(e=>e.copiable()&&Object(n.isLineTool)(e)).filter(n.isLineTool).map(t=>{const i={type:"drawing",geometry:t.geometry(),source:Object.assign(Object.assign({},t.state(!1)),{points:t.normalizedPoints()}),modelId:e};return delete i.source.alertId,i}),0===i.sources.length?null:(i.sources.length&&(1===i.sources.length?i.title=t[0].title&&t[0].title():i.title="Drawings"),i)}},GhVi:function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex=new Map,this._marksBySpan=[],this.changed=new t,this.minIndex=void 0,this.maxIndex=void 0}i.prototype.reset=function(){this._resetImpl(),this.changed.fire()},i.prototype._resetImpl=function(){this._marksByIndex=new Map,this._marksBySpan=[],this.minIndex=void 0,this.maxIndex=void 0,this._cache=void 0},i.prototype.merge=function(e){if(0!==e.length){var t=e[0].index,i=e[e.length-1].index;t<=this.minIndex&&i>=this.maxIndex&&this._resetImpl();for(var s=this._marksBySpan,r=new Set,n=0;n<e.length;n++){var o=e[n],a=o.index,l=o.span,c=this._marksByIndex.get(o.index);if(c){if(c.index===o.index&&c.span===o.span){c.time=o.time;continue}this._removeTickmark(c)}this._marksByIndex.set(a,o);var h=s[l];void 0===h&&(h=[],s[l]=h);var u=0===h.length||h[h.length-1].index<o.index;s[l].push(o),u||r.add(l)}this.minIndex=void 0===this.minIndex?t:Math.min(this.minIndex,t),this.maxIndex=void 0===this.maxIndex?i:Math.max(this.maxIndex,i);for(l=s.length;l--;)s[l]&&(s[l].length||delete s[l],r.has(l)&&s[l].sort(this._sortByIndexAsc));this._cache=void 0,this.changed.fire()}},i.prototype._removeTickmark=function(e){var t=e.index;if(this._marksByIndex.get(t)===e){this._marksByIndex.delete(t),t<=this.minIndex&&this.minIndex++,t>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(this.minIndex=void 0,this.maxIndex=void 0);var i=this._marksBySpan[e.span],s=i.indexOf(e);-1!==s&&i.splice(s,1)}},i.prototype._sortByIndexAsc=function(e,t){return e.index-t.index},i.prototype.removeTail=function(e){var t=new Map;this.maxIndex=0,this._marksByIndex.forEach(function(i,s){i.time<e&&(t.set(s,i),this.maxIndex=Math.max(this.maxIndex,s))}.bind(this)),this._marksByIndex=t},i.prototype.addTail=function(e){for(var t=0;t<e.length;t++)e[t].index=this.maxIndex+t+1;this.merge(e)},i.prototype.indexToTime=function(e){var t=this._marksByIndex.get(e);return t?new Date(1e3*t.time):null},i.prototype.density=function(){var e=this.maxIndex-this.minIndex;if(0!==e)return 1e3*(this._marksByIndex.get(this.maxIndex).time-this._marksByIndex.get(this.minIndex).time)/e},i.prototype.estimateLeft=function(e){var t=this.density();if(t)return(1e3*this._marksByIndex.get(this.minIndex).time-e)/t},
|
||
i.prototype.nearestIndex=function(e){for(var t=this.minIndex,i=this.maxIndex;i-t>2;){if(1e3*this._marksByIndex.get(t).time===e)return t;if(1e3*this._marksByIndex.get(i).time===e)return i;var s=Math.round((t+i)/2);1e3*this._marksByIndex.get(s).time>e?i=s:t=s}return t},i.prototype.build=function(e,t){var i=Math.ceil(t/e);if(this._maxbar===i&&this._cache)return this._cache;this._maxbar=i;for(var s=[],r=this._marksBySpan.length;r--;)if(this._marksBySpan[r]){var n=s;s=[];for(var o=n.length,a=0,l=this._marksBySpan[r],c=l.length,h=1/0,u=-1/0,d=0;d<c;d++){for(var p=l[d],_=p.index;a<o;){var m=n[a],f=m.index;if(!(f<_)){h=f;break}a++,s.push(m),u=f,h=1/0}h-_>=i&&_-u>=i&&(s.push(p),u=_)}for(;a<o;a++)s.push(n[a])}return this._cache=s,this._cache},i.prototype.state=function(){for(var e=[],t=this._marksBySpan.length;t--;)this._marksBySpan[t]&&(e=e.concat(this._marksBySpan[t]));return{marks:e=e.map((function(e){return[e.span,e.time,e.index]})),version:2}},i.prototype.restoreState=function(e){if(this._marksByIndex=new Map,this._marksBySpan=[],this.maxIndex=void 0,this.minIndex=void 0,e&&e.marks&&e.marks.length)if(2===e.version){var t=e.marks.map((function(e){return{span:e[0],time:e[1],index:e[2]}}));this.merge(t)}else this.merge(e.marks)},e.exports.Tickmarks=i}).call(this,i("aIyQ"))},GmZZ:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("fJhV");class r extends s.LineDataSourceTimeAxisView{constructor(e){super(e,0)}_getBgColor(){return this._source.properties().linecolor.value()}_getAlwaysInViewPort(){return!1}_getIndex(){const e=this._source.points();return 0===e.length?null:e[0].index}}},GxN8:function(e,t,i){"use strict";function s(e){return Boolean(e.showInObjectTree)}i.d(t,"a",(function(){return s}))},H007:function(e,t,i){"use strict";i.r(t),i.d(t,"RiskRewordEntryPriceProperty",(function(){return a})),i.d(t,"RiskRewordStopPriceProperty",(function(){return l})),i.d(t,"RiskRewardTargetPriceProperty",(function(){return c}));var s=i("Eyy1"),r=i("tc+8"),n=i.n(r);class o extends n.a{constructor(e,t){super(),this._lineSource=e,this._pointIndex=t}value(){const e=this._lineSource.points()[this._pointIndex].price;return this._formatAndParsePrice(e)}state(){return this.value()}merge(e,t){return this.setValue(e),t?[]:null}_formatAndParsePrice(e){const t=Object(s.ensureNotNull)(this._lineSource.ownerSource()).formatter();if(t.parse){const i=t.format(e),s=t.parse(i);return s.res?s.value:e}return e}}class a extends o{constructor(e){super(e,0)}setValue(e){const t=this._lineSource.points()[this._pointIndex];this._lineSource.startChanging(this._pointIndex,t),t.price=parseFloat(""+e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.recalculate(),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!1,!1),this._lineSource.syncPriceLevels()}}class l extends o{constructor(e){super(e,1)}value(){const e=this._lineSource.stopPrice();return this._formatAndParsePrice(e)}setValue(e){
|
||
const t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource.model().mainSeries().base());this._lineSource.properties().childs().stopLevel.setValue(t),this._lineSource.syncPriceLevels()}}class c extends o{constructor(e){super(e,2)}value(){const e=this._lineSource.profitPrice();return this._formatAndParsePrice(e)}setValue(e){const t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource.model().mainSeries().base());this._lineSource.properties().childs().profitLevel.setValue(t),this._lineSource.syncPriceLevels()}}},H0vP:function(e,t,i){"use strict";i.r(t);var s,r=i("Eyy1");class n{constructor(e=o){this._paneInvalidationLevel=o,this._leftPriceScalesInvalidationMap=new Map,this._rightPriceScalesInvalidationMap=new Map,this._invalidationLevel=e}fullInvalidation(){return this._invalidationLevel}invalidateAll(e){this._invalidationLevel=Math.max(this._invalidationLevel,e)}invalidatePane(e){this._paneInvalidationLevel=Math.max(this._invalidationLevel,e)}invalidatePriceScale(e,t,i){const s="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap,r=s.get(t)||o;s.set(t,Math.max(r,i))}invalidationLevelForPane(){return Math.max(this._paneInvalidationLevel,this._invalidationLevel)}getterForPriceScaleInvalidationLevelBySide(e){const t="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap;return e=>Math.max(t.get(e)||o,this._invalidationLevel)}priceScaleSideMaxLevel(e){const t="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap;let i=this._invalidationLevel;return t.size>0&&t.forEach(e=>{e>i&&(i=e)}),i}merge(e){this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._paneInvalidationLevel=Math.max(this._paneInvalidationLevel,e._paneInvalidationLevel),e._leftPriceScalesInvalidationMap.forEach((e,t)=>{const i=this._leftPriceScalesInvalidationMap.get(t)||o;this._leftPriceScalesInvalidationMap.set(t,Math.max(i,e))}),e._rightPriceScalesInvalidationMap.forEach((e,t)=>{const i=this._rightPriceScalesInvalidationMap.get(t)||o;this._rightPriceScalesInvalidationMap.set(t,Math.max(i,e))})}}i.d(t,"InvalidationLevel",(function(){return s})),i.d(t,"defaultInvalidationLevel",(function(){return o})),i.d(t,"InvalidationMask",(function(){return a})),function(e){e[e.None=0]="None",e[e.Cursor=1]="Cursor",e[e.Light=2]="Light",e[e.Full=3]="Full"}(s||(s={}));const o=s.None;class a{constructor(e=o){this._panesOrderChanged=!1,this._keepVisibleTimeRangeOnResize=!1,this._timeAxisInvalidationLevel=o,this._invalidatedPanes=new Map,this._additionalActions=[],this._invalidationLevel=e}invalidateAll(e){this._invalidationLevel!==e&&(this._invalidationLevel=Math.max(this._invalidationLevel,e),this._invalidatedPanes.forEach(e=>{e.invalidateAll(this._invalidationLevel)}))}invalidateAllPane(e,t){this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new n(this._invalidationLevel)),Object(r.ensureDefined)(this._invalidatedPanes.get(e)).invalidateAll(t)}invalidatePriceScale(e,t,i,s){
|
||
this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new n(this._invalidationLevel)),Object(r.ensureDefined)(this._invalidatedPanes.get(e)).invalidatePriceScale(t,i,s)}invalidateTimeScale(e){this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e)}invalidatePanesOrder(){this._panesOrderChanged=!0}lockVisibleTimeRangeOnResize(){this._keepVisibleTimeRangeOnResize=!0}fullInvalidation(){return this._invalidationLevel}maxPaneInvalidation(){const e=[];return this._invalidatedPanes.forEach(t=>{e.push(t.fullInvalidation())}),Math.max(...e,this._invalidationLevel)}invalidateForPane(e){return this._invalidatedPanes.get(e)||new n(this._invalidationLevel)}invalidateForTimeScale(){return Math.max(this._timeAxisInvalidationLevel,this._invalidationLevel)}validationActions(){return this._additionalActions}addValidationAction(e){this._additionalActions.push(e)}merge(e){this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._panesOrderChanged=this._panesOrderChanged||e._panesOrderChanged,this._keepVisibleTimeRangeOnResize=this._keepVisibleTimeRangeOnResize||e._keepVisibleTimeRangeOnResize,this._invalidatedPanes.forEach(e=>{e.invalidateAll(this._invalidationLevel)}),e._invalidatedPanes.forEach((e,t)=>{this._invalidatedPanes.has(t)||this._invalidatedPanes.set(t,new n(this._invalidationLevel)),Object(r.ensureDefined)(this._invalidatedPanes.get(t)).merge(e)}),this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e._timeAxisInvalidationLevel);for(let t=0;t<e._additionalActions.length;t++)this._additionalActions.push(e._additionalActions[t])}panesOrderInvalidated(){return this._panesOrderChanged}isVisibleTimeRangeLockedOnResize(){return this._keepVisibleTimeRangeOnResize}static cursor(){return new a(s.Cursor)}static light(){return new a(s.Light)}static full(){return new a(s.Full)}static panesOrder(){const e=a.full();return e.invalidatePanesOrder(),e}static validateAction(e){const t=new a;return t._additionalActions.push(e),t}}},HGP3:function(e,t,i){"use strict";var s=i("W3MX"),r=i("Eyy1");const n={},o=Object.keys(s).length,a=/^#[0-9A-F]{6}$/i;Object.keys(s).forEach(e=>{const t=function e(t,i=[]){const r=s[t];if(!r)return null;if(a.test(r))return r;const n=r;return i.push(t),-1!==i.indexOf(n)?(console.warn("Colors definitions cycled"),r):i.length>o?(console.warn("Too many variables-link in HEX-color search: "+i[0]),null):e(n,i)}(e);n[e]=Object(r.ensureNotNull)(t)});const l=n;function c(e){const t=l[e];if(!t)throw new Error("No such color "+e);return t}i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return c}))},HGup:function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return a})),i.d(t,"b",(function(){return l}));var s=i("Eyy1"),r=i("3u3j");class n extends r.a{constructor(e,t,i){super(e,t,i)}redo(){const e=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),t=Object(s.ensureNotNull)(this._chartModel.paneForSource(e)),i=this._chartModel.children(e,!0);t.bulkActionMacro(()=>{
|
||
i.forEach(e=>this._chartModel.detachSource(e)),this._chartModel.detachSource(e)});const r=this._chartModel.createPane(this.targetPaneIndex()),n=r.findSuitableScale(e);r.bulkActionMacro(()=>{r.addDataSource(e,n,!1),i.forEach(e=>r.addDataSource(e,n,!1))}),Object(s.ensureNotNull)(e.priceScale()).restoreState(this._newPriceScaleState(r.isOverlay(e))),this._chartModel.fullUpdate(),this._chartModel.setShouldBeSavedEvenIfHidden(!0)}undo(){const e=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),t=Object(s.ensureNotNull)(this._chartModel.paneForSource(e)),i=this._chartModel.children(e,!0);t.bulkActionMacro(()=>{i.forEach(e=>this._chartModel.detachSource(e));const t=this._chartModel.detachSource(e);Object(s.assert)(t,"Undo of detaching must remove pane")});const r=this._chartModel.panes()[this._initialPaneIndex];let n=r.getPriceScaleById(this._initialPriceScaleId);null===n&&(n=r.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),r.bulkActionMacro(()=>{r.addDataSource(e,n,!0),i.forEach(e=>r.addDataSource(e,n,!1))}),Object(s.ensureNotNull)(e.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()}}class o extends n{constructor(e,t,i){super(e,t,i)}targetPaneIndex(){return this._initialPaneIndex+1}}class a extends n{constructor(e,t,i){super(e,t,i)}targetPaneIndex(){return this._initialPaneIndex}}class l extends n{constructor(e,t,i){super(e,t,i)}targetPaneIndex(){return this._chartModel.panes().length}}},HLXm:function(e,t,i){"use strict";function s(e){"LineToolGannComplex"!==e.type||void 0!==e.version&&1!==e.version||(e.type="LineToolGannFixed")}i.r(t),i.d(t,"migrateState",(function(){return s}))},"HV/F":function(e,t,i){"use strict";function s(e){const t={};return{promise:new Promise((i,s)=>{e.subscribe(t,i,!0)}),destroy:()=>{e.unsubscribeAll(t)}}}i.r(t),i.d(t,"delegateToPromise",(function(){return s}))},HY7u:function(e,t,i){},HZKX:function(e,t,i){"use strict";i.r(t),i.d(t,"defaultContextMenuOptions",(function(){return we})),i.d(t,"createActionAddAlert",(function(){return Pe})),i.d(t,"createActionTrade",(function(){return xe})),i.d(t,"createActionOrder",(function(){return Te})),i.d(t,"createMTPredictorActions",(function(){return Me})),i.d(t,"createLinesAction",(function(){return Ie})),i.d(t,"ActionsProvider",(function(){return Le}));var s=i("Eyy1"),r=i("txPx"),n=i("ogJP"),o=i("Kxc7"),a=i("7KDR"),l=i("YmeR"),c=i("Daqx"),h=i("3ClC"),u=i("QloM"),d=i("Qq0B"),p=i("z61+"),_=i("/3z9"),m=i("L/Ed"),f=i("cKqi"),g=i("YzC7"),v=i("pvsv"),b=i("GVQo"),S=i("CW80"),y=i("/tGj"),w=i("2uTr");const C=Object(r.getLogger)("Chart.ActionsProvider"),P=(window.t("Add Alert"),window.t("Add Alert on {series}"),window.t("Add Alert on {drawing}"),Object(w.appendEllipsis)(window.t("Edit {0} Alert"))),x=window.t("Extend Alert Lines"),T=window.t("Show alert label lines"),M=window.t("Hide alert label lines"),I=(window.t("Trade"),Object(w.appendEllipsis)(window.t("Create Limit Order")),window.t("Show")),L=window.t("Hide"),O=(window.t("MTPredictor"),
|
||
window.t("Apply Manual Risk/Reward"),window.t("Apply Manual Decision Point"),window.t("Analyze Trade Setup"),window.t("Apply Elliott Wave"),window.t("Apply Elliott Wave Intermediate"),window.t("Apply Elliott Wave Major"),window.t("Apply Elliott Wave Minor"),window.t("Apply WPT Up Wave"),window.t("Up Wave 1 or A"),window.t("Up Wave 2 or B"),window.t("Up Wave C"),window.t("Up Wave 3"),window.t("Up Wave 4"),window.t("Up Wave 5"),window.t("Apply WPT Down Wave"),window.t("Down Wave 1 or A"),window.t("Down Wave 2 or B"),window.t("Down Wave C"),window.t("Down Wave 3"),window.t("Down Wave 4"),window.t("Down Wave 5"),window.t("Pinned To Scale {label} (Hidden)")),A=window.t("Pinned To Right Scale (Hidden)"),E=window.t("Pin To Scale {label} (Hidden)"),k=window.t("Pin To Right Scale (Hidden)"),D=window.t("Pinned To Scale {label}"),V=window.t("Pinned To Right Scale"),B=window.t("Pin To Scale {label}"),R=window.t("Pin To Right Scale"),N=window.t("Pinned To Left Scale (Hidden)"),j=window.t("Pin To Left Scale (Hidden)"),F=window.t("Pinned To Left Scale"),W=window.t("Pin To Left Scale"),H=window.t("Pin To New Left Scale"),z=window.t("Pin To New Right Scale"),U=window.t("Pin To Scale (Now {label})"),G=window.t("Pin To Scale (Now No Scale)"),q=window.t("Pin To Scale (Now Left)"),Y=window.t("Pin To Scale (Now Right)"),K=window.t("No Scale (Fullscreen)"),J=window.t("Move To"),Z=window.t("Existing Pane Above"),X=window.t("New Pane Above"),$=window.t("Existing Pane Below"),Q=window.t("New Pane Below"),ee=window.t("Bring to Front"),te=window.t("Send to Back"),ie=window.t("Bring Forward"),se=window.t("Send Backward"),re=window.t("Visual Order"),ne=window.t("Lines"),oe=Object(w.appendEllipsis)(window.t("Add Indicator/Strategy on {studyTitle}")),ae=(Object(w.appendEllipsis)(window.t("Add Financial metric for {instrumentName}")),Object(w.appendEllipsis)(window.t("Settings"))),le=window.t("Apply Default"),ce=Object(w.appendEllipsis)(window.t("Save As")),he=window.t("Copy"),ue=window.t("Clone"),de=window.t("Template"),pe=(window.t("Sync To All Charts"),window.t("Unlock")),_e=window.t("Lock"),me=(window.t("Show Earnings"),window.t("Show Dividends"),window.t("Show Splits"),window.t("Show All Ideas")),fe=window.t("Show Ideas of Followed Users"),ge=window.t("Show My Ideas Only"),ve=Object(w.appendEllipsis)(window.t("Settings")),be=window.t("Hide Events on Chart"),Se=window.t("Add this Symbol to Entire Layout"),ye=window.t("Add this Indicator to Entire Layout"),we=(window.t("Add this Strategy to Entire Layout"),window.t("Add this Financial Metric to Entire Layout"),{general:!0,mainSeries:!0,mainSeriesTrade:!0,esdStudies:!0,studies:!0,fundamentals:!0,lineTools:!0,publishedCharts:!0,ordersAndPositions:!0,alerts:!0,chartEvents:!0,objectTree:!0});function Ce(e){return Object(y.isSymbolSource)(e)?e.symbolTitle(!0,!0):e.title(!0)}function Pe(e,t){return null}function xe(e,t,i){return null}function Te(e){throw new Error("not supported")}function Me(e,t,i,s){return null}function Ie(e){const t=e.actions(),i=[t.showPriceLine]
|
||
;return i.push(t.showHighLowPriceLines),i.push(t.showAverageClosePriceLine),new a.Action({label:ne,statName:"Lines",subItems:i})}class Le{constructor(e,t){this._chartWidget=e,this._options=Object(n.merge)(Object(n.clone)(we),t||{})}async contextMenuActionsForSources(e){const t=e[0],i=this._options;if(t===this._chartWidget.model().mainSeries()&&i.mainSeries)return this._contextMenuActionsForSeries(t);if(Object(h.isStudy)(t)&&i.studies)return this._contextMenuActionsForStudy(t);if(Object(S.isLineTool)(t)&&i.lineTools){const t=e.filter(S.isLineTool);return this._contextMenuActionsForLineTool(t)}return[]}_isReadOnly(){return this._chartWidget.readOnly()}_createActionHide(e){return new a.Action({label:L,icon:i("dmHa"),statName:"HideSelectedObject",onExecute:this._chartWidget.hideDataSources.bind(this._chartWidget,[e])})}_createActionShow(e){const t=new a.Action({checkable:!0,label:I,icon:i("6ctS"),statName:"ToggleShow"}),s=new l.ActionBinder(t,e.properties().visible,this._chartWidget.model(),I);return t.setBinding(s),s.setValue(e.properties().visible.value()),t}_createActionScale(e){const t=Object(s.ensureNotNull)(e.priceScale()),r=this._chartWidget.model().model(),n=Object(s.ensureNotNull)(r.paneForSource(e)),o=n.priceScalePosition(t),l=("left"===o?n.leftPriceScales():n.rightPriceScales()).indexOf(t),h=r.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",u="overlay"===o?"":Object(c.a)(o,l).label,d=U.format({label:u}),p={"left-needname":d,"left-dontneedname":q,"right-needname":d,"right-dontneedname":Y,"overlay-needname":G,"overlay-dontneedname":G}[o+"-"+h];return new a.Action({label:p,icon:i("/kal"),subItems:this._createActionScaleItems(e)})}_createActionScaleDetach(e,t,i,r){const n=this._chartWidget.model().model(),o=Object(s.ensureNotNull)(n.paneForSource(e));if(!o.canCreateNewPriceScale())return null;const l=Object(s.ensureNotNull)(e.priceScale()),h=l.canDetachSource(e),u=o.priceScalePosition(l),d=h||u!==t;if(!d)return null;const p=n.priceScaleSlotsCount(),_={left:{labelled:B,sided:H},right:{labelled:B,sided:z}},m="left"===t?o.leftPriceScales().length:o.rightPriceScales().length,f=p[t]>m?"labelled":"sided",g=Object(c.a)(t,m).label,v=_[t][f].format({label:g});return new a.Action({checkable:!1,disabled:!d,label:v,statName:r,payload:e,onExecute:i})}_onDetachLeft(e){const t=e.getPayload(),i=this._chartWidget.model().model(),r=Object(s.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToLeft(t,r)}_onDetachRight(e){const t=e.getPayload(),i=this._chartWidget.model().model(),r=Object(s.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToRight(t,r)}_createActionScaleDetachLeft(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")}_createActionScaleDetachRight(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")}_onMoveToScale(e){const t=e.getPayload();if(t.datasource.priceScale()===t.priceScale)return
|
||
;const i=this._chartWidget.model().model(),r=Object(s.ensureNotNull)(i.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,r,t.priceScale,t.undoText)}_createMoveToScaleAction(e,t,i,s){const r=e.priceScale()===t;return new a.Action({checkable:!0,checked:r,label:i,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:s},onExecute:this._onMoveToScale.bind(this)})}_onNoScale(e){const t=e.getPayload().datasource,i=this._chartWidget.model().model(),r=Object(s.ensureNotNull)(i.paneForSource(t));r.isOverlay(t)||this._chartWidget.model().detachNoScale(t,r)}_createActionNoScale(e){const t=this._chartWidget.model().model(),i=Object(s.ensureNotNull)(t.paneForSource(e)),r=i.actionNoScaleIsEnabled(e);return new a.Action({checkable:!0,checked:i.isOverlay(e),label:K,disabled:!r,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)})}_createActionScaleItems(e){const t=[],i=this._chartWidget.model().model(),r=Object(s.ensureNotNull)(i.paneForSource(e)),n=i.priceScaleSlotsCount().totallySlots>1,o=r.rightPriceScales(),l=r.leftPriceScales(),h=this._createActionScaleDetachRight(e),u=this._createActionScaleDetachLeft(e),d=o.length+l.length+(null===h?0:1)+(null===u?0:1)>2,p={right:{hidden:{checked:{labelled:O,sided:A},unchecked:{labelled:E,sided:k}},visible:{checked:{labelled:D,sided:V},unchecked:{labelled:B,sided:R}}},left:{hidden:{checked:{labelled:O,sided:N},unchecked:{labelled:E,sided:j}},visible:{checked:{labelled:D,sided:F},unchecked:{labelled:B,sided:W}}}},_={left:r.visibleLeftPriceScales(),right:r.visibleRightPriceScales()},m=(t,i)=>{const s=("right"===i?o:l)[t],r=_[i].includes(s)?"visible":"hidden",a=e.priceScale()===s?"checked":"unchecked",h=n?"labelled":"sided",u=p[i],d={labelled:u.visible.unchecked.labelled,sided:u.visible.unchecked.sided},m=Object(c.a)(i,t).label;return{actionText:u[r][a][h].format({label:m}),undoText:d[h].format({label:m})}};t.push(...o.map((t,i)=>{const s=m(i,"right");return this._createMoveToScaleAction(e,t,s.actionText,s.undoText)})),null!==h&&t.push(h);d&&(o.length>0||null!==h)&&t.push(new a.Separator);t.push(...l.map((t,i)=>{const s=m(i,"left");return this._createMoveToScaleAction(e,t,s.actionText,s.undoText)})),null!==u&&t.push(u);d&&(l.length>0||null!==u)&&t.push(new a.Separator);return t.push(this._createActionNoScale(e)),t}_createVisualOrderAction(e){const t=this._chartWidget.model(),s=t.availableZOrderOperations(e),r=[new a.Action({label:ee,statName:"BringToFront",disabled:!s.bringToFrontEnabled,onExecute:()=>t.bringToFront(e)}),new a.Action({label:te,statName:"SendToBack",disabled:!s.sendToBackEnabled,onExecute:()=>t.sendToBack(e)}),new a.Action({label:ie,statName:"BringForward",disabled:!s.bringForwardEnabled,onExecute:()=>t.bringForward(e)}),new a.Action({label:se,statName:"SendBackward",disabled:!s.sendBackwardEnabled,onExecute:()=>t.sendBackward(e)})];return new a.Action({label:re,icon:i("9dnG"),statName:"VisualOrder",subItems:r})}_createActionMergeUp(e){const t=this._chartWidget.model()
|
||
;return t.model().isMergeUpAvailableForSource(e)?new a.Action({label:Z,statName:"MergeUp",onExecute:()=>t.mergeSourceUp(e)}):null}_createActionUnmergeUp(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new a.Action({label:X,statName:"UnmergeUp",onExecute:()=>t.unmergeSourceUp(e)}):null}_createActionMergeDown(e){const t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new a.Action({label:$,statName:"MergeDown",onExecute:()=>t.mergeSourceDown(e)}):null}_createActionUnmergeDown(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new a.Action({label:Q,statName:"UnmergeDown",onExecute:()=>t.unmergeSourceDown(e)}):null}_mergeContentMenuItems(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(n.notNull)}_createActionMove(e){const t=this._mergeContentMenuItems(e);return t.length>0?new a.Action({label:J,icon:i("BBCR"),subItems:t}):null}_contextMenuActionsForSeries(e){const t=[],i=e.properties().visible.value(),r=this._chartWidget.model().model(),n=(Object(s.ensureNotNull)(r.paneForSource(e)),this._chartWidget.actions());if(this._isReadOnly())t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new a.Separator),t.push(this._createActionScale(e));else{0,t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),o.enabled("symbol_info")&&t.push(n.showSymbolInfoDialog);r.mainSeries().symbolInfo();0,t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),t.push(this._createVisualOrderAction([e]));const s=this._createActionMove(e);null!==s&&t.push(s),t.push(this._createActionScale(e)),t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new a.Separator),t.push(Ie(this._chartWidget)),t.push(new a.Separator);window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&n.addToWatchlist&&t.push(n.addToWatchlist),o.enabled("text_notes")&&t.push(n.addToTextNotes),t[t.length-1]instanceof a.Separator||t.push(new a.Separator),t[t.length-1]instanceof a.Separator&&t.pop()}return t}_createActionAddChildStudy(e){const t=this._chartWidget.model().model();return new a.Action({label:oe.format({studyTitle:Ce(e)}),icon:i("CwKc"),statName:"ApplyIndicator",onExecute:()=>{const i=this._chartWidget.showIndicators(Object(h.isStudy)(e)?e:void 0);if(i&&Object(h.isStudy)(e)){const e=()=>{trackEvent("SOS","Apply SOS","Apply by RC menu")},s=t.studyInserted();s.subscribe(this,e),i.visible().subscribe(t=>{t||s.unsubscribe(this,e)},{once:!0})}}})}_createActionAddFundamentals(e){return null}_createActionShowSymbolInfoDialog(e,t){return new a.Action({label:Object(w.appendEllipsis)(window.t("Symbol Info")),icon:i("1pHB"),checkable:!1,statName:"SymbolInfo",onExecute:()=>{const i=e.symbol(),s={symbolInfo:e.symbolInfo(),unitName:e=>t.name(e)};Object(v.showSymbolInfoDialog)(i,s)}})}_createActionShowProperties(e){return new a.Action({label:ae,icon:i("MXV9"),
|
||
statName:"EditSelectedObject",onExecute:()=>this._chartWidget.showSourceProperties(e)})}_contextMenuActionsForStudy(e){const t=this._chartWidget.actions(),i=e.properties().visible.value(),s=[];if(!e.userEditEnabled())return s;if(this._chartWidget.readOnly())s.push(i?this._createActionHide(e):this._createActionShow(e)),s.push(new a.Separator),e.constructor instanceof d.NonSeriesStudy||s.push(this._createActionScale(e));else{0,o.enabled("study_on_study")&&e.canHaveChildren()&&s.push(this._createActionAddChildStudy(e));const r=this._createApplyToEntireLayoutCommand(e);if(null!==r&&s.push(r),s.length>0&&!(s[s.length-1]instanceof a.Separator)&&s.push(new a.Separator),o.enabled("symbol_info")&&(e instanceof g.a||e instanceof f.study_Overlay)&&null!==e.symbolInfo()&&(s.push(this._createActionShowSymbolInfoDialog(e,this._chartWidget.model().model().availableUnits())),s.push(new a.Separator)),s.push(this._createVisualOrderAction([e])),!(e.constructor instanceof d.NonSeriesStudy)){const t=this._createActionMove(e);null!==t&&s.push(t),s.push(this._createActionScale(e))}s.push(new a.Separator);const n=e.metaInfo();if(s[s.length-1]instanceof a.Separator||s.push(new a.Separator),e.copiable()){const t=new a.Action({label:he,shortcutHint:Object(_.humanReadableHash)(_.Modifiers.Mod+67),statName:"Copy",onExecute:()=>{this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy([e])}});s.push(t)}s.push(i?this._createActionHide(e):this._createActionShow(e)),s.push(t.studyRemove),s.push(new a.Separator),o.enabled("property_pages")&&new p.a(n).hasUserEditableOptions()&&s.push(this._createActionShowProperties(e)),s[s.length-1]instanceof a.Separator&&s.pop()}return s}_createEditAlertDrawingAction(e){return new a.Action({label:P.format(e.title()),icon:TbbiEditAlertSvg,statName:"EditAlert",onExecute:()=>{window.runOrSignIn(()=>{e.editAlert("pane_context_menu_edit_alert")},{source:"Alert edit from pane context menu"})}})}_createLineToolTemplateAction(e){if(!window.lineToolPropertiesToolbar)return null;const t=window.lineToolPropertiesToolbar.templatesList();return void 0===t?null:new a.ActionAsync(()=>{const i=[],s=new a.Action({label:ce,statName:"SaveAs",onExecute:()=>{t.showSaveDialog(i=>{const s=JSON.stringify(e.template());t.saveTemplate(i,s)})}});i.push(s);const r=new a.Action({label:le,statName:"ApplyDefault",onExecute:()=>{this._chartWidget.model().restorePropertiesForSource(e),window.lineToolPropertiesToolbar.onSourceChanged(e)}});return i.push(r),new Promise(e=>{t.templatesLoaded().then(()=>{const e=t.getData();e.length>0&&i.push(new a.Separator),e.forEach((e,s)=>{const r=new a.Action({label:e,statName:"ApplyTemplate",onExecute:()=>t.loadTemplate(e),toolbox:{type:m.ToolboxType.Delete,action:()=>{t.deleteAction(e)}},showToolboxOnHover:!0});i.push(r)})},e=>{C.logWarn(e)}).then(()=>{e({label:de,statName:"Template",subItems:i})})})})}_createActionToggleLockObject(e){const t=e.properties().frozen.value();return new a.Action({label:t?pe:_e,statName:"ToggleLockSelectedObject",checkable:!0,icon:i(t?"fs3R":"qckB"),
|
||
onExecute:()=>this._chartWidget.toggleLockSelectedObject()})}async _contextMenuActionsForLineTool(e){const t=[],s=this._chartWidget.actions(),r=(this._chartWidget.model().model(),()=>{t.push(this._createVisualOrderAction(e))}),n=()=>{const s=e.filter(e=>e.cloneable());if(s.length>0){const e=new a.Action({label:ue,icon:i("K8V9"),shortcutHint:Object(_.humanReadableModifiers)(_.Modifiers.Mod)+"Drag",doNotBindShortcut:!0,statName:"Clone",onExecute:()=>this._chartWidget.model().cloneLineTools(s,!1)},"Clone");t.push(e)}return!!s.length},l=()=>{const i=e.filter(e=>e.copiable());if(i.length>0){const e=new a.Action({label:he,shortcutHint:Object(_.humanReadableHash)(_.Modifiers.Mod+67),statName:"Copy",onExecute:()=>this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy(i)},"Copy");t.push(e)}return!!i.length};if(1===e.length){const i=e[0];if(this._chartWidget.readOnly())t.push(s.lineHide);else if(i.userEditEnabled()){if(o.enabled("alerts")&&!this._chartWidget.onWidget()&&i.hasAlert&&i.hasAlert.value()&&(t.push(this._createEditAlertDrawingAction(i)),t.push(new a.Separator)),!o.enabled("charting_library_base")){const e=this._createLineToolTemplateAction(i);null!==e&&t.push(e)}r(),this._options.objectTree&&s.paneObjectTree&&t.push(s.paneObjectTree),t.push(new a.Separator);let e=n();e=l()||e,e=e,e&&t.push(new a.Separator),t.push(this._createActionToggleLockObject(i)),t.push(s.lineHide),t.push(s.lineRemove);const c=await this._chartWidget.propertiesDefinitionsForSource(i);if(o.enabled("property_pages")&&null!==c&&(t.push(new a.Separator),t.push(s.format)),i.additionalActions){t.push(new a.Separator);const e=i.additionalActions(this._chartWidget.model());t.push(...e)}}}else this._options.objectTree&&s.paneObjectTree&&t.push(s.paneObjectTree),r(),t.push(new a.Separator),n(),l(),t.push(new a.Separator),t.push(s.lineHide),t.push(s.lineRemove);return t}_createEarningsShow(){return null}_createDividendsShow(){return null}_createSplitsShow(){return null}_contextMenuActionsForESD(){return[]}_contextMenuActionsForPublishedTimeline(e){const t=this._chartWidget.actions(),i=[];if(i.push(t.lineHide),window.is_authenticated){const t=e.properties().filter,s=new a.Action({checked:t.value()===PublishedChartsFilter.None,checkable:!0,label:me,statName:"ToggleAllIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.None,me)}),r=new a.Action({checked:t.value()===PublishedChartsFilter.Following,checkable:!0,label:fe,statName:"ToggleIdeasOfPeopleAndUser",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Following,fe)}),n=new a.Action({checked:t.value()===PublishedChartsFilter.Private,checkable:!0,label:ge,statName:"ToggleUserIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Private,ge)});i.push(new a.Separator,s,r,n)}return i}_contextMenuActionsForTradingDrawings(e){return e.contextMenuItems()}_createAlertToggleHorzLineLabelAction(e){const t=getGlobalAlertSettingsProperty().childs().line.childs().visible,i=t.value()?M:T;return new a.Action({checkable:!0,
|
||
label:x,checked:t.value(),statName:"ToggleExtendAlertLine",onExecute:()=>this._chartWidget.model().setProperty(t,!t.value(),i)})}_contextMenuActionsForAlertLabel(e){const t=e.alert(),i=[];return t.get("active")?i.push(AlertActionCreator.stopAlert(t)):i.push(AlertActionCreator.restartAlert(t,"alert_label_context_menu_restart")),i.push(AlertActionCreator.editAlert(t,"alert_label_context_menu_edit")),i.push(AlertActionCreator.deleteAlert(t)),i.push(new a.Separator),i.push(this._createAlertToggleHorzLineLabelAction(e)),i}_contextMenuActionsForChartEvents(e){const t=[];if(o.enabled("property_pages")){const e=new a.Action({label:ve,statName:"Format",onExecute:()=>this._chartWidget.showGeneralChartProperties(u.TabNames.eventsAndAlerts)});t.push(e)}const i=new a.Action({label:be,statName:"HideEvents",onExecute:()=>this._chartWidget.model().setProperty(e.properties().visible,!1,be)});return t.push(i),t}_createApplyToEntireLayoutCommand(e){if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;const t=this._chartWidget.model().model();if(e.parentSource()!==t.mainSeries())return null;const i=Object(s.ensureNotNull)(t.paneForSource(e)),r=t.paneForSource(t.mainSeries())===i,n=e instanceof g.a&&e.priceScale()===t.mainSeries().priceScale()&&Object(s.ensureNotNull)(e.priceScale()).isPercentage(),o=r?void 0:t.panes().indexOf(i);let l=ye,c="AddStudyToEntireLayout";return Object(y.isSymbolSource)(e)&&(l=Se,c="AddSymbolToEntireLayout"),new a.Action({label:l,statName:c,onExecute:()=>{const i=Object(s.ensureNotNull)(Object(b.a)(t.id(),[e])),a=this._chartWidget.chartWidgetCollection(),c={isOnMainPane:r,asCompare:n,paneIndex:o};a.applyIndicatorToAllCharts(this._chartWidget,i,c,l)}},"applyStudyToEntireLayout")}}},Hr11:function(e,t,i){"use strict";function s(e,t){return e<=t}function r(e,t){return e>=t}function n(e,t,i){return Math.min(Math.max(e,t),i)}function o(e){return e<0?-1:e>0?1:0}function a(e){if(e<0)return!1;for(let t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function l(e,t,i){return t-e<=i}function c(e,t,i){return Math.abs(e-t)<i}function h(e){return e<=0?NaN:Math.log(e)/Math.log(10)}function u(e,t){return e<t?-1:e>t?1:0}function d(e,t=u){if(e.length<1)throw Error("array is empty");let i=e[0];for(let s=0;s<e.length;++s)t(e[s],i)<0&&(i=e[s]);return i}function p(e,t=u){if(e.length<1)throw Error("array is empty");let i=e[0];for(let s=0;s<e.length;++s)t(e[s],i)>0&&(i=e[s]);return i}function _(e){const t=Math.ceil(e);return t%2!=0?t-1:t}function m(e){return e>0?Math.floor(e):Math.ceil(e)}i.r(t),i.d(t,"lessThan",(function(){return s})),i.d(t,"greaterThan",(function(){return r})),i.d(t,"clamp",(function(){return n})),i.d(t,"sign",(function(){return o})),i.d(t,"isBaseDecimal",(function(){return a})),i.d(t,"greaterOrEqual",(function(){return l})),i.d(t,"equal",(function(){return c})),i.d(t,"log10",(function(){return h})),i.d(t,"defComparator",(function(){return u})),i.d(t,"min",(function(){return d})),i.d(t,"max",(function(){return p})),i.d(t,"ceiledEven",(function(){return _})),
|
||
i.d(t,"toInt",(function(){return m}))},HySD:function(e,t,i){"use strict";i.r(t),i.d(t,"ResizerDetacherState",(function(){return o}));var s=i("Eyy1"),r=i("hY0g"),n=i.n(r);class o{constructor(e){this._alive=new n.a,this._container=new n.a,this._width=new n.a,this._height=new n.a,this._fullscreen=new n.a,this._detachable=new n.a,this._fullscreenable=new n.a,this._visible=new n.a,this._availWidth=new n.a,this._availHeight=new n.a,this._owner=new n.a,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),container:this._container.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),fullscreenable:this._fullscreenable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:()=>{const e=this._owner.value();e&&e.remove&&e.remove()},negotiateWidth:e=>{const t=this._owner.value();t&&t.negotiateWidth&&t.negotiateWidth(e)},negotiateHeight:e=>{const t=this._owner.value();t&&t.negotiateHeight&&t.negotiateHeight(e)},requestFullscreen:()=>{const e=this._owner.value();e&&e.requestFullscreen&&e.requestFullscreen()},exitFullscreen:()=>{const e=this._owner.value();e&&e.exitFullscreen&&e.exitFullscreen()},detach:e=>{const t=this._owner.value();t&&t.detach&&t.detach(e)},attach:()=>{const e=this._owner.value();e&&e.attach&&e.attach()}},e&&this.pushOwner(e)}bridge(){return this._bridge}pushOwner(e){if(!e.alive.value())return;for(const i of this._ownersStack)this._unsubscribeOwner(i);const t={owner:e};this._ownersStack.push(t),this._subscribeOwner(t)}_subscribeOwner(e){const t=e.owner;if(e.deathWatcher||(this._alive.setValue(!0),e.deathWatcher=t.alive.spawn(),e.deathWatcher.subscribe(t=>{t||this._deadHandler(e)})),this._owner.setValue(t),!e.subscriptions){const i=e.subscriptions=[];this._visible.setValue(!1);const s=(e,t)=>{if(e){const s=e.spawn();i.push(s),s.subscribe(e=>{t.setValue(e)},{callWithLast:!0})}else t.deleteValue()};s(t.container,this._container),s(t.width,this._width),s(t.height,this._height),s(t.fullscreen,this._fullscreen),s(t.detachable,this._detachable),s(t.fullscreenable,this._fullscreenable),s(t.availWidth,this._availWidth),s(t.availHeight,this._availHeight),s(t.visible,this._visible)}}_unsubscribeOwner(e,t){if(e.subscriptions){for(const t of e.subscriptions)t.unsubscribe();e.subscriptions=null}t&&e.deathWatcher&&(e.deathWatcher.unsubscribe(),e.deathWatcher=null)}_deadHandler(e){const t=this._ownersStack.indexOf(e);Object(s.assert)(-1!==t,"sanitized owner should be in stack");for(let i=this._ownersStack.length-1;i>=t;i--)this._unsubscribeOwner(this._ownersStack[i],!0);this._ownersStack.length=t,t>0?this._subscribeOwner(this._ownersStack[t-1]):(this._alive.setValue(!1),this._owner.deleteValue())}}},I4UZ:function(e,t,i){"use strict";i.r(t),i.d(t,"HeaderToolbarBootloader",(function(){return o}));var s=i("yMne"),r=i("YuHv"),n=i("cZRT");class o extends n.a{constructor(e,t){super(),this._toolsBootloader=e,
|
||
this._headerProps=t,this._headerProps.resizerBridge.negotiateHeight(s.b),this._headerProps.resizerBridge.container.value().appendChild(Object(r.a)())}_startLoading(){return Promise.all([this._toolsBootloader.load(),this._loadHeaderToolbar()]).then(([e,t])=>new t(this._headerProps.resizerBridge.container.value(),Object.assign(Object.assign({},this._headerProps),{tools:e})))}_loadHeaderToolbar(){return Promise.all([i.e("react"),i.e(22),i.e(43),i.e(84),i.e(10),i.e(14),i.e(40),i.e("header-toolbar")]).then(i.bind(null,"KMbc")).then(e=>e.HeaderToolbarRenderer)}}},IDnv:function(e,t,i){"use strict";i.r(t),i.d(t,"extrapolateBarsFrontToTime",(function(){return r})),i.d(t,"extrapolateBarsFrontByCount",(function(){return n})),i.d(t,"extrapolateBarsFrontByCountAllPoints",(function(){return o})),i.d(t,"extrapolateBars",(function(){return a}));var s=i("E6p6");function r(e,t,i,s,n=!1){if(t>i){const o=r(e,i,t,s,n);return o.count=-o.count,o}return a(e,t,1,(e,t)=>t>i||0!==s&&e>s,n)}function n(e,t,i,s=!1){const r=i<0?-1:1;return a(e,t,r,(e,t)=>e>=i*r,s)}function o(e,t,i){const s=i<0?-1:1;return a(e,t,s,(e,t)=>e>=i*s,!0).times}function a(e,t,i,r,n){let o=0,a=t;e.moveTo(a);let l=0,c=Number.MAX_VALUE,h=!1,u=t;const d=[];for(;!r(o,a);){if(l>15)throw new Error("Internal error 0x10 while extrapolating.");const r=e.indexOfBar(a);if(r===s.SessionStage.PRE_SESSION&&1===i)a=e.startOfBar(0),e.moveTo(a);else if(r===s.SessionStage.PRE_SESSION&&-1===i)a=e.startOfBar(s.SessionStage.PRE_SESSION),e.moveTo(a);else if(r===s.SessionStage.POST_SESSION&&1===i)a=e.startOfBar(s.SessionStage.POST_SESSION),e.moveTo(a);else{if(r===s.SessionStage.POST_SESSION&&-1===i)throw new Error("Internal error 0x12 while extrapolating.");{const p=e.startOfBar(r);if(p>t&&i>0||t>p&&i<0){if(h&&c===p)throw new Error("Internal error 0x11 while extrapolating.");h=!0,c=p,l=0,o++,u=p,n&&d.push(u)}if(0===r&&-1===i)a=p-1;else{a=e.startOfBar(r+i);const t=e.startOfBar(s.SessionStage.POST_SESSION);a>t&&(e.moveTo(t),a=e.startOfBar(0))}}}l++}return{time:u,times:d,count:o}}},IMMp:function(e){
|
||
e.exports=JSON.parse('{"color-bg-primary":"color-cold-gray-850","color-bg-primary-hover":"color-cold-gray-800","color-bg-secondary":"color-cold-gray-900","color-bg-highlight":"color-cold-gray-900","color-bg-scroll-buttons":"color-cold-gray-800","color-legacy-bg-scroll-buttons":"color-cold-gray-550","color-legacy-bg-widget":"color-cold-gray-900","color-text-primary":"color-cold-gray-200","color-text-secondary":"color-cold-gray-500","color-text-tertiary":"color-cold-gray-400","color-text-disabled":"color-cold-gray-650","color-divider":"color-cold-gray-700","color-divider-hover":"color-cold-gray-800","color-box-shadow":"color-black","color-active-hover-text":"color-gull-gray","color-alert-text":"color-loblolly","color-border":"color-bright-gray","color-border-chat-fields":"color-bright-gray","color-border-hover":"color-trout-1","color-border-table":"color-cold-gray-800","color-brand":"color-tv-blue-700","color-brand-active":"color-tv-blue-600","color-brand-hover":"color-tv-blue-600","color-button-hover-bg":"color-mirage-3","color-chart-page-bg":"color-cold-gray-800","color-common-tooltip-bg":"color-cold-gray-650","color-danger":"color-ripe-red-600","color-depthrenderer-fill-style":"color-catskill-white","color-depthrenderer-stroke-style":"color-trout-1","color-disabled-border-and-color":"color-ebony-clay","color-disabled-input":"color-bright-gray","color-empty-container-message":"color-slate-gray","color-highlight-new":"color-dark-slate-blue","color-icons":"color-slate-gray","color-input-bg":"color-charade","color-input-textarea-readonly":"color-trout-1","color-input-placeholder-text":"color-cold-gray-700","color-input-publish-bg":"color-mirage-1","color-item-active-blue":"color-blue-dianne","color-item-hover-active-bg":"color-charade","color-item-hover-bg":"color-ebony-clay","color-item-hover-blue":"color-blue-dianne","color-item-selected-blue":"color-blue-dianne","color-item-active-text":"color-cold-gray-200","color-item-active-bg":"color-tv-blue-700","color-link":"color-tv-blue-700","color-link-hover":"color-tv-blue-600","color-link-active":"color-tv-blue-800","color-list-item":"color-slate-gray","color-list-nth-child-bg":"color-mirage-3","color-news-highlight":"color-charade","color-pane-bg":"color-mirage-1","color-pane-secondary-bg":"color-cold-gray-850","color-placeholder":"color-trout-2","color-popup-menu-item-hover-bg":"color-cold-gray-800","color-popup-menu-separator":"color-cold-gray-700","color-row-hover-active-bg":"color-ebony-clay","color-sb-scrollbar-body-bg":"color-trout-2","color-screener-description":"color-loblolly","color-section-separator-border":"color-bright-gray","color-separator-table-chat":"color-bright-gray","color-success":"color-minty-green-700","color-success-hover":"color-minty-green-600","color-success-active":"color-minty-green-500","color-tag-active-bg":"color-bright-gray","color-tag-hover-bg":"color-charade","color-text-regular":"color-loblolly","color-toolbar-button-text":"color-cold-gray-500","color-toolbar-button-text-hover":"color-cold-gray-450","color-toolbar-button-text-active":"color-tv-blue-700","color-toolbar-button-text-active-hover":"color-tv-blue-600","color-toolbar-button-background-hover":"color-cold-gray-800","color-toolbar-button-background-secondary-hover":"color-cold-gray-750","color-toolbar-toggle-button-background-active":"color-tv-blue-700","color-toolbar-toggle-button-background-active-hover":"color-tv-blue-600","color-toolbar-interactive-element-text-normal":"color-cold-gray-300","color-toolbar-interactive-element-text-hover":"color-cold-gray-250","color-toolbar-opened-element-bg":"color-cold-gray-800","color-tooltip-bg":"color-bright-gray","color-tv-button-checked":"color-slate-gray","color-tv-dialog-caption":"color-athens-gray-2","color-tv-dropdown-item-hover-bg":"color-charade","color-underlined-text":"color-gull-gray","color-widget-pages-bg":"color-cold-gray-900","color-warning":"color-tan-orange-700","color-forex-icon":"color-white","color-list-item-active-bg":"color-medium-blue","color-list-item-hover-bg":"color-ebony-clay","color-list-item-text":"color-loblolly","color-price-axis-label-back":"color-cold-gray-800","color-price-axis-label-text":"color-cold-gray-500","color-price-axis-gear":"color-cold-gray-500","color-price-axis-gear-hover":"color-cold-gray-400","color-price-axis-highlight":"color-cold-gray-800","color-bid":"color-tv-blue-700","color-scroll-bg":"color-cold-gray-650","color-scroll-border":"color-cold-gray-850","color-widget-border":"color-cold-gray-800","color-scroll-buttons-arrow":"color-white","color-control-intent-default":"color-cold-gray-650","color-control-intent-success":"color-minty-green-600","color-control-intent-primary":"color-tv-blue-700","color-control-intent-warning":"color-tan-orange-400","color-control-intent-danger":"color-ripe-red-500","color-growing":"color-minty-green-600","color-falling":"color-ripe-red-600","color-pre-market":"color-tan-orange-600","color-pre-market-bg":"color-tan-orange-400","color-post-market":"color-tv-blue-500","color-post-market-bg":"color-tv-blue-400","color-market-open":"color-minty-green-500","color-market-open-bg":"color-minty-green-400","color-market-closed":"color-cold-gray-400","color-market-holiday":"color-cold-gray-400","color-invalid-symbol":"color-ripe-red-400","color-invalid-symbol-hover":"color-ripe-red-500","color-replay-mode":"color-tv-blue-700","color-replay-mode-icon":"color-tv-blue-50","color-replay-mode-hover":"color-tv-blue-600","color-notaccurate-mode":"color-berry-pink-700","color-notaccurate-mode-bg":"color-berry-pink-400","color-delay-mode":"color-tan-orange-700","color-delay-mode-bg":"color-tan-orange-400","color-eod-mode":"color-grapes-purple-700","color-eod-mode-bg":"color-grapes-purple-400","color-data-problem":"color-ripe-red-600","color-data-problem-bg":"color-ripe-red-400","color-data-problem-hover":"color-ripe-red-500","color-list-item-bg-highlighted":"color-tv-blue-a900","color-list-item-bg-selected":"color-tv-blue-a800","color-list-item-bg-highlighted-hover":"color-tv-blue-a800","color-list-item-bg-selected-hover":"color-tv-blue-a700","color-screener-header-bg":"color-cold-gray-850","color-screener-header-bg-hover":"color-cold-gray-800","color-overlay":"color-cold-gray-950"}')
|
||
},IVMC:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.reduce((function(e,t,i){return~e.indexOf(t)||e.push(t),e}),[])},e.exports=t.default},IWXC:function(e,t,i){"use strict";i.r(t),i.d(t,"getQuoteSessionInstance",(function(){return o})),i.d(t,"setQuoteSessionInstance",(function(){return a})),i.d(t,"getQuoteSessionNoEnsure",(function(){return l})),i.d(t,"destroyQuoteSessions",(function(){return c}));var s=i("hGf4"),r=i.n(s);const n={};function o(e="full"){return n[e]||a(e,new r.a(e)),n[e]}function a(e="full",t){n[e]=t}function l(e="full"){return n[e]}function c(){for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];void 0!==t&&t.destroy(),delete n[e]}}},Ialn:function(e,t,i){"use strict";i.r(t),i.d(t,"isRtl",(function(){return r})),i.d(t,"stripLTRMarks",(function(){return o})),i.d(t,"startWithLTR",(function(){return a})),i.d(t,"forceLTRStr",(function(){return l})),i.d(t,"forceLTRStrSsr",(function(){return c})),i.d(t,"forceRTLStr",(function(){return h})),i.d(t,"getLTRScrollLeft",(function(){return u})),i.d(t,"getLTRScrollLeftOffset",(function(){return d})),i.d(t,"detectAutoDirection",(function(){return m}));var s=i("oYVD");const r=()=>"rtl"===window.document.dir,n=new RegExp("|||","g");function o(e){return""!==e&&r()&&null!=e?e.replace(n,""):e}function a(e){return""!==e&&r()&&null!=e?""+e:e}function l(e){return""!==e&&r()&&null!=e?""+e+"":e}function c(e){return""+e+""}function h(e){return""!==e&&r()&&null!=e?""+e+"":e}function u(e){return Object(s.getNormalizedScrollLeft)(e,"rtl")}function d(e,t){const i=Object(s.detectScrollType)();if("indeterminate"===i)return 0;switch(i){case"negative":t=e.clientWidth-e.scrollWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}const p=/[^\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u200E\u2010-\u2029\u202C\u202F-\u2BFF]/,_=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/;function m(e){const t=p.exec(e);return t?_.test(t[0])?"rtl":"ltr":""}},IcDj:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyBase",(function(){return C}));var s=i("Eyy1"),r=i("txPx"),n=i("aIyQ"),o=i.n(n),a=i("7ktv"),l=i("0YCj"),c=i.n(l),h=i("mMWL"),u=i("5fI3"),d=i("jy4L"),p=i("YWnQ"),_=i("e1Hy"),m=i("W+6j"),f=i("ogJP"),g=i("zXvd"),v=i("Kxc7");const b=Object(r.getLogger)("Chart.Study"),S=window.t("Invalid Symbol"),y={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,skipBooleanInputs:v.enabled("dont_show_boolean_study_arguments"),asObject:!0,skippedGroups:[],skippedInputs:[],noExchanges:!1,noResolution:!1,keepOptionalSymbolsEmpty:!1,skipColorInputs:!1,skipTimeInputs:!1,skipOptionalEmptySymbolInputs:!1},w=v.enabled("study_symbol_ticker_description");class C extends a.PriceDataSource{constructor(e,t,i,s){super(e),this.onStart=new o.a,this._symbolsResolved=new o.a,this._statusChanged=new o.a,this._paneViews=[],this._priceAxisViews=[],this._resolvedSymbols={},this._isChildStudy=!1,this._loading=!0,this._failed=!1,this._status="",this._studyId=null,
|
||
this._titleStrCache={},this._titleInPartsCache={},this._children=[],this._numericFormatter=new g.NumericFormatter,this._chartApi=e.chartApi(),this._properties=t,this._metaInfo=s,this._series=this._model.mainSeries(),this._showStudyArgumentsProperty=e.properties().paneProperties.legendProperties.showStudyArguments,i instanceof C&&(this._source=i,this._isChildStudy=!0,this._source.setChild(this));const r=this.parentSource();r.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),r.unitChanged().subscribe(this,this._onSourceUnitChanged),r.priceRangeReadyChanged().subscribe(this,this._onSourcePriceRangeReadyChanged),r.formatterChanged().subscribe(this,this._onSourceFormatterChanged),r.priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),w&&this._model.mainSeries().properties().statusViewStyle.symbolTextSource.listeners().subscribe(this,()=>{this.invalidateTitleCache(!0)})}destroy(){const e=this.parentSource();e.currencyChanged().unsubscribeAll(this),e.unitChanged().unsubscribeAll(this),e.priceRangeReadyChanged().unsubscribeAll(this),e.formatterChanged().unsubscribeAll(this),e.priceStepChanged().unsubscribeAll(this),this._model.mainSeries().properties().statusViewStyle.symbolTextSource.listeners().unsubscribeAll(this)}isSymbolInvalid(){return this._status===S}inputs(e){const t=Object(f.merge)(Object(f.clone)(y),e||{});return t.skipOptionalEmptySymbolInputs&&(t.keepOptionalSymbolsEmpty=!0),this._buildInputs(t)}title(e,t,i,s){i=void 0===i?!this._showStudyArgumentsProperty.value():i;const r=JSON.stringify([e,t,i,s]);if(this._titleStrCache[r])return this._titleStrCache[r];if(this._titleInPartsCache[r])return this._joinTitlesParts(this._titleInPartsCache[r]);const n=this._title(e,t,i,s);return this._titleStrCache[r]=n,n}titleInParts(e,t,i,s){i=void 0===i?!this._showStudyArgumentsProperty.value():i;const r=JSON.stringify([e,t,i,s]);if(this._titleInPartsCache[r])return this._titleInPartsCache[r];const n=this._titleInParts(e,t,i,s);return this._titleInPartsCache[r]=n,n}invalidateTitleCache(e){if(this._titleStrCache={},this._titleInPartsCache={},!0===e&&this._children)for(let t=0;t<this._children.length;++t)this._children[t].invalidateTitleCache(e)}currency(){const e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().currency():null}unit(){const e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().unit():null}getSymbolString(e){return Object(u.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(e))}onStatusChanged(){return this._statusChanged}symbolsResolved(){return this._symbolsResolved}valuesProvider(){return new _.a(this,this.model())}statusProvider(e){return new m.a(this,this._model.properties().scalesProperties.textColor)}correctScaleMargins(e){if("Volume"===this.metaInfo().shortId){const t=this.model().paneForSource(this);return null!==t&&t.isOverlay(this)&&t.containsMainSeries()?{top:.75,bottom:0}:{top:e.top,bottom:0}}return e}canBeHiddenByGlobalFlag(){return!0}isSourceHidden(){
|
||
return!this.isVisible()||this.canBeHiddenByGlobalFlag()&&h.hideAllIndicators().value()}_titleInputs(e,t){return this.inputs(this._titleInputsOptions(e,t))}_titleInputsOptions(e,t){return{symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1,skippedGroups:[],noExchanges:e,noResolution:t,skipColorInputs:!0,skipTimeInputs:!0}}_title(e,t,i,s){const r=this._titleInParts(e,t,i,s);return this._joinTitlesParts(r)}_joinTitlesParts(e){const t=e[1]?e[1].join(", "):"";return e[0]+(t.length>0?" ("+t+")":"")}_titleInParts(e,t,i,s){let r="";r=e?this.metaInfo().shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this.metaInfo().description||this._properties.description&&this._properties.description.value()||"Study",t=t||{};const n=[window.t(r,{context:"study"})];let o=[];if(!i){const i=this._getMTFResolutionInputTitle();null!==i&&i.length>0&&n.push(i);const r=this.metaInfo(),a=this._titleInputs(s,!0)||[];if(a.length>0){const i={};if(this._isChildStudy)for(let t=0;t<r.inputs.length;++t){const n=r.inputs[t];if(!c.a.isSourceInput(n))continue;const o=n.id,a=this._properties.inputs[o].value();if(a.indexOf("$")>=0&&this._source){const t=this._source.metaInfo(),r=this._source.title(e,{},!0,s);if(1===t.plots.length)i[a]=r;else{const e=a.split("$")[1],s=t.plots[parseInt(e)].id,n=t.styles&&t.styles[s],o=n&&n.title||s;i[a]=r+": "+o}}break}o=a.map(e=>{let s=Object(f.isNumber)(e)?this._numericFormatter.format(e):i&&i[e.toString()]||e.toString();return t&&t[s.toString()]&&(s=t[s.toString()]),s})}}return[n.join(" · "),o]}_getMTFResolutionInputTitle(){const e=this.metaInfo();for(let t=0;t<e.inputs.length;t++){const i=e.inputs[t];if("resolution"===i.type&&i.isMTFResolution)return this._properties.inputs[i.id].value()}return null}_allSymbolsAreResolved(){const e=[],t=this.metaInfo();for(let i=0;i<t.inputs.length;i++)if("symbol"===t.inputs[i].type){const s=t.inputs[i].id,r=this._properties.inputs[s].value();if(""!==r&&!this._resolvedSymbols[this._resolvedSymbolKey(r)]){const t=this._resolveSymbol(r);e.push(t)}}return 0===e.length?Promise.resolve():Promise.all(e).catch(e=>(this._setStatus(S),this.stop(!0),this._model.updateSource(this),Promise.reject("Invalid symbol, "+e))).then(()=>{null!==this._studyId&&this.stop(!0),this.start(!0),this._symbolsResolved.fire(),this._recheckLineToolsActuality()})}_addSymbolToMap(e,t){this._resolvedSymbols[this._resolvedSymbolKey(e)]=t}_resolveSymbol(e){if(""===e)return Promise.resolve(e);const t=e;return new Promise((i,s)=>{this._chartApi.resolveSymbol(Object(d.makeNextSymbolId)(),this.getSymbolString(t),t=>{switch(t.method){case"symbol_resolved":this._loading=!1,this._failed=!1,this._addSymbolToMap(e,t.params[1]),this._onSymbolResolved(e,t.params[1]),this.invalidateTitleCache(!0),i(e);break;case"symbol_error":if(this._loading=!1,this._failed=!0,t.params[1]===p.permissionDenied&&t.params[2])switch(t.params[2]){case p.SymbolErrorPermissionDeniedReason.ExtendedHours:break;case p.SymbolErrorPermissionDeniedReason.Symbol:
|
||
if(t.params[3])return void this._resolveSymbol(t.params[3]).then(i);break;default:return void this._resolveSymbol(t.params[2]).then(i)}0,s(e)}})})}_recheckLineToolsActuality(){const e=this._model.paneForSource(this);null!==e&&e.sourcesByGroup().lineSourcesForAllSymbols().forEach(e=>{e.ownerSource()===this&&e.calcIsActualSymbol()})}_getSymbolObject(e){const t={symbol:e};return this._series&&this._series.extendedHours.value()&&(t.session="extended"),t}_onSymbolResolved(e,t){0}_resolvedSymbolKey(e){return e}_setStatus(e){this._status=e,this._statusView&&this._statusView.update(),this._model.updateSource(this),this._statusChanged.fire(e)}_bandsFirstValue(e){const t=Object(s.ensureNotNull)(this._metaInfo);if(!t.bands)return null;for(let i=0;i<t.bands.length;i++){const t=this.properties().childs().bands.childs()[i];if(t.childs().visible.value()){const i=t.childs().value.value();if(e&&0===i)continue;return i}}return null}_prepareInputs(e){Object(s.assert)(!!e,"options not set");const t=this.metaInfo(),i={},r=e.allowedInputTypes?new Set(e.allowedInputTypes):null;for(let s=0;s<t.inputs.length;s++){const n=t.inputs[s];if(null!==r&&!r.has(n.type))continue;if(n.isFake&&e.skipFakeInputs)continue;if(n.isMTFResolution&&e.noResolution)continue;if(n.isHidden&&e.skipHiddenInputs)continue;if("bool"===n.type&&e.skipHiddenInputs&&e.skipBooleanInputs)continue;if("color"===n.type&&e.skipHiddenInputs&&e.skipColorInputs)continue;if("time"===n.type&&e.skipHiddenInputs&&e.skipTimeInputs)continue;if(void 0!==n.groupId&&-1!==e.skippedGroups.indexOf(n.groupId))continue;if(-1!==e.skippedInputs.indexOf(n.id))continue;const o=this._prepareInput(n,e);"symbol"===n.type&&e.skipOptionalEmptySymbolInputs&&""===o||(i[n.id]=Object(f.clone)(o))}return i}_buildInputs(e){Object(s.assert)(!!e,"options not set");let t={};try{t=this._prepareInputs(e)}catch(i){b.logWarn("Failed to prepare study inputs: "+i)}if(e.asObject){const e={};return Object.keys(t).forEach(i=>{null!=t[i]&&(e[i]=t[i])}),e}{const e=[];return Object.keys(t).forEach(i=>{null!=t[i]&&e.push(t[i])}),e}}_prepareInput(e,t){const i=this._prepareInputValue(e,t);return!e.isFake||t.fakeInputsForDisplay||t.onlyAtomValues?i:{v:i,f:!0,t:e.type}}}},IiTo:function(e,t,i){"use strict";i.r(t);var s=i("jCNj"),r=i("LxhU"),n=i("Hr11"),o=i("ZmuQ"),a=i("E6p6");class l extends o.a{constructor(e,t){super(),this._sessionStartMs=-Number.MAX_VALUE,this._sessionEndMs=-Number.MAX_VALUE,this._periodSec=e,this._session=t}alignTimeIfPossible(e){const t=this.alignTime(e);return isNaN(t)?e:t}indexOfBar(e){return e<this._sessionStartMs?a.SessionStage.PRE_SESSION:e>=this._sessionEndMs?a.SessionStage.POST_SESSION:Object(n.toInt)(s.time_seconds_diff(e,this._sessionStartMs)/this._periodSec)}startOfBar(e){if(e===a.SessionStage.PRE_SESSION){const e=s.get_cal_from_unix_timestamp_ms(this._session.timezone,this._sessionStartMs-1),t=this._session.spec.alignToNearestSessionEnd(e,-1);return s.cal_to_utc(this._session.timezone,t)}if(e===a.SessionStage.POST_SESSION)return this._sessionEndMs
|
||
;if(e<0)throw new Error("Negative offset is not supported");return this._sessionStartMs+s.time_seconds(this._periodSec*e)}endOfBar(e){if(e<0)throw new Error("Index cannot be negative");const t=this.startOfBar(e)+1e3*this._periodSec;return t>this._sessionEndMs?this._sessionEndMs:t}isLastBar(e,t){return t>=this._sessionStartMs+s.time_seconds(this._periodSec*(e+1)-1)}moveTo(e){const t=this._session.timezone,i=s.utc_to_cal(t,e),r=this._session.spec.alignToSessionStart(i);this._sessionStartMs=s.cal_to_utc(t,i),s.add_minutes(i,r),this._sessionEndMs=s.cal_to_utc(t,i)}indexOfLastBarInSession(){return Object(n.toInt)((this._sessionEndMs-1-this._sessionStartMs)/1e3/this._periodSec)}moveNext(){this.moveTo(this._sessionEndMs)}}var c=i("OBgQ");function h(e,t){const i=s.clone(t),r=e.businessDaysToCalendarDays(i,1);r>1&&s.add_date(i,r-1);const n=e.leftBorderOfDailyBar(i);if(null===n)throw new Error("Cannot calculate left border of daily bar");return s.cal_to_utc(s.get_timezone(e.timezone()),n)}class u extends o.a{constructor(e,t,i,s,r=!1){super(),this._periodStart=-Number.MAX_VALUE,this._periodEnd=-Number.MAX_VALUE,this._periodLastBarStart=-Number.MAX_VALUE,this._periodStartDay=new c.a(0,0,0),this._periodEndDay=new c.a(0,0,0),this._period=i,this._sessionTgt=e,this._builder=s,this._useBusinessDays=r,this._sessionSrc=r?new o.b("Etc/UTC","24x7"):t||e}builder(){return this._builder}alignTimeIfPossible(e){return this.tradingDayToSessionStart(e)}tradingDayToSessionStart(e){return this.moveTo(e),this.startOfBar(0)}indexOfBar(e){if(this._useBusinessDays){const t=c.a.fromCalendar(s.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e));return t.before(this._periodStartDay)?a.SessionStage.PRE_SESSION:this._periodEndDay.before(t)?a.SessionStage.POST_SESSION:0}return e<this._periodStart?a.SessionStage.PRE_SESSION:e>=this._periodEnd?a.SessionStage.POST_SESSION:0}startOfBar(e){if(e===a.SessionStage.PRE_SESSION){const e=s.get_cal_from_unix_timestamp_ms(this._sessionTgt.timezone,this._periodStart-1),t=this._sessionTgt.spec.alignToNearestSessionEnd(e,-1);return s.cal_to_utc(this._sessionTgt.timezone,t)-1}return e===a.SessionStage.POST_SESSION||e>0?this._periodEnd:e===a.SessionStage.LASTBAR_SESSION?this._periodLastBarStart:this._periodStart}moveTo(e){const t=s.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e);this._sessionSrc.spec.correctTradingDay(t);const i=s.get_year(t),r=this._indexOfPeriodInYear(t),n=r+this._period,o=this._sessionTgt.spec,a=this._sessionTgt.timezone,l=this._builder.startOfPeriod(a,r,i);this._periodStart=h(o,l);const u=s.clone(l),d=o.businessDaysToCalendarDays(u,1);d>1&&s.add_date(u,d-1),this._periodStartDay=c.a.fromCalendar(u);const p=this._builder.startOfPeriod(a,n,i);this._periodEnd=h(o,p);const _=s.clone(p);for(s.add_date(_,-1);o.isCalWeekEnd(_);)s.add_date(_,-1);this._periodEndDay=c.a.fromCalendar(_),s.add_date(p,-1),function(e,t){for(;e.isCalWeekEnd(t);)s.add_date(t,-1)}(this._sessionTgt.spec,p),this._periodLastBarStart=h(o,p),
|
||
(this._periodLastBarStart<this._periodStart||this._periodLastBarStart===this._periodEnd)&&(this._periodLastBarStart=this._periodStart)}endOfBar(e){if(0!==e)throw new Error("index should be 0");return this._periodEnd}isLastBar(e,t){if(0!==e)throw new Error("index should be 0");return t>=this._periodLastBarStart}currentRange(){return{from:this._periodStartDay,to:this._periodEndDay}}indexOfBarInYear(e){const t=s.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e),i=s.get_year(t),r=this._builder.indexOfPeriod(t),o=this._sessionTgt.timezone;let a=this._builder.startOfPeriod(o,r,i),l=h(this._sessionTgt.spec,a);return a=s.get_cal_from_unix_timestamp_ms(s.get_timezone("Etc/UTC"),l),i<s.get_year(a)?(a=this._builder.startOfPeriod(o,r-1,i),l=h(this._sessionTgt.spec,a),{index:(r-1)/this._period,time:l}):{index:Object(n.toInt)(r/this._period),time:l}}sessionSrc(){return this._sessionSrc}_indexOfPeriodInYear(e){const t=this._builder.indexOfPeriod(e);let i=Object(n.toInt)(t/this._period)*this._period;return-1===t&&(i=-this._period),i}}function d(e,t){const i=s.get_day_of_week(t)-e.firstDayOfWeek();return i<0?i+7:i}function p(e,t){const i=s.get_day_of_year(t)-1;let r=d(e,t)-i%7;return 0===r?Object(n.toInt)(i/7):(r>=0&&(r-=7),Object(n.toInt)((r+i)/7))}class _{indexOfPeriod(e){return s.get_day_of_year(e)-1}startOfPeriod(e,t,i){const r=s.days_per_year(i);return s.get_cal(s.get_timezone("Etc/UTC"),i,s.JANUARY,1+Math.min(t,r))}}class m extends _{constructor(e){super(),this._sessionsSpec=e}indexOfPeriod(e){return super.indexOfPeriod(e)-function(e,t){const i=p(e,t),r=s.get_cal(s.get_timezone("Etc/UTC"),s.get_year(t),s.JANUARY,1);s.add_date(r,7*i);const n=i*e.weekEndsCount()+e.holidaysFromYearStart(r),o=s.get_day_of_year(t)-s.get_day_of_year(r);return n+o-e.calendarDaysToBusinessDays(r,o)}(this._sessionsSpec,e)}startOfPeriod(e,t,i){const r=7-this._sessionsSpec.weekEndsCount(),o=Math.max(0,Object(n.toInt)(t/r)-1),a=s.get_cal(s.get_timezone("Etc/UTC"),i,s.JANUARY,1),l=s.get_days_per_year(a);if(s.add_date(a,7*o),(t-=r*o-this._sessionsSpec.holidaysFromYearStart(a))>0){const e=this._sessionsSpec.businessDaysToCalendarDays(a,t);s.add_date(a,e)}let c=s.get_day_of_year(a)-1;return i<s.get_year(a)&&(c+=l),super.startOfPeriod(e,c,i)}}class f{constructor(e){this._builder=null,this._initialized=!1,this._session=e}indexOfPeriod(e){return this._getBuilder().indexOfPeriod(e)}startOfPeriod(e,t,i){return this._getBuilder().startOfPeriod(e,t,i)}_getBuilder(){return null!==this._builder&&this._initialized||(this._builder=this._session.spec.hasWeekEnds()?new m(this._session.spec):new _,this._initialized=!0),this._builder}}class g{constructor(e){this._session=e}indexOfPeriod(e){let t=p(this._session.spec,e);if(0===t){const i=s.get_timezone(this._session.spec.timezone());e<this.startOfPeriod(i,0,s.get_year(e))&&(t=-1)}return t}startOfPeriod(e,t,i){if(t<0){i--;const r=s.get_cal(s.get_timezone("Etc/UTC"),i,s.DECEMBER,31,23,59,59),o=this.indexOfPeriod(r),a=-1*t,l=Object(n.toInt)(o/a)*a;return this.startOfPeriod(e,l,i)}
|
||
const r=s.get_cal(s.get_timezone("Etc/UTC"),i,s.JANUARY,1),o=d(this._session.spec,r),a=0===o?7*t:7*(t+1)-o;return a>s.get_days_per_year(r)?this.startOfPeriod(e,0,i+1):(s.add_date(r,a),r)}}class v{indexOfPeriod(e){return s.get_month(e)}startOfPeriod(e,t,i){if(t<0){const e=Object(n.toInt)((11-t)/12);i-=e,t+=12*e}else t>s.DECEMBER&&(i++,t=s.JANUARY);return s.get_cal(s.get_timezone("Etc/UTC"),i,t,1)}}function b(e,t,i,s=!1){const n=r.Interval.parse(e),o=n.multiplier();return n.isMinutes()?new l(60*o,t):n.isSeconds()?new l(o,t):n.isTicks()?new l(1,t):n.isRange()?new l(60*o,t):new u(t,i,o,function(e,t){switch(e){case r.ResolutionKind.Days:return new f(t);case r.ResolutionKind.Weeks:return new g(t);case r.ResolutionKind.Months:return new v}throw new Error("Unknown dwm resolution: "+e)}(n.kind(),t),s)}function S(e,t,i,s,r,n,o){return w(e,t,i,s,r,n,o,0)}function y(e,t,i,s,r,n,o){return w(e,t,i,s,r,n,o,1)}function w(e,t,i,s,n,a,l,c){const h=r.Interval.parse(n+s);if(h.isMonths()){const e=new Date(l);return 0===c&&e.setUTCDate(1),function(e,t){T(e,Math.floor(t/12));let i=e.getUTCMonth()-t%12;i<0&&(T(e,1),i+=12);e.setUTCMonth(i);for(;e.getUTCMonth()!==i;)M(e,1)}(e,a*h.multiplier()),e.getTime()}const u=new o.b("Etc/UTC",e,t,i),d=h.inMilliseconds(),p=h.isDWM();let _;_=p?864e5:60*u.spec.findSession(0,0,0).getEntry().length()*1e3;let m=0;m=h.isWeeks()?7:7-u.spec.weekEndsCount();const f=_/d,g=m*f;let v;if(a<g)v=a/f;else{v=7*(a/g)}return p&&(v=Math.floor(v)),l-864e5*v}function C(e,t,i,s,n,a,l){const c=r.Interval.parse(n+s);if(c.isMonths()){const e=new Date(a),t=new Date(l);let i=12*(t.getUTCFullYear()-e.getUTCFullYear());return i+=t.getUTCMonth()-e.getUTCMonth(),Math.ceil(i/c.multiplier())}const h=new o.b("Etc/UTC",e,t,i),u=c.inMilliseconds();let d;d=c.isDWM()?864e5:60*h.spec.findSession(0,0,0).getEntry().length()*1e3;let p=0;p=c.isWeeks()?7:7-h.spec.weekEndsCount();const _=l-a,m=d/u,f=p*m;let g=_/864e5*m;return g>=f&&(g=_/6048e5*f),Math.ceil(g)}function P(e,t){const i=s.clone(t);return e.alignToSessionStart(i),s.cal_to_utc(s.get_timezone(e.timezone()),i)}function x(e,t){const i=s.utc_to_cal(t.timezone,+e);let r=s.get_day_of_week(i),n=s.get_minutes_from_midnight(i);const o=t.spec.findSession(t.spec.getWeekIndex(i),r,n).getEntry();return o.isOvernight()&&n>o.startOffset()+o.length()&&r===o.dayOfWeek()-1&&(r++,n-=1440),r===o.dayOfWeek()&&n>=o.startOffset()&&n<o.startOffset()+o.length()}function T(e,t){const i=e.getUTCMonth();e.setUTCFullYear(e.getUTCFullYear()-t),e.getUTCMonth()!==i&&M(e,1)}function M(e,t){e.setTime(e.getTime()-864e5*t)}i.d(t,"newBarBuilder",(function(){return b})),i.d(t,"alignPeriodsBackForDataRequest",(function(){return S})),i.d(t,"alignPeriodsBackForVisibleRange",(function(){return y})),i.d(t,"getPeriodsBetweenDates",(function(){return C})),i.d(t,"alignExchangeTimeToSessionStartAndReturnUTC",(function(){return P})),i.d(t,"isTradingNow",(function(){return x})),i.d(t,"SessionInfo",(function(){return o.b}))},IjC5:function(e,t,i){"use strict";i.r(t),i.d(t,"RectangleRenderer",(function(){return u}))
|
||
;var s=i("Eyy1"),r=i("aO4+"),n=i("f6yo"),o=i("GEp6"),a=i("VdBB"),l=i("Tmoa"),c=i("8Uy/"),h=i("gAom");class u{constructor(e,t,i){this._data=null,this._hitTestResult=e||new a.HitTestResult(a.HitTestResult.MOVEPOINT),this._backHitTestResult=t||new a.HitTestResult(a.HitTestResult.MOVEPOINT_BACKGROUND),this._forceOverrideTransparency=Boolean(i)}setData(e){this._data=e}hitTest(e,t){if(null===this._data||this._data.points.length<2||this._data.nohittest)return null;const[i,s]=this._getPointsInPhysicalSpace(t),n=new r.Point(s.x,i.y),a=new r.Point(i.x,s.y),l=new r.Point(e.x*t.pixelRatio,e.y*t.pixelRatio),c=this._extendAndHitTestLineSegment(l,i,n,t);if(null!==c)return c;const h=this._extendAndHitTestLineSegment(l,a,s,t);if(null!==h)return h;let u=Object(o.distanceToSegment)(n,s,l);return u.distance<=3?this._hitTestResult:(u=Object(o.distanceToSegment)(i,a,l),u.distance<=3?this._hitTestResult:this._data.fillBackground?this._hitTestBackground(l,i,s,t):null)}getColor(){const e=Object(s.ensure)(this._data);return void 0===e.transparency?e.backcolor:Object(l.generateColor)(e.backcolor,e.transparency,this._forceOverrideTransparency)}draw(e,t){if(null===this._data||this._data.points.length<2||this._data.linewidth<=0&&!this._data.fillBackground)return;e.save();const[i,s]=this._getPointsInPhysicalSpace(t),r=this._data.linewidth?Math.max(1,Math.floor(this._data.linewidth*t.pixelRatio)):0,n=this._data.fillBackground?this.getColor():void 0,o=Math.max(1,Math.floor(t.pixelRatio));Object(h.fillRectWithBorder)(e,i.x,i.y,s.x,s.y,n,this._data.color,r,c.LINESTYLE_SOLID,this._data.extendLeft,this._data.extendRight,"center",t.physicalWidth,this._data.includeRightEdge&&1===o?1:0),e.restore()}_getPointsInPhysicalSpace(e,t=0){const i=Object(s.ensureNotNull)(this._data),[n,o]=i.points,a=e.pixelRatio,l=Math.min(n.x,o.x),c=Math.max(n.x,o.x),h=Math.min(n.y,o.y),u=Math.max(n.y,o.y),d=Math.round(l*a)+t,p=Math.round(c*a)+t,_=Math.round(h*a)+t,m=Math.round(u*a)+t;return[new r.Point(d,_),new r.Point(p,m)]}_extendAndHitTestLineSegment(e,t,i,s){const r=this._extendAndClipLineSegment(t,i,s);if(null!==r){if(Object(o.distanceToSegment)(r[0],r[1],e).distance<=3)return this._hitTestResult}return null}_extendAndClipLineSegment(e,t,i){const n=Object(s.ensureNotNull)(this._data);if(Object(r.equalPoints)(e,t))return null;const o=i.physicalWidth,a=Math.min(e.x,t.x),l=Math.max(e.x,t.x),c=n.extendLeft?0:Math.max(a,0),h=n.extendRight?o:Math.min(l,o);return c>h||h<=0||c>=o?null:[new r.Point(c,e.y),new r.Point(h,t.y)]}_hitTestBackground(e,t,i,s){const o=this._extendAndClipLineSegment(t,i,s);return null!==o&&Object(n.pointInBox)(e,Object(r.box)(o[0],o[1]))?this._backHitTestResult:null}}},InMJ:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),this.version=n.version,i.e("lt-pane-views").then(i.t.bind(null,"gr7S",7)).then(({FlatBottomPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 3}name(){return"Flat Bottom"}hasEditableCoordinates(){
|
||
return!1}addPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),s.prototype.addPoint.call(this,e)}setLastPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),s.prototype.setLastPoint.call(this,e)}setPoint(e,t,i){if(i&&i.shift()&&1===e){this._snapPoint45Degree(t,this.points()[0])}if(2===e)this._points[1].index=t.index;else if(3===e)return this._points[0].index=t.index,this._points[2].price=t.price,void this.normalizePoints();super.setPoint(e,t)}getPoint(e){return e<3?s.prototype.getPoint.call(this,e):3===e?{index:this._points[0].index,price:this._points[2].price}:void 0}canHasAlert(){return!0}_getAlertPlots(){var e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));var s=this._points[2];s.time=t.time,s.index=t.index;var r,n,o,a,l={price:s.price,time:e.time,index:e.index},c=[];s.index<=l.index?(c.push(s),c.push(l)):(c.push(l),c.push(s)),i[0].price>c[0].price?(r=i,n=c):c[0].price>i[0].price||c[1].price>i[1].price?(r=c,n=i):(r=i,n=c);var h=this.properties().extendLeft.value(),u=this.properties().extendRight.value();return e.index<=t.index?(o=h,a=u):(o=u,a=h),[this._linePointsToAlertPlot(r,"Upper",o,a),this._linePointsToAlertPlot(n,"Lower",h,a)]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"vm8R"))).GeneralTrendFiguresDefinitionsViewModel}static createProperties(e){var t=new r("linetoolflatbottom",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}n.version=1,t.LineToolFlatBottom=n},J2xC:function(e,t,i){e.exports={"css-value-header-toolbar-height":"38px"}},JT5O:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMarket",(function(){return n}));var s=i("hY0g"),r=i.n(s);class n{constructor(e,t){this._visibility=new r.a(!1),this._dialogPromise=null,this._dialog=null,this._chartWidgetCollection=e,this._options=t}visible(){return this._visibility.readonly()}show(e){var t;null===this._dialog&&this._requestDialog(e),null===(t=this._dialog)||void 0===t||t.open(e,void 0)}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}resetAllPages(){var e;null===(e=this._dialog)||void 0===e||e.resetAllStudies()}_requestDialog(e){if(null===this._dialogPromise){let t;t=Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(8),i.e(9),i.e(15),i.e(35),i.e(41),i.e(70),i.e(82),i.e(0),i.e(5),i.e(37),i.e("study-market")]).then(i.bind(null,"zbLM")).then(e=>new e.IndicatorsLibraryContainer(this._chartWidgetCollection,this._options)),this._dialogPromise=t.then(t=>{this._dialog=t,this._dialog.visible().subscribe(e=>{this._visibility.setValue(e)}),this._dialog.open(e)})}return this._dialogPromise}}},JWMC:function(e,t,i){"use strict";i.r(t),i.d(t,"trackEvent",(function(){return l}));i("bSeV");var s=i("FQhm"),r=i("Kxc7"),n=i("txPx")
|
||
;const o=Object(n.getLogger)("Common.TrackEvent"),a=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],l=(e,t,i)=>{if(r.enabled("charting_library_base"))return void((e,t,i)=>{t=t||e||i||"";let r="";for(let s=0;s<a.length;s++){const e=t.match(a[s]);if(e&&3===e.length){t=e[1],r=e[2];break}}Object(s.emit)(t.toLowerCase().replace(" ","_"),{category:e,label:i,value:r})})(e,t,i);let n=(e?e+":":"")+t;i&&(n+=" "+i),o.logNormal(n),r.enabled("widget")||!window._UNIT_TESTS&&window.gtag&&window.gtag("event",t,{event_category:e,event_label:i})};"undefined"!=typeof window&&(window.TradingView=window.TradingView||{},window.TradingView.trackEvent=l)},JcHK:function(e,t,i){"use strict";function s(e){return e.getAll().some(e=>e.isInitialized())}function r(e,t){const i=e.getAll(),s=()=>{t(),i.forEach(e=>{e.chartWidgetInitialized.unsubscribe(null,s)})};i.forEach(e=>{e.chartWidgetInitialized.subscribe(null,s,!0)})}i.r(t),i.d(t,"isAnyChartWidgetInitialized",(function(){return s})),i.d(t,"waitAnyChartWidgetInitialized",(function(){return r}))},JjUe:function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayDataWindowView",(function(){return h}));var s=i("ivNn"),r=i("4miz"),n=i("qFKp"),o=i("e92V"),a=i("mMWL"),l=i("e1Hy");const c=n.CheckMobile.any();class h extends r.b{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._valueProvider=this._createValuesProvider(e,t),this._items=this._valueProvider.getItems().map(e=>new r.a(e.title,"")),this.update()}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}update(){this._invalidated=!0}_updateImpl(){this._header=this._study.title();let e;this._showLastPriceAndChangeOnly()?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),Object(s.isNumber)(e)||(e=this._study.data().lastIndex()));const t=this._valueProvider.getValues(e);for(let i=0;i<t.length;++i){const e=t[i],s=this._items[i];s.setValue(e.value),s.setVisible(e.visible),s.setColor(e.color)}}_showLastPriceAndChangeOnly(){return c&&(null===this._model.crossHairSource().pane||Object(o.isLineToolName)(a.tool.value())||null!==this._model.lineBeingEdited())}_createValuesProvider(e,t){return new l.a(e,t)}}},JmuD:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasProperty=t.isObject=void 0,t.isObject=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},t.hasProperty=function(e,t){return t in e}},K4L1:function(e,t,i){"use strict";var s=i("Eyy1").assert,r=i("lCO3").Version,n=i("txPx").getLogger("Chart.Study.Versioning"),o=i("Wt0y"),a=i("0YCj"),l=i("TcSq").extractPineId,c=i("Si3H").migrateMetaInfoAndPropState;function h(e,t){if(!e)throw new Error("No studies metainfo");var s=i("EyEd");if(this._studiesMetainfo=e,!t)throw new Error("No studies migrations");this._studiesMigrations=t,this._migrations={};for(var r=0;r<this._studiesMigrations.length;r++)for(var o=this._studiesMigrations[r],a=o.versFrom,l=o.versTo,c=0;c<o.studyMigrations.length;c++){var h=o.studyMigrations[c],u=h.studyId
|
||
;if(0!==h.rules.length){var d=u in this._migrations?this._migrations[u]:new s(u);d.addMigration(a,l,h.rules),this._migrations[u]=d}else n.logError("Study Migration should have at least one convertion rule")}this._clientMigrations=[function(e,t){if(0===this._studiesMetainfo.length||!e.isTVScript||e.version>=22)return t;for(var i={},s=0,r=0;;){var n=t[r];if(void 0===n)break;var o=t[n.id];n.isFake&&(n.id="in_"+s++),i[r]=n,i[n.id]=o,r++}return i}]}h.prototype.updateMetaInfo=function(e){if(!e)return e;s(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync");for(var t=null,i=this._studiesMetainfo,r=0;r<i.length;r++)if(i[r].id===e.id){t=i[r];break}return TradingView.clone(t)},h.prototype.updateMetaInfoAsync=function(e){if(!e)return{sync:!1,result:Promise.reject("No old metaInfo was given")};new a(e),a.versionOf(e);for(var t=null,i=this._studiesMetainfo,s=0;s<i.length;s++)if(i[s].id===e.id){t=i[s];break}return{sync:!0,result:t?TradingView.clone(t):null}},h.prototype.lastVersionOfStudy=function(e){return this._studiesMetainfo.find((function(t){return t.id===e})).version},h.prototype.updateStudyInputs=function(e,t,i,s,o){var a=TradingView.clone(s);if(e in this._migrations){var l,c=r.parse(t);if("last"===i){var h=this.lastVersionOfStudy(e);l=r.parse(h)}else l=r.parse(i);a=this._migrations[e].updateInputs(c,l,a)}if(null==o)return a;for(var u in o)u in a||(a[u]=o[u]);for(var u in a)if(!(u in o)){var d=a[u];n.logWarn("Extra input detected, studyId="+e+", versionFrom="+t+", inputId="+u+", inputValue="+d+", removing it and continue..."),delete a[u]}return a},h.prototype.updateStudyState=function(e,t,i){if(null==e||null==t||null==i)return e;if(e=TradingView.clone(e),!(t.isTVScript||!!t.pine)&&t.version!==i.version){var s=i&&i.defaults.inputs,r=this.updateStudyInputs(t.id,t.version,i.version,e.inputs,s);e.inputs=r}for(var o=0;o<this._clientMigrations.length;++o){r=this._clientMigrations[o].call(this,t,e.inputs);Object.keys(r).length===Object.keys(e.inputs).length?e.inputs=r:n.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...")}var l=a.versionOf(t);if(t.isTVScript&&t.TVScriptSourceCode&&l>=12&&l<=26){var c={};for(o=0;o<t.plots.length;++o){var h=t.plots[o],u=i.plots[o];c[h.id]=u.id}var d=Object.keys(e.styles);for(o=0;o<d.length;++o){var p=d[o],_=e.styles[p];delete e.styles[p];var m=c[p];e.styles[m]=_}var f=Object.keys(e.plots);for(o=0;o<f.length;++o){var g=f[o];p=e.plots[g].id;e.plots[g].id=c[p]}}return e},h.prototype.patchPointsBasedStudyState=function(e){return h._fixInputsMaxValue(e.state,e.metaInfo),e},h.prototype.patchPointsBasedStudyData=function(e,t){if(!o.isProd())return t;if(!e||!t)return t;var i=TradingView.clone(t);return"VbPFixed@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&h._patchOldVolumeProfiles(0,i),i},h.prototype.patchStudyData=function(e,t,i,s){if(!o.isProd())return{data:t,nsData:i,indexes:s};var r=TradingView.clone(t),n=TradingView.clone(i),l=TradingView.clone(s)
|
||
;"VbPVisible@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&h._patchOldVolumeProfiles(0,r.graphics),"VbPSessions@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&h._patchOldVolumeProfiles(0,r.graphics);var c=a.versionOf(e);if(e.isTVScript&&e.TVScriptSourceCode&&c>=12&&c<=26){var u=r.columns;r.columns=[];for(var d=0;d<u.length;++d){var p="plot_"+d;r.columns.push(p)}}return{data:r,nsData:n,indexes:l}},h._patchOldVolumeProfiles=function(e,t){var i=t.hhists[e].data,s=[];for(var r in i)s=s.concat(i[r]);t.hhists[0].data=s},h._fixInputsOrder=function(e,t){for(var i=a.getOrderedInputIds(t),s=h.splitInputs(e.inputs),r=s.arr,n=s.obj,o=TradingView.merge({},n),l=0;l<i.length;++l){var c=i[l],u=h.findInputKeyById(r,c);if(null!==u){var d=r[u];o[l]=d}}e.inputs=o},h.INPUT_MAX_VALUE=1e12,h._verifyInputsMaxValue=function(e){var t=h.INPUT_MAX_VALUE;if(e.inputs)for(var i=0;i<e.inputs.length;i++){var s=e.inputs[i];"integer"===s.type&&(s.max&&s.max>t&&n.logWarn("Bad integer input max value in metaInfo id="+e.id+" title="+e.description))}},h._fixInputsMaxValue=function(e,t){if(!TradingView.isAbsent(t)){var i=h.INPUT_MAX_VALUE;if(t.inputs)for(var s=0;s<t.inputs.length;s++){"integer"===(a=t.inputs[s]).type&&(a.max&&a.max>i&&(a.max=i))}if(e&&e.inputs){var r=h.splitInputs(e.inputs),n=r.arr;for(var o in n){var a;"integer"===(a=n[o]).type&&(a.max&&a.max>i&&(a.max=i))}e.inputs=TradingView.merge(r.obj,r.arr)}}},h.prototype.patchPropsStateAndMetaInfo=function(e,t,i){"Script$BOOKER"!==t.productId||t.alerts||delete e.alerts,h._fixInputsOrder(e,t),h._fixInputsMaxValue(e,t);var s=h.splitInputs(e.inputs);e.inputs=s.obj;var r=a.versionOf(t);r<a.METAINFO_FORMAT_VERSION_SOS_V2&&t.isChildStudy&&(e.isChildStudy=t.isChildStudy);if(t.isTVScript&&t.version<60&&("Script$TV_EARNINGS@tv-scripting"!==t.id&&"Script$TV_DIVIDENDS@tv-scripting"!==t.id&&"Script$TV_SPLITS@tv-scripting"!==t.id||delete t.TVScriptSourceCode),"Volume"!==t.id&&"Volume@tv-basicstudies"!==t.id||0!==t.inputs.length||(t.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1e3}],t.plots.push({id:"vol_ma",type:"line"})),"Volume@tv-basicstudies"===t.id&&t.version&&t.version<=46&&void 0===e.styles.vol.transparency&&(e.styles.vol.transparency=e.transparency||87),"PivotPointsStandard@tv-basicstudies"===t.id&&(0===t.inputs.length?(e.inputs={kind:"Traditional",showHistoricalPivots:!0},t.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===t.inputs.length&&(e.inputs={kind:"Traditional"},t.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===e._hardCodedDefaultsVersion)){e._hardCodedDefaultsVersion=1;var n=e.color;delete e.color,e.levelsStyle={colors:{P:n,"S1/R1":n,"S2/R2":n,"S3/R3":n,"S4/R4":n,"S5/R5":n}}}"CMF"===t.shortId&&2===t.inputs.length&&(e.inputs={length:e.inputs["length fast"]},t.inputs=t.inputs.splice(0,1),
|
||
t.inputs[0].id="length"),t.defaults&&void 0===t.defaults.precision&&r<a.VERSION_NEW_STUDY_PRECISION_FORMAT&&(-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(t.id)?t.defaults.precision=0:t.defaults.precision=4);if(t.version<60)for(var o=["TV_DIVIDENDS","TV_SPLITS","TV_EARNINGS"],u="Script".length,d=0;d<o.length;d++)t.id.startsWith("Script$"+o[d]+"@tv-scripting")&&(t.fullId="ESD"+t.fullId.substring(u),t.id="ESD"+t.id.substring(u),t.name="ESD"+t.name.substring(u),t.shortId="ESD"+t.shortId.substring(u),t.productId="ESD"+t.productId.substring(u));var p={"ESD$TV_EARNINGS@tv-scripting":{fullId:"Earnings@tv-basicstudies-129!",id:"Earnings@tv-basicstudies",name:"Earnings@tv-basicstudies",shortId:"Earnings",productId:"tv-basicstudies"},"ESD$TV_SPLITS@tv-scripting":{fullId:"Splits@tv-basicstudies-129!",id:"Splits@tv-basicstudies",name:"Splits@tv-basicstudies",shortId:"Splits",productId:"tv-basicstudies"},"ESD$TV_DIVIDENDS@tv-scripting":{fullId:"Dividends@tv-basicstudies-129!",id:"Dividends@tv-basicstudies",name:"Dividends@tv-basicstudies",shortId:"Dividends",productId:"tv-basicstudies"}};if(t.id in p&&Object.assign(t,p[t.id]),r<a.VERSION_PINE_PROTECT_TV_4164){var _={"StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy":{pineId:"STD;Consecutive%1Ups%1Downs%1Strategy",className:"StrategyScript"},Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2:{pineId:"Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2",className:"Script"}};if(t.shortId in _){var m=_[t.shortId].className+"$"+_[t.shortId].pineId,f={scriptIdPart:_[t.shortId].pineId,fullId:t.fullId.replace(t.shortId,m),id:t.id.replace(t.shortId,m),name:t.name.replace(t.shortId,m),shortId:m};TradingView.merge(t,f),TradingView.merge(e,f)}var g=l(t.fullId),v=g&&g.match(/^(USER)(_\d+)(;)(.*)$/);if(v){var b=v[0],S=v[1]+v[3]+v[2]+v[4];f={scriptIdPart:S,fullId:t.fullId.replace(b,S),id:t.id.replace(b,S),name:t.name.replace(b,S),shortId:t.shortId.replace(b,S)};TradingView.merge(t,f),TradingView.merge(e,f)}}if("MA"===t.id){var y=new a({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),w=new a({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),C=new a({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),P=new a({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{
|
||
id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}});switch(e.inputs.type){case"exp":t=y;break;case"simple":t=w;break;case"weighted":t=P;break;case"volume weighted":t=C}e.styles[t.plots[0].id]=e.styles.MovAvg,delete e.styles.MovAvg,delete e.inputs.type}return i.oldShowStudyLastValueProperty&&(e.oldShowLastValue=e.showLastValue),delete e.showLastValue,delete e.showStudyArguments,c(t,e),{propsState:e,metaInfo:t}},h.mergeInputs=function(e,t){h.mergeInputsArrPart(e,t),h.mergeInputsObjPart(e,t)},h.mergeInputsArrPart=function(e,t){var i=h.splitInputs(t);for(var s in i.arr){var r=h.findInputKeyById(e,i.arr[s].id);r?TradingView.merge(e[r],i.arr[s]):h.appendInputInfoToArr(e,i.arr[s])}},h.mergeInputsObjPart=function(e,t){var i=h.splitInputs(t);TradingView.merge(e,i.obj)},h.appendInputInfoToArr=function(e,t){var i=-1;for(var s in e){var r=parseInt(s,10);isNumber(r)&&(r>i&&(i=r))}e[i+1]=t},h.splitInputs=function(e){var t={},i={};for(var s in e)isNumber(parseInt(s,10))?t[s]=e[s]:i[s]=e[s];return{arr:t,obj:i}},h.findInputKeyById=function(e,t){var i=null;for(var s in e)if(isNumber(parseInt(s,10))&&e[s].id===t){i=s;break}return i},h.getInputKeyById=function(e,t){var i=h.findInputKeyById(e,t);if(!i)throw new Error("Cannot find input with id: "+t);return i},e.exports=h},K5cv:function(e,t,i){"use strict";let s;function r(){return s}function n(e){s=e}i.r(t),i.d(t,"getSearchRequestDelay",(function(){return r})),i.d(t,"setSearchRequestDelay",(function(){return n}))},K8V9:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor"><path d="M13.111 18.5H10.5a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-8.389z"/><path d="M18.5 20v1.5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1H8"/></g></svg>'},K9GE:function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return r})),i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o}));const s=350,r={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};class n{constructor(e,t,i,s){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=s}easingFunc(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))}_a(e,t){return 1-3*t+3*e}_b(e,t){return 3*t-6*e}_c(e){return 3*e}_calcBezier(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e}_getSlope(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)}_getTForX(e){let t=e;for(let i=0;i<4;++i){const i=this._getSlope(t);if(0===i)return t;t-=(this._calcBezier(t)-e)/i}return t}}
|
||
const o={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black27:"#2f3241",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",brandNew2:"#2196F3",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30",growing:"#37bc9b",falling:"#ff4a68"}},"KG+6":function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a}));var s,r,n=i("Eyy1"),o=i("tqok");i("hsV8");function a(e,t){if(e.firstBarTime>=t.length||e.lastBarTime>=t.length)return null;const i=t[e.firstBarTime],s=t[e.lastBarTime];return i===o.a||s===o.a?null:(Object(n.assert)(i<=s,"firstBarTime should not exceed lastBarTime"),Object(n.assert)(e.priceLow<=e.priceHigh,"priceLow should not exceed priceHigh"),{firstBarTime:i,lastBarTime:s,rate:e.rate,priceHigh:e.priceHigh,priceLow:e.priceLow})}!function(e){e.LeftToRight="left_to_right",e.RightToLeft="right_to_left"}(s||(s={})),function(e){e.Relative="relative",e.Absolute="absolute"}(r||(r={}))},KUek:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aIyQ"),n=i.n(r),o=i("k9/m"),a=i("hsV8"),l=i("jy4L"),c=i("w4Ji"),h=i("jenN"),u=i("txPx");const d=Object(u.getLogger)("Chart.StudyDataSource");var p,_;!function(e){e[e.Undefined=0]="Undefined",e[e.Loading=1]="Loading",e[e.Completed=2]="Completed",e[e.Error=3]="Error"}(p||(p={})),function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingParent=2]="AwaitingParent",e[e.AwaitingFirstDataUpdate=3]="AwaitingFirstDataUpdate",e[e.Active=4]="Active"}(_||(_={}));class m{constructor(e,t,i,s){this._inputs=null,this._status=_.Idle,this._studyId=null,this._turnaroundCounter=1,this._studyStatus={type:p.Undefined},this._studyStatusChanged=new n.a,this._graphics=new h.LiveStudyGraphics,this._dataCleared=new n.a,this._dataUpdated=new n.a,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._metaInfo=s,this._seriesSource=t,this._turnaroundPrefix=i,this._plots=new o.PlotList(Object(c.studyPlotFunctionMap)(s),c.studyEmptyPlotValuePredicate),this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}destroy(){this.stop(),
|
||
this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged),this._dataUpdated.destroy(),this._dataCleared.destroy(),this._studyStatusChanged.destroy()}metaInfo(){return this._metaInfo}inputs(){return this._inputs}setInputs(e){this._inputs=e,null!==this._studyId&&(this._turnaroundCounter++,this._onStudyStatusChangedTo({type:p.Undefined}),this._gateway.modifyStudy(this._studyId,this._turnaround(),e,this._onMessage.bind(this)),this._status===_.Active&&this._changeStatusTo(_.AwaitingFirstDataUpdate))}isStarted(){return this._status!==_.Idle}isActive(){return this._status===_.Active}start(){this.isStarted()?d.logNormal("start: data source is already started, nothing to do"):(Object(s.assert)(null!==this._inputs,"Inputs should be defined when starting a study data source"),this._gateway.isConnected().value()?this._createStudy():this._changeStatusTo(_.AwaitingConnection))}stop(){this.isStarted()?(null!==this._studyId&&(this._gateway.removeStudy(this._studyId),this._studyId=null,this._onStudyStatusChangedTo({type:p.Undefined})),this._changeStatusTo(_.Idle)):d.logNormal("stop: data source is already stopped, nothing to do")}studyId(){return this._studyId}studyStatus(){return this._studyStatus}studyStatusChanged(){return this._studyStatusChanged}plots(){return this._plots}graphics(){return this._graphics}clearData(){this._plots.clear(),this._graphics.clear(),this._dataCleared.fire()}stopAndStealData(){Object(s.assert)(this._status===_.Active,"Couldn't steal data from non-active data source"),this.stop();const e=this._plots,t=this._graphics.extract();return this._plots=new o.PlotList(Object(c.studyPlotFunctionMap)(this._metaInfo),c.studyEmptyPlotValuePredicate),{plots:e,graphics:t}}dataCleared(){return this._dataCleared}dataUpdated(){return this._dataUpdated}_changeStatusTo(e){Object(s.assert)(this._status!==e,"Source and destination status should be distinct"),d.logNormal(`Status changed from ${_[this._status]} to ${_[e]}`),this._status=e}_createStudy(){const e=this._seriesSource.instanceId();null!==e?this._createStudyUsingParentId(e):(this._changeStatusTo(_.AwaitingParent),this._seriesSource.dataEvents().completed().subscribe(this,this._onSeriesCompleted,!0))}_createStudyUsingParentId(e){Object(s.assert)(this._status!==_.Active,'Status should not be "Active" when creating a study'),Object(s.assert)(this._studyStatus.type===p.Undefined,'Study status should be "Undefined" when creating a study'),Object(s.assert)(null===this._studyId,"Study id should be empty when creating a study"),this._studyId=Object(l.makeNextStudyId)(),this._gateway.createStudy(this._studyId,this._turnaround(),e,this._metaInfo.fullId+"!",Object(s.ensureNotNull)(this._inputs),this._onMessage.bind(this)),this._changeStatusTo(_.AwaitingFirstDataUpdate)}_onGatewayIsConnectedChanged(e){e?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===_.AwaitingConnection&&this._createStudy()}_onGatewayDisconnected(){this._status!==_.Idle&&this._status!==_.AwaitingConnection&&(this._studyId=null,
|
||
this._changeStatusTo(_.AwaitingConnection),this._studyStatus.type!==p.Undefined&&this._onStudyStatusChangedTo({type:p.Undefined})),this._turnaroundCounter=1}_onSeriesCompleted(){this._status===_.AwaitingParent&&this._createStudyUsingParentId(Object(s.ensure)(this._seriesSource.instanceId()))}_onStudyStatusChangedTo(e){const t=this._studyStatus;this._studyStatus=e,d.logNormal(`Study status type changed from ${p[t.type]} to ${p[e.type]}`),this._studyStatusChanged.fire(t,e)}_onMessage(e){if("data_update"===e.method){const{customId:t,turnaround:i,plots:r,nonseries:n}=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onDataUpdate(r,Object(s.ensureDefined)(n))}else if("study_loading"===e.method){const[t,i,s]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyLoading(s)}else if("study_completed"===e.method){const[t,i,s]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyCompleted(s)}else if("study_error"===e.method){const[t,i,s,r,n]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyError(s,r,n)}else"clear_data"===e.method&&this._checkTurnaround(e.params.turnaround)&&this.clearData()}_onDataUpdate(e,t){const i=Object(a.unpackNonSeriesData)(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then(()=>i,()=>i).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate}_onDataUnpacked(e,t,i){this._status!==_.Idle&&(this._status===_.AwaitingFirstDataUpdate&&(this._changeStatusTo(_.Active),this.clearData()),this._mergePlots(e),null!==i&&(i.indexes_replace?(Object(s.assert)("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._dataUpdated.fire(e,i,t))}_onStudyLoading(e){this._onStudyStatusChangedTo({type:p.Loading,startTime:Date.now()})}_onStudyError(e,t,i){this.clearData(),this._onStudyStatusChangedTo({type:p.Error,reason:e})}_onStudyCompleted(e){this._onStudyStatusChangedTo({type:p.Completed})}_mergePlots(e){this._plots.merge(e)}_turnaround(){return`${this._turnaroundPrefix}${this._turnaroundCounter}`}_checkTurnaround(e){const t=this._turnaround();return e===t||e===this._seriesSource.turnaround()||e===`${this._seriesSource.turnaround()}_${t}`}}var f=i("kcTO"),g=i("Ocx9"),v=i("oV8k"),b=i("Kxc7");i.d(t,"sessionsPreferencesDefault",(function(){return y})),i.d(t,"Sessions",(function(){return w}));const S=new f.PriceFormatter,y={graphics:{backgrounds:{outOfSession:{color:"#2196F3",transparency:92,visible:!1},preMarket:{color:"#FF9800",transparency:92,visible:!1},postMarket:{color:"#2196F3",transparency:92,visible:!1}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}};class w extends v.a{constructor(e,t,i){super(e,t),this._studySource=null,this._paneViews=[],this._metaInfo=null,this._destroyed=!1,this._isStarted=!1,this._loadedGraphics=null,this._doubleClickHandler=i;const s=t.mainSeries();this._properties=new g.DefaultProperty("sessions"),this._removeDuplicateProperties(),
|
||
this._properties.subscribe(this,this._onPropertiesChanged),t.studyMetaInfoRepository().findById({type:"java",studyId:"Sessions@tv-basicstudies"}).then(e=>{this._destroyed||null===this._loadedGraphics&&(this._setMetaInfo(e),null!==this._metaInfo&&(this._studySource=new m(t.chartApi(),s.seriesSource(),"sessions_",this._metaInfo),this._createPaneViews(),this._studySource.dataCleared().subscribe(this,this.updateAllViews),this._studySource.dataUpdated().subscribe(this,this.updateAllViews),this._studySource.setInputs({}),this._processHibernate()))}),t.timeScale().onReset().subscribe(this,this._clearData),t.timeScale().logicalRangeChanged().subscribe(this,this.updateAllViews),t.mainSeries().properties().extendedHours.subscribe(this,this._updateVisibleOfPreAndPostMarketBackground),t.mainSeries().properties().interval.subscribe(this,this._processHibernate),this._updateVisibleOfPreAndPostMarketBackground(t.mainSeries().properties().extendedHours)}start(){this._isStarted=!0,this._processHibernate()}restart(){this._clearData(),b.enabled("stop_study_on_restart")&&this.stop(),this.start()}isStarted(){return this._isStarted}stop(){this._isStarted=!1,null!==this._studySource&&this._studySource.stop()}isHoveredEnabled(){return!1}paneViews(e){return this._paneViews}updateAllViews(){this._paneViews.forEach(e=>e.update())}updateViewsForPane(e){this.updateAllViews()}destroy(){this._destroyed=!0,null!==this._studySource&&(this._studySource.dataCleared().unsubscribe(this,this.updateAllViews),this._studySource.dataUpdated().unsubscribe(this,this.updateAllViews),this._studySource.destroy(),this._studySource=null),this._model.timeScale().logicalRangeChanged().unsubscribe(this,this.updateAllViews),this._model.timeScale().onReset().unsubscribe(this,this._clearData),this._model.mainSeries().properties().extendedHours.unsubscribe(this,this._updateVisibleOfPreAndPostMarketBackground),this._model.mainSeries().properties().interval.unsubscribe(this,this._processHibernate),this._properties.unsubscribe(this,this._onPropertiesChanged)}series(){return this._model.mainSeries()}priceScale(){return this.series().priceScale()}graphics(){return this._loadedGraphics||Object(s.ensureNotNull)(this._studySource).graphics()}properties(){return this._properties}graphicsInfo(){return Object(s.ensureNotNull)(this._metaInfo).graphics}firstValue(e){return this._model.mainSeries().firstValue()}formatter(){return S}state(e){const t={properties:this._properties.state()};return e&&null!==this._metaInfo&&(t.data={graphics:Object(h.saveStudyGraphics)(this.graphics()),metaInfo:this._metaInfo}),t}restoreState(e,t){const i=e.properties;this._migrateOutOfSessionProperty(i),this._properties.mergeAndFire(i),this._removeDuplicateProperties(),this._updateVisibleOfPreAndPostMarketBackground(this._model.mainSeries().properties().extendedHours),void 0!==e.data&&t&&(this._loadStudyGraphics(e.data.graphics),this._setMetaInfo(e.data.metaInfo),this._createPaneViews())}restoreOldState(e,t){const i={properties:{graphics:e.state.graphics}};void 0!==e.data&&void 0!==e.metaInfo&&t&&(i.data={
|
||
metaInfo:e.metaInfo,graphics:e.data.graphics}),this.restoreState(i,t)}applyPreferences(e){this._properties.mergePreferences(e)}metaInfo(){return Object(s.ensureNotNull)(this._metaInfo)}_loadStudyGraphics(e){const t=e.backgrounds;if(void 0!==t){const e=t.findIndex(e=>"inSession"===e.styleId);-1!==e&&t.splice(e,1)}this._loadedGraphics=Object(h.loadStudyGraphics)(e)}_setMetaInfo(e){const t=e.graphics.backgrounds;void 0!==t&&void 0!==t.inSession&&delete t.inSession,this._metaInfo=e}_updateVisibleOfPreAndPostMarketBackground(e){const t=e.value();this._outOfSessionVisibilityProperty().setValue(t),this._preMarketVisibilityProperty().setValue(t),this._postMarketVisibilityProperty().setValue(t)}_clearData(){null!==this._studySource&&this._studySource.clearData()}_createPaneViews(){const e={doubleClickHandler:this._doubleClickHandler};Object(h.createGraphicsPaneViews)(this,this._model,e).then(e=>{this._paneViews=e,this._model.lightUpdate()})}_onPropertiesChanged(){this._processHibernate(),this.updateAllViews()}_processHibernate(){if(null!==this._studySource){const e=this._canBeHibernated(),t=this._isHibernated(),i=this._studySource.isStarted();!t&&e&&i?this._studySource.stop():!t||e||i||this._studySource.start()}}_canBeHibernated(){const e=this._model.mainSeries(),t=this._preMarketVisibilityProperty().value()&&this._postMarketVisibilityProperty().value()&&this._outOfSessionVisibilityProperty().value();return e.isDWM()||!t&&!this._vertLinesVisibleProperty().value()}_isHibernated(){return this._isStarted&&(null===this._studySource||!this._studySource.isStarted())}_outOfSessionVisibilityProperty(){return this._properties.childs().graphics.childs().backgrounds.childs().outOfSession.childs().visible}_preMarketVisibilityProperty(){return this._properties.childs().graphics.childs().backgrounds.childs().preMarket.childs().visible}_postMarketVisibilityProperty(){return this._properties.childs().graphics.childs().backgrounds.childs().postMarket.childs().visible}_vertLinesVisibleProperty(){return this._properties.childs().graphics.childs().vertlines.childs().sessBreaks.childs().visible}_removeDuplicateProperties(){this._properties.hasChild("properties")&&(this._properties.removeProperty("properties"),Object(g.saveDefaultProperties)(!0),this._properties.childChanged("",null),Object(g.saveDefaultProperties)(!1))}_migrateOutOfSessionProperty(e){const t=e.graphics.backgrounds;if(void 0!==t){const i=t.outOfSession;i.color===Object(s.ensureDefined)(y.graphics.backgrounds).outOfSession.color||"postMarket"in t||(e.graphics.backgrounds=Object.assign(Object.assign({},t),{postMarket:{color:i.color,transparency:i.transparency,visible:i.visible},preMarket:{color:i.color,transparency:i.transparency,visible:i.visible}}))}}}},KcY8:function(e,t,i){"use strict";var s=i("aO4+"),r=i("f6yo"),n=i("jFln"),o=i("VaSN"),a=i("972a"),l=i("Tmoa"),c=i("Ialn"),h=i("ikwP"),u=i("VdBB"),d=i("gAom"),p=i("//lt");class _{constructor(e,t){this.setData(e,t)}setData(e,t){this._data=Object.assign({},e),this._commonData=Object.assign({},t)}draw(e,t,i,s,r,o){
|
||
if(!this._data.visible)return;e.save(),e.font=t.font;const u=void 0!==this._data.labelIcon,p=this._data.tickVisible?t.tickLength:0,_=t.borderSize,m=t.paddingTop+this._commonData.additionalPaddingTop,f=t.paddingBottom+this._commonData.additionalPaddingBottom,g=t.paddingInner,v=t.paddingOuter,b=t.fontSize;let S=this._data.text,y=this._data.textColor||this._commonData.textColor,w=this._data.secondLine||"",C=this._commonData.secondLineTextColor||y,P=this._data.thirdLine||"";const x=this._commonData.thirdLineTextColor||y;0===w.length&&(w=P,C=x,P=""),0===S.length&&(S=w,y=C,w=P,C=x,P="");const T=i.yMidCorrection(e,S)*o,M=Math.ceil(i.measureText(e,S)),I=b+m+f,L=Boolean(w),O=Boolean(P),A=L?Math.ceil(i.measureText(e,w)):0,E=O?Math.ceil(i.measureText(e,P)):0,k=_+g+v+M+p,D=A>0?_+g+v+A+p:0,V=E>0?_+g+v+E+p:0,B=Math.max(k,D,V),R=Math.max(1,Math.floor(o));let N=Math.round(I*o);N%2!=R%2&&(N+=1);const j=Math.round((b+t.lineSpacing)*o),F=Math.round(2*(b+t.lineSpacing)*o),W=Math.max(1,Math.floor(_*o)),H=this._data.separatorVisible?W:0,z=this._data.borderVisible?W:0,U=u?N:Math.round(B*o),G=Math.round(p*o),q=Math.ceil(s*o),Y=Math.ceil(g*o);let K=this._commonData.coordinate;this._commonData.fixedCoordinate&&(K=this._commonData.fixedCoordinate),K=Math.round(K*o)-Math.floor(.5*o);const J=Math.floor(K+R/2-N/2),Z=J+N,X="right"===r,$=X?q-H:H,Q=q;let ee,te,ie=$;const se=Object(l.resetTransparency)(this._data.backgroung||this._commonData.background);e.fillStyle=se;const re=2*o;if(e.textAlign=X?"right":"left",e.textBaseline="middle",X?(ie=$-U,ee=$-G,te=$-G-Y-1):(ie=$+U,ee=$+G,te=$+G+Y),S||u){const i=O?N+F:L?N+j:N,s=this._commonData.borderColor||se,r=(t,s,r)=>{X?Object(d.drawRoundRectWithInnerBorder)(e,ie,J,U,i,t,[re,0,0,re],z,s,r):Object(d.drawRoundRectWithInnerBorder)(e,$,J,U,i,t,[0,re,re,0],z,s,r)};if(r(se,"transparent"),this._data.tickVisible){e.strokeStyle=Object(l.generateColor)(this._data.tickColor||y,35),e.lineWidth=R;const t=void 0!==this._commonData.borderStyle?this._commonData.borderStyle:a.LineStyle.Solid;Object(n.setLineStyle)(e,t),Object(d.drawHorizontalLine)(e,Math.floor(K+R/2),$,ee)}if(r("transparent",s,this._commonData.borderStyle),this._data.separatorVisible&&(e.fillStyle=t.paneBackgroundColor,e.fillRect(X?Q-H:0,J,H,Z-J)),u){switch(this._data.labelIcon){case 0:this._drawPlusIcon(e,$,ie,J,K,Z,R);break;case 1:this._drawClockIcon(e,$,ie,K,R,o)}return}e.save(),e.translate(te,(J+Z)/2+T),Object(h.drawScaled)(e,o,()=>{e.fillStyle=y,e.fillText(S,0,0)}),e.restore()}L&&(e.fillStyle=C,e.save(),e.translate(te,(J+Z)/2+T+j),Object(h.drawScaled)(e,o,()=>{e.fillText(Object(c.startWithLTR)(w),0,0)}),e.restore()),O&&(e.fillStyle=x,e.save(),e.translate(te,(J+Z)/2+T+F),Object(h.drawScaled)(e,o,()=>{e.fillText(Object(c.startWithLTR)(P),0,0)}),e.restore()),e.restore()}height(e){const t=this._data,i=(t.text?1:0)+(t.secondLine?1:0)+(t.thirdLine?1:0);return t.visible&&0!==i?i*e.fontSize+(i-1)*e.lineSpacing+e.paddingTop+this._commonData.additionalPaddingTop+e.paddingBottom+this._commonData.additionalPaddingBottom:0}hitTest(e){const t=this._data.hitTestData
|
||
;if(void 0===t||!this._data.visible)return null;const i=Object(o.lastEventIsTouch)()?10:0,n=Object(s.box)(new s.Point(t.xl-i,t.y-i),new s.Point(t.xl+t.containerWidth+i,t.y+t.containerHeight+i)),a=t.left&&Object(r.pointInBox)(e,n),l=Object(s.box)(new s.Point(t.xr-i,t.y-i),new s.Point(t.xr+t.containerWidth+i,t.y+t.containerHeight+i)),c=t.right&&Object(r.pointInBox)(e,l);if(a||c){const i=a?"left":"right";return new u.HitTestResult(u.HitTestResult.CUSTOM,{cursorType:p.PaneCursorType.Default,clickHandler:void 0===t.clickHandler?void 0:t.clickHandler.bind(this,e,i),tapHandler:void 0===t.clickHandler?void 0:t.clickHandler.bind(this,e,i),tooltip:t.tooltip})}return null}_drawPlusIcon(e,t,i,s,r,n,o){e.fillStyle=this._commonData.textColor,e.strokeStyle=this._commonData.textColor,e.lineWidth=o;const a=Math.abs(t-i);let l=Math.round(.35*a);l%2!=o%2&&(l+=1);let c=Math.round(.65*a);c%2!=o%2&&(c+=1);const h=Math.floor((a-l)/2),u=Math.min(t,i),d=u+Math.floor(a/2-o/2);e.fillRect(u+h,r,l,o),e.fillRect(d,s+h,o,l),e.beginPath(),e.arc(d+o/2,r+o/2,c/2,0,2*Math.PI,!1),e.stroke()}_drawClockIcon(e,t,i,s,r,n){e.fillStyle=this._commonData.textColor,e.lineWidth=r;const o=Math.abs(t-i);let a=Math.round(.35*o);a%2!=r%2&&(a+=1);let l=Math.round(.65*o);l%2!=r%2&&(l+=1);const c=Math.min(t,i)+Math.floor(o/2-r/2);e.save(),e.translate(c+r/2-l/2,s+r/2-l/2),e.scale(n,n);const h=new Path2D("M7.5 0.8a1 1 0 0 0 0 13.4 1 1 0 0 0 0-13.4zm0 1a1 1 0 0 1 0 11 1 1 0 0 1 0-11zm-.97-.25A3.5 3.5 0 0 0 3.5 0 3.5 3.5 0 0 0 0 3.5a3.5 3.5 0 0 0 1.75 3.03l.5-.86A2.5 2.5 0 0 1 1 3.5 2.5 2.5 0 0 1 3.5 1a2.5 2.5 0 0 1 2.17 1.25zm6.72 4.78A3.5 3.5 0 0 0 15 3.5 3.5 3.5 0 0 0 11.5 0a3.5 3.5 0 0 0-3.03 1.75l.86.5A2.5 2.5 0 0 1 11.5 1 2.5 2.5 0 0 1 14 3.5a2.5 2.5 0 0 1-1.25 2.17zM7 5h1v5H7zm3 2v1H5V7z");e.fill(h),e.restore()}}i.d(t,"a",(function(){return m}));class m{constructor(e){this._commonRendererData={coordinate:0,textColor:"#FFF",background:"#000",additionalPaddingBottom:0,additionalPaddingTop:0},this._axisRendererData={text:"",visible:!1,tickVisible:!0,separatorVisible:!1,borderVisible:!1},this._paneRendererData={text:"",visible:!1,tickVisible:!1,separatorVisible:!0,borderVisible:!1},this._invalidated=!0,this._axisRenderer=new(e||_)(this._axisRendererData,this._commonRendererData),this._paneRenderer=new(e||_)(this._paneRendererData,this._commonRendererData)}text(){return this._updateRendererDataIfNeeded(),this._axisRendererData.text}secondLineText(){return this._updateRendererDataIfNeeded(),this._axisRendererData.secondLine}thirdLineText(){return this._updateRendererDataIfNeeded(),this._axisRendererData.thirdLine}background(){return this._updateRendererDataIfNeeded(),this._commonRendererData.background}color(){return this._updateRendererDataIfNeeded(),this.generateTextColor(this.background())}generateTextColor(e){return Object(l.colorFromBackground)(e)}coordinate(){return this._updateRendererDataIfNeeded(),this._commonRendererData.coordinate}floatCoordinate(){return this._updateRendererDataIfNeeded(),
|
||
this._commonRendererData.floatCoordinate||this._commonRendererData.coordinate}update(){this._invalidated=!0}height(e){return this._updateRendererDataIfNeeded(),Math.max(this._axisRenderer.height(e),this._paneRenderer.height(e))}getFixedCoordinate(){return this._commonRendererData.fixedCoordinate||0}setFixedCoordinate(e){this._commonRendererData.fixedCoordinate=e}isVisible(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible||this._paneRendererData.visible}isAxisLabelVisible(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible}isPaneLabelVisible(){return this._updateRendererDataIfNeeded(),this._paneRendererData.visible}renderer(){return this._updateRendererDataIfNeeded(),this._axisRenderer}paneRenderer(){return this._updateRendererDataIfNeeded(),this._paneRenderer}setPaneRendererLabelIcon(e){this._paneRendererData.labelIcon=e}setPaneLabelVisible(e){this._paneRendererData.visible=e,this._invalidated=!0}ignoreAlignment(){return!1}_updateRendererDataIfNeeded(){this._invalidated&&(this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData)}}},Kdr6:function(e,t,i){"use strict";i.r(t),i.d(t,"HHistLegendView",(function(){return r}));var s=i("TG9i");class r extends s.HHistDataWindowView{constructor(e,t){super(e,t),this._showStudyValues=t.properties().paneProperties.legendProperties.showStudyValues}isValuesVisible(){return this._showStudyValues.value()}additional(){return null}destroy(){}}},KmlC:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyPlotCandlesPaneView",(function(){return l}));var s=i("Zy3/"),r=i("Zp/P"),n=i("vq8G"),o=i("/hKg"),a=i("ehkz");class l extends a.a{renderer(){const e=this._study.properties().ohlcPlots[this._plotName];if(!e.visible.value())return null;this._invalidated&&(this._updateImpl(),this._invalidated=!1);const t=this._model.timeScale().barSpacing(),i={bars:this._bars,barSpacing:t,wickVisible:e.drawWick.value(),bodyVisible:!0,borderVisible:e.drawBorder.value(),barWidth:Object(r.optimalBarWidth)(t),borderColor:e.borderColor.value(),wickColor:e.wickColor.value()},a=new s.CompositeRenderer;return a.append(new o.PaneRendererCandles(i)),this._model.selection().isSelected(this._series)&&this._isMarkersEnabled&&this._selectionData&&a.append(new n.SelectionRenderer(this._selectionData)),a}}},KnF9:function(e,t,i){"use strict";i.r(t),i.d(t,"EnvironmentState",(function(){return r}));var s=i("qFKp");class r{constructor(e){this._shift=!1,this._control=!1,this._alt=!1,void 0!==e&&(this._shift=Boolean(e.shiftKey),this._control=Boolean(Object(s.isMac)()?e.metaKey:e.ctrlKey),this._alt=Boolean(e.altKey))}shift(){return this._shift}control(){return this._control}alt(){return this._alt}shiftOnly(){return this._shift&&!this._control&&!this._alt}controlOnly(){return this._control&&!this._shift&&!this._alt}altOnly(){return this._alt&&!this._shift&&!this._control}
|
||
controlShift(){return this._shift&&this._control&&!this._alt}static create(e=!1,t=!1,i=!1){return new r({shiftKey:e,ctrlKey:t,metaKey:t,altKey:i})}}},KtbP:function(e,t,i){"use strict";i.r(t),i.d(t,"PanePriceAxisView",(function(){return n}));var s=i("u+0B");class r{constructor(e){this._priceAxisViewRenderer=null,this._rendererOptions=null,this._align="right",this._width=0,this._textWidthCache=e}setParams(e,t,i,s){this._priceAxisViewRenderer=e,this._rendererOptions=t,this._width=i,this._align=s}draw(e,t){null!==this._rendererOptions&&null!==this._priceAxisViewRenderer&&this._priceAxisViewRenderer.draw(e,this._rendererOptions,this._textWidthCache,this._width,this._align,t.pixelRatio)}hitTest(e){var t,i;return void 0===(null===(t=this._priceAxisViewRenderer)||void 0===t?void 0:t.hitTest)?null:null===(i=this._priceAxisViewRenderer)||void 0===i?void 0:i.hitTest(e)}}class n{constructor(e,t,i){this._renderer=null,this._invalidated=!0,this._priceAxisView=e,this._textWidthCache=new s.a(50),this._dataSource=t,this._chartModel=i,this._fontSize=-1,this._panePriceAxisViewRenderer=new r(this._textWidthCache)}update(){this._invalidated=!0}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){this._priceAxisView.update(),this._renderer=null;const i=this._chartModel.crossHairSource(),s=this._dataSource===i?i.pane:this._chartModel.paneForSource(this._dataSource);if(null===s)return;const r=this._priceScale();if(null===r)return;let n=s.priceScalePosition(r);if("overlay"===n&&(n=s.priceScalePosition(s.defaultPriceScale())),"overlay"===n)return;const o=this._chartModel.priceAxisRendererOptions();o.fontSize!==this._fontSize&&(this._fontSize=o.fontSize,this._textWidthCache.reset()),this._panePriceAxisViewRenderer.setParams(this._priceAxisView.paneRenderer(),o,t,n),this._renderer=this._panePriceAxisViewRenderer,this._invalidated=!1}_priceScale(){return this._dataSource.priceScale()}}},"L/Ed":function(e,t,i){"use strict";var s;i.r(t),i.d(t,"ToolboxType",(function(){return s})),function(e){e[e.Delete=0]="Delete"}(s||(s={}))},LAp3:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("ogJP"),r=i("5rJj"),n=i.n(r);class o extends n.a{constructor(e,t){super(e,t,!1,{names:["width","color","visible"]})}_iterateLevels(e,t){for(const i in e.levels)if(e.levels[i]&&Object(s.isSameType)(e.levels[i],t.typecheck())){let s=t.tpl();for(const r in this._map.names)this._map.names.hasOwnProperty(r)&&(s=t.fill(r,this._map.names[r],e.levels[i],s));e.levels[i]=s}return e}}function a(e,t){return new o(e,t)}},LdoW:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor"><path d="M6.5 15A8.5 8.5 0 1 0 15 6.5H8.5"/><path d="M12 10L8.5 6.5 12 3"/></g></svg>'},Ltzl:function(e,t,i){"use strict";i.r(t),i.d(t,"SaveLineToolStateUndoCommand",(function(){return n}));var s=i("Eyy1"),r=i("RDU5");class n extends r.UndoCommand{constructor(e,t,i,s=!0){super(i,s),this._newStates=[],this._model=e,this._savedStates=t.map(e=>e.state(!1))}
|
||
redo(){this._applyState(this._newStates)}undo(){0===this._newStates.length&&this.saveNewState(),this._applyState(this._savedStates)}saveNewState(){const e=this._savedStates.map(e=>Object(s.ensureNotNull)(this._model.dataSourceForId(e.id)));this._newStates=e.map(e=>e.state(!1))}_applyState(e){for(const t of e){const e=this._model.dataSourceForId(t.id);null!==e&&this._model.restoreLineToolState(e,t)}}}},LxhU:function(e,t,i){"use strict";i.r(t),i.d(t,"ResolutionKind",(function(){return n})),i.d(t,"SpecialResolutionKind",(function(){return o})),i.d(t,"Interval",(function(){return h})),i.d(t,"isHour",(function(){return d}));const s=/^(\d*)([TSHDWMR])$/,r=/^(\d+)$/;var n,o;!function(e){e.Ticks="ticks",e.Seconds="seconds",e.Minutes="minutes",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(n||(n={})),function(e){e.Hours="hours"}(o||(o={}));const a={};a[n.Ticks]=1e3,a[n.Seconds]=1e3,a[n.Minutes]=60*a[n.Seconds],a[n.Days]=1440*a[n.Minutes],a[n.Weeks]=7*a[n.Days];const l={T:n.Ticks,S:n.Seconds,D:n.Days,W:n.Weeks,M:n.Months,R:n.Range},c=new Set([n.Ticks,n.Seconds,n.Minutes]);class h{constructor(e,t){this._kind=n.Invalid,this._multiplier=0,e!==n.Invalid&&t>0&&(this._kind=e,this._multiplier=t)}kind(){return this._kind}multiplier(){return this._multiplier}isValid(){return this.kind()!==n.Invalid&&this.multiplier()>0}isDWM(){return this.isValid()&&!this.isRange()&&!this.isIntraday()&&!this.isTicks()}isIntraday(){const e=c.has(this.kind());return this.isValid()&&e}isSeconds(){return this.kind()===n.Seconds}isMinutes(){return this.kind()===n.Minutes}isMinuteHours(){return this.kind()===n.Minutes&&d(this.multiplier())}isDays(){return this.kind()===n.Days}isWeeks(){return this.kind()===n.Weeks}isMonths(){return this.kind()===n.Months}isRange(){return this.kind()===n.Range}isTicks(){return this.kind()===n.Ticks}isTimeBased(){return!this.isRange()}letter(){return this.isValid()&&this.kind()!==n.Minutes?this.kind()[0].toUpperCase():""}value(){return this.isValid()?this.kind()===n.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""}isEqualTo(e){if(!(e instanceof h))throw new Error("Argument is not an Interval");return!(!this.isValid()||!e.isValid())&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())}inMilliseconds(e=Date.now()){if(!this.isValid()||this.isRange())return NaN;if(this.isMonths()){const t=new Date(e);t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1));return+t-e}const t=this.multiplier();return a[this.kind()]*t}static isEqual(e,t){return h.parse(e).isEqualTo(h.parse(t))}static parse(e){e=(e+"").toUpperCase().split(",")[0];let t=s.exec(e);return null!==t?"H"===t[2]?new h(n.Minutes,60*u(t[1])):new h(l[t[2]],u(t[1])):(t=r.exec(e),null!==t?new h(n.Minutes,u(t[1])):new h(n.Invalid,0))}static kind(e){return h.parse(e).kind()}static isValid(e){return h.parse(e).isValid()}static isDWM(e){return h.parse(e).isDWM()}static isIntraday(e){return h.parse(e).isIntraday()}static isSeconds(e){return h.parse(e).isSeconds()}static isMinutes(e){return h.parse(e).isMinutes()}
|
||
static isMinuteHours(e){return h.parse(e).isMinuteHours()}static isDays(e){return h.parse(e).isDays()}static isWeeks(e){return h.parse(e).isWeeks()}static isMonths(e){return h.parse(e).isMonths()}static isRange(e){return h.parse(e).isRange()}static isTicks(e){return h.parse(e).isTicks()}static isTimeBased(e){return h.parse(e).isTimeBased()}static normalize(e){const t=h.parse(e);return t.isValid()?t.value():null}}function u(e){return 0===e.length?1:parseInt(e,10)}function d(e){return e>=60&&!(e%60)}},"M7/j":function(e,t,i){"use strict";i.r(t),i.d(t,"itemsRangeIsValid",(function(){return h})),i.d(t,"splitItems",(function(){return u})),i.d(t,"PaneRendererBaseline",(function(){return d}));var s=i("aO4+"),r=i("hBTJ"),n=i("GEp6"),o=i("Zp/P"),a=i("Y7w9"),l=i("cPgM"),c=i("VdBB");function h(e){if(0===e.length)return!1;const t=e.findIndex(e=>Object(o.coordinateIsValid)(e.y));if(-1===t)return!1;let i=e.length-1;for(;i>t&&!Object(o.coordinateIsValid)(e[i].y);)i--;return!(t>i)}function u(e,t){const i=[],n=[];let a=null;for(let l=0;l<e.length;l++){let c=e[l];const h=e[l+1]||{};if(Object(o.coordinateIsValid)(c.y))c.y<=t&&i.push(c),c.y>=t&&n.push(c),a=c;else{if(null===a)continue;c=a}if(Object(o.coordinateIsValid)(h.y)&&(c.y>t&&h.y<t||c.y<t&&h.y>t))if(Math.abs(c.x-h.x)<1){const e=new s.Point(c.x,t);i.push(e),n.push(e)}else{const e=Object(r.intersectLineSegments)(c,h,new s.Point(c.x,t),new s.Point(h.x,t));if(null!==e){const t=c.add(h.subtract(c).scaled(e));i.push(t),n.push(t)}}}return{topItems:i,bottomItems:n}}class d extends l.ScaledPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const{items:t,topLineWidth:i,bottomLineWidth:r}=this._data,l=Object(o.interactionTolerance)().series+(i+r)/4,h=Object(a.lowerbound)(t,e,(e,t)=>e.x<=t.x),u=Math.max(1,h-1),d=Math.min(t.length-1,h+1);for(let o=u;o<=d;++o){const i=t[o-1],r=t[o],{distance:a}=Object(n.distanceToSegment)(new s.Point(i.x,i.y),new s.Point(r.x,r.y),new s.Point(e.x,e.y));if(a<=l)return new c.HitTestResult(c.HitTestResult.REGULAR)}return null}_drawImpl(e){if(null===this._data)return;const{items:t,baseLevelCoordinate:i,bottom:s,bottomFillColor1:r,bottomFillColor2:n,topFillColor1:o,topFillColor2:a,topLineColor:l,bottomLineColor:c,topLineWidth:d,bottomLineWidth:p}=this._data;if(!h(t))return;const{topItems:_,bottomItems:m}=u(t,i);e.lineCap="round",e.lineJoin="round",0!==_.length&&(e.beginPath(),e.moveTo(_[0].x,i),this._makeLine(e,_,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,o,a,i-s,i),e.fill(),e.beginPath(),this._makeLine(e,_,!1,0),e.lineWidth=d,e.strokeStyle=l,e.stroke()),0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,i),this._makeLine(e,m,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,r,n,i,i+s),e.fill(),e.beginPath(),this._makeLine(e,m,!1,1),e.lineWidth=p,e.strokeStyle=c,e.stroke())}_makeLine(e,t,i,s){if(null===this._data)return;const r=t.findIndex(e=>Object(o.coordinateIsValid)(e.y));if(-1===r)return;const{barSpacing:n,baseLevelCoordinate:a}=this._data,l=.25*n;let c
|
||
;const h=t.length;for(let u=r;u<h;u++){const n=t[u],h=t[u+1]||{};if(Object(o.coordinateIsValid)(n.y)){if(0===s){if(c&&c.y>=a&&n.y>=a){e.moveTo(n.x,n.y);continue}}else if(c&&c.y<=a&&n.y<=a){e.moveTo(n.x,n.y);continue}if(c&&Object(o.coordinateIsValid)(c.y))e.lineTo(n.x,n.y),i&&!Object(o.coordinateIsValid)(h.y)&&e.lineTo(n.x,a);else if(h&&Object(o.coordinateIsValid)(h.y))i?(u!==r&&e.lineTo(n.x,a),e.lineTo(n.x,n.y)):e.moveTo(n.x,n.y);else if(i){if(0===u)continue;u!==r&&e.lineTo(n.x-l,a),e.lineTo(n.x-l,n.y),e.lineTo(n.x+l,n.y),e.lineTo(n.x+l,a)}else e.moveTo(n.x-l,n.y),e.lineTo(n.x+l,n.y);c=n}}}_makeLinearGradient(e,t,i,s,r){const n=e.createLinearGradient(0,s,0,r);return n.addColorStop(0,t),n.addColorStop(1,i),n}}},MA5A:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolCrossLine",(function(){return a}));var s=i("Ocx9"),r=i("p1SQ"),n=i("GmZZ"),o=i("Ss5c");class a extends o.LineDataSource{constructor(e,t){super(e,t||a.createProperties()),this._priceAxisView=new r.LineToolHorzLinePriceAxisView(this),this._timeAxisView=new n.a(this),i.e("lt-pane-views").then(i.bind(null,"amUF")).then(({CrossLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 1}name(){return"Cross Line"}priceAxisViews(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null}timeAxisViews(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null}updateAllViews(){super.updateAllViews(),this._priceAxisView.update(),this._timeAxisView.update()}canHasAlert(){return!1}lineColor(){return this.properties().linecolor.value()}lineWidth(){return this.properties().linewidth.value()}lineStyle(){return this.properties().linestyle.value()}static createProperties(e){const t=new s.DefaultProperty("linetoolcrossline",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"xrdl")).then(e=>e.CrossLineDefinitionsViewModel)}static _configureProperties(e){o.LineDataSource._configureProperties(e)}}},MROS:function(e,t,i){"use strict";i.r(t),i.d(t,"ModelSelection",(function(){return o}));var s=i("Y7w9"),r=i("GxN8"),n=i("CW80");class o{constructor(){this._items=[],this._set=new Set}isEmpty(){return 0===this._items.length}add(e){if(this._items.length>0&&!Object(n.isLineTool)(this._items[0])&&this.clear(),Object(n.isLineTool)(e)){const t=Object(s.lowerbound)(this._items,e,(e,t)=>e.zorder()<t.zorder());this._items.splice(t,0,e)}else this.clear(),this._items=[e];this._set.add(e)}canBeAddedToSelection(e){return 0===this._items.length||Object(n.isLineTool)(this._items[0])&&Object(n.isLineTool)(e)}isSelected(e){return this._set.has(e)}allSources(){return this._items.slice(0)}dataSources(){return this._items.filter(r.a)}lineDataSources(){return this._items.filter(n.isLineTool)}customSources(){return this._items.filter(e=>!Object(r.a)(e))}checkLineToolSelection(){
|
||
this._items.forEach(e=>Object(n.isLineTool)(e)&&e.calcIsActualSymbol()),this._items=this._items.filter(e=>!Object(n.isLineTool)(e)||e.isActualSymbol())}remove(e){this._items=this._items.filter(t=>t!==e),this._set.delete(e)}clear(){this._items=[],this._set.clear()}notFixedSources(){return this._items.filter(e=>!Object(n.isLineTool)(e)||!e.isFixed())}}},MWAT:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleSelectionStrategyEvenly",(function(){return o})),i.d(t,"PriceScaleSelectionStrategyAllRight",(function(){return a})),i.d(t,"PriceScaleSelectionStrategyAllLeft",(function(){return l})),i.d(t,"createPriceScaleSelectionStrategy",(function(){return h})),i.d(t,"allPriceScaleSelectionStrategyInfo",(function(){return u}));var s=i("Eyy1"),r=i("3ClC");class n{constructor(e){this._priceScalesLimit=8,this._metaInfo=e}metaInfo(){return this._metaInfo}findSuitableScale(e,t,i,s){if(void 0!==s)return this._tryToGetDesiredPriceScale(e,t,s,i);if(Object(r.isStudy)(t)){const s=t.metaInfo();if("Volume"===s.shortId&&e.containsMainSeries())return e.createPriceScaleAtPosition("overlay");const n=t.desiredPriceScalePosition();if(null!==n)return this._tryToGetDesiredPriceScale(e,t,n,i);if(void 0!==i&&(Object(r.isStudy)(i)||e.isMainPane())&&s.is_price_study)return this._getPriceScaleTheSameAsForSource(i,e)}let n=!1;if(Object(r.isStudy)(t)){const i=t.metaInfo().groupingKey;if(void 0!==i){const t=e.model().findNonOverlayStudyWithGroupingKey(i,e);if(null!==t)return this._getPriceScaleTheSameAsForSource(t.study,t.pane)}n=Boolean(t.metaInfo().is_price_study)}else t===e.model().mainSeries()&&(n=!0);if(n){const t=this._findFirstScaleForPriceStudy(e);if(null!==t)return t}return this.createNewPriceScaleIfPossible(e)}canCreateNewPriceScale(e){return e.leftPriceScales().length+e.rightPriceScales().length<this._priceScalesLimit}_getPriceScaleTheSameAsForSource(e,t){return t.isOverlay(e)?t.createPriceScaleAtPosition("overlay"):Object(s.ensureNotNull)(e.priceScale())}_priceScaleIsPrice(e,t){const i=e.mainSource();return!!i&&(i===t.mainSeries()||!!Object(r.isStudy)(i)&&Boolean(i.metaInfo().is_price_study))}_findFirstScaleForPriceStudy(e){const t=e.model();for(let i=0;i<this._priceScalesLimit;i++){if(e.rightPriceScales().length>i&&this._priceScaleIsPrice(e.rightPriceScales()[i],t))return e.rightPriceScales()[i];if(e.leftPriceScales().length>i&&this._priceScaleIsPrice(e.leftPriceScales()[i],t))return e.leftPriceScales()[i]}return null}_targetPriceScaleIndex(e,t){if(e.mainSource()===t.mainSeries())return 0}_tryToGetDesiredPriceScale(e,t,i,r){switch(i){case"left":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay");case"right":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay");case"as-series":return void 0!==r?Object(s.ensureNotNull)(r.priceScale()):e.isMainPane()?Object(s.ensureNotNull)(Object(s.ensureNotNull)(e.mainDataSource()).priceScale()):this.createNewPriceScaleIfPossible(e);case"overlay":
|
||
return e.createPriceScaleAtPosition("overlay")}}}class o extends n{constructor(e){super(e)}apply(e){if(e.containsMainSeries()){const t=Object(s.ensureNotNull)(Object(s.ensureNotNull)(e.mainDataSource()).priceScale());e.movePriceScale(t,"right",0)}const t=e.model();for(;e.leftPriceScales().length>e.rightPriceScales().length;){const i=e.leftPriceScales()[e.leftPriceScales().length-1];e.movePriceScale(i,"right",this._targetPriceScaleIndex(i,t))}for(;e.rightPriceScales().length-e.leftPriceScales().length>1;){const i=e.rightPriceScales()[e.rightPriceScales().length-1];e.movePriceScale(i,"left",this._targetPriceScaleIndex(i,t))}}createNewPriceScaleIfPossible(e){if(!this.canCreateNewPriceScale(e))return e.createPriceScaleAtPosition("overlay");const t=e.leftPriceScales().length<e.rightPriceScales().length?"left":"right";return e.createPriceScaleAtPosition(t)}}class a extends n{constructor(e){super(e)}apply(e){const t=e.model();e.leftPriceScales().slice(0).forEach(i=>e.movePriceScale(i,"right",this._targetPriceScaleIndex(i,t)))}createNewPriceScaleIfPossible(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay")}}class l extends n{constructor(e){super(e)}apply(e){const t=e.model();e.rightPriceScales().slice(0).forEach(i=>e.movePriceScale(i,"left",this._targetPriceScaleIndex(i,t)))}createNewPriceScaleIfPossible(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay")}}const c=[{name:"left",title:window.t("Stack On The Left"),ctor:l},{name:"right",title:window.t("Stack On The Right"),ctor:a},{name:"auto",title:window.t("Auto"),ctor:o}];function h(e){const t=Object(s.ensureDefined)(c.find(t=>t.name===e));return new t.ctor(t)}function u(){return c}},MXV9:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor" transform="translate(4 4)"><path d="M.5 10.992c0 .287.226.508.505.508H2.65c.19.93.55 1.82 1.09 2.63L2.577 15.3a.5.5 0 0 0-.007.71l1.42 1.42a.5.5 0 0 0 .71-.007l1.17-1.163c.81.54 1.71.9 2.63 1.09v1.645c0 .284.227.505.508.505h1.984c.28 0 .508-.221.508-.505V17.35a7.46 7.46 0 0 0 2.63-1.09l1.17 1.163a.5.5 0 0 0 .71.007l1.42-1.42a.5.5 0 0 0-.007-.71l-1.163-1.17c.54-.81.9-1.7 1.09-2.63h1.645a.502.502 0 0 0 .505-.508V9.008a.503.503 0 0 0-.505-.508H17.35c-.19-.93-.55-1.82-1.09-2.63l1.163-1.17a.5.5 0 0 0 .007-.71l-1.42-1.42a.5.5 0 0 0-.71.007L14.13 3.74a7.46 7.46 0 0 0-2.63-1.09V1.005A.504.504 0 0 0 10.992.5H9.008a.504.504 0 0 0-.508.505V2.65c-.92.19-1.82.55-2.63 1.09L4.7 2.577a.5.5 0 0 0-.71-.007L2.57 3.99a.5.5 0 0 0 .007.71L3.74 5.87c-.54.81-.9 1.7-1.09 2.63H1.005a.503.503 0 0 0-.505.508v1.984z"/><circle cx="10" cy="10" r="2.5"/></g></svg>'},MY2c:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var s=i("RDU5"),r=i("aIyQ"),n=i.n(r),o=i("txPx");const a=Object(o.getLogger)("Common.UndoStack");class l{constructor(){this._commands=[],this._onChange=new n.a}onChange(){return this._onChange}isEmpty(){
|
||
return 0===this._commands.length}clear(){this.isEmpty()||(this._commands.length=0,this._onChange.fire())}push(e){if(!(e instanceof s.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(e),this._onChange.fire(e)}pop(){if(this.isEmpty())return void a.logDebug("pop: undo stack is empty");const e=this._commands.pop();return this._onChange.fire(e),e}head(){if(!this.isEmpty())return this._commands[this._commands.length-1]}}},MbIA:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("4kQX"),r=i("gQ5K");const n={dateFormat:"yyyy-MM-dd",timeFormat:"%h:%m:%s",dateTimeSeparator:" "};class o{constructor(e={}){const t=Object.assign({},n,e);this._dateFormatter=new r.DateFormatter(t.dateFormat),this._timeFormatter=new s.TimeFormatter(t.timeFormat),this._separator=t.dateTimeSeparator}format(e){return`${this._dateFormatter.format(e)}${this._separator}${this._timeFormatter.format(e)}`}formatLocal(e){return`${this._dateFormatter.formatLocal(e)}${this._separator}${this._timeFormatter.formatLocal(e)}`}}},MrEN:function(e,t,i){"use strict";var s=i("aIyQ"),r=function(e,t){this._server=e,this._session=t,this.seriesCompleted=new s,this.seriesError=new s};r.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},r.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},r.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},r.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},r.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},r.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},r.prototype.onSeriesError=function(e,t,i){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t,i]}),this.seriesError.fire(e,t)},r.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},r.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},r.prototype.onTickmarksUpdated=function(e,t){var i={method:"tickmark_update",params:[this._session,{index:e,zoffset:0,changes:[],marks:t,index_diff:[]}]};this._server.receiveLocalResponse(i)},r.prototype.onTimescaleUpdate=function(e,t){var i={method:"timescale_update",params:[this._session,this._prepareDataUpdateObjects(t),{index:e.pointsIndex,zoffset:0,changes:e.points,marks:e.marks,index_diff:e.indexChange,baseIndex:e.baseIndex}]};this._server.receiveLocalResponse(i)},r.prototype.onTimescaleCompleted=function(e){this._server.receiveLocalResponse({
|
||
method:"timescale_completed",params:[this._session,e]})},r.prototype.onSeriesTimeframeUpdate=function(e,t,i,s,r){var n={method:"series_timeframe",params:[this._session,e,t,i,s,null,!0,r]};this._server.receiveLocalResponse(n)},r.prototype.onPointsetDataUpdate=function(e,t,i){this.onDataUpdate(e,t,i,null)},r.prototype._prepareDataUpdateObjects=function(e){var t={};return e.forEach((function(e){t[e.objId]={series:e.data,turnaround:e.turnaround},e.nonSeriesData&&(e.nonSeriesData.data?t[e.objId].nonseries={d:JSON.stringify(e.nonSeriesData.data),indexes:e.nonSeriesData.indexes}:t[e.objId].nonseries={d:"",indexes:[]})})),t},r.prototype.onDataUpdate=function(e,t,i,s){var r={method:"data_update",params:[this._session,this._prepareDataUpdateObjects([{objId:e,turnaround:t,data:i,nonSeriesData:s}])]};this._server.receiveLocalResponse(r)},r.prototype.onQuotesData=function(e){this._server.receiveLocalResponse({method:"quote_symbol_data",params:e})},r.prototype.onDepthData=function(e){this._server.receiveLocalResponse({method:"dd",params:e})},r.prototype.onDepthUpdate=function(e){this._server.receiveLocalResponse({method:"dpu",params:e})},r.prototype.onClearData=function(e){this._server.receiveLocalResponse({method:"clear_data",params:[this._session,e]})},TradingView.ChartapiMessagerInstances=[],e.exports=r},"N+BX":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBezierCubic",(function(){return n}));var s=i("Ocx9"),r=i("Ss5c");class n extends r.LineDataSource{constructor(e,t){const s=t||n.createProperties();super(e,s),this._controlPoints=null,i.e("lt-pane-views").then(i.bind(null,"a6on")).then(t=>{this._setPaneViews([new t.BezierCubicPaneView(this,e)])})}pointsCount(){return 2}name(){return"Double Curve"}properties(){return super.properties()}setLastPoint(e,t){super.setLastPoint(e,t),this._controlPoints=this._calculateControlPoints()}addPoint(e,t,i){const s=super.addPoint(e,t,i);if(s){const e=this._calculateControlPoints();this._controlPoints=null,this._points.push(e[0]),this._points.push(e[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return s}restorePoints(e,t,i){super.restorePoints(e,t,i),this._createPointProperty(2),this._createPointProperty(3)}controlPoints(){return this._controlPoints}static createProperties(e){const t=new s.DefaultProperty("linetoolbeziercubic",e);return n._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"b4fl")).then(e=>e.GeneralBezierDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e)}_calculateControlPoints(){const e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5).transposed().scaled(.3),s=e.add(t).scaled(.33),r=e.add(t).scaled(.67),n=s.add(i),o=r.subtract(i);return[this.screenPointToPoint(n),this.screenPointToPoint(o)]}}},N1UO:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyApi",(function(){return m}));i("YFKU")
|
||
;var s=i("Eyy1"),r=i("ogJP"),n=i("9iCb"),o=i("xo8u"),a=i("gaBL"),l=i("HGup"),c=i("jRfx"),h=i("/ToI"),u=i("HZKX"),d=i("SwuQ"),p=i("Yt+L"),_=i("GD+X");class m{constructor(e,t){this._study=e,this._chartWidget=t,this._undoModel=this._chartWidget.model(),this._model=this._undoModel.model()}isUserEditEnabled(){return this._study.userEditEnabled()}setUserEditEnabled(e){this._study.setUserEditEnabled(e)}getInputsInfo(){return this._study.metaInfo().inputs.map(e=>Object.assign(Object.assign({},e),{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""}))}getInputValues(){const e=this._study.inputs({symbolsForChartApi:!1,asObject:!0});return Object.keys(e).map(t=>{const i=e[t];return{id:t,value:Object(r.isObject)(i)?i.v:i}})}setInputValues(e){const t=this.getInputValues();for(const i of e){void 0!==t.find(e=>e.id===i.id)?this._study.properties().inputs[i.id].setValue(i.value):console.warn(`There is no such input: "${i.id}"`)}}waitForData(e){return new Promise((t,i)=>{const s={},r=setTimeout(()=>{this._study.onStatusChanged().unsubscribeAll(s),i("Timeout waiting for study to got final status")},e);this._study.onStatusChanged().subscribe(s,e=>{""===e&&(this._study.onStatusChanged().unsubscribeAll(s),clearTimeout(r),t())})})}mergeUp(){this._model.isMergeUpAvailableForSource(this._study)&&new c.c(this._model,this._study,"").redo()}mergeDown(){this._model.isMergeDownAvailableForSource(this._study)&&new c.a(this._model,this._study,"").redo()}unmergeUp(){this._model.isUnmergeAvailableForSource(this._study)&&new l.c(this._model,this._study,"").redo()}unmergeDown(){this._model.isUnmergeAvailableForSource(this._study)&&new l.a(this._model,this._study,"").redo()}mergeUpWithUndo(){this._model.isMergeUpAvailableForSource(this._study)&&this._undoModel.mergeSourceUp(this._study)}mergeDownWithUndo(){this._model.isMergeDownAvailableForSource(this._study)&&this._undoModel.mergeSourceDown(this._study)}unmergeUpWithUndo(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceUp(this._study)}unmergeDownWithUndo(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceDown(this._study)}priceScale(){return new _.a(this._undoModel,Object(s.ensureNotNull)(this._study.priceScale()))}changePriceScale(e){const t=Object(s.ensureNotNull)(this._model.paneForSource(this._model.mainSeries())),i=Object(s.ensureNotNull)(this._model.paneForSource(this._study));switch(e){case"no-scale":Object(s.assert)(i.actionNoScaleIsEnabled(this._study),"Unable to leave a pane without any non-overlay price scale"),new h.b(this._model,this._study,i,"overlay","").redo();break;case"as-series":Object(s.assert)(i===t,"Study should be on the main pane"),new h.a(this._model,this._study,i,this._model.mainSeries().priceScale(),"").redo();break;case"new-left":new h.b(this._model,this._study,i,"left","").redo();break;case"new-right":new h.b(this._model,this._study,i,"right","").redo();break;default:const r=this._model.dataSourceForId(e);if(null===r)throw new Error(`There is no study with entityId='${e}'`)
|
||
;const n=i===this._model.paneForSource(r);Object(s.assert)(n,"Both studies should be on the same pane");const l=Object(s.ensureNotNull)(r.priceScale()),c=Object(a.sourceNewCurrencyOnPinningToPriceScale)(this._study,l,this._model),u=Object(d.sourceNewUnitOnPinningToPriceScale)(this._study,l,this._model);new h.a(this._model,this._study,i,l,"").redo(),null!==c&&new o.a(l,c,this._undoModel.chartWidget(),"").redo(),null!==u&&new p.a(l,u,this._undoModel.chartWidget(),"").redo()}}isVisible(){return this._study.properties().visible.value()}setVisible(e){this._study.properties().visible.setValue(e)}bringToFront(){this._model.bringToFront([this._study])}sendToBack(){this._model.sendToBack([this._study])}applyOverrides(e){Object(n.applyOverridesToStudy)(this._study,e)}dataLength(){return this._study.metaInfo().plots.length>0?this._study.data().size():this._model.mainSeries().bars().size()}isLoading(){return this._study.isLoading()}async applyToEntireLayout(){const e=new u.ActionsProvider(this._chartWidget),t=(await e.contextMenuActionsForSources([this._study])).find(e=>"applyStudyToEntireLayout"===e.id);t&&t.execute()}}},N22A:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("eqEH");const r={id:"TradingService"};function n(){return Object(s.hasService)(r)?Object(s.service)(r):null}},NJRZ:function(e,t,i){"use strict";i.r(t),i.d(t,"LineTool5PointsPattern",(function(){return a}));var s=i("Eyy1"),r=i("Ocx9"),n=i("Ss5c"),o=i("j3hX");class a extends n.LineDataSource{constructor(e,t){super(e,t||a.createProperties()),this._loadPaneViews(e)}pointsCount(){return 5}name(){return"XABCD Pattern"}properties(){return super.properties()}static createProperties(e){const t=new r.DefaultProperty("linetool5pointspattern",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/HOw")).then(e=>e.PatternWithBackgroundDefinitionViewModel)}_loadPaneViews(e){i.e("lt-pane-views").then(i.bind(null,"6MfG")).then(t=>{this._setPaneViews([new t.Pattern5pointsPaneView(this,e)])})}static _configureProperties(e){n.LineDataSource._configureProperties(e),e.addChild("linesColors",new o.LineToolColorsProperty([Object(s.ensureDefined)(e.child("color"))])),e.addChild("textsColors",new o.LineToolColorsProperty([Object(s.ensureDefined)(e.child("textcolor"))]))}}},NSoL:function(e,t,i){"use strict";i.r(t),i.d(t,"clientSnapshot",(function(){return y}));var s=i("aO4+"),r=i("eJTA"),n=i("zM7N"),o=i("Y7w9"),a=i("ikwP"),l=i("zDbI"),c=i("XlJ7"),h=i("EsvI"),u=i("Dq3s"),d=i("Kxc7"),p=i("tzRX");const _=!d.enabled("widget_logo");function m(e,t=null,i=null){let s={};if("number"==typeof e)return{relativePositions:{[e]:{l:t,t:i}},nextElementLeft:e,nextElementTop:e};const[r,...n]=e;if("v"===r){let e=null;for(const r of n){const n=m(r,t,i);s=Object.assign(Object.assign({},s),n.relativePositions),i=n.nextElementTop,e=n.nextElementLeft}t=e}if("h"===r){let e=null;for(const r of n){const n=m(r,t,i);s=Object.assign(Object.assign({},s),n.relativePositions),
|
||
t=n.nextElementLeft,e=n.nextElementTop}i=e}return{relativePositions:s,nextElementTop:i,nextElementLeft:t}}const f=function(e){const t={};for(const i of Object.keys(e)){const s=m(e[i]).relativePositions;t[i]=s}return t}(u);const g=URL.createObjectURL(new Blob([p],{type:"image/svg+xml"}));function v(e,t,i,s){return Object(a.drawScaled)(e,s,()=>{e.fillText(i,t.x/s,t.y/s)}),e.measureText(i).width*s}function b(e){return e.map(e=>Object.assign(Object.assign({},e),{title:""}))}class S{constructor(e,t){this._logoTextColor=null,this._snapshotData=e,t=t||{},this._options=Object.assign({backgroundColor:h.themes[e.theme].getThemedColor("color-bg-primary"),font:l.CHART_FONT_FAMILY,fontSize:12,legendMode:"vertical",hideResolution:!1},t);const i=f[e.layout],s=e.charts.map(e=>function(e){const t=e.panes[0],i=t.canvas.width+t.leftAxis.canvas.width+t.rightAxis.canvas.width;let s=0;for(const r of e.panes)s+=r.canvas.height;return void 0!==e.timeAxis&&(s+=e.timeAxis.canvas.height),new a.Size(i,s)}(e));if(this._pixelRatio=e.hidpiRatio,this._chartsGeometry=e.charts.map((e,t)=>function e(t,i,s,r){let n=Math.round(10*r),o=Math.round(10*r);const a=s[t];if(null!==a.l){const t=e(a.l,i,s,r);n=t.x+t.width+Math.round(5*r)}if(null!==a.t){const t=e(a.t,i,s,r);o=t.y+t.height+Math.round(5*r)}const l=i[t];return{x:n,y:o,width:l.w,height:l.h}}(t,s,i,this._pixelRatio)),!_){let i=e.theme;void 0!==t.backgroundColor&&(i="black"===Object(r.rgbToBlackWhiteString)(Object(r.parseRgb)(t.backgroundColor),150)?n.a.Dark:n.a.Light),this._logoTextColor=h.themes[i].getThemedColor("color-text-primary")}}async getImage(){let e=0,t=0;for(const a of this._chartsGeometry)e=Math.max(e,a.x+a.width),t=Math.max(t,a.y+a.height);const i=this._pixelRatio;e+=Math.round(10*i);const s=_?Math.round(10*i):Math.round(35*i),r=t;t+=s;const n=Object(a.createDisconnectedCanvas)(document,new a.Size(e,t),1),o=Object(a.getContext2D)(n);o.font=Object(c.makeFont)(this._options.fontSize,this._options.font),o.textBaseline="top",o.fillStyle=this._options.backgroundColor,o.fillRect(0,0,e,t);for(let a=0;a<this._snapshotData.charts.length;++a){const e=this._snapshotData.charts[a],t=this._chartsGeometry[a];this._drawChart(e,t,o)}if(null!==this._logoTextColor){const e=await(h=Math.round(26*i),u=Math.round(15*i),new Promise(e=>{const t=new Image;t.width=h,t.height=u,t.onload=()=>{e({image:t,width:h,height:u})},t.src=g}));o.fillStyle=this._logoTextColor,o.font=Object(c.makeFont)(13,l.CHART_FONT_FAMILY);const t=r+Math.round(s/2-e.height/2);!function(e,t,i,s,r){e.save(),e.drawImage(s.image,t,i,s.width,s.height),e.textBaseline="bottom";const n=(t+s.width)/r+3,o=(i+s.height)/r;Object(a.drawScaled)(e,r,()=>{e.fillText("TradingView",n,o)}),e.restore()}(o,Math.round(10*i),t,e,i)}var h,u;return n}_drawChart(e,t,i){i.save(),i.translate(t.x,t.y);let r=0;for(const n of e.panes){let t=0;const o=n.leftAxis.canvas.width+Math.round(8*this._pixelRatio),a=r,l=r+Math.round(10*this._pixelRatio);n.leftAxis.contentWidth>0&&(i.drawImage(n.leftAxis.canvas,t,r),t+=n.leftAxis.canvas.width),i.drawImage(n.canvas,t,r),
|
||
t+=n.canvas.width,n.rightAxis.contentWidth>0&&i.drawImage(n.rightAxis.canvas,t,r),"pane"===n.type&&(i.fillStyle=e.colors.text,this._drawLegend(n,i,new s.Point(o,l),a)),r+=n.canvas.height}if(void 0!==e.timeAxis){let t=0;e.timeAxis.lhsStub.contentWidth>0&&(i.drawImage(e.timeAxis.lhsStub.canvas,t,r),t+=e.timeAxis.lhsStub.canvas.width),i.drawImage(e.timeAxis.canvas,t,r),t+=e.timeAxis.canvas.width,e.timeAxis.rhsStub.contentWidth>0&&i.drawImage(e.timeAxis.rhsStub.canvas,t,r)}i.restore()}_drawLegend(e,t,i,r){let n=!0;const o=Math.ceil(1.4*this._options.fontSize*this._pixelRatio);let a=i.x,l=i.y;if(e.mainSeriesText&&l+o<r+e.canvas.height){const i=this._drawLegendLine(t,new s.Point(a,l),e.contentWidth*this._pixelRatio,e.mainSeriesText,e.mainSeriesValues,!0);"horizontal"!==this._options.legendMode?l+=o:(a=i+1.4*this._options.fontSize*this._pixelRatio,n=!1)}for(let c=0;c<e.studies.length;++c)if(l+o<r+e.canvas.height){const r=e.studies[c],h=e.studiesValues[c];let u=null;for(;null===u;)u=this._drawLegendLine(t,new s.Point(a,l),e.contentWidth*this._pixelRatio,r,b(h),n),"horizontal"!==this._options.legendMode?l+=o:null===u?(n=!0,a=i.x,l+=o):(a=u+1.4*this._options.fontSize*this._pixelRatio,n=!1)}}_drawLegendLine(e,t,i,r,n,a){const l=[{text:r.trim()}];for(const s of n)s.visible&&(""!==l[l.length-1].text&&l.push({text:" "}),s.title&&l.push({text:s.title}),l.push({text:s.value,color:s.color}));const c=l.map(e=>e.text).join("");let h=t.x;const u=function(e,t,i,s){if(e.measureText(t).width*s<=i)return{text:t,elided:!1};const r=e.measureText("...").width*s,n=[];for(let o=0;o<t.length;++o)n.push(o);const a=Object(o.upperbound)(n,i,(n,o)=>e.measureText(t.slice(0,o+1)).width*s+r>i);return{text:(t=t.slice(0,a)).trim(),elided:!0}}(e,c,i-h,this._pixelRatio);if(u.elided&&!a)return null;const d=[];let p=0;for(const s of l){if(p+s.text.length>u.text.length)break;d.push(s.text),p+=s.text.length}const _=d.join("").trim().length;p=0;for(const o of l){if(p+o.text.length>_)break;o.color&&(e.save(),e.fillStyle=o.color),h+=v(e,new s.Point(h,t.y),o.text,this._pixelRatio),o.color&&e.restore(),p+=o.text.length}return u.elided&&(h+=v(e,new s.Point(h,t.y),"...",this._pixelRatio)),h}}async function y(e,t){return new S(e,t).getImage()}},NhkU:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"l5Au",7)).then(({PitchfanLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 3}name(){return"Pitchfan"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"D+Nk"))).PitchBaseDefinitionsViewModel}static createProperties(e){var t=new r("linetoolpitchfan",e,!1,{range:[0,8]});return l._configureProperties(t),t}
|
||
static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=8,t.LineToolPitchfan=l},NsVT:function(e,t,i){"use strict";i.r(t);var s=i("hY0g"),r=i.n(s),n=i("HySD");function o(e,t){let i=0;for(const{min:s,max:r}of t){if(e<s||r<s)continue;const t=Math.min(e,r);if(i=Math.max(i,t),e===i)break}return i}function a(e){const t=[];if(void 0===e)return[];Array.isArray(e)||(e=[e]);for(const i of e){let e,s;isFinite(i)?e=s=Number(i):(e=+i.min,s=+i.max),(e<0||isNaN(e))&&(e=0),isNaN(s)&&(s=1/0),e<=s&&s>0&&t.push({min:e,max:s})}return t.sort((e,t)=>e.min-t.min||e.max-t.max),t}function l(e,t){if(e.length!==t.length)return!1;for(let i=e.length;i--;){if(e[i].min!==t[i].min)return!1;if(e[i].max!==t[i].max)return!1}return!0}var c=i("+GxX"),h=i("Kxc7");i.d(t,"ChartPage",(function(){return d}));const u=h.enabled("no_min_chart_width");class d{constructor(e){this._processVisibility=e=>{const t=e.container.value();return this._affectsLayout(e.name)?(t&&t.classList.toggle("js-hidden",!1),!0):(t&&t.classList.toggle("js-hidden",!0),!1)},this._setWidth=(e,t)=>{let i=t;this._fullscreenArea!==e.name&&(e.availWidth.setValue(t),e.canNegotiate.width&&(i=o(t,e.negotiations.width)));const s=e.container.value();return s&&(s.style.width=i+"px"),e.width.setValue(i),i},this._setHeight=(e,t)=>{let i=t;this._fullscreenArea!==e.name&&(e.availHeight.setValue(t),e.canNegotiate.height&&(i=o(t,e.negotiations.height)));const s=e.container.value();return s&&(s.style.height=i+"px"),e.height.setValue(i),i};const t=e.container.value();if(!t)throw new Error("bridge.container.value() must be an element");this._container=t,this._availableAreas=["left","tradingpanel","right","top","bottom","center","topleft","extratop"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._width.subscribe(()=>this.recalculate()),this._height.subscribe(()=>this.recalculate()),this._bridge.visible.subscribe(()=>this._updateVisibility()),this._bridge.fullscreen.subscribe(()=>this._onParentFullscreenChange()),this.recalculate()}allocate(e){const t=e&&e.areaName;if(-1===this._availableAreas.indexOf(t))throw new Error("unknown options.areaName");this.free(t);const i=this._createDOM(t),s={name:t,canNegotiate:{width:"left"===t||"right"===t||"tradingpanel"===t||"topleft"===t,height:"top"===t||"bottom"===t||"topleft"===t||"extratop"===t},negotiations:{width:[],height:[]},remove:()=>{for(const e in this._areas)this._areas[e]===s&&this.free(e)},negotiateWidth:e=>{if(!s.canNegotiate.width)return;const t=a(e);l(s.negotiations.width,t)||(s.negotiations.width=t,this.recalculate())},negotiateHeight:e=>{if(!s.canNegotiate.height)return;const t=a(e);l(s.negotiations.height,t)||(s.negotiations.height=t,this.recalculate())},requestFullscreen:()=>{
|
||
this._fullscreenArea||("right"!==t&&"center"!==t||(this._fullscreenArea=t),"center"===t&&this._bridge.requestFullscreen(),this._updateFullscreen())},exitFullscreen:()=>{t===this._fullscreenArea&&(this._fullscreenArea=void 0,"center"===t&&this._bridge.exitFullscreen(),this._updateFullscreen())},width:new r.a,height:new r.a,availWidth:new r.a,availHeight:new r.a,alive:new r.a(!0),container:new r.a(i),visible:new r.a(!0),fullscreen:new r.a(!0),rdState:new n.ResizerDetacherState};return s.rdState.pushOwner(s),this._areas[t]=s,s.rdState.owner.subscribe(e=>{const i=s.container.value();if(e!==s)i&&(i.innerHTML="",i.parentElement&&i.parentElement.removeChild(i));else{let e=null;for(let i=this._availableAreas.indexOf(t);i--;){const t=this._availableAreas[i];if(this._affectsLayout(t)){e=this._areas[t].container.value();break}}i&&(e&&i.parentElement?i.insertAdjacentElement("afterend",e):this._container.appendChild(i))}this.recalculate()},{callWithLast:!0}),s.rdState.bridge()}free(e){const t=this._areas[e];if(!t)return;this._areas[e]=void 0;const i=t.container.value();i&&i.parentElement&&i.parentElement.removeChild(i),t.alive.setValue(!1)}recalculate(){const e={};this._recalcSingleRunToken=e;const t=this._areas.topleft,i=this._areas.left,s=this._areas.tradingpanel,r=this._areas.right,n=this._areas.top,o=this._areas.bottom,a=this._areas.center,l=this._areas.extratop,c=this._width.value(),h=this._height.value();let d=0,p=0,_=0,m=0,f=0,g=0,v=0,b=0;if(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(b=this._setHeight(l,h),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t)){v=this._setHeight(t,h),g=this._setWidth(t,c),g&&(g+=4);const e=t.container.value();e&&(e.style.top=b+"px")}if(e===this._recalcSingleRunToken&&i&&this._processVisibility(i)){const e=i.container.value();e&&(e.style.top=v+b+"px"),this._setHeight(i,h-v-b),_=this._setWidth(i,c),_&&(_+=4)}if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){this._setHeight(s,h);let e=c-_;u||(e-=300),f=this._setWidth(s,e)}if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,h-b);let e=c-_-f;u||(e-=300),m=this._setWidth(r,e);const t=r.container.value();t&&(t.style.top=b+"px")}const S=f+m,y=S?4:0;if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){const e=Math.max(g,_),t=n.container.value();t&&(t.style.left=e+"px",t.style.top=b+"px");const i=c-e-f-m-y;this._setWidth(n,i),d=this._setHeight(n,h)}let w=0;const C=c-_-f-m-y;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){const e=o.container.value();e&&(e.style.left=_+"px",e.classList.toggle("no-border-top-left-radius",!_),e.classList.toggle("no-border-top-right-radius",!S)),this._setWidth(o,C);const t=h-d-b;w=Math.min(300,t-0),p=this._setHeight(o,t)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){const e=a.container.value();e&&(e.style.left=_+"px",e.style.top=d+b+"px",e.classList.toggle("no-border-bottom-left-radius",!p||!_),e.classList.toggle("no-border-bottom-right-radius",!S||!p)),this._setWidth(a,C)
|
||
;const t=h-d-p-b;this._setHeight(a,Math.max(t,w))}if(e===this._recalcSingleRunToken&&s&&this._affectsLayout("tradingpanel")){const e=s.container.value();e&&(e.style.right=m+"px",e.style.top=b+"px")}e===this._recalcSingleRunToken&&this._updateVisibility()}_affectsLayout(e){const t=this._areas[e];if(!t)return!1;if(t.rdState.owner.value()!==t)return!1;if(this._fullscreenArea&&this._fullscreenArea!==e)return p(e);if(this._width.value()<=567||this._height.value()<=445){const t=["center","top","left","topleft","extratop"];if(Object(c.isFeatureEnabled)("mobile_show_bottom_panel")&&t.push("bottom"),!t.includes(e))return!1}return!0}_updateVisibility(){const e=this._bridge.visible.value();for(let t=0;t<this._availableAreas.length;t++){const i=this._availableAreas[t],s=this._areas[i];s&&(e&&this._affectsLayout(i)?s.visible.setValue(!0):s.visible.setValue(!1))}}_onParentFullscreenChange(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,this._updateFullscreen())}_updateFullscreen(){const e=void 0!==this._fullscreenArea;for(let t=0;t<this._availableAreas.length;t++){const i=this._availableAreas[t],s=this._areas[i];if(!s)continue;if(i===this._fullscreenArea){s.fullscreen.setValue(!0);continue}const r=s.container.value();r&&r.classList.toggle("js-hidden",e&&!p(i))}this._updateVisibility(),this.recalculate()}_createDOM(e){const t=document.createElement("div");return t.classList.add("layout__area--"+e),t.style.position="absolute","bottom"===e?t.style.bottom="0":t.style.top="0","right"===e||"tradingpanel"===e?t.style.right="0":t.style.left="0",t}}function p(e){const t=h.enabled("side_toolbar_in_fullscreen_mode"),i=h.enabled("header_in_fullscreen_mode");return"center"===e||"left"===e&&t||"top"===e&&i}},Nu4p:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));i("YFKU");const s={shape_arrow_down:{guiName:window.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown",icon:"arrow_down"},shape_arrow_up:{guiName:window.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup",icon:"arrow_up"},shape_circle:{guiName:window.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle",icon:"circle"},shape_cross:{guiName:window.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross",icon:"cross"},shape_diamond:{guiName:window.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond",icon:"diamond"},shape_flag:{guiName:window.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag",icon:"flag"},shape_label_down:{guiName:window.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown",icon:"label_down"},shape_label_up:{guiName:window.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup",icon:"label_up"},shape_square:{guiName:window.t("Square"),id:"shape_square",
|
||
paneRendererClass:"PaneRendererSquare",pineName:"shape.square",icon:"square"},shape_triangle_down:{guiName:window.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown",icon:"triangle_down"},shape_triangle_up:{guiName:window.t("Triangle Up"),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup",icon:"triangle_up"},shape_xcross:{guiName:window.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross",icon:"x_cross"}}},OBgQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("jCNj");class r{constructor(e,t,i){this.year=e,this.month=t,this.day=i}toString(){return`${this.year}-${this.month}-${this.day}`}compareTo(e){return this.year>e.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1}before(e){return-1===this.compareTo(e)}toCalendar(e){return s.get_cal(s.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)}addDays(e){const t=this.toCalendar(s.get_timezone("Etc/UTC"));return s.add_date(t,e),r.fromCalendar(t)}static fromCalendar(e){return new r(s.get_year(e),s.get_month(e)+1,s.get_day_of_month(e))}}},OH2X:function(e,t,i){"use strict";t.LineToolFibRetracement=i("t2ex").LineToolFibRetracement,t.LineToolFibChannel=i("xnA2").LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i("Yjuu").LineToolFibSpeedResistanceArcs,t.LineToolProjection=i("68at").LineToolProjection,t.LineToolTrendBasedFibExtension=i("ZtA1").LineToolTrendBasedFibExtension,t.LineToolElliott=i("xz+e").LineToolElliott,t.LineToolFibCircles=i("4bfY").LineToolFibCircles,t.LineToolVertLine=i("n40Z").LineToolVertLine,t.LineToolCrossLine=i("MA5A").LineToolCrossLine,t.LineToolBarsPattern=i("2bPF").LineToolBarsPattern,t.LineToolTrendBasedFibTime=i("yUly").LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i("FsE7").LineToolFibTimeZone,t.LineToolCircleLines=i("tG6Q").LineToolCircleLines,t.LineToolDateRange=i("WkYF").LineToolDateRange,t.LineToolPriceRange=i("RDDl").LineToolPriceRange,t.LineToolDateAndPriceRange=i("UCMi").LineToolDateAndPriceRange,t.LineToolParallelChannel=i("qcGP").LineToolParallelChannel,t.LineToolTrendAngle=i("nW7S").LineToolTrendAngle,t.LineToolTrendLine=i("WPQD").LineToolTrendLine,t.LineToolInfoLine=i("yi8X").LineToolInfoLine,t.LineToolArrowMark=i("TohL").LineToolArrowMark,t.LineToolImage=i("8Blv").LineToolImage,t.LineToolExecution=i("704P").LineToolExecution,t.LineToolPitchfan=i("NhkU").LineToolPitchfan,t.LineToolGannSquare=i("Z0Sh").LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i("zZ5f").LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i("nd9+").LineToolGannComplex,t.LineToolGannFixed=i("TBaH").LineToolGannFixed,t.LineToolGannFan=i("4u8j").LineToolGannFan,t.LineToolFibWedge=i("9QkW").LineToolFibWedge,t.LineToolPitchfork=i("aDyP").LineToolPitchfork,t.LineToolDisjointAngle=i("oIoN").LineToolDisjointChannel,t.LineToolFlatBottom=i("InMJ").LineToolFlatBottom,
|
||
t.LineToolIcon=i("icPo").LineToolIcon,t.LineToolRotatedRectangle=i("Az04").LineToolRotatedRectangle,t.LineToolFibSpiral=i("i80N").LineToolFibSpiral,t.LineToolHeadAndShoulders=i("aILO").LineToolHeadAndShoulders,t.LineToolTriangle=i("isVH").LineToolTriangle,t.LineToolTrianglePattern=i("lNN+").LineToolTrianglePattern,t.LineTool5PointsPattern=i("NJRZ").LineTool5PointsPattern,t.LineToolThreeDrivers=i("PYn8").LineToolThreeDrivers,t.LineToolABCD=i("pKDv").LineToolABCD,t.LineToolPolyline=i("hP9j").LineToolPolyline,t.LineToolPath=i("YdVo").LineToolPath,t.LineToolPrediction=i("Wh6B").LineToolPrediction,t.LineToolPriceLabel=i("zqZp").LineToolPriceLabel,t.LineToolArrowMarker=i("wiuq").LineToolArrowMarker,t.LineToolNote=i("gLxC").LineToolNote,t.LineToolNoteAbsolute=i("gLxC").LineToolNoteAbsolute,t.LineToolSignpost=i("gASG").LineToolSignpost,t.LineToolBrush=i("+hLl").LineToolBrush,t.LineToolArc=i("0Pxc").LineToolArc,t.LineToolCallout=i("odCa").LineToolCallout,t.LineToolBalloon=i("me8f").LineToolBalloon,t.LineToolText=i("V3Oj").LineToolText,t.LineToolHorzLine=i("/DxK").LineToolHorzLine,t.LineToolHorzRay=i("CJIV").LineToolHorzRay,t.LineToolRectangle=i("7qI1").LineToolRectangle,t.LineToolEllipse=i("V086").LineToolEllipse,t.LineToolTimeCycles=i("kIXa").LineToolTimeCycles,t.LineToolSineLine=i("bv/X").LineToolSineLine,t.LineToolGhostFeed=i("XUCF").LineToolGhostFeed,t.LineToolBezierQuadro=i("Xyly").LineToolBezierQuadro,t.LineToolBezierCubic=i("N+BX").LineToolBezierCubic,t.LineToolArrow=i("QQu0").LineToolArrow,t.LineToolRay=i("5ZUI").LineToolRay,t.LineToolExtended=i("CHw2").LineToolExtended,t.LineToolSchiffPitchfork=i("v5F8").LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i("XFad").LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i("EqoR").LineToolInsidePitchfork,t.LineToolTextAbsolute=i("V3Oj").LineToolTextAbsolute,t.LineToolArrowMarkLeft=i("TohL").LineToolArrowMarkLeft,t.LineToolArrowMarkRight=i("TohL").LineToolArrowMarkRight,t.LineToolArrowMarkUp=i("TohL").LineToolArrowMarkUp,t.LineToolArrowMarkDown=i("TohL").LineToolArrowMarkDown,t.LineToolFlagMark=i("aIha").LineToolFlagMark,t.LineToolCypherPattern=i("bTqm").LineToolCypherPattern,t.LineToolElliottImpulse=i("xz+e").LineToolElliottImpulse,t.LineToolElliottTriangle=i("xz+e").LineToolElliottTriangle,t.LineToolElliottTripleCombo=i("xz+e").LineToolElliottTripleCombo,t.LineToolElliottCorrection=i("xz+e").LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i("xz+e").LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i("tDUI").LineToolRiskRewardLong,t.LineToolRiskRewardShort=i("tDUI").LineToolRiskRewardShort,t.LineToolPosition=i("ziJ5").LineToolPosition,t.LineToolOrder=i("B4/o").LineToolOrder,t.LineToolHighlighter=i("SMvR").LineToolHighlighter,t.LineToolPriceNote=i("Zl0W").LineToolPriceNote},"OK+B":function(e,t,i){"use strict"
|
||
;var s=i("Eyy1").assert,r=i("eJTA"),n=r.rgba,o=r.rgbaToString,a=r.parseRgb,l=i("+GxX").isFeatureEnabled,c=i("cWHH"),h=i("1Wlv").PriceScale,u=i("8sOK").StudyStub,d=i("CW80"),p=d.createLineTool,_=d.createLineToolProperties,m=d.createStudyLineToolProperties,f=d.isLineToolName,g=d.isStudyLineToolName,v=i("Ss5c").LineDataSource,b=i("OH2X").LineToolBarsPattern,S=i("OH2X").LineToolCallout,y=i("OH2X").LineToolImage,w=i("CW80").isLineTool,C=i("HLXm"),P=i("GVHu"),x=P.Study,T=P.prepareStudyPropertiesForLoadChart,M=i("3ClC").createStudy,I=i("qJq3").Series,L=i("dfhE"),O=i("n5al"),A=i("0YCj"),E=i("Kxc7"),k=i("txPx").getLogger("Chart.Serialization"),D=i("OH2X").LineToolParallelChannel,V=i("OH2X").LineToolTrendAngle,B=i("OH2X").LineToolGhostFeed,R=i("OH2X").LineToolElliott,N=i("7ktv").PriceDataSource,j=i("iDOr").Pane,F=i("Tmoa"),W=i("jofe").createDeferredPromise,H=i("ApcL").preferencesByWhiteList,z=(k=i("txPx").getLogger("Chart.Serialization"),i("mPvX").LineToolsGroupModel);c.version=2,c.prototype.state=function(e,t,i,s){for(var r={panes:[]},n=0;n<this.panes().length;n++)r.panes.push(this.panes()[n].state(!0,e,!1,t,i,s));r.timeScale=this._timeScale.state(e);var o=null,a=this.properties();return r.chartProperties={paneProperties:a.paneProperties.state(),scalesProperties:a.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(e):void 0,chartEventsSourceProperties:a.chartEventsSourceProperties.state(),tradingProperties:a.tradingProperties.state(),priceScaleSelectionStrategyName:a.priceScaleSelectionStrategyName.value()},a.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=a.chartEventsSourceProperties.state()),s||(r.lineToolsGroups=this.lineToolsGroupModel().state(t)),r.version=c.version,r.timezone=this.timezone(),r.sessions=this.sessions().state(e),r.shouldBeSavedEvenIfHidden=this._shouldBeSavedEvenIfHidden,r},c.prototype.chartPropertiesTransparencyMigrate=function(e){var t,i,s;e.chartProperties.paneProperties.crossHairProperties&&(s=e.chartProperties.paneProperties.crossHairProperties,F.isHexColor(s.color)&&(i=s.transparency/100,t=a(s.color),s.color=o(n(t,i)))),e.chartProperties.paneProperties.dataWindowProperties&&(s=e.chartProperties.paneProperties.dataWindowProperties,F.isHexColor(s.color)&&(i=s.transparency/100,t=a(s.color),s.color=o(n(t,i))))},c.prototype.resetDeferredStudies=function(){new U(this).reset()},c.prototype._getExceedingChildStudies=function(e){for(var t=[],i=0;i<e.length;++i)t=t.concat(e[i].sources||[]);var s=0;for(var r=[],n={},o=0,a=1e6;t.length&&--a;){var l=t[o];(l.ownerSource&&n[l.ownerSource]||!l.ownerSource)&&(n[l.id]=l,t.splice(t.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++s>1&&r.push(l)),o=(o+1)%t.length}return r},c.prototype.restoreState=function(e,t,i){new U(this).reset();var s={};if(e.panes)if(Array.isArray(e.panes)){if(!(e.panes.length<1)){if(this._shouldBeSavedEvenIfHidden=void 0===e.shouldBeSavedEvenIfHidden||e.shouldBeSavedEvenIfHidden,e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),
|
||
e.chartProperties){var r=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(r,e.chartProperties.scalesProperties),!("showLastValue"in r)||"showSeriesLastValue"in r||"showStudyLastValue"in r||(r.showSeriesLastValueProperty=r.showLastValue,r.showStudyLastValueProperty=r.showLastValue),"showSeriesLastValue"in r&&(s.showSeriesLastValueProperty=!0),"showStudyLastValue"in r&&(s.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),"backgroundType"in e.chartProperties.paneProperties||(e.chartProperties.paneProperties.backgroundType="solid"),this._properties.paneProperties.mergeAndFire(e.chartProperties.paneProperties),this._properties.scalesProperties.mergeAndFire(r),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.mergeAndFire(e.chartProperties.chartEventsSourceProperties),e.chartProperties.tradingProperties&&this._properties.tradingProperties&&this._properties.tradingProperties.mergeAndFire(e.chartProperties.tradingProperties),this._timeScale.restoreState(e.timeScale,t),this._updateDateTimeFormatter()}if(e.timeScale&&this._timeScale.restoreState(e.timeScale,t),!this.readOnly()){var n=this._getExceedingChildStudies(e.panes);if(n.length){for(var o=e.panes.length-1;o>=0;--o){for(var a=(u=e.panes[o]).sources.length-1;a>=0;--a){var l=u.sources[a];~n.indexOf(l)&&u.sources.splice(a,1)}u.sources.length||e.panes.splice(o,1)}0}}var c=e.panes;this.panes()[0].restoreState(c[0],t,e.version,s,i,!0);var h=1;for(o=1;o<e.panes.length;o++){var u,d=e.panes[o];if(0!==d.sources.length)(u=this.panes()[h]||this.createPane()).restoreState(d,t,e.version,s,i,!0),u.mainDataSource()?h+=1:this.removePane(u);else k.logWarn("Empty pane detected - restoring is skipped. idx="+o+", state="+JSON.stringify(d))}this._invalidateBarColorerCaches();var p=this.dataSources(),_=0;for(o=0;o<p.length;o++){var m=p[o];TradingView.isInherited(m.constructor,v)&&(_++,m.calcIsActualSymbol())}this._version=e.version,this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.fullUpdate(),this.syncESD();var f=TVLocalStorage.getItem("linetools_limit")||1e3;return window.is_authenticated&&window.user&&window.user.settings&&(f=window.user.settings.linetools_limit||f),e.sessions&&this.sessions().restoreState(e.sessions,t),e.lineToolsGroups&&(this._lineToolsGroupModel=z.fromState(this,e.lineToolsGroups)),_>f&&_%100==0?{lines_limit_exceeded:!0,line_tools_count:_}:(this.panes().forEach(function(e){this._dataSourceCollectionChanged.fire(e)}.bind(this)),this._lineToolsGroupModel.fireChangedAll(),{})}k.logDebug("ChartModel.restoreState: invalid state")
|
||
}else k.logDebug("ChartModel.restoreState: invalid state");else k.logDebug("ChartModel.restoreState: invalid state")},j.prototype.state=function(e,t,i,s,r,n){var o={},a=new Map;function l(e){if(a.has(e))return a.get(e);var o=null,l=i&&!e.isSavedInStudyTemplates()||!e.state||w(e)&&n||!(o=e.state(t,r))||!e.isSavedInChart(t)||s&&e.isActualSymbol&&!e.isActualSymbol()||e.isPhantom()?null:o;return a.set(e,l),l}if(e){o.sources=[];for(var c=0;c<this.m_dataSources.length;c++){var h=l(this.m_dataSources[c]);null!==h&&o.sources.push(h)}}function u(e){return null!==a.get(e)}function d(e){return!n||!w(e)}o.leftAxisesState=this._leftPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).filter(d).map((function(e){return e.id()})),t})),o.rightAxisesState=this._rightPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).filter(d).map((function(e){return e.id()})),t})),o.overlayPriceScales={};for(c=0;c<this.m_dataSources.length;c++){var p=this.m_dataSources[c];if(this.isOverlay(p)&&p.isSavedInChart(t)){var _=p.priceScale();o.overlayPriceScales[p.id()]=_?_.state():null}}return o.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(o.mainSourceId=this.m_mainDataSource.id()),o.priceScaleRatio=this._currentPriceScaleRatio,o},j.prototype.sourceById=function(e){for(var t=0;t<this.m_dataSources.length;t++)if(this.m_dataSources[t].id()===e)return this.m_dataSources[t];return null},j.prototype.isESDStudy=function(e){return"Script$TV_EARNINGS@tv-scripting"===e.id||"Script$TV_DIVIDENDS@tv-scripting"===e.id||"Script$TV_SPLITS@tv-scripting"===e.id||"ESD$TV_EARNINGS@tv-scripting"===e.id||"ESD$TV_DIVIDENDS@tv-scripting"===e.id||"ESD$TV_SPLITS@tv-scripting"===e.id||"Earnings@tv-basicstudies"===e.id||"Dividends@tv-basicstudies"===e.id||"Splits@tv-basicstudies"===e.id},j.prototype.isStudyToSkip=function(e){return!!this.isESDStudy(e)},j.prototype.restoreState=function(e,t,i,s,r,n){s=s||{},e.stretchFactor&&(this._stretchFactor=e.stretchFactor);var o={};if(e.sources){var a=e.sources.filter((function(e){return!!e&&("MainSeries"===e.type||(!e.points||!e.points.some((function(e){return null===e.time_t||!isFinite(e.time_t)}))||(k.logNormal("Dropped invalid "+e.type+". Reason: non-numeric point time"),!1)))}),this),l=-1!==this.m_dataSources.indexOf(this._model.mainSeries());this.clearSeries(n),this.m_mainDataSource=null,l&&this._addSourceToCollections(this._model.mainSeries(),n);var c=this.getZOrderMinMax(),u=c.minZOrder,d=c.maxZOrder;!function(){var t=a.find((function(t){return t.id===e.mainSourceId}));if(void 0!==t)if(TradingView[t.type]&&f(t.type)){for(var i=null,s=0;s<a.length;s++){var r=a[s];if(!TradingView[t.type]||!f(r.type)){if(null!==i)return void k.logWarn("Pane contains more than 1 possibly main sources - auto fix cannot be applied");i=r}}if(null!==i){var n=e.mainSourceId,o=0;e.mainSourceId=i.id,a.forEach((function(e){e.ownerSource===n&&(e.ownerSource=i.id,o+=1)})),
|
||
k.logNormal("Auto fix broken pane is applied, changed line tools="+o+", changed from="+n+" to="+i.id)}else k.logWarn("Pane contains only line tools - possible we need to remove this pane?")}else k.logNormal("The type of main source is not line tool - fix is unnecessary");else k.logWarn("There is no main source with id "+e.mainSourceId+", total sources="+a.length)}();for(var p=0;p<a.length;p++){if("study_Sessions"===(m=(_=a[p]).type)){this.model().sessions().restoreOldState(_,t);break}}for(p=0;p<a.length;p++){var _,m;if("study_Sessions"!==(m=(_=a[p]).type)){if(Math.abs(_.zorder)>1e200){var g=u-1;k.logWarn("Datasource zorder has bad value: "+_.zorder+" Resetting it to "+g),_.zorder=g}else if(!this.isZOrderAvailable(_.zorder)){l&&"MainSeries"===m&&this._model.mainSeries().zorder()===_.zorder||(_.zorder=d+1)}var b=_.id;null===this._model.dataSourceForId(_.id)||"MainSeries"===m?(o[b]=_.ownerSource,m&&("MainSeries"===m?this._restoreMainSeries(_,t,l,s,r,n):m.toLowerCase().startsWith("study")?this.restoreStudy(_,t,s,n):TradingView.isInherited(TradingView[m],v)?this.restoreLineTool(_,t,void 0,n):TradingView[m]&&TradingView[m].createFromState&&this._restoreSpecialSource(_,t,n)),u=Math.min(u,_.zorder),d=Math.max(d,_.zorder)):k.logError("Duplicate id while restoring pane: "+_.type+","+_.id)}}}var S,y,w=new Set,C=this;function P(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new h(C.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var s=C.dataSourceForId(e);s&&function e(t,i,s){w.has(t)||(w.add(t),void 0!==s.m_showSymbolLabels&&t instanceof I&&C.model().properties().scalesProperties.showSymbolLabels.setValue(s.m_showSymbolLabels),t.setPriceScale(i),i.addDataSource(t),C._model.children(t,!0).forEach((function(t){e(t,i,s)})))}(s,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)S=e.leftAxisesState.map(P).filter((function(e){return null!==e}));else{var T=P({state:e.leftAxisState,sources:e.leftAxisSources});S=null!==T?[T]:[]}if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],S.forEach((function(e){C._placePriceScale(e,"left")})),e.rightAxisesState)y=e.rightAxisesState.map(P).filter((function(e){return null!==e}));else{var M=P({state:e.rightAxisState,sources:e.rightAxisSources});y=null!==M?[M]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],y.forEach((function(e){C._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;var L=new Map;for(p=0;p<this.m_dataSources.length;p++){var O=this.m_dataSources[p];if(!w.has(O)){var A;if(e.overlayPriceScales&&e.overlayPriceScales[O.id()]){var E=e.overlayPriceScales[O.id()];L.has(E.id)?A=L.get(E.id):((A=new h(this._model.properties().scalesProperties)).setHeight(this.m_height),E.m_isAutoScale=!0,E.m_isLog=!1,E.m_isPercentage=!1,E.m_isLockScale=!1,A.restoreState(E),L.set(E.id,A))
|
||
}else(A=new h(this._model.properties().scalesProperties)).setHeight(this.m_height);var D=O.priceScale();null!==D&&(-1!==D.dataSources().indexOf(O)&&D.removeDataSource(O),0===D.dataSources().length&&this.removePriceScale(D)),A.addDataSource(O),O.setPriceScale(A)}}for(var b in o){var V=o[b];if(V)(O=this.dataSourceForId(b))&&this.dataSourceForId(b).setOwnerSource(this.dataSourceForId(V))}if(e.mainSourceId&&!this.containsMainSeries()&&(this.m_mainDataSource=this.dataSourceForId(e.mainSourceId)),!this.m_mainDataSource)for(p=0;p<this.m_dataSources.length;p++){O=this.m_dataSources[p];if(TradingView.isInherited(O.constructor,N)){this.m_mainDataSource=O;break}}for(p=0;p<this.m_dataSources.length;p++){O=this.m_dataSources[p];if(TradingView.isInherited(O.constructor,v))O.ownerSource()||O.setOwnerSource(this.mainDataSource()),O.isFixed()&&O.restoreFixedPoints();else if(TradingView.isInherited(O.constructor,x)){var B=O.properties();B.linkedToSeries&&B.linkedToSeries.value()&&(O.ownerSource()||O.setOwnerSource(this.model().mainSeries()))}}this._updateMargins(),this._cachedOrderedSources.clear()},j.prototype._restoreMainSeries=function(e,t,i,s,r,n){var o=e.id,a=e.state,c=e.zorder;if(a&&r&&(a.style=r.style||a.style,a.interval=r.interval||a.interval,a.symbol=r.symbol||a.symbol,r.symbol&&delete a.currencyId),a&&a.style===L.STYLE_HILO&&!l("chart_style_hilo")&&(a.style=L.STYLE_CANDLES),a&&["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){a[e]&&(a[e].wickUpColor=a[e].wickUpColor||a[e].wickColor,a[e].wickDownColor=a[e].wickDownColor||a[e].wickColor)})),a&&(a.statusViewStyle=a.statusViewStyle||{},!a.statusViewStyle.symbolTextSource)){var h=!!a.statusViewStyle.showSymbolAsDescription;a.statusViewStyle.symbolTextSource=h?"ticker":"description"}if(!i){var u=this._model.mainSeries();this._model.paneForSource(u).removeDataSource(u,!1,n),this._addSourceToCollections(u,n)}if(this.m_mainDataSource=this._model.mainSeries(),(g=a&&a.style?a.style:void 0)===I.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":g===I.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),a&&!a.hasOwnProperty("showSessions")&&(a.showSessions=!1),a&&!a.extendedHours&&(a.extendedHours=!1),a&&t&&(a.showCountdown=!1),a&&(t&&!("showSeriesLastValueProperty"in s)&&"showLastValue"in a&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(a.showLastValue),delete a.showLastValue),a)for(var d={haStyle:O.chartStyleStudyId(I.STYLE_HEIKEN_ASHI,!0),renkoStyle:O.chartStyleStudyId(I.STYLE_RENKO,!0),pbStyle:O.chartStyleStudyId(I.STYLE_PB,!0),kagiStyle:O.chartStyleStudyId(I.STYLE_KAGI,!0),pnfStyle:O.chartStyleStudyId(I.STYLE_PNF,!0),rangeStyle:O.chartStyleStudyId(I.STYLE_RANGE,!0)},p=this._model.studyVersioning(),_=this._model.mainSeries().styleStudyInfos(),m=Object.keys(L.SYMBOL_STRING_DATA),f=0;f<m.length;f++){
|
||
var g=m[f],v=L.STYLE_SHORT_NAMES[g]+"Style",b=v in e?e[v].studyId:d[v];if(null!=(g=a[v])){var S=g.inputs,y=A.parseIdString(b),w=_[v].studyId,C=A.parseIdString(w),P=p.updateStudyInputs(y.id,y.version,C.version,S,null);g.inputs=P}}this._model.mainSeries().restoreState(e,t),this.changeSourceId(this._model.mainSeries(),o),void 0!==c&&this._model.mainSeries().setZorder(c),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours)},j.prototype.restoreStudy=function(e,t,i,s){if(t&&void 0===e.data&&void 0===e.nonSeriesData&&void 0===e.indexes)k.logError("Cannot restore (skipping) study without data "+e.id+", "+e.metaInfo.id);else{var r=e.id,n=e.state,o=e.zorder,a=e.ownerSource,l=TradingView.clone(e.metaInfo);if(Object.assign(l,A.parseIdString(l.id)),!this.isStudyToSkip(l)||t){var c=n,h=this._model.studyVersioning(),d=h.patchPropsStateAndMetaInfo(c,l,{oldShowStudyLastValueProperty:t&&!i.showStudyLastValueProperty});c=d.propsState,l=d.metaInfo;var p=new u(this._model,e,l.shortDescription);p.setId(r);var _=this;if(t)f(null);else{var m=h.updateMetaInfoAsync(l);m.sync?f(m.result):m.result.then((function(e){f(e)})).catch((function(e){p.setStatus("error: "+e),p.setFailed(!0)}))}return p&&(this._addSourceToCollections(p,s),this._processMainSourceChange()),this._cachedOrderedSources.clear(),p&&void 0!==o&&p.setZorder(o),p}k.logNormal("Skipping study "+l.id)}function f(i){p.setStatus("");var s=i||new A(l),n=new U(_._model);function o(o){var a=T(l,i,c,null,h,o),u=M(_._model,a,o||_._model.mainSeries(),s);if(u.setId(r),t){var d=h.patchStudyData(l,e.data,e.nonSeriesData,e.indexes);u.restoreData(d.data,d.nsData,d.indexes)}_._model.replaceStudyStub(p,u)||(p=u),n.add(r,u)}a&&e.state.isChildStudy?n.get(a).then(o):o()}},j.prototype.restoreLineTool=function(e,t,i,r){i=void 0===i||i,R.migrateState(e),C.migrateState(e);var n=e.type,o=e.id,a=e.state,l=i?e.zorder:this._newZOrderForLineTool();s(f(n),"invalid data source type:"+n+" (expected to be a Line Tool)");var c,h,d=null;if(g(n)){var v=(e=(d=this._model.studyVersioning()).patchPointsBasedStudyState(e)).metaInfo;if(Object.assign(v,A.parseIdString(v.fullId)),!t){var w=v.productId;if(!pro.hasPackage(w)){var P=new u(this._model,e,v.shortDescription);return P.setId(o),this._addSourceToCollections(P,r),void 0!==l&&P.setZorder(l),P.setStatus(window.t("not authorized")),void P.setFailed(!0)}}var x=d.updateMetaInfo(v)||v;h=m(n,v,x,a,d),t?h.merge({fixedSize:!1}):h.merge({fixedSize:!0}),c=p(n,this._model,h,x,!0)}else h=_(n,a),t?h.merge({fixedSize:!1}):h.merge({fixedSize:!0}),c=p(n,this._model,h,null,!0);c.setId(o),c.linkKey=e.linkKey;var T=e.alertId;T&&c.canHasAlert()&&"function"==typeof c.setAlert&&E.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&c.setAlert(T,{noChartSave:!0});var M=e.indexes?e.indexes:[];if(M=M.slice(0,e.points.length),c.isFixed()?c.restorePositionPercents(e.positionPercents):c.restorePoints(e.points,M,t),
|
||
c instanceof b||c instanceof S||c instanceof V||c instanceof B||c instanceof y||c instanceof D)c.restoreData(e);else if(t&&c.restoreData){var I=e;d&&(I.graphics=d.patchPointsBasedStudyData(I.metaInfo,I.graphics)),c.restoreData(I)}var L=null==e.version?1:e.version,O=null==c.version?1:c.version;return L!==O&&"function"==typeof c.migrateVersion&&c.migrateVersion(L,O,{pane:this,model:this._model,properties:h}),this._addSourceToCollections(c,r),this._cachedOrderedSources.clear(),void 0!==l&&c.setZorder(l),c},j.prototype._restoreSpecialSource=function(e,t,i){var s=TradingView[e.type];if(s&&s.createFromState){var r=s.createFromState(e,t,this._model);r&&(r.setId(e.id),this._addSourceToCollections(r,i),r.zorder&&r.setZorder(r.zorder))}},c.prototype.studyTemplate=function(e,t){for(var i={panes:[]},s=0;s<this.panes().length;s++){i.panes.push(this.panes()[s].state(!0,!1,!0))}return e&&(i.symbol=this.mainSeries().symbol()),t&&(i.interval=this.mainSeries().interval()),i.version=c.version,i},c.prototype.restoreTheme=function(e,t,i){var s={hollowCandle:{related:"candle"}};for(var r in s)if(!e.mainSourceProperties[r+"Style"]){var n=e.mainSourceProperties[s[r].related+"Style"];e.mainSourceProperties[r+"Style"]=TradingView.clone(n)}this._undoModel.chartLoadTheme(this,e,t,i)},c.prototype.preferences=function(){return H(this,this.mainSeries())};var U=function(){var e=[],t=[];function i(s){var r=e.indexOf(s);return~r?t[r]:this instanceof i?(this._source=s,this._studies={},this._deferreds={},e.push(s),void t.push(this)):new i(s)}return i.prototype.add=function(e,t){this._deferreds[e]&&(this._deferreds[e].resolve(t),delete this._deferreds[e]),this._studies[e]=t},i.prototype.get=function(e){return this._studies[e]?Promise.resolve(this._studies[e]):(this._deferreds[e]||(this._deferreds[e]=W()),this._deferreds[e].promise)},i.prototype.reset=function(){var i=e.indexOf(this._source);~i&&(e.splice(i,1),t.splice(i,1))},i}();e.exports=c},OLhd:function(e,t,i){"use strict";i.r(t),i.d(t,"createDwmAligner",(function(){return c})),i.d(t,"isAlignmentEnabled",(function(){return h})),i.d(t,"createTimeToBarTimeAligner",(function(){return u}));var s=i("jCNj"),r=i("Kxc7"),n=i("LxhU"),o=i("ZmuQ"),a=i("IiTo");const l=new o.b("Etc/UTC","0000-0000:1234567");function c(e,t){if(!h()||!n.Interval.isDWM(e))return null;const i=new o.b(t.timezone,t.session,t.holidays,t.corrections),r=Object(a.newBarBuilder)(e,i,l);return{timeToSessionStart:e=>r.tradingDayToSessionStart(e),timeToExchangeTradingDay:e=>{const t=s.utc_to_cal(i.timezone,e),r=i.spec.correctTradingDay(new Date(t));return s.set_hms(r,0,0,0,0,s.get_timezone("Etc/UTC")),r.getTime()}}}function h(){return!r.enabled("disable_resolution_rebuild")}function u(e,t){if(!h())return e=>e;const i=new o.b(t.timezone,t.session,t.holidays,t.corrections),s=Object(a.newBarBuilder)(e,i,i,!1);return e=>s.alignTimeIfPossible(e)}},Ocx9:function(e,t,i){"use strict";(function(e){var s=i("wZIs"),r=i("tc+8");function n(e,t,i,r){
|
||
var n=e?s.defaults:s.factoryDefaults,a=t.startsWith("study_")?TradingView.clone(n("study")):{},l=TradingView.clone(n(t,r));return t.startsWith("study_")&&l.inputs&&delete l.inputs.symbol,"linetoolicon"===t&&e&&(l.icon=s.defaults(t).icon),l=o(l,i),TradingView.merge(a,l),a}function o(e,t){var i={};for(var s in e)t.indexOf(s)<0&&(i[s]=e[s]);return i}function a(t,i,s,o){var l;void 0===o&&(o=!0),this._defaultName=t,s?l=i:(l=n(o,t,[],null),i&&TradingView.merge(l,i)),r.call(this,l),this._defaultName=t,this._useUserPreferences=o,this.listeners().subscribe(this,a.prototype.onPropertyChanged),this._exclusions=[],this._restoreFactoryDefaultsEvent=new e}inherit(a,r),a._saveDefaults=!1,a.prototype.preferences=function(){return this.state(this._exclusions)},a.prototype.mergePreferences=function(e){this.mergeAndFire(o(e,this._exclusions))},a.prototype.addExclusion=function(e){this._exclusions.indexOf(e)<0&&this._exclusions.push(e)},a.prototype.restoreFactoryDefaults=function(){var e=n(!1,this._defaultName,this._exclusions,null);this.mergeAndFire(e),this._defaultName.startsWith("study_")||this.saveDefaults(),this._restoreFactoryDefaultsEvent.fire()},a.prototype.onRestoreFactoryDefaults=function(){return this._restoreFactoryDefaultsEvent},a.prototype.onPropertyChanged=function(){a._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()},a.prototype.saveDefaults=function(){this._useUserPreferences&&s.saveDefaults(this._defaultName,this.preferences())},a.prototype.clone=function(e){for(var t=new a(this._defaultName,this.state(),e&&e.replaceByState,this._useUserPreferences),i=0;i<this._exclusions.length;++i)t.addExclusion(this._exclusions[i]);return t},t.DefaultProperty=a,t.saveDefaultProperties=function(e){a._saveDefaults=e}}).call(this,i("aIyQ"))},OiSa:function(e,t,i){"use strict";i.r(t),i.d(t,"isDrawingToolbarVisible",(function(){return c}));var s=i("Vdly"),r=i("Kxc7"),n=i("hY0g"),o=i.n(n);const a=!r.enabled("hide_left_toolbar_by_default"),l=s.getBool("ChartDrawingToolbarWidget.visible",a),c=new o.a(l)},OsWk:function(e,t){
|
||
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" width="15" height="15" fill="none"><path d="M3.00004 7.50008C3.00004 6.25729 3.50318 5.13298 4.31807 4.31809L3.61097 3.61098C2.6162 4.60574 2.00004 5.98143 2.00004 7.50008H3.00004ZM4.31807 4.31809C5.13296 3.50321 6.25727 3.00008 7.50004 3.00008V2.00008C5.98141 2.00008 4.60572 2.61623 3.61097 3.61098L4.31807 4.31809ZM4.31808 3.61098L2.55033 1.84323L1.84322 2.55033L3.61097 4.31809L4.31808 3.61098ZM7.50004 3.00008C8.74283 3.00008 9.86715 3.50321 10.682 4.31811L11.3891 3.611C10.3944 2.61624 9.01869 2.00008 7.50004 2.00008V3.00008ZM10.682 4.31811C11.4969 5.13299 12 6.2573 12 7.50008H13C13 5.98144 12.3839 4.60576 11.3891 3.611L10.682 4.31811ZM11.3891 4.31811L13.1569 2.55033L12.4498 1.84322L10.682 3.611L11.3891 4.31811ZM12 7.50008C12 8.74285 11.4969 9.86716 10.682 10.682L11.3891 11.3892C12.3839 10.3944 13 9.01872 13 7.50008H12ZM10.682 10.682C9.86715 11.4969 8.74283 12.0001 7.50004 12.0001V13.0001C9.01869 13.0001 10.3944 12.3839 11.3891 11.3892L10.682 10.682ZM10.682 11.3892L12.4498 13.1569L13.1569 12.4498L11.3891 10.682L10.682 11.3892ZM7.50004 12.0001C6.25727 12.0001 5.13296 11.497 4.31807 10.6821L3.61097 11.3892C4.60572 12.3839 5.98141 13.0001 7.50004 13.0001V12.0001ZM4.31807 10.6821C3.50318 9.86718 3.00004 8.74286 3.00004 7.50008H2.00004C2.00004 9.01873 2.6162 10.3944 3.61097 11.3892L4.31807 10.6821ZM2.55033 13.1569L4.31808 11.3892L3.61097 10.6821L1.84322 12.4498L2.55033 13.1569ZM8.00004 2.50007L8 -8.77353e-06L7 8.77353e-06L7.00004 2.50009L8.00004 2.50007ZM12.5001 8.00008L15 8L15 7L12.5 7.00008L12.5001 8.00008ZM2.50006 7.00008L1.564e-05 7L-1.564e-05 8L2.50003 8.00008L2.50006 7.00008ZM7.00004 12.5001L7 15L8 15L8.00004 12.5001L7.00004 12.5001Z"/></svg>'},OwDf:function(e,t,i){"use strict";i.r(t),i.d(t,"PivotPointsStandardLastPricesView",(function(){return o}));var s=i("k9/m");const r=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],n={P:"P",S1:"S1/R1",S2:"S2/R2",S3:"S3/R3",S4:"S4/R4",S5:"S5/R5",R1:"S1/R1",R2:"S2/R2",R3:"S3/R3",R4:"S4/R4",R5:"S5/R5"};class o{constructor(e){this._visiblePivots=new Set,this._invidated=!0,this._prices=[],this._source=e}visiblePivots(){return this._visiblePivots}update(){this._invidated=!0}prices(){return this._invidated&&(this._updateImpl(),this._invidated=!1),this._prices}_updateImpl(){this._visiblePivots.clear();const e=this._source.model(),t=this._source.priceScale();if(null===t)return;if(e.timeScale().isEmpty()||t.isEmpty())return;const i=e.timeScale().visibleBarsStrictRange();if(null===i)return;if(!this._source.customData()||!this._source.customData().pivots)return;const o=e.mainSeries().bars().search(i.lastBar(),s.PlotRowSearchMode.NearestLeft);if(null===o)return;const a=o.index,l=this._source.customData().pivots,c=this._source.indexes(),h=this._source.properties(),u=this._source.firstValue();for(let s=0;s<l.length;s++){if(!l[s])continue;const e=c[l[s].startIndex],i=c[l[s].endIndex],o=h.inputs.showHistoricalPivots.value();if(e<=a&&(i>=a||o)){this._visiblePivots.add(l[s]),this._prices=[]
|
||
;for(let e=0;e<r.length;e++){const i=r[e],o=l[s][i];if(void 0===o||null===u)continue;const a=t.priceToCoordinate(o,u),c=i.toUpperCase(),d=n[c],p=h.levelsStyle.colors[d].value();this._prices.push({formatted:t.formatPrice(o,u),price:o,coordinate:a,color:p})}}}}}},Owlf:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));const s="large"},PAcw:function(e,t,i){"use strict";i.r(t),i.d(t,"GridRenderer",(function(){return n}));var s=i("jFln"),r=i("gAom");class n{constructor(){this._data=null}setData(e){this._data=e}draw(e,t){if(null===this._data)return;const i=t.pixelRatio,n=Math.max(1,Math.floor(i));e.lineWidth=n;const o=Math.ceil(this._data.h*i),a=Math.ceil(this._data.w*i);if(e.save(),e.lineCap="butt",this._data.vertLinesVisible){e.strokeStyle=this._data.vertLinesColor,Object(s.setLineStyle)(e,this._data.vertLineStyle);for(const t of this._data.timeMarks){const s=Math.round(t.coord*i);Object(r.drawVerticalLine)(e,s,0,o)}}if(this._data.horzLinesVisible){e.strokeStyle=this._data.horzLinesColor,Object(s.setLineStyle)(e,this._data.horzLineStyle);for(const t of this._data.priceMarks){const s=Math.round(t.coord*i);Object(r.drawHorizontalLine)(e,s,0,a)}}e.restore()}hitTest(e){return null}}},PL0c:function(e,t,i){"use strict";(function(e){var s=i("aO4+").Point,r=i("2kV1").StudyStatusView,n=i("it7y").StudyDataWindowView,o=i("Qq0B").NonSeriesStudy,a=i("UHyS").StandardPivotPointsPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("VdBB").HitTestResult,h=i("Zy3/").CompositeRenderer,u=i("c44N").areEqualPaneRenderParams,d=i("2EnG").StandardPivotPointsImageCache,p=i("OwDf").PivotPointsStandardLastPricesView,_=i("Fdrt").PaneRendererStandardPivotLabel,m=i("l4sv").HorizontalLineRenderer;class f{constructor(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}setCache(e){this._cache=e}priceAxisViews(e,t){return this._priceAxisViews}mergeLabel(e,t,i){var s=""+t;void 0===e[s]?(e[s]={},e[s].text=i,e[s].ids=[this.complete(i)]):(e[s].text+="/"+i,e[s].ids.push(this.complete(i)))}complete(e){return"P"===e?e:"S"+e[1]+"/R"+e[1]}update(){this._invalidated=!0}_updateImpl(){if(this._source.pricesView().prices(),this._pivots=[],this._source.customData()&&this._source.customData().pivots&&this._source.properties().visible.value()){var e=this._source.customData().pivots,t=this._source._indexes,i=this._model.timeScale(),s=this._source.priceScale();if(s&&!s.isEmpty()&&!i.isEmpty()&&e){var r=i.visibleBarsStrictRange(),n=r.firstBar(),o=r.lastBar();if(this._source.ownerSource())for(var a=this._source.ownerSource().firstValue(),l=0;l<e.length;l++)if(e[l]){var c=t[e[l].startIndex],h=t[e[l].endIndex];if(!(h<n||c>o)){var u={},d=this._source.properties().levelsStyle.visibility;d.P.value()&&this.mergeLabel(u,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(u,e[l].s1,"S1"),this.mergeLabel(u,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(u,e[l].s2,"S2"),this.mergeLabel(u,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(u,e[l].s3,"S3"),this.mergeLabel(u,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(u,e[l].s4,"S4"),
|
||
this.mergeLabel(u,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(u,e[l].s5,"S5"),this.mergeLabel(u,e[l].r5,"R5"));var p=i.indexToCoordinate(c),_=i.indexToCoordinate(h);for(var m in u){var f=parseFloat(m),g=s.priceToCoordinate(f,a);this._pivots.push({x1:p,x2:_,y:g,label:u[m].text,labelIds:u[m].ids,src:e[l]})}}}}}}renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);for(var e=new h,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,r=this._source.visiblePivots(),n=0;n<this._pivots.length;n++){var o=this._pivots[n];if(r.has(o.src)){var a={width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t[o.labelIds[0]].value(),linewidth:i[o.labelIds[0]].value(),linestyle:CanvasEx.LINESTYLE_SOLID,y:o.y,left:o.x1,right:o.x2},l=new m;if(l.setData(a),l.setHitTest(new c(c.REGULAR)),e.append(l),this._source.properties().levelsStyle.showLabels.value()){var u=function(e){return this._source.getCache(e)}.bind(this);e.append(new _(u,new s(o.x1,o.y),o.label))}}}return e}}t.study_PivotPointsStandard=class extends o{constructor(e,t,i,s){super(e,t,i,s);for(var r=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],n=this.properties().levelsStyle.visibility,o=0;o<r.length;o++)n[r[o]].listeners().subscribe(this,this.processHibernate);this._cacheDrawParams=null,this._cache=null}indexes(){return this._indexes}getCache(e){return this.createCacheIfRequred(e),this._cache}createCacheIfRequred(e){if(null===this._cache||null==this._cacheDrawParams||!u(e,this._cacheDrawParams)){this._cache&&this._cache.destroy();var t=this._getActualCacheParams();this._cache=new d(e,t.font,t.fontSize,t.backColors),this._cache.setPrices(this._pricesView.prices()),this._cacheDrawParams=e,this._cacheInvalidated=!1,this._cache.reset(t),this._cache.setPrices(this._pricesView.prices())}}lastValueData(e,t,i){var s=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase()),r=this._pricesView.prices()[s];return null!=r?r:{noData:!0}}priceLabelText(e){return this._metaInfo.shortDescription+":"+e.toUpperCase()}pricesView(){return this._pricesView}_getActualCacheParams(){var e={};return e.font=this.properties().font.value(),e.fontSize=this.properties().fontsize.value(),e.backColors=[this.properties().levelsStyle.colors.P.value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S5/R5"].value(),this.properties().levelsStyle.colors["S5/R5"].value()],e}updateAllViews(){super.updateAllViews(),this._pricesView.update()}createViews(){this._cache&&(this._cache.destroy(),this._cache=null),this._priceAxisViews=[]
|
||
;var e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"];this._paneViews.length=0,this._labelPaneViews=[];var t=new f(this._model,this);t.setCache(this._cache),this._paneViews.push(t),this._mainPaneView=t;for(var i=0;i<e.length;i++){var s=new a(this,{name:e[i],cache:this._cache});this._priceAxisViews.push(s),this._labelPaneViews.push(new l(s,this,this._model))}this._dataWindowView||(this._dataWindowView=new n(this,this._model)),this._statusView||(this._statusView=new r(this,this._model.properties().scalesProperties.textColor)),this._legendView=null,this._pricesView=new p(this)}visiblePivots(){return this._pricesView.visiblePivots()}_postProcessGraphics(){}isVisible(){if(!this.properties().visible.value())return!1;for(var e=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],t=this.properties().levelsStyle.visibility,i=0;i<e.length;i++)if(t[e[i]].value())return!0;return!1}stop(){super.stop(),this._cache&&(this._cache.destroy(),this._cache=null)}priceRange(t,i){if(!this.customData()||!this.customData().pivots||!this._indexes)return null;if(!this.priceScale())return null;for(var s=this.customData().pivots,r=this._indexes,n=null,o=0;o<s.length;o++)if(s[o]){var a=r[s[o].startIndex];if(!(r[s[o].endIndex]<t||a>i)){var l=[],c=this._properties.levelsStyle.visibility;c.P.value()&&l.push(s[o].p),c["S1/R1"].value()&&l.push(s[o].s1,s[o].r1),c["S2/R2"].value()&&l.push(s[o].s2,s[o].r2),c["S3/R3"].value()&&l.push(s[o].s3,s[o].r3),c["S4/R4"].value()&&l.push(s[o].s4,s[o].r4),c["S5/R5"].value()&&l.push(s[o].s5,s[o].r5);for(var h=0;h<l.length;h++)l[h]&&(null===n?n=new e(l[h],l[h]):n.apply(l[h],l[h]))}}return this.priceScale().isLog()&&n?new e(this.priceScale().priceToLogical(n.minValue()),this.priceScale().priceToLogical(n.maxValue())):n}}}).call(this,i("Qb4w").PriceRange)},PT1i:function(e,t,i){"use strict";i.r(t),i.d(t,"Linking",(function(){return h})),i.d(t,"linking",(function(){return u}));var s=i("hbEN"),r=i("hY0g"),n=i.n(r),o=i("Kxc7"),a=i("txPx");const l=Object(a.getLogger)("Linking");var c;!function(e){e[e.NotBound=0]="NotBound",e[e.BoundToWidget=1]="BoundToWidget",e[e.BoundToModel=2]="BoundToModel"}(c||(c={}));class h{constructor(){this._watchedSymbol=new n.a,this._seriesShortSymbol=new n.a,this._proSymbol=new n.a,this._watchedInterval=new n.a,this._watchedIntraday=new n.a,this._watchedSeconds=new n.a,this._watchedTicks=new n.a,this._watchedSupportedResolutions=new n.a,this._symbolNamesList=new n.a,this._chartWidgetBindingState=c.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._searchChartsLoadDebounced=null,this._selfEmit=!1,this._preventFeedBySymbol=!1,this._feedBySymbolDebounceCounter=0}get symbol(){return this._watchedSymbol}get proSymbol(){return this._proSymbol}get symbolNamesList(){return this._symbolNamesList}get seriesShortSymbol(){return this._seriesShortSymbol.readonly()}get interval(){
|
||
return this._watchedInterval}get intraday(){return this._watchedIntraday.readonly()}get seconds(){return this._watchedSeconds.readonly()}get ticks(){return this._watchedTicks.readonly()}get supportedResolutions(){return this._watchedSupportedResolutions.readonly()}get preventFeedBySymbol(){return this._preventFeedBySymbol}bindToChartWidget(e){this.unbindFromChartWidget(),this._activeChartWidget=e;const t=e.model();if(t)return void this._onChartModelCreated(t);e.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=c.BoundToWidget;const i=e.properties().childs().mainSeriesProperties.childs();this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())}unbindFromChartWidget(){switch(this._chartWidgetBindingState){case c.BoundToWidget:if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case c.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().dataEvents().symbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().dataEvents().symbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=c.NotBound}getChartWidget(){return this._activeChartWidget}bindToChartWidgetCollection(e){this._chartWidgetCollection=e,this.unbindFromChartWidget(),e.activeChartWidget.subscribe(e=>{this.unbindFromChartWidget(),this.bindToChartWidget(e)},{callWithLast:!0})}bindToSearchCharts(e){this.unbindFromSearchCharts(),this._searchCharts=e,e.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),e.loadingSymbol.subscribe(e=>{!1===e&&(this._feedBySymbolDebounceCounter=0)}),this._watchedSymbol.subscribe(this._onSymbolLinkBound)}unbindFromSearchCharts(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)}setPreventFeedBySymbol(e){this._preventFeedBySymbol=e}_onSearchBySymbol(e){if(!e.resolved_symbol)throw new Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(e.resolved_symbol),this._selfEmit=!1}_onSymbolLink(e){if(!this._selfEmit){if(!this._searchCharts){const e="No search charts defined";throw l.logError(e),new Error(e)}this._preventFeedBySymbol||this._loadSearchCharts(e)}}_loadSearchCharts(e){if(!this._searchCharts){const e="No search charts defined";throw l.logError(e),new Error(e)}if(this._searchChartsLoadDebounced)return void(this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced(e)))
|
||
;const t=e=>this._searchCharts?(!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=Object(s.default)(t,2e3),this._searchChartsLoadDebounced(e)):this._searchChartsLoadDebounced=null,this._searchCharts.feedBySymbol.call(this._searchCharts,e)):()=>{};!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=Object(s.default)(t,2e3),this._searchChartsLoadDebounced(e)):this._searchCharts.feedBySymbol(e)}_mainSeries(){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()}_properties(){return this._mainSeries().properties()}_symbolProperty(){return this._properties().symbol}_intervalProperty(){return this._properties().interval}_watchedSymbolListener(e){this._symbolProperty().value()!==e&&this._chartWidgetCollection.setSymbol(e)}_sendSnowplowAnalytics(){if(!window.user.do_not_track)throw new Error("unsupported")}_onSymbolPropertyChange(){const e=this._symbolProperty().value()!==this._watchedSymbol.value();this._watchedSymbol.setValue(this._symbolProperty().value()),e&&this._chartWidgetCollection.setSymbol(this._symbolProperty().value())}_onSymbolResolved(e){const t=this._mainSeries().symbolInfo();t&&this._applyValuesFromSymbolInfo(t)}_applyValuesFromSymbolInfo(e){const t=e.pro_name||o.enabled("trading_terminal")&&(e.full_name||e.name)||"";this._proSymbol.setValue(t),e.aliases&&this._symbolNamesList.setValue(e.aliases)}_updateSeriesSymbolInfo(){this._seriesShortSymbol.setValue(this._properties().shortName.value());const e=this._mainSeries().symbolInfo();e?(this._applyValuesFromSymbolInfo(e),e.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(e.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!e.has_intraday),this._watchedSeconds.setValue(!!e.has_seconds),this._watchedTicks.setValue(!!e.has_ticks)):(this._watchedIntraday.deleteValue(),this._watchedSeconds.deleteValue(),this._watchedTicks.deleteValue(),this._proSymbol.deleteValue())}_watchedIntervalListener(e){this._intervalProperty().value()!==e&&this._chartWidgetCollection.setResolution(e)}_onIntervalPropertyChange(){const e=this._intervalProperty().value()!==this._watchedInterval.value();this._watchedInterval.setValue(this._intervalProperty().value()),e&&this._chartWidgetCollection.setResolution(this._intervalProperty().value())}_onChartModelCreated(e){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");this._chartWidgetBindingState=c.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);const t=this._symbolProperty();t.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(t.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound);const i=this._mainSeries()
|
||
;i.dataEvents().symbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=e=>(i.symbolSameAsCurrent(e)&&(e=i.symbol()),e),i.dataEvents().symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolError().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().extendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo();const s=this._intervalProperty();s.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(s.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)}}window.TradingView=window.TradingView||{};const u=new h;window.TradingView.Linking=u},PYn8:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolThreeDrivers",(function(){return o}));var s=i("Ocx9"),r=i("Ss5c"),n=i("j3hX");class o extends r.LineDataSource{constructor(e,t){const s=t||o.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"S6aM")).then(t=>{this._setPaneViews([new t.LineToolThreeDrivesPaneView(this,e)])})}pointsCount(){return 7}name(){return"Three Drives Pattern"}properties(){return super.properties()}static createProperties(e){const t=new s.DefaultProperty("linetoolthreedrivers",e);return o._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"aMeN")).then(e=>e.PatternWithoutBackgroundDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("linesColors",new n.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new n.LineToolColorsProperty([e.childs().textcolor])),e.addChild("linesWidths",new n.LineToolWidthsProperty([e.childs().linewidth])),e.hasChild("backgroundsColors")&&e.removeProperty("backgroundsColors")}}},PdIz:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyPlotShapesPaneView",(function(){return c}));var s=i("CLNU"),r=i("Tmoa"),n=i("Zy3/"),o=i("vq8G"),a=i("Nu4p"),l=i("GSwP");class c extends l.a{renderer(){const e=this._study.properties().styles[this._plotName];return e.visible&&e.visible.value()&&this._scalesReady()?(this._invalidated&&(this._updateRenderer(e),this._invalidated=!1),this._renderer):null}_updateRenderer(e){this._updateImpl();const t=this._model.timeScale(),i={},l=this._getTranspValue(),c=t.barSpacing();let h;if(e.size){const t=e.size.value();h=this._calculateShapeHeight(25,t)}else h=Math.round(c/2);h=Math.max(h,1);const u=e.location.value(),d=Object(r.generateColor)(e.color.value(),l),p=l>19?l-10:0,_=this._calculateVerticalOffset(u,Math.round(1.5*h));i.barSpacing=c,i.items=this.items(),i.color=d,i.borderColor=Object(r.generateColor)(e.color.value(),p),i.height=h,i.vertOffset=_;const m=e.plottype.value(),f=a.a[m],g=new n.CompositeRenderer,v=e.text?e.text.value():void 0
|
||
;if(void 0!==v&&""!==v.trim()){let t=v.trim().replace(/\\n/gm,"\n");t=Object(s.cleanButAmpersand)(t,!0),i.text=t,i.fontSize=12;const n=e.textColor?e.textColor.value():void 0;i.textColor=n?Object(r.generateColor)(n,l):d}g.append(super._createRenderer(f.paneRendererClass,i)),this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&null!==this._selectionData&&(this._selectionData.vertOffset=_,g.append(new o.SelectionRenderer(this._selectionData))),this._renderer=g}}},Q19o:function(e,t,i){"use strict";var s=i("Eyy1").ensureNotNull,r=i("jA0t"),n=i("9iCb").applyOverridesToStudy,o=i("0YCj"),a=i("5JMW"),l=a.LineDataSourceApi,c=a.isLineToolRiskReward,h=i("N1UO").StudyApi,u=i("ltKl").SeriesApi,d=i("QrSB").SelectionApi,p=i("mf9N").PaneApi,_=i("OLhd").createDwmAligner,m=i("LxhU").Interval,f=i("2jXJ").supportedLineTools,g=i("vwKG").showTooManyStudiesNotice,v=i("ogJP").isNumber,b=i("vu5c").onSeriesCompletedOrErrorReceived,S=i("CW80").createLineToolProperties,y=i("96Yh").lineToolEntityInfo,w=i("lReN").LineToolsGroupControllerApi,C=i("ocrj").RemoveSourcesCommand,P=i("e92V").isLineDrawnWithPressedButton,x=i("FDyI").ChartWidgetApiBase,T=i("mMWL");function M(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}e.exports=class extends x{constructor(e,t){super(e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=t,this._selectionApi=null,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))}id(){return this._chartWidget.id()}_getPaneApi(e){var t=this._panes.get(e);return void 0===t&&(t=new p(e,this._chartWidget),this._panes.set(e,t)),t}_getStudyApi(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget),this._studies.set(e,t)),t}_getLineDataSourceApi(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new l(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map((function(e){var s=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(s.time_t,s.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t}executeActionById(e){this._chartWidget.executeActionById(e)}getCheckableActionState(e){return this._chartWidget.getCheckableActionState(e)}setZoomEnabled(e){this._chartWidget.model().model().setZoomEnabled(e)}setScrollEnabled(e){this._chartWidget.model().model().setScrollEnabled(e)}refreshMarks(){this._chartWidget.refreshMarks()}clearMarks(){this._chartWidget.clearMarks()}symbol(){return this._chartWidget.getSymbol()}symbolExt(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type,pro_name:e.pro_name}:null}resolution(){
|
||
return this._chartWidget.model().mainSeries().properties().interval.value()}setSymbol(e,t){if(e!==this.symbol()){var i=this._chartWidget.model().mainSeries().dataEvents();t&&b(i,(function(e){e||t()})),this._activateChart(),this._chartWidget.setSymbol(e)}}resetData(){this._chartWidget.model().mainSeries().rerequestData()}setResolution(e,t){var i=m.normalize(e);if(null!==i&&i!==this.resolution()){var s=this._chartWidget.model().mainSeries().dataEvents();t&&b(s,(function(e){e||t()})),this._activateChart(),this._chartWidget.setResolution(i)}}setEntityVisibility(e,t){console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead");var i=this._chartWidget.model().model().dataSourceForId(e);if(i){var s=i.properties();s&&s.visible&&s.visible.setValue(t)}}availableZOrderOperations(e){var t=M(this._chartWidget.model().model(),e);return this._chartWidget.model().availableZOrderOperations(t)}sendToBack(e){var t=M(this._chartWidget.model().model(),e);this._chartWidget.model().sendToBack(t)}bringToFront(e){var t=M(this._chartWidget.model().model(),e);this._chartWidget.model().bringToFront(t)}insertAfter(e,t){var i=this._chartWidget.model().model(),s=M(i,e),r=i.dataSourceForId(t);this._chartWidget.model().insertAfter(s,r)}insertBefore(e,t){var i=this._chartWidget.model().model(),s=M(i,e),r=i.dataSourceForId(t);this._chartWidget.model().insertBefore(s,r)}bringForward(e){var t=M(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t)}sendBackward(e){var t=M(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)}showPropertiesDialog(e){var t=this._chartWidget.model().model().dataSourceForId(e);if(null===t)throw new Error("Study or shape "+e+" does not exist");this._chartWidget.showChartPropertiesForSource(t)}getAllShapes(){return this._chartWidget.model().model().allLineTools().map(y).filter((function(e){return null!==e.name}))}removeAllShapes(){this._chartWidget.removeAllDrawingTools()}removeAllStudies(){this._chartWidget.removeAllStudies()}removeEntity(e,t){var i=this._chartWidget.model().chartModel().dataSourceForId(e);i?t&&t.disableUndo?new C(this._chartWidget.model().chartModel(),[i],"").redo():this._chartWidget.model().removeSource(i,!0,!0):console.warn("Can't find a source with id: "+e)}removeEntityWithUndo(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)}selection(){return null===this._selectionApi&&(this._selectionApi=new d(this._chartWidget.model().model())),this._selectionApi}createStudyTemplate(e){return this._chartWidget.model().model().studyTemplate(e.saveSymbol,e.saveInterval)}drawOnAllCharts(e){T.drawOnAllCharts.setValue(e)}applyStudyTemplate(e){this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())}setVisibleRange(e,t){return new Promise(function(i){this._chartWidget.setVisibleTimeRange(e.from,e.to,t,i)}.bind(this))}getVisibleRange(){var e={from:0,to:0},t=this._chartWidget.model().timeScale(),i=t.visibleBarsStrictRange();if(null===i)return e
|
||
;var r=this._chartWidget.model().mainSeries(),n=r.syncModel();if(null===n)return e;var o=s(r.data().last()),a=i.lastBar()-o.index,l=a<=0?t.indexToTimePoint(i.lastBar()):n.projectTime(o.value[TradingView.TIME_PLOT],a);if(e.from=+t.indexToTimePoint(Math.max(0,i.firstBar()))||0,e.to=+l||0,m.isDWM(r.interval())){var c=_(r.interval(),r.symbolInfo());null!==c&&(e.from=c.timeToExchangeTradingDay(1e3*e.from)/1e3,e.to=c.timeToExchangeTradingDay(1e3*e.to)/1e3)}return e}getVisiblePriceRange(){return console.warn("`getVisiblePriceRange` is deprecated. Use Price Scale API instead"),this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null}scrollPosition(){return this._chartWidget.model().timeScale().rightOffset()}defaultScrollPosition(){return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()}_createTradingPrimitive(e,t){var i=this;var r,n,o=this._chartWidget.model().model(),a=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(a,(r=TradingView.CLOSE_PLOT,{index:(n=s(i._chartWidget.model().mainSeries().bars().last())).index,price:n.value[r]}),e)._adapter}createOrderLine(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)}createPositionLine(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)}createExecutionShape(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)}createShape(e,t){return this.createMultipointShape([e],t)}_alignPoints(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),s=i.interval();if(t.timeScale().isEmpty()||!m.isDWM(s))return e;var r=_(s,i.symbolInfo());return null===r?e:e.map((function(e){return r.timeToSessionStart(1e3*e)/1e3}))}_convertUserPointsToDataSource(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),s=t.timeScale().points(),r=i.data();if(t.timeScale().isEmpty())return null;var n=e.map((function(e){return e.time||0})),o=this._alignPoints(n);function a(e,t,n){var o=s.closestIndexLeft(e)||0,a={index:o},l=s.valueAt(o);if(e>l&&o===s.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(v(t))a.price=t;else{var h=n?["open","high","low","close"].indexOf(n)+1:1;h<=0&&(h=1),a.price=r.valueAt(o)[h]}return a}for(var l=[],c=0;c<e.length;c++){var h=e[c];l.push(a(o[c],h.price,h.channel))}return l}createMultipointShape(e,t,i){var s=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),r=this._chartWidget.model().model(),n=r.mainSeries();if(!r.timeScale().isEmpty()){var o=r.dataSourceForId(t.ownerStudyId)||n,a=r.paneForSource(o),l=this._convertUserPointsToDataSource(e),h=f[t.shape]||f.flag;if(h.onlySelectable)throw new Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===h.name||"LineToolPath"===h.name||"LineToolGhostFeed"===h.name)l[0].price===l[l.length-1].price&&l[0].index===l[l.length-1].index||l.push(l[0]);else if("LineToolIcon"===h.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,
|
||
!t.hasOwnProperty("icon"))throw new Error("icon must be specified in options");t.overrides=t.overrides||{},t.overrides.icon=t.icon}var u=S(h.name);if(u.currencyId.setValue(o.symbolSource().currency()),u.unitId.setValue(o.symbolSource().unit()),t.overrides)for(var d in t.overrides)u[d]?u[d].setValue(t.overrides[d]):c(h.name)&&-1!==["profitLevel","stopLevel"].indexOf(d)&&u.addProperty(d,t.overrides[d]);void 0!==u.text&&t.text&&u.text.setValue(t.text);var p=s.createLineTool(a,l[0],h.name,u,void 0,o);if(c(h.name)){if(l.length>2)throw new Error("Wrong points count for "+t.shape+". Required 1 or 2");2===l.length&&(p.startChanging(1,l[1]),p.setPoint(1,l[1]),p.endChanging())}else{var _=p.pointsCount();if(_!==l.length&&-1!==_)throw new Error("Wrong points count for "+t.shape+". Required "+_);for(var m=P(h.name),g=1;g<l.length&&this._chartWidget.model().lineBeingCreated();g++)s.continueCreatingLine(l[g],null,g<l.length-1||m);m&&(s.finishLineTool(p),s.continueCreatingLine(l[l.length-1],null,!1))}if(t.lock&&p.setUserEditEnabled(!1),t.disableSelection&&p.setSelectionEnabled(!1),t.disableSave&&(p.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(p.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder){var v=this._chartWidget.model().availableZOrderOperations([p]);"top"===t.zOrder&&v.bringToFrontEnabled?s.bringToFront([p]):"bottom"===t.zOrder&&v.sendToBackEnabled&&s.sendToBack([p])}return p.id()}}getShapeById(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw new Error("There is no such shape");return this._getLineDataSourceApi(t)}createStudy(e,t,i,s,a,l){if("function"==typeof a)return console.warn('"createStudy" does not take "callback" parameter anymore'),Promise.resolve(null);if(l=l||{},"string"!=typeof e)return this._createStudy(e);if(l.checkLimit&&!this._chartWidget.model().canCreateStudy())return g(),Promise.resolve(null);e=e.toLowerCase();var c=l.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),h=o.findStudyMetaInfoByDescription(c.studiesMetaData(),e).id,u=c.createStudyInserter({type:"java",studyId:h});return u.setForceOverlay(t),l.priceScale&&u.setPreferredPriceScale(function(e){switch(e){case"no-scale":return"overlay";case"as-series":return"as-series";case"new-left":return"left";case"new-right":return"right";default:throw new Error('The pricescale "'+e+'" is invalid, the only valid options are "no-scale", "as-series", "new-left" and "new-right".')}}(l.priceScale)),l.allowChangeCurrency&&u.setAllowChangeCurrency(!0),l.allowChangeUnit&&u.setAllowChangeUnit(!0),s&&(s=r.getStudyRecordFromArray([e].concat(s),this._chartWidget).inputs),u.insert((function(){return Promise.resolve(s||{})})).then((function(e){return a&&n(e,a),i&&e.setUserEditEnabled(!1),e.id()}))}getStudyById(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw new Error("There is no such study");return this._getStudyApi(t)}getSeries(){var e=this._chartWidget.model(),t=e.mainSeries();return new u(t,e)}chartType(){
|
||
return this._chartWidget.model().mainSeries().properties().style.value()}priceFormatter(){return this._chartWidget.model().mainSeries().priceScale().formatter()}dataReady(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t}_onVisibleBarsChanged(){var e=this._chartWidget.model().mainSeries(),t=e.data().isEmpty();null!==this._chartWidget.model().timeScale().visibleBarsStrictRange()&&t?e.dataEvents().completed().subscribe(this,this._onVisibleBarsChanged,!0):this._visibleBarsChanged.fire(this.getVisibleRange())}_destroy(){var e=this._chartWidget.model();null!==e&&e.timeScale().visibleBarsStrictRangeChanged().unsubscribe(this,this._onVisibleBarsChanged)}setTimezone(e){this._chartWidget.setTimezone(e)}getTimezone(){return this._chartWidget.getTimezone()}getPanes(){return this._chartWidget.model().chartModel().panes().map((function(e){return this._getPaneApi(e)}),this)}canZoomOut(){return!this._chartWidget.model().zoomStack().isEmpty()}zoomOut(){this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()}shapesGroupController(){return new w(this._chartWidget.model().lineToolsGroupController(),this._chartWidget.model())}isSelectBarRequested(){return this._chartWidget.selectBarMode().value()}requestSelectBar(){if(this.isSelectBarRequested())return Promise.reject("already requested");var e=this;return new Promise((function(t,i){e._chartWidget.onBarSelected().subscribe(e,(function(i){var s=e._chartWidget.model().mainSeries();if(m.isDWM(s.interval())){var r=_(s.interval(),s.symbolInfo());null!==r&&(i=r.timeToExchangeTradingDay(1e3*i)/1e3)}t(i)}),!0),e._chartWidget.toggleSelectBarMode(),e._chartWidget.selectBarMode().subscribe((function(){setTimeout((function(){e._chartWidget.onBarSelected().unsubscribeAll(e),i("cancelled")}))}),{once:!0})}))}cancelSelectBar(){this.isSelectBarRequested()&&this._chartWidget.toggleSelectBarMode()}}},QCyK:function(e,t,i){"use strict";i.r(t),i.d(t,"spreadStudyItem",(function(){return n}));var s=i("7dm8");class r extends s.a{_doCalculation(e,t,i,s){return e*t-i*s}}const n={name:"Spread",metainfo:{_metainfoVersion:15,defaults:s.b,plots:s.d,styles:s.e,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:s.c,id:"Spread@tv-basicstudies-1"},constructor:r}},QIuV:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("ivNn").fixComputationError;class n extends s{constructor(e,t){super(e,t),this.customization.forcePriceAxisLabel=!0,this.customization.disableErasing=!0,this.customization.showInObjectsTree=!1,this.setSelectionEnabled(!1)}isSynchronizable(){return!1}pointsCount(){return n.POINTS_COUNT}hasContextMenu(){return!1}state(){return null}startMoving(){s.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1}endMoving(){s.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1}_correctPoints(e){
|
||
this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.logical.price-this._startMovingPoint.logical.price&&(this._cursorMoved=!0):this._cursorMoved=!1;for(var t=1/this.priceScale().mainSource().base(),i=0;i<e.length;i++){var s=e[i];this._cursorMoved&&(s.price=this._currentMovingPoint.logical.price),s.price=r(t*Math.round(s.price/t)),e[i]=s}}userEditEnabled(){return!0}movable(){return!1}canBeHidden(){return!1}isUserDeletable(){return!1}showInObjectTree(){return!1}doesMovingAffectsUndo(){return!1}isAvailableInFloatingWidget(){return!1}timeAxisViews(){return null}cloneable(){return!1}copiable(){return!1}static _configureProperties(e){s._configureProperties(e)}}n.POINTS_COUNT=1,e.exports.LineToolTrading=n},QQu0:function(e,t,i){"use strict";var s=i("WPQD").LineToolTrendLine,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties())}name(){return"Arrow"}static createProperties(e){var t=new r("linetoolarrow",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolArrow=n},QTwd:function(e,t,i){"use strict";i.r(t),i.d(t,"RestoreDefaultsPreferencesUndoCommand",(function(){return h}));var s=i("Eyy1"),r=i("RDU5"),n=i("ApcL"),o=i("3t3b"),a=i("x2L+"),l=i("N22A"),c=i("GDWD");class h extends r.UndoCommand{constructor(e){super("Apply All Chart Properties"),this._trading=null,this._oldShowSellBuyButtons=null,this._oldNoConfirmEnabled=null,this._oldShowOnlyRejectionNotifications=null,this._oldShowPricesWithZeroVolume=null,this._oldShowPricesWithSpread=null,this._oldOrderExecutedSoundEnabled=null,this._prevWatermarkPreferences=null,this._model=e,this._trading=Object(l.a)(),null!==this._trading&&(this._oldShowSellBuyButtons=this._trading.showSellBuyButtons.value(),this._oldNoConfirmEnabled=this._trading.noConfirmEnabled.value(),this._oldShowOnlyRejectionNotifications=this._trading.showOnlyRejectionNotifications.value(),this._oldShowPricesWithZeroVolume=this._trading.showPricesWith().zeroVolume.value(),this._oldShowPricesWithSpread=this._trading.showPricesWith().spread.value(),this._oldOrderExecutedSoundEnabled=this._trading.orderExecutedSoundParams.enabled.value()),this._defaultsPreferences=Object(n.defaultsPreferencesByWhiteList)(this._model,this._model.mainSeries()),this._oldPreferences=e.preferences(),this._prevDateFormat=o.dateFormatProperty.value(),this._prevAddPlusButton=c.addPlusButtonProperty.value(),this._prevShowOpenMarkerStatus=a.b.value();const t=this._model.watermarkSource();null!==t&&(this._prevWatermarkPreferences=t.properties().state())}redo(){null!==this._trading&&(this._trading.showSellBuyButtons.setValue(!0),this._trading.noConfirmEnabled.setValue(!1),this._trading.showOnlyRejectionNotifications.setValue(!1),this._trading.showPricesWith().zeroVolume.setValue(!0),this._trading.showPricesWith().spread.setValue(!0),this._trading.orderExecutedSoundParams.enabled.setValue(!1)),this._model.applyPreferences(this._defaultsPreferences),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),
|
||
Object(o.restoreDateFormatSettingsValue)(),Object(c.restoreAddPlusButtonSettingsValue)(),Object(a.a)();const e=this._model.watermarkSource();null!==e&&e.restorePropertiesDefaults()}undo(){null!==this._trading&&(this._trading.showSellBuyButtons.setValue(Object(s.ensureNotNull)(this._oldShowSellBuyButtons)),this._trading.noConfirmEnabled.setValue(Object(s.ensureNotNull)(this._oldNoConfirmEnabled)),this._trading.showOnlyRejectionNotifications.setValue(Object(s.ensureNotNull)(this._oldShowOnlyRejectionNotifications)),this._trading.showPricesWith().zeroVolume.setValue(Object(s.ensureNotNull)(this._oldShowPricesWithZeroVolume)),this._trading.showPricesWith().spread.setValue(Object(s.ensureNotNull)(this._oldShowPricesWithSpread)),this._trading.orderExecutedSoundParams.enabled.setValue(Object(s.ensureNotNull)(this._oldOrderExecutedSoundEnabled))),this._model.applyPreferences(this._oldPreferences),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),o.dateFormatProperty.setValue(this._prevDateFormat),a.b.setValue(this._prevShowOpenMarkerStatus),c.addPlusButtonProperty.setValue(this._prevAddPlusButton);const e=this._model.watermarkSource();null!==e&&null!==this._prevWatermarkPreferences&&e.properties().mergeAndFire(this._prevWatermarkPreferences)}}},Qb4w:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceRange",(function(){return o}));var s=i("ogJP"),r=i("txPx");const n=Object(r.getLogger)("Chart.PriceRange");class o{constructor(e,t){if(null!==e&&"object"==typeof e){const t=e;this._minValue=t.m_minValue,this._maxValue=t.m_maxValue}else{const i=e;this._minValue=i,void 0!==t&&(this._maxValue=t)}}equals(e){return this._minValue===e._minValue&&this._maxValue===e._maxValue}clone(){return new o(this._minValue,this._maxValue)}minValue(){return this._minValue}setMinValue(e){this._minValue=e}maxValue(){return this._maxValue}setMaxValue(e){this._maxValue=e}length(){return this._maxValue-this._minValue}isEmpty(){return this._maxValue===this._minValue||this._maxValue!=this._maxValue||this._minValue!=this._minValue}serialize(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}}state(){return{max:this._maxValue,min:this._minValue}}merge(e){return new o(Math.min(this.minValue(),e.minValue()),Math.max(this.maxValue(),e.maxValue()))}apply(e,t){this._minValue=Math.min(this._minValue,e),this._maxValue=Math.max(this._maxValue,t)}set(e,t){this._minValue=e,this._maxValue=t}scaleAroundCenter(e){if(!Object(s.isNumber)(e))return void n.logDebug("PriceRange.scaleAroundCenter: invalid coeff");if(0===this._maxValue-this._minValue)return;const t=.5*(this._maxValue+this._minValue);let i=this._maxValue-t,r=this._minValue-t;i*=e,r*=e,this._maxValue=t+i,this._minValue=t+r}shift(e){Object(s.isNumber)(e)?(this._maxValue+=e,this._minValue+=e):n.logDebug("PriceRange.shift: invalid coeff")}containsStrictly(e){return e.minValue()>this._minValue&&e.maxValue()<this._maxValue}static compare(e,t){return null===e||null===t?e===t:e.equals(t)}}},QfUd:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}))
|
||
;var s=i("hY0g"),r=i.n(s),n=i("ogJP");function o(e,t){return Object(n.deepEquals)(e,t)[0]}class a extends r.a{constructor(e,t=o){super(e),this._comparator=t}setValue(e,t){!1===this._comparator(this.value(),e)&&super.setValue(e,t)}}},QloM:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"TabNames",(function(){return s})),function(e){e.background="Background",e.coordinates="Coordinates",e.drawings="Drawings",e.events="Events",e.eventsAndAlerts="Events & Alerts",e.inputs="Inputs",e.properties="Properties",e.scales="Scales",e.legend="Legend",e.sourceCode="Source Code",e.style="Style",e.symbol="Symbol",e.timezoneSessions="Timezone/Sessions",e.trading="Trading",e.visibility="Visibility",e.text="Text"}(s||(s={}))},Qq0B:function(e,t,i){"use strict";i.r(t),i.d(t,"NonSeriesStudy",(function(){return n}));var s=i("Eyy1"),r=i("GVHu");class n extends r.Study{clearData(){this._customData=null,this._indexes=null}restoreData(e,t,i){r.Study.prototype.restoreData.call(this,e),this._customData=t,this._indexes=i}state(e){const t=super.state(e);return e&&(t.nonSeriesData=this._customData,t.indexes=this._indexes),t}customData(){return this._customData}_setPaneViews(e){this._paneViews=e,this.model().lightUpdate()}_onDataUpdated(e,t,i){null!==t&&(t.indexes_replace?(Object(s.assert)("nochange"!==i),this._indexes=i):(this._customData=t.data,"nochange"!==i&&(this._indexes=i))),super._onDataUpdated(e,t,i)}}},QrSB:function(e,t,i){"use strict";function s(e,t){const i=e.dataSourceForId(t);if(null===i)throw new Error(`Chart has no study or shape with id "${t}"`);return i}i.r(t),i.d(t,"SelectionApi",(function(){return r}));class r{constructor(e){this._model=e}add(e){Array.isArray(e)?this._model.selectionMacro(t=>{e.map(s.bind(null,this._model)).forEach(e=>t.addSourceToSelection(e))}):this.add([e])}canBeAddedToSelection(e){const t=s(this._model,e);return this._model.selection().canBeAddedToSelection(t)}set(e){Array.isArray(e)?this._model.selectionMacro(t=>{t.clearSelection(),e.map(s.bind(null,this._model)).forEach(e=>t.addSourceToSelection(e))}):this.set([e])}remove(e){Array.isArray(e)?this._model.selectionMacro(t=>{e.map(s.bind(null,this._model)).forEach(e=>t.removeSourceFromSelection(e))}):this.remove([e])}contains(e){const t=s(this._model,e);return this._model.selection().isSelected(t)}allSources(){return this._model.selection().dataSources().map(e=>e.id())}isEmpty(){return this._model.selection().isEmpty()}clear(){this._model.selectionMacro(e=>{e.clearSelection()})}onChanged(){return this._model.onSelectedSourceChanged()}}},Qtjj:function(e,t,i){"use strict";i.r(t),i.d(t,"TimeSynchronizer",(function(){return l}));var s=i("LxhU"),r=i("jCNj"),n=i.n(r),o=i("IiTo");let a=null;class l{constructor(e,t){var i,r;this._sourceTargetBarBuilder=null,this._cache=new Map,this._source=e,this._target=t,this._isResolutionTheSame=s.Interval.isEqual(e.getResolution(),t.getResolution()),this._isSessionTheSame=(i=e.getSymbolInfo(),r=t.getSymbolInfo(),i.timezone===r.timezone&&i.session===r.session),
|
||
this._shouldCorrectTradingDay=s.Interval.isDWM(e.getResolution())&&!this._isSessionTheSame}sourceTimeToTargetTime(e){if(this._isSessionTheSame&&this._isResolutionTheSame)return e;if(!this._source.isValid()||!this._target.isValid())return e;let t=this._cache.get(e);if(void 0===t){let i=1e3*e;if(this._shouldCorrectTradingDay){let e=n.a.utc_to_cal(this._source.getSession().timezone,i);e=this._source.getSession().spec.correctTradingDay(e);const t=new Date(e);n.a.set_hms(t,0,0,0,0,this._source.getSession().timezone),i=t.valueOf()}const s=this._sourceTargetBuilder();s.moveTo(i);const r=s.indexOfBar(i);t=s.startOfBar(Math.max(0,r))/1e3,this._cache.set(e,t)}return t}_sourceTargetBuilder(){if(null===this._sourceTargetBarBuilder){const e=this._isSessionTheSame?this._target.getSession():(null===a&&(a=new o.SessionInfo("Etc/UTC","24x7")),a);this._sourceTargetBarBuilder=Object(o.newBarBuilder)(this._target.getResolution(),this._target.getSession(),e)}return this._sourceTargetBarBuilder}}},RDDl:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"VghZ",7)).then(({PriceRangePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Price Range"}static createProperties(e){var t=new r("linetoolpricerange",e);return n._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Ax76"))).GeneralDatePriceRangeDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e)}}t.LineToolPriceRange=n},RDU5:function(e,t,i){"use strict";i.r(t),i.d(t,"UndoCommand",(function(){return s}));class s{constructor(e,t=!0){this._customFlags={},this._text=e,this._executeOnPush=t}text(){return this._text}executeOnPush(){return this._executeOnPush}customFlag(e){return this._customFlags[e]}setCustomFlag(e,t){this._customFlags[e]=t}canMerge(e){return!1}merge(e){throw new Error("Should be re-implemented in child classes")}}},RTYN:function(e,t,i){"use strict";i.r(t),i.d(t,"PositionAveragePriceAxisView",(function(){return r}));var s=i("4TVt");class r extends s.LineToolPriceAxisView{_formatPrice(e,t){return this._source.formatter().format(e)}}},RXmj:function(e,t,i){"use strict";(function(e){var s=i("FIi8").deepExtend,r=i("ogJP").deepEquals,n=i("zUrt").backend;window.t("The publication preview could not be loaded. Please disable your browser extensions and try again.");function o(t){this._chartWidgetCollection=t,this._chartAboutToBeSavedDelegate=new e,this._chartSavedDelegate=new e,this._prevChartState=null,this._chartHasBeenModified=new e,this._chartSizeLimitExceededDelegate=new e}function a(e,t){e.content=JSON.stringify(t)}o.prototype.chartHasBeenModified=function(){return this._chartHasBeenModified},o.prototype.chartSizeLimitExceeded=function(){return this._chartSizeLimitExceededDelegate},o.prototype.chartAboutToBeSaved=function(){
|
||
return this._chartAboutToBeSavedDelegate},o.prototype.chartSaved=function(){return this._chartSavedDelegate},o.prototype.whenReadyToSave=function(e){var t=this._chartWidgetCollection.activeChartWidget.value().model().mainSeries();if(t.symbolInfo()&&!t.hasDelayedSymbolIntervalChange())e();else{var i,s=null;i=function(){t.dataEvents().symbolError().unsubscribe(null,s,!0),e()},s=function(){t.dataEvents().symbolResolved().unsubscribe(null,i,!0)},t.dataEvents().symbolResolved().subscribe(null,i,!0),t.dataEvents().symbolError().subscribe(null,s,!0)}},o.prototype.saveToJSON=function(){var e=this._getCommonSavingInfo(!1);return a(e,this._getChartWidgetCollectionState(!1,!0)),e},o.prototype._fillAsyncInfo=function(e,t){var i=JSON.parse(e.content),r=this._chartWidgetCollection;return(t?r.asyncState():r.activeChartWidget.value().asyncState()).then((function(t){return e.content=JSON.stringify(s(i,t)),e}))},o.prototype._getChartWidgetCollectionState=function(e,t,i,s,r){return e||(t=!0,s=!1),t?this._chartWidgetCollection.state(!!e,i,s,r):this._chartWidgetCollection.activeChartWidget.value().state(!!e,i,s,r)},o.prototype._getCommonSavingInfo=function(e){var t={},i=this._chartWidgetCollection,s=i.activeChartWidget.value(),r=i.metaInfo,n=s.model().mainSeries(),o=n.properties(),a=n.symbolInfo();if(r.id.value()&&(t.id=r.id.value()),t.name=r.name.value()||"",t.description=r.description.value()||"",t.resolution=n.properties().interval.value(),t.symbol_type=null!==a&&a.type||"",t.exchange=null!==a&&a.exchange||"",t.listed_exchange=null!==a&&a.listed_exchange||"",null!==a&&n.isSpread()){var l=a.legs[0],c=a.base_name[0];c=c.split(":")[1],t.symbol=l,t.short_name=c,t.expression=a.full_name}else t.symbol=null!==a&&a.ticker||o.symbol.value(),t.short_name=o.shortName.value();if(null!==a){for(var h=[],u=0,d=a.legs.length;u<d;u++)h.push({symbol:a.legs[u],pro_symbol:a.base_name[u]});t.legs=JSON.stringify(h)}else t.legs=JSON.stringify([]);return t.is_realtime=e?"0":"1",t},o.prototype.saveChartLineTools=function(e,t){var i=(void 0)(),s=this._chartWidgetCollection.metaInfo.uid.value();return i.saveLineToolsAndGroups(s,e,t)},o.prototype._saveLineToolsToStorage=function(){return Promise.resolve()},o.prototype._saveChartImpl=function(e,t,i,s,r,o){var a=i,l=s;return a=function(s){t.id.value()||(t.id.setValue(s),t.uid.setValue(s)),"function"==typeof i&&i(t,e)},e.name?n.saveChart(e.name,e.short_name,e.resolution,e,t,a.bind(this),l.bind(this)):(console.warn("Saving chart with empty name is not allowed"),void s())},o.prototype._saveChart=function(e,t,i,s){var n=this._chartWidgetCollection.metaInfo,o=function(o){return r(this._prevChartState,o)[0]&&null!=n.id.value()?(this._chartSavedDelegate.fire(!0),void(t&&t(n,o))):this._saveChartImpl(o,n,t,i,s,e)}.bind(this);this._saveLineToolsToStorage().then((function(){var t=e(!0);return o(t)})).catch((function(t){var i=e(!1);return o(i)}))},o.prototype.saveChartSilently=function(e,t,i){i=i||{};var s=function(e){
|
||
var t=e&&(void 0)("remove_line_tools_from_content"),s=this._getChartWidgetCollectionState(!1,void 0,void 0,void 0,t),r=this._getCommonSavingInfo(!1,t);return a(r,s),i.chartName&&(r.name=i.chartName),r.name&&0!==r.name.length||!i.defaultChartName||(r.name=i.defaultChartName),i.autoSave&&(r.autoSave=!0),r}.bind(this);$(window).on("beforeunload.savechart",(function(){return window.t("Your chart is being saved, please wait a moment before you leave this page.")})),this._isSaveInProcess=!0,this._chartAboutToBeSavedDelegate.fire(),this._saveChart(s,function(t,i){this._chartWidgetCollection.metaInfo.name.setValue(i.name),this._prevChartState=i,this._chartSavedDelegate.fire(!0),this._isSaveInProcess=!1,e&&e({uid:t.uid.value(),data:i}),delete this._prevChartState.savingToken}.bind(this),function(){this._chartSavedDelegate.fire(!1),this._isSaveInProcess=!1,t&&t.apply(null,arguments)}.bind(this),i),$(window).off("beforeunload.savechart")},o.prototype.isSaveInProcess=function(){return this._isSaveInProcess},t.ChartSaver=o}).call(this,i("aIyQ"))},S8xo:function(e,t,i){"use strict";i.r(t),i.d(t,"MouseEventHandler",(function(){return h}));i("EsMY");var s=i("qFKp"),r=i("Eyy1"),n=i("ogJP"),o=i("GUQs"),a=i("VaSN");const l=s.isSafari?"click":"auxclick",c={treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!1};class h{constructor(e,t,i){this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._touchMoveStartPosition=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null,this._startPinchMiddlePoint=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!s.CheckMobile.iOS(),this._onFirefoxOutsideMouseUp=e=>{this._mouseUpHandler(e)},this._onMobileSafariDoubleClick=e=>{if(this._firesTouchEvents(e)){const t=this._makeCompatEvent(e);if(++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(u(e),this._tapPosition);i<30&&!this._cancelTap&&this._processTouchEvent(t,this._handler.doubleTapEvent),this._resetTapTimeout()}}else{const t=this._makeCompatEvent(e);if(++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(u(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()}}},this._target=e,this._handler=t,this._options=Object(n.merge)(Object(n.clone)(c),i||{}),this._init()}
|
||
destroy(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()}_mouseEnterHandler(e){this._unsubscribeMousemove&&this._unsubscribeMousemove();const t=this._mouseMoveHandler.bind(this);if(this._unsubscribeMousemove=()=>{this._target.removeEventListener("mousemove",t)},this._target.addEventListener("mousemove",t),this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handler.mouseEnterEvent),this._acceptMouseLeave=!0}_resetClickTimeout(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_resetTapTimeout(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_mouseMoveHandler(e){if(this._mousePressed||null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.mouseMoveEvent),this._acceptMouseLeave=!0}_touchMoveHandler(e){const t=_(e.changedTouches,Object(r.ensureNotNull)(this._activeTouchId));if(null===t)return;if(this._lastTouchEventTimeStamp=p(e),null!==this._startPinchMiddlePoint)return;if(this._preventTouchDragProcess)return;this._pinchPrevented=!0;const i=this._touchMouseMoveWithDownInfo(u(t),Object(r.ensureNotNull)(this._touchMoveStartPosition)),{xOffset:s,yOffset:n,manhattanDistance:a}=i;if(this._touchMoveExceededManhattanDistance||!(a<5)){if(!this._touchMoveExceededManhattanDistance){const e=.5*s,t=n>=e&&!this._options.treatVertTouchDragAsPageScroll,i=e>n&&!this._options.treatHorzTouchDragAsPageScroll;t||i||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}if(!this._preventTouchDragProcess){const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handler.touchMoveEvent),Object(o.a)(e)}}}_mouseMoveWithDownHandler(e){if(0!==e.button)return;const t=this._touchMouseMoveWithDownInfo(u(e),Object(r.ensureNotNull)(this._mouseMoveStartPosition)),{manhattanDistance:i}=t;if(i>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick){const t=this._makeCompatEvent(e)
|
||
;this._processMouseEvent(t,this._handler.pressedMouseMoveEvent)}}_touchMouseMoveWithDownInfo(e,t){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return{xOffset:i,yOffset:s,manhattanDistance:i+s}}_touchEndHandler(e){let t=_(e.changedTouches,Object(r.ensureNotNull)(this._activeTouchId));if(null===t&&0===e.touches.length&&(t=e.changedTouches[0]),null===t)return;this._activeTouchId=null,this._lastTouchEventTimeStamp=p(e),this._clearLongTapTimeout(),this._touchMoveStartPosition=null,this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);const i=this._makeCompatEvent(e,t);if(this._processTouchEvent(i,this._handler.touchEndEvent),++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:e}=this._touchMouseMoveWithDownInfo(u(t),this._tapPosition);e<30&&!this._cancelTap&&this._processTouchEvent(i,this._handler.doubleTapEvent),this._resetTapTimeout()}else this._cancelTap||this._processTouchEvent(i,this._handler.tapEvent);0===this._tapCount&&Object(o.a)(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,Object(o.a)(e))}_mouseUpHandler(e){if(0!==e.button)return;const t=this._makeCompatEvent(e);if(this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),s.isFF){this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp)}if(!this._firesTouchEvents(e))if(this._processMouseEvent(t,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(u(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()}else this._cancelClick||this._processMouseEvent(t,this._handler.mouseClickEvent)}_clearLongTapTimeout(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}_touchStartHandler(e){if(null!==this._activeTouchId)return;const t=e.changedTouches[0];this._activeTouchId=t.identifier,this._lastTouchEventTimeStamp=p(e);const i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartPosition=u(t),this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);{const t=this._touchMoveHandler.bind(this),s=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=()=>{i.removeEventListener("touchmove",t),i.removeEventListener("touchend",s)},i.addEventListener("touchmove",t,{passive:!1}),i.addEventListener("touchend",s,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240)}const s=this._makeCompatEvent(e,t);this._processTouchEvent(s,this._handler.touchStartEvent),this._tapTimeoutId||(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),
|
||
this._tapPosition=u(t))}_wheelClickHandler(e){if(1!==e.button)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.wheelClickEvent)}_mouseDownHandler(e){if(0!==e.button)return;const t=this._target.ownerDocument.documentElement;s.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartPosition=u(e),this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);{const e=this._mouseMoveWithDownHandler.bind(this),i=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=()=>{t.removeEventListener("mousemove",e),t.removeEventListener("mouseup",i)},t.addEventListener("mousemove",e),t.addEventListener("mouseup",i)}if(this._mousePressed=!0,this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition=u(e))}_init(){this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));{const e=this._target.ownerDocument,t=e=>{this._handler.mouseDownOutsideEvent&&(e.target&&this._target.contains(e.target)||this._handler.mouseDownOutsideEvent())};this._unsubscribeOutsideTouchEvents=()=>{e.removeEventListener("touchstart",t)},this._unsubscribeOutsideMouseEvents=()=>{e.removeEventListener("mousedown",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0})}s.CheckMobile.iOS()&&(this._unsubscribeMobileSafariEvents=()=>{this._target.removeEventListener("dblclick",this._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._contextMenuHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),Object(o.b)(this._target),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._target.addEventListener(l,this._wheelClickHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",()=>{},{passive:!1})}_initPinch(){void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",e=>this._checkPinchState(e.touches),{passive:!0}),this._target.addEventListener("touchmove",e=>{if(2===e.touches.length&&null!==this._startPinchMiddlePoint&&void 0!==this._handler.pinchEvent){const t=d(e.touches[0],e.touches[1])/this._startPinchDistance;this._handler.pinchEvent(this._startPinchMiddlePoint,t),Object(o.a)(e)}},{passive:!1}),this._target.addEventListener("touchend",e=>{this._checkPinchState(e.touches)}))}_checkPinchState(e){1===e.length&&(this._pinchPrevented=!1),
|
||
2!==e.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(e)}_startPinch(e){const t=this._target.getBoundingClientRect()||{left:0,top:0};this._startPinchMiddlePoint={x:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,y:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this._startPinchDistance=d(e[0],e[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()}_stopPinch(){null!==this._startPinchMiddlePoint&&(this._startPinchMiddlePoint=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())}_mouseLeaveHandler(e){if(this._unsubscribeMousemove&&this._unsubscribeMousemove(),this._firesTouchEvents(e))return;if(!this._acceptMouseLeave)return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.mouseLeaveEvent),this._acceptMouseLeave=!s.CheckMobile.iOS()}_longTapHandler(e){const t=_(e.touches,Object(r.ensureNotNull)(this._activeTouchId));if(null===t)return;const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handler.longTapEvent),this._processTouchEvent(i,this._handler.touchContextMenuEvent),this._cancelTap=!0,this._longTapActive=!0}_contextMenuHandler(e){if(Object(o.a)(e),null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.contextMenuEvent),this._cancelClick=!0}_firesTouchEvents(e){return e.sourceCapabilities&&void 0!==e.sourceCapabilities.firesTouchEvents?e.sourceCapabilities.firesTouchEvents:p(e)<this._lastTouchEventTimeStamp+500}_processTouchEvent(e,t){Object(a.setLastEventIsTouch)(!0),t&&t.call(this._handler,e)}_processMouseEvent(e,t){"mouseleave"!==e.srcType&&Object(a.setLastEventIsTouch)(!1),t&&t.call(this._handler,e)}_makeCompatEvent(e,t){const i=t||e,s=this._target.getBoundingClientRect()||{left:0,top:0};return{clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,localX:i.clientX-s.left,localY:i.clientY-s.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,isTouch:!e.type.startsWith("mouse")&&"contextmenu"!==e.type&&"click"!==e.type,srcType:e.type,target:i.target,view:e.view,preventDefault:()=>{"touchstart"!==e.type&&Object(o.a)(e)}}}}function u(e){return{x:e.pageX,y:e.pageY}}function d(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}function p(e){return e.timeStamp||performance.now()}function _(e,t){for(let i=0;i<e.length;++i)if(e[i].identifier===t)return e[i];return null}},SMvR:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolHighlighter",(function(){return n}));var s=i("Ocx9"),r=i("DVnF");class n extends r.a{constructor(e,t){super(e,t||n.createProperties()),this._loadPaneViews(e)}properties(){return super.properties()}smooth(){return this.properties().childs().smooth.value()}name(){return"Highlighter"}static createProperties(e){const t=new s.DefaultProperty("linetoolhighlighter",e);return n._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){
|
||
return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/a/6")).then(e=>e.HighlighterDefinitionsViewModel)}_loadPaneViews(e){i.e("lt-pane-views").then(i.bind(null,"uRW3")).then(t=>{this._setPaneViews([new t.HighlighterPaneView(this,e)])})}static _configureProperties(e){r.a._configureProperties(e)}}},Si3H:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("0YCj"),n=i.n(r),o=i("ogJP");i.d(t,"migrateMetaInfoAndPropState",(function(){return l}));const a=[new class{targetMetaInfoVersion(){return 47}migrateMetaInfo(e){const t=e,i=e;if(i._metainfoVersion=47,!t.defaults||void 0===t.defaults.precision)return void(i.format={type:"inherit"});const s=t.defaults&&t.defaults.precision,r=Object(o.isNumber)(s)?s:parseInt(s);0===r?i.format={type:"volume"}:isFinite(r)?i.format={type:"price",precision:r}:i.format={type:"inherit"},delete t.defaults.precision}migratePropState(e){}},new class{targetMetaInfoVersion(){return 50}migrateMetaInfo(e){const t=e,i=e;if(i._metainfoVersion=50,void 0===t.defaults||void 0===t.defaults.ohlcPlots||void 0===t.ohlcPlots)return;const r=t.ohlcPlots,n=t.defaults.ohlcPlots,o=Object(s.ensureDefined)(Object(s.ensureDefined)(i.defaults).ohlcPlots);for(const s of Object.keys(n)){const e=n[s];if("ohlc_candles"===e.plottype){let t=!1;const i=r[s];void 0!==i&&(t=!!i.drawBorder,delete i.drawBorder),o[s]=Object.assign({borderColor:"#000000",drawBorder:t},e)}}}migratePropState(e){}}];function l(e,t){const i=n.a.versionOf(e),r=e;void 0===r._serverMetaInfoVersion&&(r._serverMetaInfoVersion=i),a.forEach(r=>{i<0||i>=r.targetMetaInfoVersion()||(r.migrateMetaInfo(e),void 0!==t&&r.migratePropState(t),Object(s.assert)(e._metainfoVersion===r.targetMetaInfoVersion()))})}a.sort((function(e,t){return e.targetMetaInfoVersion()-t.targetMetaInfoVersion()}))},SqfW:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}));var s=i("tqok"),r=i("hsV8");function n(e,t){if(e.index>=t.length)return null;const i=t[e.index];return i===s.a?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function o(e,t,i){const s=Object(r.ensureTimePointIndexIndex)(i.indexOf(e.index));return Object.assign(Object.assign({id:t},e),{index:s})}},Ss5c:function(e,t,i){"use strict";var s=i("Eyy1").ensureDefined,r=i("aO4+").Point,n=i("dOnf").deepCopy,o=i("4TVt").LineToolPriceAxisView,a=i("fJhV").LineDataSourceTimeAxisView,l=i("mMWL"),c=i("LxhU").Interval,h=i("pPtI").getServerInterval,u=i("txPx").getLogger("Chart.LineDataSource"),d=i("FQhm"),p=i("aIyQ"),_=i("tc+8"),m=i("Kxc7"),f=i("0qMc").lineToolsLocalizedNames,g=m.enabled("datasource_copypaste"),v=i("ng+v").LineDataSourceBase,b={frozen:!1,visible:!0,intervalsVisibilities:{ticks:!0,seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,weeksFrom:1,weeksTo:52,months:!0,monthsFrom:1,monthsTo:12,ranges:!0}};class S extends v{constructor(e,t){super(e,t),this._onTemplateApplying=new p,
|
||
this._onTemplateApplied=new p,this._properties.hasChild("symbol")||this._properties.addChild("symbol",new _(e.mainSeries().symbol())),this._properties.hasChild("interval")||this._properties.addChild("interval",new _(e.mainSeries().interval())),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,S.prototype.calcIsActualSymbol);var i=this;if(this._properties.listeners().subscribe(this,(function(){i.propertiesChanged()})),this._createPointsProperties(),this.pointsCount()>0)for(var s=0;s<this.pointsCount();s++)this._priceAxisViews.push(this.createPriceAxisView(s)),this._timeAxisViews.push(new a(this,s));this._properties.visible.listeners().subscribe(this,(function(e){var t=!1===l.hideAllDrawings().value();e.value()?e.value()&&t&&d.emit("drawing_event",this._id,"show"):(i._model.selection().isSelected(this)&&i._model.selectionMacro((function(e){e.removeSourceFromSelection(i)})),t&&d.emit("drawing_event",this._id,"hide")),i._onSourceHiddenMayChange()})),l.hideAllDrawings().subscribe(this,this._onSourceHiddenMayChange),this.customization={forcePriceAxisLabel:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},this._syncStateExclusions=[],this._definitionsViewModel=null,this._isDestroyed=!1,this._syncLineStyleMuted=!1}getType(){return TradingView.className(this.constructor)}isSavedInChart(e){return!this.customization.disableSave}setSavingInChartEnabled(e){this.customization.disableSave=!e}showInObjectTree(){return this.customization.showInObjectsTree}isAvailableInFloatingWidget(){return!0}setShowInObjectsTreeEnabled(e){this.customization.showInObjectsTree=e}visibilityKeyByInterval(e){var t,i=c.parse(e);return S.IntervalsVisibilities.forEach((function(e){e.kind===i.kind()&&e.from<=i.multiplier()&&e.to>=i.multiplier()&&(t=e.key)})),t}priceScale(){return this._ownerSource?this._ownerSource.m_priceScale:null}symbol(){return this._properties.symbol.value()}properties(){return this._properties}isSavedInStudyTemplates(){return!1}state(e){var t={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(this._propertiesStateExclusions()),points:n(this._timePoint),zorder:this.zorder(),linkKey:this.linkKey};return delete t.state.points,e&&(t.indexes=this._points),this.ownerSource()&&(t.ownerSource=this.ownerSource().id()),this.isFixed()&&(t.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(t.version=this.version),this.hasAlert.value()&&(t.alertId=this._alertId),t}_propertiesStateExclusions(){return null}template(){return this.properties().preferences()}applyTemplate(e){this._onTemplateApplying.fire(e),this._applyTemplateImpl(e),this.calcIsActualSymbol(),this.updateAllViews(),this.model().lightUpdate(),this._onTemplateApplied.fire()}_applyTemplateImpl(e){var t=this.properties();t.mergePreferences(e),t.saveDefaults(),this.propertiesChanged()}clearData(){this._points=[]}denormalizeTimePoints(){for(var e=[],t=0;t<this._timePoint.length;t++){
|
||
var i=this._model.timeScale().denormalizeTimePoint(this._timePoint[t]);if(void 0===i){e=[];break}e.push({index:i,price:this._timePoint[t].price})}e.length>0&&(this._points=e)}restorePoints(e,t,i){this._timePoint=n(e),this._points=t,i||this.denormalizeTimePoints()}restoreExternalState(e){this.properties().mergeAndFire(e)}restorePositionPercents(e){this._positionPercents=e}getLinkKey(){return this.linkKey||null}updateAllViewsAndRedraw(){this.updateAllViews(),this._model.updateSource(this)}propertiesChanged(e){this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),e||this._syncLineStyleIfNeeded()}_syncLineStyleIfNeeded(){if(!this._syncLineStyleMuted&&this.linkKey){var e=this.properties().state(this._syncStateExclusions);delete e.interval,l.changeLineStyle({linkKey:this.linkKey,state:e,model:this._model})}}_muteSyncLineStyle(){this._syncLineStyleMuted=!0}_unmuteSyncLineStyleWithoutApplyingChanges(){this.propertiesChanged(),this._syncLineStyleMuted=!1}points(){for(var e=[],t=0;t<this._points.length;t++){var i=this._points[t];e.push({index:i.index,price:i.price,time:i.time})}return this._lastPoint&&e.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time}),!this.isFixed()&&this._currentMovingPoint&&this._startMovingPoint&&this._correctPoints(e),e}normalizedPoints(){return this._timePoint}fixedPoints(){var e=[];if(this._positionPercents&&!this.priceScale().isEmpty())for(var t=0;t<this._positionPercents.length;t++){var i=this._positionPercents[t],s=this._model.timeScale().width()*i.x,n=this.priceScale().height()*i.y;e.push(new r(s,n))}else for(t=0;t<this._fixedPoints.length;t++)e.push(this._fixedPoints[t].clone());return this._lastPoint&&e.push(this._lastPoint.clone()),this._currentMovingPoint&&this._startMovingPoint&&this._correctFixedPoints(e),e}addFixedPoint(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t}calcPositionPercents(){if(!this.priceScale()||this.priceScale().isEmpty())return[];this._positionPercents=[];for(var e=0;e<this._fixedPoints.length;e++){var t=this._fixedPoints[e],i=t.x/this._model.timeScale().width(),s=t.y/this.priceScale().height();this._positionPercents.push({x:i,y:s})}return this._positionPercents}calcMiddlePoint(e,t){return new r((e.x+t.x)/2,(e.y+t.y)/2)}getPointByPosition(e,t,i,s){return[t,i,s][e]}restoreFixedPoints(){this._fixedPoints=this.fixedPoints()}onData(e){e.params.customId===this._currentPointsetIdWithPrefix()&&this._onPointsetUpdated(e.params.plots)}_onPointsetUpdated(e){if(0!==e.length){for(var t=0;t<e.length;t++){var i=e[t],s=this._timePoint[i.index],r={index:i.value[0],time:new Date(1e3*i.value[1]),price:s.price};this._points.length<=i.index?(this._points.push(r),this._pointAdded.fire(this._points.length-1)):(this._points[i.index]=r,this._pointChanged.fire(i.index))}this.checkAlert&&this.checkAlert(),this.updateAllViewsAndRedraw()}}dataWindowView(){return null}statusView(){return null}isSynchronizable(){return this.priceScale()===this._model.mainSeries().priceScale()}
|
||
priceAxisViews(e,t){if(t!==this.priceScale()||this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){var i=this._model.linePointBeingEdited();if(null!==i&&i<this._priceAxisViews.length){var s=this._priceAxisViews.slice(),r=s[i];return s.splice(i,1),s.push(r),s}return this._priceAxisViews}return this._priceAxisViews}timeAxisViews(){if(this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){var e=this._model.linePointBeingEdited();if(null!==e&&e<this._timeAxisViews.length){var t=this._timeAxisViews.slice(),i=t[e];return t.splice(e,1),t.push(i),t}return this._timeAxisViews}return this._timeAxisViews}updateAllViews(){if(!this._isActualSymbol||!this._isActualCurrency||!this._isActualUnit)return null;if(!this._properties.visible.value())return null;this._updateAllPaneViews();for(var e=this._priceAxisViews,t=0;t<e.length;t++)e[t].update();for(e=this._timeAxisViews,t=0;t<e.length;t++)e[t].update()}setLastFixedPoint(e){this._lastFixedPoint=e,this.updateAllViews()}title(){return this.translatedType()}translatedType(){return void 0!==f[this.toolname]?f[this.toolname]:"Line Tool"}name(){return"Line Tool"}createServerPoints(){if(!this._recursiveGuard&&this._isActualSymbol&&this._model.chartApi().connected()&&(this._clearServerPoints(),!this._model.timeScale().isEmpty()&&(0===this._timePoint.length&&this._points.length>0&&this.normalizePoints(),0!==this._timePoint.length))){this._currentPointsetId=++S._pointSetId;for(var e=this._model.mainSeries().seriesSource().symbolInstanceId(),t=[],i=0;i<this._timePoint.length;i++){var s=this._timePoint[i];t.push([s.time_t,s.offset])}var r=h(this.properties().interval.value()),n=this;this._model.chartApi().createPointset(this._currentPointsetIdWithPrefix(),"turnaround",e,r,t,(function(e){n.onData(e)}))}}isBeingEdited(){return this===this._model.lineBeingEdited()||this===this._model.sourceBeingMoved}isFixed(){return!1}isLocked(){return this.properties().frozen&&this.properties().frozen.value()}pointToScreenPoint(e){var t=this._model.timeScale(),i=this.priceScale(),s=this.ownerSource().firstValue();if(!i||i.isEmpty()||t.isEmpty()||null==s)return[new r(0,0),new r(0,0)];var n=t.indexToCoordinate(e.index,!0),o=e.price,a=i.priceToCoordinate(o,s),l=new r(n,a);n=t.indexToCoordinate(e.index,!1),a=i.priceToCoordinate(o,s);return[l,new r(n,a)]}screenPointToPoint(e){var t=this._model.timeScale(),i=this.priceScale(),s=t.coordinateToIndex(e.x),r=this.ownerSource().firstValue();if(null!==r&&isFinite(r))return{price:i.coordinateToPrice(e.y,r),index:s}}tags(){return[this.toolname]}createPriceAxisView(e){return new o(this,{pointIndex:e})}alertId(){return this._alertId}setAlert(e,t){throw new Error("not implemented")}removeAlert(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1)}_processAlertHandlers(e){var t,i,s=this;if("unsubscribe"!==(e="subscribe"===e?"subscribe":"unsubscribe")||s._alertCallbacks){i="subscribe"===e?"on":"off",t=s.properties();var r=s._alertCallbacks||{remove:s.removeAlert.bind(s),hovered:function(e,t){var i=s._model.hoveredSource()===s
|
||
;t&&!i?s._model.setHoveredSource(s):!t&&i&&s._model.setHoveredSource(null)},selected:function(e,t){t&&s._model.selectionMacro((function(e){e.addSourceToSelection(s)}))},synchronizeSilently:function(e){s.synchronizeAlert(!1)}};s._alertCallbacks||(s._alertCallbacks=r),s.getAlert().then((function(n){n&&(n[i]("destroy",r.remove),n[i]("change:hovered",r.hovered),n[i]("change:selected",r.selected),t.extendLeft&&t.extendLeft[e](s,r.synchronizeSilently),t.extendRight&&t.extendRight[e](s,r.synchronizeSilently))}))}}editAlert(e){}getAlert(){throw new Error("not implemented")}getAlertSync(){return null}synchronizeAlert(e){}_getUndoHistory(){return this._model._undoModel.undoHistory()}stateForAlert(){if(!this.canHasAlert())return null;var e=this.state();e.id=this.idForAlert(),e.uniqueId=this.idForAlert(),e.title=this.title(),e.interval=this._model.mainSeries().interval();var t=this._getAlertPlots();return t&&(e.plots=t),e}_getAlertPlots(){return null}_linePointsToAlertPlot(e,t,i,s){if(2!==e.length)return u.logError("[Drawing Alert] Wrong points"),null;var r=this._model.timeScale();return!r||r.isEmpty()?null:{type:"LinePlot",title:t||this.title(),timestamp:r.indexToTimePoint(0),offset1:e[0].index,offset2:e[1].index,price1:e[0].price,price2:e[1].price,extendBackward:i||!1,extendForward:s||!1}}getAlertIsActive(){return!1}geometry(){var e=this;return this.points().map((function(t){return function(t){var i=t.x/e._model.timeScale().width(),s=t.y/e.priceScale().height();return new r(i,s)}(e.pointToScreenPoint(t)[0])}))}model(){return this._model}isForcedDrawPriceAxisLabel(){return this.customization.forcePriceAxisLabel}_getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}getPropertyDefinitionsViewModel(){if(null===this._definitionsViewModel){var e=this;return e._getPropertyDefinitionsViewModelClass().then((function(t){return null===t||e._isDestroyed?null:(null===e._definitionsViewModel&&(e._definitionsViewModel=new t(e._model.undoModel(),e)),e._definitionsViewModel)}))}return Promise.resolve(this._definitionsViewModel)}hasEditableCoordinates(){return!0}getSourceIcon(){return{type:"loadSvg",svgId:"linetool."+this.getType()}}destroy(){super.destroy(),this.stop(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),null!==this._ownerSource&&(this._ownerSource.currencyChanged().unsubscribeAll(this),this._ownerSource.unitChanged().unsubscribeAll(this)),l.hideAllDrawings().unsubscribeAll(this),this._isDestroyed=!0}getOrderTemplate(){return null}copiable(){return g}cloneable(){return null!==this._ownerSource&&null!==this._ownerSource.firstValue()}movable(){return!0}static _configureProperties(e){if(v._addCollectedProperties(e),e.hasChild("visible")||e.addChild("visible",new _(b.visible)),e.hasChild("frozen")||e.addChild("frozen",new _(b.frozen)),e.hasChild("currencyId")||e.addChild("currencyId",new _(null)),e.hasChild("unitId")||e.addChild("unitId",new _(null)),e.addExclusion&&(e.addExclusion("visible"),e.addExclusion("frozen"),e.addExclusion("currencyId"),
|
||
e.addExclusion("unitId")),e.hasChild("intervalsVisibilities")){var t=s(e.child("intervalsVisibilities"));for(var i in b.intervalsVisibilities)t.hasChild(i)||t.addChild(i,new _(b.intervalsVisibilities[i]))}else e.addChild("intervalsVisibilities",new _(b.intervalsVisibilities));e.hasChild("title")||e.addChild("title",new _("")),e.addExclusion&&(e.addExclusion("symbol"),e.addExclusion("symbolInfo"),e.addExclusion("points"),e.addExclusion("interval"),e.addExclusion("title")),e.hasChild("lastUpdateTime")||(e.addChild("lastUpdateTime",new _(0)),e.addExclusion&&e.addExclusion("lastUpdateTime")),e.hasChild("singleChartOnly")&&e.removeProperty("singleChartOnly")}}S.prototype.version=1,S._pointSetId=1,t.LineToolPriceAxisView=o,t.LineDataSource=S},SwuQ:function(e,t,i){"use strict";i.r(t),i.d(t,"unitConvertibleGroups",(function(){return n})),i.d(t,"sourceNewUnitOnPinningToPriceScale",(function(){return o}));var s=i("/tGj"),r=i("n5al");function n(e,t,i){const s=Object(r.symbolUnitConvertibleGroupsIfExist)(e);if(null!==s)return s;const n=i.unitGroupById(t);return null===n?[]:[n]}function o(e,t,i,r){let o=null;if(i.unitConversionEnabled()&&Object(s.isSymbolSource)(e)){const s=i.availableUnits(),a=t.unit(s),l=e.unit(),c=null===l?[]:n(e.symbolInfo(),l,s);null!==a&&null!==a.selectedUnit&&!a.allUnitsAreOriginal&&a.selectedUnit!==l&&(r&&null===l||null!==l&&s.convertible(l,c))&&(o=a.selectedUnit)}return o}},SzKR:function(e,t,i){},T6Of:function(e,t,i){"use strict";i.r(t),i.d(t,"LimitedPrecisionNumericFormatter",(function(){return r}));var s=i("ogJP");class r{constructor(e=1){this._precision=e}format(e){Object(s.isNumber)(e)||(e=parseFloat(e));const t=e.toFixed(this._precision),i=Math.pow(10,-this._precision);return Math.max(parseFloat(t),i)+""}parse(e){const t=parseFloat(e);return isNaN(t)?{res:!1}:{res:!0,value:t,suggest:this.format(t)}}}},TBaH:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolGannFixed",(function(){return a}));var s=i("aO4+"),r=i("Ss5c"),n=i("LAp3"),o=i("j3hX");class a extends r.LineDataSource{constructor(e,t){super(e,t||a.createProperties()),this._constructor="LineToolGannFixed",i.e("lt-pane-views").then(i.bind(null,"wdUH")).then(({GannFixedPaneView:e})=>{this._setPaneViews([new e(this,this.model())])}),this.properties().childs().reverse.subscribe(this,this._reversePoints)}pointsCount(){return 2}name(){return"Gann Square Fixed"}properties(){return super.properties()}axisPoints(){const e=this.points(),t=this.getScreenPoints();return e.length<2||t.length<2?[]:[e[0],this.screenPointToPoint(t[1])]}getScreenPoints(){const e=this.points();if(e.length<2)return[];const t=this._calcAngle();if(null===t)return[];const[i,r]=e,n=this.pointToScreenPoint(i)[0],o=this.pointToScreenPoint(r)[0],a=Math.sqrt(Math.pow(n.x-o.x,2)+Math.pow(n.y-o.y,2)),l=new s.Point(Math.cos(t),-Math.sin(t)),c=l.normalized(),h=c.x<0?-1:1,u=c.y<0?-1:1;return[n.addScaled(l,a),n.add(new s.Point(5*a*h,5*a*u))]}levelsCount(){return this.properties().childs().levels.childCount()}levels(){const e=[],t=this.properties().childs(),i=t.levels.childCount()
|
||
;for(let s=0;s<i;s++){const i=t.levels.childs()[s].childs();e.push({index:s,visible:i.visible.value(),color:i.color.value(),width:i.width.value()})}return e}fanLinesCount(){return this.properties().childs().fanlines.childCount()}fanLines(){const e=[],t=this.properties().childs(),i=t.fanlines.childCount();for(let s=0;s<i;s++){const i=t.fanlines.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsCount(){return this.properties().childs().arcs.childCount()}arcs(){const e=[],t=this.properties().childs(),i=t.arcs.childCount();for(let s=0;s<i;s++){const i=t.arcs.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsBackgroundTransparency(){return this.properties().childs().arcsBackground.childs().transparency.value()}isArcsBackgroundFilled(){return this.properties().childs().arcsBackground.childs().fillBackground.value()}static createProperties(e){const t=Object(n.a)("linetoolgannfixed",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"WfUZ")).then(e=>e.GannComplexAndFixedDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e);const t=[],i=[],s=e.childs();{const e=s.levels.childCount();for(let r=0;r<e;r++){const e=s.levels.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.fanlines.childCount();for(let r=0;r<e;r++){const e=s.fanlines.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.arcs.childCount();for(let r=0;r<e;r++){const e=s.arcs.childs()[r].childs();t.push(e.width),i.push(e.color)}}e.addChild("linesColors",new o.LineToolColorsProperty(i)),e.addChild("linesWidths",new o.LineToolWidthsProperty(t))}_calcAngle(){const e=this.points();if(e.length<2)return null;const[t,i]=e,s=this.pointToScreenPoint(t)[0];let r=this.pointToScreenPoint(i)[0].subtract(s);if(r.length()<=0)return null;r=r.normalized();let n=Math.acos(r.x);return r.y>0&&(n=-n),n}_reversePoints(){const[e,t]=this._points;this._points[0]=t,this._points[1]=e,this.normalizePoints(),this.restart()}}},TG9i:function(e,t,i){"use strict";i.r(t),i.d(t,"HHistDataWindowView",(function(){return d}));var s=i("Eyy1"),r=i("ivNn"),n=i("4miz"),o=i("nEwK"),a=i("qFKp"),l=i("e92V"),c=i("mMWL");const h=a.CheckMobile.any(),u=window.t("n/a");class d extends n.b{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._header=this._study.title(!0);const i=this._study.metaInfo().graphics.hhists;if(void 0===i)return;let r=0;for(const n in i){if(!i.hasOwnProperty(n))continue;const e=Object(s.ensureDefined)(i[n]);e.titles.length>r&&(r=e.titles.length)}r>1&&r++;const o=this._na();for(let s=0;s<r;s++)this._items.push(new n.a("",o));this.update()}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}update(){this._invalidated=!0}study(){return this._study}
|
||
_hideValues(){return h&&(null===this._model.crossHairSource().pane||Object(l.isLineToolName)(c.tool.value())||null!==this._model.lineBeingEdited())}_na(){const e=this._hideValues();return this._study.isVisible()&&!e?u:""}_setNa(){const e=this._hideValues(),t=this._na();for(const i of this._items)(""!==i.value()||e)&&(i.setTitle(""),i.setValue(t),i.setColor(void 0))}_updateImpl(){this._header=this._study.title(!0),this._title=this._study.title();const e=this._study.priceScale(),t=this._model.timeScale();if(null===e||e.isEmpty()||t.isEmpty())return void this._setNa();const i=this._model.crossHairSource(),s=i.appliedIndex(),n=i.price,a=function(e,t,i){if(0===e.size)return null;const s=function(e,t){let i=null;return e.forEach((e,s)=>{s<=t&&(null===i||s>i)&&(i=s)}),i}(e,t);if(null===s)return null;const r=e.get(s);if(!r||0===r.size)return null;return function(e,t){let i=null;return e.forEach(e=>{e.priceLow<=t&&t<e.priceHigh&&(i=e)}),i}(r,i)}(this._study.graphics().hhistsByTimePointIndex(),s,n);if(null===a)return;const l=this._study.metaInfo().graphics.hhists;if(void 0===l)return;const c=l[a.styleId];if(void 0===c)return;const h=this._study.properties().child("graphics").child("hhists").child(a.styleId),u=new o.VolumeFormatter;this._items.forEach((e,t,i)=>{if(t<h.colors.childCount())if(t<a.rate.length){const i=a.rate[t];e.setTitle(c.titles[t]),e.setValue(Object(r.isNumber)(i)?u.format(i):""),e.setColor(h.colors[t].value())}else e.setTitle(""),e.setValue(""),e.setColor(void 0);else{if(a.rate.length>1&&t===h.colors.childCount()){const t=a.rate.reduce((e,t)=>e+t,0);return e.setValue(u.format(t)),void e.setColor(h.valuesColor.value())}e.setValue("")}})}}},TMWk:function(e,t,i){"use strict";var s=i("Eyy1").assert,r=i("ogJP").clone,n=i("GVHu").Study,o=i("k9/m").PlotList,a=i("w4Ji").studyPlotFunctionMap,l=i("w4Ji").studyEmptyPlotValuePredicate;class c{constructor(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i}rebuildData(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,s=null,r=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each((function(n,o){var a=o[t],l=o[i]?Math.round(o[i]):null;if(o[t]=null,o[i]=null,!l||l>0)return!1;var c=n+l,h={pointIndex:c,value:a};if(r){if(r.pointIndex!==h.pointIndex){c>=0&&(e.valueAt(c)[t]=a);var u=!1;s&&(u=s.value<=r.value&&r.value<=a||s.value>=r.value&&r.value>=a),u?r.pointIndex>=0&&(e.valueAt(r.pointIndex)[t]=null):s=r,r=h}}else r=h;return!1}))}}t.study_ScriptWithDataOffset=class extends n{constructor(e,t,i,s){super(e,t,i,s),this._underlyingData=new o(a(s),l)}clearData(){super.clearData(),this._underlyingData.clear()}_mergeData(e){this._invalidateLastNonEmptyPlotRowCache();var t=this._underlyingData.firstIndex();this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new o(a(this._metaInfo),l));var i=this.m_data.lastIndex();this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach((function(e){
|
||
new c(e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)}),this)}_plotsForStrategyProcessing(){var e=[];return this._metaInfo.plots.forEach((function(t,i){if("dataoffset"===t.type){var r=this._metaInfo.plots.findIndex((function(e){return e.id===t.target}));s(r>=0,"target plot not found for strategy plot "+t.id);var n={strategyIndex:i,targetIndex:r};e.push(n)}}),this),e}}},TTFo:function(e,t,i){"use strict";i.r(t),i.d(t,"fromPercent",(function(){return n})),i.d(t,"toPercent",(function(){return o})),i.d(t,"toPercentRange",(function(){return a})),i.d(t,"fromIndexedTo100",(function(){return l})),i.d(t,"toIndexedTo100",(function(){return c})),i.d(t,"toIndexedTo100Range",(function(){return h})),i.d(t,"toLog",(function(){return u})),i.d(t,"fromLog",(function(){return d}));var s=i("Qb4w"),r=i("Hr11");function n(e,t){return t<0&&(e=-e),e/100*t+t}function o(e,t){const i=100*(e-t)/t;return t<0?-i:i}function a(e,t){const i=o(e.minValue(),t),r=o(e.maxValue(),t);return new s.PriceRange(i,r)}function l(e,t){return t<0&&(e=-e),(e-=100)/100*t+t}function c(e,t){const i=100*(e-t)/t+100;return t<0?-i:i}function h(e,t){const i=c(e.minValue(),t),r=c(e.maxValue(),t);return new s.PriceRange(i,r)}function u(e){const t=Math.abs(e);if(t<1e-8)return 0;const i=Object(r.log10)(t+1e-4)+4;return e<0?-i:i}function d(e){const t=Math.abs(e);if(t<1e-8)return 0;const i=Math.pow(10,t-4)-1e-4;return e<0?-i:i}},TcSq:function(e,t,i){"use strict";function s(e){return e===r(e)}function r(e){const t=e.indexOf("$"),i=e.indexOf("@");return t<0&&i>=0?null:e.substring(Math.max(t+1,0),i>=0?i:e.length)}function n(e){return e.startsWith("PUB;")}function o(e){return e.startsWith("USER;")}function a(e){return e.startsWith("STD;")}function l(e){return e.includes("Candlestick%1Pattern%1")}i.r(t),i.d(t,"isPineIdString",(function(){return s})),i.d(t,"extractPineId",(function(){return r})),i.d(t,"isPublishedPineId",(function(){return n})),i.d(t,"isCustomPineId",(function(){return o})),i.d(t,"isStandardPineId",(function(){return a})),i.d(t,"isCandleStickId",(function(){return l}))},TlGQ:function(e,t,i){"use strict";i.r(t),i.d(t,"visitObject",(function(){return n}));var s=i("ogJP");function r(e,t,i){return Object(s.isArray)(e)?function(e,t,i){return e.map(e=>{const s=r(e,t,i),n=t(s);return void 0!==n?n:s})}(e,t,i):Object(s.isObject)(e)&&(Object(s.isHashObject)(e)||i&&i.visitInstances)?function(e,t,i){const s={};return Object.keys(e).forEach(n=>{const o=r(e[n],t,i),a=t(o);s[n]=void 0!==a?a:o}),s}(e,t,i):e}function n(e,t,i){const s=r(e,t,i),n=t(s);return void 0!==n?n:s}},TmNs:function(e,t,i){"use strict";i.r(t);var s=i("KcY8"),r=i("Eyy1"),n=i("jFln"),o=i("8Uy/"),a=i("gAom");class l{constructor(e,t){this.setData(e,t)}setData(e,t){this._data=e,this._commonData=t}draw(e,t,i,s,l,c){if(!this._data.visible)return;let h=this._commonData.coordinate;void 0!==this._commonData.fixedCoordinate&&(h=this._commonData.fixedCoordinate),e.lineWidth=Math.max(1,Math.floor(Object(r.ensureDefined)(this._data.linewidth)*c)),e.lineCap="butt",
|
||
Object(n.setLineStyle)(e,void 0===this._data.linestyle?o.LINESTYLE_DOTTED:this._data.linestyle),e.strokeStyle=this._commonData.textColor,Object(a.drawHorizontalLine)(e,Math.round(h*c),0,Math.ceil(s*c))}height(e){return 0}}i.d(t,"PriceLineAxisView",(function(){return c})),i.d(t,"SeriesPriceLineAxisView",(function(){return h})),i.d(t,"StudyPriceLineAxisView",(function(){return u}));class c extends s.a{constructor(e){super(e||l)}ignoreAlignment(){return!0}_updateRendererData(e,t,i){if(t.visible=!1,e.visible=!1,!this._isVisible())return;const s=this._value();s.noData||(i.background="",i.textColor=this._priceLineColor(s.color),i.coordinate=s.coordinate,i.floatCoordinate=s.floatCoordinate,e.linewidth=this._lineWidth(),e.linestyle=this._lineStyle(),e.backgroundAreaVisible=this._backgroundAreaVisible(),e.backgroundAreaColor=this._backgroundAreaColor(),e.backgroundAreaHeight=this._backgroundAreaHeight(),e.visible=!0)}_lineStyle(){return o.LINESTYLE_DOTTED}_backgroundAreaVisible(){return!1}_backgroundAreaColor(){return""}_backgroundAreaHeight(){return 0}}class h extends c{constructor(e){super(),this._series=e}_value(){return this._series.lastValueData(void 0,!0)}_priceLineColor(e){return this._series.priceLineColor(e)}_lineWidth(){return this._series.properties().priceLineWidth.value()}_isVisible(){const e=this._series.model().properties().scalesProperties.showSeriesLastValue.value();return this._series.properties().showPriceLine.value()&&e}}class u extends c{constructor(e,t){super(),this._study=e,this._plotname=t}_value(){return this._study.lastValueData(this._plotname,!0)}_lineWidth(){return this._study.properties().styles[this._plotname].linewidth.value()}_lineStyle(){return o.LINESTYLE_DOTTED}_priceLineColor(e){return e}_isVisible(){const e=this._study.model().properties().scalesProperties.showStudyLastValue.value();return this._study.properties().styles[this._plotname].trackPrice.value()&&e}}},Tmoa:function(e,t,i){"use strict";i.r(t),i.d(t,"generateColor",(function(){return r})),i.d(t,"alphaToTransparency",(function(){return n})),i.d(t,"transparencyToAlpha",(function(){return o})),i.d(t,"resetTransparency",(function(){return a})),i.d(t,"getLuminance",(function(){return l})),i.d(t,"isHexColor",(function(){return c})),i.d(t,"colorFromBackground",(function(){return h})),i.d(t,"gradientColorAtPercent",(function(){return u})),i.d(t,"isColorDark",(function(){return d})),i.d(t,"rgbaFromInteger",(function(){return p})),i.d(t,"rgbaToInteger",(function(){return _})),i.d(t,"colorToInteger",(function(){return m}));var s=i("eJTA");function r(e,t,i){if(t=t||0,!c(e))return i?Object(s.rgbaToString)(Object(s.rgba)(Object(s.parseRgb)(e),Object(s.normalizeAlphaComponent)(o(t)))):e;const[r,n,a]=Object(s.parseRgb)(e),l=Object(s.normalizeAlphaComponent)(o(t));return Object(s.rgbaToString)([r,n,a,l])}function n(e){return 100*(1-e)}function o(e){if(e<0||e>100)throw new Error("invalid transparency");return 1-e/100}function a(e){
|
||
return"transparent"===e||c(e)?e:Object(s.rgbaToString)(Object(s.rgba)(Object(s.parseRgb)(e),Object(s.normalizeAlphaComponent)(1)))}function l(e){const t=Object(s.parseRgb)(e).map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){return 0===e.indexOf("#")}function h(e){return"black"===Object(s.rgbToBlackWhiteString)(Object(s.parseRgb)(e),150)?"#ffffff":"#000000"}function u(e,t,i){const[r,n,o,a]=Object(s.parseRgba)(e),[l,c,h,u]=Object(s.parseRgba)(t),d=Object(s.rgba)(Math.round(r+i*(l-r)),Math.round(n+i*(c-n)),Math.round(o+i*(h-o)),a+i*(u-a));return Object(s.rgbaToString)(d)}function d(e){return l(a(e))<.5}function p(e){const t=(e=Math.round(e))%256;e-=t;const i=(e/=256)%256;e-=i;const s=(e/=256)%256;e-=s;return`rgba(${t},${i},${s},${(e/=256)/255})`}function _(e){const t=Math.round(255*e[3]);return e[0]+256*e[1]+65536*e[2]+16777216*t}function m(e){const t=Object(s.tryParseRgba)(e);return null===t?0:_(t)}},TohL:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolArrowMark",(function(){return l})),i.d(t,"LineToolArrowMarkLeft",(function(){return c})),i.d(t,"LineToolArrowMarkUp",(function(){return h})),i.d(t,"LineToolArrowMarkRight",(function(){return u})),i.d(t,"LineToolArrowMarkDown",(function(){return d}));var s=i("Ocx9"),r=i("Ss5c"),n=i("tc+8"),o=i.n(n),a=i("j3hX");class l extends r.LineDataSource{constructor(e,t,s){const r=t||l.createProperties(null,s);super(e,r),this._textPaneView=null,i.e("lt-pane-views").then(i.bind(null,"ct+2")).then(({ArrowMarkPaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)})}paneViews(e){const t=super.paneViews();return null!==t&&this._textPaneView&&t.push(this._textPaneView),t}pointsCount(){return 1}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e,t){const i=new s.DefaultProperty(t,e);return l._configureProperties(i),i}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"5sLb")).then(e=>e.ArrowMarkDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("linesColors",new a.LineToolColorsProperty([e.childs().arrowColor])),e.addChild("textsColors",new a.LineToolColorsProperty([e.childs().color])),e.hasChild("text")||e.addChild("text",new o.a("")),e.addExclusion("text")}}l.version=2;class c extends l{constructor(e,t){super(e,t,"linetoolarrowmarkleft")}direction(){return"left"}name(){return"Arrow Mark Left"}textAlignParams(){return{horzAlign:"left",vertAlign:"middle",offsetX:22,offsetY:3}}static createProperties(e){return l.createProperties(e,"linetoolarrowmarkleft")}}class h extends l{constructor(e,t){super(e,t,"linetoolarrowmarkup")}direction(){return"up"}name(){return"Arrow Mark Up"}textAlignParams(){return{horzAlign:"center",vertAlign:"top",offsetX:0,offsetY:20}}static createProperties(e){
|
||
return l.createProperties(e,"linetoolarrowmarkup")}}class u extends l{constructor(e,t){super(e,t,"linetoolarrowmarkright")}direction(){return"right"}name(){return"Arrow Mark Right"}textAlignParams(){return{horzAlign:"right",vertAlign:"middle",offsetX:22,offsetY:3,forceTextAlign:!0}}static createProperties(e){return l.createProperties(e,"linetoolarrowmarkright")}}class d extends l{constructor(e,t){super(e,t,"linetoolarrowmarkdown")}direction(){return"down"}name(){return"Arrow Mark Down"}textAlignParams(){return{horzAlign:"center",vertAlign:"bottom",offsetX:0,offsetY:20}}static createProperties(e){return l.createProperties(e,"linetoolarrowmarkdown")}}},"U0+/":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMetaInfoRepository",(function(){return h}));i("YFKU");var s=i("Eyy1"),r=i("0YCj"),n=i.n(r),o=i("Si3H"),a=i("lCO3"),l=i("txPx");const c=Object(l.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"});class h{constructor(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._isReady=!1,this._metaInfoQueryQueue=[],this._javaMetaInfoQueryQueue=[],this._javaStudiesMetaInfo=[],this._pineMetaInfoCache=[],this._studiesMigrations=[],this._gateway=e}requestMetaInfo(){this._requestStarted();const e=this._makeNextRequestId();return c.logNormal("Requesting metainfo #"+e),new Promise(t=>{c.logNormal("Requesting studies metadata #"+e),this._gateway.requestMetadata(e,i=>{c.logNormal(`Requesting studies metadata #${e} finished`);const s=i.params[1].metainfo.slice();this._processLibraryMetaInfo(s),this._requestFinished(),t()})})}findById(e){if(!this._isReady)return this._enqueueMetaInfoQuery(e);const t=this._findStudyMetaInfo(e);return null!==t?Promise.resolve(t):"pine"===e.type?this._compilePine(e):Promise.reject(`unexpected study id=${e.studyId} with type=${e.type}`)}findByIdSync(e){return this._findStudyMetaInfo(e)}isReady(){return this._isReady}findAllJavaStudies(){return this._isReady?Promise.resolve(this._javaStudiesMetaInfo):this._enqueueJavaMetaInfoQuery()}getInternalMetaInfoArray(){return this._javaStudiesMetaInfo}getMigrations(){return this._studiesMigrations}addPineMetaInfo(e){return d(this._pineMetaInfoCache,e)}_processMigrations(e){throw new Error("not implemented")}_processSiteMetaInfo(e,t){throw new Error("not implemented")}_processLibraryMetaInfo(e){for(const t of e)u(t),d(this._javaStudiesMetaInfo,t);this._javaStudiesMetaInfo=this._javaStudiesMetaInfo.sort((e,t)=>{const i=e.description_localized||e.description,s=t.description_localized||t.description;return i>s?1:i<s?-1:0}),n.a.overrideDefaults(this._javaStudiesMetaInfo)}_requestStarted(){this._isReady=!1,this._javaStudiesMetaInfo=[],this._pineMetaInfoCache=[],this._studiesMigrations=[],this._rawStudiesMetaInfo=[]}_requestFinished(){this._isReady=!0,this._processPendingMetaInfoQueries(),this._processPendingFullMetaInfoQueries()}_enqueueMetaInfoQuery(e){return new Promise(t=>{this._metaInfoQueryQueue.push({studyDescriptor:e,resolver:t})})}_enqueueJavaMetaInfoQuery(){return new Promise(e=>{this._javaMetaInfoQueryQueue.push({resolver:e})})}
|
||
_processPendingMetaInfoQueries(){for(;this._metaInfoQueryQueue.length;){const e=this._metaInfoQueryQueue.shift();this.findById(e.studyDescriptor).then(e.resolver)}}_processPendingFullMetaInfoQueries(){for(;this._javaMetaInfoQueryQueue.length;){this._javaMetaInfoQueryQueue.shift().resolver(this._javaStudiesMetaInfo)}}_findStudyMetaInfo(e){return"java"===e.type?this._javaStudiesMetaInfo.find(t=>t.id===e.studyId)||null:this._pineMetaInfoCache.find(t=>t.scriptIdPart===e.pineId&&(void 0===e.pineVersion||Object(s.ensureDefined)(t.pine).version===e.pineVersion))||null}_makeNextRequestId(){return"metadata_"+this._nextRequestNumber++}_compilePine(e){throw new Error("unsupported")}}function u(e){e.description_localized=window.t(e.description,{context:"study"})}function d(e,t){const i=new n.a(t);Object(o.migrateMetaInfoAndPropState)(i);let s=!0;const r=e.findIndex(e=>e.id===i.id);if(-1===r)e.push(i);else{const t=e[r],n=void 0!==t.pine?a.Version.parse(t.pine.version):null,o=void 0!==i.pine?a.Version.parse(i.pine.version):null;null===o||null===n||o.isGreaterOrEqual(n)?(t.removeDefaults(),e[r]=i):s=!1}return s&&i.createDefaults(),i}},UAFa:function(e,t,i){"use strict";i.r(t);var s=i("i6cO"),r=i("23IT"),n=i("Eyy1");const o=new Map([[s.ColorerType.Main,"color"],[s.ColorerType.Text,"textColor"],[s.ColorerType.Border,"borderColor"],[s.ColorerType.Wick,"wickColor"],[s.ColorerType.Up,"colorup"],[s.ColorerType.Down,"colordown"]]);class a{constructor(e){this._plotStyle=e}getPlotPointStyle(e,t){const i=t?Object(s.clearStyle)(t):Object(s.createEmptyStyle)();return o.forEach((e,t)=>{this._plotStyle[e]&&(i.colors[t]=this._plotStyle[e].value())}),i.lineWidth=this._plotStyle.linewidth?this._plotStyle.linewidth.value():void 0,i.lineStyle=this._plotStyle.linestyle?this._plotStyle.linestyle.value():void 0,i}isColorDefined(){return!0}singleColor(){return!0}getDefaultPlotPointStyle(){return null}}class l{constructor(e,t,i,s){this._palettes=new Map,this._metaInfo=e,this._properties=t,this._indexes=s,this._plotStyle=t.styles[i];const r=Object(n.ensureDefined)(this._metaInfo.palettes);s.forEach((t,i)=>{const s=e.plots[t];if(s&&"palette"in s){const e=r[s.palette],t=this._properties.palettes[s.palette];e&&t&&this._palettes.set(i,{palette:e,props:t})}})}getPlotPointStyle(e,t){const i=t?Object(s.clearStyle)(t):Object(s.createEmptyStyle)();if(this._palettes.has(s.ColorerType.Main)){const t=Object(n.ensureDefined)(this._indexes.get(s.ColorerType.Main)),r=e[t+1];if(null!=r){const e=Object(n.ensureDefined)(this._palettes.get(s.ColorerType.Main)),t=e.palette,o=e.props,a=Object(n.ensureDefined)(t.valToIndex?t.valToIndex[r]:r),l=o.colors[a];i.lineWidth=l.width.value(),i.lineStyle=l.style.value()}}return Object.keys(s.ColorerType).forEach(t=>{const s=parseInt(t);if(this._palettes.has(s)){const t=Object(n.ensureDefined)(this._indexes.get(s)),r=e[t+1];if(null!=r){const e=Object(n.ensureDefined)(this._palettes.get(s)),t=Object(n.ensureDefined)(e.palette.valToIndex?e.palette.valToIndex[r]:r),o=e.props.colors[t];i.colors[s]=o.color.value()}else i.colors[s]="transparent"
|
||
}else if(this._plotStyle){const e=o.get(s);void 0!==e&&this._plotStyle[e]&&(i.colors[s]=this._plotStyle[e].value())}}),i}getDefaultPlotPointStyle(){const e=Object(n.ensureDefined)(this._palettes.get(s.ColorerType.Main)).props.colors[0];if(null!=e){return{colors:[e.color.value(),void 0,void 0,void 0,void 0,void 0,void 0],lineWidth:e.width.value()}}return null}isColorDefined(){return!!this._palettes.size}singleColor(){return!1}}var c=i("Tmoa");class h{constructor(e){this._indexes=e}getPlotPointStyle(e,t){const i=t?Object(s.clearStyle)(t):Object(s.createEmptyStyle)();return this._indexes.forEach((t,s)=>{const r=e[t+1];if(null!=r){const e=Object(c.rgbaFromInteger)(r);i.colors[s]=e}else i.colors[s]="transparent"}),i}isColorDefined(){return!0}singleColor(){return!1}getDefaultPlotPointStyle(){return null}}i.d(t,"createStudyPlotColorProvider",(function(){return d}));const u=new Map([[s.ColorerType.Main,function(e,t){const i=Object(r.isColorerPlot)(t)||Object(r.isOhlcColorerPlot)(t);return"target"in t&&t.target===e&&i}],[s.ColorerType.Text,function(e,t){const i=Object(r.isTextColorerPlot)(t);return"target"in t&&t.target===e&&i}],[s.ColorerType.Background,function(e,t){return Object(r.isBgColorerPlot)(t)&&t.id===e}],[s.ColorerType.Border,function(e,t){const i=Object(r.isCandleBorderColorerPlot)(t);return"target"in t&&t.target===e&&i}],[s.ColorerType.Wick,function(e,t){const i=Object(r.isCandleWickColorerPlot)(t);return"target"in t&&t.target===e&&i}],[s.ColorerType.Up,function(e,t){const i=Object(r.isUpColorerPlot)(t);return"target"in t&&t.target===e&&i}],[s.ColorerType.Down,function(e,t){const i=Object(r.isDownColorerPlot)(t);return"target"in t&&t.target===e&&i}]]);function d(e,t,i){const{colorers:s}=function(e,t){const i=e.plots,s=i.findIndex(e=>e.id===t),r=new Map;return i.forEach((e,i)=>{u.forEach((s,n)=>{s(t,e)&&r.set(n,i)})}),{plotIndex:-1===s?null:s,colorers:r}}(e,i);if(s.size)return e.isRGB?new h(s):new l(e,t,i,s);{const e=t.ohlcPlots;if(e&&e[i])return new a(e[i]);const s=t.styles[i];return new a(s)}}},UCMi:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"UcQu",7)).then(({DateAndPriceRangePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Date and Price Range"}static createProperties(e){var t=new r("linetooldateandpricerange",e);return n._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Ax76"))).GeneralDatePriceRangeDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e)}}t.LineToolDateAndPriceRange=n},UCjq:function(e,t,i){"use strict";i.r(t)
|
||
;var s=i("YFKU"),r=i("Eyy1"),n=i("aO4+"),o=i("qFKp"),a=i("VaSN"),l=i("FQhm"),c=i("ogJP"),h=i("FIi8"),u=i("VdBB"),d=i("vTIA"),p=i("KnF9"),_=i("3ClC"),m=i("GxN8"),f=i("CW80"),g=i("mMWL"),v=i("bOGh"),b=i("fTGZ"),S=i("ikwP"),y=i("gAom"),w=i("mE5r"),C=i("1IXQ");function P(e,t){return e.position-t.position}function x(e,t,i){const s=(e.position-t.position)/(e.time-t.time);return Math.sign(s)*Math.min(Math.abs(s),i)}class T{constructor(e,t,i,s){this._position1=null,this._position2=null,this._position3=null,this._position4=null,this._animationStartPosition=null,this._durationMsecs=0,this._speedPxPerMsec=0,this._terminated=!1,this._minSpeed=e,this._maxSpeed=t,this._dumpingCoeff=i,this._minMove=s}addPosition(e,t){if(null!==this._position1){if(this._position1.time===t)return void(this._position1.position=e);if(Math.abs(this._position1.position-e)<this._minMove)return}this._position4=this._position3,this._position3=this._position2,this._position2=this._position1,this._position1={time:t,position:e}}start(e,t){if(null===this._position1||null===this._position2)return;if(t-this._position1.time>50)return;let i=0;const s=x(this._position1,this._position2,this._maxSpeed),r=P(this._position1,this._position2),n=[s],o=[r];if(i+=r,null!==this._position3){const e=x(this._position2,this._position3,this._maxSpeed);if(Math.sign(e)===Math.sign(s)){const t=P(this._position2,this._position3);if(n.push(e),o.push(t),i+=t,null!==this._position4){const e=x(this._position3,this._position4,this._maxSpeed);if(Math.sign(e)===Math.sign(s)){const t=P(this._position3,this._position4);n.push(e),o.push(t),i+=t}}}}let a=0;for(let l=0;l<n.length;++l)a+=o[l]/i*n[l];Math.abs(a)<this._minSpeed||(this._animationStartPosition={position:e,time:t},this._speedPxPerMsec=a,this._durationMsecs=function(e,t){const i=Math.log(t);return Math.log(1*i/-e)/i}(Math.abs(a),this._dumpingCoeff))}getPosition(e){const t=Object(r.ensureNotNull)(this._animationStartPosition),i=e-t.time;return t.position+this._speedPxPerMsec*(Math.pow(this._dumpingCoeff,i)-1)/Math.log(this._dumpingCoeff)}finished(e){return null===this._animationStartPosition||this._progressDuration(e)===this._durationMsecs}terminated(){return this._terminated}terminate(){this._terminated=!0}_progressDuration(e){const t=e-Object(r.ensureNotNull)(this._animationStartPosition).time;return Math.min(t,this._durationMsecs)}}var M=i("hY0g"),I=i.n(M),L=i("1AAW"),O=i("XcdR"),A=i("7MWe"),E=i("HZKX"),k=i("5VQP"),D=i("7ktv"),V=i("Fixu"),B=i("e92V"),R=i("QloM"),N=i("Kxc7"),j=i("//lt"),F=i("JWMC"),W=i("7KDR"),H=i("ZBiT"),z=i("zL3Q"),U=i("/3z9"),G=i("H0vP"),q=i("m/3z");i.d(t,"PaneWidgetBase",(function(){return ne}));const Y=parseInt(H["css-value-pane-controls-padding-left"]),K=parseInt(H["css-value-pane-controls-padding-right"]),J=["AlertLabel"];function Z(e){return!(null===e||!Object(_.isStudy)(e))&&"Volume@tv-basicstudies"===e.metaInfo().id}function X(e,t,i){e.drawBackground&&e.drawBackground(t,i)}function $(e,t,i){e.draw(t,i)}function Q(e,t){return e.paneViews(t)}function ee(e,t){return e.labelPaneViews(t)}function te(e,t){
|
||
const i=e.strategyOrdersPaneView();return null===i?null:[i]}const ie={contextMenuEnabled:!0,contextMenu:E.defaultContextMenuOptions,priceScaleContextMenuEnabled:!0,legendWidgetEnabled:!0,controlsEnabled:!0,propertyPagesEnabled:!0,sourceSelectionEnabled:!0,countdownEnabled:!0},se=new Map([[u.AreaName.Text,"Text"],[u.AreaName.Style,"Style"]]),re=!N.enabled("display_legend_on_all_charts");class ne{constructor(e,t,i,s){this._legendWidget=null,this._paneControls=null,this._isDestroyed=!1,this._trackCrosshairOnlyAfterLongTap=Object(a.lastEventIsTouch)(),this._startTrackPoint=null,this._exitTrackingModeOnNextTry=!1,this._startMoveLineToolParams=null,this._startChangeLineToolParams=null,this._preventSourceChange=!1,this._clonningAtMoveLineTools=null,this._startCloningPoint=null,this._size=new S.Size(0,0),this._themedTopColor=null,this._themedBottomColor=null,this._initCrossHairPosition=null,this._firstZoomPoint=null,this._editDialog=null,this._processing=!1,this._touchMove=!1,this._startTouchPoint=null,this._isSelecting=!1,this._prevHoveredHittest=null,this._contextMenuX=0,this._contextMenuY=0,this._startScrollingPos=null,this._isScrolling=!1,this._scrollPriceScale=null,this._scrollXAnimation=null,this._scrollYAnimation=null,this._prevPinchScale=1,this._pinching=!1,this._wasPinched=!1,this._longTap=!1,this._contextMenuOpenedOnLastTap=!1,this._paneControlsResizeObserver=null,this._hideNotMainSourcesInLegendSpawn=null,this._lastClickedSource=null,this._customLegendWidgetsFactoryMap=new Map,this._prevMoveEventPosition=null,this._onMagnetStateChangedListener=this._onMagnetStateChanged.bind(this),this._onShiftKeyStateChangedListener=this._onShiftKeyStateChanged.bind(this),this._currentCursorClassName="",this._lastFinishedToolId=null,this._needResetMeasureLater=!1,this._canvasConfiguredHandler=()=>this._state&&this._chartModel().lightUpdate(),this._topCanvasConfiguredHandler=()=>this._state&&this._chartModel().lightUpdate(),this._chart=e,this._state=t,this._options=Object(c.merge)(Object(c.clone)(ie),i),this._paneWidgetsSharedState=s,this._state&&(this._state.onDestroyed().subscribe(this,this._onStateDestroyed,!0),this._state.dataSourcesCollectionChanged().subscribe(this,this._onDataSourcesCollectionChanged));const r={contextMenuEnabled:this._options.priceScaleContextMenuEnabled,pressedMouseMoveScale:this._options.handleScale.axisPressedMouseMove.price,currencyConversionEnabled:this._options.currencyConversionEnabled,unitConversionEnabled:this._options.unitConversionEnabled,countdownEnabled:this._options.countdownEnabled,croppedTickMarks:this._options.croppedTickMarks};void 0!==this._options.priceScaleContextMenu&&(r.contextMenu=this._options.priceScaleContextMenu);const n=(e,t,i,s,n)=>new C.PriceAxisWidget(this,this._chartUndoModel(),i,t,e,r,s,n),o=e.properties().childs().scalesProperties,l=this._chartModel().rendererOptionsProvider(),h={backgroundBasedTheme:e.backgroundBasedTheme(),rendererOptionsProvider:l,getBackgroundTopColor:()=>this._chartModel().backgroundTopColor().value(),
|
||
getBackgroundBottomColor:()=>this._chartModel().backgroundColor().value()},u={showLabels:!1};this._lhsPriceAxisesContainer=new w.a(o,"left",n,h,u),this._rhsPriceAxisesContainer=new w.a(o,"right",n,h,u),this._paneCell=document.createElement("td"),this._paneCell.classList.add("chart-markup-table","pane"),this._div=document.createElement("div"),this._div.classList.add("chart-gui-wrapper"),this._paneCell.appendChild(this._div),this._canvasBinding=Object(S.createBoundCanvas)(this._div,new S.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);const d=this._canvasBinding.canvas;d.style.position="absolute",d.style.left="0",d.style.top="0",this._topCanvasBinding=Object(S.createBoundCanvas)(this._div,new S.Size(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);const p=this._topCanvasBinding.canvas;p.style.position="absolute",p.style.left="0",p.style.top="0",this._rowElement=document.createElement("tr"),this._rowElement.appendChild(this._lhsPriceAxisesContainer.getElement()),this._rowElement.appendChild(this._paneCell),this._rowElement.appendChild(this._rhsPriceAxisesContainer.getElement()),this._options.legendWidgetEnabled&&(this._options.customLegendWidgetFactories&&(this._customLegendWidgetsFactoryMap=this._options.customLegendWidgetFactories),this._loadAndCreateLegendWidget()),this._state&&!this._chart.readOnly()&&this._options.controlsEnabled&&this._loadAndCreatePaneControlsWidget(),Object(z.a)().subscribe(this._onMagnetStateChangedListener),Object(q.c)().subscribe(this._onShiftKeyStateChangedListener)}destroy(){this._chart.onPaneWidgetDestroyed(this),this._customLegendWidgetsFactoryMap.clear(),this._topCanvasBinding.unsubscribeCanvasConfigured(this._topCanvasConfiguredHandler),this._topCanvasBinding.destroy(),this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),null!==this._hideNotMainSourcesInLegendSpawn&&this._hideNotMainSourcesInLegendSpawn.destroy(),this._legendWidget&&(this._legendWidget.destroy(),this._legendWidget=null),null!==this._paneControlsResizeObserver&&this._paneControlsResizeObserver.disconnect(),null!==this._paneControls&&(this._paneControls.destroy(),this._paneControls=null),this._lhsPriceAxisesContainer.destroy(),this._rhsPriceAxisesContainer.destroy(),this.hasState()&&(this.state().onDestroyed().unsubscribeAll(this),this.state().dataSourcesCollectionChanged().unsubscribeAll(this)),Object(z.a)().unsubscribe(this._onMagnetStateChangedListener),Object(q.c)().unsubscribe(this._onShiftKeyStateChangedListener),this._paneWidgetsSharedState.onPaneDestroyed(this)}size(){return this._size}setSize(e){Object(r.assert)(e.w>=0&&e.h>=0,"Try to set invalid size to PaneWidget "+JSON.stringify(e)),this._size.equals(e)||(this._size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._topCanvasBinding.resizeCanvas({width:e.w,height:e.h}),this._paneCell.style.width=e.w+"px",this._paneCell.style.height=e.h+"px",this._div.style.width=e.w+"px",this._div.style.height=e.h+"px",
|
||
this._rowElement.classList.toggle("js-hidden",0===e.h),null!==this._legendWidget&&this._legendWidget.updateWidgetModeBySize(e),null!==this._paneControls&&this._paneControls.updateWidgetModeByWidth(e.w))}width(){return this._size.w}height(){return this._size.h}backgroundColor(){return this._chartModel().backgroundColor().value()}processDoubleClickOnSource(e,t){e.id()!==this._lastFinishedToolId&&this._showEditDialogForSource(e,t)}setCursorForTool(e,t,i){const s=g.tool.value();if(t&&t.control()&&e)return void this._setCursorClassName("pointer");if(void 0!==i){switch(i){case j.PaneCursorType.VerticalResize:this._setCursorClassName("ns-resize");break;case j.PaneCursorType.HorizontalResize:this._setCursorClassName("ew-resize");break;case j.PaneCursorType.DiagonalNeSwResize:this._setCursorClassName("nesw-resize");break;case j.PaneCursorType.DiagonalNwSeResize:this._setCursorClassName("nwse-resize");break;case j.PaneCursorType.Default:this._setCursorClassName("default");break;case j.PaneCursorType.Pointer:this._setCursorClassName("pointer");break;case j.PaneCursorType.Grabbing:this._setCursorClassName("grabbing")}return}if(Object(g.toolIsCursor)(s)){if(null!==this._paneWidgetsSharedState.draggingSource()||this._isScrolling||this._chartUndoModel()&&this._chartUndoModel().model().sourcesBeingMoved().length)return void this._setCursorClassName("grabbing");if(e&&this._options.sourceSelectionEnabled)return void this._setCursorClassName("pointer")}if("eraser"===s)return void this._setCursorClassName("eraser");if("zoom"===s)return void this._setCursorClassName("zoom-in");const r=g.cursorTool.value();"dot"!==r?"arrow"!==r?this._setCursorClassName(""):this._setCursorClassName("default"):this._setCursorClassName("dot")}showContextMenuForSelection(e){const t=this._chartUndoModel().selection();if(t.isEmpty())return;const i=t.dataSources().filter(e=>e.hasContextMenu());this.showContextMenuForSources(i,e)}async showContextMenuForSources(e,t,i){if(!e.length)return Promise.resolve(null);const s=e[0],r=Object(c.merge)(Object(c.clone)(this._options.contextMenu),i||{}),n=new E.ActionsProvider(this._chart,r);if(s===this._chartUndoModel().crossHairSource())return s.handleContextMenuEvent(t),Promise.resolve(null);{const i=await n.contextMenuActionsForSources(e);return 0===i.length?Promise.resolve(null):k.ContextMenuManager.createMenu(i).then(e=>(e.show(t),e))}}leftPriceAxisesContainer(){return this._lhsPriceAxisesContainer}rightPriceAxisesContainer(){return this._rhsPriceAxisesContainer}setPriceAxisSizes(e,t,i){this._priceAxisesContainer(e).setSizes(t,i)}state(){return Object(r.ensureNotNull)(this._state)}hasState(){return null!==this._state}setState(e){this._state!==e&&(this.hasState()&&(this.state().onDestroyed().unsubscribeAll(this),this.state().dataSourcesCollectionChanged().unsubscribeAll(this)),this._state=e,this.hasState()&&(this.state().onDestroyed().subscribe(this,this._onStateDestroyed,!0),this.state().dataSourcesCollectionChanged().subscribe(this,this._onDataSourcesCollectionChanged),this.updatePriceAxisWidgets()))}
|
||
getScreenshotData(e){const t=[],i=[];let s,r=[];const n=this.state().sourcesByGroup().allExceptSpecialSources().slice().reverse(),o=this._chart.properties().childs().paneProperties.childs().legendProperties.childs();if(o.showLegend.value()||(null==e?void 0:e.showCollapsedLegend))for(const a of n){const n=a.statusView();Object(_.isStudy)(a)?a.properties().visible.value()&&n&&o.showStudyTitles.value()&&(t.push(a.statusProvider((null==e?void 0:e.status)||{}).text()),i.push(a.valuesProvider().getValues(null))):a===this._chartModel().mainSeries()&&n&&o.showSeriesTitle.value()&&(s=a.statusProvider((null==e?void 0:e.status)||{}).text(),r=a.valuesProvider().getValues(null))}return{type:"pane",leftAxis:this._lhsPriceAxisesContainer.getScreenshotData(),rightAxis:this._rhsPriceAxisesContainer.getScreenshotData(),content:this._canvasBinding.canvas.toDataURL(),canvas:this._canvasBinding.canvas,contentWidth:this._size.w,contentHeight:this._size.h,studies:t,studiesValues:i,containsMainSeries:this.containsMainSeries(),mainSeriesText:s,mainSeriesValues:r}}hardResetCanvas(){this._size.equals(new S.Size(0,0))||(Object(S.hardResizeCanvas)(this._canvasBinding,this._size),Object(S.hardResizeCanvas)(this._topCanvasBinding,this._size),this._lhsPriceAxisesContainer.hardResetCanvas(),this._rhsPriceAxisesContainer.hardResetCanvas())}updatePriceAxisWidgets(){if(!this.hasState())return;const e=this._chartModel(),t=e.paneForSource(e.mainSeries());if(!t)return;const i=e.priceScaleSlotsCount(),s=this.state(),r=s.visibleLeftPriceScales(),n=s.visibleRightPriceScales();this._lhsPriceAxisesContainer.setScales(r,i.left,t.leftPriceScales().length,i.left+i.right),this._rhsPriceAxisesContainer.setScales(n,i.right,t.rightPriceScales().length,i.left+i.right)}update(){this.hasState()&&(this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls())}updateStatusWidget(e=G.InvalidationLevel.None){this.hasState()&&null!==this._legendWidget&&(e===G.InvalidationLevel.Full?this._legendWidget.updateLayout():this._legendWidget.update())}updateControls(){this.hasState()&&null!==this._paneControls&&this._paneControls.update()}updateThemedColors(e,t){this._themedTopColor=e,this._themedBottomColor=t,this._updateByThemedColors()}statusWidget(){return this._legendWidget}getElement(){return this._rowElement}canvasElement(){return this._canvasBinding.canvas}hasCanvas(e){return this._canvasBinding.canvas===e||this._topCanvasBinding.canvas===e}pinchStartEvent(){null===this._paneWidgetsSharedState.scrollingPane()&&null===this._paneWidgetsSharedState.pinchingPane()&&(this._onTouchEvent(),this._options.handleScale.pinch&&(this._terminateActiveAnimations(),this._prevPinchScale=1,this._pinching=!0,this._wasPinched=!0,this._paneWidgetsSharedState.setPinchingPane(this)))}pinchEvent(e,t){if(null!==this._paneWidgetsSharedState.scrollingPane()||this._paneWidgetsSharedState.pinchingPane()!==this)return;if(this._onTouchEvent(),!this._options.handleScale.pinch)return
|
||
;const i=10*(t-this._prevPinchScale);this._prevPinchScale=t,this._chartModel().zoomTime(e.x,i,!0),this._prevPinchScale=t}pinchEndEvent(){null===this._paneWidgetsSharedState.scrollingPane()&&this._paneWidgetsSharedState.pinchingPane()===this&&(this._onTouchEvent(),this._pinching=!1,this._paneWidgetsSharedState.setPinchingPane(null))}mouseClickEvent(e){this._onMouseEvent(),this._mouseClickOrTapEvent(e)}tapEvent(e){this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._mouseClickOrTapEvent(e))}mouseDownEvent(e){this._onMouseEvent(),this._mouseDownOrTouchStartEvent(e)}touchStartEvent(e){this._paneWidgetsSharedState.startTouch(this),this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this.hasState()&&(this._chart.setActivePaneWidget(this),this._mouseDownOrTouchStartEvent(e),this._mouseOrTouchMoveEvent(e)))}mouseUpEvent(e){this._onMouseEvent(),this._mouseUpOrTouchEndEvent(e)}touchEndEvent(e){this._paneWidgetsSharedState.endTouch(this),this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._mouseOrTouchLeaveEvent(e),this._mouseUpOrTouchEndEvent(e))}mouseMoveEvent(e){this._onMouseEvent(),this._mouseOrTouchMoveEvent(e)}pressedMouseMoveEvent(e){this._onMouseEvent(),this._pressedMouseOrTouchMoveEvent(e)}touchMoveEvent(e){this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._pressedMouseOrTouchMoveEvent(e))}mouseLeaveEvent(e){this._onMouseEvent(),this._mouseOrTouchLeaveEvent(e)}mouseDoubleClickEvent(e){this._onMouseEvent(),this._mouseDoubleClickOrDoubleTapEvent(e)}wheelClickEvent(e){var t,i;if(this._chart.readOnly())return;const s=this._dataSourceAtPoint(e.localX,e.localY);if(null===s||s.isCustom||null===s.source)return;if(((null===(t=s.hittest)||void 0===t?void 0:t.result())||0)<=u.HitTestResult.MOVEPOINT_BACKGROUND)return;const n=new p.EnvironmentState(e),o=null===(i=s.hittest)||void 0===i?void 0:i.eraseMarker();if(n.control()&&void 0!==o&&s.source.processErase)return void s.source.processErase(this._chartUndoModel(),o);const a=this._chartUndoModel();a.selection().isSelected(s.source)||a.selectionMacro(e=>{e.clearSelection(),e.addSourceToSelection(Object(r.ensureNotNull)(s.source))}),this._chart.removeSelectedSources()}doubleTapEvent(e){this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._mouseDoubleClickOrDoubleTapEvent(e))}longTapEvent(e){this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._longTap=!0,null===this._startTrackPoint&&this._trackingModeShouldBeActive()&&this.startTrackingMode(new n.Point(e.localX,e.localY),new n.Point(e.localX,e.localY),new p.EnvironmentState(e)))}mouseEnterEvent(e){this._onMouseEvent(),this.hasState()&&(this._chart.setActivePaneWidget(this),this._setCursorPosition(e.localX,e.localY,new p.EnvironmentState(e)))}contextMenuEvent(e){this._onMouseEvent(),this._contextMenuEvent(e)}touchContextMenuEvent(e){this._preventTouchEventsExceptPinch()||(this._onTouchEvent(),this._contextMenuEvent(e))}mouseDownOutsideEvent(){this._processOutsideClick({hittest:null,isCustom:!1,renderer:null,source:null})}cancelZoom(){
|
||
this._chartModel().crossHairSource().clearSelection(),this._firstZoomPoint=null,this._preventCrossHairMove()&&this._clearCursorPosition()}startTrackingMode(e,t,i){this._startChangeLineToolParams=null,this._startMoveLineToolParams=null,this._chartUndoModel().selectionMacro(e=>e.clearSelection()),this._startTrackPoint=e,this._exitTrackingModeOnNextTry=!1,this._setCursorPosition(t.x,t.y,i),this._initCrossHairPosition=this._chartModel().crossHairSource().currentPoint()}setDragToAnotherPaneCursor(){this._setCursorClassName("grabbing")}cloneLineTools(e,t){return this._chartUndoModel().cloneLineTools(e,t)}exitTrackingMode(){null!==this._state&&null!==this._startTrackPoint&&(this._exitTrackingModeOnNextTry=!0,this._tryExitTrackingMode())}trackingModeEnabled(){return null!==this._state&&null!==this._startTrackPoint}addCustomWidgetToLegend(e,t){this._options.legendWidgetEnabled&&(this._customLegendWidgetsFactoryMap.set(e,t),null!==this._legendWidget&&this._legendWidget.addCustomWidgetToLegend(e,t))}containsMainSeries(){return!!this.hasState()&&this.state().containsMainSeries()}paint(e,t){if(!this._chartUndoModel()||!this.hasState())return;this._state&&(e.priceScaleSideMaxLevel("left")>G.InvalidationLevel.Cursor||e.priceScaleSideMaxLevel("right")>G.InvalidationLevel.Cursor)&&(this._recalculatePriceScales(),this._chartModel().updateCrosshairPositionByOriginCoords()),this._lhsPriceAxisesContainer.paint(e.getterForPriceScaleInvalidationLevelBySide("left")),this._rhsPriceAxisesContainer.paint(e.getterForPriceScaleInvalidationLevelBySide("right"));const i=e.fullInvalidation();if(i!==G.InvalidationLevel.None){if(i>G.InvalidationLevel.Cursor){const e=Object(r.ensureNotNull)(this._canvasBinding.canvas.getContext("2d"));e.setTransform(1,0,0,1,0,0);const i=this._canvasRenderParams();this._drawBackground(e,i),this._state&&(this._drawSources(e,i),this._drawBarsMarks(e,i,t))}if(this._state){const e=Object(r.ensureNotNull)(this._topCanvasBinding.canvas.getContext("2d"));e.setTransform(1,0,0,1,0,0);const t=this._topCanvasRenderParams();e.clearRect(0,0,Math.ceil(this._size.w*t.pixelRatio),Math.ceil(this._size.h*t.pixelRatio)),this._drawCrossHair(e,t),this._drawActiveLineTools(e,t)}}}pasteImageAsLineTool(e){var t;const i=this._chartModel().timeScale(),s=i.width(),n=Object(r.ensureNotNull)(this._state).height(),o=Object(r.ensureNotNull)(this._state).defaultPriceScale(),a=Object(r.ensureNotNull)(Object(r.ensureNotNull)(o.mainSource()).firstValue()),l={price:o.coordinateToPrice(n/2,a),index:i.coordinateToIndex(s/2)},c=Object(f.createLineToolProperties)("LineToolImage");null===(t=c.child("url"))||void 0===t||t.setValue(e),this._chartUndoModel().createLineTool(Object(r.ensureNotNull)(this._state),l,"LineToolImage",c)}cancelCreatingLineTool(){const e=this._chartUndoModel(),t=this._chartUndoModel().lineBeingCreated();if(t)if(t.pointsCount()<=0){const i=t.points();if(i.length>2){const s=i[i.length-2];e.continueCreatingLine(s),this._finishTool(t)}else e.cancelCreatingLine()}else e.cancelCreatingLine();null!==this._firstZoomPoint&&this.cancelZoom(),
|
||
this.setCursorForTool()}cancelMeasuring(){this._chartUndoModel().crossHairSource().clearMeasure(),Object(g.resetToCursor)(),this.setCursorForTool()}_topCanvasRenderParams(){return{pixelRatio:this._topCanvasBinding.pixelRatio,physicalWidth:this._topCanvasBinding.canvas.width,physicalHeight:this._topCanvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}}_canvasRenderParams(){return{pixelRatio:this._canvasBinding.pixelRatio,physicalWidth:this._canvasBinding.canvas.width,physicalHeight:this._canvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}}_tryExitTrackingMode(e){this._exitTrackingModeOnNextTry&&(this._startTrackPoint=null,e||this._clearCursorPosition())}_tryStartMeasure(e,t,i,s,r){return!(!Object(g.toolIsMeasure)(g.tool.value())||t.startMeasurePoint())&&(e.isTouch||this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,i),s=this._chartModel().magnet().align(s,r,this.state()),t.startMeasuring({price:s,index:r},this.state()),!0)}_tryFinishMeasure(e,t){if(t.startMeasurePoint()&&!t.endMeasurePoint()){let i=t.price;const s=t.index;return i=this._chartModel().magnet().align(i,s,this.state()),t.finishMeasure({price:i,index:s}),e.isTouch?Object(g.resetToCursor)():this._needResetMeasureLater=!0,this._preventCrossHairMove()&&this._clearCursorPosition(),!0}return!1}_tryStartZoom(e,t,i,s){const r=this._chart.model().model().zoomEnabled();if("zoom"===g.tool.value()&&r){const r=this._chartUndoModel(),n=r.timeScale().indexToCoordinate(i)-.5*r.timeScale().barSpacing();return this._firstZoomPoint={price:t,index:i,x:n,y:e.localY},this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,s),this._chartModel().crossHairSource().startSelection(this.state()),!0}return!1}_finishZoom(e){const t=this.state(),i=t.defaultPriceScale(),s=Object(r.ensureNotNull)(t.mainDataSource()).firstValue(),n=i.coordinateToPrice(e.localY,Object(r.ensureNotNull)(s)),o=this._chartUndoModel(),a=Math.round(o.timeScale().coordinateToIndex(e.localX)),l=Object(r.ensureNotNull)(this._firstZoomPoint);a!==l.index&&o.zoomToViewport(l.index,a,l.price,n,t),this._chartModel().crossHairSource().clearSelection(),this._firstZoomPoint=null,Object(g.resetToCursor)(),this._preventCrossHairMove()&&this._clearCursorPosition()}_tryFinishZoom(e){return null!==this._firstZoomPoint&&(this._finishZoom(e),!0)}_tryHandleEraserMouseDown(e,t){if(e.source&&"eraser"===g.tool.value()&&!e.isCustom&&(!(i=e.source)||!i.customization||!i.customization.disableErasing)){const i=this._chartUndoModel();if(null!==e.hittest&&(Object(f.isLineTool)(e.source)||Object(_.isStudy)(e.source))){const s=e.hittest.eraseMarker();return t.control()&&void 0!==s&&e.source.processErase?e.source.processErase(i,s):i.removeSource(e.source,!1),!0}}var i;return!1}_tryStartChangingLineTool(e,t,i,s){var n,o;if(e.isTouch&&null!==this._startTrackPoint)return!1;if((!e.isTouch||!this._preventSourceChange)&&t.hittest&&Object(f.isLineTool)(t.source)&&t.hittest.result()===u.HitTestResult.CHANGEPOINT){
|
||
const a=this._chartUndoModel(),l=Object(r.ensure)(null===(n=this.state().mainDataSource())||void 0===n?void 0:n.firstValue()),c=Object(r.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,l);a.selectionMacro(e=>{e.clearSelection(),e.addSourceToSelection(t.source)});const h=a.model().magnet().align(c,s,this.state()),u=null===(o=t.hittest.data())||void 0===o?void 0:o.pointIndex;return this._startChangeLineToolParams={source:t.source,startPoint:{index:s,price:h},screenPoint:{x:e.localX,y:e.localY},pointIndex:u,envState:i},!0}return this._startChangeLineToolParams=null,!1}_tryStartCloning(e,t,i,s){if(i.control()){const t=this._chartUndoModel().selection().dataSources().filter(e=>e.cloneable());if(s&&s.cloneable()&&t.push(s),t.length>0)return this._clonningAtMoveLineTools=t.map(e=>e.id()),this._startCloningPoint=new n.Point(e.localX,e.localY),!0}return!1}_tryFinishClonning(e,t){const i=this._chartUndoModel(),s=this._chartModel();if(t.control()&&this._clonningAtMoveLineTools){const o=new n.Point(e.localX,e.localY),a=Object(r.ensureNotNull)(this._startCloningPoint).subtract(o).length(),l=[];for(const e of this._clonningAtMoveLineTools){const t=s.dataSourceForId(e);null!==t&&l.push(t)}if(0===l.length)return!1;if(a>8){const s=this.cloneLineTools(l,!0).map(e=>Object(r.ensureNotNull)(i.model().dataSourceForId(e)));i.selectionMacro(e=>{e.clearSelection(),s.forEach(t=>{e.addSourceToSelection(t)})});const o=new n.Point(e.localX,e.localY),a=Object(r.ensureNotNull)(s[0].priceScale()),c=Object(r.ensureNotNull)(this.state().mainDataSource()).firstValue(),h={index:i.timeScale().coordinateToIndex(e.localX),price:a.coordinateToPrice(e.localY,Object(r.ensureNotNull)(c))};i.startMovingSources(s,{logical:h,screen:o},null,t),this._clonningAtMoveLineTools=null,this._startCloningPoint=null}return!0}return!1}_mouseDownEventForLineTool(e,t,i,s){var o,a;if(!this.hasState())return;const l=this._chartUndoModel();let c=!1,h=null;const u=g.tool.value();Object(g.hideAllDrawings)().value()&&Object(g.hideAllIndicators)().setValue(!1),Object(g.hideAllDrawings)().setValue(!1),Object(g.lockDrawings)().setValue(!1),e.isTouch&&(Object(f.isLineToolName)(u)&&!Object(B.isLineDrawnWithPressedButton)(u)||l.lineBeingCreated())&&this._initToolCreationModeParams(e);const d=l.lineBeingCreated();if(d&&!Object(B.isLineDrawnWithPressedButton)(d.toolname)){const u=Object(r.ensure)(null===(o=d.ownerSource())||void 0===o?void 0:o.firstValue());if(e.isTouch){if(!this._startTouchPoint){this._startTouchPoint=new n.Point(e.pageX,e.pageY);const t=d.points(),i=t[t.length-1],s=l.timeScale().indexToCoordinate(i.index),o=Object(r.ensureNotNull)(d.priceScale()).priceToCoordinate(i.price,u);return void(this._initCrossHairPosition=new n.Point(s,o))}}else{h=d;const n=l.model().paneForSource(d);if(n!==this._state&&null!==n){const i=this._externalPaneXCoord(n,e.localX),s=this._externalPaneYCoord(n,e.localY);c=l.continueCreatingLine({index:Math.round(l.timeScale().coordinateToIndex(i)),
|
||
price:Object(r.ensure)(null===(a=d.priceScale())||void 0===a?void 0:a.coordinateToPrice(s,u))},t)}else{const e=l.model().magnet().align(s,i,this.state());c=l.continueCreatingLine({index:i,price:e},t)}}}else if(!e.isTouch||Object(B.isLineDrawnWithPressedButton)(u)){const e={index:i,price:l.model().magnet().align(s,i,this.state())};h=l.createLineTool(this.state(),e,u),l.lineBeingCreated()||(c=!0)}h&&l.selectionMacro(e=>e.addSourceToSelection(Object(r.ensureNotNull)(h))),c&&h&&(this._finishTool(h),e.preventDefault())}_handleSelectionMouseDownAndGetJustDeselectedSource(e,t,i){const s=this._chartUndoModel();let r=null;if(null===t.source||t.source.isSelectionEnabled()){let n=e.isTouch?Boolean(t.hittest&&t.hittest.result()>=u.HitTestResult.MOVEPOINT_BACKGROUND):Boolean(t.hittest&&t.hittest.result()>u.HitTestResult.MOVEPOINT_BACKGROUND);this._preventSourceChange&&(n=!1),s.selectionMacro(e=>{var s;n&&t.source?(i.control()||e.selection().isSelected(t.source)||e.clearSelection(),i.control()&&e.selection().isSelected(t.source)?(r=t.source,e.removeSourceFromSelection(t.source)):e.addSourceToSelection(t.source,(null===(s=null==t?void 0:t.hittest)||void 0===s?void 0:s.data())||void 0),e.selection().allSources().length>1&&Object(F.trackEvent)("GUI","Multiselect","Click Select")):i.control()||e.clearSelection()})}return r}_processMouseMoveWhileZoom(e,t){this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,t)}_setCursorPositionOnExternalPane(e,t,i,s){t=this._externalPaneXCoord(e,t),i=this._externalPaneYCoord(e,i);this._chart.paneByState(e)._setCursorPosition(t,i,s)}_setCursorPosition(e,t,i){this._chartModel().setAndSaveCurrentPosition(this._correctXCoord(e),this._correctYCoord(t),this.state(),i)}_setCursorClassName(e){let t="";e&&(t="pane--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._paneCell.classList.remove(this._currentCursorClassName),t&&this._paneCell.classList.add(t),this._currentCursorClassName=t,this._paneCell.style.cursor)}_processMouseUpOrTouchEndHandler(e){var t;null===(t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY)).hittest)||void 0===t||t.tryCallMouseUpOrTouchEndHandler(e)}_crossHairShouldBeVisible(){const e=this._chartModel().crossHairSource();return Object(f.isLineToolName)(g.tool.value())||Object(g.toolIsMeasure)(g.tool.value())||e.startMeasurePoint()&&!e.endMeasurePoint()||null!==this._firstZoomPoint||null!==this._chartModel().lineBeingEdited()||null!==this._chartModel().lineBeingCreated()}_clearCursorPosition(){this._chartModel().clearCurrentPosition()}_dataSourceAtPoint(e,t){let i=null,s=null,r=null;if(!this.hasState())return null;const o=this.state(),a=o.height(),l=o.width();let c=!1;const h=(e,t,n,o)=>{const a=r?r.result():0;e.result()>a&&(r=e,i=t,s=n,c=o)},u=this._canvasRenderParams(),p=new n.Point(e,t),_=this._chartUndoModel();this._hitTestChartSources(u,[_.crossHairSource()],p,h),this._hitTestCustomSources(u,o.customSources(d.a.Topmost),p,h);const m=o.sourcesByGroup();this._hitTestChartSources(u,m.tradingSources(),p,h),
|
||
this._hitTestCustomSources(u,o.customSources(d.a.Foreground),p,h);const f=[...this._chartModel().multiPaneSources(o),...m.hitTestSources()];if(this._hitTestChartSources(u,f,p,h),this.containsMainSeries()){const e=_.barsMarksSources();for(let h=0;h<e.length;++h){const t=e[h],n=t.paneViews(o)||[];let d,_;for(let e=0;e<n.length;e++)if(d=n[e].renderer(a,l),null!==d&&(_=d.hitTest(p,u),_)){r=_,i=t,s=d,c=!1;break}}const t=_.activeStrategySource().value(),n=t&&t.strategyOrdersPaneView();if(null!==n){const e=n.renderer(a,l),o=e&&e.hitTest(p,u);o&&(r=o,i=t,s=e,c=!1)}}return null===i&&this._hitTestCustomSources(u,o.customSources(d.a.Background),p,h),{source:i,hittest:r,renderer:s,isCustom:c}}_hitTestCustomSources(e,t,i,s){const n=Object(r.ensureNotNull)(this._state),o=n.height(),a=n.width();for(let r=t.length-1;r>=0;--r){const l=t[r],c=l.paneViews(n);if(0!==c.length)for(let t=c.length-1;t>=0;--t){const r=c[t].renderer(o,a);if(null!==r){const t=r.hitTest(i,e);null!==t&&s(t,l,r,!0)}}}}_hitTestChartSources(e,t,i,s){const n=Object(r.ensureNotNull)(this._state),o=n.height(),a=n.width();for(let r=t.length;0<r--;){const l=t[r],c=l.paneViews(n);if(null!==c)for(let t=c.length;0<t--;){const r=c[t].renderer(o,a);if(r&&r.hitTest){const t=r.hitTest(i,e);null!==t&&s(t,l,r,!1)}}}}_tryStartMovingLineTool(e,t,i,s){var o,a;if(null===t.source||!t.source.movable()||null!==this._startTrackPoint)return!1;if(!this._preventSourceChange){const l=this._chartUndoModel(),c=Object(r.ensureNotNull)(Object(r.ensureNotNull)(this._state).mainDataSource()).firstValue(),h=Object(r.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,Object(r.ensureNotNull)(c)),u=t.source.isSelectionEnabled()?l.selection().allSources():[t.source],d=new n.Point(e.localX,e.localY),p={index:s,price:h},_=null===(a=null===(o=t.hittest)||void 0===o?void 0:o.data())||void 0===a?void 0:a.itemIndex;return this._startMoveLineToolParams={source:u,startPoint:{logical:p,screen:d},itemIndex:void 0===_?null:_,envState:i},!0}return this._startMoveLineToolParams=null,!1}_chartModel(){return this._chart.model().model()}_chartUndoModel(){return this._chart.model()}_externalPaneXCoord(e,t){t+=this._div.getBoundingClientRect().left+document.body.scrollLeft;const i=Object(r.ensureNotNull)(this._chart.paneByState(e)),s=i._div.getBoundingClientRect().left+document.body.scrollLeft;return i._correctXCoord(t-s)}_externalPaneYCoord(e,t){t+=this._div.getBoundingClientRect().top+document.body.scrollTop;const i=Object(r.ensureNotNull)(this._chart.paneByState(e)),s=i._div.getBoundingClientRect().top+document.body.scrollTop;return i._correctYCoord(t-s)}_correctXCoord(e){return Math.max(0,Math.min(e,this._size.w-1))}_correctYCoord(e){return Math.max(0,Math.min(e,this._size.h-1))}_processScroll(e){if(!this._chart.model().model().scrollEnabled())return;const t=Date.now();this._startScrollingPos||this._preventScroll()||(this._startScrollingPos={x:e.clientX,y:e.clientY,timestamp:t,localX:e.localX,localY:e.localY}),null!==this._scrollXAnimation&&this._scrollXAnimation.addPosition(e.localX,t),
|
||
null!==this._scrollYAnimation&&this._scrollYAnimation.addPosition(e.localY,t);const i=this._chartUndoModel();let s=this.state().defaultPriceScale();if(this._startScrollingPos&&!this._isScrolling&&(this._startScrollingPos.x!==e.clientX||this._startScrollingPos.y!==e.clientY))return i.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),null===this._scrollXAnimation&&this._options.useKineticScroll&&(this._scrollXAnimation=new T(.2,7,.997,15),this._scrollXAnimation.addPosition(this._startScrollingPos.localX,this._startScrollingPos.timestamp),this._scrollXAnimation.addPosition(e.localX,t)),this._scrollYAnimation,i.selection().isEmpty()||(s=i.selection().allSources()[0].priceScale()),null===s||s.isEmpty()||(this._scrollPriceScale=s,i.startScrollPrice(this.state(),s,e.localY)),i.startScrollTime(e.localX),this._isScrolling=!0,this.setCursorForTool(),void this._paneWidgetsSharedState.setScrollingPane(this);this._isScrolling&&(null!==this._scrollPriceScale&&i.scrollPriceTo(this.state(),this._scrollPriceScale,e.localY),i.scrollTimeTo(e.localX))}_finishScroll(){const e=this._chartUndoModel();e.endScrollTime(),null!==this._scrollPriceScale&&e.endScrollPrice(this.state(),this._scrollPriceScale),e.endUndoMacro(),this._isScrolling=!1,this._startScrollingPos=null,this._scrollPriceScale=null,this.setCursorForTool(),this._paneWidgetsSharedState.setScrollingPane(null)}_endScroll(e){if(!this._isScrolling)return!1;const t=this._isScrolling&&this._scrollUndoCommandInStack();if(this._isScrolling){const i=Date.now();null!==this._scrollXAnimation&&this._scrollXAnimation.start(e.localX,i),null!==this._scrollYAnimation&&this._scrollYAnimation.start(e.localY,i);const s=this._chartUndoModel();if((null===this._scrollXAnimation||this._scrollXAnimation.finished(i))&&(null===this._scrollYAnimation||this._scrollYAnimation.finished(i)))return this._finishScroll(),t;const r=s.timeScale(),n=this._scrollXAnimation,o=this._scrollYAnimation,a=()=>{if((null===n||n.terminated())&&(null===o||o.terminated()))return;const e=Date.now();let t=null===n||n.finished(e);const i=null===o||o.finished(e);if(null!==n&&!n.terminated()){const i=r.rightOffset();s.scrollTimeTo(n.getPosition(e)),i===r.rightOffset()&&(t=!0,this._scrollXAnimation=null)}null===o||o.terminated()||null===this._scrollPriceScale||s.scrollPriceTo(this.state(),this._scrollPriceScale,o.getPosition(e)),t&&i?this._finishScroll():requestAnimationFrame(a)};requestAnimationFrame(a)}return t}_terminateActiveAnimations(){const e=Date.now(),t=null===this._scrollXAnimation||this._scrollXAnimation.finished(e),i=null===this._scrollYAnimation||this._scrollYAnimation.finished(e);null===this._scrollXAnimation&&null===this._scrollYAnimation||t&&i||this._finishScroll(),null!==this._scrollXAnimation&&(this._scrollXAnimation.terminate(),this._scrollXAnimation=null),null!==this._scrollYAnimation&&(this._scrollYAnimation.terminate(),this._scrollYAnimation=null)}_preventScroll(){
|
||
return this._trackCrosshairOnlyAfterLongTap&&this._longTap||this._contextMenuOpenedOnLastTap||Object(f.isLineToolName)(g.tool.value())||Boolean(this._chartUndoModel().lineBeingCreated())||null!==this._startTrackPoint}_isSelectBarModeEnabled(){return this._chartUndoModel().crossHairSource().selectBarMode().value()}_preventCrossHairMove(){return!!this._trackCrosshairOnlyAfterLongTap&&(null===this._chart.trackingModePaneWidget()&&(!!this._contextMenuOpenedOnLastTap||!this._crossHairShouldBeVisible()&&null===this._startTrackPoint))}_finishTool(e){const t=this._chartUndoModel(),i=g.tool.value();if(Object(g.resetToCursor)(),this._preventCrossHairMove()&&this._clearCursorPosition(),t.selectionMacro(t=>{t.addSourceToSelection(e)}),Object(B.isTextToolName)(i)){const i=t.createUndoCheckpoint();this._chart.showChartPropertiesForSource(e,R.TabNames.text,void 0,i)}this._lastFinishedToolId=e.id(),Object(V.c)(e)}_alignSourcesThatBeingMoved(e,t,i,s){const r=this._chartUndoModel(),o=r.timeScale().coordinateToIndex(t);r.model().sourcesBeingMoved().forEach(e=>{const a=e.convertYCoordinateToPriceForMoving(i,this.state().mainDataSource());null!==a&&(this.setCursorForTool(),r.moveSources({screen:new n.Point(t,i),logical:{index:o,price:a}},s))})}_resetMeasureIfRequired(){this._needResetMeasureLater&&(Object(g.resetToCursor)(),this._needResetMeasureLater=!1)}_drawBackground(e,t){const i=Math.ceil(t.pixelRatio*this._size.w),s=Math.ceil(t.pixelRatio*this._size.h),r=this._chartModel(),n=r.backgroundTopColor().value(),o=r.backgroundColor().value();n===o?Object(S.clearRect)(e,0,0,i+1,s+1,o):Object(y.clearRectWithGradient)(e,0,0,i+1,s+1,n,o)}_drawWatermark(e,t){const i=this._chartModel().watermarkSource();if(null===i)return;const s=this.state();if(!s.containsMainSeries())return;const r=i.paneViews(),n=s.height(),o=s.width();for(const a of r){e.save();const i=a.renderer(n,o);i&&i.draw(e,t),e.restore()}}_drawCrossHair(e,t){const i=this._chartUndoModel().crossHairSource();!i.visible&&Object(g.lockTimeAxis)().value()&&(i.setLockedPosition(Object(r.ensureNotNull)(this._state)),i.updateAllViews()),this._drawSourceImpl(e,t,Q,$,i)}_drawActiveLineTools(e,t){const i=this._chartModel(),s=[i.lineBeingCreated(),i.lineBeingEdited(),...i.sourcesBeingMoved()].filter(e=>!!e);for(const r of s){(i.paneForSource(r)===this.state()||r.isMultiPaneEnabled())&&this._drawSourceImpl(e,t,Q,$,r)}}_drawSources(e,t){const i=this.state(),s=i.model(),r=i.sourcesByGroup(),n=r.tradingSources(),o=[...s.multiPaneSources(i),...r.generalSources()],a=r.phantomSources(),l=i.customSources(d.a.Background).slice(),h=i.customSources(d.a.Foreground).slice(),u=i.customSources(d.a.Topmost).slice();{const e=s.panes();for(let t=e.length-1;t>=0;t--)e[t].createDrawingsCaches()}this._drawSourceImpl(e,t,Q,$,s.gridSource()),this._drawWatermark(e,t);for(const c of l)this._drawSourceImpl(e,t,Q,X,c);for(const c of o)this._drawSourceImpl(e,t,Q,X,c);for(const c of h)this._drawSourceImpl(e,t,Q,X,c);for(const c of a)this._drawSourceImpl(e,t,Q,X,c);const p=new Set
|
||
;[s.lineBeingCreated(),s.lineBeingEdited(),...s.sourcesBeingMoved()].filter(c.notNull).forEach(e=>p.add(e.id()));let _=s.hoveredSource();null!==_&&(Z(_)||Object(f.isLineTool)(_)&&p.has(_.id())||Object(m.a)(_)&&!o.includes(_)?_=null:p.add(_.id()));const g=s.selection().allSources().filter(e=>!(Object(m.a)(e)&&!o.includes(e))&&(!p.has(e.id())&&!Z(e)));g.forEach(e=>p.add(e.id()));{for(const s of l)this._drawSourceImpl(e,t,Q,$,s,p);for(const s of o)this._drawSourceImpl(e,t,Q,$,s,p);for(const s of h)this._drawSourceImpl(e,t,Q,$,s,p);const i=s.activeStrategySource().value();i&&this.containsMainSeries()&&this._drawSourceImpl(e,t,te,$,i)}for(const c of n)this._drawSourceImpl(e,t,Q,X,c);for(const c of u)this._drawSourceImpl(e,t,Q,X,c);for(const c of o)this._drawSourceImpl(e,t,ee,$,c,p);for(const c of h)this._drawSourceImpl(e,t,ee,$,c,p);for(const c of n)this._drawSourceImpl(e,t,Q,$,c,p);for(const c of u)this._drawSourceImpl(e,t,Q,$,c,p);for(const c of g)this._drawSourceImpl(e,t,Q,$,c);for(const c of g)this._drawSourceImpl(e,t,ee,$,c);_&&(this._drawSourceImpl(e,t,Q,$,_),this._drawSourceImpl(e,t,ee,$,_));for(const c of a)this._drawSourceImpl(e,t,Q,$,c,p);{const e=s.panes();for(let t=e.length-1;t>=0;t--)e[t].clearDrawingCaches()}}_drawSourceImpl(e,t,i,s,r,n){if(n&&n.has(r.id()))return;const o=this.state(),a=o.height(),l=o.width(),c=i(r,this.state());if(c)for(const h of c){const i=h.renderer(a,l);i&&(e.save(),s(i,e,t),e.restore())}}_drawBarsMarks(e,t,i){if(this.containsMainSeries()&&!i){const i=this._chartUndoModel().barsMarksSources();for(const s of i)this._drawSourceImpl(e,t,Q,$,s)}}_updateByThemedColors(){null!==this._legendWidget&&this._legendWidget.updateThemedColors(this._themedTopColor),null!==this._paneControls&&this._paneControls.updateThemedColors(this._themedTopColor)}_scrollUndoCommandInStack(){const e=this._chartUndoModel().undoHistory().undoStack();if(e.isEmpty())return!1;const t=e.head();if(!(t instanceof v.a))return!1;if(t.isEmpty())return!1;const i=t.commands()[0];return i instanceof A.PriceScaleChangeUndoCommand||i instanceof O.a}_onStateDestroyed(){this.setState(null)}_getHideNotMainSourcesValue(){return re&&!this._chart.isActive()&&!this._chart.crossHairSyncEnabled()}_onDataSourcesCollectionChanged(){this._startMoveLineToolParams=null}_processMouseEnterLeaveMoveHandlers(e,t){var i,s,r,n;null!==this._prevHoveredHittest&&this._prevHoveredHittest.renderer!==e.renderer&&(Object(u.tryCallHandler)(t,null===(s=null===(i=this._prevHoveredHittest.hittest)||void 0===i?void 0:i.data())||void 0===s?void 0:s.mouseLeaveHandler),this._prevHoveredHittest=null),t.isTouch||(e.hittest&&(null===(r=this._prevHoveredHittest)||void 0===r?void 0:r.renderer)!==e.renderer&&(e.hittest.tryCallMouseEnterHandler(t),this._prevHoveredHittest=e),null===(n=e.hittest)||void 0===n||n.tryCallMouseMoveHandler(t))}_startChangeOrMoveLineToolIfNeeded(){if(null!==this._startChangeLineToolParams){const e=this._startChangeLineToolParams;this._chartUndoModel().startChangingLinetool(e.source,e.startPoint,e.pointIndex,e.envState)}
|
||
if(null!==this._startMoveLineToolParams){const e=this._startMoveLineToolParams;this._chartUndoModel().startMovingSources(e.source,e.startPoint,e.itemIndex,e.envState)}this._startMoveLineToolParams=null,this._startChangeLineToolParams=null}_trackingModeShouldBeActive(){return!(!this._trackCrosshairOnlyAfterLongTap||this._contextMenuOpenedOnLastTap||this._crossHairShouldBeVisible())&&this._longTap}_processOutsideClick(e){let t=null;const i=this._chartModel();if(e.source&&(t=e.isCustom?i.customSourceName(e.source):e.source.id()),null!==this._lastClickedSource&&this._lastClickedSource.id!==t){const e=this._lastClickedSource.id,t=this._lastClickedSource.isCustom?i.customSourceForName(e):i.dataSourceForId(e);null!==t&&t.onClickOutside&&(t.onClickOutside(),this._chartModel().updateSource(t))}this._lastClickedSource=null!==t?{id:t,isCustom:e.isCustom}:null}_mouseClickOrTapEvent(e){var t;if(!this.hasState())return;const i=this._dataSourceAtPoint(e.localX,e.localY),s=i&&i.source,n=this._chartUndoModel();this._processOutsideClick(Object(r.ensureNotNull)(i)),!this._isSelectBarModeEnabled()||e.isTouch&&this.trackingModeEnabled()&&!this._exitTrackingModeOnNextTry||n.crossHairSource().trySelectCurrentBar(),(null===(t=null==i?void 0:i.hittest)||void 0===t?void 0:t.tryCallClickOrTapHandler(e))&&n.model().updateSource(Object(r.ensureNotNull)(s)),!e.isTouch||this._isSelectBarModeEnabled()||i&&i.source===n.crossHairSource()||this._tryExitTrackingMode(),s instanceof b.BarsMarksContainer&&i&&i.hittest&&i.hittest.data()&&s.onClicked(Object(r.ensureNotNull)(i.hittest).data()),s&&Object(f.isLineTool)(s)&&Object(l.emit)("drawing_event",s.id(),"click"),this._resetMeasureIfRequired()}_mouseDownOrTouchStartEvent(e){var t;if(e.isTouch&&(this._longTap=!1,this._exitTrackingModeOnNextTry=null!==this._startTrackPoint,this._paneWidgetsSharedState.clearDraggingSource()),this._contextMenuOpenedOnLastTap=!1,this._lastFinishedToolId=null,!this.hasState())return;if(this._terminateActiveAnimations(),e.isTouch&&this._switchTrackingModeFromAnotherPaneIfNeeded(e),document.activeElement!==document.body&&document.activeElement!==document.documentElement)document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus();else{const e=document.getSelection();null!==e&&e.removeAllRanges()}Object(l.emit)("mouse_down",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),e.isTouch||this._updateCommonTooltip(null);const i=this._chartUndoModel(),s=new p.EnvironmentState(e);i.mainSeries().clearGotoDateResult(),this.hideInplaceEditor();const o=this.state().defaultPriceScale();if(o.isEmpty()||i.timeScale().isEmpty())return;const c=i.crossHairSource();if(!e.isTouch&&!Object(B.isLineDrawnWithPressedButton)(g.tool.value())){const t=i.lineBeingCreated(),r=null!==t?i.model().paneForSource(t):null;null!==r&&r!==this._state?this._setCursorPositionOnExternalPane(r,e.localX,e.localY,s):this._setCursorPosition(e.localX,e.localY,s)}
|
||
e.isTouch&&Object(f.isLineToolName)(g.tool.value())&&(Object(B.isLineDrawnWithPressedButton)(g.tool.value())||null!==c.pane?Object(B.isLineDrawnWithPressedButton)(g.tool.value())&&this._clearCursorPosition():this._chart.updateCrossHairPositionIfNeeded());const h=Object(r.ensureNotNull)(this.state().mainDataSource()).firstValue();if(null===h){const t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));return void(this._chart.readOnly()||(this._handleSelectionMouseDownAndGetJustDeselectedSource(e,t,s),t.source&&t.source instanceof D.PriceDataSource&&t.source.isDraggable()&&this._paneWidgetsSharedState.trySetDraggingSource(t.source,this)))}const d=o.coordinateToPrice(e.localY,h),_=this._chartModel().timeScale().coordinateToIndex(e.localX);if(c.startMeasurePoint()&&c.endMeasurePoint()&&c.clearMeasure(),s.shift()&&Object(g.toolIsCursor)(g.tool.value())&&i.selection().isEmpty()&&g.tool.setValue("measure"),!e.isTouch&&this._tryStartMeasure(e,c,s,d,_))return;if(!e.isTouch&&this._tryFinishMeasure(e,c))return;if(this._tryFinishZoom(e))return;if(this._tryStartZoom(e,d,_,s))return;e.isTouch&&(null!==this._startTrackPoint?(this._initCrossHairPosition=c.currentPoint(),this._startTrackPoint=new n.Point(e.localX,e.localY)):this._isSelectBarModeEnabled()&&null===this._chart.trackingModePaneWidget()&&this.startTrackingMode(new n.Point(e.localX,e.localY),new n.Point(e.localX,e.localY),new p.EnvironmentState(e)));const m=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));if(e.isTouch&&(this._preventSourceChange=null===m.source||!i.selection().isSelected(m.source)),!this._isSelectBarModeEnabled()&&!this._isScrolling){if(e.isTouch&&(Object(g.toolIsMeasure)(g.tool.value())||null!==c.measurePane()))return void this._initToolCreationModeParams(e);if(Object(f.isLineToolName)(g.tool.value())||i.lineBeingCreated())return s.shift()||i.selectionMacro(e=>e.clearSelection()),void this._mouseDownEventForLineTool(e,s,_,d)}if(null===(t=m.hittest)||void 0===t||t.tryCallMouseDownOrTouchStartHandler(e),!this._chart.readOnly()){const t=this._handleSelectionMouseDownAndGetJustDeselectedSource(e,m,s);if(m.hittest&&m.source){const t=m.hittest.data();if(m.isCustom){if(m.hittest.hasPressedMoveHandler(e))return void i.model().setCustomSourceMovingHitTestData(t)}else if((null==t?void 0:t.areaName)===u.AreaName.SourceItemMove){const s=null==t?void 0:t.itemIndex;if(void 0!==s)return void i.startCustomMoving(m.source,s,e)}}if(this._tryHandleEraserMouseDown(m,s))return;const r=m.source&&Object(f.isLineTool)(m.source)&&m.source.isLocked&&m.source.isLocked();if(!(Object(g.lockDrawings)().value()||r)&&!m.isCustom){if(m.source&&m.source.userEditEnabled&&!m.source.userEditEnabled())return;if(this._tryStartChangingLineTool(e,m,s,_))return;if(m.hittest&&((v=m.hittest.result())===u.HitTestResult.MOVEPOINT||v===u.HitTestResult.MOVEPOINT_BACKGROUND&&Object(a.lastEventIsTouch)())){if(this._tryStartCloning(e,m,s,t))return;if(this._tryStartMovingLineTool(e,m,s,_))return}}
|
||
if(m.source&&m.source instanceof D.PriceDataSource&&m.source.isDraggable()&&this._paneWidgetsSharedState.trySetDraggingSource(m.source,this))return}var v;m&&m.hittest&&m.hittest.result()===u.HitTestResult.REGULAR||(this._processing=!0)}_mouseUpOrTouchEndEvent(e){var t,i;if(!this.hasState())return;const s=e.isTouch&&null!==this._startTrackPoint,n=e.isTouch&&this._wasPinched;e.isTouch&&(this._wasPinched=!1,this._longTap=!1),this._startMoveLineToolParams=null,this._startChangeLineToolParams=null;const o=this._chartUndoModel(),c=o.model().customSourceMovingHitTestData();null!==c||o.customMoveBeingProcessed()||this._processMouseUpOrTouchEndHandler(e),this._isSelecting=!1;const h=o.model(),d=h.crossHairSource();if(d.selection()&&null===this._firstZoomPoint){const e=this.state().lineToolsForArea(d.selection());o.selectionMacro(t=>{e.forEach(e=>{t.addSourceToSelection(e)})}),d.clearSelection(),Object(F.trackEvent)("GUI","Multiselect","Area Select")}Object(l.emit)("mouse_up",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY});const _=e.isTouch&&this._touchMove;e.isTouch&&(this._touchMove=!1);const m=new p.EnvironmentState(e),v=g.tool.value();if(e.isTouch&&!_&&(Object(g.toolIsMeasure)(v)||null!==d.measurePane())){if(null===d.measurePane()&&d.pane!==this._state)return void this._setCursorPosition(e.localX,e.localY);if(this._tryStartMeasure(e,d,m,d.price,d.index))return;if(this._tryFinishMeasure(e,d))return}if(e.isTouch&&!_&&!Object(B.isLineDrawnWithPressedButton)(v)&&Object(f.isLineToolName)(v)&&!o.lineBeingCreated()){if(this._chart.justActivated())return;if(d.pane!==this._state)return void this._setCursorPosition(e.localX,e.localY,m);const i=d.currentPoint(),s=this.state().defaultPriceScale(),n=Object(r.ensure)(null===(t=this.state().mainDataSource())||void 0===t?void 0:t.firstValue()),a={index:Math.round(o.timeScale().coordinateToIndex(i.x)),price:s.coordinateToPrice(i.y,n)},l=Object(r.ensureNotNull)(o.createLineTool(this.state(),a,v));return o.selectionMacro(e=>{e.addSourceToSelection(l)}),o.lineBeingCreated()||(this._finishTool(l),e.preventDefault()),void(this._startTouchPoint=null)}const b=o.lineBeingCreated();if(b&&!Object(B.isLineDrawnWithPressedButton)(b.toolname)&&e.isTouch&&this._startTouchPoint){if(this._startTouchPoint=null,!_){const t=b.points()[b.points().length-1],i=o.continueCreatingLine({index:t.index,price:t.price},new p.EnvironmentState(e));this._initCrossHairPosition=null,i&&(this._finishTool(b),e.preventDefault())}return}if(null!==this._firstZoomPoint&&this._firstZoomPoint.draggingMode)return void this._finishZoom(e);if(this._processing=!1,o.customMoveBeingProcessed()&&o.endCustomMoving(),null!==c&&(c.beingMoved&&(Object(u.tryCallHandler)(e,c.mouseUpHandler,c.touchEndHandler),this.setCursorForTool()),h.setCustomSourceMovingHitTestData(null)),h.lineBeingEdited())return o.endChangingLinetool(!1),void(this._preventCrossHairMove()&&this._clearCursorPosition());if(Object(B.isLineDrawnWithPressedButton)(v)&&!this._isSelectBarModeEnabled()){
|
||
const t=o.lineBeingCreated();null!==t&&(Object(V.c)(t),t.finish());const s=this.state().defaultPriceScale();if(s.isEmpty())return;if(!t)return;const n=Object(r.ensure)(null===(i=t.ownerSource())||void 0===i?void 0:i.firstValue()),a=s.coordinateToPrice(e.localY,n),l={index:Math.round(o.timeScale().coordinateToIndex(e.localX)),price:a};return void o.continueCreatingLine(l)}if(h.sourcesBeingMoved().length)return o.endMovingSource(!1),h.sourcesBeingMoved().forEach(e=>{this.setCursorForTool(e)}),void h.invalidate(G.InvalidationMask.cursor());if(!this._chart.readOnly()){const t=this._dataSourceAtPoint(e.localX,e.localY),i=e.localX>=0&&e.localX<this._size.w;if((!t||t.source!==d)&&i){const t=o.timeScale().coordinateToIndex(e.localX);h.onSyncScrollNeeded(t)}}const S=this._isScrolling,y=this._endScroll(e),w=this._paneWidgetsSharedState.draggingSource();if(null!==w){const t=e.target,i=this._chart.paneByCanvas(t);i&&i!==this&&(y&&o.undoHistory().undo(),o.mergeToPane(w,i.state()));if(this._chart.timeAxisByCanvas(t))if(h.isUnmergeAvailableForSource(w))y&&o.undoHistory().undo(),o.unmergeToNewBottomPane(w);else{const e=h.panes(),t=Object(r.ensureNotNull)(h.paneForSource(w)),i=e.indexOf(t);i!==e.length-1&&(y&&o.undoHistory().undo(),t.isMaximized()&&this._chart.toggleMaximizePane(),o.movePane(i,e.length-1))}this._paneWidgetsSharedState.clearDraggingSource();const s=this._chart.getTimeScale();s&&s.restoreDefaultCursor();const n=this._dataSourceAtPoint(e.localX,e.localY),a=this._chart.paneWidgets();for(let e=0;e<a.length;e++){const t=a[e];t===this&&n&&!n.isCustom?t.setCursorForTool(n.source||void 0):t.setCursorForTool(),t.leftPriceAxisesContainer().restoreDefaultCursor(),t.rightPriceAxisesContainer().restoreDefaultCursor()}}if(!(s||m.control()||S||n)){const t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));t.source&&(t.hittest&&t.hittest.result()>u.HitTestResult.MOVEPOINT_BACKGROUND||Object(a.lastEventIsTouch)())&&o.selectionMacro(e=>{e.clearSelection(),e.addSourceToSelection(Object(r.ensureNotNull)(t.source))})}e.isTouch&&(this._touchMove=!1)}_mouseOrTouchMoveEvent(e){if(!this.hasState())return;this._resetMeasureIfRequired();const t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));this._processMouseEnterLeaveMoveHandlers(t,e);const i=this._chartUndoModel();if(!i)return;const s=i.crossHairSource(),o=e.localX,a=e.localY;this._prevMoveEventPosition=new n.Point(o,a);const l=new p.EnvironmentState(e);if(null!==this._firstZoomPoint)return void this._processMouseMoveWhileZoom(e,l);let c=!1;if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.visible().value())){const s=g.tool.value();let r=null;if(!this._processing&&(Object(g.toolIsCursor)(s)||"eraser"===s||l.control()||!i.lineBeingCreated())){const e=t&&t.source,n=t&&t.hittest&&t.hittest.data();c=Boolean(n&&n.hideCrosshairLinesOnHover)||!!e&&Object(f.isLineTool)(e)&&-1!==J.indexOf(e.toolname),t.hittest&&t.hittest.result()>u.HitTestResult.MOVEPOINT_BACKGROUND?(r=t.source,
|
||
t.source&&t.source.isHoveredEnabled()&&("eraser"!==s||t.source!==i.mainSeries())?i.model().setHoveredSource(t.source,t.hittest.data()):i.model().setHoveredSource(null,null)):i.model().setHoveredSource(null,null)}if(this._options.sourceSelectionEnabled)if(this._isSelectBarModeEnabled())this._setCursorClassName("pointer");else{const e=t.hittest&&t.hittest.data(),i=e&&e.cursorType;this.setCursorForTool(r,l,null===i?void 0:i)}if(e.isTouch||this._updateCommonTooltip(t),null!==t.hittest&&t.hittest.hasPressedMoveHandler(e)){switch((t.hittest.data()||{}).cursorType){case j.PaneCursorType.VerticalResize:this._setCursorClassName("ns-resize");break;case j.PaneCursorType.HorizontalResize:this._setCursorClassName("we-resize");break;case j.PaneCursorType.DiagonalNeSwResize:this._setCursorClassName("nesw-resize");break;case j.PaneCursorType.DiagonalNwSeResize:this._setCursorClassName("nwse-resize")}}}if(this._preventCrossHairMove()&&this._clearCursorPosition(),s.setLinesShouldBeHidden(c),this._chart.readOnly()&&this._options.sourceSelectionEnabled&&(t.source&&t.source.isHoveredEnabled()?i.model().setHoveredSource(t.source,t.hittest&&t.hittest.data()):i.model().setHoveredSource(null,null)),!e.isTouch&&i.lineBeingCreated()){const e=i.lineBeingCreated(),t=null===e?null:i.model().paneForSource(e);if(null!==t&&t!==this._state)return void this._setCursorPositionOnExternalPane(t,o,a,l)}e.isTouch||this._setCursorPosition(o,a,l)}_pressedMouseOrTouchMoveEvent(e){var t;if(!this.hasState()||this._pinching)return;this._resetMeasureIfRequired(),this._startChangeOrMoveLineToolIfNeeded(),e.isTouch&&(this._touchMove=!0,this._preventSourceChange=!1);const i=new p.EnvironmentState(e),s=this._chartUndoModel(),o=s.crossHairSource(),a=e.localX,l=e.localY;if(this._prevMoveEventPosition=new n.Point(a,l),null!==this._firstZoomPoint)return this._processMouseMoveWhileZoom(e),void(this._firstZoomPoint.draggingMode=!0);const c=g.tool.value();if(e.isTouch&&this._startTouchPoint&&Object(f.isLineToolName)(c)&&!Object(B.isLineDrawnWithPressedButton)(c)&&!s.lineBeingCreated()&&!this._isSelectBarModeEnabled())return void this._updateCrosshairPositionInToolCreationMode(e,this.state());const h=o.measurePane();if(e.isTouch&&this._startTouchPoint&&(Object(g.toolIsMeasure)(c)||null!==h))return void this._updateCrosshairPositionInToolCreationMode(e,h||this.state());const d=s.lineBeingCreated();if(e.isTouch&&d&&!Object(B.isLineDrawnWithPressedButton)(d.toolname)){if(this._startTouchPoint){const t=Object(r.ensureNotNull)(s.lineBeingCreated()),i=Object(r.ensureNotNull)(s.model().paneForSource(t));this._updateCrosshairPositionInToolCreationMode(e,i)}return}if(e.isTouch&&null!==this._startTrackPoint){this._exitTrackingModeOnNextTry=!1;const e=Object(r.ensureNotNull)(this._initCrossHairPosition),t=new n.Point(a,l).subtract(this._startTrackPoint),s=e.add(t);this._setCursorPosition(s.x,s.y,i)}else e.isTouch&&this._preventCrossHairMove()||this._setCursorPosition(a,l,i);const _=this._isSelectBarModeEnabled()
|
||
;if(Object(f.isLineToolName)(c)&&!Object(B.isLineDrawnWithPressedButton)(c)&&!_&&!i.control())return;if(Object(B.isLineDrawnWithPressedButton)(c)&&!_){const i=this.state().defaultPriceScale();if(i.isEmpty())return;const o=s.lineBeingCreated();if(!o)return;const a=new n.Point(e.localX,e.localY),l=Object(r.ensure)(null===(t=o.ownerSource())||void 0===t?void 0:t.firstValue());return a.price=i.coordinateToPrice(e.localY,l),a.index=Math.round(s.timeScale().coordinateToIndex(e.localX)),void s.continueCreatingLine(a)}if(null!==this._paneWidgetsSharedState.draggingSource()){const t=e.target,i=this._chart.paneByCanvas(t);i&&(i!==this?i.setDragToAnotherPaneCursor():i.setCursorForTool());const s=this._chart.timeAxisByCanvas(t);s&&s.setCursor("grabbing")}if(s.timeScale().isEmpty())return;const m=this._options.handleScroll;if((!m.pressedMouseMove||e.isTouch)&&(!m.horzTouchDrag&&!m.vertTouchDrag||!e.isTouch))return;if(s.customMoveBeingProcessed())return void s.processCustomMove(e);const v=s.model().customSourceMovingHitTestData();if(null!==v&&(s.model().processingCustomSourceMove(),Object(u.tryCallHandler)(e,v.pressedMouseMoveHandler,v.touchMoveHandler),!Object(u.shouldDefaultActionBeExecuted)(e,v,"pressedMouseMoveHandler","touchMoveHandler")))return;if(s.model().lineBeingEdited())return this._setCursorPosition(a,l,i),void this.setCursorForTool();if(s.model().sourcesBeingMoved().length)return void this._alignSourcesThatBeingMoved(s.model().sourcesBeingMoved(),e.localX,e.localY,i);if(this._tryFinishClonning(e,new p.EnvironmentState(e)))return;const b=Object(g.toolIsMeasure)(c)||o.startMeasurePoint()&&o.endMeasurePoint();this._chart.readOnly()||!i.control()||Object(f.isLineToolName)(c)||b?(this._processScroll(e),this._preventScroll()&&!this._preventCrossHairMove()&&null===this._startTrackPoint&&this._setCursorPosition(e.localX,e.localY,new p.EnvironmentState(e))):this._isSelecting||(o.startSelection(this.state()),this._isSelecting=!0)}_mouseOrTouchLeaveEvent(e){var t,i;if(!this.hasState())return;const s=this._chartUndoModel();s&&(e.isTouch||null!==s.crossHairSource().measurePane()||this._clearCursorPosition(),s.model().setHoveredSource(null,null),null!==this._prevHoveredHittest&&(Object(u.tryCallHandler)(e,null===(i=null===(t=this._prevHoveredHittest.hittest)||void 0===t?void 0:t.data())||void 0===i?void 0:i.mouseLeaveHandler),this._prevHoveredHittest=null),e.isTouch||this._updateCommonTooltip(null),this._chart.unsetActivePaneWidget())}_mouseDoubleClickOrDoubleTapEvent(e){var t;if(!this.hasState())return;const i=!this._chart.readOnly()&&!Object(f.isLineToolName)(g.tool.value())&&Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY))||null;if(null===i)return;if(i.isCustom)return void(null===(t=i.hittest)||void 0===t||t.tryCallDblClickOrDblTapHandler(e));let s=i.hittest&&i.source||null;s&&i.hittest&&i.hittest.result()<=u.HitTestResult.MOVEPOINT_BACKGROUND&&!e.isTouch&&(s=null),s&&!s.isSelectionEnabled()&&(s=null),
|
||
s?this.processDoubleClickOnSource(s,i.hittest?i.hittest:void 0):this._chart.readOnly()||Object(f.isLineToolName)(g.tool.value())||this._chartUndoModel().lineBeingCreated()||!this._chartUndoModel().selection().isEmpty()||this._chart.toggleMaximizePane(this)}_contextMenuEvent(e){var t;const i=this._chartUndoModel();if(i.crossHairSource().startMeasurePoint()&&!this._trackCrosshairOnlyAfterLongTap)return i.crossHairSource().clearMeasure(),void Object(g.resetToCursor)(!0);if(this._pinching)return;if(null===this._firstZoomPoint||this._trackCrosshairOnlyAfterLongTap||this.cancelZoom(),this.hideInplaceEditor())return;if(!Object(g.toolIsCursor)(g.tool.value())||this._isSelectBarModeEnabled()){if(e.isTouch)return;return Object(g.resetToCursor)(!0),this.setCursorForTool(),void(i.lineBeingCreated()&&i.cancelCreatingLine())}if(!this._options.contextMenuEnabled)return;const s=this._dataSourceAtPoint(e.localX,e.localY),r=s?s.source:null;if(e.isTouch&&null!==this._startTrackPoint){if(this._preventSourceChange)return;this._clearCursorPosition()}e.isTouch&&(this._contextMenuOpenedOnLastTap=!0,this._startTrackPoint=null),this._contextMenuX=e.localX,this._contextMenuY=e.localY;const n=s&&s.hittest?s.hittest.result():0,o=n>=u.HitTestResult.REGULAR||n>=u.HitTestResult.MOVEPOINT_BACKGROUND&&e.isTouch;this._chart.updateActions(),i.selectionMacro(t=>{null!==r&&o?t.selection().isSelected(r)||(t.clearSelection(),t.addSourceToSelection(r)):(this._options.contextMenu.general&&this._contextMenu(e).then(t=>{t.show(e)}),t.clearSelection())}),s&&o&&null!==r&&(Object(m.a)(r)&&r.hasContextMenu()?r.isSelectionEnabled()?this.showContextMenuForSelection(e):this.showContextMenuForSources([r],e):null===(t=s.hittest)||void 0===t||t.tryCallContextMenuHandler(e))}_onMouseEvent(){this._preventSourceChange=!1,this._startTrackPoint=null,this._trackCrosshairOnlyAfterLongTap=!1}_onTouchEvent(){this._trackCrosshairOnlyAfterLongTap=!0}_switchTrackingModeFromAnotherPaneIfNeeded(e){const t=this._chart.trackingModePaneWidget();if(null!==t&&t!==this){const i=this._chartModel().crossHairSource().currentPoint();t._exitTrackingModeOnNextTry=!0,t._tryExitTrackingMode(!0),this.startTrackingMode(new n.Point(e.localX,e.localY),new n.Point(i.x,e.localY),new p.EnvironmentState(e))}}_contextMenu(e){const t=e=>e instanceof W.Separator,i=this._customActions(),s=this._initActions(e).filter(e=>null!==e);i.remove.forEach(e=>{for(let t=0;t<s.length;t++){const i=s[t];if(i instanceof W.Action&&i.getLabel()===e){s.splice(t,1);break}}});const r=i.top.concat(s).concat(i.bottom);for(let n=r.length-1;n>0;n--)t(r[n])&&t(r[n-1])&&r.splice(n,1);return r.length&&t(r[0])&&r.splice(0,1),r.length&&t(r[r.length-1])&&r.splice(r.length-1,1),k.ContextMenuManager.createMenu(r,{statName:"ChartContextMenu"})}_initActions(e){var t;const i=this._chart.actions(),r=[];r.push(i.chartReset),r.push(new W.Separator),N.enabled("datasource_copypaste")&&!this.state().isEmpty()&&(r.push(new W.Action({label:Object(s.t)("Paste %s").replace("%s","").trim(),shortcutHint:Object(U.humanReadableHash)(U.Modifiers.Mod+86),
|
||
statName:"Paste",onExecute:()=>this._chart.chartWidgetCollection().clipboard.uiRequestPaste(this.state())})),r.push(new W.Separator)),r[r.length-1]instanceof W.Separator||r.push(new W.Separator);return window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&i.addToWatchlist&&r.push(i.addToWatchlist),N.enabled("text_notes")&&r.push(i.addToTextNotes),r[r.length-1]instanceof W.Separator||r.push(new W.Separator),r.push(this._createLockTimeAxisAction(e)),r.push(new W.Separator),r.push(Object(E.createLinesAction)(this._chart)),N.enabled("charting_library_base")||r.push(i.applyColorTheme),r[r.length-1]instanceof W.Separator||r.push(new W.Separator),this._chart.applyIndicatorsToAllChartsAvailable()&&(r.push(i.applyStudiesToAllCharts),r.push(new W.Separator)),r.push(i.paneRemoveAllDrawingTools),r.push(i.paneRemoveAllStudies),r.push(new W.Separator),(null===(t=window.pro)||void 0===t?void 0:t.hasPackage("mtp-mtpredictor"))&&this.state().containsMainSeries()&&r.push(Object(E.createMTPredictorActions)(this._chart,this.state(),this._contextMenuX,this._contextMenuY),new W.Separator),r.push(i.hideAllMarks),r.push(new W.Separator),N.enabled("show_chart_property_page")&&r.push(i.chartProperties),r[r.length-1]instanceof W.Separator&&r.pop(),r}_loadAndCreateLegendWidget(){Promise.all([i.e(77),i.e(10),i.e("chart-widget-gui")]).then(i.bind(null,"sAH5")).then(e=>{if(this._isDestroyed)return;const t=e.LegendWidget,i=Object(h.deepExtend)({},this._options.legendWidget);i.canShowSourceCode=!this._chart.onWidget()&&!o.CheckMobile.any(),i.readOnlyMode=i.readOnlyMode||this._chart.readOnly(),i.statusesWidgets={sourceStatusesEnabled:this._options.sourceStatusesWidgetEnabled,sourceStatuses:this._options.sourceStatusesWidget||{},marketStatusEnabled:this._options.marketStatusWidgetEnabled,marketStatus:this._options.marketStatusWidget||{},dataUpdateModeEnabled:this._options.chartWarningWidgetEnabled,dataUpdateMode:this._options.chartWarningWidget||{},dataProblemEnabled:this._options.dataProblemWidgetEnabled};const s=new I.a(this._getHideNotMainSourcesValue());this._hideNotMainSourcesInLegendSpawn=Object(L.a)(()=>({}),this._chart.chartWidgetCollection().activeChartWidget,this._chart.chartWidgetCollection().lock.crosshair),this._hideNotMainSourcesInLegendSpawn.subscribe(()=>{s.setValue(this._getHideNotMainSourcesValue())}),this._legendWidget=new t(this._chartUndoModel(),this,this._chart.backgroundTopTheme(),s,i,{showContextMenuForSelection:this.showContextMenuForSelection.bind(this),showContextMenuForSources:this.showContextMenuForSources.bind(this),updateActions:this._chart.updateActions.bind(this._chart),showChartPropertiesForSource:this._chart.showChartPropertiesForSource.bind(this._chart),showGeneralChartProperties:this._chart.showGeneralChartProperties.bind(this._chart),showObjectsTreeDialog:this._chart.showObjectsTreeDialog.bind(this._chart)}),this._div.appendChild(this._legendWidget.getElement()),this._legendWidget.updateLayout(),this._legendWidget.updateWidgetModeBySize(this._size),
|
||
this._legendWidget.updateThemedColors(this._themedTopColor);for(const n of Array.from(this._customLegendWidgetsFactoryMap.keys()))this._legendWidget.addCustomWidgetToLegend(n,Object(r.ensureDefined)(this._customLegendWidgetsFactoryMap.get(n)))})}_loadAndCreatePaneControlsWidget(){Promise.all([Promise.all([i.e(77),i.e(10),i.e("chart-widget-gui")]).then(i.bind(null,"lvAK")),Promise.all([i.e(77),i.e(10),i.e("chart-widget-gui")]).then(i.bind(null,"MjAr"))]).then(([e,t])=>{if(this._isDestroyed)return;const i=e.PaneControlsWidget;this._paneControls=new i(this._chartUndoModel(),this,{backgroundThemeName:this._chart.backgroundTopTheme()},{toggleMaximizePane:this._chart.toggleMaximizePane.bind(this._chart)},this._div),this._paneControls.updateWidgetModeByWidth(this._size.w),this._paneControls.updateThemedColors(this._themedTopColor),this._paneControlsResizeObserver=new t.default(this._handleRestrictLegendWidth.bind(this)),this._paneControlsResizeObserver.observe(this._paneControls.getElement())})}_handleRestrictLegendWidth(e){if(null===this._legendWidget||null===this._paneControls)return;const t=e[e.length-1].contentRect.width,i=0===t?0:t+Y+K;this._legendWidget.addMargin(i)}_onMagnetStateChanged(){this._chart.isActive()&&this._isToolActionActiveOnPane(!0)&&this._chartModel().crossHairSource().visible&&this._updateLineToolUsingMagnetOrShift()}_onShiftKeyStateChanged(){this._chart.isActive()&&this._isToolActionActiveOnPane(!1)&&this._chartModel().crossHairSource().visible&&this._updateLineToolUsingMagnetOrShift(p.EnvironmentState.create(Object(q.c)().value()))}_isToolActionActiveOnPane(e){const t=this._chartModel(),i=t.lineBeingCreated()||t.lineBeingEdited()||t.sourcesBeingMoved().length>0&&t.sourcesBeingMoved()[0];return i?t.paneForSource(i)===this._state:e&&Object(f.isLineToolName)(g.tool.value())&&t.crossHairSource().pane===this._state}_updateLineToolUsingMagnetOrShift(e){if(null===this._prevMoveEventPosition)return;const{x:t,y:i}=this._prevMoveEventPosition,s=this._chartModel().sourcesBeingMoved();s.length>0?this._alignSourcesThatBeingMoved(s,t,i,e):this._setCursorPosition(t,i,e)}_showEditDialogForSource(e,t){if(this._options.propertyPagesEnabled&&(!e.userEditEnabled||e.userEditEnabled()))if(e===this._chartUndoModel().mainSeries())this._chart.showGeneralChartProperties(R.TabNames.symbol);else if(Object(f.isLineTool)(e)||Object(_.isStudy)(e)){let i;const s=null==t?void 0:t.data();if(null!=s){const e=s.areaName;void 0!==e&&(i=se.get(e))}this._chart.showChartPropertiesForSource(e,i).then(e=>{this._editDialog=e})}}_initToolCreationModeParams(e){this._startTouchPoint=new n.Point(e.pageX,e.pageY),this._initCrossHairPosition=this._chartModel().crossHairSource().currentPoint()}_updateCrosshairPositionInToolCreationMode(e,t){if(t!==this._state){const i=this._chart.paneByState(t);return i._startTouchPoint=this._startTouchPoint,i._initCrossHairPosition=this._initCrossHairPosition,void i._updateCrosshairPositionInToolCreationMode(e,t)}const i=this._chartModel().crossHairSource()
|
||
;this._chart.justActivated()&&(this._initCrossHairPosition=i.currentPoint());const s=e.pageX,o=e.pageY,a=Object(r.ensureNotNull)(this._initCrossHairPosition),l=new n.Point(s,o).subtract(Object(r.ensureNotNull)(this._startTouchPoint)),c=a.add(l);this._setCursorPosition(c.x,c.y,new p.EnvironmentState(e))}_priceAxisesContainer(e){return"left"===e?this._lhsPriceAxisesContainer:this._rhsPriceAxisesContainer}_recalculatePriceScales(){const e=this.state();for(const t of e.leftPriceScales())e.recalculatePriceScale(t);for(const t of e.rightPriceScales())e.recalculatePriceScale(t);for(const t of e.sourcesByGroup().overlayPriceScaleSources())Object(f.isLineTool)(t)||e.recalculatePriceScale(t.priceScale())}_createLockTimeAxisAction(e){const t=Object(g.lockTimeAxis)().value();return new W.Action({label:Object(s.t)("Lock Vertical Line On Time Axis"),statName:"LockCursorInTime",checkable:!0,checked:t,onExecute:()=>this._toggleLockTimeAxis(e.localX,!t)})}_toggleLockTimeAxis(e,t){if(t){const t=this._chartUndoModel().timeScale(),i=t.coordinateToIndex(e),s=t.points().roughTime(i);null!==s&&g.lockTimeAxisTime.setValue(s)}Object(g.lockTimeAxis)().setValue(t)}_preventTouchEventsExceptPinch(){return this._paneWidgetsSharedState.hasTouchesOnOtherPanes(this)||null!==this._paneWidgetsSharedState.pinchingPane()}}},UHyS:function(e,t,i){"use strict";i.r(t),i.d(t,"StandardPivotPointsPriceAxisView",(function(){return n}));var s=i("KcY8");const r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"];class n extends s.a{constructor(e,t){super(),this._source=e,this._data=t;const i=t.name;this._completeName="P"===i.toUpperCase()?"P":`S${i[1]}/R${i[1]}`}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._source.properties();if(!s.visible.value())return;const n=this._completeName,o=s.levelsStyle.visibility;if(!o[n]||!o[n].value())return;const a=this._source.model().timeScale(),l=this._source.priceScale();if(a.isEmpty()||null===a.visibleBarsStrictRange()||null!==l&&l.isEmpty())return;const c=this._source.customData();if(!c||!c.pivots)return;const h=this._source.pricesView().prices()[r.indexOf(this._data.name.toUpperCase())];if(!h)return;i.background=h.color,i.textColor=this.generateTextColor(h.color),i.coordinate=h.coordinate,i.floatCoordinate=h.floatCoordinate;const u=this._source.model().properties().scalesProperties;u.showStudyLastValue.value()&&(e.text=h.formatted,e.visible=!0),u.showStudyPlotLabels.value()&&(t.text=this._source.priceLabelText(this._data.name),t.visible=!0)}}},ULlu:function(e,t,i){"use strict";function s(e){return e[0]}function r(e,t,i){return"string"!=typeof t?e:null==i?(e.removeAttribute(t),e):(e.setAttribute(t,String(i)),e)}function n(e,t){return"string"==typeof t&&e.classList.add(t),e}function o(e,t){return void 0===t||(null===t&&(e.innerHTML=""),"string"!=typeof t&&"number"!=typeof t||(e.innerHTML=String(t))),e}function a(e){const{paddingLeft:t,paddingRight:i}=window.getComputedStyle(e);return[t,i].reduce((e,t)=>e-Number((t||"").replace("px","")),e.clientWidth)}function l(e){
|
||
const{paddingTop:t,paddingBottom:i}=window.getComputedStyle(e);return[t,i].reduce((e,t)=>e-Number((t||"").replace("px","")),e.clientHeight)}function c(e,t){var i;i=i=>i(e).trigger(t),window.jQuery&&i(window.jQuery)}i.r(t),i.d(t,"unwrap",(function(){return s})),i.d(t,"attr",(function(){return r})),i.d(t,"addClass",(function(){return n})),i.d(t,"html",(function(){return o})),i.d(t,"contentWidth",(function(){return a})),i.d(t,"contentHeight",(function(){return l})),i.d(t,"trigger",(function(){return c}))},UlDV:function(e,t,i){"use strict";i.r(t),i.d(t,"RestrictedToolsetBootloader",(function(){return r}));var s=i("cZRT");class r extends s.a{_startLoading(){return Promise.all([i.e("react"),i.e(1),i.e(2),i.e(7),i.e(11),i.e(16),i.e(18),i.e(20),i.e(22),i.e(23),i.e(24),i.e(35),i.e(42),i.e(50),i.e(66),i.e(68),i.e(73),i.e(74),i.e(0),i.e(4),i.e(10),i.e(14),i.e(38),i.e(57),i.e("restricted-toolset")]).then(i.bind(null,"miV2")).then(e=>e.getRestrictedToolSet())}}},UqOQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var s=i("aIyQ"),r=i.n(s),n=i("e3/o");function o(e){return e.properties().visible.value()}function a(e){return!o(e)}class l{constructor(e,t,i){this._onChanged=new r.a,this._lineToolsSet=new Set,this._lineTools=[...e],this._lineToolsSet=new Set(this._lineTools),this._name=t,this.id=i||Object(n.randomHashN)(6)}lineTools(){return this._lineTools}name(){return this._name}setName(e){this._doAndFireOnChange(()=>{this._name=e})}isActualSymbol(){return this._lineTools.length>0&&this._lineTools[0].isActualSymbol()&&this._lineTools[0].isActualCurrency()&&this._lineTools[0].isActualUnit()}symbol(){return this._lineTools[0].symbol()}containsLineTool(e){return this._lineToolsSet.has(e)}addLineTools(e){this._doAndFireOnChange(t=>{e.forEach(i=>{this._lineToolsSet.add(i),t.push(...e.map(e=>e.id()))}),this._lineTools.push(...e)})}excludeLineTool(e){this._doAndFireOnChange(t=>{this._lineToolsSet.delete(e);const i=this._lineTools.indexOf(e);this._lineTools.splice(i,1),t.push(e.id())})}excludeLineTools(e){this._doAndFireOnChange(t=>{const i=new Set(e);e.forEach(e=>this._lineToolsSet.delete(e)),this._lineTools=this._lineTools.filter(e=>!i.has(e)),t.push(...e.map(e=>e.id()))})}state(){return{id:this.id,name:this._name,tools:this._lineTools.map(e=>e.id())}}visibility(){const e=this._lineTools.some(o),t=this._lineTools.some(a);return e&&!t?"Visible":t&&!e?"Invisible":"Partial"}locked(){const e=this._lineTools.some(e=>e.properties().frozen.value()),t=this._lineTools.some(e=>!e.properties().frozen.value());return e&&!t?"Locked":t&&!e?"Unlocked":"Partial"}isActualInterval(){const e=this._lineTools.some(e=>e.isActualInterval()),t=this._lineTools.some(e=>!e.isActualInterval());return e&&!t?"IsActualInterval":t&&!e?"IsNotActualInterval":"Partial"}onChanged(){return this._onChanged}static fromState(e,t){const i=[];for(const s of t.tools){const t=e.dataSourceForId(s);null!==t&&i.push(t)}return i.length>0?new l(i,t.name,t.id):null}_doAndFireOnChange(e){const t=[],i=this.visibility(),s=this.locked(),r=this.name(),n=this.isActualInterval()
|
||
;e(t);const o={affectedLineTools:t,visibilityChanged:this.visibility()!==i,lockedChanged:s!==this.locked(),titleChanged:r!==this.name(),isActualIntervalChanged:n!==this.isActualInterval()};this._onChanged.fire(o)}}},V086:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("GEp6").distanceToLine,n=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty,a=i("j3hX").LineToolColorsProperty;class l extends n{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"obU/",7)).then(({EllipsePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){var i=this.pointToScreenPoint(this._points[0])[0],s=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0];this._dist=r(i,s,n).distance||0}}_preparePoint(e,t){var i=this._preparePointInternal(e,t,!1);return t&&t.shift()&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i}_preparePointInternal(e,t,i){var r=Object.assign({},e);if(t&&t.shift()){var n=this.points().length;if(!this._fakePointAdded&&3===n&&!i)return r;if(this._fakePointAdded||2===n||i){this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,super._addPointIntenal(e));var o=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=a.x-o.x,c=a.y-o.y,h=Math.sqrt(l*l+c*c)/2,u=a.subtract(o),d=o.add(a).scaled(.5),p=new s(-u.y,u.x);p=p.normalized();var _=d.add(p.scaled(h));r=this.screenPointToPoint(_),(TradingView.isNaN(r.price)||TradingView.isNaN(r.index))&&(r=this.screenPointToPoint(d))}}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return r}_fixVerticalDiameterPoints(e,t,i){var s=this.pointToScreenPoint(e)[0],r=this.pointToScreenPoint(t)[0],n=this._model.timeScale(),o=n.indexToCoordinate(e.index),a=n.indexToCoordinate(i.index),l=2*Math.abs(o-a);l*=t.price>e.price?1:-1,e.price=this.screenPointToPoint({x:s.x,y:r.y+l}).price}addPoint(e,t,i){var s=n.prototype.addPoint.call(this,e,t,i);return s&&(this._fakePointAdded=!1),s}setPoint(e,t,i){var n=Object.assign({},t),o=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift()){this._snapPoint45Degree(n,this._points[1]),this._points[0]=n,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}o=this.pointToScreenPoint(n)[0];var c=a.subtract(o),h=o.add(a).scaled(.5);d=(d=new s(-c.y,c.x)).normalized(),l=h.add(d.scaled(this._dist)),l=this.screenPointToPoint(l),this._points[0]=n,this._points[2]=l;break;case 1:if(i&&i.shift()){this._snapPoint45Degree(n,this._points[0]),this._points[1]=n,this._points[2]=this._preparePointInternal(this._points[2],i,!0),
|
||
this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}c=(a=this.pointToScreenPoint(n)[0]).subtract(o),h=o.add(a).scaled(.5);d=(d=new s(-c.y,c.x)).normalized(),l=h.add(d.scaled(this._dist)),l=this.screenPointToPoint(l),this._points[1]=n,this._points[2]=l;break;case 2:n=this.pointToScreenPoint(n)[0];var u=r(o,a,n).distance;c=a.subtract(o),h=o.add(a).scaled(.5);d=(d=new s(-c.y,c.x)).normalized(),l=h.add(d.scaled(u)),l=this.screenPointToPoint(l),this._points[2]=l;break;case 3:n=this.pointToScreenPoint(n)[0];var d;u=r(o,a,n).distance,c=a.subtract(o),h=o.add(a).scaled(.5);d=(d=new s(-c.y,c.x)).normalized(),l=h.add(d.scaled(u)),l=this.screenPointToPoint(l),this._points[2]=l}this.normalizePoints()}pointsCount(){return 3}name(){return"Ellipse"}hasEditableCoordinates(){return!1}migrateVersion(e,t,i){if(1===e&&2===this._points.length){var s=this._points[0].price,r=.5*(this._points[0].price+this._points[1].price);this._points[0]={price:r,index:this._points[0].index},this._points[1]={price:r,index:this._points[1].index},this._points.push({price:s,index:this._points[0].index})}if(1===e&&2===this._timePoint.length){s=this._timePoint[0].price,r=.5*(this._timePoint[0].price+this._timePoint[1].price);this._timePoint[0].price=r,this._timePoint[1].price=r;var n={price:s,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t};this._timePoint.push(n)}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Zd1D"))).GeneralFiguresDefinitionsViewModel}static createProperties(e){var t=new o("linetoolellipse",e);return l._configureProperties(t),t}static _configureProperties(e){n._configureProperties(e),e.addChild("linesColors",new a([e.childs().color]))}}l.version=2,t.LineToolEllipse=l},V3Oj:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolText",(function(){return c})),i.d(t,"LineToolTextAbsolute",(function(){return h}));var s=i("Eyy1"),r=i("Ss5c"),n=i("tc+8"),o=i.n(n),a=i("Ocx9"),l=i("j3hX");class c extends r.LineDataSource{constructor(e,t){const s=t||c.createProperties();super(e,s),this._barSpacing=e.timeScale().barSpacing(),i.e("lt-pane-views").then(i.bind(null,"mr3a")).then(({TextPaneView:t})=>{this._setPaneViews([new t(this,e)])})}setPoint(e,t,i){const s=this.properties().childs();let r;if(0===e&&s.wordWrapWidth.value()){const e=this.model().timeScale();r=this.isFixed()?this.fixedPoints()[0].x:e.indexToCoordinate(this.points()[0].index);const i=e.indexToCoordinate(t.index)-r-~~(s.fontsize.value()/6);if(!isFinite(i))return;s.wordWrapWidth.setValue(Math.max(100,i))}}pointsCount(){return 1}name(){return"Text"}setPriceScale(e){super.setPriceScale(e),e&&e.priceRange()&&(this._priceDencity=e.height()/Object(s.ensureNotNull)(e.priceRange()).length(),this._isPriceDencityLog=e.isLog())}restoreSize(){const e=Object(s.ensureNotNull)(this.priceScale());this._barSpacing=this.model().timeScale().barSpacing(),
|
||
this._priceDencity=e.height()/Object(s.ensureNotNull)(e.priceRange()).length(),this.updateAllViews(),this._model.updateSource(this)}properties(){return super.properties()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}state(e){const t=super.state(e);return e&&(t.state.fixedSize=!1),t}barSpacing(){return this._barSpacing}priceDencity(){return this._priceDencity}isPriceDencityLog(){return this._isPriceDencityLog}hasEditableCoordinates(){return!1}static createProperties(e){const t=new a.DefaultProperty("linetooltext",e);return c._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"QWxu")).then(e=>e.TextDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.a(window.t("Text"))),e.addExclusion("text"),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().color])),e.addExclusion("linesColors"),e.addExclusion("textsColors")}}class h extends c{constructor(e,t){super(e,t||h.createProperties())}name(){return"Anchored Text"}hasEditableCoordinates(){return!1}isFixed(){return!0}static createProperties(e){const t=new a.DefaultProperty("linetooltextabsolute",e);return h._configureProperties(t),t}static _configureProperties(e){c._configureProperties(e)}}},VNzU:function(e,t,i){"use strict";i.r(t);i("Dq3s");i.d(t,"layouts",(function(){return n})),i.d(t,"isSingleLayout",(function(){return o})),i.d(t,"isMultipleLayout",(function(){return a}));const s={s:{title:"1 chart",count:1,sizer:(e,t)=>{if(0!==t)throw new RangeError("invalid index");return e}}};let r;r={};const n=Object.assign(Object.assign({},s),r);function o(e){return"s"===e}function a(e){return!o(e)}},VVxS:function(e,t,i){"use strict";const{getLogger:s}=i("txPx"),r=s("TVLocalStorage");var n=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength();try{this._report()}catch(e){}};n.prototype._report=function(){if(this.isAvailable){const t=10,i=[];for(let e=0;e<this.localStorage.length;e++){const t=this.key(e);i.push({key:t,length:String(this.getItem(t)).length})}i.sort((e,t)=>t.length-e.length);const s=i.slice(0,t);i.sort((e,t)=>t.key.length-e.key.length);const n=i.slice(0,t);r.logNormal("Total amount of keys in Local Storage: "+this.length),r.logNormal(`Top ${t} keys with longest values: ${JSON.stringify(s)}`),r.logNormal(`Top ${t} longest key names: ${JSON.stringify(n)}`);try{navigator.storage.estimate().then(e=>{r.logNormal("Storage estimate: "+JSON.stringify(e))})}catch(e){}}},n.prototype.length=0,n.prototype.isAvailable=!1,n.prototype.localStorage={"tvlocalstorage.available":"false"},
|
||
n.prototype._updateLength=function(){if(this.isAvailable)this.length=this.localStorage.length;else{var e,t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},n.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},n.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},n.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},n.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},n.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()};var o=function(e){this.storage=e};o.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},o.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new n,window.TVLocalStorageAsync=new o(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},VaSN:function(e,t,i){"use strict";i.r(t),i.d(t,"lastEventIsTouch",(function(){return n})),i.d(t,"lastEventIsMouse",(function(){return o})),i.d(t,"setLastEventIsTouch",(function(){return a}));var s=i("qFKp");let r=Object(s.supportTouch)();function n(){return r}function o(){return r}function a(e){r=e}},VdBB:function(e,t,i){"use strict";function s(e,t,i){if(e.isTouch){if(void 0!==i)return!0}else if(void 0!==t)return!0;return!1}function r(e,t,i){if(e.isTouch){if(void 0!==i)return i(e),!0}else if(void 0!==t)return t(e),!0;return!1}function n(e,t,i,s){return void 0!==t.executeDefaultAction&&(e.isTouch?Boolean(t.executeDefaultAction[s]):Boolean(t.executeDefaultAction[i]))}var o;i.r(t),i.d(t,"hasMouseOrTouchHandler",(function(){return s})),i.d(t,"tryCallHandler",(function(){return r})),i.d(t,"shouldDefaultActionBeExecuted",(function(){return n})),i.d(t,"AreaName",(function(){return o})),i.d(t,"HitTestResult",(function(){return a})),function(e){e.Style="Style",e.Text="Text",e.SourceItemMove="SourceItemMove"}(o||(o={}));class a{constructor(e,t,i){this._result=e,this._data=t||null,this._eraseMarker=i}result(){return this._result}data(){return this._data}hasPressedMoveHandler(e){return null!==this._data&&s(e,this._data.pressedMouseMoveHandler,this._data.touchMoveHandler)}tryCallMouseDownOrTouchStartHandler(e){return null!==this._data&&r(e,this._data.mouseDownHandler,this._data.touchStartHandler)}tryCallMouseUpOrTouchEndHandler(e){return null!==this._data&&r(e,this._data.mouseUpHandler,this._data.touchEndHandler)}tryCallMouseEnterHandler(e){return null!==this._data&&r(e,this._data.mouseEnterHandler)}tryCallMouseLeaveHandler(e){return null!==this._data&&r(e,this._data.mouseLeaveHandler)}tryCallMouseMoveHandler(e){return null!==this._data&&r(e,this._data.mouseMoveHandler)}tryCallClickOrTapHandler(e){
|
||
return null!==this._data&&r(e,this._data.clickHandler,this._data.tapHandler)}tryCallDblClickOrDblTapHandler(e){return null!==this._data&&r(e,this._data.doubleClickHandler,this._data.doubleTapHandler)}tryCallContextMenuHandler(e){return null!==this._data&&r(e,this._data.contextMenuHandler,this._data.touchContextMenuHandler)}eraseMarker(){return this._eraseMarker}}a.MOVEPOINT_BACKGROUND=1,a.REGULAR=2,a.MOVEPOINT=3,a.CHANGEPOINT=4,a.CUSTOM=5},Vdly:function(e,t,i){"use strict";(function(e){i("qFKp");i("wVAQ").fetch;var t=i("dTSQ").regExpEscape,s=i("FBuY").TVXWindowEvents,r=i("VVxS").TVLocalStorage,n=i("aIyQ"),o=i("Kxc7"),a=["s.tradingview.com","betacdn.tradingview.com"],l=o.enabled("use_localstorage_for_settings"),c=window.TVSettings=function(){var e=!1,i=null;function h(){return!i&&l}try{e=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(I){}if(e){var u={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},d=function(e,t,i){var s=u[e];return null==s?t:s},p=function(){};return{loaded:!1,loadedModel:!1,getValue:d,getJSON:d,getBool:d,getFloat:d,getInt:d,setValue:p,setJSON:p,remove:p,keys:function(){return Object.keys(u)},keysMask:function(){return[]},sync:p,onSync:{subscribe:function(){}}}}window.environment;var _,m=TradingView.onWidget()?"tradingview-widget":"tradingview",f={},g=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^orderpanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/,/^trading\.orderWidgetMode\./,/^symbolWatermark$/,/^pinereference\.size$/,/^pinereference\.position$/,/^hint\.+/];function v(e){return m+"."+e}function b(e,t){var i=f[e];return null==i?t:i}function S(e,t,i){i=i||{};var s=""+t;return f[e]!==s&&(f[e]=s,w(e)),i.forceFlush&&!_&&(_=setTimeout((function(){_=void 0,C()}),10)),c}function y(e,t){return t=t||{},null!=f[e]&&(delete f[e],w(e)),t.forceFlush&&C(),c}function w(e){if(i)null==f[e]?i.removeValue(e):i.setValue(e,f[e]);else if(h())try{null==f[e]?r.removeItem(v(e)):r.setItem(v(e),f[e])}catch(I){}else 0;s.emit("settings",JSON.stringify({key:e,value:f[e]}))}function C(e){}function P(){return Object.keys(f)}function x(e){for(var t=0;t<g.length;++t)if(g[t].exec(e))return!0;return!1}function T(e){f={};for(var t=0===Object.keys(e).length,i=m+".",s=r.length;s--;){var n=r.key(s);if(n&&n.substring(0,i.length)===i){if(t)S(n.substring(i.length),r.getItem(n));r.removeItem(n)}}Object.keys(e).forEach((function(t){f[t]=e[t]+""}))}s.on("settings",(function(e){var t=JSON.parse(e);null==t.value?delete f[t.key]:f[t.key]=t.value}));var M=new n;return document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState||document.hidden})),window.addEventListener("beforeunload",(function(){})),{loaded:!1,loadedModel:!1,getValue:b,getJSON:function(e,t){
|
||
var i=b(e,void 0);if(null==i)return t;try{return JSON.parse(i)}catch(s){return y(e),t}},getBool:function(e,t){var i=b(e);return null==i?t:!(!i||"false"===i||0==+i)},getFloat:function(e,t,i){var s=b(e,void 0);if(null==s)return t;var r=parseFloat(s);if(!isFinite(r))throw new TypeError('"'+s+'" is not float (key: "'+e+'")');return r},getInt:function(e,t,i){var s=b(e,void 0);if(null==s)return t;var r=parseInt(s,10);if(!isFinite(r))throw new TypeError('"'+s+'" is not int (key: "'+e+'")');return r},setValue:S,setJSON:function(e,t,i){return S(e,JSON.stringify(t),i),c},remove:y,keys:P,keysMask:function(e,i){for(var s=P(),r=[],n=(e=new RegExp("^"+t(e).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),s.length-1);n>=0;n--)e.test(s[n])&&r.push(s[n]),e.lastIndex=0;return r},sync:function(e){null!==e?(i?T(i.initialSettings||{}):h()?(function(){if(TradingView.onWidget()&&a.includes(window.location.host))for(var e=r.length;e--;){var t=r.key(e);if(0===t.indexOf("tradingview.")){var i=t.replace("tradingview.",m+".");r.setItem(i,r.getItem(t)),r.removeItem(t)}}}(),function(){f={};for(var e=m+".",t=!o.enabled("save_chart_properties_to_local_storage"),i=r.length;i--;){var s=r.key(i);if(s&&s.substring(0,e.length)===e){var n=s.substring(e.length);t&&!x(n)||(f[n]=r.getItem(s))}}}()):T(e||{}),M.fire()):!0},onSync:M,setSettingsAdapter:function(e){i=e}}}();e&&e.exports&&(e.exports=c)}).call(this,i("YuTi")(e))},VgjZ:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceAxisRendererOptionsProvider",(function(){return n}));var s=i("XlJ7"),r=i("zDbI");class n{constructor(e){this._rendererOptions={borderSize:1,tickLength:5,fontSize:NaN,font:"",color:"",paneBackgroundColor:"",paddingBottom:0,paddingInner:0,paddingOuter:0,paddingTop:0,lineSpacing:0},this._chartModel=e}options(){const e=this._rendererOptions,t=this._chartModel.properties(),i=t.scalesProperties.fontSize.value();return e.fontSize!==i&&(e.fontSize=i,e.font=Object(s.makeFont)(i,r.CHART_FONT_FAMILY,""),e.paddingTop=2.5/12*i,e.paddingBottom=e.paddingTop,e.paddingInner=i/12*e.tickLength,e.paddingOuter=i/12*e.tickLength,e.lineSpacing=2/12*i),e.color=t.scalesProperties.textColor.value(),e.paneBackgroundColor=t.paneProperties.background.value(),this._rendererOptions}}},ViuT:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("Kxc7"),n=i("jCNj"),o=i("Y7w9"),a=i("OLhd"),l=i("tqok"),c=i("/bs+");function h(e){return 60*e*60*1e3}function u(e){return 60*e*1e3}const d=[{divisor:1,weight:20},{divisor:(p=1,1e3*p),weight:19},{divisor:u(1),weight:20},{divisor:u(5),weight:21},{divisor:u(30),weight:22},{divisor:h(1),weight:30},{divisor:h(3),weight:31},{divisor:h(6),weight:32},{divisor:h(12),weight:33}];var p;function _(e,t){if(null!==t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;const i=t.getTime(),s=e.getTime();for(let e=d.length-1;e>=0;--e)if(Math.floor(i/d[e].divisor)!==Math.floor(s/d[e].divisor))return d[e].weight}return 20}function m(e,t,i=0){if(0===e.length)return[];let s=i,r=i;const n=[]
|
||
;for(;s<e.length;)r>=t.length?(n.push({old:s,new:l.a}),s++):e[s].timeMs===t[r].timeMs?(s!==r&&n.push({old:s,new:r}),s++,r++):e[s].timeMs<t[r].timeMs?(n.push({old:s,new:l.a}),s++):r++;return n.sort((e,t)=>{if(e.new===t.new&&e.new===l.a)return e.old-t.old;if(e.new===l.a)return-1;if(t.new===l.a)return 1;const i=e.old-e.new,s=t.old-t.new;return i>0?s>0?e.old-t.old:-1:s<0?t.new-e.new:1})}function f(e,t){return{span:e.markWeight,time:e.displayTime,index:t}}i.d(t,"SessionTimeScale",(function(){return v}));const g=r.enabled("end_of_period_timescale_marks");class v{constructor(){this._completed=!0,this._mainSymbolExtrapolator=null,this._pointDataByTimePoint=new Map,this._seriesIds=new Set,this._displayTimezone=null,this._minFutureBarsCount=0,this._sortedTimePoints=[]}destroy(){this.clearTimeScale()}setCompleted(e){this._completed=e}isCompleted(){return this._completed}clearTimeScale(){return this._pointDataByTimePoint.clear(),this._seriesIds.clear(),this._sortedTimePoints=[],{baseIndex:0,pointsIndex:0,indexChange:[],marks:[],points:[]}}indexOfTime(e){if(0===this._sortedTimePoints.length)return null===this._mainSymbolExtrapolator?null:this._mainSymbolExtrapolator.indexOfTime(e);if(e<this._sortedTimePoints[0].timeMs){if(null===this._mainSymbolExtrapolator)return null;const t=this._mainSymbolExtrapolator.indexOfTime(e),i=this._mainSymbolExtrapolator.indexOfTime(this._sortedTimePoints[0].timeMs);if(null===t||null===i)return null;let s=t.index-i.index;return i.timeMs!==this._sortedTimePoints[0].timeMs&&(s-=1),{index:s,timeMs:t.timeMs}}if(e>this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs){if(null===this._mainSymbolExtrapolator)return null;const t=this._mainSymbolExtrapolator.indexOfTime(e),i=this._mainSymbolExtrapolator.indexOfTime(this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs);if(null===t||null===i)return null;const s=t.index-i.index-1;return{index:this._sortedTimePoints.length+s,timeMs:t.timeMs}}let t=Object(o.lowerbound)(this._sortedTimePoints,e,(e,t)=>e.timeMs<t);return this._sortedTimePoints[t].timeMs!==e&&(t-=1),{index:t,timeMs:this._sortedTimePoints[t].timeMs}}setMainSymbolExtrapolator(e){this._mainSymbolExtrapolator=e,this._updateFutureBars(),this._fillPointsData(this._sortedTimePoints,0)}setMinFutureBarsCount(e){this._minFutureBarsCount=e,this._updateFutureBars()}minFutureBarsCount(){return this._minFutureBarsCount}firstFutureBarIndex(){return this._sortedTimePoints.length}lastSessionBarIndex(){return 0===this._sortedTimePoints.length?null:this._sortedTimePoints.length-1}tickMarks(e=0){const t=this.firstFutureBarIndex();Object(s.assert)(e<=t,"tickmarks cannot be filtered in the future");const i=this._futureBars().map((e,t)=>({timeMs:e,markWeight:0,displayTime:NaN}));this._fillPointsData(i,0,0!==this._sortedTimePoints.length?this._sortedTimePoints[this._sortedTimePoints.length-1].displayTime:null);const r=[];for(let s=e;s<this._sortedTimePoints.length;++s)r.push(f(this._sortedTimePoints[s],s));const n=i.map((e,i)=>f(e,i+t));return r.concat(n)}setTimezone(e){
|
||
this._displayTimezone="exchange"===e?null:Object(n.get_timezone)(e),this._fillPointsData(this._sortedTimePoints,0)}fillIndexesInRows(e){if(0===e.length)return;let t=-1,i=Object(o.lowerbound)(this._sortedTimePoints,Math.round(1e3*e[0].value[0]),(e,t)=>e.timeMs<t);for(const r of e){const e=Math.round(1e3*r.value[0]);for(;i<this._sortedTimePoints.length&&this._sortedTimePoints[i].timeMs<e;)i+=1;i!==this._sortedTimePoints.length&&this._sortedTimePoints[i].timeMs===e||(i-=1),Object(s.assert)(i!==t,"data must have unique times"),t=i,r.index=i}Object(s.assert)(i<this._sortedTimePoints.length,"data must be within a data range")}convertTimesToIndexes(e){if(0===e.length)return[];let t=-1,i=Object(o.lowerbound)(this._sortedTimePoints,e[0],(e,t)=>e.timeMs<t);return e.map(e=>{for(;i<this._sortedTimePoints.length&&this._sortedTimePoints[i].timeMs<e;)i+=1;if(0===i&&e<this._sortedTimePoints[0].timeMs)return l.a;if(i>=this._sortedTimePoints.length){const t=this.indexOfTime(e);if(null===t)return l.a;i=t.timeMs!==e?t.index+1:t.index}return Object(s.assert)(i>t,"data must have unique sorted times"),t=i,i})}firstSeriesBarTime(){return 0===this._sortedTimePoints.length?null:this._sortedTimePoints[0].timeMs}replaceSeriesBarsTimesTail(e,t){if(0===t.length)return null;if(!this._seriesIds.has(e))return this.setSeriesBarsTimes(e,t);const i=[],s=Object(o.lowerbound)(this._sortedTimePoints,t[0],(e,t)=>e.timeMs<t);for(let o=s;o<this._sortedTimePoints.length;++o){const t=this._sortedTimePoints[o];t.pointData.series.delete(e)&&0===t.pointData.series.size&&i.push(t)}const r=this._addBarsTimesToSeries(e,t,!0);this._cleanupPointsData(i);const n=r.map(e=>({timeMs:e.timeMs,pointData:e.pointData,markWeight:0,displayTime:NaN}));for(let o=s;o<this._sortedTimePoints.length;++o){const e=this._sortedTimePoints[o];0!==e.pointData.series.size&&n.push(e)}n.sort((e,t)=>e.timeMs-t.timeMs);const a=this._updateTimeScalePointsTail(n);return this._applyTimeScaleChanges(a,!1)}setSeriesBarsTimes(e,t){let i=0!==this._pointDataByTimePoint.size;if(this._seriesIds.has(e))if(1===this._seriesIds.size)i=!1,this._pointDataByTimePoint.clear();else for(const c of this._sortedTimePoints)c.pointData.series.delete(e);this._addBarsTimesToSeries(e,t,!1);const s=this._seriesIds.size;0===t.length?this._seriesIds.delete(e):this._seriesIds.add(e),i&&this._cleanupPointsData(this._sortedTimePoints);const r=s<this._seriesIds.size,n=s>this._seriesIds.size,o=r&&2===this._seriesIds.size||n&&1===this._seriesIds.size,a=[];this._pointDataByTimePoint.forEach((e,t)=>{a.push({markWeight:0,timeMs:t,displayTime:NaN,pointData:e})}),a.sort((e,t)=>e.timeMs-t.timeMs);const l=this._updateTimeScalePoints(a);return this._applyTimeScaleChanges(l,o)}_updateFutureBars(){if(0===this._minFutureBarsCount||null===this._mainSymbolExtrapolator)return;if(0!==this._sortedTimePoints.length){const e=this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs;this._mainSymbolExtrapolator.ensureExtrapolatedToFutureTime(e)}const e=this._futureBarsFirstPointIndex()
|
||
;this._mainSymbolExtrapolator.setMinFutureBarsCount(e+this._minFutureBarsCount)}_addBarsTimesToSeries(e,t,i){const s=i?[]:null;for(const r of t){const t=this._pointDataByTimePoint.get(r);if(void 0===t){const t=new Set;t.add(e);const i={index:0,series:t};this._pointDataByTimePoint.set(r,i),null!==s&&s.push({timeMs:r,pointData:i})}else t.series.add(e)}return s}_futureBarsFirstPointIndex(){if(null===this._mainSymbolExtrapolator||0===this._sortedTimePoints.length)return 0;const e=this._mainSymbolExtrapolator.futureBars();return Object(o.upperbound_int)(e,this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs)}_futureBars(){return null===this._mainSymbolExtrapolator?[]:this._mainSymbolExtrapolator.futureBars().slice(this._futureBarsFirstPointIndex(),this._futureBarsFirstPointIndex()+1e3)}_cleanupPointsData(e){for(const t of e)0===t.pointData.series.size&&this._pointDataByTimePoint.delete(t.timeMs)}_updateTimeScalePoints(e){let t=-1;for(let s=0;s<this._sortedTimePoints.length&&s<e.length;++s){const i=this._sortedTimePoints[s],r=e[s];if(i.timeMs!==r.timeMs){t=s;break}r.markWeight=i.markWeight,r.displayTime=i.displayTime}if(t=b(t,this._sortedTimePoints.length,e.length),-1===t)return null;for(let s=t;s<e.length;++s){e[s].pointData.index=s}this._fillPointsData(e,t);const i=m(this._sortedTimePoints,e,t);return this._sortedTimePoints=e,this._updateFutureBars(),{pointsIndex:t,indexChange:i}}_updateTimeScalePointsTail(e){if(0===e.length)return null;const t=Object(o.lowerbound)(this._sortedTimePoints,e[0].timeMs,(e,t)=>e.timeMs<t);let i=-1;for(let n=0;n<e.length;++n){const s=e[n],r=t+n;if(s.pointData.index=r,r>=this._sortedTimePoints.length)continue;this._sortedTimePoints[r].timeMs!==s.timeMs&&-1===i&&(i=r)}const s=t+e.length;if(i=b(i,this._sortedTimePoints.length,s),-1===i)return null;this._fillPointsData(e,0,0===t||0===this._sortedTimePoints.length?null:this._sortedTimePoints[t-1].displayTime);const r=m(this._sortedTimePoints.slice(t),e).map(e=>({old:e.old+t,new:e.new===l.a?e.new:e.new+t}));{const i=this._sortedTimePoints;let r=0;for(;t+r<i.length&&r<e.length;)i[t+r]=e[r],r+=1;for(;r<e.length;++r)i.push(e[r]);i.length=s}return this._updateFutureBars(),{pointsIndex:i,indexChange:r}}_getBaseIndex(){return Math.max(0,this._sortedTimePoints.length-1)}_fillPointsData(e,t,i=null){this._fillDiplayTimeForPoints(e,t),function(e,t=0,i=null){let s=0===t||0===e.length?i:e[t-1].displayTime,r=null!==s?new Date(1e3*s):null,n=0;for(let o=t;o<e.length;++o){const t=e[o],i=new Date(1e3*t.displayTime);t.markWeight=_(i,r),n+=t.displayTime-(s||t.displayTime),r=i,s=t.displayTime}if(0===t&&e.length>1&&null===i){const t=Math.ceil(n/(e.length-1)),i=new Date(1e3*(e[0].displayTime-t));e[0].markWeight=_(new Date(1e3*e[0].displayTime),i)}}(e,t,i)}_applyTimeScaleChanges(e,t){if(null===e)return t?(this._fillPointsData(this._sortedTimePoints,0),{points:[],pointsIndex:0,baseIndex:this._getBaseIndex(),indexChange:[],marks:this.tickMarks(0)}):null;let i=e.pointsIndex;if(0!==i&&t&&(this._fillPointsData(this._sortedTimePoints,0),i=0),
|
||
0===this._sortedTimePoints.length)return{baseIndex:0,pointsIndex:0,indexChange:[],marks:[],points:[]};const s=[];for(let r=e.pointsIndex;r<this._sortedTimePoints.length;++r)s.push(this._sortedTimePoints[r].timeMs/1e3);return Object.assign(Object.assign({},e),{points:s,baseIndex:this._getBaseIndex(),marks:this.tickMarks(i)})}_fillDiplayTimeForPoints(e,t=0){if(null===this._mainSymbolExtrapolator)return;const i=this._mainSymbolExtrapolator.interval(),s=this._mainSymbolExtrapolator.barBuilder(),r=this._mainSymbolExtrapolator.symbolInfo(),o=null===this._displayTimezone?Object(n.get_timezone)(r.timezone):this._displayTimezone,l=1===this._seriesIds.size,h=i.isDWM(),u=h?Object(a.createDwmAligner)(i.value(),{timezone:r.timezone,corrections:l?r.corrections:void 0,holidays:l?r.holidays:void 0,session:l?r.session:"24x7"}):null,d=!h;for(let a=t;a<e.length;++a){let t=e[a].timeMs/1e3;g&&(t=Object(c.a)(s,t,i)),null!==u&&(t=Math.floor(u.timeToExchangeTradingDay(1e3*t)/1e3)),d&&(t=Math.floor(Object(n.utc_to_cal_ts)(o,1e3*t)/1e3)),e[a].displayTime=t}}}function b(e,t,i){return-1===e&&t!==i&&(e=i<t?Math.max(0,i-1):t),e}},"W+6j":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("ww0J");class r extends s.a{constructor(e,t){super(e,t),this._study=e}color(){return this._study.isFailed()||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":super.color()}}},W3MX:function(e){
|
||
e.exports=JSON.parse('{"color-aqua-spring":"#ebf9f5","color-army-green":"#3d2c12","color-army-green-2":"#31230d","color-athens-gray-1":"#f2f3f5","color-athens-gray-2":"#f7f8fa","color-athens-gray-3":"#eceff2","color-black":"#000000","color-black-180":"#b4b4b4","color-blue-dianne":"#21384d","color-bluish":"#2185cc","color-bright-gray":"#363c4e","color-brownish-grey":"#8d6e63","color-carnation":"#f04561","color-catskill-white":"#e1ecf2","color-charade":"#2f3241","color-charcoal-grey":"#323337","color-curious-blue":"#299dcd","color-dark-blue-grey":"#123440","color-darkness-blue-grey":"#12213b","color-dark-grey":"#292a2d","color-dark-grey-blue":"#28415a","color-dark-sky-blue":"#37a6ef","color-dark-slate-blue":"#194453","color-deep-sea-blue":"#016087","color-duck-egg-blue":"#e1eff9","color-ebony-clay":"#262b3e","color-foam":"#d7f0fb","color-gull-gray":"#9db2bd","color-humming-bird":"#d3eef9","color-keppel-1":"#37bc9b","color-keppel-2":"#34b293","color-lavender-blush":"#ffedf0","color-lightish-purple":"#a75ee8","color-loblolly":"#c5cbce","color-manatee":"#878ca8","color-mandy":"#eb4d5c","color-medium-blue":"#2e7bb2","color-milk-chocolate":"#6f2626","color-mirage-1":"#131722","color-mirage-2":"#171b29","color-mirage-3":"#1c2030","color-mischka":"#d6d8e0","color-morning-glory":"#9addcc","color-oslo-gray":"#8b8e95","color-pale":"#fff2cf","color-pale-grey-1":"#f9fafb","color-pale-grey-2":"#e7ebee","color-pale-sky":"#6b7988","color-picton-blue-1":"#3bb3e4","color-picton-blue-2":"#41bef1","color-puerto-rico":"#3bc2a1","color-purple-brown":"#4e2934","color-purple-brown-2":"#3d2028","color-radical-red":"#ff4a68","color-regent-gray":"#8797a5","color-scooter":"#38acdb","color-silver-tree":"#53b987","color-slate-gray":"#758696","color-sundown":"#ffa4b3","color-sunglow":"#ffca3b","color-tan-hide":"#ff9850","color-trout-1":"#4c525e","color-trout-2":"#4f5966","color-violet-1":"#332738","color-violet-2":"#271d2b","color-water-blue":"#1592e6","color-white":"#ffffff","color-white-ice":"#ebf7fc","color-wild-watermelon":"#ff5773","color-bg-primary":"color-white","color-bg-primary-hover":"color-cold-gray-100","color-bg-secondary":"color-white","color-bg-highlight":"color-cold-gray-50","color-bg-scroll-buttons":"color-cold-gray-100","color-legacy-bg-scroll-buttons":"color-cold-gray-850","color-legacy-bg-widget":"color-white","color-text-primary":"color-cold-gray-900","color-text-secondary":"color-cold-gray-500","color-text-tertiary":"color-cold-gray-400","color-text-disabled":"color-cold-gray-300","color-box-shadow":"color-cold-gray-300","color-divider":"color-cold-gray-150","color-divider-hover":"color-cold-gray-100","color-active-hover-text":"color-black","color-alert-text":"color-black","color-border-table":"color-cold-gray-100","color-brand":"color-tv-blue-500","color-brand-active":"color-tv-blue-600","color-brand-hover":"color-tv-blue-600","color-brand-light":"color-picton-blue-2","color-chart-page-bg":"color-cold-gray-150","color-common-tooltip-bg":"color-cold-gray-800","color-common-tooltip-text":"color-cold-gray-100","color-danger":"color-radical-red","color-depthrenderer-stroke-style":"color-athens-gray-1","color-highlight-new":"color-pale","color-input-bg":"color-white","color-input-publish-bg":"color-white","color-link":"color-tv-blue-500","color-link-hover":"color-tv-blue-600","color-link-active":"color-tv-blue-700","color-list-nth-child-bg":"color-athens-gray-2","color-pane-bg":"color-white","color-pane-secondary-bg":"color-cold-gray-100","color-popup-menu-item-hover-bg":"color-cold-gray-100","color-popup-menu-separator":"color-cold-gray-150","color-replay-data-mode":"color-radical-red","color-screener-description":"color-trout-2","color-legacy-success":"color-keppel-1","color-success":"color-minty-green-500","color-success-hover":"color-minty-green-600","color-success-active":"color-minty-green-700","color-toolbar-button-text":"color-cold-gray-900","color-toolbar-button-text-hover":"color-black","color-toolbar-button-text-active":"color-tv-blue-500","color-toolbar-button-text-active-hover":"color-tv-blue-600","color-toolbar-button-background-hover":"color-cold-gray-100","color-toolbar-button-background-secondary-hover":"color-cold-gray-150","color-toolbar-toggle-button-background-active":"color-tv-blue-500","color-toolbar-toggle-button-background-active-hover":"color-tv-blue-600","color-toolbar-interactive-element-text-normal":"color-cold-gray-900","color-toolbar-interactive-element-text-hover":"color-black","color-toolbar-opened-element-bg":"color-cold-gray-100","color-tooltip-bg":"color-ebony-clay","color-tv-dialog-caption":"color-trout-2","color-tv-dropdown-item-hover-bg":"color-athens-gray-1","color-underlined-text":"color-slate-gray","color-widget-pages-bg":"color-white","color-warning":"color-tan-orange-500","color-growing":"color-minty-green-400","color-falling":"color-ripe-red-400","color-collapse-tabs-border":"color-athens-gray-3","color-forex-icon":"color-bright-gray","color-list-item-active-bg":"color-dark-sky-blue","color-list-item-hover-bg":"color-white-ice","color-list-item-text":"color-ebony-clay","color-site-widget-hover":"color-athens-gray-1","color-attention":"color-sunglow","color-price-axis-label-back":"color-cold-gray-150","color-price-axis-label-text":"color-cold-gray-650","color-price-axis-gear":"color-cold-gray-900","color-price-axis-gear-hover":"#000000","color-price-axis-highlight":"color-cold-gray-150","color-marker-flagged":"color-ripe-red-400","color-marker-flagged-hovered":"color-ripe-red-600","color-bid":"color-tv-blue-500","color-ask":"color-ripe-red-400","color-sell":"color-ripe-red-400","color-buy":"color-tv-blue-500","color-neutral":"color-cold-gray-500","color-border":"#dadde0","color-border-chat-fields":"#c9cbcd","color-border-hover":"#c8c8c8","color-button-hover-bg":"#f2f2f2","color-depthrenderer-fill-style":"#555555","color-disabled-border-and-color":"#ececec","color-disabled-input":"#ececec","color-readonly-input":"#b4b4b4","color-empty-container-message":"#8a8a8a","color-icons":"#7d7d7d","color-input-textarea-readonly":"#555555","color-input-placeholder-text":"color-cold-gray-350","color-item-active-blue":"#eff9ff","color-item-hover-active-bg":"#f1f3f6","color-item-hover-bg":"#edf1f2","color-item-hover-blue":"#c6e9f8","color-item-selected-blue":"#eafafe","color-item-active-text":"color-white","color-item-active-bg":"color-tv-blue-500","color-list-item":"#888989","color-news-highlight":"#f2f5f8","color-placeholder":"#adaeb0","color-row-hover-active-bg":"#f1f3f6","color-sb-scrollbar-body-bg":"#d8d8d8","color-section-separator-border":"#b5b7b9","color-separator-table-chat":"#eaecef","color-tag-active-bg":"#cfdce3","color-tag-hover-bg":"#dce6ea","color-text-regular":"#4a4a4a","color-tv-button-checked":"#757575","color-brand-dark":"#2a2c39","color-scroll-bg":"color-cold-gray-200","color-scroll-border":"color-item-hover-active-bg","color-widget-border":"color-cold-gray-100","color-scroll-buttons-arrow":"color-white","color-control-intent-default":"color-cold-gray-200","color-control-intent-success":"color-minty-green-600","color-control-intent-primary":"color-tv-blue-500","color-control-intent-warning":"color-tan-orange-500","color-control-intent-danger":"color-ripe-red-500","color-seeking-alpha-brand":"#ff7200","color-pro":"color-minty-green-400","color-pro-hover":"color-minty-green-600","color-pro-plus":"color-tv-blue-500","color-pro-plus-hover":"color-tv-blue-600","color-pro-premium":"color-tan-orange-500","color-pro-premium-hover":"color-tan-orange-700","color-trial":"color-cold-gray-500","color-trial-hover":"color-cold-gray-600","color-mod":"color-ripe-red-400","color-mod-hover":"color-ripe-red-600","color-top":"color-banana-yellow-700","color-top-hover":"color-banana-yellow-800","color-ad":"color-banana-yellow-a700","color-broker-featured":"color-minty-green-400","color-broker-featured-hover":"color-minty-green-600","color-alert-status-active":"color-minty-green-400","color-alert-status-stopped":"color-ripe-red-500","color-alert-status-triggered":"color-tan-orange-500","color-covid19-confirmed":"color-ripe-red-500","color-covid19-recovered":"color-minty-green-500","color-covid19-deaths":"color-cold-gray-450","color-blue-gray-950":"#0C0E15","color-cold-gray-50":"#F8F9FD","color-cold-gray-100":"#F0F3FA","color-cold-gray-150":"#E0E3EB","color-cold-gray-200":"#D1D4DC","color-cold-gray-250":"#C1C4CD","color-cold-gray-300":"#B2B5BE","color-cold-gray-350":"#A3A6AF","color-cold-gray-400":"#9598A1","color-cold-gray-450":"#868993","color-cold-gray-500":"#787B86","color-cold-gray-550":"#6A6D78","color-cold-gray-600":"#5D606B","color-cold-gray-650":"#50535E","color-cold-gray-700":"#434651","color-cold-gray-750":"#363A45","color-cold-gray-800":"#2A2E39","color-cold-gray-850":"#1E222D","color-cold-gray-900":"#131722","color-cold-gray-950":"#0C0E15","color-ripe-red-50":"#FFEBEE","color-ripe-red-100":"#FFCDD2","color-ripe-red-200":"#ef9a9a","color-ripe-red-300":"#E57373","color-ripe-red-400":"#EF5350","color-ripe-red-500":"#F44336","color-ripe-red-600":"#E53935","color-ripe-red-700":"#D32F2F","color-ripe-red-800":"#C62828","color-ripe-red-900":"#B71C1C","color-ripe-red-a200":"#FF5252","color-ripe-red-a700":"#862226","color-ripe-red-a800":"#5B1E24","color-ripe-red-a900":"#351E25","color-tan-orange-50":"#FFF3E0","color-tan-orange-100":"#FFE0B2","color-tan-orange-200":"#FFCC80","color-tan-orange-300":"#ffb74d","color-tan-orange-400":"#FFA726","color-tan-orange-500":"#FF9800","color-tan-orange-600":"#FB8C00","color-tan-orange-700":"#F57C00","color-tan-orange-800":"#EF6C00","color-tan-orange-900":"#e65100","color-tan-orange-a200":"#ffab40","color-tan-orange-a400":"#ff9100","color-tan-orange-a700":"#FF6D00","color-iguana-green-100":"#C8E6C9","color-iguana-green-200":"#A5D6A7","color-iguana-green-300":"#81c784","color-iguana-green-400":"#66BB6A","color-iguana-green-500":"#4caf50","color-iguana-green-600":"#43a047","color-iguana-green-700":"#388e3c","color-iguana-green-800":"#2E7D32","color-iguana-green-900":"#1B5E20","color-iguana-green-a700":"#00c853","color-banana-yellow-100":"#FFF9C4","color-banana-yellow-200":"#FFF59D","color-banana-yellow-300":"#FFF176","color-banana-yellow-400":"#ffee58","color-banana-yellow-500":"#ffeb3b","color-banana-yellow-600":"#fdd835","color-banana-yellow-700":"#fbc02d","color-banana-yellow-800":"#f9a825","color-banana-yellow-900":"#F57F17","color-banana-yellow-a400":"#ffea00","color-banana-yellow-a700":"#ffd600","color-tv-blue-50":"#E3F2FD","color-tv-blue-100":"#BBDEFB","color-tv-blue-200":"#90CAF9","color-tv-blue-300":"#64B5F6","color-tv-blue-400":"#42A5F5","color-tv-blue-500":"#2196F3","color-tv-blue-600":"#1E88E5","color-tv-blue-700":"#1976D2","color-tv-blue-800":"#1565C0","color-tv-blue-900":"#0d47a1","color-tv-blue-a100":"#82b1ff","color-tv-blue-a200":"#448aff","color-tv-blue-a400":"#2979ff","color-tv-blue-a600":"#2962FF","color-tv-blue-a700":"#144987","color-tv-blue-a800":"#143661","color-tv-blue-a900":"#132742","color-deep-blue-100":"#D1C4E9","color-deep-blue-200":"#B39DDB","color-deep-blue-300":"#9575cd","color-deep-blue-400":"#7e57c2","color-deep-blue-500":"#673ab7","color-deep-blue-700":"#512da8","color-deep-blue-800":"#4527A0","color-deep-blue-900":"#311B92","color-deep-blue-a100":"#b388ff","color-deep-blue-a700":"#6200EA","color-minty-green-50":"#E0F2F1","color-minty-green-100":"#B2DFDB","color-minty-green-200":"#80cbc4","color-minty-green-300":"#4db6ac","color-minty-green-400":"#26a69a","color-minty-green-500":"#009688","color-minty-green-600":"#00897b","color-minty-green-700":"#00796b","color-minty-green-800":"#00695C","color-minty-green-900":"#004D40","color-minty-green-a400":"#1de9b6","color-minty-green-a700":"#00BFA5","color-grapes-purple-100":"#E1BEE7","color-grapes-purple-200":"#CE93D8","color-grapes-purple-300":"#ba68c8","color-grapes-purple-400":"#ab47bc","color-grapes-purple-500":"#9c27b0","color-grapes-purple-600":"#8e24aa","color-grapes-purple-700":"#7b1fa2","color-grapes-purple-800":"#6A1B9A","color-grapes-purple-900":"#4A148C","color-grapes-purple-a700":"#aa00ff","color-berry-pink-100":"#F8BBD0","color-berry-pink-200":"#f48fb1","color-berry-pink-300":"#f06292","color-berry-pink-400":"#ec407a","color-berry-pink-500":"#e91e63","color-berry-pink-600":"#D81B60","color-berry-pink-700":"#C2185B","color-berry-pink-800":"#AD1457","color-berry-pink-900":"#880E4F","color-berry-pink-a100":"#ff80ab","color-berry-pink-a200":"#ff4081","color-sky-blue-100":"#B2EBF2","color-sky-blue-200":"#80DEEA","color-sky-blue-300":"#4dd0e1","color-sky-blue-400":"#26c6da","color-sky-blue-500":"#00bcd4","color-sky-blue-600":"#00acc1","color-sky-blue-700":"#0097A7","color-sky-blue-800":"#00838F","color-sky-blue-900":"#006064","color-sky-blue-a400":"#00e5ff","color-sky-blue-a700":"#00B8D4","color-deep-blue-600":"#5E35B1","color-facebook":"#1877F2","color-deep-facebook":"#1564CA","color-twitter":"#1DA1F2","color-deep-twitter":"#188CD3","color-youtube":"#FF0000","color-linkedin":"#007BB5","color-pre-market":"color-tan-orange-600","color-pre-market-bg":"color-tan-orange-400","color-post-market":"color-tv-blue-500","color-post-market-bg":"color-tv-blue-400","color-market-open":"color-minty-green-500","color-market-open-bg":"color-minty-green-400","color-market-closed":"color-cold-gray-400","color-market-holiday":"color-cold-gray-400","color-invalid-symbol":"color-ripe-red-400","color-invalid-symbol-hover":"color-ripe-red-700","color-replay-mode":"color-tv-blue-500","color-replay-mode-icon":"color-white","color-replay-mode-hover":"color-tv-blue-600","color-notaccurate-mode":"color-berry-pink-700","color-notaccurate-mode-bg":"color-berry-pink-400","color-delay-mode":"color-tan-orange-700","color-delay-mode-bg":"color-tan-orange-400","color-eod-mode":"color-grapes-purple-700","color-eod-mode-bg":"color-grapes-purple-400","color-data-problem":"color-ripe-red-600","color-data-problem-bg":"color-ripe-red-400","color-data-problem-hover":"color-ripe-red-700","color-list-item-bg-highlighted":"color-tv-blue-50","color-list-item-bg-selected":"color-tv-blue-100","color-list-item-bg-highlighted-hover":"color-tv-blue-100","color-list-item-bg-selected-hover":"color-tv-blue-200","color-screener-header-bg":"color-white","color-screener-header-bg-hover":"color-cold-gray-100","color-overlay":"color-cold-gray-400"}')
|
||
},WIS0:function(e,t,i){"use strict";i.r(t),i.d(t,"DatafeedRequestsCachedProcessor",(function(){return _}));var s=i("Eyy1"),r=i("LxhU"),n=i("Y7w9"),o=i("ocLq"),a=i("Kxc7"),l=i("IiTo"),c=i("OLhd"),h=i("5mo2");i("HbRj");function u(e,t){return e.ticker+(e.currency_code?"_#_"+e.currency_code:"")+(e.unit_id?"_#_"+e.unit_id:"")+"_#_"+t}function d(e){return new Date(e).toISOString()}class p{constructor(e,t,i,s,n,o){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._nextTime=null,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._destroyed=!1,this._emptyResponsesCount=0,this._datafeed=e,this._symbolInfo=t,this._interval=r.Interval.parse(i),this._resolution=this._interval.value(),this._dwmAligner=n,this._serverTimeOffsetGetter=s,this._resetCacheTimePeriod=void 0===o?1e4:o,this._sessionSpec=new h.SessionSpec(t.timezone,t.session,t.holidays,t.corrections),this._updateDatesFromExpirationDate()}destroy(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed,this._destroyed=!0}addSubscription(e,t,i){const s=this._getNextSubscriptionId();this._pendingSubscribers.push({key:s,range:e,onHistoryCallback:t,onErrorCallback:i}),r.Interval.isDWM(this._resolution)&&void 0!==e.to&&null!==this._dwmAligner&&e.to%864e5&&console.warn(`Internal error: invalid date for DWM resolution ${d(e.to)}, expected time without a time part`),this._clearResetCacheTimeout();return setTimeout(()=>{this._destroyed||this._processPendingSubscribers()},0),s}removeSubscription(e){const t=this._pendingSubscribers.find(t=>t.key===e);if(t)return void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(t),1);const i=this._subscribers.find(t=>t.key===e);if(i)return this._subscribers.splice(this._subscribers.indexOf(i),1),void(this._subscribers.length||(this._resetCacheTimeout=setTimeout(()=>{this._resetCacheTimeout=null,this._purgeCache(),this._unsubscribeRealtime()},this._resetCacheTimePeriod)));console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))}_logMessage(e,t){if(a.enabled("charting_library_debug_mode")||t){const t=this._symbolInfo.currency_code,i=this._symbolInfo.unit_id;console.log(`FEED [${this._symbolInfo.name}|${this._resolution}${t?"|"+t:""}${i?"|"+i:""}]: ${e}`)}}_clearResetCacheTimeout(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)}_purgeCache(){this._logMessage("Reset cache"),this._cache={bars:[]},this._errorMessage=null,this._leftDate=null,this._endOfData=!1,this._updateDatesFromExpirationDate()}_updateDatesFromExpirationDate(){void 0!==this._symbolInfo.expiration_date&&(this._nextTime=1e3*this._symbolInfo.expiration_date,this._leftDate=1e3*(this._symbolInfo.expiration_date+1))}_dealignTime(e){
|
||
return null===this._dwmAligner?e:this._dwmAligner.timeToExchangeTradingDay(e)}_normalizeRange(e){const t=void 0!==e.to?e.to:this._dealignTime(this._now());if(0===this._cache.bars.length||void 0!==e.to&&t<=Object(s.ensureNotNull)(this._leftDate))return{countBack:e.countBack,to:t};const i=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(t):t,r=Object(n.lowerbound)(this._cache.bars,i,(e,t)=>e.time<t);return e.countBack<r?{countBack:0,to:0!==e.countBack&&r<=this._cache.bars.length?this._dealignTime(this._cache.bars[r-e.countBack].time):t}:{countBack:e.countBack-r,to:this._dealignTime(this._cache.bars[0].time)}}_processPendingSubscribers(){const e=this._pendingSubscribers;if(!e.length)return;if(this._requesting)return void this._logMessage("Processing is skipped due active request");if(this._logMessage("Processing pending subscribers, count="+e.length),this._errorMessage){const t=this._errorMessage;return this._logMessage("Return error: "+t),this._pendingSubscribers=[],void e.forEach(e=>{e.onErrorCallback(t)})}let t=this._normalizeRange(e[0].range);for(const i of e.map(e=>this._normalizeRange(e.range)))(i.to<t.to||i.to===t.to&&i.countBack>t.countBack)&&(t=i);this._logMessage(`Leftmost subscriber requires ${t.countBack} bars prior ${d(t.to)}`);!(null===this._leftDate||t.to<this._leftDate&&(null===this._nextTime||t.to<this._nextTime)||0!==t.countBack)||this._endOfData?(this._pendingSubscribers=[],e.forEach(e=>{const t=this._moveSubscriberToRealtime(e);this._returnHistoryDataToSubscriber(e,t)}),this._subscribeRealtimeIfNeeded()):this._ensureRequestedTo(t)}_moveSubscriberToRealtime(e){const t={key:e.key,onHistoryCallback:e.onHistoryCallback,barset:null};return this._subscribers.push(t),t}_isSymbolExpired(){return this._symbolInfo.expired||void 0!==this._symbolInfo.expiration_date}_subscribeRealtimeIfNeeded(){!this._subscribers.length||this._realtimeOn||this._isSymbolExpired()||this._subscribeRealtime()}_subscribeRealtime(){if(this._symbolInfo.expired||this._realtimeOn)return;this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,e=>{null!==this._dwmAligner&&(e.time=this._dwmAligner.timeToSessionStart(e.time)),this._putToCacheNewBar(e),this._subscribers.forEach(t=>{const i=t.barset;if(null===i)throw new Error("subscriber.barset is null");i.add(e),t.onHistoryCallback(i)})},u(this._symbolInfo,this._resolution),()=>{this._unsubscribeRealtime();const e=this._leftDate;this._purgeCache(),null!==e&&this._ensureRequestedTo({to:e,countBack:0})}),this._logMessage("Subscribed to realtime")}_unsubscribeRealtime(){!this._isSymbolExpired()&&this._realtimeOn&&(this._datafeed.unsubscribeBars(u(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)}_returnHistoryDataToSubscriber(e,t){const i=this._normalizeRange(e.range),s=this._createBarsetForRange(i)
|
||
;s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),d(s.bars[0].time),d(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,this._endOfData&&null!==this._leftDate&&i.to<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)}_createBarsetForRange(e){const t=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(e.to):e.to,i=Object(n.lowerbound)(this._cache.bars,t,(e,t)=>e.time<t),r=new o.BarSet(this._symbolInfo,this._cache.bars.slice(Math.max(0,i-e.countBack)));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(Object(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=Object(l.alignPeriodsBackForDataRequest)(this._symbolInfo.session,this._symbolInfo.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+=Object(l.getPeriodsBetweenDates)(this._symbolInfo.session,this._symbolInfo.holidays,this._symbolInfo.corrections,this._interval.letter(),this._interval.multiplier(),e.to,i)),null!==this._leftDate&&this._leftDate<s)return void this._processPendingSubscribers();const n=this._isSymbolExpired()?0===this._cache.bars.length:null===this._leftDate;this._requesting=!0,this._nextTime=null,this._leftDate=s;const o=`[${d(s)} ... ${d(i)}, ${r} bars]`;this._logMessage("Requesting data: "+o);let a=!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(a)this._logMessage("getBars callback is already called before",!0);else{if(a=!0,e.length>0){const t=` [${d(e[0].time)} ... ${d(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||(a?this._logMessage("getBars callback is already called before",!0):(a=!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(d(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("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("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(a.enabled("charting_library_debug_mode"))for(let i=1;i<e.length;i++){if(e[i].time<=e[i-1].time){let s="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(e[i].time,i,e[i-1].time,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("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("putToCacheNewBar: time violation, previous bar time: "+d(s)+" should be less or equal to new time: "+d(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=u(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,Object(c.createDwmAligner)(t,e),this._resetCacheTimePeriod)}_forEachThread(e){Object.keys(this._threads).forEach(t=>e(t,this._threads[t]))}}},WPIy:function(e,t,i){"use strict";var s=i("hOqT"),r=i("X0WL"),n=(i("Eyy1"),i("xDuj")),o=i("Kxc7");const a=i.n(o).a.enabled("hide_resolution_in_legend");function l(e){const t="QUANDL"===(e=e||{}).exchange,i={symbolDescription:"",interval:"",exchange:"",chartStyle:"",extended:"",provider:"",ticker:""};if(e.description&&t)if(2===e.description.split("/").length)i.symbolDescription=e.description.split("/")[1];else{e.description.split("'").filter(e=>e.length).forEach(e=>{let t=[];t=e&&("/"===e[0]||/\d+\/\(?/.test(e))?[e]:e.split("/").filter(e=>e.length),i.symbolDescription+=t[2===t.length?1:0]})}else e.description?i.symbolDescription=e.description:i.symbolDescription=e.symbol;if(e.interval&&(i.interval=Object(n.translatedIntervalString)(e.interval)),t&&e.description){const t=/[\w_]+\/[\w_]+/.exec(e.description);t&&t[0]?i.provider=t[0].split("/")[0]:i.provider=e.description.split("/")[0]}return e.exchange&&(i.exchange=e.exchange),i.chartStyle=function(e){return e.inputs,8===e.style?window.t("Heikin Ashi"):""}(e),e.extended&&(i.extended=window.t("ext",{context:"shorthand_for_extended_session"})),e.ticker&&(i.ticker=e.ticker),i}i.d(t,"a",(function(){return c}));class c extends r.a{constructor(e,t,i,s){super(t),this._series=e,this._statusViewProperties=i,this._options=s||{}}text(){return function(e){const t=l(e);return(t.symbolDescription+(t.interval?", "+t.interval:"")+function(e,t=", "){return(e.provider?`${t}${e.provider}`:"")+(e.exchange?`${t}${e.exchange}`:"")+(e.chartStyle?`${t}${e.chartStyle}`:"")+(e.extended?`${t}${e.extended}`:"")}(t)).replace(/'/g,"")}(this._getTitleGenerationOptions())}getSplitTitle(){return function(e){const t=l(e),i=t.symbolDescription.replace(/'/g,""),s=function(e){const t=[];e.provider&&t.push(e.provider);e.exchange&&t.push(e.exchange);e.chartStyle&&t.push(e.chartStyle);e.extended&&t.push(e.extended);return t}(t).map(e=>e.replace(/'/g,"")),r=[];return t.ticker&&r.push(t.ticker),r.push(i),a||r.push(t.interval||""),r.push(...s),r}(this._getTitleGenerationOptions())}
|
||
bold(){return!1}size(){return this._statusViewProperties.childs().fontSize.value()+"px"}_getTitleGenerationOptions(){const e=this._series.symbolInfo(),t=this._statusViewProperties.childs().symbolTextSource.value();return{description:"ticker"===this._statusViewProperties.childs().symbolTextSource.value()?e&&e.name||void 0:Object(s.getTranslatedSymbolDescription)({pro_name:e&&e.pro_name||void 0,short_name:e&&e.name||void 0,description:e&&e.description||void 0,short_description:e&&e.short_description||void 0,local_description:e&&e.local_description||void 0,language:e&&e.language||void 0}),exchange:this._statusViewProperties.childs().showExchange.value()&&e&&e.exchange||void 0,symbol:this._series.symbol(),interval:this._statusViewProperties.childs().showInterval.value()&&!this._options.hideResolution?this._series.interval():void 0,style:this._series.properties().childs().style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,ticker:"ticker-and-description"===t?e&&e.name||void 0:""}}}},WPQD:function(e,t,i){"use strict";(function(e){var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),this._trendLinePaneView=null,i.e("lt-pane-views").then(i.t.bind(null,"ocVb",7)).then(({TrendLinePaneView:e})=>{this._trendLinePaneView=new e(this,this._model),this._setPaneViews([this._trendLinePaneView])})}dataAndViewsReady(){return s.prototype.dataAndViewsReady.call(this)&&this._trendLinePaneView&&this._trendLinePaneView.iconsReady()}stop(){super.stop()}pointsCount(){return 2}name(){return"Trend Line"}canHasAlert(){return!0}_getAlertPlots(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"auWl"))).TrendLineDefinitionsViewModel}template(){var e=s.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static createProperties(e){var t=new r("linetooltrendline",e);return n._configureProperties(t),t}static _configureProperties(t){s._configureProperties(t),t.hasChild("text")||t.addChild("text",new e("")),t.addExclusion("text")}}t.LineToolTrendLine=n}).call(this,i("tc+8"))},"Wh/T":function(e,t,i){"use strict";var s=i("Kxc7");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(t){}}),3e4)}},
|
||
Wh6B:function(e,t,i){"use strict";var s=i("Eyy1").ensureNotNull,r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("08i5");class a extends r{constructor(e,t){super(e,t||a.createProperties()),this._predictionPaneView=null,i.e("lt-pane-views").then(i.t.bind(null,"Ay2m",7)).then(({PredictionPaneView:e})=>{this._predictionPaneView=new e(this,this._model),this._setPaneViews([this._predictionPaneView])})}dataAndViewsReady(){return r.prototype.dataAndViewsReady.call(this)&&this._predictionPaneView&&this._predictionPaneView.iconsReady()}isSynchronizable(){return!1}status(){return this._properties.status.value()}setStatus(e){return this._properties.status.setValue(e)}pointsCount(){return 2}name(){return"Forecast"}restorePoints(e,t,i){super.restorePoints(e,t,i),this.checkAlert()}checkAlert(){if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){var e=this._points[1];if(this.status())e.index>this._model.timeScale().baseIndex()&&this.setStatus(o.AlertStatus.Waiting);else{var t=this._model.mainSeries().bars().valueAt(e.index);if(null!==t){var i=this.direction();if(i===o.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price)this.setStatus(o.AlertStatus.Success);else if(i===o.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price)this.setStatus(o.AlertStatus.Success);else{var r=s(this._model.mainSeries().bars().lastIndex());e.index!==r&&this.setStatus(o.AlertStatus.Failure)}}}}}addPoint(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t}endChanging(){super.endChanging(),this.setStatus(o.AlertStatus.Waiting),this.checkAlert()}onData(e){super.onData(e),this.checkAlert()}endMoving(){super.endMoving(),this.setStatus(o.AlertStatus.Waiting),this.checkAlert()}direction(){if(this.points().length<2)return o.Direction.Up;var e=this.points()[0];return this.points()[1].price>e.price?o.Direction.Up:o.Direction.Down}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Pwwq"))).PredictionDefinitionsViewModel}cloneable(){return!1}static createProperties(e){var t=new n("linetoolprediction",e);return a._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e),e.merge({status:o.AlertStatus.Waiting})}}t.LineToolPrediction=a},WkOR:function(e,t,i){"use strict";i.r(t),i.d(t,"areEqualSymbols",(function(){return n})),i.d(t,"includesEqualSymbol",(function(){return o}));var s=i("Kxc7");const r=s.enabled("uppercase_instrument_names");function n(e,t){return void 0===e?void 0===t:void 0!==t&&(r?e.toUpperCase()===t.toUpperCase():e===t)}function o(e,t){return e.some(e=>n(t,e))}},WkYF:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"3xLB",7)).then(({DateRangePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Date Range"}async _getPropertyDefinitionsViewModelClass(){
|
||
return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Ax76"))).GeneralDatePriceRangeDefinitionsViewModel}static createProperties(e){var t=new r("linetooldaterange",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolDateRange=n},WmDe:function(e,t,i){"use strict";TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.isPaidPro=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]}},Wo0S:function(e,t,i){e.exports={"common-tooltip":"common-tooltip-36YLR71G","common-tooltip--hidden":"common-tooltip--hidden-36YLR71G","common-tooltip--horizontal":"common-tooltip--horizontal-36YLR71G","common-tooltip--farther":"common-tooltip--farther-36YLR71G","common-tooltip--vertical":"common-tooltip--vertical-36YLR71G","common-tooltip-farther":"common-tooltip-farther-36YLR71G","common-tooltip--no-pointer-events":"common-tooltip--no-pointer-events-36YLR71G","common-tooltip--direction_normal":"common-tooltip--direction_normal-36YLR71G","common-tooltip__body":"common-tooltip__body-36YLR71G","common-tooltip__button-container":"common-tooltip__button-container-36YLR71G","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-36YLR71G","common-tooltip__button":"common-tooltip__button-36YLR71G","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-36YLR71G","common-tooltip__ear-holder":"common-tooltip__ear-holder-36YLR71G","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-36YLR71G","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-36YLR71G","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-36YLR71G","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-36YLR71G","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-36YLR71G","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-36YLR71G","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-36YLR71G","common-tooltip__body--no-padding":"common-tooltip__body--no-padding-36YLR71G","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-36YLR71G","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-36YLR71G","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-36YLR71G","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-36YLR71G","common-tooltip__plus-sign":"common-tooltip__plus-sign-36YLR71G"}},Wt0y:function(e,t,i){"use strict";function s(e=location.host){
|
||
return-1!==["i18n.tradingview.com","partial.tradingview.com","www.tradingview.com","wwwcn.tradingview.com"].indexOf(e)||-1!==["d33t3vvu2t2yu5.cloudfront.net","dwq4do82y8xi7.cloudfront.net","s.tradingview.com","s3.tradingview.com"].indexOf(e)||e.match(/^[a-z]{2}\.tradingview\.com/)||e.match(/prod-[^.]+.tradingview.com/)?"battle":e.includes("tradingview.com")||e.includes("staging")?"staging":e.match(/webcharts/)?"staging_local":(e.match(/^localhost(:\d+)?$/),"local")}function r(){return"local"===s()}function n(){return"battle"===s()}function o(){return!n()}i.r(t),i.d(t,"environment",(function(){return s})),i.d(t,"isLocal",(function(){return r})),i.d(t,"isProd",(function(){return n})),i.d(t,"isDebug",(function(){return o}))},X0WL:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e){this._colorProperty=e}size(){return"13px"}bold(){return!1}color(){return this._colorProperty.value()}}},XAms:function(e,t,i){"use strict";function s(e){e.preventDefault()}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return n}));const r=["input:not([type])",'input[type="text"]','input[type="email"]','input[type="password"]','input[type="search"]','input[type="number"]','input[type="url"]',"textarea","a[href]",'*[contenteditable="true"]',"[data-allow-context-menu]"];function n(e){const t=e.target;t&&!t.closest(r.join(", "))&&e.preventDefault()}},XFad:function(e,t,i){"use strict";var s=i("5rJj"),r=i("aDyP").LineToolPitchfork;class n extends r{constructor(e,t){super(e,t||n.createProperties())}name(){return"Schiff Pitchfork"}static createProperties(e){var t=new s("linetoolschiffpitchfork2",e,!1,{range:[0,8]});return n._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolSchiffPitchfork2=n},XPit:function(e,t,i){"use strict";i.r(t),i.d(t,"TimePointIndexSearchMode",(function(){return s})),i.d(t,"seriesPlotFunctionMap",(function(){return l})),i.d(t,"barFunction",(function(){return c})),i.d(t,"SeriesData",(function(){return u}));var s,r=i("Eyy1"),n=i("k9/m");!function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(s||(s={}));const o={open:e=>e[1],high:e=>e[2],low:e=>e[3],close:e=>e[4],hl2:e=>(e[2]+e[3])/2,hlc3:e=>(e[2]+e[3]+e[4])/3,ohlc4:e=>(e[1]+e[2]+e[3]+e[4])/4},a=["open","high","low","close","hl2","hlc3","ohlc4"];function l(){const e=new Map;return a.forEach((t,i)=>{e.set(t,c(t))}),e}function c(e){return o[e]}function h(e,t){return null==e[t]}class u{constructor(){this.m_bars=new n.PlotList(l(),h),this.m_nsBars=new n.PlotList(l(),h)}bars(){return this.m_bars}nsBars(){return this.m_nsBars}size(){return this.m_bars.size()+this.m_nsBars.size()}each(e){this.m_bars.each(e),this.m_nsBars.each(e)}clear(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0}isEmpty(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()}first(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()}last(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()}search(e,t){
|
||
return this.nsBars().isEmpty()?this.bars().search(e,t):this.bars().isEmpty()||Object(r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t):this.bars().search(e,t)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}plotValueToTimePointIndex(e,t,i){if(i===s.FromRight){const i=(i,s)=>{const r=s[t];return null!=r&&e>=r},s=this.m_bars.findLast(i);if(null!==s)return s.index;const r=this.m_nsBars.findLast(i);return null!==r?r.index:this.m_bars.firstIndex()}if(i===s.FromLeft){const i=(i,s)=>{const r=s[t];return null!=r&&e<=r},s=this.m_bars.findFirst(i);if(null!==s)return s.index;const r=this.m_nsBars.findFirst(i);return null!==r?r.index:this.m_bars.lastIndex()}throw new Error("plotValueToTimePointIndex: unsupported search mode")}moveData(e){this.m_bars.move(e),this.m_nsBars.move(e)}}},XRI5:function(e,t,i){"use strict";i.r(t),i.d(t,"SymbolExtrapolator",(function(){return c}));var s=i("Eyy1"),r=i("Y7w9"),n=i("IiTo"),o=i("IDnv"),a=i("LxhU");function l(e,t){return e.length>t}class c{constructor(e,t,i=2e5){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._projectionFirstIndex=1/0,this._barsTimes=[],this._minFutureBarsCount=0,this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._symbolInfo=e,this._interval=a.Interval.parse(t),this._extrapolateLimit=i,this._barBuilder=Object(n.newBarBuilder)(t,new n.SessionInfo(e.timezone,e.session,e.holidays,e.corrections),null)}destroy(){this.clear()}interval(){return this._interval}barBuilder(){return this._barBuilder}symbolInfo(){return this._symbolInfo}clear(){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._barsTimes=[],this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._minFutureBarsCount=0,this._projectionFirstIndex=1/0}firstFutureBarIndex(){return this._barsTimes.length}futureBars(){return this._futureBarsCache}replaceBarsTimesTail(e,t=e.length){if(0===e.length)return;if(0===this._barsTimes.length)return void this.setBarsTimes(e,t);const i=e[0],n=this._barsTimes[this._barsTimes.length-1],o=i>n?this._barsTimes.length:Object(r.lowerbound_int)(this._barsTimes,i);0!==o?(this._barsTimes.splice(o,this._barsTimes.length,...e),this._projectionFirstIndex=t===e.length?this._barsTimes.length:this._barsTimes.indexOf(e[t]),Object(s.assert)(-1!==this._projectionFirstIndex,"something went wrong"),n!==e[e.length-1]&&this._setLastRealBarTime(e[e.length-1])):this.setBarsTimes(e,t)}setBarsTimes(e,t=e.length){const i=this._barsTimes;if(this._barsTimes=e.slice(),this._projectionFirstIndex=0===this._barsTimes.length?1/0:t,0===e.length)return this._historyBarsCache=[],this._futureBarsCache=[],this._firstRealBarTimeMs=null,void(this._lastRealBarTimeMs=null);0!==i.length&&i[i.length-1]===e[e.length-1]||this._setLastRealBarTime(e[e.length-1]),0!==i.length&&i[0]===e[0]||(this._historyBarsCache=[],this._firstRealBarTimeMs=e[0])}extrapolateTimeWithOffsetToTime(e,t){if(0===t)return{timeMs:e,exact:!0}
|
||
;0===this._barsTimes.length&&(t<0?null===this._firstRealBarTimeMs?this._firstRealBarTimeMs=e:(this._extendHistoryCacheToTimeFromRight(Math.min(e,null!==this._lastRealBarTimeMs?this._lastRealBarTimeMs:1/0)),this._ensureExtrapolatedToHistoryTime(e)):null===this._lastRealBarTimeMs?this._lastRealBarTimeMs=e:(this._extendFutureCacheToTimeFromLeft(Math.max(e,null!==this._firstRealBarTimeMs?this._firstRealBarTimeMs:1/0)),this._ensureExtrapolatedToFutureTime(e)));const i=this.indexOfTime(e);if(null===i)return null;const s=this._timeOfBarIndex(i.index+t);return null===s?null:((i.index<0||this._projectionFirstIndex<=i.index)&&(s.exact=!1),s)}indexOfTime(e){if(null!==this._firstRealBarTimeMs&&e<this._firstRealBarTimeMs){this._ensureExtrapolatedToHistoryTime(e);let t=Object(r.lowerbound_int)(this._historyBarsCache,e);if(0!==this._historyBarsCache.length&&0===t&&e<this._historyBarsCache[0])return null;t!==this._historyBarsCache.length&&this._historyBarsCache[t]===e||(t-=1);return{index:t-this._historyBarsCache.length,timeMs:this._historyBarsCache[t]}}if(null!==this._lastRealBarTimeMs&&e>this._lastRealBarTimeMs){this._ensureExtrapolatedToFutureTime(e);let t=Object(r.lowerbound_int)(this._futureBarsCache,e);if(0!==this._futureBarsCache.length&&t===this._futureBarsCache.length&&e>this._futureBarsCache[this._futureBarsCache.length-1])return null;this._futureBarsCache[t]!==e&&(t-=1);const i=Math.max(1,this._barsTimes.length)+t;return{index:i,timeMs:i===this._barsTimes.length-1?Object(s.ensureNotNull)(this._lastRealBarTimeMs):this._futureBarsCache[t]}}if(0===this._barsTimes.length)return null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||null!==this._lastRealBarTimeMs&&e<=this._lastRealBarTimeMs?{index:0,timeMs:Object(s.ensureNotNull)(this._timeOfBarIndex(0)).timeMs}:null;let t=Object(r.lowerbound_int)(this._barsTimes,e);return this._barsTimes[t]!==e&&(t-=1),{index:t,timeMs:this._barsTimes[t]}}setMinFutureBarsCount(e){this._minFutureBarsCount=e,0!==this._barsTimes.length&&this._ensureExtrapolatedToFutureBar(e)}ensureExtrapolatedToFutureTime(e){this._ensureExtrapolatedToFutureTime(e)}_setLastRealBarTime(e){const t=this._futureBarsCache.length,i=Object(r.upperbound_int)(this._futureBarsCache,e);0===i?this._extendFutureCacheToTimeFromLeft(e):(this._lastRealBarTimeMs=e,this._futureBarsCache=this._futureBarsCache.slice(i)),this._ensureExtrapolatedToFutureBar(Math.max(t,this._minFutureBarsCount))}_timeOfBarIndex(e){var t;if(e<0){const t=Math.abs(e);this._ensureExtrapolatedToHistoryBar(t);const i=this._historyBarsCache.length-t;return i<0?null:{timeMs:this._historyBarsCache[i],exact:!1}}if(0===e&&0===this._barsTimes.length)return{timeMs:Object(s.ensureNotNull)(null!==(t=this._firstRealBarTimeMs)&&void 0!==t?t:this._lastRealBarTimeMs),exact:!1};if(e>=this._barsTimes.length){const t=e-Math.max(1,this._barsTimes.length);return this._ensureExtrapolatedToFutureBar(t+1),t>=this._futureBarsCache.length?null:{timeMs:this._futureBarsCache[t],exact:!1}}return{timeMs:this._barsTimes[e],exact:e<this._projectionFirstIndex}}
|
||
_extendFutureCacheFromRight(e){const t=0!==this._futureBarsCache.length?this._futureBarsCache[this._futureBarsCache.length-1]:this._lastRealBarTimeMs;if(null===t)return!1;const i=e(t,this._futureBarsCache.length);return 0!==i.length&&(this._futureBarsCache=this._futureBarsCache.concat(i),!0)}_extendHistoryCacheFromLeft(e){const t=0!==this._historyBarsCache.length?this._historyBarsCache[0]:this._firstRealBarTimeMs;if(null===t)return;const i=e(t,this._historyBarsCache.length);this._historyBarsCache=i.concat(this._historyBarsCache)}_extendFutureCacheToTimeFromLeft(e){if(null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs<=e)return;if(Object(s.assert)(0===this._barsTimes.length||e===this._barsTimes[this._barsTimes.length-1],"invalid argument"),this._lastRealBarTimeMs=e,0===this._futureBarsCache.length)return;const t=Object(o.extrapolateBarsFrontToTime)(this._barBuilder,e,this._futureBarsCache[0]-1,this._extrapolateLimit,!0).times;this._futureBarsCache=t.concat(this._futureBarsCache)}_extendHistoryCacheToTimeFromRight(e){if(null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs>=e)return;if(Object(s.assert)(0===this._barsTimes.length,"bars should be empty"),this._firstRealBarTimeMs=e,0===this._historyBarsCache.length)return;const t=Object(o.extrapolateBarsFrontToTime)(this._barBuilder,this._historyBarsCache[this._historyBarsCache.length-1],e-1,this._extrapolateLimit,!0).times;this._historyBarsCache=this._historyBarsCache.concat(t)}_ensureExtrapolatedToFutureBar(e){return!(this._futureBarsCache.length>=e||l(this._futureBarsCache,this._extrapolateLimit))&&this._extendFutureCacheFromRight((t,i)=>Object(o.extrapolateBarsFrontByCount)(this._barBuilder,t,e-i,!0).times)}_ensureExtrapolatedToFutureTime(e){null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs>=e||l(this._futureBarsCache,this._extrapolateLimit)||0!==this._futureBarsCache.length&&this._futureBarsCache[this._futureBarsCache.length-1]>=e||(this._extendFutureCacheFromRight((t,i)=>Object(o.extrapolateBarsFrontToTime)(this._barBuilder,t,e,this._extrapolateLimit,!0).times),this._futureBarsCache[this._futureBarsCache.length-1]<e&&this._ensureExtrapolatedToFutureBar(this._futureBarsCache.length+1))}_ensureExtrapolatedToHistoryBar(e){this._historyBarsCache.length>=e||l(this._historyBarsCache,this._extrapolateLimit)||this._extendHistoryCacheFromLeft((t,i)=>Object(o.extrapolateBarsFrontByCount)(this._barBuilder,t,-(e-i),!0).times.reverse())}_ensureExtrapolatedToHistoryTime(e){null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||l(this._historyBarsCache,this._extrapolateLimit)||0!==this._historyBarsCache.length&&this._historyBarsCache[0]<=e||(this._extendHistoryCacheFromLeft((t,i)=>{const s=Object(o.extrapolateBarsFrontToTime)(this._barBuilder,t-1,e-1,this._extrapolateLimit,!0).times;return s[s.length-1]===t?s.slice(0,-1):s}),(0===this._historyBarsCache.length||this._historyBarsCache[0]>e)&&this._ensureExtrapolatedToHistoryBar(this._historyBarsCache.length+1))}}},XUCF:function(e,t,i){"use strict"
|
||
;var s=i("Hr11").sign,r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty;class o{constructor(e,t,i){this._source=e,this._index=t,this._bars=i||[]}setBars(e){this._bars=e||[]}clone(e){return new o(e,this._index,TradingView.clone(this._bars))}createBar(){var e=this._source.properties().averageHL.value(),t=this._source.properties().variance.value()/100,i=this._source._model.mainSeries().base(),s=Math.random(),r=e*(1-2*s)*t,n=e*(1+(.5-(s=Math.random()))*t),o=r-n/2,a=o+n;return{o:(o+Math.random()*n)/i,h:a/i,l:o/i,c:(o+Math.random()*n)/i}}generate(){this._bars=[];var e=this._source.points(),t=e[this._index],i=e[this._index+1];if(t&&i&&t.index!==i.index){this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100;for(var r=this._index?t.index+1:t.index,n=s(i.index-t.index),o=r;o!==i.index;o+=n)this._bars.push(this.createBar())}}bars(){return this._bars}setSize(e){if(e<this._bars.length)this._bars.splice(e,this._bars.length-e);else for(;this._bars.length<e;)this._bars.push(this.createBar())}}class a extends r{constructor(e,t,s){var r=t||a.createProperties();if(super(e,r),this._segments=[],!s){var n=Math.round(this.calculateATR(e));r.averageHL.setValue(n)}r.averageHL.listeners().subscribe(this,a.prototype.regenerate),r.variance.listeners().subscribe(this,a.prototype.regenerate),r.points||r.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),this.properties().onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),i.e("lt-pane-views").then(i.t.bind(null,"dMkl",7)).then(({GhostFeedPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}isSynchronizable(){return!1}_handleRestoringFactoryDefaults(){var e=Math.round(this.calculateATR());this.properties().averageHL.setValue(e)}destroy(){this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),super.destroy()}regenerate(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach((function(e){e.generate()})),this.updateAllViews(),this._model.updateSource(this)}propertiesChanged(){super.propertiesChanged(),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()}pointsCount(){return-1}name(){return"Ghost Feed"}segmentBars(e){return this._segments[e].bars()}segments(){return this._segments}generateBars(e){this._segments.length<=e&&this._segments.push(new o(this,e)),this._segments[e].generate()}addPoint(e){if(this._points.length>0&&this._points[this._points.length-1].index===e.index){this._lastPoint=null,this.normalizePoints(),this.createServerPoints();for(var t=0;t<this._points.length;t++)this._createPointProperty(t);return!0}var i=r.prototype.addPoint.call(this,e);return this._finished&&(this._lastPoint=null),
|
||
this._points.length>1&&this.generateBars(this._points.length-2),i||this._finished}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}setPoint(e,t,i){if(super.setPoint(e,t,i),e>0){var s=this.points()[e-1],r=t.index-s.index;this._segments[e-1].setSize(Math.abs(r))}if(e<this.points().length-1){r=this.points()[e+1].index-t.index;this._segments[e].setSize(Math.abs(r))}}state(e){var t=r.prototype.state.call(this,e);return t.segments=this._segments.map((function(e){return{bars:e.bars()}})),t}restoreData(e){var t=this;e.segments&&(this._segments=e.segments.map((function(e,i){return new o(t,i,[].concat(e.bars))}))),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()}onData(e){if(super.onData(e),0===this.pointsProperty().childs().points._childs.length)for(var t=0;t<this._points.length;t++)this._createPointProperty(t);this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())}cloneData(e){var t=this;this._segments=e._segments.map((function(e){return e.clone(t)}))}calculateATR(e){var t=(void 0!==e?e:this._model).mainSeries(),i=[];t.bars().each((function(e,t){i.push(t[TradingView.HIGH_PLOT]-t[TradingView.LOW_PLOT])}));var s=0===i.length?0:i.reduce((function(e,t){return e+t}),0)/i.length;return s*=t.base()}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"fIc+"))).GhostFeedDefinitionsViewModel}static createProperties(e){var t=new n("linetoolghostfeed",e);return a._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolGhostFeed=a},XXdw:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"StoriesTimeLineItemType",(function(){return s})),function(e){e[e.Image=0]="Image",e[e.Emoji=1]="Emoji"}(s||(s={}))},XcdR:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("txPx"),r=i("RDU5");const n=Object(s.getLogger)("Chart.ChartUndoModel");class o extends r.UndoCommand{constructor(e,t,i){super(i,!1),this._newRightOffsetAndBarSpacing=null,this.setCustomFlag("doesnt_affect_save",!0),this._model=e,this._rightOffsetAndBarSpacing=t}undo(){if(null!==this._newRightOffsetAndBarSpacing)return void n.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");const e=this._model.timeScale();this._newRightOffsetAndBarSpacing={barSpacing:e.barSpacing(),rightOffset:e.rightOffset()},e.setBarSpacing(this._rightOffsetAndBarSpacing.barSpacing),e.setRightOffset(this._rightOffsetAndBarSpacing.rightOffset),this._model.lightUpdate()}redo(){if(null===this._newRightOffsetAndBarSpacing)return void n.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");const e=this._model.timeScale();e.setBarSpacing(this._newRightOffsetAndBarSpacing.barSpacing),e.setRightOffset(this._newRightOffsetAndBarSpacing.rightOffset),this._model.lightUpdate(),this._newRightOffsetAndBarSpacing=null}}},XlJ7:function(e,t,i){"use strict"
|
||
;function s(e,t,i,s){return`${s?s+" ":""}${i?i+" ":""}${e}px ${t}`}i.r(t),i.d(t,"makeFont",(function(){return s})),i.d(t,"parseFont",(function(){return n}));const r=/(bold )?(italic )?(\d+)(px|pt) (.*)$/;function n(e){const t=r.exec(e);return null===t?null:{family:t[5],size:parseInt(t[3])*("pt"===t[4]?.75:1),bold:Boolean(t[1]),italic:Boolean(t[2])}}},Xyly:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBezierQuadro",(function(){return n}));var s=i("Ocx9"),r=i("Ss5c");class n extends r.LineDataSource{constructor(e,t){const s=t||n.createProperties();super(e,s),this._controlPoint=null,i.e("lt-pane-views").then(i.bind(null,"4Ptp")).then(t=>{this._setPaneViews([new t.BezierQuadroPaneView(this,e)])})}pointsCount(){return 2}properties(){return super.properties()}name(){return"Curve"}setLastPoint(e,t){super.setLastPoint(e,t),this._controlPoint=this._calculateControlPoint()}addPoint(e,t,i){const s=super.addPoint(e,t,i);if(s){const e=this._calculateControlPoint();this._points.push(e),this._controlPoint=null,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)}return s}restorePoints(e,t,i){super.restorePoints(e,t,i),this._createPointProperty(2)}controlPoint(){return this._controlPoint}static createProperties(e){const t=new s.DefaultProperty("linetoolbezierquadro",e);return n._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"b4fl")).then(e=>e.GeneralBezierDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e)}_calculateControlPoint(){const e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5).transposed().scaled(.3),s=e.add(t).scaled(.5).add(i);return this.screenPointToPoint(s)}}},XzZr:function(e,t,i){"use strict";var s=i("ogJP").declareClassAsPureInterface;function r(){}TradingView.WEB_SOCKET_WAS_CONNECTED=!1,r.REBIND_STUDY_STANDALONE_TO_CHILD=1,r.REBIND_STUDY_CHILD_TO_STANDALONE=2,r.prototype.defaultWatchlistSymbols=function(){},r.prototype.defaultResolutions=function(){},r.prototype.availableCurrencies=function(){},r.prototype.availableUnits=function(){},r.prototype.supportedSymbolsTypes=function(){},r.prototype.supportedExchangesList=function(){},r.prototype.symbolsGrouping=function(){},r.prototype.quoteCreateSession=function(e){},r.prototype.quoteDeleteSession=function(e){},r.prototype.quoteSetFields=function(e,t){},r.prototype.quoteAddSymbols=function(e,t){},r.prototype.quoteRemoveSymbols=function(e,t){},r.prototype.quoteFastSymbols=function(e,t){},r.prototype.depthCreateSession=function(e,t,i){},r.prototype.depthDeleteSession=function(e){},r.prototype.depthSetSymbol=function(e,t){},r.prototype.depthClearSymbol=function(e){},r.prototype.depthSetScale=function(e,t){},r.prototype.chartCreateSession=function(e,t){},r.prototype.chartDeleteSession=function(e){},r.prototype.createSession=function(e,t){},r.prototype.removeSession=function(e){},r.prototype.connected=function(){},
|
||
r.prototype.connect=function(){},r.prototype.disconnect=function(){},r.prototype.switchTimezone=function(e,t){},r.prototype.resolveSymbol=function(e,t,i,s,r){},r.prototype.createSeries=function(e,t,i,s,r,n,o,a){},r.prototype.removeSeries=function(e,t,i){},r.prototype.modifySeries=function(e,t,i,s,r,n,o){},r.prototype.requestMoreData=function(e,t,i,s){},r.prototype.requestMetadata=function(e,t,i){},r.prototype.isCanCreateStudy=function(e,t){},r.prototype.createStudy=function(e,t,i,s,r,n,o){},r.prototype.rebindStudy=function(e,t,i,s,r,n,o,a){},r.prototype.removeStudy=function(e,t,i){},r.prototype.modifyStudy=function(e,t,i,s,r){},r.prototype.createPointset=function(e,t,i,s,r,n,o){},r.prototype.modifyPointset=function(e,t,i,s,r){},r.prototype.removePointset=function(e,t,i){},r.prototype.requestMoreTickmarks=function(e,t,i,s){},r.prototype.requestFirstBarTime=function(e,t,i,s){},r.prototype._invokeHandler=function(e,t){},r.prototype._sendRequest=function(e,t){},r.prototype._onMessage=function(e){},r.prototype._dispathNotification=function(e){},r.prototype._invokeNotificationHandler=function(e,t,i){},r.prototype._notifySessions=function(e){},r.prototype.unpack=function(e){},r.prototype.searchSymbols=function(e,t,i,s,r,n,o,a,l,c){},r.prototype.serverTimeOffset=function(){},r.prototype.getMarks=function(e,t,i,s,r){},r.prototype.getTimescaleMarks=function(e,t,i,s,r){},s(r,"ChartApiInterface"),e.exports.HandlerInfo=function(e,t){this.handler=e,this.customId=t},e.exports.ChartApiInterface=r},Y5iK:function(e,t,i){"use strict";i.r(t),i.d(t,"MainSeriesScaleRatioProperty",(function(){return n}));var s=i("aIyQ"),r=i.n(s);class n{constructor(e){this._changed=new r.a,this._model=e}getStepChangeValue(){return.1}getMinValue(){return 1e-7}getMaxValue(){return 99999999}value(){return this._model.mainSeriesScaleRatio()}setValue(e,t){(e!==this.value()||t)&&(this._model.setMainSeriesScaleRatio(e),this._onChanged())}state(){return null}clone(){return new n(this._model)}listeners(){return this._changed}subscribe(e,t){this._changed.subscribe(e,t)}unsubscribe(e,t){this._changed.unsubscribe(e,t)}unsubscribeAll(e){this._changed.unsubscribeAll(e)}_onChanged(){this._changed.fire(this)}}},Y7w9:function(e,t,i){"use strict";function s(e,t){return e<t}function r(e,t,i,s=0,r=e.length){let n=r-s;for(;0<n;){const r=n>>1,o=s+r;i(e[o],t)?(s=o+1,n-=r+1):n=r}return s}function n(e,t,i=0,n=e.length){return r(e,t,s,i,n)}function o(e,t,i,s=0,r=e.length){let n=r-s;for(;0<n;){const r=n>>1,o=s+r;i(t,e[o])?n=r:(s=o+1,n-=r+1)}return s}function a(e,t,i=0,r=e.length){return o(e,t,s,i,r)}function l(e,t){return e.filter(e=>!t.includes(e))}function c(e,t){const i=e.indexOf(t);return i<0?e.slice():[t].concat(e.slice(0,i)).concat(e.slice(i+1))}function h(e,t,i){const s=new Set(t),r=[],o=[];return e.forEach((e,t)=>{s.has(e)||(r.push(e),o.push(t))}),i<e.length-1&&(i=n(o,i+1)),r.splice(i,0,...t),r}function u(e,t,i){const s=new Set(t),r=[],o=[];return e.forEach((e,t)=>{s.has(e)||(r.push(e),o.push(t))}),i<=e.length-1&&(i=n(o,i)),r.splice(i,0,...t),r}function d(e,t){
|
||
const i=new Set;return e.forEach(e=>{t.has(e)&&i.add(e)}),i}i.r(t),i.d(t,"lowerbound",(function(){return r})),i.d(t,"lowerbound_int",(function(){return n})),i.d(t,"upperbound",(function(){return o})),i.d(t,"upperbound_int",(function(){return a})),i.d(t,"subtract",(function(){return l})),i.d(t,"moveToHead",(function(){return c})),i.d(t,"moveAfter",(function(){return h})),i.d(t,"moveBefore",(function(){return u})),i.d(t,"intersect",(function(){return d}))},YCFM:function(e,t,i){},YWnQ:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"SymbolErrorPermissionDeniedReason",(function(){return s})),i.d(t,"permissionDenied",(function(){return r})),function(e){e.Symbol="symbol",e.ExtendedHours="extended_hours",e.GroupPermission="group"}(s||(s={}));const r="permission denied"},YdVo:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolPath",(function(){return c}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ocx9"),o=i("Zp/P"),a=i("Ss5c"),l=i("j3hX");class c extends a.LineDataSource{constructor(e,t){const s=t||c.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"JeuX")).then(t=>{this._setPaneViews([new t.PathPaneView(this,e)])})}pointsCount(){return-1}properties(){return super.properties()}name(){return"Path"}hasEditableCoordinates(){return!1}addPoint(e,t,i){var n;const a=Object(s.ensureNotNull)(this.priceScale()),l=this._model.timeScale().indexToCoordinate(e.index),c=e.price,h=Object(s.ensure)(null===(n=this.ownerSource())||void 0===n?void 0:n.firstValue()),u=a.priceToCoordinate(c,h);if(this._points.length>0){const e=this._points[this._points.length-1],t=this._model.timeScale().indexToCoordinate(e.index),i=e.price,s=a.priceToCoordinate(i,h);if(new r.Point(l,u).subtract(new r.Point(t,s)).length()<Object(o.interactionTolerance)().minDistanceBetweenPoints)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return super.addPoint(e,t,i)}static createProperties(e){const t=new n.DefaultProperty("linetoolpath",e);return c._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"WW+G")).then(e=>e.PathDefinitionsViewModel)}static _configureProperties(e){a.LineDataSource._configureProperties(e),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().lineColor]))}}},"Ye2/":function(e,t,i){"use strict";var s;i.r(t),i.d(t,"LineToolBarsPatternMode",(function(){return s})),function(e){e[e.Bars=0]="Bars",e[e.Line=1]="Line",e[e.OpenClose=2]="OpenClose",e[e.LineOpen=3]="LineOpen",e[e.LineHigh=4]="LineHigh",e[e.LineLow=5]="LineLow",e[e.LineHL2=6]="LineHL2"}(s||(s={}))},Yj6H:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleBase",(function(){return w}));var s=i("Eyy1"),r=i("ogJP"),n=i("aIyQ"),o=i.n(n),a=i("Y7w9"),l=i("Qb4w"),c=i("TTFo"),h=i("qJq3"),u=i("7ktv"),d=i("tc+8"),p=i.n(d),_=i("3ClC"),m=i("/tGj"),f=i("n5al"),g=i("SwuQ"),v=i("s1Gx"),b=i("lTLF"),S=i("CW80");const y={autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1,
|
||
indexedTo100:!1};class w{constructor(e){this._marksCache=null,this._onMarksChanged=new o.a,this.m_dataSources=[],this._sourcesForAutoscale=null,this._hasSeries=!1,this._seriesLikeSources=[],this._seriesLikeSourcesSet=new Set,this._priceDataSources=[],this._mainSource=null,this._lastSourceRemoved=new o.a,this._scaleSeriesOnly=!1,this._invalidatedForRange={isValid:!0,visibleBars:null},this.m_priceRange=null,this.m_height=0,this._margins={top:0,bottom:0},this._correctedMarginsCache=null,this._topPixelMargin=0,this._bottomPixelMargin=0,this._internalHeightCache=null,this._internalHeightChanged=new o.a,this._priceRangeSnapshot=null,this._currencyCache=null,this._unitCache=null,this._recalculatePriceRangeOnce=!1,this._cachedOrderedSoruces=null,this._scaleStartPoint=null,this._maxPriceRange=null,this._minPriceRange=null,this._priceRangeChanged=new o.a,this._sourcesToUpdateViews=null,this._markBuilder=new b.PriceTickMarkBuilder(this,100,this._coordinateToLogical.bind(this),this._logicalToCoordinate.bind(this)),e=Object.assign({},y,e),this._properties=new p.a(e)}isLog(){return this._properties.childs().log.value()}isPercentage(){return this._properties.childs().percentage.value()}isInverted(){return this._properties.childs().isInverted.value()}isIndexedTo100(){return this._properties.childs().indexedTo100.value()}isAutoScale(){return this._properties.childs().autoScale.value()&&!this.isLockScale()}isLockScale(){return this._properties.childs().lockScale.value()}isRegular(){return!this.isPercentage()&&!this.isLog()&&!this.isIndexedTo100()}properties(){return this._properties}height(){return this.m_height}setHeight(e){this.m_height!==e&&(this.m_height=e,this._invalidateInternalHeightCache(),this._marksCache=null)}internalHeight(){if(this._internalHeightCache)return this._internalHeightCache;const e=this.height()-this.topPixelMargin()-this.bottomPixelMargin();return this._internalHeightCache=e,e}priceRange(){return this._makeSureItIsValid(),this.m_priceRange}setPriceRange(e,t,i){if(!(e instanceof l.PriceRange))throw new TypeError("incorrect price range");const s=this.m_priceRange;if(!t&&l.PriceRange.compare(s,e))return;const r=null!==this._maxPriceRange&&this._maxPriceRange.containsStrictly(e),n=null!==this._minPriceRange&&e.containsStrictly(this._minPriceRange);this.isLockScale()&&!t&&(r||n)||(this._marksCache=null,this.m_priceRange=e,i||this._priceRangeChanged.fire(s,e))}setMinPriceRange(e){this._minPriceRange=e}setMaxPriceRange(e){this._maxPriceRange=e}recalculatePriceRangeOnce(){this._recalculatePriceRangeOnce=!0}priceRangeShouldBeRecalculatedOnce(){if(!this._recalculatePriceRangeOnce||this.isLockScale())return!1;const e=this.mainSource();return null!==e&&e.priceRangeReady()}priceRangeChanged(){return this._priceRangeChanged}updateAllViews(){const e=this._getSourcesToUpdateViews();for(const t of e)t.updateAllViews()}priceToLogical(e){return this.isLog()&&e?Object(c.toLog)(e):e}logicalToPrice(e){return this.isLog()?Object(c.fromLog)(e):e}mainSource(){if(null!==this._mainSource)return this._mainSource;let e
|
||
;for(const t of this.m_dataSources){if(t instanceof h.Series){e=t;break}!e&&t instanceof u.PriceDataSource&&(e=t)}return this._mainSource=e||null,this._correctedMarginsCache=null,this._mainSource}pricesArrayToCoordinates(e,t,i){this._makeSureItIsValid();const r=this.bottomPixelMargin(),n=Object(s.ensureNotNull)(this.priceRange()),o=n.minValue(),a=n.maxValue(),l=this.internalHeight()-1,h=this.isInverted(),u=l/(a-o);void 0===i&&(i=e.length);const d=this.isPercentage(),p=this.isIndexedTo100(),_=this.isLog(),m=this.m_height;let f,g;for(let s=0;s<i;s++)f=e[s],Number.isFinite(f)&&(d?f=Object(c.toPercent)(f,t):p?f=Object(c.toIndexedTo100)(f,t):_&&(f=Object(c.toLog)(f)),g=r+u*(f-o),e[s]=h?g:m-1-g)}dataSources(){return this.m_dataSources}seriesLikeSources(){return this._seriesLikeSources}addDataSource(e,t){if(t||-1===this.m_dataSources.indexOf(e)){if(e instanceof u.PriceDataSource&&(this._priceDataSources.push(e),e.currencyChanged().subscribe(this,()=>this._currencyCache=null),e.unitChanged().subscribe(this,()=>this._unitCache=null),Object(m.isSymbolSource)(e)&&(this._seriesLikeSources.push(e),this._seriesLikeSourcesSet.add(e),e.symbolResolved().subscribe(this,()=>{this._currencyCache=null,this._unitCache=null}),e instanceof h.Series))){const t=e.properties();this._hasSeries||(t.childs().lockScale&&(this.setMode({lockScale:t.childs().lockScale.value()}),t.removeProperty("lockScale")),t.childs().pnfStyle.childs().lockScale&&t.childs().pnfStyle.removeProperty("lockScale")),this._hasSeries=!0}e.properties().visible.listeners().subscribe(null,()=>{this._sourcesForAutoscale=null,this._currencyCache=null,this._unitCache=null}),this.m_dataSources.push(e),this._mainSource=null,this._correctedMarginsCache=null,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._currencyCache=null,this._unitCache=null,this.updateFormatter(),this._initScaleProperties(),this.invalidateSourcesCache()}}removeDataSource(e){const t=this.m_dataSources.indexOf(e);if(Object(s.assert)(-1!==t,"Source is not attached to scale"),e.properties().visible.listeners().unsubscribeAll(this),this.m_dataSources.splice(t,1),e instanceof u.PriceDataSource){const t=this._priceDataSources.indexOf(e);if(Object(s.assert)(-1!==t,"Source is not found"),this._priceDataSources.splice(t,1),Object(m.isSymbolSource)(e)){const t=this._seriesLikeSources.indexOf(e);Object(s.assert)(-1!==t,"Source is not found"),this._seriesLikeSources.splice(t,1),this._seriesLikeSourcesSet.delete(e),e.symbolResolved().unsubscribeAll(this),e instanceof h.Series&&(this._hasSeries=!1)}e.currencyChanged().unsubscribeAll(this),e.unitChanged().unsubscribeAll(this)}this.mainSource()||this.setMode({autoScale:!0}),this._mainSource=null,this._correctedMarginsCache=null,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache(),0===this.m_dataSources.length&&this._lastSourceRemoved.fire(),this._currencyCache=null,this._unitCache=null}currency(e){
|
||
if(null!==this._currencyCache&&e.size()===this._currencyCache.availableCurrenciesCount)return this._currencyCache.value;let t;const i=new Set,r=new Set,n=new Set,o=new Map;let a,l=0===this._seriesLikeSources.length,c=!0,h=0,u=0;for(const d of this._seriesLikeSources){if(!d.isVisible())continue;const u=d.symbolInfo();if(null===u){t=null;break}const p=Object(f.symbolOriginalCurrency)(u);if(null===p){t=null;break}o.set(p,Object(s.ensureNotNull)(Object(f.symbolOriginalCurrency)(u,!0)));const _=d.currency();if(null===_){t=null;break}o.set(_,Object(s.ensureNotNull)(Object(f.symbolCurrency)(u,!0)));const m=Object(f.symbolBaseCurrency)(u);null!==m&&r.add(m),c=c&&p===_,n.add(_),i.add(p),void 0===a?a=_:null!==a&&a!==_&&(a=null),l||e.convertible(_)&&Object(f.symbolCurrencyConvertible)(u)||(l=!0),h+=1}if(null!==t)for(const d of this._priceDataSources){if(this._seriesLikeSourcesSet.has(d))continue;const i=d;if(!i.isCurrencySource()||!i.isVisible())continue;const r=i.currency();if(null===r){t=null;break}n.add(r),u+=1;const c=Object(s.ensureNotNull)(i.symbolSource()),p=c.symbolInfo();if(null===p){t=null;break}if(l||e.convertible(r)&&Object(f.symbolCurrencyConvertible)(p)||(l=!0),o.set(r,Object(s.ensureNotNull)(Object(f.symbolCurrency)(p,!0))),!this._seriesLikeSourcesSet.has(c)||!c.isVisible()){if(h>0)a=null;else if(void 0===a)a=r;else if(null!==a&&a!==r){a=null;break}l=!0;break}}if(void 0===t)if(0===h&&0===u)t=null;else{const e=a||null;t={readOnly:l,selectedCurrency:e,currencies:n,originalCurrencies:i,baseCurrencies:r,symbolSourceCount:h,allCurrenciesAreOriginal:c,displayedValues:o}}return this._currencyCache={value:t,availableCurrenciesCount:e.size()},t}unit(e){if(null!==this._unitCache&&e.size()===this._unitCache.availableUnitsCount)return this._unitCache.value;let t;const i=new Set,r=new Set,n=new Map,o=new Map;let l,c=0===this._seriesLikeSources.length?new Set:e.allGroups(),h=!0,u=0,d=0;for(const s of this._seriesLikeSources){if(!s.isVisible())continue;const d=s.symbolInfo();if(null===d){t=null;break}const p=Object(f.symbolOriginalUnit)(d);if(null===p){t=null;break}n.set(p,e.name(p)),o.set(p,e.description(p));const _=s.unit();if(null===_){t=null;break}if(n.set(_,e.name(_)),o.set(_,e.description(_)),h=h&&p===_,r.add(_),i.add(p),void 0===l?l=_:null!==l&&l!==_&&(l=null),c.size>0){const t=Object(g.unitConvertibleGroups)(d,_,e);c=Object(a.intersect)(c,new Set(t))}u+=1}if(null!==t)for(const p of this._priceDataSources){if(this._seriesLikeSourcesSet.has(p))continue;const i=p;if(!i.isUnitSource()||!i.isVisible())continue;const h=i.unit();if(null===h){t=null;break}r.add(h),d+=1;const _=Object(s.ensureNotNull)(i.symbolSource()),m=_.symbolInfo();if(null===m){t=null;break}if(c.size>0){const t=Object(g.unitConvertibleGroups)(m,h,e);c=Object(a.intersect)(c,new Set(t))}if(n.set(h,e.name(h)),o.set(h,e.description(h)),!this._seriesLikeSourcesSet.has(_)||!_.isVisible()){if(u>0)l=null;else if(void 0===l)l=h;else if(null!==l&&l!==h){l=null;break}c=new Set;break}}if(void 0===t)if(0===u&&0===d)t=null;else{const e=l||null;t={availableGroups:c,
|
||
selectedUnit:e,units:r,originalUnits:i,symbolSourceCount:u,allUnitsAreOriginal:h,names:n,descriptions:o}}return this._unitCache={value:t,availableUnitsCount:e.size()},t}setMargins(e){if(!Object(r.isNumber)(e.top)||!Object(r.isNumber)(e.bottom))throw new TypeError("invalid margin");if(e.top<0||e.top>30||e.bottom<0||e.bottom>30)throw new RangeError("invalid margin");this._margins.top===e.top&&this._margins.bottom===e.bottom||(this._margins=e,this._correctedMarginsCache=null,this._invalidateInternalHeightCache(),this._marksCache=null)}topMargin(){return this._correctedMargins().top}bottomMargin(){return this._correctedMargins().bottom}invalidateMargins(){this._correctedMarginsCache=null}topPixelMargin(){return this.isInverted()?this.bottomMargin()*this.height()+this._bottomPixelMargin:this.topMargin()*this.height()+this._topPixelMargin}bottomPixelMargin(){return this.isInverted()?this.topMargin()*this.height()+this._topPixelMargin:this.bottomMargin()*this.height()+this._bottomPixelMargin}marks(e){return this._makeSureItIsValid(),null===this._marksCache&&(this._markBuilder.rebuildTickMarks(),this._marksCache=this._markBuilder.marks(),this._onMarksChanged.fire()),e?this._marksCache.full:this._marksCache.withoutEndingZerosIfPossible}onMarksChanged(){return this._onMarksChanged}priceRangeInPrice(){if(this.isEmpty())return null;const e=this.mainSource();if(null===e)return null;const t=Object(s.ensureNotNull)(e.firstValue()),i=this.height();return{from:this.coordinateToPrice(i-1,t),to:this.coordinateToPrice(0,t)}}setPriceRangeInPrice(e){if(this.isPercentage()||this.isIndexedTo100())return;const t=this.isInverted(),i=t?this.bottomMargin():this.topMargin(),s=t?this.topMargin():this.bottomMargin(),r=this.isLog();let n=r?Object(c.toLog)(e.from):e.from,o=r?Object(c.toLog)(e.to):e.to;const a=o-n;n+=s*a,o-=i*a,this.setMode({autoScale:!1}),this.setPriceRange(new l.PriceRange(n,o)),this._marksCache=null,this._onMarksChanged.fire()}hasMainSeries(){return this._hasSeries}getStudies(){return this.dataSources().filter(_.isStudy)}lastSourceRemoved(){return this._lastSourceRemoved}sourcesForAutoscale(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.childs().scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||(this._sourcesForAutoscale=this._recalculateSourcesForAutoscale()),this._sourcesForAutoscale}recalculatePriceRange(e){this._invalidatedForRange={visibleBars:e,isValid:!1}}internalHeightChanged(){return this._internalHeightChanged}orderedSources(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;let e=this.m_dataSources.slice();return e=Object(v.sortSources)(e),this._cachedOrderedSoruces=e,this._cachedOrderedSoruces}invalidateSourcesCache(){this._cachedOrderedSoruces=null,this._sourcesToUpdateViews=null}startScale(e){if(this.isPercentage()||this.isIndexedTo100())return;if(null!==this._scaleStartPoint||null!==this._priceRangeSnapshot)return;if(this.isEmpty())return;this._scaleStartPoint=this.m_height-e;const t=this.priceRange();this._priceRangeSnapshot=t&&t.clone()}
|
||
scaleTo(e){if(this.isPercentage()||this.isIndexedTo100())return;if(null===this._scaleStartPoint)return;this.setMode({autoScale:!1}),(e=this.m_height-e)<0&&(e=0);let t=(this._scaleStartPoint+.2*(this.m_height-1))/(e+.2*(this.m_height-1));const i=Object(s.ensureNotNull)(this._priceRangeSnapshot).clone();t=Math.max(t,.1),i.scaleAroundCenter(t),this.setPriceRange(i)}endScale(){this.isPercentage()||this.isIndexedTo100()||null!==this._scaleStartPoint&&(this._scaleStartPoint=null,this._priceRangeSnapshot=null)}_recalculateSourcesForAutoscale(){this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.childs().scaleSeriesOnly.value());const e=this._scaleSeriesOnly&&this._hasSeries;return this.m_dataSources.filter(t=>!!(t.properties().visible.value()||t instanceof h.Series)&&(e?t instanceof h.Series:t.isIncludedInAutoScale()))}_updateAutoScaleDisabledProperty(e){const t=this._properties.childs(),i=t.indexedTo100.value()||t.percentage.value()||t.lockScale.value();e?t.autoScaleDisabled.setValueSilently(i):t.autoScaleDisabled.setValue(i)}_setAutoScaleValueWithDependentProperties(e){const t=this._properties.childs();t.autoScale.setValueSilently(e),e&&(t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.logDisabled.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)}_setLockScaleValueWithDependentProperties(e){const t=this._properties.childs();t.lockScale.setValueSilently(e),e&&(t.autoScale.setValueSilently(!1),t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1),t.log.setValueSilently(!1)),t.percentageDisabled.setValueSilently(e),t.logDisabled.setValueSilently(e),this._updateAutoScaleDisabledProperty(!0)}_setPercentageValueWithDependentProperties(e){const t=this._properties.childs();t.percentage.setValueSilently(e),e&&(t.autoScale.setValueSilently(!0),t.log.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.indexedTo100.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)}_setIndexedTo100ValueWithDependentProperties(e){const t=this._properties.childs();t.indexedTo100.setValueSilently(e),e&&(t.autoScale.setValueSilently(!0),t.log.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.percentage.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)}_setLogValueWithDependentProperties(e){const t=this._properties.childs();t.log.setValueSilently(e),e&&(t.lockScale.setValueSilently(!1),t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)}_recalculatePriceRangeImpl(){const e=this._invalidatedForRange.visibleBars;if(null===e)return;let t=null;const i=this.sourcesForAutoscale(),s=this.isPercentage(),r=this.isIndexedTo100();let n=0,o=0;for(const l of i){if(!l.properties().visible.value())continue;const i=l.firstValue();if(null===i)continue;const a=e.firstBar(),h=e.lastBar(),u=l.autoScaleInfo(a,h);let d=u.range;d&&(s?d=Object(c.toPercentRange)(d,i):r&&(d=Object(c.toIndexedTo100Range)(d,i)),t=null===t?d:t.merge(d)),
|
||
void 0!==u.topPixelMargin&&(n=Math.max(n,u.topPixelMargin)),void 0!==u.bottomPixelMargin&&(o=Math.max(o,u.bottomPixelMargin))}(Math.abs(n-this._topPixelMargin)>0||Math.abs(o-this._bottomPixelMargin)>0)&&(this._bottomPixelMargin=o,this._topPixelMargin=n,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new l.PriceRange(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new l.PriceRange(-.5,.5)),this._invalidatedForRange.isValid=!0;const a=this.mainSource();null!==a&&this._recalculatePriceRangeOnce&&(this._recalculatePriceRangeOnce=!a.priceRangeReady())}_makeSureItIsValid(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this._recalculatePriceRangeImpl())}_invalidateInternalHeightCache(){this._internalHeightCache=null,this._internalHeightChanged.fire()}_coordinateToLogical(e,t){if(this._makeSureItIsValid(),this.isEmpty())return 0;const i=this._invertedCoordinate(e),r=Object(s.ensureNotNull)(this.priceRange()),n=r.minValue()+(r.maxValue()-r.minValue())*((i-this.bottomPixelMargin())/(this.internalHeight()-1));return this.logicalToPrice(n)}_logicalToCoordinate(e,t){if(this._makeSureItIsValid(),this.isEmpty())return 0;e=this.priceToLogical(e);const i=Object(s.ensureNotNull)(this.priceRange()),r=this.bottomPixelMargin()+(this.internalHeight()-1)*(e-i.minValue())/(i.maxValue()-i.minValue());return this._invertedCoordinate(r)}_invertedCoordinate(e){return this.isInverted()?e:this.height()-1-e}_initScaleProperties(){const e=this.isLockScale(),t=this.properties().childs();e&&(t.percentage.setValue(!1),t.indexedTo100.setValue(!1),t.log.setValue(!1),t.autoScale.setValue(!1)),t.percentageDisabled.setValue(e),t.logDisabled.setValue(e),this._updateAutoScaleDisabledProperty(!1),t.percentage.value()&&(t.log.setValue(!1),t.indexedTo100.setValue(!1)),t.indexedTo100.value()&&(t.log.setValue(!1),t.percentage.setValue(!1))}_correctedMargins(){if(null===this._correctedMarginsCache){const e=this.mainSource();this._correctedMarginsCache=null!==e?e.correctScaleMargins(this._margins):this._margins}return this._correctedMarginsCache}_getSourcesToUpdateViews(){return this._sourcesToUpdateViews||(this._sourcesToUpdateViews=this.m_dataSources.filter(e=>!Object(S.isLineTool)(e)||e.isActualSymbol()&&e.isActualCurrency())),this._sourcesToUpdateViews}}},Yjuu:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"bcXK",7)).then(({FibSpeedResistanceArcsPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 2}name(){return"Fib Speed Resistance Arcs"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}static createProperties(e){var t=new r("linetoolfibspeedresistancearcs",e,!1,{range:[1,11]});return l._configureProperties(t),t}
|
||
async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"pdv6"))).FibSpeedResistanceArcsDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,t.LineToolFibSpeedResistanceArcs=l},YlKu:function(e,t,i){"use strict";i.r(t),i.d(t,"ApplyLineToolTemplateUndoCommand",(function(){return r}));var s=i("RDU5");class r extends s.UndoCommand{constructor(e,t,i){super(i),this._source=e,this._newState=t,this._oldState=e.properties().state()}redo(){this._source.applyTemplate(this._newState)}undo(){this._source.applyTemplate(this._oldState)}}},YmeR:function(e,t,i){"use strict";i.r(t),i.d(t,"ActionBinder",(function(){return r}));var s=i("2h0C");class r extends s.Binding{constructor(e,t,i,s,r=null){super(e,t,!0,i,s),null!==r?e.update({onExecute:r.bind(this)}):e.update({onExecute:this._onActionCallback.bind(this)})}action(){return this.control()}value(){return this.action().isChecked()}setValue(e){this.action().update({checked:Boolean(e)})}_onActionCallback(){this._undoModel.setProperty(this._property,this.value(),this._undoText)}}},"Yt+L":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Eyy1"),r=i("RDU5"),n=i("n5al");class o extends r.UndoCommand{constructor(e,t,i,r){super(r),this._newSourcesUnits=new Map,this._oldSourcesUnits=new Map,this._showFade=!1,this._chartWidget=i;const o=i.model().mainSeries();for(const a of e.seriesLikeSources()){if(!a.isVisible())continue;const e=t||Object(n.symbolOriginalUnit)(Object(s.ensureNotNull)(a.symbolInfo()));this._newSourcesUnits.set(a.id(),e),this._oldSourcesUnits.set(a.id(),a.unit()),this._showFade=this._showFade||a===o&&a.unit()!==e}}redo(){this._applyUnits(this._newSourcesUnits)}undo(){this._applyUnits(this._oldSourcesUnits)}_applyUnits(e){this._showFade&&this._chartWidget.screen.show();const t=this._chartWidget.model().model();e.forEach((e,i)=>{Object(s.ensureNotNull)(t.dataSourceForId(i)).setUnit(e)}),this._chartWidget.model().selectionMacro(e=>{e.clearSelection()})}}},YtI2:function(e,t,i){"use strict";i.r(t),i.d(t,"AreaBackgroundPaneView",(function(){return n}));var s=i("Hr11"),r=i("gMX9");class n extends r.a{constructor(e){super(e)}_plotAId(){return this._source.properties().area[0].name.value()}_plotBId(){return this._source.properties().area[1].name.value()}_color(){return this._source.properties().areaBackground.backgroundColor.value()}_transparency(){const e=this._source.properties().areaBackground.transparency.value();return Object(s.clamp)(e,0,100)}_visible(){return this._source.properties().areaBackground.fillBackground.value()}_getColorByPlotValue(e){return this._color()}_isPerBarColoringSupported(){return!1}}},YuHv:function(e,t,i){"use strict";i.d(t,"a",(function(){
|
||
return r}));var s=i("AWC/");function r(e=[],t=[]){const i=document.createElement("div"),r=document.createElement("div");return i.appendChild(r),i.classList.add(s.container),r.classList.add(s.inner),e.forEach(e=>{i.classList.add(s[e])}),t.forEach(e=>{i.classList.add(s[e])}),i}},YzC7:function(e,t,i){"use strict";var s=i("GVHu"),r=i("n5al"),n=i("tc+8"),o=i.n(n),a=i("Kxc7"),l=i("oXaB"),c=i("KcY8");class h extends c.a{constructor(e,t){super(),this._studyCompare=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._studyCompare.lastValueData(this._data.plotIndex,!1);if(s.noData)return;i.background=s.color,i.textColor=this.generateTextColor(s.color),i.coordinate=s.coordinate,i.floatCoordinate=s.floatCoordinate;const r=this._studyCompare.model().properties().scalesProperties;if(r.showSeriesLastValue.value()){const t=this._studyCompare.priceScale();if(null===t)e.text=s.text,e.secondLine="";else if(r.seriesLastValueMode.value()!==l.PriceAxisLastValueMode.LastPriceAndPercentageValue)e.text=s.text,e.secondLine="";else{const i=t.isPercentage();e.text=i?s.formattedPricePercentage:s.formattedPriceAbsolute,e.secondLine=i?s.formattedPriceAbsolute:s.formattedPricePercentage}e.visible=!0}t.text="",r.showSymbolLabels.value()&&(t.text=this._paneText(),t.visible=t.text.length>0)}_paneText(){let e="";if(this._studyCompare.model().properties().scalesProperties.showSymbolLabels.value()){const t=this._studyCompare.symbolInfo();e+=(t&&Object(r.symbolCurrentContract)(t)||this._studyCompare.symbol())+" "}return e.trim()}}var u=i("it7y"),d=i("e92V"),p=i("mMWL"),_=i("qFKp"),m=i("ogJP"),f=i("EYFt");class g extends f.a{constructor(e,t){super(e,t),this._emptyValues[0].title=e.guiPlotName("")}_hideValues(){return!1}}const v=_.CheckMobile.any();class b extends u.StudyDataWindowView{constructor(e,t){super(e,t),this._studyCompare=e}_hideValues(){return!1}_createValuesProvider(e,t){return new g(e,t)}_currentIndex(){const e=this._model.crossHairSource().lockedIndex;let t;return v&&(null===this._model.crossHairSource().pane&&void 0===e||Object(d.isLineToolName)(p.tool.value())||null!==this._model.lineBeingEdited())?t=this._study.data().lastIndex():(t=this._model.crossHairSource().appliedIndex(),Object(m.isNumber)(t)||(t=this._study.data().lastIndex())),t}}class S extends b{constructor(e,t){super(e,t),this._additional=null,this._showSeriesOHLC=t.properties().paneProperties.legendProperties.showSeriesOHLC,this._showSeriesOHLC.subscribe(this,this.update)}isValuesVisible(){return this._showSeriesOHLC.value()}destroy(){this._showSeriesOHLC.unsubscribeAll(this)}additional(){return this._additional}_updateImpl(){super._updateImpl()}}var y=i("2kV1"),w=i("W+6j");class C extends w.a{getSplitTitle(){return this._source.titleInParts(!0,void 0,!1,!1)}text(){return this._source.isFailed()?`${this._source.title(!0,void 0,!1,!1)}: ${this._source.status()}`:`${this._source.title(!0,void 0,!1,!1)} ${this._source.status()}`}}i.d(t,"a",(function(){return I}))
|
||
;const P=a.enabled("study_overlay_compare_legend_option"),x=a.enabled("force_exchange_as_title"),T=a.enabled("uppercase_instrument_names"),M=!a.enabled("hide_study_compare_legend_item");class I extends s.Study{constructor(e,t,i,s){t.hasChild("currencyId")||t.addChild("currencyId",new o.a(null)),t.hasChild("unitId")||t.addChild("unitId",new o.a(null)),super(e,t,i,s),this.properties().minTick.subscribe(null,()=>this._recreatePriceFormattingDependencies()),this.properties().minTick.subscribe(null,()=>this._model.fullUpdate()),this.properties().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().unitId.subscribe(this,this._onUnitChanged),this.properties().merge({skipHistogramBaseOnAutoScale:!0})}createPriceAxisView(e){return new h(this,{plotIndex:"compare"})}symbol(){let e;const t=this.properties().inputs.symbol.value(),i=this.symbolInfo(),s=i&&i.exchange&&0!==i.exchange.length;return e=x&&s&&i?i.exchange:i?i.name:t,T?e.toUpperCase():e}setSymbol(e){this._properties.inputs.symbol.setValue(e)}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this._properties.inputs.symbol.value();return e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null}symbolResolved(){return this.symbolsResolved()}currency(){return this._properties.currencyId.value()||null}setCurrency(e){this._properties.currencyId.setValue(e)}isConvertedToOtherCurrency(){return Object(r.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this._properties.unitId.value()||null}setUnit(e){this._properties.unitId.setValue(e)}isConvertedToOtherUnit(){return Object(r.isConvertedToOtherUnit)(this.symbolInfo())}symbolSource(){return this}state(e,t){const i=super.state(e,t);return i}symbolTitle(e,t){return this.title(!0,{},!1,e)}titleInParts(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return[T?r.toUpperCase():r]}tags(){const e=this.symbol();return e?[e]:[]}statusView(){return M?super.statusView():null}guiPlotName(e){return this.properties().inputs.symbol.value()}canOverrideMinTick(){return!0}canBeHiddenByGlobalFlag(){return!1}valuesProvider(){return new g(this,this.model())}statusProvider(e){return new C(this,this._model.properties().scalesProperties.textColor)}createViews(){this._legendView||(this._legendView=new S(this,this._model)),this._dataWindowView||(this._dataWindowView=new b(this,this._model)),this._statusView||(this._statusView=new y.StudyStatusView(this)),super.createViews()}_showLastValueOnPriceScale(){return this._model.properties().scalesProperties.showSeriesLastValue.value()}_onCurrencyChanged(){this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()}_onUnitChanged(){this.isStarted()&&this._tryChangeInputs(),this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return null!==s&&(t["unit-id"]=s),t}_onSymbolResolved(e,t){super._onSymbolResolved(e,t),this._recreatePriceFormattingDependencies(),this.setCurrency(Object(r.symbolCurrency)(t)),this.setUnit(Object(r.symbolUnit)(t)),
|
||
this.model().realignLineTools()}_tryCreateFormatter(){const e=this.symbolInfo();return Object(r.createSeriesFormatter)(e,this.properties().minTick.value())}_addSymbolToMap(e,t){var i,s;const n=this._resolvedSymbolKey(e,null!==(i=Object(r.symbolCurrency)(t))&&void 0!==i?i:void 0,null!==(s=Object(r.symbolUnit)(t))&&void 0!==s?s:void 0);this._resolvedSymbols[n]=t}_resolvedSymbolKey(e,t,i){const s=null!=t?t:this.currency(),r=null!=i?i:this.unit();return e+(null===s?"":"_#_"+s)+(null===r?"":"_#_"+r)}_titleInParts(e,t,i,s){const r=this.properties().inputs.symbol.value(),n=this.symbolInfo(),o=n&&n.exchange&&0!==n.exchange.length;let a;if(x&&o&&n)a=n.exchange;else if(n){if(a=n.name,P)switch(this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value()){case"description":a=n.description;break;case"ticker-and-description":a=`${n.name}, ${n.description}`}else if(o&&!s)return[a,[n.exchange]]}else a=r;return[a]}}},Z0Sh:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX").LineToolColorsProperty,o=[4.5,9,11.25,18,22.5,36,45],a=function(){for(var e=[],t=o.length-1,i=1,s=0,r=0;r<1e10;)r=o[s]*i,e.push(Math.round(r)),e.push(Math.ceil(-r)),s===t-1&&(i*=10),s=(s+1)%t;return e.sort((function(e,t){return e<t?-1:e>t?1:0})),e}();class l extends s{constructor(e,t){super(e,t||l.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"eg8N",7)).then(({GannSquarePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}hLevelsCount(){return l.HLevelsCount}vLevelsCount(){return l.VLevelsCount}pointsCount(){return 2}name(){return"Gann Box"}_alignPriceOnPattern(e,t){var i=Math.round(1e6*(e.price-t.price))/1e6;if(0===i)return t.price;for(var s=o[0],r=o[o.length-1],n=1,a=Math.abs(i);a<s*n||r*n<a;)a<s*n?n*=.1:r*n<a&&(n*=10);for(var l=r*n,c=o.length-2;c>=0&&!(o[c]*n<a);--c)l=o[c]*n;return e.price=t.price+(i>=0?l:-l),e}_alignTimeOnPattern(e,t){var i=e.index-t.index;if(0===i)return 0;for(var s=a.length-2;s>=0&&!(a[s]<i);--s);return s+=i>0?1:0,e.index=t.index+a[s],e}_alignPointsFixedIncrement(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e}_preparePoint(e,t){return t&&t.shift()&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),s.prototype._preparePoint.call(this,e,t)}setPoint(e,t,i){if(i&&i.shift()){var s=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,s)}super.setPoint(e,t,i)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"2liL"))).GannSquareDefinitionsViewModel}static createProperties(e){var t=new r("linetoolgannsquare",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("color"),e.child("fans").child("color")],i=1;i<=l.HLevelsCount;i++)t.push(e.child("hlevel"+i).child("color"));for(i=1;i<=l.VLevelsCount;i++)t.push(e.child("vlevel"+i).child("color"));e.addChild("linesColors",new n(t)),
|
||
e.addExclusion("linesColors")}}l.HLevelsCount=7,l.VLevelsCount=7,t.LineToolGannSquare=l},Z8aO:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesPriceLinePaneView",(function(){return n}));var s=i("k4w6"),r=i("8Uy/");class n extends s.a{constructor(e){super(e),this._lineRendererData.linestyle=r.LINESTYLE_DOTTED}_updateImpl(){if(this._lineRendererData.visible=!1,!this._series.properties().showPriceLine.value())return;if(12===this._series.properties().style.value())return;const e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,this._lineRendererData.y=e.coordinate,this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}}},ZBiT:function(e,t,i){e.exports={"css-value-pane-controls-padding-left":"1px","css-value-pane-controls-padding-right":"5px"}},ZJKN:function(e,t,i){"use strict";i.r(t),i.d(t,"BarsRange",(function(){return r}));var s=i("Eyy1");class r{constructor(e,t){Object(s.assert)(e<=t,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=e,this._lastBar=t}firstBar(){return this._firstBar}lastBar(){return this._lastBar}count(){return this._lastBar-this._firstBar+1}contains(e){return this._firstBar<=e&&e<=this._lastBar}equals(e){return this._firstBar===e.firstBar()&&this._lastBar===e.lastBar()}static compare(e,t){return null===e||null===t?e===t:e.equals(t)}}},ZjKI:function(e,t,i){"use strict";i.r(t),i.d(t,"CLOSE_POPUPS_AND_DIALOGS_COMMAND",(function(){return s}));const s="CLOSE_POPUPS_AND_DIALOGS_COMMAND"},Zl0W:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolPriceNote",(function(){return l}));var s=i("Eyy1"),r=i("Ocx9"),n=i("tc+8"),o=i.n(n),a=i("Ss5c");class l extends a.LineDataSource{constructor(e,t){super(e,t||l.createProperties()),this._labelMovingDelta=null,i.e("lt-pane-views").then(i.bind(null,"0s1X")).then(t=>{this._setPaneViews([new t.PriceNotePaneView(this,e)])})}pointsCount(){return 2}properties(){return super.properties()}name(){return"Price Note"}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}startMoving(e,t,i){if(1===t){if(this.isSourceHidden())return;const i=Object(s.ensureDefined)(e.logical),r=this.points()[1];this._labelMovingDelta={index:r.index-i.index,price:r.price-i.price},this.startChanging(t,i)}else this._labelMovingDelta=null,super.startMoving(e,t,i)}move(e,t,i){if(null!==this._labelMovingDelta){const t=Object(s.ensureDefined)(e.logical),r={index:t.index+this._labelMovingDelta.index,price:t.price+this._labelMovingDelta.price};this.setPoint(1,r,i),this.updateAllViews()}else super.move(e,t,i)}endMoving(e,t){return null!==this._labelMovingDelta?(this._labelMovingDelta=null,this.endChanging(!1,e)):super.endMoving(e)}static createProperties(e){const t=new r.DefaultProperty("linetoolpricenote",e);return l._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){
|
||
return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"ernH")).then(e=>e.PriceNoteDefinitionsViewModel)}static _configureProperties(e){a.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.a("")),e.addExclusion("text"),e.hasChild("backgroundsColors")&&e.removeProperty("backgroundsColors"),e.hasChild("textsColors")&&e.removeProperty("textsColors")}}},ZmuQ:function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));var s=i("jCNj"),r=i("E6p6"),n=i("5mo2");class o{constructor(e,t,i,s){this.init(e,t,i,s)}init(e,t,i,r){this.timezone=s.get_timezone(e),this.spec=new n.SessionSpec(e,t,i,r)}}class a{alignTime(e){if(isNaN(e))return NaN;let t=this.indexOfBar(e);return t===r.SessionStage.POST_SESSION&&(this.moveTo(e),t=this.indexOfBar(e)),t<0?NaN:this.startOfBar(t)}}},"Zo2/":function(e,t,i){"use strict";(function(t){i("YCFM"),i("YFKU");var s=i("Eyy1").assert,r=i("Y7w9").moveToHead,n=i("iPBr").TimeAxisWidget,o=i("fTGZ").BarsMarksContainer,a=i("qJq3").Series,l=i("Kxc7"),c=i("YmeR").ActionBinder,h=i("mKT+").resolveAndShowEditObjectDialog,u=i("Vdly"),d=u.getValue,p=u.setValue,_=i("QloM").TabNames,m=i("cdbK").showGoToDateDialog,f=i("/3z9"),g=i("lxNp"),v=i("7nsU").showConfirmInputsDialog,b=i("ikwP").disableSelection,S=i("GVHu").Study,y=i("8sOK").StudyStub,w=i("3ClC").isStudy,C=i("Ss5c").LineDataSource,P=i("CW80"),x=P.isLineTool,T=P.isStudyLineTool,M=i("7KDR"),I=M.Action,L=M.Separator,O=(i("L/Ed").ToolboxType,i("mMWL")),A=i("LxhU").Interval,E=i("pPtI").setLastUsedResolution,k=i("n5al"),D=k.getDefaultStyle,V=i("pvsv").showSymbolInfoDialog,B=i("H0vP").InvalidationMask,R=i("H0vP").InvalidationLevel,N=i("PT1i").linking,j=i("mYjs").showChangeIntervalDialog,F=i("u5Q5").showDialog,W=i("u5Q5").activateKeyPressHandler,H=i("Ocx9").DefaultProperty,z=i("+6ja"),U=z.availableTimezones,G=z.timezoneIsAvailable,q=i("0F0w").ChartSession,Y=i("0YCj"),K=i("c2JX").Spinner,J=i("JWMC").trackEvent,Z=i("VaSN").lastEventIsTouch,X=i("vaqD").LoadingScreen,$=i("wZIs"),Q=i("txPx").getLogger("ChartWidget",{color:"#606"}),ee=i("2uTr").appendEllipsis,te=i("U0+/").StudyMetaInfoRepository,ie=i("VNzU").isMultipleLayout,se=i("b1GK").addPerfMark,re=i("KnF9").EnvironmentState,ne=i("FQhm"),oe=i("wjVR").ChartWidgetBase,ae=i("qFKp").CheckMobile.any(),le=i("uDHo").TIMEFRAMETYPE,ce=i("GDWD").addPlusButtonProperty,he=window.t("On The Left"),ue=window.t("On The Right"),de=window.t("Move Scale To Left"),pe=window.t("Move Scale To Right");class _e extends oe{constructor(e,i,s){super(e,i,s),this._options.timeScaleWidget&&(this._options.timeScaleWidget.pressedMouseMoveScale=this._options.handleScale.axisPressedMouseMove.time);var r=this;this._startSpinner(this._options.container.value());var n=this._options.content,o=this._options.readOnly;this._removeMaximizeHotkey=null,r._hotkeys=g.createGroup({desc:"Chart actions",isDisabled:function(){return!r._isActive}});var a=this._options.containsData,l=this._options.onWidget,c=this._options.onCmeWidget
|
||
;c&&Q.logWarn("[ChartWidget] 'onCmeWidget' option is depricated");var h=this._options.widgetCustomer,u=this._options.timezone,d=this._options.hideSymbolSearch,p=this._options.defSymbol,_=A.isValid(this._options.defInterval)?this._options.defInterval:void 0,m=parseInt(this._options.defStyle),f=k.isValidStyle(m)?m:void 0,v=this._options.defExtendedHours,b=void 0!==this._options.defTimeframe?{value:this._options.defTimeframe.toUpperCase(),type:le.PeriodBack}:void 0;this._chartWidgetCollection=this._options.chartWidgetCollection,this._content=n,this._initialLoading=this._options.initialLoading,this._readOnly=o,this._containsData=a,this._showChartEvents=!a&&this._options.chartEventsEnabled,this._defSymbol=p,this._defInterval=_,this._defTimeframe=b,this._defStyle=f,this._onWidget=!!l,this._compareSymbols=this._options.compareSymbols,this._onWidget&&(c?this._widgetCustomer="cme":h&&(this._widgetCustomer=h)),this._hideSymbolSearch=d,this._frameTime=30,this._model=null,this._metaInfo={},this._drawRafId=0,this._compareDialog=null;var S=this._contentSeriesProperties();S&&(p=S.symbol,_=S.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new H("chartproperties",void 0,void 0,this._options.useUserChartPreferences);var y=this._options.useUserChartPreferences?$.defaults("chartproperties.mainSeriesProperties"):$.factoryDefaults("chartproperties.mainSeriesProperties");this._properties.mainSeriesProperties.merge(y),_=_||y.interval||"D",k.isValidStyle(f)||(f=k.isValidStyle(y.style)?y.style:D(A.isRange(_))),this._properties.mainSeriesProperties.merge({visible:!0,symbol:p||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:_,currencyId:null,unitId:null,style:f,extendedHours:v,lineStyle:{styleType:$.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),u&&G(u)&&this._properties.timezone.setValue(u),this._tagsChanged=new t,this._disconnected=new t,this._reconnectBailout=new t,this._connected=new t,this._onScroll=new t,this.chartWidgetInitialized=new t,this._chartSession=new q(ChartApiInstance),this._metaInfoRepository=new te(this._chartSession),this._timingsMeter=null,this._isActive=this._options.isActive,this._options.container.subscribe((function(e){r._setElement(e)}),{callWithLast:!0});var w=function(){r.resize()};this._options.width.subscribe(w),this._options.height.subscribe(w),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this)),this._aboutToBeDestroyed=new t,this._actions=null,this._definitionsViewModel=null,this._backgroundTopColorSpawn=null,this._backgroundBottomColorSpawn=null,this._onZoom=new t}onZoom(){return this._onZoom}isInitialized(){return Boolean(this._inited)}compareSymbols(){return this._compareSymbols}async _getChartPropertyDefinitionsViewModel(){if(null===this._definitionsViewModel){
|
||
const{ChartPropertyDefinitionsViewModel:e}=await Promise.all([i.e(33),i.e(61),i.e("general-property-page")]).then(i.bind(null,"5lPo"));if(this._isDestroyed)throw new Error("Chart widget already destroyed");await new Promise(e=>this.withModel(null,e)),null===this._definitionsViewModel&&(this._definitionsViewModel=new e(this.model(),this.properties(),this._options))}return this._definitionsViewModel}_initMaximizeHotkey(e){var t=this;function i(e){e.defaultPrevented||f.modifiersFromEvent(e)===f.Modifiers.Alt&&e.stopPropagation()}function s(e){e.defaultPrevented||f.modifiersFromEvent(e)===f.Modifiers.Alt&&(e.preventDefault(),e.stopPropagation(),t.toggleFullscreen())}return e.addEventListener("mousedown",i,!0),e.addEventListener("click",s,!0),function(){e.removeEventListener("mousedown",i,!0),e.removeEventListener("click",s,!0)}}toggleFullscreen(){var e=this.getResizerDetacher();e.fullscreenable.value()&&(e.fullscreen.value()?e.exitFullscreen():e.requestFullscreen())}_beginRequestActive(){var e=this._chartWidgetCollection.activeChartWidget.value()!==this;this._chartWidgetCollection.activeChartWidget.setValue(this),e&&(Z()&&this._isLineToolModeExceptBrush()&&this.updateCrossHairPositionIfNeeded(),this._justActivated=!0)}_endRequestActive(){var e=this;this._justActivated&&setTimeout((function(){e._justActivated=!1}),0)}_requestActive(){this._beginRequestActive(),this._endRequestActive()}justActivated(){return this._justActivated}_onMousewheel(e){if(this.model().model().zoomEnabled()&&(TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty()){var t=this._mouseWheelHelper.processWheel(e),i=t.deltaX/100,s=-t.deltaY/100;if(0!==i&&this._options.handleScroll.mouseWheel||0!==s&&this._options.handleScale.mouseWheel){switch(e.cancelable&&e.preventDefault(),e.deltaMode){case e.DOM_DELTA_PAGE:i*=120,s*=120;break;case e.DOM_DELTA_LINE:i*=32,s*=32}if(0!==s&&this._options.handleScale.mouseWheel){var r=Math.sign(s)*Math.min(1,Math.abs(s)),n=this._mainDiv.getBoundingClientRect(),o=e.clientX-this._lhsAxesWidth-n.left;if(!Number.isFinite(o)||!Number.isFinite(r))return void Q.logWarn("Incorrect mouse wheel processing: scrollPosition: "+o+", zoomScale: "+r);var a=new re(e).control();this.model().model().zoomTime(o,r,!!a||void 0),this._onZoom.fire(a)}0!==i&&this._options.handleScroll.mouseWheel&&this.model().scrollChart(-80*i)}}}setTimezone(e){e&&G(e)?this._properties.timezone.setValue(e):console.warn("Incorrect timezone: "+JSON.stringify(e))}getTimezone(){return this._properties.timezone.value()}refreshMarks(){this.model().barsMarksSources().forEach((function(e){e.refreshData()}))}clearMarks(){this.model().barsMarksSources().forEach((function(e){e.clearMarks()}))}metaInfoRepository(){return this._metaInfoRepository}_init(){var e=this;this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui();var t=function(){e._checkObsoleteTimezone(),e._chartSession&&e._chartSession.connected()&&this._model.restart(),
|
||
this._content&&(this.initColors(),this._updateGui(),this.update()),this._resizeHandler=function(){this.adjustSize(),this.paint()}.bind(this),this._resizeHandler(),this._parent.appendChild(this._mainDiv),this._spinner&&(this._spinner.stop(),delete this._spinner),this._keydownEventListener=function(e){27===e.which&&e.preventDefault()},window.addEventListener("keydown:chart_"+this._id,this._keydownEventListener),this._initBarsMarksSources(),this._activateSymbolSearchHotkeys(),this.model().timeScale().onScroll().subscribe(this,(function(){this._onScroll.fire()})),this._inited=!0}.bind(this),i=this._makeDefaultModel();void 0===i?t():i.then(t)}_activateSymbolSearchHotkeys(){this.readOnly()||this._hideSymbolSearch||W()}_checkObsoleteTimezone(){var e=this._properties.timezone.value();G(e)||this._properties.timezone.setValue({UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[e]||"exchange")}_initBarsMarksSources(){var e=this;this.withModel(this,(function(){this.model().barsMarksSources().forEach((function(t){t.onNeedRepaint.subscribe(e,(function(){e.model().model().lightUpdate()}))}))}))}initColors(){this._properties.scalesProperties.lineColor.listeners().subscribe(this,_e.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,_e.prototype.setScaleTextColor)}_initBackgroundColor(){null===this._backgroundTopColorSpawn&&(this._backgroundTopColorSpawn=this._model.model().backgroundTopColor().spawn(),this._backgroundTopColorSpawn.subscribe(this._onBackgroundColorChanged.bind(this))),null===this._backgroundBottomColorSpawn&&(this._backgroundBottomColorSpawn=this._model.model().backgroundColor().spawn(),this._backgroundBottomColorSpawn.subscribe(this._onBackgroundColorChanged.bind(this)))}paneWidgets(){return this._paneWidgets}paneByCanvas(e){for(var t=0;t<this._paneWidgets.length;t++)if(this._paneWidgets[t].hasCanvas(e))return this._paneWidgets[t];return null}paneByState(e){for(var t=0;t<this._paneWidgets.length;t++)if(this._paneWidgets[t].state()===e)return this._paneWidgets[t];return null}timeAxisByCanvas(e){return this._timeAxisWidget.hasCanvas(e)?this._timeAxisWidget:null}properties(){return this._properties}emulateCriticalError(){this._chartSession.removeSeries("-1",null)}readOnly(){return this._readOnly}onDisconnected(){return this._disconnected}onReconnectBailout(){return this._reconnectBailout}onConnected(){return this._connected}onRedraw(){return this._redraw}onScroll(){return this._onScroll}modelCreated(){return this._modelCreated}setResolution(e){if(this._model){var t=this._model.mainSeries().properties(),i=window.t("Change Resolution");this._model.setResolutionProperty(t.interval,e,this,i)}else this._properties.mainSeriesProperties.merge({interval:e})}getResolution(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()}addOverlayStudy(e,t,i){var s=this.model();return this._options.isSymbolAvailable(e).then((function(r){if(!r)return null
|
||
;var n=s.createStudyInserter({type:"java",studyId:"Overlay@tv-basicstudies"}),o={allowExtendTimeScale:i};if(l.enabled("use_overrides_for_overlay")){var a=$.factoryDefaults("study_Overlay@tv-basicstudies.style");o.style=a}return n.setPropertiesState(o),n.setForceOverlay(t),n.insert((function(){return Promise.resolve({symbol:e})}))}))}addCompareStudy(e){var t=this.model();return this._options.isSymbolAvailable(e).then((function(i){return i?t.createStudyInserter({type:"java",studyId:"Compare@tv-basicstudies"}).insert((function(){return Promise.resolve({symbol:e})})):null}))}updateActions(){for(var e=this.actions(),t=this._model.dataSources(),i=!1,s=!1,r=0,n=t.length;r<n;r++){var o=t[r];TradingView.isInherited(o.constructor,C)&&o.isUserDeletable()&&(i=!0),TradingView.isInherited(o.constructor,S)&&o.removeByRemoveAllStudies()&&(s=!0),TradingView.isInherited(o.constructor,y)&&(s=!0)}this._readOnly||(e.paneRemoveAllStudies&&e.paneRemoveAllStudies.update({disabled:!s}),e.paneRemoveAllDrawingTools&&e.paneRemoveAllDrawingTools.update({disabled:!i}),e.paneRemoveAllStudiesDrawingTools&&e.paneRemoveAllStudiesDrawingTools.update({disabled:!s&&!i}));var a=this,l=[],c=function(e){return e.id===a.model().model().properties().timezone.value()};U.forEach((function(e){if(!e.separator){var t=new I({label:e.title,checkable:!0,checked:c(e),statName:"SetTimeZone",onExecute:function(){a.model().setProperty(a.model().model().properties().timezone,e.id,"Changed Time Zone")}});l.push(t)}}),this),e.applyTimeZone.update({subItems:l}),e.addToWatchlist&&e.addToWatchlist.update({label:window.t("Add to Watchlist {0}").format(this.getSymbol(!0))}),e.addToTextNotes&&e.addToTextNotes.update({label:window.t("Add Text Note for {0}").format(this.getSymbol(!0))})}applyTheme(e){var t=this;Promise.resolve().then(i.bind(null,"EsvI")).then(i=>{e=e||i.getCurrentTheme().name,i.loadTheme(e,!0,!0,t._chartWidgetCollection)})}actions(){return null===this._actions&&this._setActions(),this._actions}_setActions(){var e,t=this,s=[];if(!this._readOnly){s=[new I({label:window.t("Eraser"),payload:"eraser",statName:"Eraser"}),new L,new I({label:window.t("Trend Line"),payload:"LineToolTrendLine",statName:"LineToolTrendLine"}),new I({label:window.t("Horizontal Line"),payload:"LineToolHorzLine",statName:"LineToolHorzLine"}),new I({label:window.t("Vertical Line"),payload:"LineToolVertLine",statName:"LineToolVertLine"}),new I({label:window.t("Arrow"),payload:"LineToolArrow",statName:"LineToolArrow"}),new I({label:window.t("Ray"),payload:"LineToolRay",statName:"LineToolRay"}),new I({label:window.t("Extended"),payload:"LineToolExtended",statName:"LineToolExtended"}),new I({label:window.t("Parallel Channel"),payload:"LineToolParallelChannel",statName:"LineToolParallelChannel"}),new L,new I({label:window.t("Pitchfork"),payload:"LineToolPitchfork",statName:"LineToolPitchfork"}),new I({label:window.t("Schiff Pitchfork"),payload:"LineToolSchiffPitchfork",statName:"LineToolSchiffPitchfork"}),new I({label:window.t("Pitchfan"),payload:"LineToolPitchfan",statName:"LineToolPitchfan"
|
||
}),new I({label:window.t("Gann Square"),payload:"LineToolGannSquare",statName:"LineToolGannSquare"}),new I({label:window.t("Gann Fan"),payload:"LineToolGannFan",statName:"LineToolGannFan"}),new I({label:window.t("Fib Retracement"),payload:"LineToolFibRetracement",statName:"LineToolFibRetracement"}),new I({label:window.t("Trend-Based Fib Extension"),payload:"LineToolTrendBasedFibExtension",statName:"LineToolTrendBasedFibExtension"}),new I({label:window.t("Fib Speed Resistance Fan"),payload:"LineToolFibSpeedResistanceFan",statName:"LineToolFibSpeedResistanceFan"}),new I({label:window.t("Fib Time Zone"),payload:"LineToolFibTimeZone",statName:"LineToolFibTimeZone"}),new I({label:window.t("Circle Lines"),payload:"LineToolCircleLines",statName:"LineToolCircleLines"}),new I({label:window.t("Fib Circles"),payload:"LineToolFibCircles",statName:"LineToolFibCircles"}),new I({label:window.t("Fib Speed Resistance Arcs"),payload:"LineToolFibSpeedResistanceArcs",statName:"LineToolFibSpeedResistanceArcs"}),new L,new I({label:window.t("Rectangle"),payload:"LineToolRectangle",statName:"LineToolRectangle"}),new I({label:window.t("Ellipse"),payload:"LineToolEllipse",statName:"LineToolEllipse"}),new I({label:window.t("Triangle"),payload:"LineToolTriangle",statName:"LineToolTriangle"}),new I({label:window.t("Polyline"),payload:"LineToolPolyline",statName:"LineToolPolyline"}),new I({label:window.t("Path"),payload:"LineToolPath",statName:"LineToolPath"}),new I({label:window.t("Arc"),payload:"LineToolArc",statName:"LineToolArc"}),new L,new I({label:window.t("Text",{context:"tool"}),payload:"LineToolText",statName:"LineToolText"}),new I({label:window.t("Anchored Text"),payload:"LineToolTextAbsolute",statName:"LineToolTextAbsolute"}),new I({label:window.t("Balloon"),payload:"LineToolBalloon",statName:"LineToolBalloon"}),new I({label:window.t("Price Label"),payload:"LineToolPriceLabel",statName:"LineToolPriceLabel"}),new L,new I({label:window.t("Elliott Wave Subminuette"),payload:"LineToolElliottSubminuette",statName:"LineToolElliottSubminuette"}),new I({label:window.t("Elliott Wave Minor"),payload:"LineToolElliottMinor",statName:"LineToolElliottMinor"}),new I({label:window.t("Elliott Wave Circle"),payload:"LineToolElliottCircle",statName:"LineToolElliottCircle"}),new I({label:window.t("Elliott Minor Retracement"),payload:"LineToolElliottMinorRetr",statName:"LineToolElliottMinorRetr"}),new I({label:window.t("Elliott Major Retracement"),payload:"LineToolElliottMajorRetr",statName:"LineToolElliottMajorRetr"}),new L,new I({label:window.t("Brush"),payload:"LineToolBrush",statName:"LineToolBrush"}),new L,new I({label:window.t("Forecast"),payload:"LineToolPrediction",statName:"LineToolPrediction"})];for(var r=function(e){O.tool.setValue(e.getPayload())},n=0;n<s.length;n++)s[n]instanceof I&&s[n].update({onExecute:r});e=new I({label:ee(window.t("Settings")),icon:i("MXV9"),statName:"ScalesProperties",onExecute:function(){t.showGeneralChartProperties(_.scales)}})}this._hotkeys.add({desc:"Maximize",hotkey:g.Modifiers.Alt+13,handler:function(){
|
||
t.toggleFullscreen()},isDisabled:function(){return!t._options.fullscreenable.value()}}),this._hotkeys.add({desc:"Cancel selection",hotkey:27,handler:function(){t._model.selectionMacro((function(e){t._cancelCreatingLine(),e.clearSelection()}))},isDisabled:function(){var e=0===t._model.selection().allSources().length,i=null===t._model.crossHairSource().measurePane(),s=e&&i;return!t._model||s}}),t.withModel(null,(function(){var e=function(){t._hotkeys.promote()};t._model.onSelectedSourceChanged().subscribe(null,e),t._model.crossHairSource().measuringStarted().subscribe(null,e)}));var o=new I({label:window.t("Reset Chart"),icon:i("LdoW"),statName:"ResetChart",onExecute:this.GUIResetScales.bind(this),hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+82}),a=new I({label:window.t("Invert Scale"),statName:"Invert Scale",checkable:!0,onExecute:function(){t._model.invertPriceScale(t._model.mainSeries().priceScale())},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+73}),h=new I({label:window.t("Auto (Fits Data To Screen)"),checkable:!0,onExecute:function(){var e=t._model.mainSeries().priceScale();t._model.togglePriceScaleAutoScaleMode(e),h.update({checked:e.isAutoScale()})}}),u=new I({label:window.t("Lock Price To Bar Ratio"),checkable:!0,statName:"ToggleLockScale",onExecute:function(){t._model.togglePriceScaleLockScaleMode(t._model.mainSeries().priceScale())}}),v=new I({label:window.t("Regular"),checkable:!0,statName:"ToggleRegularScale",onExecute:function(){var e=t._model.mainSeries().priceScale();t._model.setPriceScaleRegularScaleMode(e),v.update({checked:e.isRegular()})}}),b=new I({label:window.t("Percent"),checkable:!0,statName:"TogglePercantage",onExecute:function(){t._model.togglePriceScalePercentageScaleMode(t._model.mainSeries().priceScale())},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+80}),S=new I({label:window.t("Indexed to 100"),checkable:!0,statName:"ToggleIndexedTo100",onExecute:function(){t._model.togglePriceScaleIndexedTo100ScaleMode(t._model.mainSeries().priceScale())}}),y=new I({label:window.t("Logarithmic"),statName:"ToggleLogScale",checkable:!0,onExecute:function(){t._model.togglePriceScaleLogScaleMode(t._model.mainSeries().priceScale())},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+76}),w=new I({label:window.t("Undo"),onExecute:function(){J("GUI","Undo"),t._model.undoHistory().undo()},disabled:!0,hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Mod+90}),C=new I({label:window.t("Redo"),onExecute:function(){J("GUI","Redo"),t._model.undoHistory().redo()},disabled:!0,hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Mod+89});t.withModel(null,(function(){t._model.undoHistory().undoStack().onChange().subscribe(t,t.updateUndoRedo),t._model.undoHistory().redoStack().onChange().subscribe(t,t.updateUndoRedo)}));var P=[new I({label:window.t("Loading")})],x=new I({name:"apply-color-theme",label:window.t("Color Theme"),icon:i("opke"),subItems:P,statName:"ColorTheme"}),T=new I({label:window.t("Time Zone"),statName:"TimeZone"}),M=function(e,t){N.symbol.setValue(e),t&&(E(t),N.interval.setValue(t))
|
||
},A=new I({label:ee(window.t("Change Symbol")),statName:"ChangeSymbol",onExecute:function(){F({callback:M,ownerDocument:t._parent.ownerDocument})}});p("symboledit.dialog_last_entry","");var k={label:ee(window.t("Change Interval")),statName:"ChangeInterval",onExecute:function(){j({callback:function(e){t._chartWidgetCollection.setResolution(e)},ownerDocument:t._parent.ownerDocument})}};var D,R,W=new I(k);TradingView.onWidget()||(this._options.addToWatchlistEnabled&&(D=new I({label:window.t("Add To Watchlist"),icon:i("a9Kt"),statName:"AddToWatchlist",onExecute:function(){window.runOrSignIn(()=>{if(window.widgetbar){for(var e,i=window.widgetbar.setPage("base"),s=0;s<i.widgets.length;s++)if("watchlist"===i.widgets[s].type){e=i.widgets[s].widgetObject;break}if(!e)return;e.addSymbols([t.getSymbol()])}},{source:"add symbol to watchlist"})},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+87})),R=new I({label:window.t("Add To Text Notes"),statName:"AddToTextNotes",onExecute:function(){runOrSignIn((function(){TradingView.bottomWidgetBar&&(TradingView.bottomWidgetBar.toggleWidget("text_notes",!0),TradingView.bottomWidgetBar._widgets.text_notes.addNote(null,t.getSymbol(!0),t.getSymbol()))}),{source:"Add text note in chart context menu"})},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+78}));var H=new I({label:window.t("Reset Time Scale"),icon:i("LdoW"),statName:"ResetScale",onExecute:function(){t.model().resetTimeScale()},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Mod+g.Modifiers.Alt+81}),z=new I({label:window.t("Insert Drawing Tool"),subItems:s,statName:"InsertDravingTool"}),U=new I({label:window.t("Remove Indicators"),statName:"RemoveAllIndicators",onExecute:this.removeAllStudies.bind(this)}),G=new I({label:window.t("Remove Drawings"),statName:"RemoveAllDrawingTools",onExecute:this.removeAllDrawingTools.bind(this)}),q=new I({label:window.t("All Indicators And Drawing Tools"),statName:"RemoveAllIndicatorsAndDrawingTools",onExecute:this.removeAllStudiesDrawingTools.bind(this)}),Y=this.chartWidgetCollection(),K=new I({label:window.t("Apply these Indicators to Entire Layout"),statName:"ApplyIndicatorsToAllCharts",onExecute:function(){Y.applyIndicatorsToAllCharts(t)}}),Z=new I({label:ee(window.t("Insert Indicator")),statName:"InsertIndicator",onExecute:function(){t.showIndicators()},hotkeyGroup:this._hotkeys,hotkeyHash:191});new I({label:ee(window.t("Insert Indicator")),statName:"InsertIndicator",onExecute:function(){t.showIndicators()},hotkeyGroup:this._hotkeys,hotkeyHash:111});var X,$=new I({label:ee(window.t("Compare or Add Symbol")),statName:"CompareOrAddSymbol",onExecute:this.toggleCompareOrAdd.bind(this)}),Q=new I({label:ee(window.t("Compare")),statName:"Compare",onExecute:this.toggleCompareOrAdd.bind(this)}),te=new I({label:ee(window.t("Object Tree")),statName:"ObjectsTree",onExecute:this.showObjectsTreePanelOrDialog.bind(this)}),ie=new I({label:ee(window.t("Settings")),icon:i("MXV9"),statName:"ChartProperties",onExecute:function(){t.showGeneralChartProperties()}}),se=new I({label:ee(window.t("Settings")),
|
||
icon:i("MXV9"),statName:"MainSeriesProperties",onExecute:function(){t.showGeneralChartProperties(_.symbol)}}),re=new I({label:window.t("Lock/Unlock"),statName:"ToggleLockSelectedObject",onExecute:this.toggleLockSelectedObject.bind(this)}),ne=new I({label:window.t("Hide"),icon:i("dmHa"),statName:"HideSelectedObject",onExecute:this.hideSelectedObject.bind(this)});l.enabled("property_pages")&&(X=new I({label:ee(window.t("Settings")),icon:i("MXV9"),statName:"EditSelectedObject",onExecute:function(){t.showSelectedSourceProperties()}})),this.withModel(null,(function(){var e=t.model().mainSeries(),i=e.properties();i.priceAxisProperties.subscribe(t,t._updateScalesActions),e.priceScaleAboutToBeChanged().subscribe(t,(function(){i.priceAxisProperties.unsubscribeAll(t)})),e.priceScaleChanged().subscribe(t,(function(){i.priceAxisProperties.subscribe(t,t._updateScalesActions),t._updateScalesActions()}))}));var oe=new I({label:window.t("Scale Price Chart Only"),checkable:!0,statName:"ScalePriceChartOnly"});oe.binder=new c(oe,this._properties.scalesProperties.scaleSeriesOnly,this.model(),window.t("Scale Price Chart Only"));var ae=this.model().model();this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,(function(){ae.recalculateAllPanes(),ae.invalidate(B.full())}));var le=new I({label:window.t("Drawings Toolbar"),checkable:!0,statName:"ToggleDrawingToolbar"}),_e=this._options.isDrawingToolbarVisible;_e&&(_e.subscribe((function(e){le.update({checked:e})}),{callWithLast:!0}),le.update({onExecute:function(){_e.setValue(!_e.value())}}));var me=new I({label:window.t("Stay in Drawing Mode"),checkable:!0,statName:"ToggleStayInDrawingMode"});me.binder=new c(me,O.properties().stayInDrawingMode,this.model(),window.t("Stay In Drawing Mode"));var fe=new I({label:window.t("Sync drawings to all charts"),checkable:!0,statName:"ToggleSyncDrawings"});fe.binder=new c(fe,O.properties().drawOnAllCharts,this.model(),"SyncDrawings");var ge=new I({label:window.t("Lock All Drawing Tools"),checkable:!0,statName:"ToggleLockDrawings"});ge.binder=new c(ge,O.lockDrawings(),this.model(),window.t("Lock drawings"),(function(){O.lockDrawings().setValue(this.value())}));var ve=new I({label:window.t("Hide All Drawing Tools"),checkable:!0,statName:"ToggleHideAllDrawingTools",hotkeyHash:g.Modifiers.Mod+g.Modifiers.Alt+72,hotkeyGroup:this._hotkeys});ve.binder=new c(ve,O.hideAllDrawings(),this.model(),window.t("Hide All Drawing Tools"),(function(){var e=d("ChartToolsHideMode","drawings"),t=O.hideAllDrawings(),i=O.hideAllIndicators();switch(e){case"drawings":t.setValue(!t.value());break;case"indicators":i.setValue(!i.value());break;default:t.setValue(!t.value()),i.setValue(!i.value())}}));var be=new I({label:window.t("Hide Marks On Bars"),checkable:!0,statName:"ToggleHideMarksOnBars"});be.binder=new c(be,O.hideMarksOnBars(),this.model(),window.t("Hide Marks On Bars"),(function(){O.hideMarksOnBars().setValue(this.value())}));var Se=new I({label:window.t("Extended Trading Hours"),checkable:!0,statName:"ToggleExtendedHours"})
|
||
;Se.binder=new c(Se,this.model().mainSeries().properties().extendedHours,this.model(),window.t("Change Extended Hours"));var ye=new I({label:window.t("Symbol Last Price Label"),checkable:!0,checked:!1,statName:"ToggleSymbolLastValue"});ye.binder=new c(ye,this.properties().scalesProperties.showSeriesLastValue,this.model(),window.t("Show Symbol Last Value"));var we=new I({label:window.t("Symbol Name Label"),checkable:!0,checked:!1,statName:"ToggleSymbolLabels"});we.binding=new c(we,this.properties().scalesProperties.showSymbolLabels,this.model(),"Undo Show Symbol Labels");var Ce=new I({label:window.t("Indicator Last Value Label"),checkable:!0,checked:!1,statName:"ToggleStudyLastValue"});Ce.binder=new c(Ce,this.properties().scalesProperties.showStudyLastValue,this.model(),window.t("Show Indicator Last Value"));var Pe=new I({label:window.t("Indicator Name Label"),checkable:!0,checked:!1,statName:"ToggleIndicatorsLabels"});Pe.binding=new c(Pe,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels");var xe=this.model().mainSeries().properties().highLowAvgPrice,Te=new I({label:window.t("High and low price labels"),checkable:!0,checked:!1,statName:"ToggleHighLowPriceLabels"});Te.binding=new c(Te,xe.highLowPriceLabelsVisible,this.model(),window.t("Show high and low price labels"));var Me=new I({label:window.t("High and low price lines"),checkable:!0,checked:!1,statName:"ToggleHighLowPriceLine"});Me.binding=new c(Me,xe.highLowPriceLinesVisible,this.model(),window.t("Show high and low price lines"));var Ie=new I({label:window.t("Average close price label"),checkable:!0,checked:!1,statName:"ToggleAverageClosePriceLabel"});Ie.binding=new c(Ie,xe.averageClosePriceLabelVisible,this.model(),window.t("Show average close price label"));var Le=new I({label:window.t("Average close price line"),checkable:!0,checked:!1,statName:"ToggleAverageClosePriceLine"});Le.binding=new c(Le,xe.averageClosePriceLineVisible,this.model(),window.t("Show average close price line"));var Oe=new I({label:window.t("Financials Last Value Label"),checkable:!0,checked:!1,statName:"ToggleFundamentalsLastValue"});Oe.binder=new c(Oe,this.properties().scalesProperties.showFundamentalLastValue,this.model(),"Show Financials Last Value");var Ae=new I({label:window.t("Financials Name Label"),checkable:!0,checked:!1,statName:"ToggleFundamentalsLabels"});Ae.binding=new c(Ae,this.properties().scalesProperties.showFundamentalNameLabel,this.model(),"Show Financials Name Label");var Ee=new I({label:window.t("Countdown To Bar Close"),checkable:!0,checked:!1,statName:"ToggleCountdown"});Ee.binder=new c(Ee,this.model().mainSeries().properties().showCountdown,this.model(),Ee.getLabel());var ke=new I({label:window.t("Currency"),checkable:!0,checked:!0,statName:"ToggleScalesCurrency"});ke.binder=new c(ke,this.properties().scalesProperties.showCurrency,this.model(),"Change Currency Label Visibility");var De=new I({label:window.t("Unit"),checkable:!0,checked:!0,statName:"ToggleScalesUnit"})
|
||
;De.binder=new c(De,this.properties().scalesProperties.showUnit,this.model(),"Change Unit Label Visibility");var Ve=new I({label:window.t("Plus Button"),checkable:!0,checked:ce.value(),statName:"ToggleAddOrderPlusButton"});Ve.binder=new c(Ve,ce,this.model(),Ve.getLabel());var Be=null;this._options.goToDateEnabled&&(Be=new I({label:ee(window.t("Go to Date")),statName:"GoToDate",onExecute:function(){var e=t._chartWidgetCollection.activeChartWidget.value();m(e)},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+71}));var Re=new I({label:ee(window.t("Symbol Info")),icon:i("1pHB"),checkable:!1,statName:"SymbolInfo",onExecute:function(){var e=t.model().mainSeries().symbol(),i=t.model().mainSeries().symbolInfo(),s=t.model().model().availableUnits(),r=t.model().model().unitConversionEnabled();V(e,{symbolInfo:i,showUnit:r,unitName:function(e){return s.name(e)}})}}),Ne=new I({label:he,statName:"MergeAllScalesToLeft",onExecute:function(){t.model().mergeAllScales("left")}}),je=new I({label:ue,statName:"MergeAllScalesToRight",onExecute:function(){t.model().mergeAllScales("right")}}),Fe=new I({label:de,statName:"MoveScaleToLeft",onExecute:function(){t.model().mergeAllScales("left")}}),We=new I({label:pe,statName:"MoveScaleToRight",onExecute:function(){t.model().mergeAllScales("right")}});var He=l.enabled("show_object_tree");if(this._actions={chartProperties:ie,mainSeriesPropertiesAction:se,timeScaleReset:H,chartReset:o,invertSeriesScale:a,logSeriesScale:y,autoSeriesScale:h,lockSeriesScale:u,regularSeriesScale:v,percentSeriesScale:b,indexedTo100SeriesScale:S,compareOrAdd:$,compare:Q,paneObjectTree:He?te:void 0,insertIndicator:Z,insertDrawingTool:z,applyColorTheme:x,symbolSearch:A,showSymbolInfoDialog:Re,changeInterval:W,seriesHide:ne,studyHide:ne,lineToggleLock:re,lineHide:ne,scaleSeriesOnly:oe,drawingToolbarAction:le,stayInDrawingModeAction:me,syncModeAction:fe,lockDrawingsAction:ge,hideAllDrawingsAction:ve,hideAllMarks:be,applyTimeZone:T,extendedHours:Se,showCountdown:Ee,showCurrency:ke,showUnit:De,addPlusButton:Ve,showSeriesLastValue:ye,showHighLowPriceLabels:Te,showHighLowPriceLines:Me,showAverageClosePriceLabel:Ie,showAverageClosePriceLine:Le,showSymbolLabelsAction:we,showStudyLastValue:Ce,showStudyPlotNamesAction:Pe,showFundamentalsLastValueAction:Oe,showFundamentalNamesAction:Ae,undo:w,redo:C,mergeLeftScalesAction:Ne,mergeRightScalesAction:je,moveScaleToLeft:Fe,moveScaleToRight:We,moveChartAction:void 0},e&&(this._actions.scalesProperties=e),D&&(this._actions.addToWatchlist=D),l.enabled("show_source_code")&&(this._actions.viewSourceCode=new I({label:ee(window.t("Source Code")),statName:"OpenSelectedObjectSource",onExecute:this.openSelectedObjectSource.bind(this)})),!TradingView.onWidget()&&l.enabled("text_notes")&&(this._actions.addToTextNotes=R),null!==Be&&(this._actions.gotoDate=Be),this.createSessionBreaksActions(),!this.readOnly()){var ze=new I({label:window.t("Remove"),icon:i("aVjL"),statName:"RemoveSelectedObject",onExecute:function(){var e=this._chartWidgetCollection.activeChartWidget.value();e||(e=this),
|
||
e.removeSelectedSources()}.bind(this),hotkeyGroup:this._hotkeys,hotkeyHash:f.isMacKeyboard?8:46});this._hotkeys.add({handler:function(){this.removeSelectedSources()}.bind(this),desc:"Remove selected source",hotkey:f.isMacKeyboard?46:8}),this._actions.insertDrawingTool=z,this._actions.paneRemoveAllStudies=U,this._actions.paneRemoveAllDrawingTools=G,this._actions.paneRemoveAllStudiesDrawingTools=q,this._actions.applyStudiesToAllCharts=K,this._actions.seriesRemove=ze,this._actions.studyRemove=ze,this._actions.lineRemove=ze,l.enabled("property_pages")&&(this._actions.format=X),this._actions.lockDrawingsAction=ge,this._actions.hideAllDrawingsAction=ve,this._actions.hideAllMarks=be}this._actions.showPriceLine=new I({label:window.t("Price Line"),checkable:!0,statName:"TogglePriceLine"}),this._actions.showPriceLine.binding=new c(this._actions.showPriceLine,this.model().mainSeries().properties().showPriceLine,this.model(),"Undo Toggle Price Line"),this.readOnly()||(this._actions.horzLineRightThere=new I({label:window.t("Draw Horizontal Line Here"),onExecute:function(){t.activePaneWidget&&t.activePaneWidget.drawRightThere("LineToolHorzLine")},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+72}),this._actions.vertLineRightThere=new I({label:window.t("Draw Vertical Line Here"),onExecute:function(){t.activePaneWidget&&t.activePaneWidget.drawRightThere("LineToolVertLine")},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+86}),this._actions.crossLineRightThere=new I({label:window.t("Draw Cross Line Here"),onExecute:function(){t.activePaneWidget&&t.activePaneWidget.drawRightThere("LineToolCrossLine")},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+67}),this._actions.trendLine=new I({label:window.t("Draw Trend Line"),onExecute:function(){t.activePaneWidget&&O.tool.setValue("LineToolTrendLine")},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+84}),this._actions.FibRetracement=new I({label:window.t("Draw Fib Retracement"),onExecute:function(){t.activePaneWidget&&O.tool.setValue("LineToolFibRetracement")},hotkeyGroup:this._hotkeys,hotkeyHash:g.Modifiers.Alt+70})),this._updateScalesActions()}executeActionById(e){if("takeScreenshot"===e)return console.warn('Action "takeScreenshot" is deprecated. Use method "takeScreenshot" instead'),void this._chartWidgetCollection.takeScreenshot();"lockDrawingsAction"===e&&console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),"hideAllDrawingsAction"===e&&console.warn('Action "hideAllDrawingsAction" is deprecated. Use method "hideAllDrawingTools" instead'),e in this._actions?this._actions[e]instanceof I&&this._actions[e].execute():console.warn("Unknown action id: "+e)}getCheckableActionState(e){if("lockDrawingsAction"===e)return console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),null;if("hideAllDrawingsAction"===e)return console.warn('Action "hideAllDrawingsAction" is deprecated. Use method "hideAllDrawingTools" instead'),null;if(e in this._actions){var t=this._actions[e]
|
||
;if(t instanceof I&&t.isCheckable())return t.isChecked();console.warn("Action "+e+" has no state")}else console.warn("Unknown action id: "+e);return null}_updateScalesActions(){if(null!==this._actions){var e=this.model().mainSeries(),t=e.priceScale(),i=e.properties(),s=t.isLockScale(),r=i.style.value()===a.STYLE_PNF;this._actions.percentSeriesScale.update({disabled:s||r,checked:t.isPercentage()}),this._actions.logSeriesScale.update({disabled:s||r,checked:t.isLog()}),this._actions.regularSeriesScale.update({disabled:s||r,checked:t.isRegular()}),this._actions.indexedTo100SeriesScale.update({disabled:s||r,checked:t.isIndexedTo100()}),this._actions.invertSeriesScale.update({checked:t.isInverted()}),this._actions.lockSeriesScale.update({checked:t.isLockScale()}),this._actions.autoSeriesScale.update({checked:t.isAutoScale(),disabled:t.properties().autoScaleDisabled.value()})}}removeAllStudies(){this._model.removeAllStudies()}removeAllDrawingTools(){this._model.removeAllDrawingTools()}removeAllStudiesDrawingTools(){this._model.removeAllStudiesAndDrawingTools()}model(){return this._model}defaultSymbol(){return this._defSymbol}connect(){this._handler=function(e){this._onData(e)}.bind(this),this._boundOnChartSessionIsConnectedChanged=this._onChartSessionIsConnectedChanged.bind(this),this._chartSession.isConnected().subscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.criticalError().subscribe(this,this._onChartSessionCriticalError),this._chartSession.connect(this._handler)}finishInitWithoutConnect(){this._chartSession.disable(),this._init(),this.chartWidgetInitialized.fire()}reconnect(){this._chartSession.disconnect(),this._chartSession.connect()}update(){if(this._model){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].update();this._timeAxisWidget&&this._timeAxisWidget.update()}}_makeDefaultGui(){this._makeLoadingScreen(),this._model&&(this._makeTimeAxisWidget(),this._makePaneWidgetsAndSeparators()),this.adjustSize(),this._updateScalesActions(),b(this._elMainTable),this.update(),this.paint()}widget(){return this._mainDiv}_onBackgroundColorChanged(){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].setCursorForTool();this.update(),this.model().model().fullUpdate()}setScaleLineColor(e){this.scaleLineColor=e.value(),this._paneSeparators.forEach((function(e){e.update()})),this.update(),this.paint()}setScaleTextColor(e){this.scaleTextColor=e.value(),this.update(),this.paint()}setTimingsMeter(e){this._timingsMeter=e,this._updateTimingsMeterState()}_updateTimingsMeterState(){var e=this._options.visible.value();null!==this._timingsMeter&&(e?this._timingsMeter.startCollect():this._timingsMeter.stopCollect())}_update(e){var t=e?e.fullInvalidation():R.Full,i=!!e&&e.isVisibleTimeRangeLockedOnResize();if(null!==this._timingsMeter&&this._timingsMeter.startDraw(t),t===R.Full&&(this._model?this._updateGui(i):this.adjustSize(i)),e.invalidateForTimeScale()>R.Cursor&&this._timeAxisWidget.update(),this.paint(e),this._dataWindowWidget){var s=e.maxPaneInvalidation()
|
||
;s===R.Full?this._dataWindowWidget.fullUpdate():s>R.None&&this._dataWindowWidget.update()}for(var r=0;r<this._paneWidgets.length;r++)this._paneWidgets[r].updateStatusWidget(e.invalidateForPane(r).fullInvalidation());null!==this._timingsMeter&&this._timingsMeter.stopDraw(),e&&e.panesOrderInvalidated()&&ne.emit("panes_order_changed")}_createVolumeIfNeeded(){var e=l.enabled("create_volume_indicator_by_default")&&this._options.addVolume,t=!this._content,i=l.enabled("charting_library_base"),s=l.enabled("create_volume_indicator_by_default_once"),r=this._content&&!this._content.loading;e&&(t||i&&r&&!s)&&this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,(function(){var e=this;setTimeout((function(){var t=e._model.model().mainSeries().symbolInfo();if(t){var i=!t.has_no_volume;if(!e.containsVolume()&&i){var s=$.factoryDefaults("chartproperties.volumePaneSize"),r=e._model.model().createStudyInserter({type:"java",studyId:"Volume@tv-basicstudies"});r.setForceOverlay(l.enabled("volume_force_overlay")),r.setPaneSize(s),l.enabled("hide_volume_ma")&&r.setPropertiesState({styles:{vol_ma:{visible:!1}}}),r.insert()}else if(!i&&e.containsVolume()){var n=e.model().dataSources().filter((function(e){return e instanceof S&&"Volume"===e.metaInfo().shortId}))[0];e._model.model().removeSource(n)}}}),0)}),s)}_createSessions(e){var t=this.showGeneralChartProperties.bind(this,_.timezoneSessions);e.createSessions(t)}_createPrePostMarket(e){}_createChartEventsSource(){throw new Error("Not implemented")}_onChartStyleChanged(){J("Chart","Chart Style "+this._model.mainSeries().getStyleShortName().toUpperCase())}_updateGui(e){this._model&&(this._makeTimeAxisWidget(),this._makePaneWidgetsAndSeparators(),this._elMainTable.style.userSelect="none",this.adjustSize(e))}setVisibleTimeRange(e,t,i,s){this._chartSession.setVisibleTimeRange(this._model.mainSeries().seriesSource().instanceId(),e,t,i||{},s)}_makeLoadingScreen(){if(l.enabled("lean_chart_load")){if(this.screen)return;this.screen=new X(this,this._parent)}else this.screen=new X(this,this._mainDiv)}_makeAvailableOnTVPopup(){throw new Error("Not implemented")}_setSymbol(e,t){if(this._model){var i=this._model.mainSeries();if(!t&&i.symbolSameAsCurrent(e))return;this._model.selectionMacro((function(e){e.clearSelection()})),this._model.setSymbol(this._model.mainSeries(),e)}else this._properties.mainSeriesProperties.merge({symbol:e})}setSymbol(e,t){return this._setSymbol.apply(this,arguments)}loadRange(e){this._model&&(this.screen.show(),this._model.loadRange(e))}getSymbol(e){var t;return(t=this._model?this._model.mainSeries().properties():this._properties.mainSeriesProperties)?e&&t.shortName&&t.shortName.value()?t.shortName.value():t.symbol.value():""}toggleMaximizePane(e){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,this._paneSeparators.forEach((function(e){e.show()}))):(this._maximizedPaneWidget=e,this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach((function(e){
|
||
e.hide()})));for(var t=this._paneWidgets.length;t--;)this._paneWidgets[t].updateControls(),this._paneWidgets[t].updatePriceAxisWidgets();this._timeAxisWidget.updatePriceAxisStubs(),this.adjustSize(),this.updateCrossHairPositionIfNeeded()}}_titlesProvider(e,t){var i=this.model(),s=this._maximizedPaneWidget?this._maximizedPaneWidget.state():i.paneForSource(i.mainSeries()),n="right"===e?s.rightPriceScales():s.leftPriceScales();if(n.length<t+1)return[];var o=n[t].orderedSources().filter((function(e){return e===i.mainSeries()||e instanceof S}));return o.reverse(),(o=r(o,i.mainSeries())).map((function(e){return e.title(!0,void 0,!1)}))}_menuItemsProvider(e,t){var i=this.model(),s=this._maximizedPaneWidget?this._maximizedPaneWidget.state():i.paneForSource(i.mainSeries()),r="right"===e?s.visibleRightPriceScales():s.visibleLeftPriceScales();if(r.length<t+1)return[];var n=r[t],o=i.panes().indexOf(s),a=this._paneWidgets[o];return("right"===e?a.rightPriceAxisesContainer():a.leftPriceAxisesContainer()).findAxisWidgetForScale(n).getContextMenuActions()}_makeTimeAxisWidget(){if(this._timeAxisWidget)this._timeAxisWidget.updatePriceAxisStubs();else{var e=this.model();this._timeAxisWidget=new n(this,this._options.timeScaleWidget,this._titlesProvider.bind(this),this._menuItemsProvider.bind(this),this._backgroundBasedTheme),this._elMainTable.appendChild(this._timeAxisWidget.getElement()),this._timeAxisWidget.updatePriceAxisStubs(),this._timeAxisWidget.onLabelHovered().subscribe(this,(function(t,i){var s=this._maximizedPaneWidget?this._maximizedPaneWidget.state():e.paneForSource(e.mainSeries()),r=this.paneByState(s).highlightedPriceAxis(),n=r.value();(i||n.owner===t.owner)&&(r.setValue({owner:t.owner,axis:i?t.axis:null}),this.model().model().lightUpdate())}))}}insertStudy(e,t,i,s){var r=this;return new Promise((function(n){t?window.runOrSignIn((function(){n(r._insertStudy(e,t,i,s))}),{source:"study on study"}):n(r._insertStudy(e,t,i,s))})).catch((function(){}))}_insertStudy(e,t,i,s){var r=this._model.createStudyInserter(e,t,i);r.setForceOverlay("java"===e.type&&"Volume@tv-basicstudies"===e.studyId&&l.enabled("volume_force_overlay"));var n=this,o=r.insert((function(e,t,i){return new Promise((function(r,o){s?r(s(e,t,i)):n.isSymbolicStudy(i)?(J("GUI","Confirmation dialogs","Symbol confirmation dialog"),v(i,n.model(),r,o,"symbol")):n.hasConfirmInputs(t)?(J("GUI","Confirmation dialogs","Inputs confirmation dialog"),v(i,n.model(),r,o)):r({})}))}));return o.catch((function(e){})),o}hasConfirmInputs(e){if(void 0===e)return!1;for(var t=0;t<e.length;++t){var i=e[t];if(void 0!==i.confirm&&i.confirm)return!0}return!1}isSymbolicStudy(e){switch(e.id){case"Overlay@tv-basicstudies":case"CorrelationCoefficient@tv-basicstudies":case"Correlation Coeff@tv-basicstudies":case"Correlation - Log@tv-basicstudies-1":case"Spread@tv-basicstudies":case"Ratio@tv-basicstudies":return!0;default:return!1}}_onChartSessionIsConnectedChanged(e){e?this._onConnection():this._onDisconnect()}_onChartSessionCriticalError(e,t){this._disconnected.fire(!0)}_onData(e){
|
||
switch(e.method){case"reconnect_bailout":this._reconnectBailout.fire();break;default:this._model.onData(e)}}_onConnection(){this._online=!0,this._model?(this._model.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):this.requestMetadata()}_onDisconnect(){this._model&&this._model.disconnect(),this._online=!1,this.update(),this.paint(),this._disconnected.fire()}_applyStudiesOverrides(){Y.overrideDefaults(this._metaInfoRepository.getInternalMetaInfoArray())}requestMetadata(){this._addPerfMark("RequestMetadataStart"),this._metaInfoRepository.requestMetaInfo().then(function(){this._addPerfMark("RequestMetadataEnd"),this._inited?this.model().model().setStudiesMetaData(this._metaInfoRepository.getInternalMetaInfoArray(),this._metaInfoRepository.getMigrations()):(this._init(),this.chartWidgetInitialized.fire(),l.enabled("charting_library_base")||Q.logDebug("initialized"))}.bind(this))}studiesMetaData(){return this._model.studiesMetaData()}getTimeScale(){return this._timeAxisWidget}chartWidgetCollection(){return this._chartWidgetCollection}setSeriesStyle(e,t){this._model.setProperty(e.properties().style,t)}showObjectsTreePanelOrDialog(){var e=!1,t=window.widgetbar;t&&t.isVisible()&&(e="object_tree"===t.setPage("object_tree").name);e||this.showObjectsTreeDialog()}_showChartProperties(e,t,i,s){t&&(p("properties_dialog.active_tab.chart",t),i.tabName=t);var r=this;return new Promise((function(t){h(e,r._model,i,r._chartWidgetCollection,s).then((function(e){t(null!==e&&e.isVisible()?e:null)}))}))}showGeneralChartProperties(e){if(!l.enabled("show_chart_property_page"))return Promise.resolve(null);var t=this;return this._showChartProperties(this._model.mainSeries(),e,{doNotCloseOnBgClick:!0,onResetToDefault:function(){t._model.restorePreferences(t._model),t.applyTheme(t)}}).then((function(e){if(null===e)return null;var i=function(){e.hide(),t._chartWidgetCollection.activeChartWidget.unsubscribe(i)};return t._chartWidgetCollection.activeChartWidget.subscribe(i),e}))}showChartPropertiesForSource(e,t,i,s){return l.enabled("property_pages")?e===this._model.model().mainSeries()?this.showGeneralChartProperties(t):((i=i||{}).onResetToDefault=this._model.restorePropertiesForSource.bind(this._model,e),this._showChartProperties(e,t,i,s)):Promise.resolve(null)}generalPropertiesDefinitions(){return this._getChartPropertyDefinitionsViewModel().then((function(e){return e.propertyPages()}))}propertiesDefinitionsForSource(e){return x(e)||w(e)||T(e)?e.getPropertyDefinitionsViewModel().then((function(e){return null===e?null:e.propertyPages()})).catch((function(e){return Q.logWarn(e),null})):Promise.resolve(null)}toggleCompareOrAdd(){this._chartWidgetCollection.toggleAddCompareDialog()}showIndicators(e){if(window.studyMarket)return window.studyMarket.visible().value()?void window.studyMarket.hide():(window.studyMarket.show(e),window.studyMarket)}showFundamentals(e){if(window.fundamentalsDialog){if(!window.fundamentalsDialog.visible().value()){var t,i=void 0!==e?e.title(!0):void 0;if(void 0!==e){var s=e.symbolInfo()
|
||
;t=null===s?e.symbol():s.ticker||s.full_name}return window.fundamentalsDialog.show(t,i),window.fundamentalsDialog}window.fundamentalsDialog.hide()}}removeSelectedSources(){this.removeDataSources(this._model.selection().dataSources())}removeDataSources(e){var t=e.filter(function(e){return e!==this._model.mainSeries()&&e!==this._model.lineBeingCreated()&&!(e instanceof o)}.bind(this));if(0!==t.length){var i=null;w(t[0])&&(s(1===t.length,"Cannot remove several studies (no multi select for studies)"),i=t[0]);t.find((function(e){return e.hasAlert.value()&&e.isUserDeletable()}));i&&i.hasChildren()?showDeleteStudyTreeConfirm(this._model.removeSelectedSources.bind(this._model)):this._model.removeSelectedSources()}}unlinkSelectedLine(){var e=this._model,t=e.selection().lineDataSources();e.unlinkLines(t)}copyLineToOtherCharts(){var e=this._model,t=e.selection().lineDataSources().filter((function(e){return e.isSynchronizable()}));e.copyToOtherCharts(t)}hideSelectedObject(){this.hideDataSources(this._model.selection().dataSources())}hideDataSources(e){if(e.length){var t=e.map((function(e){return e.properties().visible})),i=e.map((function(){return!1}));this._model.setProperties(t,i,"Hide "+e[0].title())}}toggleLockSelectedObject(){var e=this._model;e.selection().lineDataSources().forEach((function(t){var i=t.properties().frozen.value();e.setProperty(t.properties().frozen,!i,(i?window.t("Unlock"):window.t("Lock"))+" "+t.title())}))}showSelectedSourceProperties(){var e=this._model.selection().dataSources()[0];e&&this.showSourceProperties(e)}showSourceProperties(e){var t=null;e===this._model.mainSeries()&&(t=_.symbol),this.showChartPropertiesForSource(e,t)}openSelectedObjectSource(e){}tags(){return this._model?this._model.calculateDefaultTags():[]}state(e,t,i,s){var r=this._model.state(e,t,i,s);return r.chartId=this.id(),r}asyncState(){return this._model.asyncState()}metaInfo(){var e=this._metaInfo;return this._model&&(e.systemTags=this._model.calculateDefaultTags()),e}onTagsChanged(){return this._tagsChanged}onModelTagsChanged(){this._tagsChanged.fire()}onAboutToBeDestroyed(){return this._aboutToBeDestroyed}destroy(){this._aboutToBeDestroyed.fire(),null!==this._removeMaximizeHotkey&&(this._removeMaximizeHotkey(),this._removeMaximizeHotkey=null),0!==this._drawRafId&&this._parent.ownerDocument.defaultView.cancelAnimationFrame(this._drawRafId),null!==this._backgroundTopColorSpawn&&this._backgroundTopColorSpawn.destroy(),null!==this._backgroundBottomColorSpawn&&this._backgroundBottomColorSpawn.destroy(),null!==this._timingsMeter&&(this._timingsMeter.stopCollect(),this._timingsMeter=null);for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].destroy();this._paneWidgets.length=0;for(e=0;e<this._paneSeparators.length;e++)this._paneSeparators[e].destroy();for(var t in this._paneSeparators.length=0,this._hotkeysListener&&this._hotkeysListener.destroy(),this._barsButton&&this._barsButton.destroy(),this._controlBarNavigation&&(this._controlBarNavigation.destroy(),this._controlBarNavigation=void 0),
|
||
this._mainDiv&&this._mainDiv.remove(),this._actions){var i=this._actions[t];i instanceof I&&(i.destroy(),i.binder&&i.binder.destroy())}null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),null!==this._definitionsViewModel&&this._definitionsViewModel.destroy(),this._hotkeys&&(this._hotkeys.destroy(),this._hotkeys=null),this._mainDiv.removeEventListener("wheel",this._onWheelBound),window.removeEventListener("keydown:chart_"+this._id,this._keydownEventListener),super.destroy(),this._chartSession.criticalError().unsubscribe(this,this._onChartSessionCriticalError),this._chartSession.isConnected().unsubscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.destroy()}title(){return window.t("Chart Properties")}symbolProperty(){return this._model.mainSeries().properties().shortName?this._model.mainSeries().properties().shortName:this._model.mainSeries().properties().symbol}loadContent(e,t){this.screen.show();this.isMaximizedPane()&&this.toggleMaximizePane();for(var i,s=this._model.model().dataSources(),r=0;r<s.length;r++){var n=s[r];n!==this._model.mainSeries()&&this._model.model().removeSource(n,!0)}this._model.disconnect(),this.activePaneWidget=!1,this._model.mainSeries().purgeSymbolInfo(),e.loading=!0,this._content=e,this._initialLoading=Boolean(t);for(r=0;r<e.panes.length;++r)for(var o=0;o<e.panes[r].sources.length;++o)if(e.panes[r].sources[o].state.symbol){i=e.panes[r].sources[o].state;break}if(!i)throw Error("An error occured while determining main series ion the chart");this._properties.mainSeriesProperties.merge({visible:!0,symbol:i.symbol,timeframe:"",onWidget:this._onWidget,interval:i.interval||"D",style:i.style}),this._init(),N.interval.setValue(i.interval),this._model.undoHistory().clearStack()}_contentSeriesProperties(){if(this._content)for(var e=this._content.panes.length;e-- >0;)for(var t=this._content.panes[e].sources,i=t.length;i-- >0;)if("MainSeries"===t[i].type)return t[i].state}updateUndoRedo(){this._model&&(this.actions().undo.update({disabled:this._model.undoHistory().undoStack().isEmpty()}),this.actions().redo.update({disabled:this._model.undoHistory().redoStack().isEmpty()}))}createSessionBreaksActions(e){var t=new I({label:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"});t.binder=new c(t,this._model.chartModel().sessions().properties().graphics.vertlines.sessBreaks.visible,this.model(),"Session Breaks"),this._actions.sessionBreaks=t}updateActionForIntradayOnly(e){e&&e instanceof I&&e.update({disabled:this.model().mainSeries().isDWM()})}containsVolume(){return this.model().dataSources().some((function(e){return e instanceof S&&"Volume"===e.metaInfo().shortId}))}containsStudyByPredicate(e){return!!this._model&&this._model.dataSources().some((function(t){if(!(t instanceof S))return!1;var i=t.metaInfo();return e(i)}))}containsStudy(e){return this.containsStudyByPredicate((function(t){return t.id===e||t.fullId===e}))}isSmall(){return this._width()<550||this._height()<300}onWidget(){return this._onWidget}onCmeWidget(){
|
||
return"cme"===this.widgetCustomer()}widgetCustomer(){return this._widgetCustomer}resize(){var e=this._height()+"px",t=this._width()+"px";this._mainDiv.style.height=e,this._mainDiv.style.width=t,this._elMainTable.style.height=e,this._elMainTable.style.width=t,this._resizeHandler&&this._mainDiv&&this._resizeHandler()}chartSession(){return this._chartSession}GUIResetScales(){J("GUI","Reset Scales");var e=this.model();e&&e.resetScales()}onLineCancelled(){O.resetToCursor()}_startSpinner(e){this._spinner||e&&(this._spinner=(new K).spin(e))}isJustClonedChart(){return!!(this._options||{}).justCloned}setDataWindowWidget(e){this._dataWindowWidget=e}removeDataWindowWidget(){this._dataWindowWidget=null}applyOverrides(e){var t={};for(var i in e)i.startsWith("mainSeriesProperties.priceAxisProperties")||(t[i]=e[i]);applyPropertiesOverrides(this.properties(),null,!1,t,null),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,t),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,t,"mainSeriesProperties"))}applyStudiesOverrides(e){Y.setDefaultsOverrides(e),this._applyStudiesOverrides()}setActive(e){this._isActive=e,Z()&&(e&&this.selectBarMode().value()?this.startTrackingMode():this.exitTrackingMode()),this._paneWidgets.forEach((function(e){e.update()})),e||this.model().selectionMacro((function(e){e.clearSelection()}))}isActive(){return this._isActive}trackTime(){return this._chartWidgetCollection.lock.trackTime}crossHairSyncEnabled(){return this._chartWidgetCollection.lock.crosshair.value()}isMultipleLayout(){return ie(this._chartWidgetCollection.layout.value())}selectBarMode(){return this._model.model().selectBarMode()}toggleSelectBarMode(){this.selectBarMode().value()||(O.resetToCursor(!0),this._model.lineBeingCreated()&&this._model.cancelCreatingLine()),this._model.model().toggleSelectBarMode(),this.selectBarMode().value()&&this.startTrackingMode()}onBarSelected(){return this._model.model().onBarSelected()}showReplayOrderConfirmationDialog(){if(!this.model().isInReplay())return Promise.resolve()}_addPerfMark(e){se("ChartWidget."+this._id+"."+e)}requestFullscreen(){this._options.requestFullscreen()}getResizerDetacher(){return this._options}}e.exports.ChartWidget=_e,e.exports.trackingModeIsAvailable=ae}).call(this,i("aIyQ"))},"Zp/P":function(e,t,i){"use strict";i.r(t),i.d(t,"extendAndClipLineSegment",(function(){return h})),i.d(t,"getArrowPoints",(function(){return u})),i.d(t,"optimalBarWidth",(function(){return d})),i.d(t,"optimalCandlestickWidth",(function(){return p})),i.d(t,"optimalHiLoWidth",(function(){return _})),i.d(t,"interactionTolerance",(function(){return m})),i.d(t,"coordinateIsValid",(function(){return f})),i.d(t,"setValidLineStyle",(function(){return g}));var s=i("aO4+"),r=i("hBTJ"),n=i("VaSN"),o=i("ogJP"),a=i("jFln");const l={line:13,minDistanceBetweenPoints:10,series:14,curve:10,anchor:13},c={line:3,minDistanceBetweenPoints:5,series:2,curve:3,anchor:2};function h(e,t,i,n,o,a){if(Object(s.equalPoints)(e,t))return null;const l=new s.Point(0,0),c=new s.Point(i,n);if(o){
|
||
if(a){const i=Object(r.intersectLineAndBox)(Object(s.lineThroughPoints)(e,t),Object(s.box)(l,c));return Array.isArray(i)?i:null}{const i=Object(r.intersectRayAndBox)(t,e,Object(s.box)(l,c));return null===i||Object(s.equalPoints)(t,i)?null:Object(s.lineSegment)(t,i)}}if(a){const i=Object(r.intersectRayAndBox)(e,t,Object(s.box)(l,c));return null===i||Object(s.equalPoints)(e,i)?null:Object(s.lineSegment)(e,i)}{const i=Object(r.intersectLineSegmentAndBox)(Object(s.lineSegment)(e,t),Object(s.box)(l,c));return Array.isArray(i)?i:null}}function u(e,t,i,s){const r=.5*i,n=Math.sqrt(2),o=t.subtract(e),a=o.normalized();let l=5*i;s&&(l=Math.min(l,.35*o.length()));const c=1*r;if(l*n*.2<=c)return[];const h=a.scaled(l),u=t.subtract(h),d=a.transposed(),p=1*l,_=d.scaled(p),m=u.add(_),f=u.subtract(_),g=m.subtract(t).normalized().scaled(c),v=f.subtract(t).normalized().scaled(c),b=t.add(g),S=t.add(v),y=r*(n-1),w=d.scaled(y),C=Math.min(l-1*r/n,r*n*1),P=a.scaled(C),x=t.subtract(w),T=t.add(w),M=t.subtract(P);return[[m,b],[f,S],[x,M.subtract(w)],[T,M.add(w)]]}function d(e,t){return t=t||1,Math.floor(.3*e*t)}function p(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);const i=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),s=Math.floor(e*i*t),r=Math.floor(e*t),n=Math.min(s,r);return Math.max(Math.floor(t),n)}function _(e){return.4*e}function m(){return Object(n.lastEventIsTouch)()?l:c}function f(e){return null!=e&&!Object(o.isNaN)(e)}function g(e,t){void 0!==t&&Object(a.setLineStyle)(e,t)}},Zp8I:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererStepLine",(function(){return c}));var s=i("GEp6"),r=i("VdBB"),n=i("aO4+"),o=i("jFln"),a=i("Y7w9"),l=i("Zp/P");class c{constructor(){this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||0===this._data.items.length)return null;const{items:t,lineWidth:i}=this._data,o=Object(l.interactionTolerance)().series+i/2,c=Object(a.lowerbound)(t,e,(e,t)=>e.x<=t.x),h=Math.max(0,c-1),u=Math.min(t.length-1,c+1);for(let a=h;a<u;a++){const i=t[a],l=t[a+1];if(!l)continue;const c=Math.round((i.x+l.x)/2),h=new n.Point(c,i.y),u=new n.Point(c,l.y);if(Math.min(Object(s.distanceToSegment)(i,h,e).distance,Object(s.distanceToSegment)(h,u,e).distance,Object(s.distanceToSegment)(u,l,e).distance)<=o)return new r.HitTestResult(r.HitTestResult.REGULAR)}return null}draw(e,t){var i,s,r,n,a,l,c,h,u,d,p,_;if(null===this._data||0===this._data.items.length)return;const{lineWidth:m,lineStyle:f,lineColor:g,items:v}=this._data,b=t.pixelRatio;let S=Math.max(Math.floor(null!==(s=null===(i=v[0].style)||void 0===i?void 0:i.width)&&void 0!==s?s:m*b)),y=S%2?.5:0;e.save(),e.lineCap="butt",e.lineJoin="round",void 0!==f&&Object(o.setLineStyle)(e,f),e.beginPath(),e.moveTo(Math.round(v[0].x*b)+y,Math.round(v[0].y*b)+y);const w=v.length;e.strokeStyle=null!==(n=null===(r=v[0].style)||void 0===r?void 0:r.color)&&void 0!==n?n:g,e.lineWidth=S;for(let o=0;o<w;o++){const t=v[o],i=v[o+1],s=Math.round(t.x*b)+y,r=Math.round(t.y*b)+y;if(e.lineTo(s,r),!i)continue;const n=Math.round((t.x+i.x)/2*b)+y,f=Math.round(i.y*b)+y;e.lineTo(n,r),e.lineTo(n,f)
|
||
;const w=null!==(l=null===(a=t.style)||void 0===a?void 0:a.color)&&void 0!==l?l:g,C=null!==(h=null===(c=t.style)||void 0===c?void 0:c.width)&&void 0!==h?h:m,P=null!==(d=null===(u=i.style)||void 0===u?void 0:u.color)&&void 0!==d?d:g,x=null!==(_=null===(p=i.style)||void 0===p?void 0:p.width)&&void 0!==_?_:m,T=w!==P,M=C!==x;(T||M)&&(e.stroke(),T&&(e.strokeStyle=P),M&&(S=Math.max(1,Math.floor(x*b)),y=S%2?.5:0,e.lineWidth=S),e.beginPath(),e.moveTo(n,f))}e.stroke(),e.restore()}}},ZsYR:function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayStatusProvider",(function(){return r}));var s=i("W+6j");class r extends s.a{getSplitTitle(){return this._source.titleInParts(!0,void 0,!1,!1)}text(){return this._source.isFailed()?`${this._source.title(!0,void 0,!1,!1)}: ${this._source.status()}`:`${this._source.title(!0,void 0,!1,!1)} ${this._source.status()}`}}},ZtA1:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"6sSH",7)).then(({TrendBasedFibExtensionPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 3}name(){return"Trend-Based Fib Extension"}migrateVersion(e,t,i){1===e&&this.properties().extendLines.setValue(!0)}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}static createProperties(e){var t=new r("linetooltrendbasedfibextension",e,!1,{range:[0,8]});return l._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"17v9"))).FibDrawingsWith24LevelsDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth"),e.child("levelsStyle").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}fibLevelsBasedOnLogScale(){return this.properties().fibLevelsBasedOnLogScale.value()&&this.priceScale().isLog()}}l.version=2,l.LevelsCount=24,t.LineToolTrendBasedFibExtension=l},"Zy3/":function(e,t,i){"use strict";i.r(t),i.d(t,"CompositeRenderer",(function(){return s}));class s{constructor(){this._renderers=[],this._globalAlpha=1}setGlobalAlpha(e){this._globalAlpha=e}append(e){this._renderers.push(e)}insert(e,t){this._renderers.splice(t,0,e)}clear(){this._renderers.length=0}draw(e,t){for(let i=0;i<this._renderers.length;i++)e.save(),e.globalAlpha=this._globalAlpha,this._renderers[i].draw(e,t),e.restore()}drawBackground(e,t){e.save(),e.globalAlpha=this._globalAlpha;for(let i=0;i<this._renderers.length;i++){const s=this._renderers[i];s.drawBackground&&s.drawBackground(e,t)}e.restore()}hitTest(e,t){let i=null;for(let s=this._renderers.length-1;s>=0;s--){const r=this._renderers[s].hitTest(e,t)
|
||
;null!==r&&(null===i||r.result()>i.result())&&(i=r)}return i}doesIntersectWithBox(e){return this._renderers.some(t=>!!t.doesIntersectWithBox&&t.doesIntersectWithBox(e))}}},a7Ha:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"LineEnd",(function(){return s})),function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(s||(s={}))},a9Kt:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd"><path stroke="currentColor" d="M13 22.5H5.5a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2V14"/><path stroke="currentColor" stroke-linecap="square" d="M18.5 15.5v8m-4-4h8"/><path fill="currentColor" d="M7 8h11v1H7zm0 4h11v1H7zm0 4h5v1H7z"/></g></svg>'},aDyP:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("7KDR").Action,o=i("rCHB").LineToolPitchforkStyle,a=null,l=i("j3hX"),c=l.LineToolWidthsProperty,h=l.LineToolColorsProperty;class u extends s{constructor(e,t){super(e,t||u.createProperties()),this._properties.style.listeners().subscribe(this,u.prototype._recreatePaneView),this._recreatePaneView()}levelsCount(){return u.LevelsCount}additionalActions(e){for(var t=[],i=["Original","Modified Schiff","Inside","Schiff"],s=0;s<4;s++){var r=new n({checked:this.properties().style.value()===s,checkable:!0,label:window.t(i[s]),payload:{target:this,value:s},onExecute:function(t){var i=t.getPayload(),s=i.target;e.setProperty(s.properties().style,i.value,`Change ${s.name()} Style`),s.updateAllViews(),s._model.updateSource(s)}});t.push(r)}return[t[0],t[3],t[1],t[2]]}_recreatePaneView(){if(null!==a){var e=[];this._properties.style.value()===o.Original?e=[new a.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===o.Schiff?e=[new a.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===o.Schiff2?e=[new a.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===o.Inside&&(e=[new a.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)}else i.e("lt-pane-views").then(i.t.bind(null,"cT+B",7)).then(e=>{null===a&&(a=e),this._recreatePaneView()})}pointsCount(){return 3}name(){return"Pitchfork"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}static createProperties(e){var t=new r("linetoolpitchfork",e,!1,{range:[0,8]});return u._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"HCdA"))).PitchForkDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=u.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new h(i)),e.addChild("linesWidths",new c(t))}}u.LevelsCount=8,t.LineToolPitchfork=u},aILO:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolHeadAndShoulders",(function(){return o}))
|
||
;var s=i("Ocx9"),r=i("Ss5c"),n=i("j3hX");class o extends r.LineDataSource{constructor(e,t){const s=t||o.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"Fx2Q")).then(t=>{this._setPaneViews([new t.LineToolHeadAndShouldersPaneView(this,e)])})}pointsCount(){return 7}name(){return"Head and Shoulders"}properties(){return super.properties()}static createProperties(e){const t=new s.DefaultProperty("linetoolheadandshoulders",e);return o._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/HOw")).then(e=>e.PatternWithBackgroundDefinitionViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("linesColors",new n.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new n.LineToolColorsProperty([e.childs().textcolor]))}}},aIha:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolFlagMark",(function(){return a}));var s=i("aO4+"),r=i("Ss5c"),n=i("Ocx9"),o=i("j3hX");class a extends r.LineDataSource{constructor(e,t){super(e,t||a.createProperties()),i.e("lt-pane-views").then(i.bind(null,"y/56")).then(({FlagMarkPaneView:e})=>{const t=new e(this,this.model());t.setAnchors(new s.Point(0,0)),this._setPaneViews([t])})}pointsCount(){return 1}name(){return"Flag Mark"}properties(){return super.properties()}static createProperties(e){e&&void 0===e.flagColor&&(e.flagColor="#318757");const t=new n.DefaultProperty("linetoolflagmark",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"w/mY")).then(e=>e.FlagMarkDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("backgroundsColors",new o.LineToolColorsProperty([e.childs().flagColor])),e.addExclusion("backgroundsColors")}}a.version=2},aIyQ:function(e,t,i){"use strict";(function(e){var t=i("txPx").getLogger("Common.Delegate");function s(){this._listeners=[]}function r(e){return!e.singleshot}s.prototype.subscribe=function(e,t,i){var s={object:e,member:t,singleshot:!!i};this._listeners.push(s)},s.prototype.unsubscribe=function(e,t){for(var i=0;i<this._listeners.length;++i){var s=this._listeners[i];if(s.object===e&&s.member===t){this._listeners.splice(i,1);break}}},s.prototype.unsubscribeAll=function(e){for(var t=this._listeners.length-1;t>=0;--t){this._listeners[t].object===e&&this._listeners.splice(t,1)}},s.prototype.destroy=function(){delete this._listeners},s.prototype.fire=function(){var e=this._listeners;this._listeners=this._listeners.filter(r);for(var i=e.length,s=0;s<i;++s){var n=e[s];try{n.member.apply(n.object||null,arguments)}catch(o){t.logError(o.stack||o.message)}}},"undefined"!=typeof window&&(window.Delegate=s),e&&e.exports&&(e.exports=s)}).call(this,i("YuTi")(e))},aKms:function(e,t,i){"use strict";i.r(t),i.d(t,"MarketStatusModel",(function(){return o}));var s=i("hY0g"),r=i.n(s),n=i("x2L+");class o{constructor(e,t){this._marketStatus=new r.a(null),
|
||
this._lastMarketStatus=null,n.b.subscribe(this,()=>this._update()),this._quotesProvider=e,this._quotesProvider.quotesUpdate().subscribe(this,this._update.bind(this)),this._resetSubscription=t,this._resetSubscription.subscribe(this,this._resetStatus)}destroy(){n.b.unsubscribeAll(this),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._resetSubscription.unsubscribeAll(this)}status(){return this._marketStatus}_resetStatus(){this._marketStatus.setValue(null)}_update(e={}){void 0!==e.values&&(this._lastMarketStatus=e.values.current_session),"market"!==this._lastMarketStatus||n.b.value()?this._marketStatus.setValue(this._lastMarketStatus):this._resetStatus()}}},"aO4+":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addScaled=function(t,i){return new e(this.x+i*t.x,this.y+i*t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.dotProduct=function(e){return this.x*e.x+this.y*e.y},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.scaled=function(t){return new e(this.x*t,this.y*t)},e.prototype.normalized=function(){return this.scaled(1/this.length())},e.prototype.transposed=function(){return new e(-this.y,this.x)},e.prototype.clone=function(){return new e(this.x,this.y)},e}();function r(e,t){return new s(e,t)}function n(e,t){return e.x===t.x&&e.y===t.y}function o(e,t,i){if(0===e&&0===t)throw new Error("A and B can not be both equal to zero.");return{A:e,B:t,C:i}}function a(e,t){return{edge:e,isPositive:t}}t.Point=s,t.point=r,t.equalPoints=n,t.line=o,t.lineThroughPoints=function(e,t){if(n(e,t))throw new Error("Points should be distinct");return o(e.y-t.y,t.x-e.x,e.x*t.y-t.x*e.y)},t.lineSegment=function(e,t){if(n(e,t))throw new Error("Points of a segment should be distinct");return[e,t]},t.halfplane=a,t.halfplaneThroughPoint=function(e,t){return a(e,e.A*t.x+e.B*t.y+e.C>0)},t.box=function(e,t){return{min:r(Math.min(e.x,t.x),Math.min(e.y,t.y)),max:r(Math.max(e.x,t.x),Math.max(e.y,t.y))}},t.equalBoxes=function(e,t){return n(e.min,t.min)&&n(e.max,t.max)}},aVjL:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" fill-rule="evenodd" d="M11.5 6a.5.5 0 0 0-.5.5V8h6V6.5a.5.5 0 0 0-.5-.5h-5zM18 8V6.5c0-.83-.67-1.5-1.5-1.5h-5c-.83 0-1.5.67-1.5 1.5V8H5.5a.5.5 0 0 0 0 1H7v12.5A2.5 2.5 0 0 0 9.5 24h9a2.5 2.5 0 0 0 2.5-2.5V9h1.5a.5.5 0 0 0 0-1H18zm2 1H8v12.5c0 .83.67 1.5 1.5 1.5h9c.83 0 1.5-.67 1.5-1.5V9zm-8.5 3c.28 0 .5.22.5.5v7a.5.5 0 0 1-1 0v-7c0-.28.22-.5.5-.5zm5.5.5a.5.5 0 0 0-1 0v7a.5.5 0 0 0 1 0v-7z"/></svg>'},b1GK:function(e,t,i){"use strict";i.r(t),i.d(t,"addPerfMark",(function(){return c})),i.d(t,"startPerfMeasure",(function(){return h})),i.d(t,"endPerfMeasure",(function(){return u})),i.d(t,"perfMeasureOperation",(function(){return d}));var s=i("e3/o");function r(){}
|
||
const n=console.timeStamp?console.timeStamp.bind(console):r,o=window.performance&&performance.mark?performance.mark.bind(performance):r,a=window.performance&&performance.measure?performance.measure.bind(performance):r,l=window.performance&&performance.clearMarks?performance.clearMarks.bind(performance):r;function c(e){n(e),o(e)}function h(e){o(e)}function u(e){a(e,e),l(e)}async function d(e,t){const i=`measure-${e}-${Object(s.randomHash)()}`;o(i);try{return await t()}finally{a(e,i),l(i)}}},bGI9:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyTrackPricePaneView",(function(){return n}));var s=i("2ijp"),r=i("8Uy/");class n extends s.a{constructor(e,t){super(),this._lineRendererData.linestyle=r.LINESTYLE_DOTTED,this._study=e,this._plotName=t}_updateImpl(){this._lineRendererData.visible=!1;const e=this._study.properties().styles[this._plotName];if(!e.trackPrice.value())return;const t=this._study.lastValueData(this._plotName,!0);t.noData||(this._lineRendererData.visible=!0,this._lineRendererData.y=t.coordinate,this._lineRendererData.color=t.color,this._lineRendererData.linewidth=e.linewidth.value())}}},bJYc:function(e,t,i){"use strict";i.r(t),i.d(t,"SetPropertyUndoCommand",(function(){return n}));var s=i("RDU5"),r=i("Ocx9");class n extends s.UndoCommand{constructor(e,t,i,s,r){super(i),this._targetObj=e,this._newValue=t,this._oldValue=this._targetObj.value(),this._model=s,r&&this.setCustomFlag("doesnt_affect_save",!0)}redo(){Object(r.saveDefaultProperties)(!0),this._targetObj.setValue(this._newValue),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()}undo(){Object(r.saveDefaultProperties)(!0),this._targetObj.setValue(this._oldValue),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()}}},bKFv:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"StatsPosition",(function(){return s})),function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(s||(s={}))},bOGh:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("RDU5");class r extends s.UndoCommand{constructor(e){super(e,!1),this._subcommands=[]}addCommand(e){this._subcommands.push(e)}isEmpty(){return 0===this._subcommands.length}redo(){for(let e=0;e<this._subcommands.length;e++)this._subcommands[e].redo()}undo(){for(let e=this._subcommands.length-1;e>=0;e--)this._subcommands[e].undo()}commands(){return this._subcommands}}},bSeV:function(e,t,i){},bTqm:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolCypherPattern",(function(){return n}));var s=i("NJRZ"),r=i("Ocx9");class n extends s.LineTool5PointsPattern{constructor(e,t){super(e,t||n.createProperties())}name(){return"Cypher Pattern"}static createProperties(e){const t=new r.DefaultProperty("linetoolcypherpattern",e);return n._configureProperties(t),t}_loadPaneViews(e){i.e("lt-pane-views").then(i.bind(null,"mjK7")).then(t=>{this._setPaneViews([new t.CypherPaneView(this,e)])})}static _configureProperties(e){s.LineTool5PointsPattern._configureProperties(e)}}},bc0y:function(e,t,i){},biIa:function(e,t,i){
|
||
"use strict";i.r(t),i.d(t,"SeriesWaterlinePaneView",(function(){return a}));var s=i("k4w6"),r=i("//lt"),n=i("VdBB"),o=i("8Uy/");class a extends s.a{constructor(e){super(e);const t={cursorType:r.PaneCursorType.VerticalResize,itemIndex:0,areaName:n.AreaName.SourceItemMove};this._lineRenderer.setHitTest(new n.HitTestResult(n.HitTestResult.MOVEPOINT,t)),this._lineRendererData.visible=!0,this._lineRendererData.linestyle=o.LINESTYLE_SPARSE_DOTTED}_updateImpl(){const e=this._series.properties().baselineStyle,t=Math.abs(100-e.baseLevelPercentage.value());this._lineRendererData.y=Math.round(this._series.priceScale().height()*(t/100)),this._lineRendererData.color=e.baselineColor.value()}}},brCa:function(e,t,i){"use strict";i.r(t),i.d(t,"createNoticeDialog",(function(){return r})),i.d(t,"showNoticeDialog",(function(){return n}));i("YFKU");const s={width:400,destroyOnClose:!0,title:window.t("Notification"),content:window.t("You are notified"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]};async function r(e){return(await Promise.all([i.e("dialogs-core"),i.e(60),i.e(0),i.e(32),i.e("create-dialog")]).then(i.bind(null,"YDhE"))).createDialog(Object.assign(Object.assign({},s),e))}function n(e){r(e).then(e=>e.open())}},"bv/X":function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"piZW",7)).then(({SineLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Sine Line"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"LX4V"))).CyclicAndSineLinesPatternDefinitionsViewModel}static createProperties(e){var t=new r("linetoolsineline",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolSineLine=n},c2JX:function(e,t,i){"use strict";i.r(t),i.d(t,"renderSpinnerTemplate",(function(){return n})),i.d(t,"Spinner",(function(){return a}));i("SzKR");var s=i("gWrr"),r=i("Owlf");function n(e=""){return'\n\t\t<div class="tv-spinner" role="progressbar">\n\t\t\t<div class="tv-spinner__spinner-layer">\n\t\t\t\t<div class="tv-spinner__background tv-spinner__width_element"></div>\n\t\t\t\t<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--left"></div>\x3c!--\n\t\t\t\t--\x3e<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--right"></div>\n\t\t\t</div>\n\t\t</div>\n\t'}
|
||
const o=Object(s.b)('\n\t\t<div class="tv-spinner" role="progressbar">\n\t\t\t<div class="tv-spinner__spinner-layer">\n\t\t\t\t<div class="tv-spinner__background tv-spinner__width_element"></div>\n\t\t\t\t<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--left"></div>\x3c!--\n\t\t\t\t--\x3e<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--right"></div>\n\t\t\t</div>\n\t\t</div>\n\t');class a{constructor(e){this._shown=!1,this._el=o.cloneNode(!0),this.setSize(e||r.a)}spin(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,void 0!==e&&e.appendChild(this._el)),this._shown=!0,this}stop(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this}setStyle(e){return Object.keys(e).forEach(t=>{const i=e[t];void 0!==i&&this._el.style.setProperty(t,i)}),this}setSize(e){const t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className=`tv-spinner ${t} ${this._shown?"tv-spinner--shown":""}`,this}getEl(){return this._el}destroy(){this.stop(),delete this._el,delete this._container}}},c44N:function(e,t,i){"use strict";function s(e,t){return e.pixelRatio===t.pixelRatio}i.r(t),i.d(t,"areEqualPaneRenderParams",(function(){return s}))},cBZt:function(e,t,i){"use strict";function s(e,t){return`${e}@${t}`}function r(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",(function(){return s})),i.d(t,"extractStudyId",(function(){return r}))},cKqi:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("qJq3").Series,n=i("GVHu").Study,o=i("k9/m").PlotRowSearchMode,a=i("FBsw").OverlayPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("x0JF"),h=c.SeriesAreaPaneView,u=c.SeriesLinePaneView,d=c.SeriesHollowCandlesPaneView,p=c.SeriesCandlesPaneView,_=c.SeriesBarsPaneView,m=c.SeriesBaselinePaneView,f=i("biIa").SeriesWaterlinePaneView,g=i("2kV1").StudyStatusView,v=i("JjUe").OverlayDataWindowView,b=i("z8/4").OverlayLegendView,S=i("qXYw").OverlayLegendValuesProvider,y=i("ZsYR").OverlayStatusProvider,w=i("38az").SeriesBarColorer,C=i("l4sv").HorizontalLineRenderer,P=i("Kxc7"),x=i("6sst").OverlayStudyPriceLineAxisView,T=i("Qb4w").PriceRange,M=i("XPit").barFunction,I=i("n5al").createSeriesFormatter,L=i("y/Xm").StudyOverlayBase,O=i("qFKp").CheckMobile.any()&&!1,A=!P.enabled("hide_study_overlay_legend_item"),E=i("txPx").getLogger("Chart.StudyOverlay");class k{constructor(e,t){this._source=e,this._model=t,this._points=[new s(0,0)],this._lineRenderer=new C}update(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new s(0,e.coordinate)],this._color=e.color)}}renderer(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.y=this._points[0].y,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),
|
||
this._lineRenderer}}t.study_Overlay=class extends L{constructor(e,t,i,s){super(e,t,i,s),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,(function(){r._recreatePriceFormattingDependencies(),r.updateAllViews(),r._model.fullUpdate()})),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}_showLastValueOnPriceScale(){return this._model.properties().scalesProperties.showSeriesLastValue.value()}lastValueData(e,t,i){var s={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return s;var n=this._model.timeScale().visibleBarsStrictRange();if(null===n)return s;if(!this.properties().visible.value())return s;var a=this.nearestIndex(n.lastBar(),o.NearestLeft,TradingView.OPEN_PLOT);if(null==a)return s;var l=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),c=null!==l&&n.contains(l.index),h=null!==l?l.value:null,u=t||c?h:this.data().valueAt(a);if(null===u)return s;var d=this._barFunction(u);if(!isNumber(d))return s;var p={noData:!1};i&&(p.price=d);var _=this.firstValue();if(!isNumber(_))return s;p.text=this.priceScale().formatPrice(d,_),p.text=this.priceScale().formatPrice(d,_),p.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(d),p.formattedPricePercentage=this.priceScale().formatPricePercentage(d,_),p.floatCoordinate=this.priceScale().priceToCoordinate(d,_),p.coordinate=p.floatCoordinate,p.item=u;var m=this.properties();switch(m.style.value()){case r.STYLE_BARS:p.color=u[TradingView.OPEN_PLOT]<=u[TradingView.CLOSE_PLOT]?m.barStyle.upColor.value():m.barStyle.downColor.value();break;case r.STYLE_CANDLES:case r.STYLE_HOLLOW_CANDLES:p.color=u[TradingView.OPEN_PLOT]<=u[TradingView.CLOSE_PLOT]?m.candleStyle.upColor.value():m.candleStyle.downColor.value();break;case r.STYLE_LINE:p.color=m.lineStyle.color.value();break;case r.STYLE_AREA:p.color=m.areaStyle.color1.value();break;case r.STYLE_BASELINE:var f=m.baselineStyle,g=this.priceScale(),v=Math.round(g.height()*(Math.abs(100-f.baseLevelPercentage.value())/100));p.color=p.coordinate<v?m.baselineStyle.topLineColor.value():m.baselineStyle.bottomLineColor.value()}return p}firstValue(){var e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return null;var t=e.firstBar();if(0===this.data().size())return null;var i=this.data().search(t,o.NearestRight,TradingView.OPEN_PLOT);return null!==i?this._barFunction(i.value):null}barFunction(){return this._barFunction}_updateBarFunction(){var e=this.priceSource()||"close";this._barFunction=M(e)}priceSource(){switch(this._properties.style.value()){case r.STYLE_LINE:return this._properties.lineStyle.priceSource.value();case r.STYLE_AREA:
|
||
return this._properties.areaStyle.priceSource.value();case r.STYLE_BASELINE:return this._properties.baselineStyle.priceSource.value()}return null}priceRange(e,t){if(TradingView.isInteger(e)){if(TradingView.isInteger(t)){if(0===this.data().size())return null;var i,s=this.priceSource(),r=null!==(i=null!==s?this.data().minMaxOnRangeCached(e,t,[{name:s,offset:0}]):this.data().minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]))?new T(i.min,i.max):null;return this._postProcessPriceRange(r)}E.logDebug("priceRange: incorrect endBar")}else E.logDebug("priceRange: incorrect startBar")}createViews(){this._priceAxisViews=[];var e=new a(this);this._priceAxisViewsBase=[e];var t=new x(this);this._priceLinesAxisViews=[t],this._paneViews=[],this._labelPaneViews=[];var i=null,s=null;switch(this._properties.style.value()){case r.STYLE_BARS:s=new _(this,this._model);break;case r.STYLE_CANDLES:s=new p(this,this._model);break;case r.STYLE_HOLLOW_CANDLES:s=new d(this,this._model);break;case r.STYLE_LINE:s=new u(this,this._model);break;case r.STYLE_AREA:s=new h(this,this._model);break;case r.STYLE_BASELINE:s=new m(this,this._model),i=new f(this)}s&&this._paneViews.push(s),null!==i&&this._paneViews.push(i),this._paneViews.push(new k(this,this._model)),this._dataWindowView||(this._dataWindowView=new v(this,this._model)),this._legendView||(this._legendView=new b(this,this._model)),this._statusView||(this._statusView=new g(this)),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews),this._labelPaneViews.push(new l(e,this,this._model))}barColorer(){return new w(this)}start(e){this._formatter=null,n.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter(),O&&this._setQuotesSymbol(this.symbol())}_tryCreateFormatter(){return I(this.symbolInfo(),this.properties().minTick.value())}formatter(){return this._formatter||this._recreateFormatter(),this._formatter}_tryChangeInputs(){n.prototype._tryChangeInputs.call(this),this.m_formatter=null,this.priceScale().updateFormatter()}bars(){return this.data()}open(e){return this.bars().valueAt(e)[TradingView.OPEN_PLOT]}high(e){return this.bars().valueAt(e)[TradingView.HIGH_PLOT]}low(e){return this.bars().valueAt(e)[TradingView.LOW_PLOT]}close(e){return this.bars().valueAt(e)[TradingView.CLOSE_PLOT]}hl2(e){return(this.high(e)+this.low(e))/2}hlc3(e){return(this.high(e)+this.low(e)+this.close(e))/3}ohlc4(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4}stop(e){n.prototype.stop.call(this,e),this._quotesProvider.setQuotesSessionSymbol(null)}_onQuotesUpdate(e,t){!this._legendView||void 0===t.values.change&&void 0===t.values.change_percent||(this._legendView.update(),this._model.updateSource(this))}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.destroy(),n.prototype.destroy.call(this)}tags(){var e=[],t=this.symbolInfo();return t?e.push(t.name):this._properties.inputs.symbol.value()&&e.push(this._properties.inputs.symbol.value()),e}statusView(){
|
||
return A?n.prototype.statusView.call(this):null}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e(61),i.e("study-property-pages-with-definitions")]).then(i.bind(null,"WUYT"))).StudyOverlayDefinitionsViewModel}defaultPlotIdForAlert(){return""}changeStyles(){this.data().each((function(e,t){t[TradingView.STYLE_PLOT]=null})),n.prototype.changeStyles.call(this)}valuesProvider(){return new S(this,this.model())}statusProvider(e){return new y(this,this.model())}canBeHiddenByGlobalFlag(){return!1}}},cPgM:function(e,t,i){"use strict";i.r(t),i.d(t,"ScaledPaneRenderer",(function(){return s})),i.d(t,"ScaledPaneRendererWrapper",(function(){return r}));class s{draw(e,t){e.save(),e.scale(t.pixelRatio,t.pixelRatio),e.translate(.5,.5),this._drawImpl(e,Object.assign(Object.assign({},t),{pixelRatio:1})),e.restore()}drawBackground(e,t){e.save(),e.scale(t.pixelRatio,t.pixelRatio),e.translate(.5,.5),this._drawBackgroundImpl(e,Object.assign(Object.assign({},t),{pixelRatio:1})),e.restore()}_drawBackgroundImpl(e,t){}}class r{constructor(e){this._base=e}hitTest(e,t){return this._base.hitTest(e,t)}draw(e,t){e.save(),e.scale(t.pixelRatio,t.pixelRatio),e.translate(.5,.5),this._base.draw(e,Object.assign(Object.assign({},t),{pixelRatio:1})),e.restore()}drawBackground(e,t){e.save(),e.scale(t.pixelRatio,t.pixelRatio),e.translate(.5,.5),this._base.drawBackground&&this._base.drawBackground(e,Object.assign(Object.assign({},t),{pixelRatio:1})),e.restore()}}},cWHH:function(e,t,i){"use strict";(function(t,s){var r=i("Eyy1").ensureNotNull,n=i("eJTA"),o=i("gP14").ChartModelBase,a=n.parseRgb,l=n.rgbToBlackWhiteString,c=i("CW80"),h=c.isLineTool,u=c.isStudyLineTool,d=i("2+aH").Crosshair,p=i("rY0k").Watermark,_=i("hY3j").Grid,m=i("22xp").TimeScale,f=i("qFKp").CheckMobile,g=i("H0vP").InvalidationMask,v=i("H0vP").InvalidationLevel,b=i("GVHu"),S=b.Study,y=i("Qq0B").NonSeriesStudy,w=i("3ClC"),C=w.createStudy,P=w.isStudy,x=w.isFundamentalStudy,T=b.prepareStudyProperties,M=i("K4L1"),I=i("qJq3").Series,L=i("mMWL"),O=i("wZIs").defaults,A=i("Ocx9").DefaultProperty,E=i("Qtjj").TimeSynchronizer,k=i("txPx").getLogger("Chart.ChartModel"),D=i("Y5iK").MainSeriesScaleRatioProperty,V=i("FaJS").scaleRatio,B=i("MROS").ModelSelection,R=i("Y7w9").subtract,N=i("VgjZ").PriceAxisRendererOptionsProvider,j=i("/YGI").StudyInserter,F=i("3t3b").dateFormatProperty,W=i("/tGj").isSymbolSource,H=i("gaBL").sourceNewCurrencyOnPinningToPriceScale,z=i("SwuQ").sourceNewUnitOnPinningToPriceScale,U=i("FQhm"),G=i("jCNj"),q=i("i126").StudyColorRotatorFactory,Y=i("Kxc7"),K=i("jeZR").AppliedTimeFrame,J=Y.enabled("auto_enable_symbol_labels");function Z(){this._selection.clear()}function X(e){this._selection.remove(e)}function Q(e,t){var i=this._selection.isSelected(e);i&&this._lastHittestData===t||e&&!e.isSelectionEnabled()||(this._lastHittestData=t,i||this._selection.add(e))}class ee extends o{constructor(e,i,r,n,o,a,l,c){super(e,i,r,n,o,a,l,c),this._version=ee.version,this._modelIntervals=[],this._rendererOptionsProvider=new N(this),this._lastBackgroundColor=void 0,
|
||
this._lastOriginalColor=void 0,this.setStudiesMetaData(this._studiesMetaInfoRepository.getInternalMetaInfoArray(),this._studiesMetaInfoRepository.getMigrations()),L.init();var h=this;this._panes=[],this.m_gridSource=new _;var u=this._readOnly?new t(O("chartproperties.paneProperties.crossHairProperties")):this._properties.paneProperties.crossHairProperties;this.m_crossHairSource=new d(this,u,this._options.crossHair),this.m_crossHairSource.selectBarMode().subscribe((function(e){if(e&&h.lineBeingCreated()){var t=L.tool.value();h.cancelCreatingLine(),L.tool.setValue(t)}})),this._tagsChanged=new s;var f=new A("chartproperties.mainSeriesProperties");f.addExclusion("minTick"),f.addExclusion("priceAxisProperties.lockScale"),f.addExclusion("priceAxisProperties.percentage"),f.addExclusion("priceAxisProperties.indexedTo100"),f.addExclusion("priceAxisProperties.isInverted"),f.addExclusion("priceAxisProperties.log"),f.addExclusion("priceAxisProperties.logDisabled"),f.addExclusion("priceAxisProperties.percentageDisabled"),f.addExclusion("priceAxisProperties.autoScaleDisabled"),f.merge(r.mainSeriesProperties.state()),this._timeScale=new m(this,this._options.timeScale);var g={countdownEnabled:this._options.countdownEnabled};this.m_mainSeries=new I(this,f,g,n),this.m_mainSeries.onStyleChanged().subscribe(this._timeScale,this._timeScale.invalidateVisibleBars),this.m_mainSeries.properties().showCountdown.subscribe(this,(function(){this.m_mainSeries.updateAllViews(),this.fullUpdate()})),this._timeScale.visibleBarsStrictRangeChanged().subscribe(this.m_mainSeries,this.m_mainSeries.clearHighLowAvgPriceCache),this.createPane(void 0,{axisProperties:f.priceAxisProperties.state(["autoScale"])});var v=this._panes[0];v.setStretchFactor(2*v.stretchFactor()),v._isMainPane=!0,this._selection=new B,this._selectedSourceChanged=new s,this._properties.listeners().subscribe(this,ee.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,(function(){h._chartApi&&h._chartApi.connected()&&h._chartApi.switchTimezone(h.timezone())})),this._timeScale.defaultRightOffsetProperty().listeners().subscribe(null,(function(){h.recalculateAllPanes()})),v.addDataSource(this.m_mainSeries,this._panes[0].findSuitableScale(this.m_mainSeries)),this._mainSeriesScaleRatioProperty=new D(this),this.m_mainSeries.dataEvents().completed().subscribe(this,function(){if(this._scrollingState&&this.gotoTime(),Y.enabled("fix_left_edge")&&this.m_mainSeries.endOfData()){var e=this.m_mainSeries.bars().first();null!==e&&this._timeScale.setLeftEdgeFix(e.index)}}.bind(this)),this.m_mainSeries.onIntervalChanged().subscribe(this,(function(){this._recalcVRStudiesParams.oldStartVisibleIndex=NaN,this._recalcVRStudiesParams.oldEndVisibleIndex=NaN})),this._readOnly||(f.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,(function(e){e.value()||h._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)}))),this._barsMarksSources=l(this)
|
||
;for(var b=0;b<this._barsMarksSources.length;b++)this._barsMarksSources[b].setOwnerSource(this.m_mainSeries);this._syncPointCache={},this._watermarkSource=this._options.watermarkEnabled?new p(this,this.m_mainSeries):null,L.hideAllDrawings().subscribe(this,this._onDrawingsVisibilityChanged),L.hideAllIndicators().subscribe(this,this._onIndicatorsVisibilityChanged),this._properties.scalesProperties.listeners().subscribe(this,ee.prototype.fullUpdate),this._studyInserted=new s,this._chartThemeLoaded=new s,this._studyShiftColorStartOffset=void 0,this._linePointBeingEdited=null,this._lineBeingEdited=null,F.subscribe(this,this._updateDateTimeFormatter),this.mainSeries().properties().interval.subscribe(this,this._updateDateTimeFormatter),this._updateDateTimeFormatter(),this._studyColorRotatorFactory=new q(this),this._dataSourceCollectionChanged.subscribe(this,this._updateShowLegendProperty.bind(this)),this._properties.paneProperties.legendProperties.showLegend.subscribe(this,this._updateShowLegendProperty),this._appliedTimeFrame=new K(this),this.mainSeries().onTimeFrameApplied().subscribe(this,(function(e){var t=null!==e?{res:this.mainSeries().interval(),val:e}:null;this.appliedTimeFrame().setValue(t)}))}applyPreferences(e){for(var t in e)void 0!==this._properties[t]&&"m_mainSeries"!==this._properties[t]&&this._properties[t].mergeAndFire(e[t]);void 0!==e.timeScale&&this._timeScale.defaultRightOffsetProperty().setValue(e.timeScale.defaultRightOffset),this._properties.saveDefaults(),this.m_mainSeries.applyPreferences(e.mainSeries),this.sessions().applyPreferences(e.sessions),this.recalculateAllPanes(),this.fullUpdate()}setStudiesMetaData(e,t){this._studiesMetaData=e,this._studyVersioning=new M(this._studiesMetaData,t)}isSnapshot(){return this._isSnapshot}timezone(){return this._properties.timezone.value()}version(){return this._version}setVersion(e){this._version=e}initConnection(){this._chartApi.switchTimezone(this.timezone())}updatePane(e){var t=this._paneInvalidationMask(e);this.invalidate(t)}fullUpdate(){this.invalidate(g.full())}lightUpdate(){this.invalidate(g.light())}studiesMetaData(){return this._studiesMetaData}studyVersioning(){return this._studyVersioning}disconnect(){this.sessions().stop();for(var e,t=this.dataSources(),i=0;i<t.length;i++)(e=t[i]).disconnect&&e.disconnect();this._timeScale.disconnect()}restart(){this.initConnection(),this._timeScale.reset(),this.m_mainSeries.restart();for(var e,t=this.dataSources(),i=0;i<t.length;i++)(e=t[i]).restart&&e!==this.m_mainSeries&&e.restart();this.sessions().restart()}startNotStartedStudies(){if(!this.m_mainSeries.isStarted())throw new Error("Cannot start studies: main series is not started");for(var e=this.dataSources(),t=0;t<e.length;t++)P(e[t])&&!e[t].isStarted()&&e[t].restart&&e[t]!==this.m_mainSeries&&e[t].restart()}updateLineTools(){for(var e=this.dataSources(),t=0;t<e.length;t++)if(h(e[t])){var i=e[t];i.tryCreateServerPoints(),i.checkAlert&&i.checkAlert()}}readOnly(){return this._readOnly}properties(){return this._properties}chartApi(){return this._chartApi}
|
||
propertyChangeHandler(){this.lightUpdate()}_onDrawingsVisibilityChanged(e){for(var t=!1===e.value(),i=this.dataSources(),s=0;s<i.length;s++){var r=i[s],n=h(r)&&r.properties().visible.value();t&&n?U.emit("drawing_event",r.id(),"show"):!t&&n&&U.emit("drawing_event",r.id(),"hide")}this.selectionMacro((function(e){e.clearSelection()}))}_onIndicatorsVisibilityChanged(){var e=this.allStudies().filter((function(e){return e.properties().visible.value()&&e.canBeHiddenByGlobalFlag()}));if(0!==e.length){for(var t=!1,i=0;i<e.length;i++)if(this.selection().isSelected(e[i])){t=!0;break}t?this.selectionMacro((function(e){e.clearSelection()})):this.lightUpdate()}}updateAllPaneViews(){for(var e=0;e<this._panes.length;e++){this._panes[e].updateAllViews()}}mainSeries(){return this.m_mainSeries}timeScale(){return this._timeScale}gridSource(){return this.m_gridSource}watermarkSource(){return this._watermarkSource}crossHairSource(){return this.m_crossHairSource}publishedChartsTimelineSource(){return null}barsMarksSources(){return this._barsMarksSources}priceScaleSlotsCount(){var e=0,t=0;this._panes.forEach((function(i){e=Math.max(i.leftPriceScales().length,e),t=Math.max(i.rightPriceScales().length,t)}));var i=e+t;if(f.any()){var s=this.paneForSource(this.mainSeries()),r=s.priceScalePosition(this.mainSeries().priceScale()),n="right"===r;return"overlay"===r&&(n=s.rightPriceScales().length>0),n?{left:0,right:1,totallySlots:i}:{left:1,right:0,totallySlots:i}}return{left:e,right:t,totallySlots:e+t}}startScrollPrice(e,t,i){e.startScrollPrice(t,i)}scrollPriceTo(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,v.Light))}endScrollPrice(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,v.Light))}setPriceAutoScale(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,v.Light))}updateScales(e,t){this._undoModel._chartWidget._updateScalesActions()}mainSeriesScaleRatioProperty(){return this._mainSeriesScaleRatioProperty}mainSeriesScaleRatioPropertyOnChanged(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)}mainSeriesScaleRatio(){return V(this._timeScale,this.m_mainSeries.priceScale())}setMainSeriesScaleRatio(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)}startScrollTime(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0}scrollTimeTo(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)}endScrollTime(){this._timeScale.endScroll(),this.lightUpdate(),this.recalcVisibleRangeStudies(),this._isTimeScrolling=!1}recalcStudyBasedLineTools(){this.dataSources().forEach((function(e){u(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()}))}restoreTimeScaleState(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)}restoreFactoryDefaults(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudies(!0)}selectionMacro(e){var t=this.selection().allSources();e({
|
||
removeSourceFromSelection:X.bind(this),addSourceToSelection:Q.bind(this),clearSelection:Z.bind(this),selection:this.selection.bind(this)});var i=R(t,this.selection().allSources()),s=R(this.selection().allSources(),t);s.concat(t).forEach((function(e){e.updateAllViews()})),i.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!1)})),s.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!0)})),this.lightUpdate(),this.setHoveredSource(null),(i.length>0||s.length>0)&&this._selectedSourceChanged.fire()}checkLineToolSelection(){this._selection.checkLineToolSelection()}onSelectedSourceChanged(){return this._selectedSourceChanged}selection(){return this._selection}orderedDataSources(e){var t=[];t.push(this.m_crossHairSource);for(var i=0;i<this._panes.length;i++){var s=this._panes[i].sourcesByGroup().all().slice();e&&s.reverse(),t=t.concat(s)}return t}dataSourceForId(e){for(var t,i=0;i<this._panes.length;++i)if(t=this._panes[i].dataSourceForId(e))return t;return null}children(e,t){return this.dataSources().filter((function(i){return(!0!==t||!P(i)||!i.isChildStudy())&&i.ownerSource()===e}))}onSyncScrollNeeded(e){var t=this._undoModel._chartWidget;if(t._chartWidgetCollection){var i=this.mainSeries().syncModel();if(i){var s=1e3*this._timeScale.points().roughTime(e,i.projectTime.bind(i));t._chartWidgetCollection.syncScroll(s,this)}}}syncTimeWithModel(e,t){var i=this.mainSeries().syncModel();if(null!==i){var s=1e3*this.createSyncPoint(e.mainSeries().syncModel(),i).sourceTimeToTargetTime(t/1e3),r=G.get_timezone(this.timezone()),n=G.utc_to_cal(r,s).getTime();this._gotoTimeImpl(n,{centerIfVisible:!1})}}gotoTime(e){return this._gotoTimeImpl(e,{centerIfVisible:!0})}_gotoTimeImpl(e,t){var i,s=this.timeScale(),n=this.mainSeries();if(void 0!==e)this._scrollingState&&this._scrollingState.deferred.reject(),i=$.Deferred(),this._scrollingState={targetDate:e,deferred:i,centerIfVisible:t.centerIfVisible};else{if(!this._scrollingState)return k.logError("scrollTo called without an argument"),$.Deferred().reject().promise();e=this._scrollingState.targetDate,i=this._scrollingState.deferred}var o=function(t){if(s.tickMarks().indexToTime(s.tickMarks().minIndex).valueOf()-e<0){var i=s.tickMarks().nearestIndex(e),o=r(n.bars().lastIndex());i=Math.min(i,o);for(var a=s.tickMarks().indexToTime(i).valueOf();a<e&&i<o;)i++,a=s.tickMarks().indexToTime(i).valueOf();var l=s.visibleBarsStrictRange(),c=l.lastBar()-l.firstBar();return!t&&l.contains(i)||s.zoomToBarsRange(i-c/2,i+c/2),{timestamp:s.indexToTimePoint(i)}}}(this._scrollingState.centerIfVisible);if(!o){var a=s.tickMarks().minIndex,l=s.visibleBarsStrictRange(),c=l.lastBar()-l.firstBar();if(n.endOfData())s.zoomToBarsRange(a-c/2,a+c/2),o={timestamp:s.indexToTimePoint(a),eod:!0};else{var h=this.timeScale().tickMarks().estimateLeft(e);this.timeScale().requestMoreHistoryPoints(Math.ceil(h+c/2))}}return o&&(this.fullUpdate(),this._scrollingState=null,i.resolve(o)),i.promise()}createSyncPoint(e,t){
|
||
var i=this._syncPointCache[e.uniqueId()];if(i){var s=i[t.uniqueId()];if(s)return s}else this._syncPointCache[e.uniqueId()]={};var r=new E(e,t);return this._syncPointCache[e.uniqueId()][t.uniqueId()]=r,r}updateTimeScale(e,t,i,s,r,n,o){if(o){this._timeScale.reset();for(var a=this.dataSources(),l=0;l<a.length;l++)a[l].clearData&&a[l].clearData()}if(s.length>0)for(a=this.dataSources(),l=0;l<a.length;l++)a[l].moveData&&a[l].moveData(s);var c=this._timeScale.indexToTimePoint(this._timeScale.baseIndex());this._timeScale.update(e,t,i,n);var h="ChartModel.prototype.updateTimeScale("+e+","+t+","+i.length+","+s.length+","+n.length+","+o+")";if(h+="TimeScale: {first:"+this._timeScale.points().firstIndex()+",last:"+this._timeScale.points().lastIndex()+"}",void 0!==r){var u=this._timeScale.indexToTimePoint(r),d=null!==c&&null!==u&&u>c;this._updateBaseIndex(r,d)}k.logDebug(h),this.recalculateAllPanes(),this.lightUpdate()}updateTimeScaleBaseIndex(e){var t=this.mainSeries().bars();t.isEmpty()||this._updateBaseIndex(r(t.lastIndex()),e&&e.index>0)}_updateBaseIndex(e,t){var i=this.timeScale(),s=i.baseIndex(),r=i.visibleBarsStrictRange(),n=i.logicalRange();if(null!==n&&t){var o=n.contains(s),a=e-s,l=o?null:i.rightOffset()-a;if(!this._options.shiftVisibleRangeOnNewBar&&o){var c=i.indexToCoordinate(s)+i.barSpacing()/2+1,h=s-n.left()+a,u=c/h;if(u>=i.minBarSpacing())i.setBarSpacing(u),l=i.width()/u-h;else r.lastBar()!==s&&(l=i.rightOffset()-a)}null!==l&&i.setRightOffset(l)}i.setBaseIndex(e)}recalculatePane(e){e&&e.recalculate()}recalculateAllPanes(){for(var e=0;e<this._panes.length;++e)this._panes[e].recalculate();this.updateAllPaneViews(),this.crossHairSource().updateAllViews()}_invalidateBarColorerCaches(){for(var e=this.dataSources(),t=0;t<e.length;++t){var i=e[t];i instanceof I&&i.invalidateBarColorerCache()}}createStudyInserter(e){return new j(e,this._studiesMetaInfoRepository,{createStudy:this.insertStudyWithParams.bind(this)})}insertStudyWithParams(e,t,i,s,r,n,o,a,l,c,h){null==n&&(n=this.mainSeries());var u=null;if(!r&&void 0!==e.groupingKey){var d=this.findNonOverlayStudyWithGroupingKey(e.groupingKey);null!==d&&(u=d.pane)}null===u&&(r||e.is_price_study?u=this.paneForSource(n):(u=this.createPane(),void 0!==c&&u.setPaneSize(c))),"Compare@tv-basicstudies"===e.id&&this.m_mainSeries.priceScale().setMode({log:!1,percentage:!0});var p=Object.assign({},s,{inputs:t}),_=T(e,p,u,this.studyVersioning(),n),m=C(this,_,n,e,h);this._recalcVisibleRangeStudiesImpl({studies:[m],oldEndVisibleIndex:-1,oldStartVisibleIndex:-1,force:!0,timerId:null});var f=u.findSuitableScale(m,n,o);if(f===this.mainSeries().priceScale()&&W(m)){if(a){var g=H(m,f,this,!0);null!==g&&m.setCurrency(g)}if(l){var v=z(m,f,this,!0);null!==v&&m.setUnit(v)}}return W(m)&&u.hasDataSource(this.mainSeries())&&J&&this.properties().scalesProperties.showSymbolLabels.setValue(!0),m.start(),null!==i&&u.id()===i.paneId?u.insertDataSource(m,f,i.zorder):u.addDataSource(m,f),m.properties().linkedToSeries&&m.properties().linkedToSeries.value()&&m.setOwnerSource(this.mainSeries()),
|
||
this.recalculatePane(u),this.fullUpdate(),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudies(!0),this._studyInserted.fire(m),m}studyInserted(){return this._studyInserted}detachSource(e,t){var i=this.paneForSource(e);if(i)return i.removeDataSource(e),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,t),!0):(this.fullUpdate(),!1)}removeSource(e,t){this.selectionMacro((function(t){t.removeSourceFromSelection(e)})),this._sourcesBeingMoved.includes(e)&&(this._sourcesBeingMoved=this._sourcesBeingMoved.filter((function(t){return t!==e})),this._sourcesBeingMoved.length||(this._lineItemBeingMoved=null)),e===this._lineBeingEdited&&(this._lineBeingEdited=null,L.isToolEditingNow.setValue(!1)),e===this._lineBeingCreated&&(this._lineBeingCreated=null,L.isToolCreatingNow.setValue(!1)),e.stop&&e.stop();var i=this.detachSource(e,t);const s=this.mainSeries().priceScale();return P(e)&&W(e)&&e.priceScale()===s&&s.isPercentage()&&1===s.seriesLikeSources().length&&s.setMode({percentage:!1}),this.fullUpdate(),this._invalidateBarColorerCaches(),P(e)&&(U.emit("study_event",e.id(),"remove"),e.isChildStudy()&&e.source().unsetChild(e)),e.destroy&&e.destroy(),h(e)&&U.emit("drawing_event",e.id(),"remove"),i}_unmergeAvailable(e){return e===this.m_mainSeries||TradingView.isInherited(e.constructor,S)&&!e.isLinkedToSeries()&&!TradingView.isInherited(e.constructor,y)&&e.showInObjectTree()}isMergeUpAvailableForSource(e){return!!this._unmergeAvailable(e)&&this.paneForSource(e)!==this.panes()[0]}isMergeDownAvailableForSource(e){if(!this._unmergeAvailable(e))return!1;var t=this.paneForSource(e),i=this.panes();return t!==i[i.length-1]}isUnmergeAvailableForSource(e){return!!this._unmergeAvailable(e)&&this.paneForSource(e).dataSources().filter(this._unmergeAvailable,this).length>1}lineBeingEdited(){return this._lineBeingEdited}linePointBeingEdited(){return this._linePointBeingEdited}calculateDefaultTags(){for(var e=[],t=this.dataSources(),i=0;i<t.length;i++){var s=t[i];s.tags&&(e=e.concat(s.tags()))}return e}changeZOrder(e,t){this.paneForSource(e).changeZOrder(e,t),this.fullUpdate()}_sendTo(e,t){var i={},s=this;for(var r in e.forEach((function(e){var t=s.paneForSource(e),r=s._panes.indexOf(t);i[r]||(i[r]=[]),i[r].push(e)})),i){t(s._panes[r],i[r])}this.fullUpdate()}sendToBack(e){this._sendTo(e,(function(e,t){e.sendToBack(t)}))}bringToFront(e){this._sendTo(e,(function(e,t){e.bringToFront(t)}))}clearAllStudies(){for(var e=this.dataSources(),t=0;t<e.length;t++)e[t].clearData&&e[t].clearData()}allLineTools(){return this._getAllSources(h)}getStudyById(e){var t=this.dataSourceForId(e);return null!==t&&P(t)?t:null}getLineToolById(e){var t=this.dataSourceForId(e);return null!==t&&h(t)?t:null}getStudyById(e){var t=this.dataSourceForId(e);return t instanceof S?t:null}backgroundCounterColor(){var e=this.backgroundColor().value();if(void 0===this._lastBackgroundColor||void 0===this._lastOriginalColor||e!==this._lastBackgroundColor){var t=l(a(e),150);this._lastBackgroundColor=e,
|
||
this._lastOriginalColor="black"===t?"white":"black"}return this._lastOriginalColor}isDark(){return"white"===this.backgroundCounterColor()}_initAlertsList(){throw new Error("Not implemented")}_addAlertLabelToChart(e){throw new Error("Not implemented")}_removeAlertLabelFromChart(e){throw new Error("Not implemented")}_removeAllAlertLabelsFromChart(){throw new Error("Not implemented")}getAlertsList(){return Promise.resolve(null)}resetAlertList(){}setInterval(e,t){var i=setInterval(e,t);return this._modelIntervals.push(i),i}clearInterval(e){clearInterval(e);var t=this._modelIntervals.indexOf(e);t>-1&&this._modelIntervals.splice(t,1)}clearIntervals(){for(var e=0;e<this._modelIntervals.length;e++)clearInterval(this._modelIntervals[e]);this._modelIntervals=[]}destroy(){this.mainSeries().properties().childs().showCountdown.unsubscribeAll(this),this.mainSeries().onTimeFrameApplied().unsubscribeAll(this),this._appliedTimeFrame.destroy();for(var e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();this.clearIntervals(),L.hideAllDrawings().unsubscribe(this,this._onDrawingsVisibilityChanged),L.hideAllIndicators().unsubscribe(this,this._onIndicatorsVisibilityChanged),this.resetDeferredStudies();for(e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(e=0;e<this._panes.length;e++)this._panes[e].destroy();this._panes.length=0,this._sessions=null,this.m_mainSeries.onStyleChanged().unsubscribe(this._timeScale,this._timeScale.invalidateVisibleBars),this._timeScale.visibleBarsStrictRangeChanged().unsubscribe(this.m_mainSeries,this.m_mainSeries.clearHighLowAvgPriceCache),this._timeScale.destroy(),F.unsubscribe(this,this._updateDateTimeFormatter),this.mainSeries().properties().interval.unsubscribe(this,this._updateDateTimeFormatter),this._trendLineStatsCache&&this._trendLineStatsCache.destroy(),this._fibRetracementLabelsCache&&this._fibRetracementLabelsCache.destroy(),this._properties.paneProperties.legendProperties.showLegend.unsubscribeAll(this),this._dataSourceCollectionChanged.unsubscribeAll(this),super.destroy()}countUserStudies(e){var t=0;e=e||{};for(var i=0;i<this._panes.length;i++)for(var s=this._panes[i].dataSources(),r=0;r<s.length;r++){var n=s[r];if(P(n)&&!x(n)&&n.showInObjectTree()){var o=n.metaInfo&&n.metaInfo();if(o){var a=o.id;if(e.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(e.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(e.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}t++}}return t}isJustClonedChart(){return this._undoModel.isJustClonedChart()}restoreSource(e,t,i,s,r){var n,o;n=e?this.createPane(t):this.panes()[t];var a=s.type.toLowerCase().startsWith("study");if(!(o=a?n.restoreStudy(s):n.restoreLineTool(s)))return null;var l=null;s.ownerSource&&(l=n.dataSourceForId(s.ownerSource)),o.setOwnerSource(l);var c=null;if(r?c=n.getPriceScaleById(r.id):o.ownerSource()&&(c=o.ownerSource().priceScale()),c)o.setPriceScale(c),c.addDataSource(o);else{c=n.createPriceScaleAtPosition(r.position,r.priceScaleIndex);r&&r.id&&c.setId(r.id),
|
||
o.setPriceScale(c),c.addDataSource(o)}if(!e&&i&&i.overlayPriceScales){var h=this.dataSources().filter((function(e){return void 0!==i.overlayPriceScales[e.id()]}));h.forEach((function(e){var t=e.priceScale();-1!==t.dataSources().indexOf(e)&&t.removeDataSource(e),0===t.dataSources().length&&n.removePriceScale(t)}));var u=new Map;h.forEach((function(e){var t,s=i.overlayPriceScales[e.id()];u.has(s.id)?t=u.get(s.id):((t=n.createPriceScaleAtPosition("overlay")).restoreState(s),u.set(s.id,t)),t.addDataSource(e),e.setPriceScale(t)}))}return o.start(),o.restore&&o.restore(),e&&n.restoreState(i),a&&(this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.fullUpdate()),o}restoreLineToolState(e,t){e.restorePoints(t.points,t.indexes||[]),e.properties().merge(t.state),e.restoreData&&e.restoreData(t),e.createServerPoints(),this.fullUpdate(),e.linkKey&&L.restoreLineToolState({model:this,linkKey:e.linkKey,state:t})}onChartThemeLoaded(){return this._chartThemeLoaded}chartThemeLoaded(){this._chartThemeLoaded.fire()}selectBarMode(){return this.m_crossHairSource.selectBarMode()}toggleSelectBarMode(){this.m_crossHairSource.toggleSelectBarMode()}onBarSelected(){return this.m_crossHairSource.onBarSelected()}isSeriesStyleSupported(e){return this.m_mainSeries.isStyleSupported(e)}getStudyShiftColorStartOffset(){return this._studyShiftColorStartOffset}setStudyShiftColorStartOffset(e){this._studyShiftColorStartOffset=e}isInReplay(){return this.m_mainSeries.isInReplay()}onInReplayStateChanged(){return new s}switchToReplay(e,t){0}switchToRealtime(){0}rendererOptionsProvider(){return this._rendererOptionsProvider}priceAxisRendererOptions(){return this._rendererOptionsProvider.options()}magnet(){return this._magnet}isPriceScaleVisible(e){var t=this.paneForSource(e.mainSource()),i=t.priceScalePosition(e);if("overlay"===i)return!0;var s=this.priceScaleSlotsCount();return t.priceScaleIndex(e,i)<s[i]}studyMetaInfoRepository(){return this._studiesMetaInfoRepository}studiesColorRotatorFactory(){return this._studyColorRotatorFactory}}e.exports=ee}).call(this,i("tc+8"),i("aIyQ"))},cXAR:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesDataWindowView",(function(){return p}));var s=i("4miz"),r=i("xDuj"),n=i("qFKp"),o=i("mMWL"),a=i("Kxc7"),l=i.n(a),c=i("6I19"),h=i("CW80");const u=n.CheckMobile.any(),d=l.a.enabled("hide_resolution_in_legend");class p extends s.b{constructor(e,t){super(),this._invalidated=!0,this._series=e,this._model=t,this._valuesProvider=this._createValuesProvider(e,t),this._items=this._valuesProvider.getItems().map(e=>new s.a(e.title,"")),this.update()}update(){this._invalidated=!0}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}_updateImpl(){const e=this._series.symbolInfo();if(e){const t=[e.name];d||t.push(Object(r.translatedIntervalString)(this._series.interval())),t.push(e.exchange),this._header=t.join(", "),this._title=e.description}else this._header=this._series.symbol();const t=this._model.crossHairSource().appliedIndex(),i=this._valuesProvider.getValues(t)
|
||
;for(let s=0;s<i.length;++s){const e=i[s],t=this._items[s];t.setValue(e.value),t.setVisible(e.visible),t.setColor(e.color)}}_createValuesProvider(e,t){return new c.a(e,t)}_showLastPriceAndChangeOnly(){return u&&(null===this._model.crossHairSource().pane||Object(h.isLineToolName)(o.tool.value())||null!==this._model.lineBeingEdited())}}},cZRT:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(){this._retries=5,this._cache=null,this._tryLoad=e=>{this._retries=this._retries-1;this._startLoading().then(e,0!==this._retries?()=>setTimeout(()=>this._tryLoad(e),3e3):void 0)}}load(){return this._cache||(this._cache=new Promise(this._tryLoad)),this._cache}}},cdbK:function(e,t,i){"use strict";function s(e){return Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(15),i.e(19),i.e(30),i.e(43),i.e(44),i.e(48),i.e(49),i.e(80),i.e(0),i.e(5),i.e(4),i.e(10),i.e(14),i.e(12),i.e(17),i.e(27),i.e(40),i.e(45),i.e("go-to-date-dialog-impl")]).then(i.bind(null,"uUY/")).then(t=>t.showGoToDateDialog(e))}i.r(t),i.d(t,"showGoToDateDialog",(function(){return s}))},cgFQ:function(e,t,i){"use strict";var s=i("Tmoa"),r=i("ikwP");const n=/[1-9]/g;class o{constructor(){this._data=null}setData(e){this._data=e}draw(e,t,i){if(null===this._data||!this._data.visible||0===this._data.text.length)return;const s=this._data;e.font=t.font;const o=Math.round(t.widthCache.measureText(e,s.text,n));if(o<=0)return;e.save();const a=t.paddingHorizontal,l=o+2*a,c=l/2;let h=s.coordinate,u=Math.floor(h-c)+.5;if(s.alwaysInViewPort){const e=s.width;u<0?(h+=Math.abs(0-u),u=Math.floor(h-c)+.5):u+l>e&&(h-=Math.abs(e-(u+l)),u=Math.floor(h-c)+.5)}const d=u+l,p=Math.ceil(0+t.borderSize+t.tickLength+t.paddingTop+t.fontSize+t.paddingBottom);e.fillStyle=s.background;const _=Math.round(u*i),m=Math.round(0*i),f=Math.round(d*i),g=Math.round(p*i),v=Math.round(2*i);e.beginPath(),e.moveTo(_,m),e.lineTo(_,g-v),e.arcTo(_,g,_+v,g,v),e.lineTo(f-v,g),e.arcTo(f,g,f,g-v,v),e.lineTo(f,m),e.fill();const b=Math.round(s.coordinate*i),S=m,y=Math.round((S+t.tickLength)*i);e.fillStyle=s.color;const w=Math.max(1,Math.floor(i)),C=Math.floor(.5*i);e.fillRect(b-C,S,w,y-S);const P=0+t.borderSize+t.tickLength+t.paddingTop+t.fontSize/2;e.textAlign="left",e.textBaseline="middle",e.fillStyle=s.color;const x=t.widthCache.yMidCorrection(e,"Apr0");e.translate((u+a)*i,(P+x)*i),Object(r.drawScaled)(e,i,()=>e.fillText(s.text,0,0)),e.restore()}}i.d(t,"a",(function(){return a}));class a{constructor(e){this._renderer=new o,this._rendererData={background:"",color:"",coordinate:0,text:"",visible:!1,width:0,alwaysInViewPort:!0},this._invalidated=!0,this._model=e,this._renderer.setData(this._rendererData)}update(){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}coordinate(){return this._rendererData.coordinate}_getAlwaysInViewPort(){return!0}_updateImpl(){const e=this._rendererData;if(e.visible=!1,this._model.timeScale().isEmpty())return;const t=this._getIndex();if(null===t)return
|
||
;e.visible=!0,e.width=this._model.timeScale().width(),e.background=this._getBgColor(),e.color=Object(s.colorFromBackground)(e.background),e.coordinate=this._model.timeScale().indexToCoordinate(t),e.alwaysInViewPort=this._getAlwaysInViewPort();const i=this._model.timeScale().indexToUserTime(t);e.text=null!==i?this._model.dateTimeFormatter().format(i):"",this._invalidated=!1}}},d700:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return n}));var s=i("/3z9");function r(e){if("INPUT"===e.tagName){const t=e.type;return"text"===t||"email"===t||"number"===t||"password"===t||"search"===t||"tel"===t||"url"===t}return"TEXTAREA"===e.tagName||e.isContentEditable}function n(e,t){if(!t)return!1;const i=255&e;if(27===i||i>>>4==7)return!1;switch(e^i){case s.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||r(t);case s.Modifiers.Alt+s.Modifiers.Shift:return r(t);case s.Modifiers.Mod:if(67===i||!s.isMacKeyboard&&45===i){const e=t.ownerDocument&&t.ownerDocument.getSelection();if(e&&!e.isCollapsed)return!0}return r(t);case s.Modifiers.Mod+s.Modifiers.Shift:return i>=33&&i<=40&&r(t);case s.Modifiers.Shift:case 0:return!!(9!==i||t.ownerDocument&&t!==t.ownerDocument.body&&t!==t.ownerDocument.documentElement)&&((13===i||32===i||!function(e){if("BUTTON"===e.tagName)return!0;if("INPUT"===e.tagName){const t=e.type;if("submit"===t||"button"===t||"reset"===t||"checkbox"===t||"radio"===t)return!0}return!1}(t))&&("form"in t||t.isContentEditable))}return!1}},dDSx:function(e,t,i){"use strict";(function(e){var s=i("CW80").isLineTool,r=i("Ss5c").LineDataSource,n=i("FIi8").deepExtend,o=i("//lZ").doAnimate,a=i("onDC").ChartUndoModelBase,l=i("Ocx9").saveDefaultProperties,c=i("GVHu").Study,h=i("8sOK").StudyStub,u=i("vwKG").showTooManyStudiesNotice,d=i("RDU5").UndoCommand,p=i("Ltzl").SaveLineToolStateUndoCommand,_=i("YlKu").ApplyLineToolTemplateUndoCommand,m=i("s9sR").SetResolutionUndoCommand,f=i("8C8C").RestoreFactoryDefaultsUndoCommand,g=i("FKaq").SetPriceScaleSelectionStrategyCommand,v=i("CsKN").SetScaleRatioPropertiesCommand,b=i("/YGI").StudyInserter,S=i("JWMC").trackEvent,y=i("txPx").getLogger("Chart.ChartUndoModel"),w=i("QTwd").RestoreDefaultsPreferencesUndoCommand,C=i("bJYc").SetPropertyUndoCommand,P=i("pOzK").SetPriceScaleModeCommand,x=i("7MWe").PriceScaleChangeUndoCommand,T=i("LxhU").Interval;class M extends d{constructor(e,t,i){super("Move "+t[0].title()+" "+(i>0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map((function(e){return e.id()})),this._shift=i}undo(){var e=this,t=this._sourcesIds.map((function(t){return e._model.dataSourceForId(t)}));this._shift<0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,-e._shift)}))}redo(){var e=this,t=this._sourcesIds.map((function(t){return e._model.dataSourceForId(t)}));this._shift>0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,e._shift)}))}}class I extends d{constructor(e,t,i){super("Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),
|
||
this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),this._newSessionProps=t.sessions||TradingView.factoryDefaults("sessions"),["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor})),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=n({},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showBidAskLabels,delete this._newChartProps.scalesProperties.showPrePostMarketPriceLabel,delete this._newChartProps.scalesProperties.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,delete this._newChartProps.scalesProperties.seriesLastValueMode,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=n({},this._newSeriesProps,t.mainSourceProperties),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.mainSeries().properties().state(),this._oldSessionsProps=this._model.sessions().properties().state(),i||(delete this._oldSeriesProps.style,delete this._oldSeriesProps.symbol,delete this._oldSeriesProps.interval,delete this._oldSeriesProps.extendedHours,delete this._newSeriesProps.style,delete this._newSeriesProps.symbol,delete this._newSeriesProps.interval,delete this._newSeriesProps.currencyId,delete this._newSeriesProps.unitId,delete this._newSeriesProps.extendedHours,delete this._newSeriesProps.showCountdown,delete this._newSeriesProps.bidAsk.visible,delete this._newSeriesProps.prePostMarket.visible,delete this._newSeriesProps.highLowAvgPrice)}_merge(e,t,i){var s=this._model;l(!0),e&&(s.properties().paneProperties.mergeAndFire(e.paneProperties),s.properties().scalesProperties.mergeAndFire(e.scalesProperties)),s.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),
|
||
s.mainSeries().properties().mergeAndFire(t),s.mainSeries().properties().saveDefaults(),s.mainSeries().createPaneView(),s.mainSeries().invalidateBarStylesCache(),s._version=t.version,s.recalculateAllPanes(),s.fullUpdate(),s.properties().saveDefaults(),s.sessions().restoreState({properties:i}),l(!1)}undo(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()}redo(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()}}class L extends d{constructor(e,t){super("Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}redo(){delete this._model.dataSourceForId(this._sourceId).linkKey}undo(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey}}t.ChartUndoModel=class extends a{constructor(t,i,s,r,n,o,a,l,c){super(t,i,s,r,n,o,a,l,c),this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this.beginUndoMacro=a.beginUndoMacro.bind(a),this.endUndoMacro=a.endUndoMacro.bind(a),this.createUndoCheckpoint=a.createUndoCheckpoint.bind(a),this.undoToCheckpoint=a.undoToCheckpoint.bind(a)}version(){return this.m_model._version}onData(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.baseIndex,t.marks,t.clear);break;case"timescale_completed":var i=e.params[0];this.m_model.timeScale().onTimeScaleCompleted(i)}}paneForSource(e){return this.m_model.paneForSource(e)}createPane(e){return this.m_model.createPane(e)}readOnly(){return this.m_model.readOnly()}restart(){this.m_model.restart()}disconnect(){this.m_model.disconnect()}studiesMetaData(){return this.m_model.studiesMetaData()}studyVersioning(){return this.m_model.studyVersioning()}chartModel(){return this._model()}_model(){return this.m_model}pushUndoCommand(e){this._pushUndoCommand(e)}_pushUndoCommand(e){this._undoHistory.pushUndoCommand(e)}startScrollPrice(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))}scrollPriceTo(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new x(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))}endScrollPrice(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))}setPriceAutoScale(e,t,i){this.pushUndoCommand(new x(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)}setWidth(e){this.m_model.setWidth(e)}setPaneHeight(e,t){this.m_model.setPaneHeight(e,t)}gridSource(){return this.m_model.gridSource()}watermarkSource(){return this.m_model.watermarkSource()}addAlertsSource(e){return this.m_model.addAlertsSource(e)}alertsSources(){
|
||
return this.m_model.alertsSources()}publishedChartsTimelineSource(){return this.m_model.publishedChartsTimelineSource()}barsMarksSources(){return this.m_model.barsMarksSources()}crossHairSource(){return this.m_model.crossHairSource()}model(){return this.m_model}chartWidget(){return this._chartWidget}mainSeries(){return this.m_model.m_mainSeries}mainSeriesScaleRatioProperty(){return this.m_model.mainSeriesScaleRatioProperty()}panes(){return this.m_model.panes()}timeScale(){return this.m_model.timeScale()}selectionMacro(e){return this.m_model.selectionMacro(e)}setHoveredSource(e,t){this.m_model.setHoveredSource(e,t)}selection(){return this.m_model.selection()}onSelectedSourceChanged(){return this.m_model.onSelectedSourceChanged()}hoveredSource(){return this.m_model.hoveredSource()}activeStrategySource(){return this.m_model.activeStrategySource()}invalidate(e){this.m_model.invalidate(e)}setCurrentPosition(e,t,i,s){this.m_model.setCurrentPosition(e,t,i,s)}setAndSaveCurrentPosition(e,t,i,s){this.m_model.setAndSaveCurrentPosition(e,t,i,s)}canCreateStudy(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)}_isCountedStudy(e){throw new Error("Not implemented")}checkIfFeatureAvailable(e,t){var i=this.canCreateStudy(),s=t&&t instanceof c;return!this.readOnly()&&s&&(i=this.canCreateStudy(!0)),!!i||(s||u(),!1)}insertStudyWithoutCheck(e){return this._insertStudy(e)}createStudyInserter(e,t,i){var s=this,r=null,n={createStudy:function(e,t,i,n,o,a,l,c,h,u,d){return s.checkIfFeatureAvailable(e,a)?(S("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&S("compare","symbol:"+t.symbol),s._insertStudy(e,t,n,o,a,l,c,h,u,r,d)):(y.logNormal("Cannot insert study "+e.id),null)}};void 0!==i&&(n.createStub=function(){var e=s.m_model.insertStudyStub(i);return r={targetPaneId:s.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},n.removeStub=function(e){return s.m_model.removeStudyStub(e)});var o=new b(e,this.m_model._studiesMetaInfoRepository,n);return o.setParentSource(t),o}setProperty(e,t,i,s){if(e&&e.value()!==t){var r=new C(e,t,i,this.m_model,s);this.pushUndoCommand(r),this.emitEvent("setProperty")}}setProperties(e,t,i){var s=this;this.beginUndoMacro(i),this.m_model.selectionMacro((function(){for(var r=0;r<e.length;r++)s.setProperty(e[r],t[r],i)})),this.endUndoMacro()}setPriceScaleMode(e,t,i){for(var s=Object.keys(e),r=t.mode(),n=!1,o=0;o<s.length;o++)if(r[s[o]]!==e[s[o]]){n=!0;break}if(n){var a=new P(e,t,i,this.m_model);this.pushUndoCommand(a)}}setPriceScaleSelectionStrategy(e){if(this.m_model.properties().priceScaleSelectionStrategyName.value()!==e){S("Chart","Change PriceScale Selection Strategy");var t="Set Price Scale Selection Stretegy to "+e;this.beginUndoMacro(t),this.setProperty(this.m_model.properties().priceScaleSelectionStrategyName,e,t);var i=new g(this.m_model,e,t);this.pushUndoCommand(i),this.endUndoMacro()}}setScaleRatioProperty(e,t,i){if(e.value()!==t){var s=new v(e,t,i,this.m_model);this.pushUndoCommand(s)}}setResolutionProperty(e,t,i,s){if(!T.isEqual(e.value(),t)){var r=new m(e,t,i,s)
|
||
;this.pushUndoCommand(r)}}lineBeingCreated(){return this.m_model.lineBeingCreated()}paneBeingCreatedLineOn(){return this.m_model.paneBeingCreatedLineOn()}cancelCreatingLine(){this.m_model.cancelCreatingLine()}lineCancelled(){return this.m_model.lineCancelled()}lineBeingEdited(){return this.m_model.lineBeingEdited()}sourcesBeingMoved(){return this.m_model.sourcesBeingMoved()}dataSources(){return this.m_model.dataSources()}orderedDataSources(e){return this.m_model.orderedDataSources(e)}dataSourceForId(e){return this.m_model.dataSourceForId(e)}state(e,t,i,s){return this.m_model.state(e,t,i,s)}asyncState(){return this.m_model.asyncState()}calculateDefaultTags(){return this.m_model.calculateDefaultTags()}onTagsChanged(){return this.m_model.onTagsChanged()}changeZOrder(e,t){var i=new M(this.m_model,e,t);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[e,t])}_removeAllStudiesImpl(){for(var e=this.m_model.dataSources(),t=0;t<e.length;t++){var i=e[t];(TradingView.isInherited(i.constructor,c)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,h))&&this.removeSource(i)}}removeAllStudies(){this.beginUndoMacro(window.t("Remove all studies")),this._removeAllStudiesImpl(),this.endUndoMacro()}_removeAllDrawingToolsImpl(e){var t=this;this.selectionMacro((function(){t.lineBeingCreated()&&t.cancelCreatingLine();for(var i=t.dataSources(),s=0;s<i.length;s++){var n=i[s];TradingView.isInherited(n.constructor,r)&&n.isActualSymbol()&&n.isUserDeletable()&&(e&&e!==n.toolname||t.removeSource(n))}}))}removeAllDrawingTools(e){this.beginUndoMacro(window.t("Remove Drawings")),this._removeAllDrawingToolsImpl(),this.endUndoMacro()}removeAllStudiesAndDrawingTools(){this.beginUndoMacro(window.t("Remove all studies and drawing tools")),this._removeAllDrawingToolsImpl(),this._removeAllStudiesImpl(),this.endUndoMacro()}unlinkLines(e){this.beginUndoMacro("Stop syncing line tool(s)");var t=this.m_model,i=this;e.forEach((function(e){var s=new L(t,e);i.pushUndoCommand(s)})),this.endUndoMacro()}moveLeft(){try{this.beginUndoMacro("Move Left")}catch(i){return}var e=this.m_model.timeScale().width(),t=this;o({to:e/5,onStep:function(e){t.startScrollTime(e),t.scrollTimeTo(0),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})}moveRight(){try{this.beginUndoMacro("Move Right")}catch(i){return}var e=this.m_model.timeScale().width(),t=this;o({to:e/5,onStep:function(e){t.startScrollTime(0),t.scrollTimeTo(e),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})}scrollChart(e){this.m_model.scrollEnabled()&&(this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime())}scrollChartByBar(e){if(this.m_model.scrollEnabled()){var t=e*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime()}}resetScales(){this.beginUndoMacro("Reset scales"),this.resetTimeScale(),this.panes().forEach((function(e){e.leftPriceScales().forEach((function(t){this.resetPriceScale(e,t)}),this),e.rightPriceScales().forEach((function(t){this.resetPriceScale(e,t)}),this)}),this),
|
||
this.endUndoMacro(),this.m_model.recalculateAllPanes()}_restoreFactoryDefaults(e){var t=new f(this.m_model,e);this.pushUndoCommand(t)}_restoreLineToolFactoryDefaults(e){var t="Load default drawing template";this.beginUndoMacro(t),this.saveLineToolState(e,t);var i=new f(this.m_model,e.properties(),t);this.pushUndoCommand(i),this.saveLineToolState(e,t),this.endUndoMacro(),this.model().updateSource(e)}restorePropertiesForSource(e){s(e)?this._restoreLineToolFactoryDefaults(e):this._restoreFactoryDefaults(e.properties())}restorePreferences(){var e=new w(this.model());this.pushUndoCommand(e)}applyPreferences(e){throw new Error("Not implemented")}chartLoadTheme(e,t,i,s){var r=new I(e,t,i);s?r.redo():this.pushUndoCommand(r)}applyLineToolTemplate(e,t,i){this.beginUndoMacro(i),this.saveLineToolState(e,i);var s=new _(e,t,i);this.pushUndoCommand(s),this.saveLineToolState(e,i),this.endUndoMacro(),this.model().updateSource(e)}onSimpleZoomIn(){return this._onSimpleZoomIn}onSimpleZoomOut(){return this._onSimpleZoomOut}getAlertsList(){return this.m_model.getAlertsList()}isJustClonedChart(){return this._chartWidget.isJustClonedChart()}trackTime(){return this._chartWidget.trackTime()}isInReplay(){return this.m_model.isInReplay()}switchToReplay(e,t){}switchToRealtime(){}saveLineToolState(e,t){this.pushUndoCommand(new p(this.m_model,[e],t))}togglePriceScaleAutoScaleMode(e){var t={autoScale:!e.isAutoScale()};this.setPriceScaleMode(t,e,"Auto Scale")}togglePriceScaleLockScaleMode(e){var t={lockScale:!e.isLockScale()};this.setPriceScaleMode(t,e,"Lock Scale")}setPriceScaleRegularScaleMode(e){this.setPriceScaleMode({log:!1,percentage:!1,indexedTo100:!1},e,"Regular")}togglePriceScaleIndexedTo100ScaleMode(e){var t={indexedTo100:!e.isIndexedTo100()};this.setPriceScaleMode(t,e,"Indexed to 100")}togglePriceScalePercentageScaleMode(e){var t={percentage:!e.isPercentage()};this.setPriceScaleMode(t,e,"Percent")}togglePriceScaleLogScaleMode(e){var t={log:!e.isLog()};this.setPriceScaleMode(t,e,"Logarithmic")}invertPriceScale(e){var t=e.properties().isInverted;this.setProperty(t,!t.value(),"Invert Scale")}removePane(e){var t=this.m_model.panes()[e].dataSources().slice();this.removeSources(t,!1,"Remove pane")}destroy(){this.model().destroy()}}}).call(this,i("aIyQ"))},dOnf:function(e,t,i){"use strict";function s(e){let t;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if(e instanceof Date)t=new Date(e.valueOf());else if(Array.isArray(e)){t=[];let i=0;const r=e.length;for(;i<r;i++)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=s(e[i]))}else{t={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=s(e[i]))}return t}i.r(t),i.d(t,"deepCopy",(function(){return s}))},dTSQ:function(e,t,i){"use strict";function s(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}i.r(t),i.d(t,"regExpEscape",(function(){return s}))},"dUJ+":function(e,t,i){"use strict";i.r(t),i.d(t,"replaceGraphicsTimesWithTimePointIndexIndex",(function(){return n}))
|
||
;const s=new Map([["horizlines",e=>[e.startIndex,e.endIndex]],["hhists",e=>[e.firstBarTime,e.firstBarTime]],["vertlines",e=>[e.index]]]),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)}]]);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}},dfhE:function(e,t,i){"use strict";i.r(t),i.d(t,"STATUS_OFFLINE",(function(){return s})),i.d(t,"STATUS_RESOLVING",(function(){return r})),i.d(t,"STATUS_LOADING",(function(){return n})),i.d(t,"STATUS_READY",(function(){return o})),i.d(t,"STATUS_INVALID_SYMBOL",(function(){return a})),i.d(t,"STATUS_SNAPSHOT",(function(){return l})),i.d(t,"STATUS_EOD",(function(){return c})),i.d(t,"STATUS_PULSE",(function(){return h})),i.d(t,"STATUS_DELAYED",(function(){return u})),i.d(t,"STATUS_DELAYED_STREAMING",(function(){return d})),i.d(t,"STATUS_NO_BARS",(function(){return p})),i.d(t,"STATUS_REPLAY",(function(){return _})),i.d(t,"SERIES_STATUS_TEXT",(function(){return m})),i.d(t,"STYLE_LINE_TYPE_MARKERS",(function(){return f})),i.d(t,"STYLE_LINE_TYPE_STEP",(function(){return g})),i.d(t,"STYLE_LINE_TYPE_SIMPLE",(function(){return v})),i.d(t,"STYLE_BARS",(function(){return b})),i.d(t,"STYLE_CANDLES",(function(){return S})),i.d(t,"STYLE_LINE",(function(){return y})),i.d(t,"STYLE_AREA",(function(){return w})),i.d(t,"STYLE_RENKO",(function(){return C})),i.d(t,"STYLE_KAGI",(function(){return P})),i.d(t,"STYLE_PNF",(function(){return x})),i.d(t,"STYLE_PB",(function(){return T})),i.d(t,"STYLE_HEIKEN_ASHI",(function(){return M})),i.d(t,"STYLE_HOLLOW_CANDLES",(function(){return I})),i.d(t,"STYLE_BASELINE",(function(){return L})),i.d(t,"STYLE_RANGE",(function(){return O})),i.d(t,"STYLE_HILO",(function(){return A})),i.d(t,"STYLE_SHORT_NAMES",(function(){return E})),i.d(t,"SYMBOL_STRING_DATA",(function(){return k}));const s=0,r=1,n=2,o=3,a=4,l=5,c=6,h=7,u=8,d=9,p=10,_=11,m={[s]:"connecting",[r]:"loading",[n]:"loading",[o]:"realtime",[a]:"invalid",[l]:"snapshot",[c]:"endofday",[h]:"endofday",[u]:"delayed",[d]:"delayed_streaming",[p]:"forbidden",[_]:"replay"},f=0,g=1,v=2,b=0,S=1,y=2,w=3,C=4,P=5,x=6,T=7,M=8,I=9,L=10,O=11,A=12,E={0:"bar",1:"candle",9:"hollowCandle",2:"line",3:"area",4:"renko",7:"pb",5:"kagi",6:"pnf",8:"ha",10:"baseline",11:"range",12:"hilo"},k={4:{type:"BarSetRenko@tv-prostudies",basicStudyVersion:40},7:{type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},5:{type:"BarSetKagi@tv-prostudies",basicStudyVersion:34},6:{type:"BarSetPnF@tv-prostudies",basicStudyVersion:34},8:{type:"BarSetHeikenAshi@tv-basicstudies",
|
||
basicStudyVersion:60},11:{type:"BarSetRange@tv-basicstudies",basicStudyVersion:72}}},di4O:function(e,t,i){"use strict";i.r(t),i.d(t,"watermarkProperty",(function(){return h})),i.d(t,"restoreWatermarkPropertyDefaults",(function(){return u}));var s=i("eJTA"),r=i("Vdly"),n=i("tc+8"),o=i.n(n);const a={visibility:!1,color:"rgba(80, 83, 94, 0.25)"};function l(){const e=r.getJSON("symbolWatermark");let t=Object.assign({},a,e);if(void 0===e){if(void 0!==r.getJSON("chartproperties")){const e=r.getJSON("chartproperties").symbolWatermarkProperties;if(void 0!==e){const i=Object(s.tryParseRgba)(e.color);t=Object.assign(t,e),null!==i&&(0!==i[3]?t.visibility=!0:(i[3]=.25,t.color=Object(s.rgbaToString)(i)))}}delete t.transparency}return t}let c=null;function h(){return null===c&&(c=new o.a(l()),r.onSync.subscribe(null,()=>{null!==c&&c.mergeAndFire(l())}),c.listeners().subscribe(null,()=>{null!==c&&r.setJSON("symbolWatermark",c.state())})),c}function u(){null!==c&&c.mergeAndFire(a)}},dmHa:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="currentColor" d="M18.15 7.02A9.05 9.05 0 0014 6c-3.45 0-6.08 2-7.8 3.92a18.18 18.18 0 00-2.64 3.84v.02h-.01L4 14l-.45-.21-.1.21.1.21L4 14l-.45.21.01.03a5.85 5.85 0 00.16.32c.11.2.28.51.5.87a18.18 18.18 0 002.4 3.12l.71-.71A17.18 17.18 0 014.56 14a10.05 10.05 0 01.52-.91c.41-.69 1.04-1.6 1.85-2.5C8.58 8.75 10.95 7 14 7a8 8 0 013.4.77l.75-.75zm-3.11 3.12a4 4 0 00-4.9 4.9l.86-.87V14a3 3 0 013.17-3l.87-.86zm1.96 3.7l.86-.88a4 4 0 01-4.9 4.9l.87-.86A3 3 0 0017 13.83zm-6.4 6.4A8 8 0 0014 21c3.05 0 5.42-1.76 7.07-3.58A17.18 17.18 0 0023.44 14a9.47 9.47 0 00-.52-.91 17.18 17.18 0 00-2.25-2.93l.7-.7a18.18 18.18 0 013.06 4.3l.02.02L24 14l.45.21-.01.03a7.03 7.03 0 01-.16.32c-.11.2-.28.51-.5.87-.44.72-1.1 1.69-1.97 2.65C20.08 20.01 17.45 22 14 22c-1.55 0-2.94-.4-4.15-1.02l.75-.75zM24 14l.45-.21.1.21-.1.21L24 14zM22.2 6.5L6.5 22.2l-.7-.7L21.5 5.8l.7.7z"/></svg>'},e1Hy:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("EYFt");class r extends s.a{constructor(e,t){super(e,t),this._showStudyValues=t.properties().paneProperties.legendProperties.showStudyValues}getValues(e){const t=super.getValues(e),i=this._showStudyValues.value();for(const s of t)s.visible=s.visible&&i;return t}}},e1ZQ:function(e,t,i){"use strict";i.d(t,"b",(function(){return p})),i.d(t,"a",(function(){return _})),i.d(t,"c",(function(){return m}));var s=i("YFKU"),r=i("kcTO");const n={1:()=>s.t("Jan"),2:()=>s.t("Feb"),3:()=>s.t("Mar"),4:()=>s.t("Apr"),5:()=>s.t("May"),6:()=>s.t("Jun"),7:()=>s.t("Jul"),8:()=>s.t("Aug"),9:()=>s.t("Sep"),10:()=>s.t("Oct"),11:()=>s.t("Nov"),12:()=>s.t("Dec")},o=(e,t)=>(t?e.getMonth():e.getUTCMonth())+1,a=(e,t)=>t?e.getFullYear():e.getUTCFullYear(),l=(e,t)=>Object(r.numberToStringWithLeadingZero)(((e,t)=>t?e.getDate():e.getUTCDate())(e,t),2),c=(e,t)=>n[o(e,t)](),h=(e,t)=>Object(r.numberToStringWithLeadingZero)(o(e,t),2),u=(e,t)=>Object(r.numberToStringWithLeadingZero)(a(e,t)%100,2),d=(e,t)=>Object(r.numberToStringWithLeadingZero)(a(e,t),4),p={
|
||
"dd MMM 'yy":(e,t)=>`${l(e,t)} ${c(e,t)} '${u(e,t)}`,"MMM dd, yyyy":(e,t)=>`${c(e,t)} ${l(e,t)}, ${d(e,t)}`,"MMM dd":(e,t)=>`${c(e,t)} ${l(e,t)}`,"yyyy-MM-dd":(e,t)=>`${d(e,t)}-${h(e,t)}-${l(e,t)}`,"yy-MM-dd":(e,t)=>`${u(e,t)}-${h(e,t)}-${l(e,t)}`,"yy/MM/dd":(e,t)=>`${u(e,t)}/${h(e,t)}/${l(e,t)}`,"yyyy/MM/dd":(e,t)=>`${d(e,t)}/${h(e,t)}/${l(e,t)}`,"dd-MM-yyyy":(e,t)=>`${l(e,t)}-${h(e,t)}-${d(e,t)}`,"dd-MM-yy":(e,t)=>`${l(e,t)}-${h(e,t)}-${u(e,t)}`,"dd/MM/yy":(e,t)=>`${l(e,t)}/${h(e,t)}/${u(e,t)}`,"dd/MM/yyyy":(e,t)=>`${l(e,t)}/${h(e,t)}/${d(e,t)}`,"MM/dd/yy":(e,t)=>`${h(e,t)}/${l(e,t)}/${u(e,t)}`,"MM/dd/yyyy":(e,t)=>`${h(e,t)}/${l(e,t)}/${d(e,t)}`},_=Object.keys(p),m=()=>-1!==["ja","ko","zh","zh_TW"].indexOf(window.language||"")?"yyyy-MM-dd":"dd MMM 'yy"},"e3/o":function(e,t,i){"use strict";i.r(t),i.d(t,"guid",(function(){return r})),i.d(t,"randomHash",(function(){return n})),i.d(t,"randomHashN",(function(){return o}));const s="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function n(){return o(12)}function o(e){let t="";for(let i=0;i<e;++i){const e=Math.floor(Math.random()*s.length);t+=s[e]}return t}},e92V:function(e,t,i){"use strict";i.r(t),i.d(t,"isStudyLineToolName",(function(){return r})),i.d(t,"isLineToolName",(function(){return n})),i.d(t,"isLineDrawnWithPressedButton",(function(){return o})),i.d(t,"isTextToolName",(function(){return a}));var s=i("OH2X");new Set([]);function r(e){return!1}function n(e){return e in s||!1}function o(e){return"LineToolBrush"===e||"LineToolHighlighter"===e}function a(e){switch(e){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":case"LineToolSignpost":return!0}return!1}},eJTA:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("ivNn");function r(e,t,i){return s.isNaN(t)||t<e?e:t>i?i:Math.round(t)}function n(e,t,i){return s.isNaN(t)||t<e?e:t>i?i:Math.round(1e4*t)/1e4}function o(e){return r(0,e,255)}function a(e){return r(0,e,255)}function l(e){return r(0,e,255)}function c(e){return n(0,e,1)}function h(e){return n(0,e,1)}function u(e){return n(0,e,1)}function d(e){return n(0,e,1)}function p(e){return n(0,e,1)}function _(e){return n(0,e,1)}function m(e){var t=e[0]/255,i=e[1]/255,s=e[2]/255,r=Math.min(t,i,s),n=Math.max(t,i,s),o=0,a=0,l=(r+n)/2;if(r===n)o=0,a=0;else{var c=n-r;switch(a=l>.5?c/(2-n-r):c/(n+r),n){case t:o=((i-s)/c+(i<s?6:0))/6;break;case i:o=((s-t)/c+2)/6;break;case s:o=((t-i)/c+4)/6}}return[o,a,l]}function f(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function g(e){var t,i,s,r=e[0],n=e[1],c=e[2];if(0===n)t=i=s=c;else{var h=c<.5?c*(1+n):c+n-c*n,u=2*c-h;t=f(u,h,r+1/3),i=f(u,h,r),s=f(u,h,r-1/3)}return[o(255*t),a(255*i),l(255*s)]}t.normalizeRedComponent=o,t.normalizeGreenComponent=a,t.normalizeBlueComponent=l,t.normalizeAlphaComponent=c,
|
||
t.rgb=function(e,t,i){return[o(e),a(t),l(i)]},t.areEqualRgb=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgba=function(e,t,i,s){if(Array.isArray(e)){var r=e;return s=t,[r[0],r[1],r[2],c(s)]}var n=t;return i=i||0,s=s||0,[o(e),a(n),l(i),c(s)]},t.areEqualRgba=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},t.normalizeHue=h,t.normalizeHslSaturation=u,t.normalizeHsvSaturation=d,t.normalizeLightness=p,t.normalizeValue=_,t.hsl=function(e,t,i){return[h(e),u(t),p(i)]},t.areEqualHsl=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.hsv=function(e,t,i){return[h(e),d(t),_(i)]},t.areEqualHsv=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgbToHsl=m,t.hslToRgb=g,t.rgbToHsv=function(e){var t=e[0],i=e[1],s=e[2],r=t/255,n=i/255,o=s/255,a=Math.min(r,n,o),l=Math.max(r,n,o),c=l-a,h=0,u=0===l?0:c/l,d=l;if(l===a)h=0;else switch(l){case t:h=((n-o)/c+(n<o?6:0))/6;break;case i:h=((o-r)/c+2)/6;break;case s:h=((r-n)/c+4)/6}return[h,u,d]},t.hsvToRgb=function(e){var t=e[0],i=e[1],s=e[2],r=Math.floor(6*t),n=6*t-r,c=s*(1-i),h=s*(1-n*i),u=s*(1-(1-n)*i),d=0,p=0,_=0;switch(r%6){case 0:d=s,p=u,_=c;break;case 1:d=h,p=s,_=c;break;case 2:d=c,p=s,_=u;break;case 3:d=c,p=h,_=s;break;case 4:d=u,p=c,_=s;break;case 5:d=s,p=c,_=h}return[o(255*d),a(255*p),l(255*_)]};var v=[.199,.687,.114];function b(e){return v[0]*e[0]+v[1]*e[1]+v[2]*e[2]}function S(e,t,i){void 0===i&&(i=.05);var s=m(e),r=s[0]+t*i;return s[0]=h(r-Math.floor(r)),g(s)}function y(e,t,i){void 0===i&&(i=.05);var s=e[0],r=e[1],n=e[2],o=e[3],a=S([s,r,n],t,i);return[a[0],a[1],a[2],o]}t.rgbToGrayscale=b,t.distanceRgb=function(e,t){var i=e[0],s=e[1],r=e[2],n=t[0]-i,o=t[1]-s,a=t[2]-r;return Math.sqrt(n*n+o*o+a*a)},t.invertRgb=function(e){return[255-e[0],255-e[1],255-e[2]]},t.darkenRgb=function(e,t){var i=m(e);return g([i[0],i[1],p(i[2]-t/100)])},t.blendRgba=function(e,t){var i=e[0],s=e[1],r=e[2],n=e[3],h=t[0],u=t[1],d=t[2],p=t[3],_=c(1-(1-p)*(1-n));return[o(h*p/_+i*n*(1-p)/_),a(u*p/_+s*n*(1-p)/_),l(d*p/_+r*n*(1-p)/_),_]},t.shiftRgb=S,t.shiftRgba=y,t.shiftColor=function(e,t,i){return void 0===i&&(i=.05),E(y(V(e),t,i))};var w,C,P,x,T={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",
|
||
fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function M(e,t){return t in e}function I(e){var t=w.re.exec(e);return null!==t?w.parse(t):null}function L(e){var t=C.re.exec(e);return null!==t?C.parse(t):null}function O(e){var t=P.re.exec(e);return null!==t?P.parse(t):null}function A(e){var t=x.re.exec(e);return null!==t?x.parse(t):null}function E(e){return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function k(e){if(e=e.toLowerCase(),M(T,e)){var t=L(T[e]);if(null!==t)return t;throw new Error("Invalid named color definition")}var i=I(e);if(null!==i)return i;var s=L(e);if(null!==s)return s;var r=O(e);if(null!==r)return r;var n=A(e);return null!==n?[n[0],n[1],n[2]]:null}function D(e){if(e=e.toLowerCase(),M(T,e)){var t=L(T[e]);if(null!==t)return[t[0],t[1],t[2],1];throw new Error("Invalid named color definition")}var i=I(e);if(null!==i)return[i[0],i[1],i[2],1];var s=L(e);if(null!==s)return[s[0],s[1],s[2],1];var r=O(e);if(null!==r)return[r[0],r[1],r[2],1];var n=A(e);return null!==n?n:null}function V(e){var t=D(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")}!function(e){
|
||
e.re=/^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,e.parse=function(e){return[o(parseInt(e[1],10)),a(parseInt(e[2],10)),l(parseInt(e[3],10))]}}(w||(w={})),t.rgbToString=function(e){return"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},function(e){e.re=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,e.parse=function(e){return[o(parseInt(e[1],16)),a(parseInt(e[2],16)),l(parseInt(e[3],16))]}}(C||(C={})),t.rgbToHexString=function(e){var t=e[0],i=e[1],s=e[2],r=t.toString(16),n=i.toString(16),o=s.toString(16);return"#"+(1===r.length?"0":"")+r+(1===n.length?"0":"")+n+(1===o.length?"0":"")+o},function(e){e.re=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,e.parse=function(e){return[o(parseInt(e[1]+e[1],16)),a(parseInt(e[2]+e[2],16)),l(parseInt(e[3]+e[3],16))]}}(P||(P={})),function(e){e.re=/^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?[\d]{0,10}(?:\.\d+)?)\s*\)$/,e.parse=function(e){return[o(parseInt(e[1],10)),a(parseInt(e[2],10)),l(parseInt(e[3],10)),c(parseFloat(e[4]))]}}(x||(x={})),t.rgbaToString=E,t.rgbToBlackWhiteString=function(e,t){if(t<0||t>255)throw new Error("invalid threshold value, valid values are [0, 255]");return b(e)>=t?"white":"black"},t.tryParseRgb=k,t.parseRgb=function(e){var t=k(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")},t.tryParseRgba=D,t.parseRgba=V},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",(function(){return s}));const s={ECONOMIC:"economic",QUANDL:"quandl"}},ehkz:function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var s=i("aO4+"),r=i("Eyy1"),n=i("Kxc7"),o=i("Tmoa"),a=i("o2pV"),l=i("k9/m"),c=i("VdBB"),h=i("23IT"),u=i("i6cO"),d=i("UAFa");class p{constructor(e,t,i,s){this._bars=[],this._invalidated=!1,this._isMarkersEnabled=n.enabled("source_selection_markers"),this._selectionData=null,this._ohlcPlotIndexes=new Map,this._study=e,this._series=t,this._model=i,this._plotName=s,this._isMarkersEnabled=n.enabled("source_selection_markers"),this._colorProvider=Object(d.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),s),this._selectionIndexer=new a.SelectionIndexes(i.timeScale());const r=this._study.metaInfo().plots;for(let n=0;n<r.length;n++){const e=r[n];"target"in e&&(e.target===this._plotName&&(Object(h.isOhlcOpenPlot)(e)&&this._ohlcPlotIndexes.set(1,n),Object(h.isOhlcHighPlot)(e)&&this._ohlcPlotIndexes.set(2,n),Object(h.isOhlcLowPlot)(e)&&this._ohlcPlotIndexes.set(3,n),Object(h.isOhlcClosePlot)(e)&&this._ohlcPlotIndexes.set(4,n)))}}update(){this._invalidated=!0}items(){return this._bars}_updateImpl(){this._bars.length=0;const e=this._study.priceScale();if(this._model.timeScale().isEmpty()||null===e||e.isEmpty())return;const t=this._model.timeScale().visibleBarsStrictRange();if(null===t)return;let i=this._series.nearestIndex(t.firstBar(),l.PlotRowSearchMode.NearestRight);const n=this._series.nearestIndex(t.lastBar(),l.PlotRowSearchMode.NearestLeft);if(void 0===i||void 0===n)return;const a=this._study.getMinFirstBarIndexForPlot(this._plotName);if(a>n)return
|
||
;i=Math.max(a,i);const h=this._study.data(),d=this._study.firstValue();if(null===d)return;const p=h.rangeIterator(i,n),_=this._study.properties().ohlcPlots[this._plotName],m=new Map,f=(e,t)=>{const i=e+"@"+t;if(!m.has(i)){const s=Object(o.generateColor)(e,t);return m.set(i,s),s}return m.get(i)},g=Object(u.createEmptyStyle)();for(;p.hasNext();){const e=p.next();let t=e.index;const i=e.value;t=Math.floor(t);let s=!0;const n=new Map;for(let r=1;r<=4;++r){const e=this._ohlcPlotIndexes.get(r);if(void 0===e){s=!1;break}const t=i[e+1];if(null==t){s=!1;break}n.set(r,t)}if(!s)continue;const o=Object(r.ensureDefined)(n.get(1)),a=Object(r.ensureDefined)(n.get(4)),l=Object(r.ensureDefined)(n.get(2)),c=Object(r.ensureDefined)(n.get(3)),h=Math.max(o,l,c,a),d=Math.min(o,l,c,a);let m=Object(r.ensureDefined)(f(_.color.value(),0));const v=this._colorProvider.getPlotPointStyle(i,g);void 0!==v.colors[u.ColorerType.Main]&&(m=Object(r.ensureDefined)(v.colors[u.ColorerType.Main]));const b={time:Math.round(t),open:o,high:h,low:d,close:a,color:m,wickColor:v.colors[u.ColorerType.Wick],borderColor:v.colors[u.ColorerType.Border],hollow:null};this._bars.push(b)}if(e.barPricesToCoordinates(this._bars,d),this._model.timeScale().barIndexesToCoordinates(this._bars),this._model.selection().isSelected(this._study)){const t=this._selectionIndexer.indexes();this._selectionData={points:[],hittestResult:c.HitTestResult.REGULAR,bgColors:[],visible:!0,barSpacing:this._model.timeScale().barSpacing()};const i=Object(r.ensureNotNull)(this._model.paneForSource(this._study)).height(),n=Object(r.ensureDefined)(this._ohlcPlotIndexes.get(4));for(let r=0;r<t.length;r++){const o=t[r],a=this._study.data().valueAt(o);if(null===a)continue;const l=a[n+1];if(null==l)continue;const c=this._model.timeScale().indexToCoordinate(Math.floor(o)),h=e.priceToCoordinate(l,d);this._selectionData.points.push(new s.Point(c,h)),this._selectionData.bgColors.push(this._model.backgroundColorAtYPercentFromTop(h/i))}}else this._selectionIndexer.clear()}}},eqEH:function(e,t,i){"use strict";i.r(t),i.d(t,"registerService",(function(){return o})),i.d(t,"unregisterService",(function(){return a})),i.d(t,"hasService",(function(){return l})),i.d(t,"service",(function(){return c})),i.d(t,"waitServiceRegistered",(function(){return h}));var s=i("jofe");const r={},n=new Map;function o(e,t){if(l(e))throw new Error("Service already registered");r[e.id]=t;const i=n.get(e.id);void 0!==i&&(n.delete(e.id),i.resolve(t))}function a(e){if(!l(e))throw new Error("Service not found");r[e.id]=void 0}function l(e){return void 0!==r[e.id]}function c(e){const t=r[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}function h(e){if(l(e))return Promise.resolve(c(e));let t=n.get(e.id);return void 0===t&&(t=Object(s.createDeferredPromise)(),n.set(e.id,t)),t.promise}},f6yo:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("hBTJ");t.pointInHalfplane=function(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive},
|
||
t.pointInTriangle=function(e,t,i,r){var n=t.add(i).scaled(.5).add(r).scaled(.5),o=s.intersectLineSegments(t,i,n,e);return null===o&&(null===(o=s.intersectLineSegments(i,r,n,e))&&null===(o=s.intersectLineSegments(r,t,n,e)))},t.pointInBox=function(e,t){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},t.pointInPolygon=function(e,t){for(var i=t.length-1,s=!1,r=e.x,n=e.y,o=0;o<t.length;o++){var a=t[o],l=t[i];(a.y<n&&l.y>=n||l.y<n&&a.y>=n)&&a.x+(n-a.y)/(l.y-a.y)*(l.x-a.x)<r&&(s=!s),i=o}return s},t.pointInCircle=function(e,t,i){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)<=i*i}},fFKx:function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));var s=i("Eyy1"),r=i("tqok"),n=i("hsV8");function o(e,t){if(e.startIndex>=t.length||e.endIndex>=t.length)return null;const i=t[e.startIndex],n=t[e.endIndex];return i===r.a||n===r.a?null:(Object(s.assert)(i<=n,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:n,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function a(e,t,i){const s=Object(n.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),r=Object(n.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return Object.assign(Object.assign({id:t},e),{startIndex:s,endIndex:r})}},fJhV:function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourceTimeAxisView",(function(){return r}));var s=i("cgFQ");class r extends s.a{constructor(e,t){super(e.model()),this._active=!1,this._source=e,this._pointIndex=t}setActive(e){this._active=e}_getBgColor(){return this._active?"#1565C0":this._model.isDark()?"#1E88E5":"#2196F3"}_getIndex(){if(!this._model.selection().isSelected(this._source))return null;const e=this._source.timeAxisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index}}},fPdn:function(e,t,i){"use strict";window.TradingView=window.TradingView||{},window.requireAll=function(e){return e.keys().map(e)},i("6jKD"),i("bZMm"),i("P5fv"),i("YFKU"),i("VUhU"),i("si6p"),i("EsMY"),i("jjqu"),i("OV6q"),i("SpsL"),i("eqD+"),i("iA8Q"),i("32f0"),i("MApU"),i("w9cH").install(),i("QYoC"),i("oA7e"),i("qFKp"),i("1oAu"),i("ogJP"),i("jFln"),i("HbRj"),i("VVxS"),i("CLNU"),i("mZrn"),i("Vdly"),i("+GxX")},fTGZ:function(e,t,i){"use strict";(function(e,s,r){var n=i("Eyy1").ensureNotNull,o=i("Ss5c").LineDataSource,a=i("ogJP").isNumber,l=i("BOPY").BarsMarksContainerPaneView,c=i("BOPY").BarsMarksContainerRenderer,h=i("Bt3k").TooltipRenderer,u=i("LxhU").Interval,d=i("n5al").isPriceSourceStyle,p=i("txPx").getLogger("Chart.BarsMarksContainer");class _ extends o{constructor(t,i){var a=t._undoModel._chartWidget,l=a.onWidget(),c=!1;c=l?a._options&&!a._options.hideIdeas:!!e.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:c,frozen:!1}):i=new s({visible:c,frozen:!1}),i.visible.listeners().subscribe(null,(function(t){l||a._containsData||!e.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),u._tooltip&&u._tooltip.removeAll()})),o._configureProperties(i),super(t,i);var u=this;this.onNeedRepaint=new r,
|
||
this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().completed().subscribe(this,(function(){var e=this._model.mainSeries().data();if(0!==e.size()){var t=n(e.first()).index,i=n(e.last()).index,s=this.timeScale();this.getData({start:s.indexToTimePoint(t),end:s.indexToTimePoint(i)})}})),this._initialize(),this.pinnedTooltips={},this._tooltip=new h(this._createTooltip.bind(this),this)}_initialize(e){throw new Error("Child class must override this member")}onClicked(){throw new Error("Child class must override this member")}_getData(e){throw new Error("Child class must override this member")}_createTooltip(){throw new Error("Child class must override this member")}updateDotData(e,t){return t}updatePlateData(e,t){}isAvailableInFloatingWidget(){return!1}_plateViewData(e){return{}}pinTooltip(e,t){this.pinnedTooltips[e]=t}timeScale(){return this._model.timeScale()}getIntervalInTicks(){var e=this._model.mainSeries().properties().interval.value(),t=u.parse(e);if(!t.isValid())throw new TypeError("Unexpected interval");return t.isRange()?60:t.inMilliseconds()/1e3}getVisibleTickMarksRange(){if(this.timeScale().isEmpty())return{start:0,end:0};var e,t=this.timeScale().visibleBarsStrictRange();return t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()<this.timeScale().points().lastIndex()?(e=t.lastBar()<this.timeScale().points().lastIndex()?this.timeScale().indexToTimePoint(t.lastBar()):this._maxDate,{start:(t={start:this.timeScale().indexToTimePoint(Math.max(t.firstBar(),this.timeScale().points().firstIndex())),end:e}).start?t.start:void 0,end:t.end?t.end:void 0}):{start:0,end:0}}getVisibleRangePlates(){var e=[],t=this.getVisibleTickMarksRange(),i=this.getIntervalInTicks();return Object.keys(this._marks).forEach((function(s){var r=this._marks[s],n=r.tickmark;n>=t.start&&n<=t.end+i&&e.push(r)}),this),e}getPublishedPlates(){var e={},t=this;return is_authenticated?(this.getVisibleRangePlates().forEach((function(i){i.is_public&&(t.pinnedTooltips[i.id]||i.user__id===user.id)&&(e[i.id]=i)})),e):e}filterDisplayedPlates(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var s=e[i];return s=(s=s.sort((function(e,t){return t.views_count-e.views_count}))).slice(0,this._maxPlatesPerBar),t.concat(s)}.bind(this),[])}_layout(e){switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}}_theme(e){switch(e){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}}_offset(e,t,i){var s;switch(e){default:case"up":s=null===i?t[TradingView.HIGH_PLOT]:i(t);break;case"down":s=null===i?t[TradingView.LOW_PLOT]:i(t)}
|
||
return this.priceScale().priceToCoordinate(s,this.ownerSource().firstValue())}_getIndex(e){return this.timeScale().timePointToIndex(e)}getViewData(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}}barWidth(){return this.timeScale().barSpacing()}getPlatesViewData(){var e=this._model.mainSeries();if(e.data().isEmpty())return[];for(var t=d(e.style())?e.barFunction():null,i=this.filterDisplayedPlates(this.getVisibleRangePlates()),s=this,r={},n=this._model.lastHittestData(),o=(i=(i=i.map(function(e){var i=this._getIndex(e.tickmark),o=this._getBar(i);if(null===o)return!1;var a,l=this._layout(e.direction),c=this._theme(e.direction),h=n&&n.id===e.id,u=this.timeScale().indexToCoordinate(i),d=this._offset(l,o,t),p=this.priceScale().isInverted();return i in r||(r[i]={up:0,down:0}),a=r[i][l]++,TradingView.merge({id:e.id,x:u,y:d,yInverted:p,order:a,direction:l,theme:c,hovered:h,pinned:!0===s.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e))}.bind(this))).filter((function(e){return!!e}))).filter((function(e){return!0===e.hovered})),a=0;a<i.length;a++)null!=o[0]&&i[a].user__id===o[0].user__id&&(i[a].highlightByAuthor=!0);return i.sort((function(e,t){return e.hovered&&!t.hovered?1:0})),i}_getBar(e){return this._model.mainSeries().data().valueAt(e)}paneViews(){var e=this;return this._properties.visible.value()?[new l(this,(function(t){return new c(t.getViewData(),e)}))]:[]}dataWindowView(){return null}priceAxisViews(){return null}statusView(){return null}updateAllViews(){}pointsCount(){return 0}properties(){return this._properties}_rangeDifference(e){return e=Object.assign({},e),this._loadedRange&&(e.start<this._loadedRange.start?e.end=this._loadedRange.start:e.end>this._loadedRange.end&&(e.start=this._loadedRange.end)),e}_rangeUnion(e,t){return e=Object.assign({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e}_pushGetDataStack(e){a(e.start)&&a(e.end)?(this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)):p.logError("Wrong tickmark range")}roundRange(e){return{start:Math.round(e.start),end:Math.round(e.end)}}refreshData(){this.getData(this._lastRange)}getData(e){a(e.start)&&a(e.end)?(this._lastRange=e,(e=Object.assign({},e)).end=this._maxDate,this._pushGetDataStack(e)):p.logError("Wrong range")}_abortAllRequests(){this._requests.forEach((function(e){e.abort()})),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null}clearMarks(){this._abortAllRequests(),this._marks={},this._loadedRange=null}}_.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),_.prototype._maxPlatesPerBar=10,t.BarsMarksContainer=_}).call(this,i("Kxc7"),i("tc+8"),i("aIyQ"))},fZEr:function(e,t,i){"use strict";async function s(e,t){
|
||
const s=await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(13),i.e(15),i.e(18),i.e(91),i.e(0),i.e(5),i.e(12),i.e("simple-dialog")]).then(i.bind(null,"EcUf"));return s.showSimpleDialog(e,s.renameModule,t)}async function r(e,t){const s=await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(13),i.e(15),i.e(18),i.e(91),i.e(0),i.e(5),i.e(12),i.e("simple-dialog")]).then(i.bind(null,"EcUf"));return s.showSimpleDialog(e,s.confirmModule,t)}i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}))},fgLi:function(e,t,i){"use strict";i.r(t),i.d(t,"DataSource",(function(){return l}));var s=i("hY0g"),r=i.n(s),n=i("e3/o"),o=i("aIyQ"),a=i.n(o);class l{constructor(){this.hasAlert=new r.a(!1),this._zorder=0,this.m_priceScale=null,this._id=Object(n.randomHashN)(6),this._ownerSource=null,this._userEditEnabled=!0,this._onPriceScaleChanged=new a.a,this._isSelectionEnabled=!0,this._ownerSourceChanged=new a.a,this._zOrderChanged=new a.a}id(){return this._id}preferNoScale(){return!1}idForAlert(){return this._id}setId(e){this._id=e}zorder(){return this._zorder}setZorder(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e,this._zOrderChanged.fire(e))}title(){throw new Error("Implement this fun in a subclass")}priceScale(){return this.m_priceScale}setPriceScale(e){this.m_priceScale=e,this._onPriceScaleChanged.fire()}ownerSource(){return this._ownerSource}setOwnerSource(e){this._ownerSource=e,this._ownerSourceChanged.fire()}ownerSourceChanged(){return this._ownerSourceChanged}zOrderChanged(){return this._zOrderChanged}isSavedInChart(e){return!0}isSavedInStudyTemplates(){return!0}isRemovedByStudyTemplates(){return!0}hasContextMenu(){return!0}showInObjectTree(){return!0}setUserEditEnabled(e){this._userEditEnabled=e}userEditEnabled(){return this._userEditEnabled}canBeHidden(){return this.userEditEnabled()}isUserDeletable(){return this.userEditEnabled()}canHasAlert(){return!1}properties(){throw new Error("Implement this fun in a subclass")}isVisible(){return this.properties().visible.value()}statusView(){return null}dataWindowView(){return null}legendView(){return null}marketStatusModel(){return null}dataUpdatedModeModel(){return null}dataProblemModel(){return null}priceAxisViews(e,t){return null}timeAxisViews(){return null}updateAllViews(){}paneViews(){return null}labelPaneViews(){return null}isFailed(){return!1}isLoading(){return!1}isPhantom(){return!1}isChildStudy(){return!1}hasChildren(){return!1}canHaveChildren(){return!1}onClickOutside(){}getSourceIcon(){return null}state(e){throw new Error("Implement this fun in a subclass")}onPriceScaleChanged(){return this._onPriceScaleChanged}doesMovingAffectsUndo(){return!0}isMultiPaneAvailable(){return!1}isMultiPaneEnabled(){return!1}copiable(){return!1}cloneable(){return!1}movable(){return!1}isIncludedInAutoScale(){return!1}isHoveredEnabled(){return this.isSelectionEnabled()}isSelectionEnabled(){return this._isSelectionEnabled}setSelectionEnabled(e){this._isSelectionEnabled=e}priceRange(e,t){return null}autoScaleInfo(e,t){return{range:this.priceRange(e,t)}}}},
|
||
fs3R:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor" transform="translate(6 4)"><rect width="15" height="12" rx="2" x=".5" y="7.5"/><path stroke-linecap="round" stroke-width="2" d="M8 14v2"/><path d="M11.5 7.5V4a3.5 3.5 0 0 0-7 0v3.5"/></g></svg>'},g5Qf:function(e,t,i){"use strict";i.r(t),i.d(t,"getFavoriteDrawingToolbarPromise",(function(){return o})),i.d(t,"createFavoriteDrawingToolbar",(function(){return a}));i("YFKU");var s=i("yMne");let r=null,n=null;function o(){return n}function a(){null===n&&(n=Promise.all([i.e("react"),i.e(1),i.e(2),i.e(7),i.e(11),i.e(15),i.e(16),i.e(18),i.e(20),i.e(22),i.e(24),i.e(28),i.e(42),i.e(47),i.e(50),i.e(63),i.e(69),i.e(79),i.e(0),i.e(4),i.e(25),i.e(32),i.e(38),i.e("line-tools-icons"),i.e(52),i.e(55),i.e("floating-toolbars")]).then(i.bind(null,"gmn6")).then(({FavoriteDrawingToolbar:e})=>(r=null!==r?r:new e({left:window.innerWidth/2,top:s.b+61}),r)))}},gASG:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("Ocx9"),n=i("jvrd"),o=i("Ss5c"),a=i("tc+8"),l=i.n(a),c=i("mMWL"),h=i("+FzY"),u=i("aIyQ"),d=i.n(u);class p{constructor(e){this._image=null,this._currentImageURL=null,this._imageReady=!1,this._ready=new d.a,this._source=e,this.updateImage()}updateImage(){const e=this.imageURL();this._currentImageURL!==e&&(this._currentImageURL=e,this._image=null,this._imageReady=!1,null!==this._currentImageURL&&(this._image=new Image,this._image.onload=()=>{this._imageReady=!0,this._ready.fire()},this._image.crossOrigin="anonymous",this._image.src=this._currentImageURL))}itemIndex(){return 1}labelIndex(){return 0}image(){return this._imageReady&&this.showPlate()?this._image:null}showPlate(){return this._props().childs().showImage.value()}backgroundPlateColor(e){return this._props().childs().plateColor.value()}ready(){return this._ready}type(){return this._props().childs().itemType.value()}category(){return 1}time(){return 0}index(){const e=this._source.points();return 0===e.length?null:e[0].index}imageURL(){const e=this._props().childs().emoji.value();return Object(h.a)(e,"png")||null}sourceImage(){return null}additionalImageURL(){return null}additionalImageSource(){return null}name(){return""}headline(){return this._props().childs().text.value()}text(){return""}fullTextAst(){return null}position(){return this._props().childs().position.value()}fontSize(){return this._props().childs().fontSize.value()}fontBold(){return this._props().childs().bold.value()}fontItalic(){return this._props().childs().italic.value()}sourceLabel(){return null}_props(){return this._source.properties()}}class _ extends l.a{constructor(e){super(),this._source=e,e.pointAdded().subscribe(this,()=>this.listeners().fire(this)),e.pointChanged().subscribe(this,()=>this.listeners().fire(this))}value(){const e=this._source.properties().childs().position.value();return parseFloat(e.toFixed(2))}setValue(e){this._source.properties().childs().position.setValue(e),this._source.model().updateSource(this._source),
|
||
this.listeners().fire(this),this._source.syncMultichartState({pricesChanged:!1,indexesChanged:!1}),this._source.updateLastUpdateTime()}}var m=i("j8de");class f extends m.a{constructor(e,t){super(e,t),this._source=e}_setPointImpl(e){this._source.setPointAndChangeIndex(this._pointIndex,e)}}var g=i("j3hX");i.d(t,"LineToolSignpost",(function(){return v}));class v extends o.LineDataSource{constructor(e,t){const s=t||v.createProperties();super(e,s),this._item=new p(this),this._startMovingAnchorY=NaN,this.properties().childs().emoji.subscribe(this,()=>this._item.updateImage()),this._item.ready().subscribe(this,()=>this._model.updateSource(this)),i.e("lt-pane-views").then(i.bind(null,"KFbh")).then(t=>{this._setPaneViews([new t.SignpostPaneView(this,e)])})}isItemHovered(e){return!1}isItemSelected(e){return!1}isHidden(e){return!1}items(){return[this.customEvent()]}priceSource(){return this.ownerSource()}pointsCount(){return 1}addPoint(e,t,i){return super.addPoint(this._updatePositionAndCorrectPoint(e),t,i)}setPoint(e,t,i){super.setPoint(e,this._updatePositionAndCorrectPoint(t,!this.isPhantom()),i),this._syncPosition()}setPointAndChangeIndex(e,t,i){super.setPoint(e,this._updatePositionAndCorrectPoint(t,!1),i),this._syncPosition()}startMoving(e,t,i,r){r||(this._startMovingAnchorY=Object(s.ensureNotNull)(this._anchorYCoordinate())),super.startMoving(e,t,i)}move(e,t,i,r){var n;if(!r&&0===t){const t=this._points[0],i=Object(s.ensureDefined)(Object(s.ensureNotNull)(this.startMovingPoint()).logical),r=Object(s.ensureDefined)(e.logical),o=r.index-i.index,a=Object(s.ensureNotNull)(this.priceScale()),l=Object(s.ensure)(null===(n=this.ownerSource())||void 0===n?void 0:n.firstValue()),c=a.priceToCoordinate(r.price,l)-a.priceToCoordinate(i.price,l),h=this._startMovingAnchorY+c,u=a.coordinateToPrice(h,l);this._updatePositionAndCorrectPoint({index:t.index+o,price:u})}super.move(e,t,i),r||this._syncPosition()}properties(){return super.properties()}name(){return"Signpost"}customEvent(){return this._item}showInObjectTree(){return!this.isPhantom()&&super.showInObjectTree()}isPhantom(){return this._model.isPhantomLine(this)}clonePositionOffset(){return{barOffset:1,xCoordOffset:0,yCoordOffset:0}}template(){const e=super.template(),t=this.properties().childs();return e.text=t.text.value(),e.position=t.position.value(),e}static createProperties(e){const t=new r.DefaultProperty("linetoolsignpost",e);return v._configureProperties(t),t.hasChild("text")||t.addChild("text",new l.a(window.t("Text"))),t.hasChild("position")||t.addChild("position",new l.a(50)),t.addExclusion("text"),t.addExclusion("position"),t.addChild("backgroundsColors",new g.LineToolColorsProperty([t.childs().plateColor])),t}_createPointProperty(e){super._createPointProperty(e);const t=this._pointsProperty.childs().points[e];t.removeProperty("price"),t.removeProperty("bar"),t.addChild("price",new _(this)),t.addChild("bar",new f(this,0))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text),
|
||
this.properties().childs().position.setValue(e.position)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"zb1A")).then(e=>e.SignpostDefinitionsViewModel)}static _configureProperties(e){o.LineDataSource._configureProperties(e)}_updatePositionAndCorrectPoint(e,t){t&&(e.index=this._points[0].index);const i=this.priceSource();if(null===i)return e;const s=i.priceScale(),r=i.firstValue();if(null===s||s.isEmpty()||null===r)return e;const o=s.height();let a=o/2,l=e.price>=s.coordinateToPrice(a,r)?1:-1;const c=this._model.mainSeries();if(i===c){const t=c.data().search(e.index);if(null!==t){const i=Object(n.e)(c,t,-1),o=Object(n.e)(c,t,1);l=e.price>=i?1:-1,a=s.priceToCoordinate(1===l?o:i,r),e.price=1===l?Math.max(o,e.price):e.price}}const h=1===(-1===l!==s.isInverted()?-1:1)?a:o-a,u=s.priceToCoordinate(e.price,r),d=Math.min(o,Math.abs(u-a)),p=Math.max(0,Math.min(100,100*d/h))*l;return this.properties().childs().position.setValue(p),e}_syncPosition(){if(this.linkKey){const e={position:this.properties().childs().position.value()};Object(c.changeLineStyle)({linkKey:this.linkKey,state:e,model:this._model})}}_anchorYCoordinate(){const e=this.priceSource();if(null===e)return null;const t=e.priceScale(),i=e.firstValue();if(null===t||t.isEmpty()||null===i)return null;const s=this._model.mainSeries(),r=this.customEvent();let o=null;if(e===s&&(o=Object(n.d)(s,r)),null===o&&(o=Object(n.a)(r,t,i)),null===o)return null;const a=r.position(),l=t.priceToCoordinate(o.price,i);return Object(n.b)(a,t.height(),l,Object(n.c)(a,t.isInverted()))}}v.supportPhantomMode=!0},gAom:function(e,t,i){"use strict";i.r(t),i.d(t,"clearRectWithGradient",(function(){return o})),i.d(t,"fillRectInnerBorder",(function(){return a})),i.d(t,"drawHorizontalLine",(function(){return l})),i.d(t,"drawVerticalLine",(function(){return c})),i.d(t,"drawRoundRect",(function(){return u})),i.d(t,"drawRoundRectWithInnerBorder",(function(){return d})),i.d(t,"fillRectWithBorder",(function(){return p}));var s=i("aO4+"),r=i("jFln"),n=i("972a");function o(e,t,i,s,r,n,o){e.save(),e.globalCompositeOperation="copy";const a=e.createLinearGradient(0,0,0,r);a.addColorStop(0,n),a.addColorStop(1,o),e.fillStyle=a,e.fillRect(t,i,s,r),e.restore()}function a(e,t,i,s,r,n){e.fillRect(t+n,i,s-2*n,n),e.fillRect(t+n,i+r-n,s-2*n,n),e.fillRect(t,i,n,r),e.fillRect(t+s-n,i,n,r)}function l(e,t,i,s){e.beginPath();const r=e.lineWidth%2?.5:0;e.moveTo(i,t+r),e.lineTo(s,t+r),e.stroke()}function c(e,t,i,s){e.beginPath();const r=e.lineWidth%2?.5:0;e.moveTo(t+r,i),e.lineTo(t+r,s),e.stroke()}function h(e,t){return Array.isArray(e)?e.map(e=>0===e?e:e+t):e+t}function u(e,t,i,s,r,n){let o,a,l,c;if(Array.isArray(n))if(2===n.length){const e=Math.max(0,n[0]),t=Math.max(0,n[1]);o=e,a=e,l=t,c=t}else{if(4!==n.length)throw new Error("Wrong border radius - it should be like css border radius");o=Math.max(0,n[0]),a=Math.max(0,n[1]),l=Math.max(0,n[2]),c=Math.max(0,n[3])}else{const e=Math.max(0,n);o=e,a=e,l=e,c=e}e.beginPath(),e.moveTo(t+o,i),
|
||
e.lineTo(t+s-a,i),0!==a&&e.arcTo(t+s,i,t+s,i+a,a),e.lineTo(t+s,i+r-l),0!==l&&e.arcTo(t+s,i+r,t+s-l,i+r,l),e.lineTo(t+c,i+r),0!==c&&e.arcTo(t,i+r,t,i+r-c,c),e.lineTo(t,i+o),0!==o&&e.arcTo(t,i,t+o,i,o)}function d(e,t,i,s,o,a,l=0,c=0,d="",p=n.LineStyle.Solid){if(e.save(),!c||!d||d===a)return u(e,t,i,s,o,l),e.fillStyle=a,e.fill(),void e.restore();const _=c/2;if("transparent"!==a){const r="transparent"!==d&&p!==n.LineStyle.Solid;u(e,r?t:t+c,r?i:i+c,r?s:s-2*c,r?o:o-2*c,r?l:h(l,-c)),e.fillStyle=a,e.fill()}if("transparent"!==d){u(e,t+_,i+_,s-c,o-c,h(l,-_)),e.lineWidth=c,e.strokeStyle=d,Object(r.setLineStyle)(e,p),e.closePath(),e.stroke()}e.restore()}function p(e,t,i,n,o,a,l,c,h,u,d,p,_,m,f){const g=u?0:t,v=d?_:n;if(void 0!==a&&(e.fillStyle=a,e.fillRect(g,i,v-g+m,o-i)),void 0!==l&&c>0){if(e.beginPath(),Object(r.setLineStyle)(e,h),void 0!==f){const t=f.map(e=>e*c);Object(r.setLineDash)(e,t)}let a=Object(s.point)(0,0),u=Object(s.point)(0,0),d=Object(s.point)(0,0),_=Object(s.point)(0,0);switch(p){case"outer":{const e=.5*c;d=Object(s.point)(0,e),_=Object(s.point)(0,e),a=Object(s.point)(e,-c),u=Object(s.point)(e,-c);break}case"center":{const e=c%2?.5:0,t=c%2?.5:m;d=Object(s.point)(.5*c-e,-e),_=Object(s.point)(t+.5*c,-e),a=Object(s.point)(-e,e+.5*c),u=Object(s.point)(t,e+.5*c);break}case"inner":{const e=.5*c;d=Object(s.point)(0,-e),_=Object(s.point)(1,-e),a=Object(s.point)(-e,c),u=Object(s.point)(1-e,c);break}}e.lineWidth=c,e.strokeStyle=l,e.moveTo(g-d.x,i-d.y),e.lineTo(v+_.x,i-_.y),e.moveTo(n+u.x,i+u.y),e.lineTo(n+u.x,o-u.y),e.moveTo(g-d.x,o+d.y),e.lineTo(v+_.x,o+_.y),e.moveTo(t-a.x,i+a.y),e.lineTo(t-a.x,o-a.y),e.stroke()}}},gBDZ:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"c",(function(){return r})),i.d(t,"b",(function(){return c}));var s,r,n=i("Eyy1"),o=i("XlJ7"),a=i("c44N"),l=i("ikwP");!function(e){e.Left="left",e.Right="right",e.Center="center"}(s||(s={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(r||(r={}));class c{constructor(e,t,i,s,r,a="center"){this._cacheRenderParams=null,this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,s){return Object(o.makeFont)(s,i,`${e?"bold ":""}${t?"italic ":""}`)}(t,i,s,r),this._fontSize=r,this._verticalPadding=~~(r/6),this._textAlign=a;const c=Object(l.createDisconnectedCanvas)(document,new l.Size(0,0),1),h=Object(n.ensureNotNull)(c.getContext("2d"));h.font=this._font;let u=0;for(const n of this._lines){const e=h.measureText(n).width;u=Math.max(u,e)}this.textImageWidth=u+1,this.textImageHeight=this._lines.length*r+this._verticalPadding}paintTo(e,t,i,s,r,n,o){const a=this._getTextImage(i,t);if(0===a.width||0===a.height)return;const c=function(e,t,i){let s=e;switch(t){case"left":break;case"right":s-=i;break;case"center":s-=i/2}return Math.round(s)}(s,n,this.textImageWidth),h=function(e,t,i){let s=e;switch(t){case"top":break;case"bottom":s-=i;break;case"middle":s-=i/2}return Math.round(s)}(r,o,this.textImageHeight);Object(l.drawScaled)(e,t.pixelRatio,()=>{
|
||
e.drawImage(a,c,h,this.textImageWidth,this.textImageHeight)})}_getTextImage(e,t){if(null!==this._cacheRenderParams&&Object(a.areEqualPaneRenderParams)(this._cacheRenderParams,t)||(this._canvasesMap={},this._cacheRenderParams=t),this._canvasesMap[e])return this._canvasesMap[e];{const t=Object(l.createDisconnectedCanvas)(document,new l.Size(this.textImageWidth,this.textImageHeight),this._cacheRenderParams.pixelRatio),i=Object(n.ensureNotNull)(t.getContext("2d"));let s;switch(i.textBaseline="top",i.font=this._font,i.fillStyle=e,this._textAlign){case"left":s=0,i.textAlign="left";break;case"right":s=this.textImageWidth-1,i.textAlign="right";break;default:s=this.textImageWidth/2,i.textAlign="center"}let r=this._verticalPadding;return Object(l.drawScaled)(i,this._cacheRenderParams.pixelRatio,()=>{for(const e of this._lines)i.fillText(e,s,r),r+=this._fontSize}),this._canvasesMap[e]=t,t}}}},gLxC:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("tc+8"),n=i("Ocx9").DefaultProperty;class o extends s{constructor(e,t){super(e,t||o.createProperties()),this.version=o.version,i.e("lt-pane-views").then(i.bind(null,"Dz+H")).then(({NotePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 1}name(){return"Note"}getTooltipWidth(){return o.TOOLTIP_WIDTH}getTooltipPadding(){return o.TOOLTIP_PADDING}getTooltipLineSpacing(){return o.TOOLTIP_LINESPACING}template(){var e=s.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static createProperties(e){void 0!==e&&void 0!==e.markerColor&&void 0===e.borderColor&&(e.borderColor=e.markerColor);var t=new n("linetoolnote",e);return o._configureProperties(t),t}state(e){var t=s.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"74nv"))).NoteDefinitionsViewModel}static _configureProperties(e){s._configureProperties(e),e.hasChild("text")||e.addChild("text",new r(window.t("Text"))),e.addExclusion("text")}}o.TOOLTIP_WIDTH=300,o.TOOLTIP_PADDING=10,o.TOOLTIP_LINESPACING=5,o.version=1;class a extends o{constructor(e,t){super(e,t||a.createProperties())}title(){return window.t("Anchored Note")}name(){return"Anchored Note"}isFixed(){return!0}hasEditableCoordinates(){return!1}static createProperties(e){var t=new n("linetoolnoteabsolute",e);return a._configureProperties(t),t}static _configureProperties(e){o._configureProperties(e)}}t.LineToolNote=o,t.LineToolNoteAbsolute=a},gMX9:function(e,t,i){"use strict";var s=i("Eyy1"),r=i("Tmoa"),n=i("cPgM");class o{constructor(){this._items=[],this._actualLength=0,this._invalidations=0}push(e){this._items.length===this._actualLength?this._items.push(e):this._items[this._actualLength]!==e&&(this._items[this._actualLength]=e),this._actualLength+=1}newItem(){const e=this._items.length>this._actualLength?this._items[this._actualLength]:null
|
||
;return null!==e&&Boolean(e.invalidateCache)&&e.invalidateCache(),e}invalidateCache(){this._invalidations+=1,3e3===this._invalidations&&(this._items.splice(this._actualLength),this._invalidations=0),this._actualLength=0}at(e){return this._items[e]}data(){return this._items}length(){return this._actualLength}}class a{constructor(){this._map=new Map,this._usedKeys=new Set,this._invalidations=0}invalidateCache(){this._invalidations+=1,50===this._invalidations&&(this._deleteUnused(),this._invalidations=0),this._usedKeys.clear(),this._map.forEach((e,t)=>e.invalidateCache())}get(e){const t=this._map.get(e);return void 0!==t&&this._usedKeys.add(e),t}set(e,t){this._usedKeys.add(e),this._map.set(e,t)}forEach(e){this._map.forEach((t,i)=>{this._usedKeys.has(i)&&e(t,i)})}delete(e){const t=this._map.get(e);void 0!==t&&t.invalidateCache(),this._usedKeys.delete(e)}_deleteUnused(){const e=[];this._map.forEach((t,i)=>{this._usedKeys.has(i)||e.push(i)});for(const t of e)this._map.delete(t)}}class l extends o{constructor(){super(),this.points1=new o,this.points2=new o,this.push(this.points1),this.push(this.points2)}addPoints1Point(e,t){let i=this.points1.newItem();null!==i?(i.x=e,i.y=t):i={x:e,y:t},this.points1.push(i)}addPoints2Point(e,t){let i=this.points2.newItem();null!==i?(i.x=e,i.y=t):i={x:e,y:t},this.points2.push(i)}invalidateCache(){this.points1.invalidateCache(),this.points2.invalidateCache()}}class c extends n.ScaledPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e,t){return null}_drawImpl(e,t){if(null===this._data)return;const i=.25*this._data.barSpacing,s=this._data.transparency;this._data.colorAreas.forEach((t,n)=>{e.beginPath();for(let s=0;s<t.length();s++){const r=t.at(s);if(0===r.points1.length()||0===r.points2.length())continue;const n=r.points1.at(0).x,o=r.points1.at(0).y;if(e.moveTo(n,o),1!==r.points1.length()&&1!==r.points2.length()){for(let t=1;t<r.points1.length();t++)e.lineTo(r.points1.at(t).x,r.points1.at(t).y);for(let t=r.points2.length()-1;t>=0;t--)e.lineTo(r.points2.at(t).x,r.points2.at(t).y)}else{const t=r.points2.at(0).x,s=r.points2.at(0).y;e.lineTo(n+i,o),e.lineTo(t+i,s),e.lineTo(t-i,s),e.lineTo(n-i,o)}}e.closePath(),e.fillStyle=Object(r.generateColor)(n,s),e.fill()})}}var h=i("k9/m"),u=i("ogJP"),d=i("Zp/P"),p=i("ZJKN");i.d(t,"a",(function(){return m}));class _ extends o{constructor(){super(...arguments),this._startIndex=0}setStartIndex(e){this._startIndex=e}at(e){const t=e-this._startIndex;for(;t>=this._actualLength;){if(this._items.length<=t)this._items.push({plot1Value:void 0,plot2Value:void 0,colorIndex:void 0});else{const e=this._items[this._actualLength];e.plot1Value=void 0,e.plot2Value=void 0,e.colorIndex=void 0}this._actualLength+=1}return this._items[t]}}class m{constructor(e,t=!1){this._isHlineFill=!1,this._bandAKey=null,this._bandBKey=null,this._colorPlotIndex=null,this._colorValues=[],this._colors=new o,this._areaRenderer=new c,this._invalidated=!0,this._plIndex1=null,this._plIndex2=null,this._level1=0,this._level2=0,this._studyValuesCache=new _,
|
||
this._points1=new o,this._points2=new o,this._timePoints=new o,this._colorAreas=new a,this._source=e,this._fillGaps=t}update(){this._invalidated=!0}renderer(e,t){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._areaRenderer}_correctVisibleRange(e){const t=this._source.data(),i=t.search(e.firstBar(),h.PlotRowSearchMode.NearestLeft,this._plotIndex1()),s=t.search(e.firstBar(),h.PlotRowSearchMode.NearestLeft,this._plotIndex2()),r=t.search(e.lastBar(),h.PlotRowSearchMode.NearestRight,this._plotIndex1()),n=t.search(e.lastBar(),h.PlotRowSearchMode.NearestRight,this._plotIndex2()),o=null!==i?i.index:e.firstBar(),a=null!==s?s.index:e.firstBar(),l=null!==r?r.index:e.lastBar(),c=null!==n?n.index:e.lastBar();return[Math.min(o,a),Math.max(l,c)]}_plotNames(){return this._source.metaInfo().plots.map(e=>e.id)}_plotIndex1(){return null===this._plIndex1&&(this._plIndex1=this._plotNames().indexOf(this._plotAId())+1),this._plIndex1}_plotIndex2(){return null===this._plIndex2&&(this._plIndex2=this._plotNames().indexOf(this._plotBId())+1),this._plIndex2}_updateImpl(){var e,t,i;if(this._areaRenderer.setData(null),!this._visible())return;const r=this._source.priceScale(),n=this._source.model(),o=n.timeScale();if(!r||r.isEmpty()||o.isEmpty())return;if(n.mainSeries().bars().isEmpty())return;const a=this._source.firstValue();if(null===a)return;if(this._isHlineFill){const e=this._source.properties().bands[Object(s.ensureNotNull)(this._bandAKey)],t=this._source.properties().bands[Object(s.ensureNotNull)(this._bandBKey)];this._level1=r.priceToCoordinate(e.value.value(),a),this._level2=r.priceToCoordinate(t.value.value(),a)}const l=o.visibleBarsStrictRange();if(null===l)return;this._timePoints.invalidateCache(),this._points1.invalidateCache(),this._points2.invalidateCache(),null===(e=this._colors)||void 0===e||e.invalidateCache(),this._colorAreas.invalidateCache();const[c,h]=this._correctVisibleRange(l),d=this._isPerBarColoringSupported()?this._colors:null,_=this._source.offset(this._plotAId()),m=this._source.offset(this._plotBId()),f=Math.min(_,m),g=Math.max(_,m),v=this._plotIndex1(),b=this._plotIndex2(),S=this._source.data();if(S.isEmpty())return;let y,w;const C=Object(s.ensureNotNull)(S.firstIndex()),P=Object(s.ensureNotNull)(S.lastIndex()),x=C-Math.max(0,-f),T=P+Math.max(0,g),M=Math.max(c-1,x),I=Math.min(h+1,T),L=this._studyValuesCache;L.invalidateCache();const O=M-g,A=S.rangeIterator(O,I-f),E=Math.max(l.firstBar()-1,Math.min(O-g-1,O-1+f));L.setStartIndex(E);const k=new p.BarsRange(l.firstBar()-1,l.lastBar()+1);for(;A.hasNext();){const e=A.next(),t=e.index,i=e.value,r=i[v],n=i[b],o=t+_,a=t+m;if(o===a&&k.contains(o)){const e=L.at(o);e.plot1Value=r,e.plot2Value=n}else{if(k.contains(o)){L.at(o).plot1Value=r}if(k.contains(a)){L.at(a).plot2Value=n}}if(null!==d){const e=t-1+f;if(l.contains(e)){const t=i[Object(s.ensureNotNull)(this._colorPlotIndex)+1];L.at(e).colorIndex=t}}}const D=this._timePoints,V=this._points1,B=this._points2;let R=null;const N=E+L.length();for(let s=E;s<=N;s++){if(!this._fillGaps&&(null===y||null===w)){
|
||
const e=s-1;D.push(e),V.push(NaN),B.push(NaN),null==d||d.push(null)}const e=L.at(s);if(null!==d){const t=e.colorIndex;R=null==t?null:this._getColorByPlotValue(t)}if(this._isHlineFill){D.push(s),null!==d&&d.push(R);continue}const r=null!==(t=e.plot1Value)&&void 0!==t?t:null,n=null!==(i=e.plot2Value)&&void 0!==i?i:null;(null!==r||null!==n||Number.isFinite(y)||Number.isFinite(w))&&(y=r,w=n,V.push(r),B.push(n),D.push(s),null!==d&&d.push(R))}r.pricesArrayToCoordinates(V.data(),a,V.length()),r.pricesArrayToCoordinates(B.data(),a,B.length()),o.indexesToCoordinates(D.data(),D.length());const j=this._transparency();let F=Object(u.isNumber)(j)?j:50;F=Math.min(F,100),F=Math.max(F,0);const W={barSpacing:this._source.model().timeScale().barSpacing(),transparency:F,colorAreas:this._getFilledAreas(D,V,B,d)};this._areaRenderer.setData(W)}_getFilledAreas(e,t,i,s){const r=this._isHlineFill;if(!r&&(0===t.length()||0===i.length()))return new a;const n=this._colorAreas;let c=null,h=null;const u=this._color();for(let a=0;a<e.length();a++){const p=r?this._level1:t.at(a),_=r?this._level2:i.at(a),m=e.at(a),f=Object(d.coordinateIsValid)(p),g=Object(d.coordinateIsValid)(_);if(this._fillGaps?f||g:f&&g){const e=s?s.at(a)||"":u;if(h!==e||null===c){h=e,null!==c&&(f&&c.addPoints1Point(m,p),g&&c.addPoints2Point(m,_));const t=n.get(e)||new o;c=t.newItem()||new l,t.push(c),n.set(e,t)}f&&c.addPoints1Point(m,p),g&&c.addPoints2Point(m,_)}else this._fillGaps||(h=null,c=null)}return n.delete(""),n}}},gMtF:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolRiskRewardPriceAxisView",(function(){return r}));var s=i("KcY8");class r extends s.a{constructor(e,t){super(),this._source=e,this._data=t}_updateRendererData(e,t,i){if(e.visible=!1,!this._showAxisLabel())return;const s=this._source.priceScale();if(0===this._source.points().length||null===s||s.isEmpty())return;const r=this._source.ownerSource(),n=null!==r?r.firstValue():null;if(null===n)return;const o=this._data.priceProperty.value(),a=this._data.colorProperty.value();i.background=a,i.textColor=this.generateTextColor(a),i.coordinate=s.priceToCoordinate(o,n),e.text=s.formatPrice(o,n),e.visible=!0}_showAxisLabel(){return this._source.properties().childs().showPriceLabels.value()}}},gP14:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aO4+"),n=i("oiZD"),o=i("JWMC"),a=i("vTIA"),l=i("GxN8"),c=i("8sOK"),h=i("LxhU"),u=i("tc+8"),d=i.n(u),p=i("KUek"),_=i("3ClC"),m=i("aIyQ"),f=i.n(m),g=i("hY0g"),v=i.n(g),b=i("H0vP"),S=i("Kxc7"),y=i("iDOr"),w=i("MbIA"),C=i("gQ5K"),P=i("3t3b"),x=i("4kQX"),T=i("mPvX"),M=i("mMWL"),I=i("txPx"),L=i("CW80"),O=i("e3/o"),A=i("ogJP"),E=i("Tmoa"),k=i("fTGZ"),D=i("4vW/");function V(e,t){return e.code<t.code?-1:e.code>t.code?1:0}class B{constructor(e){this._convertibleItems=e,this._idsToItems=new Map;for(const t of e)this._idsToItems.set(t.id,t)}convertible(e){return void 0!==this._idsToItems.get(e)}size(){return this._convertibleItems.length}filterConvertible(e,t){const i=this._convertibleItems.filter(function(e,t){return i=>!e.has(i.id)&&t(i.id)}(e,t));return i.sort(V),i}}class R{
|
||
constructor(e){this._allGroups=new Set,this._idToName=new Map,this._idToDescription=new Map,this._groupedUnitIds=new Map,this._groupedUnits=new Map,this._groupById=new Map,this._size=0,this._units=e;for(const t in e)if(e.hasOwnProperty(t)){this._allGroups.add(t),this._groupedUnitIds.set(t,new Set(e[t].map(e=>e.id))),this._groupedUnits.set(t,e[t]);for(const i of e[t])this._size++,this._idToName.set(i.id,i.name),this._idToDescription.set(i.id,i.description),this._groupById.set(i.id,t)}}unitsChanged(e){return this._units!==e}size(){return this._size}name(e){return this._idToName.get(e)||e}description(e){return this._idToDescription.get(e)||e}unitGroupById(e){return this._groupById.get(e)||null}allGroups(){return new Set(this._allGroups)}unitsByGroups(e){const t=[];return e.forEach(e=>{const i=this._groupedUnits.get(e);void 0!==i&&t.push({name:e,units:i})}),t}convertible(e,t){for(const i of t){const t=this._groupedUnitIds.get(i);if(void 0!==t&&t.has(e))return!0}return!1}}var N=i("ivNn");class j{constructor(e){this._source=null,this._sourcePane=null,this._currentToolSupportsPhantomMode=!1,this._model=e}destroy(){this._source=null,this._sourcePane=null}source(){return this._source}onToolChanged(){this._removeSource();const e=this._model.currentTool();this._currentToolSupportsPhantomMode=Object(L.isLineToolName)(e)&&Object(L.supportsPhantomMode)(e)}onCursorPositionUpdated(){if(!this._currentToolSupportsPhantomMode)return;const e=this._model.crossHairSource();if(this._sourcePane!==e.pane&&this._removeSource(),null===e.pane||!Object(N.isNumber)(e.index)||!Object(N.isNumber)(e.price))return void this._removeSource();const t={index:e.index,price:e.price};null!==this._source?this._source.setPoint(0,t):(this._source=this._model.createLineTool(e.pane,t,this._model.currentTool(),void 0,null),this._sourcePane=e.pane)}_removeSource(){null!==this._source&&(this._model.removeSource(this._source),this._source=null,this._sourcePane=null)}}var F=i("k9/m"),W=i("4o++"),H=i("zL3Q");class z{align(e,t,i){let r=e;if(!Object(H.a)().value())return r;const n=i.mainDataSource();if(null===n)return r;const o=n.model().mainSeries();if(n!==o)return r;const a=o.priceScale(),l=o.bars();if(a.isEmpty()||!l.contains(t))return r;const c=l.valueAt(t);if(null===c)return r;const h=[];null!==o.priceSource()?h.push(o.barFunction()(c)):h.push(c[1],c[2],c[3],c[4]);const u=Object(s.ensure)(o.firstValue()),d=h.map(e=>({y:a.priceToCoordinate(e,u),price:e})),p=a.priceToCoordinate(e,u);d.sort((e,t)=>Math.abs(e.y-p)-Math.abs(t.y-p));const _=d[0];return(Object(H.b)().value()===W.MagnetMode.StrongMagnet||Math.abs(_.y-p)<50)&&(r=_.price),r}}var U=i("Qb4w");i.d(t,"ChartModelBase",(function(){return K}));const G=Object(I.getLogger)("Chart.ChartModel");function q(e,t){const i=e.indexOf(t);return-1!==i&&(e.splice(i,1),!0)}const Y={isSnapshot:!1,readOnly:!1,watermarkEnabled:!0,shiftVisibleRangeOnNewBar:!0,currencyConversionEnabled:!1,unitConversionEnabled:!1,countdownEnabled:!0};class K{constructor(e,t,i,s,r,o,a,l){this._onRearrangePanes=new f.a,
|
||
this._lineToolsGroupModel=new T.LineToolsGroupModel,this._sourcesBeingMoved=[],this._lineItemBeingMoved=null,this._lineBeingEdited=null,this._linePointBeingEdited=null,this._linePointBeingChanged=null,this._customSourceBeingMovedHitTestData=null,this._dataSourceCollectionChanged=new f.a,this._sourceProperitesChanged=new f.a,this._sourceZOrderChanged=new f.a,this._sessions=null,this._currentTool="",this._lineBeingCreated=null,this._paneBeingCreatedLineOn=null,this._lineCancelled=new f.a,this._phantomSourceContainer=new j(this),this._destroyed=!1,this._isSettingsExternalPosition=!1,this._isTimeScrolling=!1,this._magnet=new z,this._panes=[],this._tagsChanged=new f.a,this._strategySources=[],this._strategySourcesChange=new f.a,this._activeStrategySource=new v.a(null),this._panesCollectionChanged=new f.a,this._scrollEnabled=S.enabled("chart_scroll"),this._zoomEnabled=S.enabled("chart_zoom"),this._isScalesResetAvailableChanged=new f.a,this._isScalesResetAvailable=!1,this._esdWatcher=null,this._alertsWatcher=null,this._hoveredSource=null,this._hoveredSourceChanged=new f.a,this._lastHittestData=null,this._topmostCustomSources=[],this._fgCustomSources=[],this._bgCustomSources=[],this._allCustomSources=[],this._customSourcesMap=new Map,this._multiPaneSources=[],this._showLegendProperty=new d.a,this._id=Object(O.guid)(),this._chartSaveTime=null,this._availableCurrenciesList=null,this._availableCurrencies=new B([]),this._availableUnitsObject=null,this._availableUnits=new R({}),this._shouldBeSavedEvenIfHidden=!1,this._watchedThemeSpawn=n.watchedTheme.spawn(),this._gradientColorsCache=null,this._recalcVRStudiesParams={timerId:null,force:!1,oldEndVisibleIndex:NaN,oldStartVisibleIndex:NaN},this._width=0,this._resetScales=new f.a,this._chartApi=e,this._invalidateHandler=t,this._undoModel=o,this._properties=i,this._options=Object(A.merge)(Object(A.clone)(Y),l),this._studiesMetaInfoRepository=r,this._readOnly=this._options.readOnly,this._isSnapshot=this._options.isSnapshot,this._chartSaveTime=(new Date).valueOf(),this._backgroundColor=new v.a(this._getBackgroundColor()),this._backgroundTopColor=new v.a(this._getBackgroundColor(!0)),this._properties.childs().paneProperties.childs().background.subscribe(this,this._updateBackgroundColor),this._properties.childs().paneProperties.childs().backgroundType.subscribe(this,this._updateBackgroundColor),this._properties.childs().paneProperties.childs().backgroundGradientStartColor.subscribe(this,this._updateBackgroundColor),this._properties.childs().paneProperties.childs().backgroundGradientEndColor.subscribe(this,this._updateBackgroundColor),this._watchedThemeSpawn.subscribe(this._updateBackgroundColor.bind(this))}chartSaveTime(){return this._chartSaveTime}setChartSaveTime(e){this._chartSaveTime=e}destroy(){this._phantomSourceContainer.destroy(),this._hoveredSourceChanged.destroy(),null!==this._watermarkSource&&(this._watermarkSource.destroy(),this._watermarkSource=null),Array.from(this._customSourcesMap.keys()).forEach(this._removeCustomSource,this),
|
||
Object(s.assert)(0===this._topmostCustomSources.length),Object(s.assert)(0===this._fgCustomSources.length),Object(s.assert)(0===this._bgCustomSources.length),Object(s.assert)(0===this._allCustomSources.length),Object(s.assert)(0===this._customSourcesMap.size),null!==this._esdWatcher&&(this._esdWatcher.destroy(),this._esdWatcher=null),null!==this._alertsWatcher&&(this._alertsWatcher.destroy(),this._alertsWatcher=null),this._properties.childs().paneProperties.childs().background.unsubscribeAll(this),this._properties.childs().paneProperties.childs().backgroundType.unsubscribeAll(this),this._properties.childs().paneProperties.childs().backgroundGradientEndColor.unsubscribeAll(this),this._properties.childs().paneProperties.childs().backgroundGradientStartColor.unsubscribeAll(this),this._watchedThemeSpawn.destroy(),this._destroyed=!0}undoModel(){return this._undoModel}addStrategySource(e){-1===this._strategySources.indexOf(e)&&(this._strategySources.push(e),this._strategySourcesChange.fire(),this.setActiveStrategySource(e))}removeStrategySource(e){const t=this._strategySources.indexOf(e);if(-1!==t){if(this._strategySources.splice(t,1)[0]===this._activeStrategySource.value()&&this.unsetActiveStrategySource(),this._strategySources.length>0){const e=this._strategySources[this._strategySources.length-1];this.setActiveStrategySource(e)}this._strategySourcesChange.fire()}}setActiveStrategySource(e){-1!==this._strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)}unsetActiveStrategySource(){this._activeStrategySource.setValue(null)}activeStrategySource(){return this._activeStrategySource}strategySources(){return this._strategySources}strategySourcesChange(){return this._strategySourcesChange}setScrollEnabled(e){this._scrollEnabled=e}scrollEnabled(){return this._scrollEnabled}setZoomEnabled(e){this._zoomEnabled=e}zoomEnabled(){return this._zoomEnabled}zoomToViewport(e,t,i,s,r){this.setTimeViewport(e,t);let n=Math.min(i,s),o=Math.max(i,s);const a=r.defaultPriceScale();a.isPercentage()||a.setMode({autoScale:!1}),a.isLog()&&(n=a.priceToLogical(n),o=a.priceToLogical(o)),a.setPriceRange(new U.PriceRange(n,o)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(r,b.InvalidationLevel.Light)),this._setScalesResetAvailable(!0)}setTimeViewport(e,t){this.timeScale().zoomToBarsRange(e,t),this.recalculateAllPanes(),this.recalcVisibleRangeStudies(),this.lightUpdate()}onTagsChanged(){return this._tagsChanged}canZoomIn(){return this._timeScale.canZoomIn()&&this._zoomEnabled}canZoomOut(){return this._timeScale.canZoomOut()&&this._zoomEnabled}onPaneTagsChanged(){this._tagsChanged.fire()}panesCollectionChanged(){return this._panesCollectionChanged}dataSourceCollectionChanged(){return this._dataSourceCollectionChanged}sourceProperitesChanged(){return this._sourceProperitesChanged}sourceZOrderChanged(){return this._sourceZOrderChanged}updateCrosshairPositionByOriginCoords(){const e=this.crossHairSource(),t=e.pane;let i=e.originX(),r=e.originY();if(Number.isFinite(i)||(i=e.x,r=e.y),
|
||
null!==t&&Number.isFinite(i)&&Number.isFinite(r)){const e=Math.round(this._timeScale.coordinateToIndex(i));let n=NaN;const o=t.defaultPriceScale();if(!o.isEmpty()){const e=Object(s.ensureNotNull)(t.mainDataSource()).firstValue();null!==e&&(n=o.coordinateToPrice(r,Object(s.ensureNotNull)(e)))}this.crossHairSource().setPosition(e,n,t)&&this._undoModel.chartWidget().isActive()&&this._syncCrosshair()}}zoomTime(e,t,i){if(!this._zoomEnabled)return;const s=this.timeScale();if(s.isEmpty()||0===t)return;const r=s.width();e=Math.max(1,Math.min(e,r-2)),s.zoom(e,t,i),this.recalculateAllPanes(),this.lightUpdate(),this.recalcVisibleRangeStudies(),this._setScalesResetAvailable(!0)}linePointBeingEdited(){return this._linePointBeingEdited}linePointBeingChanged(){return this._linePointBeingChanged}dataSources(){const e=[this.crossHairSource()];for(const t of this._panes)for(const i of t.dataSources())e.push(i);return e}priceDataSources(){const e=[];for(const t of this._panes)for(const i of t.priceDataSources())e.push(i);return e}lineToolsGroupModel(){return this._lineToolsGroupModel}restoreLineToolsGroups(e){this._lineToolsGroupModel=T.LineToolsGroupModel.fromState(this,e)}realignLineTools(){for(const e of this._panes)e.realignLineTools()&&this._dataSourceCollectionChanged.fire(e)}updateSource(e){const t=this._invalidationMaskForSource(e);null!==t&&this.invalidate(t)}updateSourcePriceScale(e){const t=this._invalidationMaskForSourcePriceScale(e);null!==t&&this.invalidate(t)}replaceStudyStub(e,t){const i=this.paneForSource(e);if(null===i)return!1;const s=e.priceScale(),r=e.zorder(),n=e.ownerSource();return this.paneForSource(e)===i?i.replaceSource(e,t,s):(i.insertDataSource(t,s,r),this.removeSource(e)),t.setOwnerSource(n),this.dataSources().forEach(i=>{i.ownerSource()===e&&i.setOwnerSource(t)}),t.start(),this.recalculatePane(i),this.fullUpdate(),!0}insertStudyStub(e){const t=this.mainSeries(),i=Object(s.ensureNotNull)(this.paneForSource(t)),r=new c.StudyStub(this,null,e),n=i.createPriceScaleAtPosition("overlay");return i.addDataSource(r,n,!1),this.recalculatePane(i),this.fullUpdate(),r}removeStudyStub(e){const t=this.dataSourceForId(e);return null===t?(G.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)}setHoveredSource(e,t){const i=this._hoveredSource!==e;if(!i&&this._lastHittestData===t)return;this._lastHittestData=t;let s=null;if(this._hoveredSource){this._hoveredSource.updateAllViews(),s=new b.InvalidationMask(b.InvalidationLevel.Cursor);const e=this._invalidationMaskForSource(this._hoveredSource,b.InvalidationLevel.Light);null!==e&&s.merge(e)}if(this._hoveredSource=e,e){e.updateAllViews(),s||(s=new b.InvalidationMask(b.InvalidationLevel.Cursor));const t=this._invalidationMaskForSource(e,b.InvalidationLevel.Light);null!==t&&s.merge(t)}s&&this.invalidate(s),i&&this._hoveredSourceChanged.fire(e)}hoveredSource(){return this._hoveredSource}hoveredSourceChanged(){return this._hoveredSourceChanged}lastHittestData(){return this._lastHittestData}paneForSource(e){if(function(e){return!("id"in e)
|
||
}(e))return Array.from(this._customSourcesMap.values()).includes(e)?this.paneForSource(this.mainSeries()):null;for(let t=this._panes.length-1;t>=0;t--)if(this._panes[t].hasDataSource(e))return this._panes[t];return e instanceof k.BarsMarksContainer?this.paneForSource(this.mainSeries()):null}allStudies(e){const t=e?e=>Object(_.isStudy)(e)&&!Object(_.isESDStudy)(e):_.isStudy;return this._getAllSources(t)}findNonOverlayStudyWithGroupingKey(e,t){const i=void 0!==t?[t]:this._panes;for(const s of i){const t=s.dataSources().find(t=>Object(_.isStudy)(t)&&t.metaInfo().groupingKey===e&&!s.isOverlay(t));if(void 0!==t)return{pane:s,study:t}}return null}movePaneUp(e){this.movePane(e,e-1)}movePaneDown(e){this.movePane(e,e+1)}movePane(e,t){const i=this._panes[e];this._panes.splice(e,1),this._panes.splice(t,0,i),this._panesCollectionChanged.fire(this._panes),this._onRearrangePanes.fire(),this.invalidate(b.InvalidationMask.panesOrder())}backgroundColor(){return this._backgroundColor}backgroundTopColor(){return this._backgroundTopColor}backgroundColorAtYPercentFromTop(e){const t=this.backgroundColor().value(),i=this.backgroundTopColor().value();if(t===i)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),null===this._gradientColorsCache||this._gradientColorsCache.topColor!==i||this._gradientColorsCache.bottomColor!==t)this._gradientColorsCache={topColor:i,bottomColor:t,colors:new Map};else{const t=this._gradientColorsCache.colors.get(e);if(void 0!==t)return t}const s=Object(E.gradientColorAtPercent)(i,t,e/100);return this._gradientColorsCache.colors.set(e,s),s}defaultResolutions(){return this.chartApi().defaultResolutions()}availableCurrencies(){const e=this._getAvailableCurrencies();return e.length!==this._availableCurrencies.size()&&(this._availableCurrencies=new B(e)),this._availableCurrencies}currencyConversionEnabled(){return this._options.currencyConversionEnabled}availableUnits(){const e=this._getAvailableUnits();return this._availableUnits.unitsChanged(e)&&(this._availableUnits=new R(e)),this._availableUnits}unitConversionEnabled(){return this._options.unitConversionEnabled}onResetScales(){return this._resetScales}startMovingSources(e,t,i,r,n,o){if(this._sourcesBeingMoved=e,this._lineItemBeingMoved=i,this._sourcesBeingMoved.forEach(e=>{const a=Object(s.ensureNotNull)(this.paneForSource(e));if(Object(L.isLineTool)(e)&&e.isFixed()&&e.linkKey&&r.has(e.linkKey)){const t=Object(s.ensureDefined)(r.get(e.linkKey)),l={screen:this._percentPositionToPoint(t,a)};e.startMoving(l,i,n,o)}else e.startMoving(t,i,n,o);const l=this._paneInvalidationMask(a,b.InvalidationLevel.Light);this.invalidate(l)}),!o){const r=e.filter(e=>e.linkKey&&e.isSynchronizable()).map(e=>e.linkKey);if(r.length&&t.logical){const o=this.externalTimeStamp(t.logical.index),a={linkKeys:r,model:this,symbol:this.mainSeries().symbol(),point:{price:t.logical.price,timeStamp:o},itemIndex:null!==i?i:void 0,envState:n,pointPositionPercents:new Map};e.forEach(e=>{if(e.linkKey&&e.isSynchronizable()&&e.isFixed()){const i=Object(s.ensureNotNull)(this.paneForSource(e))
|
||
;a.pointPositionPercents.set(e.linkKey,this._pointToPercentPosition(Object(s.ensureDefined)(t.screen),i))}}),Object(M.startMovingLineTool)(a)}}M.isToolMovingNow.setValue(!0)}moveSources(e,t,i,r){if(this._sourcesBeingMoved.filter(e=>!e.isLocked||!e.isLocked()).forEach(n=>{if(n.linkKey&&t.has(n.linkKey)){const e=Object(s.ensureNotNull)(this.paneForSource(n)),o=Object(s.ensureDefined)(t.get(n.linkKey)),a={screen:this._percentPositionToPoint(o,e)};n.move(a,this._lineItemBeingMoved,i,r)}else n.move(e,this._lineItemBeingMoved,i,r)}),this.lightUpdate(),!r&&e.logical){const t=this._sourcesBeingMoved.filter(e=>e.isSynchronizable()&&!!e.linkKey).map(e=>e.linkKey),r=this.externalTimeStamp(e.logical.index),n={linkKeys:t,model:this,point:{price:e.logical.price,timeStamp:r},envState:i,pointPositionPercents:new Map};this._sourcesBeingMoved.forEach(t=>{if(t.linkKey&&t.isSynchronizable()&&t.isFixed()){const i=Object(s.ensureNotNull)(this.paneForSource(t));n.pointPositionPercents.set(t.linkKey,this._pointToPercentPosition(Object(s.ensureDefined)(e.screen),i))}}),Object(M.moveLineTool)(n)}}endMovingSources(e,t){const i=this._sourcesBeingMoved.map(i=>{const r=Object(s.ensureNotNull)(this.paneForSource(i)),n=i.endMoving(e,t),o=this._paneInvalidationMask(r,b.InvalidationLevel.Light);return o.invalidateAll(b.InvalidationLevel.Light),this.invalidate(o),n}),r=this._sourcesBeingMoved.filter(e=>e.isSynchronizable()&&!!e.linkKey).map(e=>e.linkKey),n=this._sourcesBeingMoved.filter(e=>e.isSynchronizable()&&!!e.linkKey).map(e=>{const t={points:e.normalizedPoints(),interval:this.mainSeries().interval()};return e.isFixed()&&(t.pointPositionPercents=e.calcPositionPercents()),t});r.length&&Object(M.finishMovingLineTool)({linkKeys:r,model:this,finalStates:n,changes:i}),this._sourcesBeingMoved=[],this._lineItemBeingMoved=null,M.isToolMovingNow.setValue(!1)}sourcesBeingMoved(){return this._sourcesBeingMoved}setCustomSourceMovingHitTestData(e){this._customSourceBeingMovedHitTestData=null!==e?Object.assign({beingMoved:!1},e):null}processingCustomSourceMove(){null!==this._customSourceBeingMovedHitTestData&&(this._customSourceBeingMovedHitTestData.beingMoved=!0)}customSourceMovingHitTestData(){return this._customSourceBeingMovedHitTestData}width(){return this._width}setWidth(e,t){this._width=e,this._timeScale.setWidth(e,t);for(const i of this._panes)i.setWidth(e);this.recalculateAllPanes(),this.recalcVisibleRangeStudies()}setPaneHeight(e,t){e.setHeight(t),this.recalculateAllPanes(),this.lightUpdate()}isScalesResetAvailableChanged(){return this._isScalesResetAvailableChanged}isScalesResetAvailable(){return this._isScalesResetAvailable}panes(){return this._panes}paneForId(e){return this._panes.find(t=>t.id()===e)||null}createPane(e,t,i){const s=this._undoModel.chartWidget();s.isMaximizedPane()&&s.toggleMaximizePane();const r=this._properties.childs().paneProperties;t&&r.merge(t);const n=new y.Pane(this._timeScale,r,this,i);return void 0!==e?this._panes.splice(e,0,n):this._panes.push(n),n.onTagsChanged().subscribe(this,K.prototype.onPaneTagsChanged),
|
||
n.dataSourcesCollectionChanged().subscribe(this,()=>this._dataSourceCollectionChanged.fire(n)),n.sourcePropertiesChanged().subscribe(this,e=>this._sourceProperitesChanged.fire(n,e)),n.sourceZOrderChanged().subscribe(this,e=>this._sourceZOrderChanged.fire(n,e)),this._panesCollectionChanged.fire(this._panes),this.invalidate(b.InvalidationMask.panesOrder()),n}removePane(e){const t=this._undoModel.chartWidget();t.isMaximizedPane()&&t.toggleMaximizePane();const i=e;i.destroy();const s=this._panes.indexOf(i);-1!==s&&(this._panes.splice(s,1),e.dataSourcesCollectionChanged().unsubscribeAll(this),e.sourcePropertiesChanged().unsubscribeAll(this),e.onTagsChanged().unsubscribeAll(this));this.crossHairSource().pane===e&&this.clearCurrentPosition(),this._panesCollectionChanged.fire(this._panes),this.invalidate(b.InvalidationMask.panesOrder())}changePanesHeight(e,t){if(this._panes.length<2)return;Object(s.assert)(e>=0&&e<this._panes.length,"Invalid pane index");const i=this._panes[e],r=this._panes.reduce((e,t)=>e+t.stretchFactor(),0),n=this._panes.reduce((e,t)=>e+t.height(),0),o=n-30*(this._panes.length-1);t=Math.min(o,Math.max(30,t));const a=r/n,l=i.height();i.setStretchFactor(t*a);let c=t-l,h=this._panes.length-1;for(const s of this._panes)if(s!==i){const e=Math.min(o,Math.max(30,s.height()-c/h));c-=s.height()-e,h-=1;const t=e*a;s.setStretchFactor(t)}this.fullUpdate()}clearCurrentPosition(){const e=this.crossHairSource();e.clearPosition(),Object(s.ensureNotNull)(e.dataWindowView()).update();const t=this._panes;for(let s=t.length;s--;){const e=t[s].dataSources();for(let t=e.length;t--;){const i=e[t].dataWindowView();i&&i.update();const s=e[t].legendView();s&&s.update()}}this.invalidate(b.InvalidationMask.cursor());const i=this._undoModel.chartWidget();i.chartWidgetCollection().syncCrosshair(null,i),this._phantomSourceContainer.onCursorPositionUpdated()}setAndSaveCurrentPosition(e,t,i,s){this.crossHairSource().saveOriginCoords(e,t),this.setCurrentPosition(e,t,i,s)}setCurrentPosition(e,t,i,r){let n=NaN,o=Math.round(this._timeScale.coordinateToIndex(e));const a=this.timeScale().visibleBarsStrictRange();null===a||a.contains(o)||(o=Math.min(Math.max(a.firstBar(),o),a.lastBar()));const l=i.defaultPriceScale();let c=null;l.isEmpty()||(c=Object(s.ensureNotNull)(i.mainDataSource()).firstValue(),null!==c&&(n=l.coordinateToPrice(t,Object(s.ensureNotNull)(c))));const h=this.crossHairSource(),u=this.currentTool();if(!this._isSettingsExternalPosition&&(this._lineBeingCreated||this._lineBeingEdited||Object(L.isLineToolName)(u)||Object(M.toolIsMeasure)(u))&&(n=this._magnet.align(n,o,i),null!==c&&h.saveOriginCoords(h.originX(),l.priceToCoordinate(n,c))),this._isTimeScrolling)return void h.setPosition(h.index,n,i);h.setOnHoveredChartWidget(!0),h.setPosition(o,n,i),Object(s.ensureNotNull)(h.dataWindowView()).update();const d=this._panes;for(let s=d.length;s--;){const e=d[s].dataSources();for(let t=e.length;t--;){const i=e[t].dataWindowView();i&&i.update();const s=e[t].legendView();s&&s.update()}}const p=this.mainSeries().syncModel()
|
||
;if(this.crossHairSource().startMeasurePoint()||this._lineBeingCreated?this.lightUpdate():this.invalidate(b.InvalidationMask.cursor()),this._lineBeingCreated){const e=this._lineBeingCreated.linkKey;if(!this._isSettingsExternalPosition){this._lineBeingCreated.setLastPoint({index:o,price:n},r),this._lineBeingCreated.updateAllViews();const t=Object(s.ensureNotNull)(this._lineBeingCreated.lastPoint());if(t.price!==n||t.index!==o){h.setPosition(t.index,t.price,i);const e=this._timeScale.indexToCoordinate(t.index),r=l.priceToCoordinate(t.price,Object(s.ensureNotNull)(c));h.saveOriginCoords(e,r)}if(p&&e){const i=this._timeScale.points().roughTime(t.index,p.projectTime.bind(p));Object(M.setLineToolLastPoint)({model:this,linkKey:e,point:{timeStamp:Object(s.ensureNotNull)(i),price:t.price}})}}}if(!this._isSettingsExternalPosition&&null!==this._lineBeingEdited&&null!==this._linePointBeingEdited){this.changeLinePoint({index:o,price:n},r);const e=this._lineBeingEdited.getPoint(this._linePointBeingEdited);if(null!==e){h.setPosition(e.index,e.price,i);const t=this._timeScale.indexToCoordinate(e.index),r=l.priceToCoordinate(e.price,Object(s.ensureNotNull)(c));h.saveOriginCoords(t,r)}}this._syncCrosshair(r)}setExternalPosition(e,t){let i;const r=this.crossHairSource();if(r.setOnHoveredChartWidget(!1),null!==e&&Object(A.isNumber)(e.timeStamp)){const t=this.mainSeries().syncModel();if(t){const s=this.createSyncPoint(e.syncModel,t).sourceTimeToTargetTime(e.timeStamp);i=this._timeScale.points().roughIndex(s,t.distance.bind(t))}}if(null!==e&&null!=i&&Number.isFinite(i)&&void 0!==e.price&&Number.isFinite(e.price)){this._isSettingsExternalPosition=!0;const n=Object(s.ensureNotNull)(this.paneForSource(this.mainSeries())),o=this._timeScale.indexToCoordinate(i),a=Object(s.ensureNotNull)(n.mainDataSource()).firstValue();if(null!==a){const i=this.mainSeries().priceScale().priceToCoordinate(e.price,a);r.clearOriginCoords(),this.setCurrentPosition(o,i,n,t)}return r.setOnHoveredChartWidget(!1),void(this._isSettingsExternalPosition=!1)}null!=i&&Number.isFinite(i)?(r.clearOriginCoords(),r.setPosition(i,NaN,null)):(r.clearPosition(),Object(s.ensureNotNull)(r.dataWindowView()).update());const n=this.dataSources();for(let s=n.length;s--;){const e=n[s].dataWindowView();e&&e.update();const t=n[s].legendView();t&&t.update()}this.invalidate(b.InvalidationMask.cursor())}startScaleTime(e){this._timeScale.startScale(e)}scaleTimeTo(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)}endScaleTime(){this._timeScale.endScale(),this.lightUpdate(),this.recalcVisibleRangeStudies()}resetTimeScale(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.recalcVisibleRangeStudies(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)}startScalePrice(e,t,i){e.startScalePrice(t,i)}scalePriceTo(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,b.InvalidationLevel.Light)),
|
||
this._setScalesResetAvailable(!0)}endScalePrice(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,b.InvalidationLevel.Light))}resetPriceScale(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,b.InvalidationLevel.Light))}restorePriceScaleState(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,b.InvalidationLevel.Light))}currentTool(){return this._currentTool}setCurrentTool(e){this._currentTool!==e&&(Object(L.isLineToolName)(e)&&this.selectionMacro(e=>{e.clearSelection()}),this._currentTool=e,this._phantomSourceContainer.onToolChanged())}onRearrangePanes(){return this._onRearrangePanes}finishLineTool(e){Object(M.drawOnAllCharts)().value()&&e.linkKey&&e.isSynchronizable()&&Object(M.finishLineTool)({linkKey:e.linkKey,model:this})}startChangingLinetool(e,t,i,r,n){this._lineBeingEdited=e,this._linePointBeingChanged=t||null,this._linePointBeingEdited=void 0===i?null:i,M.isToolEditingNow.setValue(!0),this._lineBeingEdited.startChanging(i,t,n);const o=Object(s.ensureNotNull)(this.paneForSource(e));this._lineBeingEdited.startDragPoint&&void 0!==i&&void 0!==t&&this._lineBeingEdited.startDragPoint(i,t),n||void 0===i||void 0===t||this._lineBeingEdited.setPoint(i,t,r,n),this._lineBeingEdited.updateAllViews();const a=this._paneInvalidationMask(o,b.InvalidationLevel.Light);if(this.invalidate(a),e.linkKey&&e.isSynchronizable()&&void 0!==i&&void 0!==t){const n=Object(s.ensureNotNull)(this.externalTimeStamp(t.index));Object(M.startChangingLineTool)({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:n},pointIndex:i,envState:r||null})}}createLineTool(e,t,i,n,a,l){if(Object(s.assert)(Object(L.isLineToolName)(i),"Cannot create unknown line tool: "+i),"LineToolExecution"!==i&&Object(o.trackEvent)("drawings","Study_Drawing_"+i),n){const e=n.state();n=Object(L.createLineToolProperties)(i,e)}const c=Object(L.createLineTool)(i,this,n,null),h=!c.linkKey&&!a;Object(M.drawOnAllCharts)().value()?c.linkKey=a||Object(O.randomHash)():c.linkKey=a,l=l||Object(s.ensureNotNull)(e.mainDataSource()),n||(c.properties().currencyId.setValue(Object(s.ensureNotNull)(l.symbolSource()).currency()),c.properties().unitId.setValue(Object(s.ensureNotNull)(l.symbolSource()).unit())),c.setOwnerSource(l);const u=e.defaultPriceScale();let d;if(e.addDataSource(c,u,!1),c.isFixed()){const i=Object(s.ensureNotNull)(Object(s.ensureNotNull)(e.mainDataSource()).firstValue()),n=this._timeScale.indexToCoordinate(t.index),o=u.priceToCoordinate(t.price,i);d=c.addFixedPoint(new r.Point(n,o))}else d=c.addPoint(t);return d||(this._lineBeingCreated=c,this._paneBeingCreatedLineOn=e,M.isToolCreatingNow.setValue(!0)),h&&c.enableCurrentIntervalVisibility(),this.fullUpdate(),c}endChangingLinetool(e,t){const i=Object(s.ensureNotNull)(this._lineBeingEdited),r=i.endChanging(!1,e);this._lineBeingEdited=null,M.isToolEditingNow.setValue(!1),this._linePointBeingEdited=null,this._linePointBeingChanged=null,this.lightUpdate();const n={
|
||
points:i.normalizedPoints(),interval:this.mainSeries().interval()};i.linkKey&&i.isSynchronizable()&&Object(M.finishChangingLineTool)({model:this,linkKey:i.linkKey,symbol:this.mainSeries().symbol(),finalState:n,changes:r})}continueCreatingLine(e,t,i,r){const n=Object(s.ensureNotNull)(this._lineBeingCreated),o=n.addPoint(e,t,i);n.updateAllViews();const a=new b.InvalidationMask(b.InvalidationLevel.Light);return o&&(this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,M.isToolCreatingNow.setValue(!1)),this.invalidate(a),o}cancelCreatingLine(){if(!this._lineBeingCreated)return;const e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),M.isToolCreatingNow.setValue(!1),Object(M.drawOnAllCharts)().value()&&e.isSynchronizable()&&Object(M.cancelLineTool)({model:this})}lineBeingCreated(){return this._lineBeingCreated}paneBeingCreatedLineOn(){return this._paneBeingCreatedLineOn}lineCancelled(){return this._lineCancelled}isPhantomLine(e){return this._phantomSourceContainer.source()===e}changeLinePoint(e,t,i){const r=Object(s.ensureNotNull)(this._lineBeingEdited),n=Object(s.ensureNotNull)(this._linePointBeingEdited);let o=e.price,a=e.index;if(r.setPoint(n,e,t),!i){const e=r.getPoint(n);null!==e&&(a=e.index,o=e.price)}if(r.updateAllViews(),this.lightUpdate(),!i&&r.linkKey&&r.isSynchronizable()){const e=Object(s.ensureNotNull)(this._linePointBeingChanged),i={indexesChanged:a!==e.index,pricesChanged:o!==e.price},l=r.getChangePointForSync(n);if(null!==l){const e=this.externalTimeStamp(a);null!==e&&(o=l.price,Object(M.changeLineTool)({linkKey:r.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:o,timeStamp:e},envState:t,changes:i}))}}}changeLinePoints(e,t,i){const r=e.points();!i&&e.linkKey&&e.isSynchronizable()&&t.forEach((t,i)=>{const n=r[i],o=n.price!==t.price,a=n.index!==t.index;if(e.getChangePointForSync(i)){const i=Object(s.ensureNotNull)(this.externalTimeStamp(t.index));Object(M.changeLineTool)({linkKey:Object(s.ensureDefined)(e.linkKey),model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:i},changes:{pricesChanged:o,indexesChanged:a}})}}),e.setPoints(t),e.updateAllViews(),this.lightUpdate()}addCustomSource(e,t,i=a.a.Foreground){this._customSourcesMap.has(e)&&G.logWarn(`Attempt to add the same custom source multiple time "${e}"`),G.logNormal(`Adding custom source "${e}"`);const s=t(e,this);switch(i){case a.a.Background:this._bgCustomSources.push(s);break;case a.a.Foreground:this._fgCustomSources.push(s);break;case a.a.Topmost:this._topmostCustomSources.push(s);break;default:throw new Error("Unknown custom sources layer "+i)}this._allCustomSources.push(s),this._customSourcesMap.set(e,s),this.lightUpdate()}removeCustomSource(e){this._removeCustomSource(e),this.lightUpdate()}hasCustomSource(e){return this._customSourcesMap.has(e)}customSourceForName(e){return this._customSourcesMap.get(e)||null}customSourceName(e){let t=null;return this._customSourcesMap.forEach((i,s)=>{i===e&&(t=s)}),t}customSources(e){switch(e){
|
||
case a.a.Background:return this._bgCustomSources;case a.a.Foreground:return this._fgCustomSources;case a.a.Topmost:return this._topmostCustomSources;default:return this._allCustomSources}}addMultiPaneSource(e){this._multiPaneSources.push(e),this.lightUpdate()}removeMultiPaneSource(e){const t=this._multiPaneSources.indexOf(e);-1===t?G.logWarn("Attempt to remove multi-pane source which does not exist in the model"):this._multiPaneSources.splice(t,1),this.lightUpdate()}multiPaneSources(e){return this._multiPaneSources.filter(t=>!e.hasDataSource(t))}dateTimeFormatter(){return this._dateTimeFormatter}dateFormatter(){return this._dateFormatter}timeFormatter(){return this._timeFormatter}sessions(){return Object(s.ensureNotNull)(this._sessions)}createSessions(e){Object(s.assert)(null===this._sessions,"Sessions are already created"),this.addCustomSource("sessions",(t,i)=>(this._sessions=new p.Sessions(t,i,e),this._sessions.start(),this._sessions),a.a.Background)}createPrePostMarket(e){this.addCustomSource("prePostMarket",(t,i)=>new PrePostMarket(t,i,e))}theme(){const e=this.properties().paneProperties.state();delete e.topMargin,delete e.bottomMargin;const t=this.mainSeries().state().state;delete t.symbol,delete t.interval,delete t.currencyId,delete t.unitId;const i={mainSourceProperties:t,sessions:this.sessions().properties().state(),chartProperties:{paneProperties:e,scalesProperties:this.properties().scalesProperties.state()}};return i.version=this.version(),i}shouldBeSavedEvenIfHidden(){return this._shouldBeSavedEvenIfHidden}setShouldBeSavedEvenIfHidden(e){this._shouldBeSavedEvenIfHidden=e}externalTimeStamp(e){const t=this.mainSeries().syncModel();return this.timeScale().points().roughTime(e,t&&t.projectTime.bind(t))}syncESD(){null!==this._esdWatcher&&this._esdWatcher.syncESDStudies()}recalcVisibleRangeStudies(e){null!==this._recalcVRStudiesParams.timerId&&clearTimeout(this._recalcVRStudiesParams.timerId),this._recalcVRStudiesParams.force=this._recalcVRStudiesParams.force||Boolean(e),this._recalcVRStudiesParams.timerId=setTimeout(()=>this._recalcVisibleRangeStudiesImpl(this._recalcVRStudiesParams),500)}alertsWatcher(){return this._alertsWatcher}showLegend(){return this._showLegendProperty}id(){return this._id}recalculatePriceRangeOnce(){const e=this.mainSeries();for(const t of this._panes)for(const i of t.priceDataSources())i.symbolSource()===e&&i.disablePriceRangeReady()}invalidate(e){var t;null===(t=this._invalidateHandler)||void 0===t||t.call(this,e)}appliedTimeFrame(){return this._appliedTimeFrame.appliedTimeFrame()}_createESDWatcher(){}_updateDateTimeFormatter(){const e=P.dateFormatProperty.value(),t=new C.DateFormatter(e);if(this._dateFormatter=t,this.mainSeries().isDWM())this._dateTimeFormatter=t,this._timeFormatter=new x.TimeFormatter("%h:%m");else{const t=h.Interval.parse(this.mainSeries().interval()),i=t.isSeconds()||t.isTicks()?"%h:%m:%s":"%h:%m";this._dateTimeFormatter=new w.a({dateFormat:e,timeFormat:i,dateTimeSeparator:" "}),this._timeFormatter=new x.TimeFormatter(i)}}_setScalesResetAvailable(e){
|
||
this._isScalesResetAvailable!==e&&(this._isScalesResetAvailable=e,this._isScalesResetAvailableChanged.fire())}_invalidationMaskForSource(e,t=b.InvalidationLevel.Light){if(e===this.crossHairSource())return b.InvalidationMask.cursor();if(this._watermarkSource===e)return this._paneInvalidationMask(Object(s.ensureNotNull)(this.paneForSource(this.mainSeries())),t);if(-1!==this._allCustomSources.indexOf(e)){const e=new b.InvalidationMask;return e.invalidateAll(t),e}if(!Object(l.a)(e))return null;if(e.isMultiPaneEnabled())return new b.InvalidationMask(t);const i=this.paneForSource(e);return null!==i?this._paneInvalidationMask(i,t):null}_paneInvalidationMask(e,t=b.InvalidationLevel.Light){const i=new b.InvalidationMask,s=this._panes.indexOf(e);return i.invalidateAllPane(s,t),i}_invalidationMaskForSourcePriceScale(e,t=b.InvalidationLevel.Light){if(!Object(l.a)(e))return new b.InvalidationMask(t);const i=this.paneForSource(e);if(null===i)return null;let s=e.priceScale();if(null===s)return null;const r=this._panes.indexOf(i);let n=i.priceScalePosition(s);if("overlay"===n){const e=this._panes[r].defaultPriceScale();s=e,n=i.priceScalePosition(e)}const o=i.priceScaleIndex(s,n);if(void 0===o)return null;const a=new b.InvalidationMask;return a.invalidatePriceScale(r,n,o,t),a}_removeCustomSource(e){const t=this._customSourcesMap.get(e);if(void 0===t)return void G.logWarn(`Attempt to remove custom source which does not exist in the model - "${e}"`);G.logNormal(`Removing custom source "${e}"`),this.selectionMacro(e=>{e.removeSourceFromSelection(t)});const i=q(this._bgCustomSources,t),r=q(this._fgCustomSources,t),n=q(this._topmostCustomSources,t),o=q(this._allCustomSources,t);Object(s.assert)(i||r||n,"Source should be presented in one of the layers"),Object(s.assert)(o,"Source should be presented in the array"),this._customSourcesMap.delete(e),t.destroy()}_updateShowLegendProperty(){const e=this._properties.childs().paneProperties.childs().legendProperties.childs().showLegend,t=this._showLegendProperty;if(e.value())t.setValue(!0);else{for(const e of this._panes){let i=0;for(const s of e.dataSources())if(s!==this.mainSeries()&&null!==s.statusView()&&(i++,i>1))return void t.setValue(!1)}t.setValue(!0)}}_pointToPercentPosition(e,t){return{x:e.x/this._timeScale.width(),y:e.y/Object(s.ensureNotNull)(Object(s.ensureNotNull)(t.mainDataSource()).priceScale()).height()}}_percentPositionToPoint(e,t){const i=e.x*this._timeScale.width(),n=e.y*Object(s.ensureNotNull)(Object(s.ensureNotNull)(t.mainDataSource()).priceScale()).height();return new r.Point(i,n)}_recalcVisibleRangeStudiesImpl(e){if(e.timerId=null,this.timeScale().isEmpty())return;const t=this.timeScale().visibleBarsStrictRange();if(null===t)return;const i=this.mainSeries().nearestData(t.firstBar(),F.PlotRowSearchMode.NearestRight),s=this.mainSeries().nearestData(t.lastBar(),F.PlotRowSearchMode.NearestLeft),r=this.mainSeries().bars().lastIndex(),n=i?i.index:void 0,o=s?s.index:void 0,a=n===e.oldStartVisibleIndex,l=o===e.oldEndVisibleIndex;if(a&&l&&!e.force)return;e.force=!1,
|
||
e.oldStartVisibleIndex=void 0!==n?n:NaN,e.oldEndVisibleIndex=void 0!==o?o:NaN;const c={first_visible_bar_time:1e3*Math.floor(i&&i.value?i.value[0]:0),last_visible_bar_time:1e3*Math.floor(s&&s.value?s.value[0]:0),subscribeRealtime:s&&s.index===r},h=e.studies||this.priceDataSources();e.studies=void 0;for(const u of h)if(Object(_.isStudy)(u)){const e=u.metaInfo().inputs,t=[];for(const s of e)c.hasOwnProperty(s.id)&&t.push(s.id);const i=u.properties().inputs;for(const s of t)i[s].setValueSilently(c[s]);t.length>0&&i.listeners().fire(i)}}_getAllSources(e){const t=[];for(const i of this._panes){const s=i.sourcesByGroup().all();for(const i of s)e(i)&&t.push(i)}return t}_getAvailableCurrencies(){return this._options.currencyConversionEnabled?Object(A.isArray)(this._availableCurrenciesList)?this._availableCurrenciesList:(null!==this._availableCurrenciesList||(this._availableCurrenciesList=this.chartApi().availableCurrencies(),this._availableCurrenciesList.then(e=>{this._destroyed||(this._availableCurrenciesList=e,this.lightUpdate())}).catch(e=>{G.logWarn("An error occurred while getting currencies config: "+e)})),[]):[]}_getAvailableUnits(){return this._options.unitConversionEnabled?this._availableUnitsObject instanceof Promise||null===this._availableUnitsObject?(null!==this._availableUnitsObject||(this._availableUnitsObject=this.chartApi().availableUnits(),this._availableUnitsObject.then(e=>{this._destroyed||(this._availableUnitsObject=e,this.lightUpdate())}).catch(e=>{G.logWarn("An error occurred while getting units config: "+e)})),{}):this._availableUnitsObject:{}}_getBackgroundColor(e){const t=this._properties.childs().paneProperties.childs();if(t.backgroundType.value()===D.ColorType.Gradient){const i=t.backgroundGradientStartColor.value(),s=t.backgroundGradientEndColor.value();return e?i:s}return t.background.value()}_updateBackgroundColor(){this._backgroundColor.setValue(this._getBackgroundColor()),this._backgroundTopColor.setValue(this._getBackgroundColor(!0))}_syncCrosshair(e){if(!this._isSettingsExternalPosition){const t=this._undoModel.chartWidget(),i=this._undoModel.mainSeries(),s=i.syncModel(),r=this._undoModel.crossHairSource(),n=r.pane;if(null!==s&&null!==n){const o={timeStamp:this._timeScale.points().roughTime(r.index,s.projectTime.bind(s)),syncModel:s};n.mainDataSource()===i&&(o.price=r.price,o.symbol=i.symbol()),o.syncModel=s;let a=this._lineBeingCreated||null!==this._linePointBeingEdited||Boolean(this._sourcesBeingMoved.length);a=a&&Object(M.drawOnAllCharts)().value(),t.chartWidgetCollection().syncCrosshair(o,t,a,e)}this._phantomSourceContainer.onCursorPositionUpdated()}}}},gQ5K:function(e,t,i){"use strict";i.r(t),i.d(t,"DateFormatter",(function(){return n}));var s=i("kcTO"),r=i("e1ZQ");class n{constructor(e="yyyy-MM-dd"){this._dateFormatFunc=r.b[e]}format(e){return s.customFormatters&&s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)}formatLocal(e){
|
||
return s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.formatLocal?s.customFormatters.dateFormatter.formatLocal(e):s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)}}},gWck:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesLegendView",(function(){return o}));var s=i("cXAR"),r=i("C2K+");const n=window.t("At close");class o extends s.SeriesDataWindowView{constructor(e,t){super(e,t),this._showBarChange=t.properties().paneProperties.legendProperties.showBarChange,this._showSeriesOHLC=t.properties().paneProperties.legendProperties.showSeriesOHLC,this._showBarChange.subscribe(this,this.update),this._showSeriesOHLC.subscribe(this,this.update)}isValuesVisible(){return this._showSeriesOHLC.value()||this._showBarChange.value()}additional(){return null}marketTitle(){const e=this._series.marketStatusModel().status().value();return this._showLastPriceAndChangeOnly()&&("pre_market"===e||"post_market"===e)?n+":":""}destroy(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)}_createValuesProvider(e,t){return new r.a(e,t)}}},gWrr:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));const s=new WeakMap;function r(e,t){let i,r;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,s&&(r=s.get(i)),r||(r=i.ownerDocument.createRange(),r.selectNodeContents(i),s&&s.set(i,r)),r.createContextualFragment(e)}function n(e,t){const i=r(e,t);let s;if("firstElementChild"in i)s=i.firstElementChild;else{s=null;for(let e=0;e<i.childNodes.length;e++){const t=i.childNodes[e];if(1===t.nodeType){s=t;break}}}return null!==s&&i.removeChild(s),s}},gaBL:function(e,t,i){"use strict";i.r(t),i.d(t,"sourceNewCurrencyOnPinningToPriceScale",(function(){return r}));var s=i("/tGj");function r(e,t,i,r){let n=null;if(i.currencyConversionEnabled()&&Object(s.isSymbolSource)(e)){const s=i.availableCurrencies(),o=t.currency(s),a=e.currency();null!==o&&null!==o.selectedCurrency&&!o.allCurrenciesAreOriginal&&o.selectedCurrency!==a&&(r&&null===a||null!==a&&s.convertible(a))&&(n=o.selectedCurrency)}return n}},gyZD:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("GEp6").distanceToSegment,n=i("Zp/P"),o=i("VdBB").HitTestResult,a=i("cPgM").ScaledPaneRenderer;t.PaneRendererLine=TradingView.PaneRendererLine=class extends a{constructor(e){super(),this.items=e.items,this._simpleMode=e.simpleMode,this.barSpacing=e.barSpacing,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth,this.lineStyle=e.lineStyle,this.withMarkers=e.withMarkers,this.hittest=e.hittest,this.ignorePaletteLineWidth=e.ignorePaletteLineWidth,this.forceLineColor=!!e.forceLineColor}_drawImpl(e){e.lineCap="square",e.lineJoin="round",e.strokeStyle=this.lineColor,e.fillStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,n.setValidLineStyle(e,this.lineStyle),this._simpleMode?this._drawSimpleMode(e):this._drawLines(e)}_drawSimpleMode(e){if(e.beginPath(),this.walkLine(e,this.items),e.stroke(),this.withMarkers){var t,i=this.lineWidth+2,s=2*Math.PI;e.beginPath()
|
||
;for(var r=this.items.length;r--;)(t=this.items[r])&&(e.moveTo(t.x,t.y),e.arc(t.x,t.y,i,0,s));e.fill()}}walkLine(e,t,i,s){if(t){for(var r,o,a,l,c,h=.25*this.barSpacing,u=n.coordinateIsValid,d=0,p=t.length;d<p;d++){var _=t[d];if(u(_.y)){o=_,r=d;break}}if(void 0!==r&&o)for(d=r,p=t.length;d<p;d++){l=t[d],c=t[d+1]||{};const n=Math.round(l.x);if(u(l.y))if(a&&u(a.y))e.lineTo(n,l.y),i&&!u(c.y)&&e.lineTo(n,s);else if(c&&u(c.y))i?(d!==r&&e.lineTo(n,s),e.lineTo(n,l.y)):e.moveTo(n,l.y);else if(i){if(0===d)continue;d!==r&&e.lineTo(n-h,s),e.lineTo(n-h,l.y),e.lineTo(n+h,l.y),e.lineTo(n+h,s)}else e.moveTo(n-h,l.y),e.lineTo(n+h,l.y);a=l}}}_drawLines(e){if(this.items.length){var t,i,s,r=.25*this.barSpacing,o=n.coordinateIsValid;e.beginPath();var a=this.items[0];a&&e.moveTo(a.x,a.y);for(var l=e.strokeStyle,c=e.lineWidth,h=e.lineStyle,u=1;u<this.items.length;++u){var d,p,_;t=this.items[u-1],i=this.items[u],s=this.items[u+1],i.style&&!this.forceLineColor?(d=i.style.color,p=i.style.width,_=i.style.style):(d=this.lineColor,p=this.lineWidth,_=this.lineStyle),this.ignorePaletteLineWidth&&(p=this.lineWidth),(d!==l||p!==c||_!==h)&&(l=d,c=p,h=_,e.stroke(),e.beginPath(),e.strokeStyle=d,e.lineWidth=p,n.setValidLineStyle(e,_),e.moveTo(t.x,t.y)),m(t,i,s)}e.stroke()}function m(t,i,s){o(i.y)&&(o(t.y)?e.lineTo(i.x,i.y):s&&o(s.y)?e.moveTo(i.x,i.y):(e.moveTo(i.x-r,i.y),e.lineTo(i.x+r,i.y)))}}hitTest(e){for(var t,i,a,l,c=n.interactionTolerance().series+this.lineWidth/2,h=0,u=this.items.length-1;u-h>2;){var d=Math.round((u+h)/2);this.items[d].x<=e.x?h=d:u=d}h=Math.max(1,h-1),u=Math.min(this.items.length-1,u+1);for(var p=h;p<=u;++p)if(t=this.items[p-1],i=this.items[p],a=t.x,l=i.x,r(new s(a,t.y),new s(l,i.y),new s(e.x,e.y)).distance<=c)return this.hittest?this.hittest:new o(o.REGULAR);return null}}},gzUS:function(e,t,i){"use strict";i.r(t),i.d(t,"PointsetsManager",(function(){return o}));var s=i("LxhU"),r=i("txPx");const n=Object(r.getLogger)("ChartApi.PointsetsManager");class o{constructor(){this._pointsetsDataBySymbol=new Map}destroy(){this._pointsetsDataBySymbol.clear()}createPointset(e,t,i,s,r){let o=this._pointsetsDataBySymbol.get(t);void 0===o&&(o=new Map,this._pointsetsDataBySymbol.set(t,o));const a=[];for(const l of s){const[t,i]=l;"number"!=typeof t||Number.isNaN(t)?n.logWarn(`Pointset time is invalid: id=${e}, ${t} of type ${typeof t}`):a.push({point:l,extrapolation:r.extrapolateTimeWithOffsetToTime(1e3*t,i)})}s.length===a.length&&o.set(e,{resolution:i,points:a})}removePointset(e){const t=[];this._pointsetsDataBySymbol.forEach((i,s)=>{i.delete(e),0===i.size&&t.push(s)});for(const i of t)this._pointsetsDataBySymbol.delete(i)}invalidatePointsetsForSymbol(e,t){const i=this._pointsetsDataBySymbol.get(e);void 0!==i&&i.forEach((e,i)=>{if(s.Interval.isEqual(e.resolution,t))for(const t of e.points)null!==t.extrapolation&&t.extrapolation.exact&&(t.extrapolation.exact=!1)})}getUpdatesForSymbol(e,t,i,s){const r=new Map,n=this._pointsetsDataBySymbol.get(e);return void 0!==n&&n.forEach((e,n)=>{const o=this._refreshPointsetData(e,t,i,s);null!==o&&r.set(n,o)}),
|
||
r}_refreshPointsetData(e,t,i,r){if(s.Interval.isEqual(e.resolution,t))for(let s=0;s<e.points.length;++s){const t=e.points[s];if(null!==t.extrapolation&&t.extrapolation.exact)continue;const[r,n]=t.point;t.extrapolation=i.extrapolateTimeWithOffsetToTime(1e3*r,n)}const o=[];for(let s=0;s<e.points.length;++s){const i=e.points[s];if(null===i.extrapolation)return null;const a=r.indexOfTime(i.extrapolation.timeMs);if(null===a)return n.logWarn(`Cannot get index of time: time=${i.extrapolation.timeMs}, ${e.resolution} -> ${t}`),null;o.push({index:s,value:[a.index,a.timeMs/1e3]})}return o}}},h24c:function(e,t,i){"use strict";i.r(t),i.d(t,"parseIntervalValue",(function(){return c})),i.d(t,"intervalIsSupported",(function(){return h})),i.d(t,"canShowSpreadActions",(function(){return u})),i.d(t,"globalKeypressMatches",(function(){return d})),i.d(t,"skipAccept",(function(){return p})),i.d(t,"syncSymbolSearch",(function(){return _})),i.d(t,"setLinkingResolution",(function(){return m}));var s=i("Kxc7"),r=i("pPtI"),n=i("PT1i"),o=i("LxhU"),a=i("ePL1");const l=new RegExp("^"+a.types.QUANDL,"i");function c(e){let t;t=/^[,\s]*(\d*)\s*([hdwmst]?)\s*$/i;const i=t.exec(e)||[],s=~~i[1],r=i[2]&&i[2].toUpperCase()||null,n={qty:!s&&r?1:s,unit:r};return n.error=!s&&!r,n.intraday=!(n.error||n.unit&&"H"!==n.unit&&"S"!==n.unit&&"T"!==n.unit),n}function h(e){if(s.enabled("allow_supported_resolutions_set_only")){const t=o.Interval.normalize(e);return null!==t&&Object(r.isAvailable)(t)}{const t=c(e);if(t.error)return!1;if(t.intraday)return n.linking.intraday.value();{const e=n.linking.supportedResolutions.value();return!e||null!==t.unit&&!!~e.indexOf(t.unit)}}}function u(){let e=!1;return s.enabled("show_spread_operators")&&(e=!0),e}function d(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}function p(e,t){return!t&&(e===n.linking.symbol.value()||e===n.linking.seriesShortSymbol.value())}function _(e,t){let i=n.linking.symbol.value()||"";i=function(e,t){if(!t)return e;if(l.test(e)){const t=e.split(/\//);t.length&&(e=t[t.length-1])}else e=n.linking.seriesShortSymbol.value()||e;return e}(i,t),e.val(i)}function m(e){Object(r.setLastUsedResolution)(e),n.linking.interval.setValue(e)}},hBTJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("Eyy1"),r=i("aO4+"),n=i("GEp6"),o=i("f6yo");function a(e,t){var i=e.A,s=t.A,n=e.B,o=t.B,a=e.C,l=t.C,c=i*o-s*n;if(Math.abs(c)<1e-6)return null;var h=(n*l-o*a)/c,u=(s*a-i*l)/c;return new r.Point(h,u)}function l(e,t,i,s){var r=function(e,t,i,s){var r=t.subtract(e),n=s.subtract(i),o=r.x*n.y-r.y*n.x;if(Math.abs(o)<1e-6)return null;var a=e.subtract(i);return(a.y*n.x-a.x*n.y)/o}(e,t,i,s);if(null===r)return null;var o=t.subtract(e).scaled(r).add(e),a=n.distanceToSegment(i,s,o);return Math.abs(a.distance)<1e-6?r:null}function c(e,t){for(var i=0,s=e;i<s.length;i++){var n=s[i];if(r.equalPoints(n,t))return!1}return e.push(t),!0}function h(e,t){
|
||
return!(e.length>0&&r.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function u(e,t){for(var i=[],s=0;s<e.length;++s){var n=e[s],l=e[(s+1)%e.length],c=r.lineThroughPoints(n,l);if(o.pointInHalfplane(n,t)){if(h(i,n),!o.pointInHalfplane(l,t))null!==(u=a(c,t.edge))&&h(i,u)}else if(o.pointInHalfplane(l,t)){var u;null!==(u=a(c,t.edge))&&h(i,u)}}return i.length>=3?i:null}t.intersectLineSegmentAndBox=function(e,t){var i=e[0].x,s=e[0].y,n=e[1].x,o=e[1].y,a=t.min.x,l=t.min.y,c=t.max.x,h=t.max.y;function u(e,t,i,s,r,n){var o=0;return e<i?o|=1:e>r&&(o|=2),t<s?o|=4:t>n&&(o|=8),o}for(var d=u(i,s,a,l,c,h),p=u(n,o,a,l,c,h),_=!1,m=0;;){if(m>1e3)throw new Error("Cohen - Sutherland algorithm: infinity loop");if(m++,!(d|p)){_=!0;break}if(d&p)break;var f=d||p,g=void 0,v=void 0;8&f?(g=i+(n-i)*(h-s)/(o-s),v=h):4&f?(g=i+(n-i)*(l-s)/(o-s),v=l):2&f?(v=s+(o-s)*(c-i)/(n-i),g=c):(v=s+(o-s)*(a-i)/(n-i),g=a),f===d?d=u(i=g,s=v,a,l,c,h):p=u(n=g,o=v,a,l,c,h)}return _?r.equalPoints(r.point(i,s),r.point(n,o))?r.point(i,s):r.lineSegment(r.point(i,s),r.point(n,o)):null},t.intersectLines=a,t.intersectLineSegments=l,t.intersectLineAndBox=function(e,t){var i=t.min.x,n=t.min.y,o=t.max.x,a=t.max.y;if(0===e.A){var l=-e.C/e.B;return n<=l&&l<=a?r.lineSegment(r.point(i,l),r.point(o,l)):null}if(0===e.B){var h=-e.C/e.A;return i<=h&&h<=o?r.lineSegment(r.point(h,n),r.point(h,a)):null}var u=[],d=function(t){var i=function(e,t){return-(e.C+e.A*t)/e.B}(e,t);n<=i&&i<=a&&c(u,new r.Point(t,i))},p=function(t){var s=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);i<=s&&s<=o&&c(u,new r.Point(s,t))};switch(d(i),p(n),d(o),p(a),u.length){case 0:return null;case 1:return u[0];case 2:return r.equalPoints(u[0],u[1])?u[0]:r.lineSegment(u[0],u[1])}return s.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var s=l(e,t,i.min,new r.Point(i.max.x,i.min.y)),n=l(e,t,new r.Point(i.max.x,i.min.y),i.max),a=l(e,t,i.max,new r.Point(i.min.x,i.max.y)),c=l(e,t,new r.Point(i.min.x,i.max.y),i.min),h=[];if(null!==s&&s>=0&&h.push(s),null!==n&&n>=0&&h.push(n),null!==a&&a>=0&&h.push(a),null!==c&&c>=0&&h.push(c),0===h.length)return null;h.sort((function(e,t){return e-t}));var u=o.pointInBox(e,i)?h[0]:h[h.length-1];return e.addScaled(t.subtract(e),u)},t.intersectPolygonAndHalfplane=u,t.intersectPolygons=function(e,t){for(var i=e,s=0;s<t.length&&null!==i;++s){var n=t[s],o=t[(s+1)%t.length],a=t[(s+2)%t.length],l=r.lineThroughPoints(n,o);i=u(i,r.halfplaneThroughPoint(l,a))}return i}},hGf4:function(e,t,i){"use strict";(function(e,t){var s,r=i("UXvI").default,n=i("hbEN").default,o=i("kcTO").PriceFormatter,a=i("IVMC"),l=i("e3/o"),c=i("i/Bj").parseUpdateMode,h=i("FIi8").deepExtend;function u(t,i){this.options=Object.assign({throttleTimeout:125},i),this._connected=!1,this._symbol_data={},this._subscriptions={},this.onConnect=new e,this.onDisconnect=new e,this._quoteApi=new s(window.ChartApiInstance),this._type=t||"full",this._delayUpdateFastSymbols=n(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},
|
||
this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}s=i("wi9r"),u.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},u.prototype.typeFields={},u.prototype.typeFields.simple=["base-currency-logoid","ch","chp","currency-logoid","currency_code","current_session","description","exchange","format","fractional","is_tradable","language","local_description","logoid","lp","lp_time","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"],u.prototype.typeFields.simpleDetailed=[].concat(u.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","rtc_time","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume","dividends_yield","timezone"]),u.prototype.typeFields.full=[],u.prototype.typeFields.watchlist=[].concat(u.prototype.typeFields.simple,["rchp","rtc","country_code","provider_id"]),u.prototype.typeFields.portfolio=["pro_name","short_name","exchange","description","sector","type","currency_code","currency_id","ch","chp","logoid","currency-logoid","base-currency-logoid","earnings_per_share_forecast_next_fq","earnings_release_next_date","earnings_release_date","earnings_per_share_fq","lp","volume","average_volume","market_cap_basic","total_revenue","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year","dps_common_stock_prim_issue_fy","dividends_yield"],u.prototype.connect=function(e){this._quoteApi.connect(this.quoteHandler.bind(this))},u.prototype.quoteHandler=function(e){var t=e.method,i=e.params;switch(t){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"quote_completed":this._connected&&this.onSymbolData({symbolname:i[0],complete:performance.now(),values:{}});break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},u.prototype.onConnected=function(){this.setFields();var e=Object.keys(this._symbol_data);e.length&&(this._quoteApi.quoteAddSymbols(e,{forcePermission:!0}),this._delayUpdateFastSymbols()),this.onConnect.fire()},u.prototype.setFields=function(){var e=u.prototype.typeFields[this._type];e&&e.length&&this._quoteApi.quoteSetFields(e)},u.prototype.onSymbolData=function(e){var t=e.symbolname,i=this._throttledSymbolData[t];i||(i=this._throttledSymbolData[t]={fnDispatch:r(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?h(i.cache,e):i.cache=e,i.fnDispatch(t)},u.prototype._parseUpdateMode=function(e){var t=c(e.update_mode);null!==t&&(e.update_mode=t.mode,e.update_mode_seconds=t.interval)},u.prototype.dipatchSymbolData=function(e){var t=this._symbol_data[e],i=this._throttledSymbolData[e].cache;if(delete this._throttledSymbolData[e].cache,this._symbol_data[e])for(var s in h(t,i),
|
||
t.values&&this._parseUpdateMode(t.values),this._subscriptions){var r=this._subscriptions[s];r.has(e)&&r.get(e).forEach((function(e){e(t,i)}))}},u.prototype.subscribe=function(e,t,i){this._subscriptions[e]=this._subscriptions[e]||new Map;var s=this._subscriptions[e];t=[].concat(t);var r=[];t.forEach((function(e){this._symbol_data[e]?s&&s.has(e)||this._symbol_data[e].subscribers_count++:(this._symbol_data[e]={subscribers_count:1},r.push(e)),s.has(e)||s.set(e,[]),s.get(e).push(i),s.get(e).fast=!0,this._symbol_data[e]&&this._symbol_data[e].values&&i(this._symbol_data[e],this._symbol_data[e])}),this),r.length&&this._connected&&(this._quoteApi.quoteAddSymbols(r,{forcePermission:!0}),this._delayUpdateFastSymbols())},u.prototype.unsubscribe=function(e,t,i){t=[].concat(t);for(var s=this._subscriptions[e],r=[],n=0;n<t.length;n++){var o=t[n];if(s)if(s.has(o)&&i){var a=s.get(o).indexOf(i);~a&&s.get(o).splice(a,1),s.get(o).length||s.delete(o)}else s.delete(o);s&&0===s.size&&delete this._subscriptions[e],this._symbol_data.hasOwnProperty(o)&&(s&&!s.has(o)&&this._symbol_data[o].subscribers_count--,this._symbol_data[o].subscribers_count||(delete this._symbol_data[o],r.push(o)))}r.length&&this._connected&&(this._quoteApi.quoteRemoveSymbols(r),this._delayUpdateFastSymbols())},u.prototype.setFastSymbols=function(e,t){if(this._subscriptions[e])for(var i=this._subscriptions[e],s=Array.from(i.keys()),r=0;r<s.length;++r){var n=s[r];i.get(n).fast=-1!==t.indexOf(n)}this._delayUpdateFastSymbols()},u.prototype._updateFastSymbols=function(){if(this._connected){var e=this._fastSymbols();0===e.length?this._quoteApi.quoteHibernateAll():this._quoteApi.quoteFastSymbols(e)}},u.prototype._delayUpdateFastSymbols=u.prototype._updateFastSymbols,u.prototype._fastSymbols=function(){var e=[];for(var t in this._subscriptions)for(var i=this._subscriptions[t],s=Array.from(i.keys()),r=0;r<s.length;++r){var n=s[r];i.get(n).fast&&e.push(n)}return e=a(e)},u.prototype.formatter=function(e,t){var i=this;if(this._waitingForFormatters[e])return this._waitingForFormatters[e];function s(e){var i=t&&!e.fractional?1:e.minmov;return new o(e.pricescale,i,e.fractional,e.minmove2)}var r=new Promise((function(t,r){if(i._formatterValuesCache[e])t(s(i._formatterValuesCache[e]));else{var n=l.guid();i.subscribe(n,[e],(function(o){"error"===o.status&&(i._waitingForFormatters[e]=null,r("Quotes snapshot is not received")),function(e){return e&&null!=e.pricescale&&null!=e.minmov}(o.values)&&(i._waitingForFormatters[e]=null,i._formatterValuesCache[e]=o.values,t(s(o.values)),i.unsubscribe(n,e))}))}}));return this._waitingForFormatters[e]=r,r},u.prototype.snapshot=function(e){var t=this;if(this._waitingForSnapshot[e])return this._waitingForSnapshot[e];var i=new Promise((function(i,s){if(t._snapshotValuesCache[e])i(t._snapshotValuesCache[e]);else{var r=l.guid();t.subscribe(r,[e],(function(n){"error"===n.status&&(t._waitingForSnapshot[e]=null,s("Quotes snapshot is not received"));var o=n.values;o&&o.minmov&&o.pricescale&&o.description&&(t._waitingForSnapshot[e]=null,
|
||
t._snapshotValuesCache[e]=o,i(o),t.unsubscribe(r,e))}))}}));return this._waitingForSnapshot[e]=i,i},TradingView.QuoteSessionMultiplexer=u,t&&t.exports&&(t.exports=u)}).call(this,i("aIyQ"),i("YuTi")(e))},hOqT:function(e,t,i){"use strict";i.r(t),i.d(t,"getTranslatedSymbolDescription",(function(){return s}));i("YFKU");function s(e){return e.description||""}},hP9j:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolPolyline",(function(){return l}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ocx9"),o=i("Zp/P"),a=i("Ss5c");class l extends a.LineDataSource{constructor(e,t){const s=t||l.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"C2CE")).then(t=>{this._setPaneViews([new t.PolylinePaneView(this,e)])})}pointsCount(){return-1}properties(){return super.properties()}name(){return"Polyline"}hasEditableCoordinates(){return!1}addPoint(e,t,i){var n;const a=Object(s.ensureNotNull)(this.priceScale()),l=this._model.timeScale().indexToCoordinate(e.index),c=e.price,h=Object(s.ensure)(null===(n=this.ownerSource())||void 0===n?void 0:n.firstValue()),u=a.priceToCoordinate(c,h),d=Object(o.interactionTolerance)().minDistanceBetweenPoints;if(this._points.length>0){const e=this._points[this._points.length-1],t=this._model.timeScale().indexToCoordinate(e.index),i=e.price,s=a.priceToCoordinate(i,h);if(new r.Point(l,u).subtract(new r.Point(t,s)).length()<d)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;const n=this._points[0],o=this._model.timeScale().indexToCoordinate(n.index),c=n.price,p=a.priceToCoordinate(c,h);if(new r.Point(l,u).subtract(new r.Point(o,p)).length()<d)return this.properties().childs().filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return super.addPoint(e,t,i)}setPoint(e,t,i){var n;super.setPoint(e,t,i);const a=this.priceScale();if(!(this._model.timeScale().isEmpty()||null===a||a.isEmpty()||e!==this._points.length-1&&0!==e)){const i=Object(s.ensure)(null===(n=this.ownerSource())||void 0===n?void 0:n.firstValue()),l=this._model.timeScale().indexToCoordinate(t.index),c=a.priceToCoordinate(t.price,i),h=e===this._points.length-1?this._points[0]:this._points[this._points.length-1],u=this._model.timeScale().indexToCoordinate(h.index),d=a.priceToCoordinate(h.price,i);new r.Point(l,c).subtract(new r.Point(u,d)).length()<Object(o.interactionTolerance)().minDistanceBetweenPoints&&this.properties().childs().filled.setValue(!0)}}static createProperties(e){const t=new n.DefaultProperty("linetoolpolyline",e);return l._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"91EF")).then(e=>e.PolylinesDefinitionsViewModel)}static _configureProperties(e){a.LineDataSource._configureProperties(e),e.addExclusion("filled")}}},hY0g:function(e,t,i){"use strict";(function(e){var t=i("txPx").getLogger("Common.WatchedValue");function s(){}function r(e){if(!(this instanceof r))return new r(e);arguments.length>0&&(this._value=e),this._listeners=[]}
|
||
r.prototype.value=function(){return this._owner?this._owner._value:this._value},r.prototype.setValue=function(e,i){var s=this._owner?this._owner:this;if("function"==typeof s.hook&&(e=s.hook(e)),s.writeLock)return s._value;if(!i&&s._value===e&&s.hasOwnProperty("_value"))return e;s._value=e;for(var r=s._listeners.slice(),n=0,o=0;o<r.length;o++){r[o].once&&(s._listeners.splice(o-n,1),n++);try{r[o].cb(e)}catch(a){t.logError(a.stack||a.message)}}return e},r.prototype.deleteValue=function(){var e=this._owner?this._owner:this;if(e.hasOwnProperty("_value")){if(e.writeLock)return e._value;delete e._value;for(var i=e._listeners.slice(),s=0,r=0;r<i.length;r++){i[r].once&&(e._listeners.splice(r-s,1),s++);try{i[r].cb()}catch(n){t.logError(n.stack||n.message)}}}},r.prototype.subscribe=function(e,i){if("function"!=typeof e)throw new TypeError("callback must be a function");var s=!!i&&!!i.once,r=!!i&&!!i.callWithLast,n=this._owner?this._owner:this;if(r&&n.hasOwnProperty("_value")){try{e(n._value)}catch(o){t.logError(o.stack||o.message)}if(s)return}n._listeners.push({cb:e,owner:this,once:!!i&&!!i.once})},r.prototype.unsubscribe=function(e){var t=this._owner?this._owner:this;void 0===e&&(e=null);for(var i=t._listeners,s=i.length;s--;)i[s].owner!==this&&t!==this||i[s].cb!==e&&null!==e||i.splice(s,1)},r.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},r.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var e=this._readonlyInstance=new s;return e.subscribe=this.subscribe.bind(this),e.unsubscribe=this.unsubscribe.bind(this),e.value=this.value.bind(this),e.when=this.when.bind(this),e.spawn=function(){return this.spawn().readonly()}.bind(this),this.destroy&&(e.destroy=this.destroy.bind(this)),e},r.prototype.spawn=function(e){var i=new r;return delete i._listeners,i._owner=this._owner||this,i.destroy=function(){if("function"==typeof e)try{e()}catch(i){t.logError(i.stack||i.message)}this.unsubscribe(),delete this._owner},i},r.prototype.when=function(e){var i=this;if(this.value())try{e()}catch(r){t.logError(r.stack||r.message)}else{var s=function(t){t&&(i.unsubscribe(s),e())};i.subscribe(s)}},r.prototype.opposite=function(){if(!this._opposite){var e=this,t=new r(!this.value());this.subscribe((function(e){t.setValue(!e)})),t.subscribe((function(t){e.setValue(!t)})),this._opposite=t}return this._opposite},"undefined"!=typeof window&&(window.WatchedValue=r),e&&e.exports&&(e.exports=r)}).call(this,i("YuTi")(e))},hY3j:function(e,t,i){"use strict";var s=i("PAcw").GridRenderer;function r(){this._id="grid",this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function n(e,t){this.source=e,this.pane=t,this._renderer=new s}r.prototype.id=function(){return this._id},r.prototype.paneViews=function(e){return[new n(this,e)]},n.prototype.update=function(){},n.prototype.renderer=function(){var e={}
|
||
;return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(e.horzLinesVisible=!0,e.vertLinesVisible=!0,e.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),e.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),e.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),e.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),e.priceMarks=this.pane.defaultPriceScale().marks(),e.timeMarks=this.pane.timeScale().marks(),e.w=this.pane.width(),e.h=this.pane.height(),this._renderer.setData(e),this._renderer)},t.Grid=r},hezA:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyPriceAxisView",(function(){return r}));var s=i("KcY8");class r extends s.a{constructor(e,t){super(),this._model=e.model(),this._source=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._source.model(),r=this._source.priceScale();if(null===r)return;if(!s.isPriceScaleVisible(r))return;const n=this._source.lastValueData(this._data.plotIndex,!1);if(n.noData)return;i.background=n.color;let o=n.color;"transparent"===o&&(o=this._model.properties().scalesProperties.backgroundColor.value()),i.textColor=this.generateTextColor(o),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate,this._showAxisLabel()&&(e.text=n.text,e.visible=!0),this._updatePaneRendererData(t)}_showPaneLabel(){return this._model.properties().scalesProperties.showStudyPlotLabels.value()}_showAxisLabel(){return this._model.properties().scalesProperties.showStudyLastValue.value()}_updatePaneRendererData(e){e.text="",this._showPaneLabel()&&(e.text=this._source.priceLabelText(this._data.plotIndex),e.visible=!0)}}},hfHJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("aO4+");t.identityMatrix=function(){return[[1,0,0],[0,1,0],[0,0,1]]},t.multiplyMatrices=function(e,t){for(var i=[[0,0,0],[0,0,0],[0,0,0]],s=0;s<3;s++)for(var r=0;r<3;r++)for(var n=0;n<3;n++)i[s][r]+=e[s][n]*t[n][r];return i},t.rotationMatrix=function(e){var t=Math.cos(e),i=Math.sin(e);return[[t,-i,0],[i,t,0],[0,0,1]]},t.scalingMatrix=function(e,t){return[[e,0,0],[0,t,0],[0,0,1]]},t.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},t.transformPoint=function(e,t){for(var i=[t.x,t.y,1],r=[0,0,0],n=0;n<3;n++)for(var o=0;o<3;o++)r[n]+=i[o]*e[n][o];return new s.Point(r[0],r[1])}},hsV8:function(e,t,i){"use strict";i.r(t),i.d(t,"ensureTimePointIndexIndex",(function(){return n})),i.d(t,"unpackNonSeriesData",(function(){return o}));var s=i("JmuD"),r=i("qySK");function n(e){if(e<0)throw new Error("TimePointIndexIndex should be non-negative integer");return e}async function o(e){if(""===e)return null;const t=JSON.parse(e);if(!Object(s.isObject)(t)||"function"==typeof t)throw new Error("Non-object content in the non-series envelope");if(Object(s.hasProperty)(t,"indexes_replace"))return{indexes_replace:!0};const i={indexes_replace:!1}
|
||
;if(Object(s.hasProperty)(t,"offsets")&&(i.offsets=t.offsets),Object(s.hasProperty)(t,"isUpdate")){if("boolean"!=typeof t.isUpdate)throw new Error('Invalid type of "isUpdate" field');i.isUpdate=t.isUpdate}return Object(s.hasProperty)(t,"data")&&(i.data=t.data),Object(s.hasProperty)(t,"graphicsCmds")&&(i.graphicsCmds=Object(r.b)(t.graphicsCmds)),i}},htUT:function(e,t,i){"use strict";i.r(t),i.d(t,"ChartChangesWatcher",(function(){return n}));var s=i("aIyQ"),r=i.n(s);class n{constructor(e,t,i){this._hasChanges=!1,this._undoHistory=e,this._chartSaver=t,this._globalEvents=i,this._onValueChanged=new r.a,this._subscribe()}destroy(){this._unsubscribe(),this._onValueChanged.destroy()}hasChanges(){return this._hasChanges}getOnChange(){return this._onValueChanged}_subscribe(){this._globalEvents.subscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().subscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().subscribe(this,this._handleChartSaved)}_unsubscribe(){this._globalEvents.unsubscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().unsubscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().unsubscribe(this,this._handleChartSaved)}_setChanges(e){this._hasChanges!==e&&(this._hasChanges=e,this._onValueChanged.fire(e))}_handleChartLoaded(){this._setChanges(!1)}_handleChangeUndoStack(e){e&&!e.customFlag("doesnt_affect_save")&&this._setChanges(!0)}_handleChartSaved(e){e&&this._setChanges(!1)}}},"hyq/":function(e,t,i){"use strict";i.r(t),i.d(t,"pivotPointsStandardStudyItem",(function(){return h}));var s=i("ocLq"),r=i("LxhU");class n{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 o{constructor(){this.pivots=[]}}function a(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function l(e,t){if(s.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())?(a(i,s.Std.interval(e)),i=s.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=s.Std.add_days_considering_dst("Etc/UTC",i,1),a(i,s.Std.interval(e))),i.valueOf()}return t+r.Interval.parse(e.symbol.resolution).inMilliseconds(t)}function c(e,t){switch(t){case"Auto":return function(e){const t=r.Interval.parse(e.symbol.interval+e.symbol.resolution);switch(t.kind()){case r.ResolutionKind.Weeks:case r.ResolutionKind.Months:return"12M";case r.ResolutionKind.Days:return"1M";case r.ResolutionKind.Minutes:return t.multiplier()>=1&&t.multiplier()<=15?"1D":"1W";case r.ResolutionKind.Seconds:case r.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 h={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"],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:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:class{constructor(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}init(e,t){const i=t(0),r=t(1),n=t(2),a=t(3);this._data=new o,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;default:throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=n,this._isValidResolution=function(e,t){return(!s.Std.isdaily(e)||"Daily"!==t)&&((!s.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!s.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}(e,this._pivTimeFrame),this._isValidResolution||s.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=c(e,this._pivTimeFrame)),e.new_sym(e.symbol.tickerid,this._secondaryRes)}main(e){if(!this._isValidResolution)return null;if(e.symbol.time)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 t=e.new_var(s.Std.open(e)),i=e.new_var(s.Std.high(e)),r=e.new_var(s.Std.low(e)),o=e.new_var(s.Std.close(e)),a=e.new_var(s.Std.time(e)),c=this._data,h=t.get(0),u=a.get(0),d=t.get(1),p=i.get(1),_=r.get(1),m=o.get(1),f=e.symbol.isLastBar;if(0!==c.pivots.length&&e.symbol.isNewBar){const e=c.pivots[c.pivots.length-1];e.endIndex__t!==u&&(e.endIndex__t=u)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;const g=function(e,t,i,r,o,a,l,c){const h=new n;let u=NaN;const d=i-r;switch(c){case 0:u=(i+r+o)/3,h.p=u,h.r1=2*u-r,h.s1=2*u-i,h.r2=u+(i-r),h.s2=u-(i-r),h.r3=2*u+(i-2*r),h.s3=2*u-(2*i-r),h.r4=3*u+(i-3*r),h.s4=3*u-(3*i-r),h.r5=4*u+(i-4*r),h.s5=4*u-(4*i-r);break;case 1:u=(i+r+o)/3,h.p=u,h.r1=u+.382*d,h.s1=u-.382*d,h.r2=u+.618*d,h.s2=u-.618*d,h.r3=u+d,h.s3=u-d;break;case 2:u=(i+r+2*e)/4,h.p=u,h.r1=2*u-r,h.s1=2*u-i,h.r2=u+d,h.s2=u-d,h.r3=i+2*(u-r),h.s3=r-2*(i-u),h.r4=h.r3+d,h.s4=h.s3-d;break;case 3:u=(i+r+o)/3,h.p=u,h.r1=2*u-r,h.s1=2*u-i,h.r2=u+d,h.s2=u-d,h.r3=u+2*d,h.s3=u-2*d,h.r4=u+3*d,h.s4=u-3*d;break;case 4:let n=NaN;n=s.Std.equal(t,o)?i+r+2*o:s.Std.greater(o,t)?2*i+r+o:2*r+i+o,u=n/4,h.p=u,h.r1=n/2-r,h.s1=n/2-i;break;case 5:u=(i+r+o)/3,h.p=u,h.r1=o+1.1*d/12,h.s1=o-1.1*d/12,h.r2=o+1.1*d/6,h.s2=o-1.1*d/6,h.r3=o+1.1*d/4,
|
||
h.s3=o-1.1*d/4,h.r4=o+1.1*d/2,h.s4=o-1.1*d/2;break;default:throw new Error("Unknown kind")}return h.startIndex__t=a,h.endIndex__t=l,h}(h,d,p,_,m,u,l(e,u),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(g),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),f?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)}}}},"i/Bj":function(e,t,i){"use strict";function s(e){if(void 0===e)return null;const t=e.match(/(delayed_streaming)_([\d]{1,4})/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}i.r(t),i.d(t,"parseUpdateMode",(function(){return s}))},i126:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyColorRotatorFactory",(function(){return h}));var s=i("eJTA"),r=i("Tmoa"),n=i("HGP3"),o=i("3ClC");const a=["color-sky-blue-400","color-banana-yellow-700","color-deep-blue-500","color-grapes-purple-a700","color-iguana-green-500","color-minty-green-a700","color-ripe-red-a200","color-berry-pink-200","color-tv-blue-a100","color-tan-orange-a200","color-sky-blue-a400","color-deep-blue-a100","color-grapes-purple-400","color-iguana-green-a700","color-minty-green-200","color-ripe-red-200","color-berry-pink-a200","color-ripe-red-500","color-grapes-purple-500","color-deep-blue-400","color-tv-blue-a200","color-sky-blue-500","color-iguana-green-400","color-minty-green-400","color-banana-yellow-600","color-tan-orange-500","color-berry-pink-400","color-ripe-red-300","color-grapes-purple-300","color-deep-blue-300","color-tv-blue-300","color-sky-blue-300","color-iguana-green-300","color-minty-green-300","color-banana-yellow-400","color-tan-orange-300","color-berry-pink-300","color-tan-orange-a700"];class l{constructor(e){this._offset=0,this._offset=e}getColor(e){if(0===this._offset)return e;const t=a[(this._offset-1)%a.length],i=n.a[t],o=Object(r.isHexColor)(e)?1:Object(s.parseRgba)(e)[3];return Object(r.generateColor)(i,Object(r.alphaToTransparency)(o))}}class c{constructor(e,t){this._offset=e,this._modelStartOffset=t}getColor(e){if(Object(r.isHexColor)(e)){const t=Object(s.parseRgb)(e);return Object(s.rgbToHexString)(Object(s.shiftRgb)(t,this._offset,this._modelStartOffset))}{const t=Object(s.parseRgba)(e);return Object(s.rgbaToString)(Object(s.shiftRgba)(t,this._offset,this._modelStartOffset))}}}class h{constructor(e){this._chartModel=e}getColorRotator(e){const t=Object(o.studyColorRotationMode)(e);if(null===t)return null;const i=this._calcDefaultColorsOffset(e);switch(t){case"loop":return new l(i);case"shift":{const e=this._chartModel.getStudyShiftColorStartOffset();return new c(i,e)}}}_calcDefaultColorsOffset(e){let t=0;return this._chartModel.dataSources().filter(o.isStudy).forEach(i=>{const s=i.metaInfo().id===e.id,r=(n=i.metaInfo(),o=e,(n.pine?n.pine.version:void 0)===(o.pine?o.pine.version:void 0));var n,o;s&&r&&t++}),t}}},
|
||
i6cO:function(e,t,i){"use strict";var s;function r(e){e.lineWidth=void 0,e.lineStyle=void 0;for(let t=0;t<e.colors.length;t++)e.colors[t]=void 0;return e}function n(){return{colors:[void 0,void 0,void 0,void 0,void 0,void 0,void 0]}}i.r(t),i.d(t,"ColorerType",(function(){return s})),i.d(t,"clearStyle",(function(){return r})),i.d(t,"createEmptyStyle",(function(){return n})),function(e){e[e.Main=0]="Main",e[e.Background=1]="Background",e[e.Text=2]="Text",e[e.Border=3]="Border",e[e.Wick=4]="Wick",e[e.Up=5]="Up",e[e.Down=6]="Down"}(s||(s={}))},i80N:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"8MBc",7)).then(({FibSpiralPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Fib Spiral"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"nBUU"))).FibSpiralDefinitionsViewModel}static createProperties(e){var t=new r("linetoolfibspiral",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolFibSpiral=n},iDOr:function(e,t,i){"use strict";(function(e){var s=i("Y7w9").moveToHead,r=i("704P").ExecutionsPositionController,n=i("Ss5c").LineDataSource,o=i("7ktv").PriceDataSource,a=i("CW80").isLineTool,l=i("s1Gx").isSpeciallyZOrderedSource,c=i("1Wlv").PriceScale,h=i("MWAT").createPriceScaleSelectionStrategy,u=i("yfAl").PaneBase,d=i("s1Gx").sortSources;class p extends u{constructor(t,i,s,r){super(t,i,s,r),this.m_timeScale=t,this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=s,this._destroyed=new e,s.properties().priceScaleSelectionStrategyName.listeners().subscribe(null,function(e){this._priceScaleSelectionStrategy=h(e.value()),this._priceScaleSelectionStrategy.apply(this)}.bind(this)),this.m_timeScale.barSpacingChanged().subscribe(this,function(){this.m_mainDataSource===this._model.mainSeries()&&this._recalculatePriceScaleByScaleRatio(this.m_mainDataSource.priceScale())}.bind(this)),i.topMargin.listeners().subscribe(this,p.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,p.prototype._updateMargins),this._updateMargins(),this._maximized=!1,this._isMainPane=!1}destroy(){this._properties.topMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._model.properties().priceScaleSelectionStrategyName.listeners().unsubscribeAll(this),this.m_timeScale.barSpacingChanged().unsubscribeAll(this),this._leftPriceScales.concat(this._rightPriceScales).forEach((function(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this)}),this);for(var e=0;e<this.m_dataSources.length;e++){var t=this.m_dataSources[e];t.destroy&&t.destroy()}this._destroyed.fire()}model(){return this._model}width(){
|
||
return this.m_width}height(){return this.m_height}setWidth(e){this.m_width=e,this.updateAllViews()}setHeight(e){this.m_height=e,this._leftPriceScales.forEach((function(t){t.setHeight(e)})),this._rightPriceScales.forEach((function(t){t.setHeight(e)}));for(var t=0;t<this.m_dataSources.length;t++){var i=this.m_dataSources[t];this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(e)}this.updateAllViews()}leftPriceScales(){return this._leftPriceScales}rightPriceScales(){return this._rightPriceScales}visibleLeftPriceScales(){var e=this._model.priceScaleSlotsCount();if(this._leftPriceScales.length>e.left){var t=s(this._leftPriceScales,this.mainDataSource().priceScale());return t.splice(e.left),t}return this._leftPriceScales}visibleRightPriceScales(){var e=this._model.priceScaleSlotsCount();if(this._rightPriceScales.length>e.right){var t=s(this._rightPriceScales,this.mainDataSource().priceScale());return t.splice(e.right),t}return this._rightPriceScales}timeScale(){return this.m_timeScale}_processMainSourceChange(){var e;if(null===this.m_mainDataSource)for(var t=0;t<this.m_dataSources.length;t++){if((r=this.m_dataSources[t])instanceof o&&!this.isOverlay(r)&&(!r.properties().linkedToSeries||!r.properties().linkedToSeries.value())){this.m_mainDataSource=r,e=!0;break}}if(this.m_mainDataSource&&e){var i=[];for(t=0;t<this.m_dataSources.length;t++){(r=this.m_dataSources[t])instanceof n&&i.push(r)}i=d(i);for(t=0;t<i.length;t++)this.move(i[t],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount()){var s=null;if(this.m_dataSources.includes(this._model.mainSeries()))s=this._model.mainSeries();else for(t=0;t<this.m_dataSources.length;t++){var r;if((r=this.m_dataSources[t])instanceof o&&this.isOverlay(r)&&r.showInObjectTree()){s=r;break}}if(null!==s){var a=this.m_mainDataSource===s;this.m_mainDataSource=s;var l=this.createNewPriceScaleIfPossible();if(a&&s===this._model.mainSeries()){var c=s.priceScale();this._model.children(s,!0).forEach((function(e){l.addDataSource(e),e.setPriceScale(l),-1!==c.dataSources().indexOf(e)&&c.removeDataSource(e)})),this.removePriceScale(c)}this.move(s,l,!0),this.recalculatePriceScale(s.priceScale())}}}_newZOrderForLineTool(){for(var e=null,t=0;t<this.m_dataSources.length;++t){var i=this.m_dataSources[t];if(a(i)&&!l(i)){var s=i.zorder();(null===e||s>e)&&(e=s)}}return null===e&&(e=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach((function(t){t.zorder()>e&&t.setZorder(t.zorder()+1)})),e+1}beginInsertManyLineDataSources(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null}endInsertManyLineDataSources(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null}startScrollPrice(e,t){e.startScroll(t)}scrollPriceTo(e,t){e.scrollTo(t),this.updateAllViews()}endScrollPrice(e){e.endScroll()}setPriceAutoScale(e,t){e.setMode({autoScale:t}),this.timeScale().isEmpty()||this.recalculatePriceScale(e)}defaultPriceScale(){
|
||
var e=this.m_mainDataSource?this.m_mainDataSource.priceScale():null;return null===e&&(e=new c(this._model.properties().scalesProperties)),e}_priceScaleIsPrice(e){var t=e.mainSource();return!!t&&(!!TradingView.isInherited(t.constructor,TradingView.Series)||!!TradingView.isInherited(t.constructor,TradingView.Study)&&t.metaInfo().is_price_study)}findSuitableScale(e,t,i){return this._priceScaleSelectionStrategy.findSuitableScale(this,e,t,i)}createNewPriceScaleIfPossible(){return this._priceScaleSelectionStrategy.createNewPriceScaleIfPossible(this)}canCreateNewPriceScale(){return this._priceScaleSelectionStrategy.canCreateNewPriceScale(this)}mainDataSource(){return this.m_mainDataSource}recalculate(){this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale);for(var e=0;e<this.m_dataSources.length;e++){var t=this.m_dataSources[e];this.isOverlay(t)&&!a(t)&&this.recalculatePriceScale(t.priceScale())}this.updateAllViews(),this._model.updatePane(this)}createDrawingsCaches(){r.recreateOrderedByBarsSourcesCache(this)}clearDrawingCaches(){r.clearOrderedByBarsSourcesCache()}_invalidateSourcesCache(){this._cachedOrderedSources.clear(),this._leftPriceScales.forEach((function(e){e.invalidateSourcesCache()})),this._rightPriceScales.forEach((function(e){e.invalidateSourcesCache()}))}isZOrderAvailable(e){for(var t=0;t<this.m_dataSources.length;t++){if(this.m_dataSources[t].zorder()===e)return!1}return!0}changeZOrder(e,t){for(var i=this.sourcesByGroup().all().filter((function(e){return e.showInObjectTree()})),s=0,r=0,n=i.length;r<n;r++)if(i[r]===e){s=r;break}if(s>0&&t<0){var o=i[s-1].zorder(),a=e.zorder();i[s-1].setZorder(a),e.setZorder(o)}else if(s<i.length-1&&t>0){var l=i[s+1].zorder();a=e.zorder();i[s+1].setZorder(a),e.setZorder(l)}this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire()}onDestroyed(){return this._destroyed}clearSeries(e){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this._removeSourceFromCollections(t,e)}nonOverlayPricesSourcesCount(){return this.m_dataSources.filter((function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,o)&&e.showInObjectTree()&&!this.isOverlay(e))}),this).length}canHaveMoreNoScaleSources(){return this.nonOverlayPricesSourcesCount()>1}actionNoScaleIsEnabled(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,o))||this.canHaveMoreNoScaleSources()}executionsPositionController(){return this._executionsPositionController||(this._executionsPositionController=new r(this,this._model.timeScale())),this._executionsPositionController}isLast(){var e=this._model.panes();return e[e.length-1]===this}setMaximized(e){this._maximized=e}isMaximized(){return this._maximized}isMainPane(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach((function(i){t||(t=i===e)})),this._isMainPane=t,t}properties(){return this._properties}priceScaleRatio(){
|
||
return this._currentPriceScaleRatio}getPriceScaleById(e){var t=this.m_dataSources.find((function(t){return null!==t.priceScale()&&t.priceScale().id()===e}));return void 0===t?null:t.priceScale()}setPriceScaleSelectionStrategy(e){this._priceScaleSelectionStrategy=e,e.apply(this)}priceScaleIndex(e,t){switch(t){case"left":return this.leftPriceScales().indexOf(e);case"right":return this.rightPriceScales().indexOf(e)}}}p.DEFAULT_STRETCH_FACTOR=1e3,p.PANE_ANIMATION_DURATION=500,t.Pane=p}).call(this,i("aIyQ"))},iPBr:function(e,t,i){"use strict";i.r(t),i.d(t,"TimeAxisWidget",(function(){return y}));var s=i("Eyy1"),r=i("XlJ7"),n=i("S8xo"),o=i("ikwP"),a=i("H0vP"),l=i("ogJP"),c=i("u+0B"),h=i("zDbI"),u=i("aIyQ"),d=i.n(u),p=i("mE5r"),_=i("8OdW"),m=i("7KDR"),f=i("3/8U"),g=i("GxN8"),v=i("JWMC"),b=i("5VQP");i("xrEm");const S={contextMenuEnabled:!0,timezoneMenuEnabled:!0,pressedMouseMoveScale:!0};class y{constructor(e,t,i,s,r){this._rendererOptions=null,this._onLabelHovered=new d.a,this._mousedown=!1,this._currentCursorClassName="invalid",this._options=Object(l.merge)(Object(l.clone)(S),t||{}),this.chart=e,this._properties=e.properties().childs().scalesProperties,this._element=document.createElement("tr"),this._backgroundBasedTheme=r;const a=()=>this.backgroundColor(),c=()=>{throw new Error("Time axis does not support real price scales")},h={titlesProvider:i,stubContextMenuProvider:(e,t)=>{const i=this.getContextMenuActions(!0);let r=s(e,t);if(r[r.length-1]===this.chart.actions().scalesProperties){const e=[new m.Separator].concat(i);Array.prototype.splice.apply(r,[r.length-2,0,...e])}else r.push(new m.Separator),r=r.concat(i);return r},backgroundBasedTheme:r,rendererOptionsProvider:e.model().model().rendererOptionsProvider(),getBackgroundTopColor:a,getBackgroundBottomColor:a,showHorizontalBorder:!0};this._lhsStubContainer=new p.a(this._properties,"left",c,h,this._options.priceAxisLabelsOptions),this._lhsStubContainer.onLabelHovered().subscribe(this,(e,t)=>{this._onLabelHovered.fire(e,t)}),this._rhsStubContainer=new p.a(this._properties,"right",c,h,this._options.priceAxisLabelsOptions),this._rhsStubContainer.onLabelHovered().subscribe(this,(e,t)=>{this._onLabelHovered.fire(e,t)}),this._element.appendChild(this._lhsStubContainer.getElement()),this._cell=document.createElement("td"),this._element.appendChild(this._cell),this._cell.classList.add("chart-markup-table","time-axis"),this._cell.style.height="25px",this._dv=document.createElement("div"),this._dv.style.width="100%",this._dv.style.height="100%",this._dv.style.position="relative",this._dv.style.overflow="hidden",this._cell.appendChild(this._dv),this._canvasConfiguredHandler=()=>this.chart.model().model().lightUpdate(),this._canvasBinding=Object(o.createBoundCanvas)(this._dv,new o.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);const u=this._canvasBinding.canvas;u.style.position="absolute",u.style.zIndex="1",u.style.left="0",u.style.top="0",this._topCanvasConfiguredHandler=()=>this.chart.model().model().lightUpdate(),
|
||
this._topCanvasBinding=Object(o.createBoundCanvas)(this._dv,new o.Size(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);const f=this._topCanvasBinding.canvas;f.style.position="absolute",f.style.zIndex="2",f.style.left="0",f.style.top="0",this._element.appendChild(this._rhsStubContainer.getElement()),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=_.MINUTE_SPAN,this._mouseEventHandler=new n.MouseEventHandler(this._topCanvasBinding.canvas,this,{treatVertTouchDragAsPageScroll:!0,treatHorzTouchDragAsPageScroll:!1}),this.size=new o.Size(0,0)}destroy(){this._mouseEventHandler.destroy(),this._topCanvasBinding.unsubscribeCanvasConfigured(this._topCanvasConfiguredHandler),this._topCanvasBinding.destroy(),this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),this._rhsStubContainer.onLabelHovered().unsubscribeAll(this),this._lhsStubContainer.onLabelHovered().unsubscribeAll(this),this._lhsStubContainer.destroy(),this._rhsStubContainer.destroy(),this.chart.properties().childs().paneProperties.childs().background.unsubscribeAll(this)}setCursor(e){let t="";"grabbing"!==e&&"ew-resize"!==e||(t="time-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t,this._cell.style.cursor)}restoreDefaultCursor(){this.setCursor("")}getElement(){return this._element}optimalHeight(){const e=this.rendererOptions();return Math.ceil(e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom+e.labelBottomOffset)}setSizes(e,t,i){this.size&&this.size.equals(e)||(this.size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._topCanvasBinding.resizeCanvas({width:e.w,height:e.h}),this._cell.style.width=e.w+"px",this._cell.style.height=e.h+"px"),this._lhsStubContainer.setSizes(e.h,t),this._rhsStubContainer.setSizes(e.h,i)}hardResetCanvas(){this.size&&(Object(o.hardResizeCanvas)(this._canvasBinding,this.size),Object(o.hardResizeCanvas)(this._topCanvasBinding,this.size))}rendererOptions(){if(!this._rendererOptions||this._rendererOptions.fontSize!==this.fontSize()){const e=this.fontSize();this._rendererOptions={borderSize:1,tickLength:5,fontSize:e,font:Object(r.makeFont)(e,h.CHART_FONT_FAMILY,""),widthCache:new c.a,paddingTop:3*e/12,paddingBottom:3*e/12,paddingHorizontal:9*e/12,labelBottomOffset:4*e/12}}return this._rendererOptions}backgroundColor(){return this.chart.model().model().backgroundColor().value()}lineColor(){return this._properties.childs().lineColor.value()}textColor(){return this._properties.childs().textColor.value()}fontSize(){return this._properties.childs().fontSize.value()}baseFont(){return Object(r.makeFont)(this.fontSize(),h.CHART_FONT_FAMILY)}baseBoldFont(){return Object(r.makeFont)(this.fontSize(),h.CHART_FONT_FAMILY,"","bold")}hasCanvas(e){return this._canvasBinding.canvas===e||this._topCanvasBinding.canvas===e}onLabelHovered(){return this._onLabelHovered}
|
||
getScreenshotData(){return{content:this._canvasBinding.canvas.toDataURL(),canvas:this._canvasBinding.canvas,contentWidth:this.size.w,contentHeight:this.size.h,lhsStub:this._lhsStubContainer.getScreenshotData(),rhsStub:this._rhsStubContainer.getScreenshotData()}}getContextMenuActions(e){const t=this.chart;t.updateActions();const i=t.actions(),s=[];return e||s.push(i.timeScaleReset,new m.Separator),this._options.timezoneMenuEnabled&&s.push(i.applyTimeZone),s.push(i.sessionBreaks),s}update(){if(!this.chart.model())return;const e=this.chart.model().timeScale().marks();if(e){this._minVisibleSpan=_.YEAR_SPAN;for(const t of e)this._minVisibleSpan=Math.min(t.span,this._minVisibleSpan)}}updatePriceAxisStubs(){const e=this.chart.model().model(),t=this.chart.isMaximizedPane()?Object(s.ensureNotNull)(this.chart.maximizedPaneWidget()).state():e.paneForSource(e.mainSeries());if(!t)return;const i=e.priceScaleSlotsCount();this._lhsStubContainer.setScales([],i.left,t.leftPriceScales().length,i.left+i.right),this._rhsStubContainer.setScales([],i.right,t.rightPriceScales().length,i.left+i.right)}paint(e){if(e===a.InvalidationLevel.None)return;const t=Object(o.getContext2D)(this._topCanvasBinding.canvas);if(e>a.InvalidationLevel.Cursor){const i=Object(o.getContext2D)(this._canvasBinding.canvas),s=this._canvasBinding.pixelRatio;this.drawBackground(i,s),this.chart.model()&&(this.drawBorder(i,s),this.drawTickMarks(i,s),this.drawBackLabels(i,s),this.drawCrossHairLabel(t,s)),this._lhsStubContainer.paintStubs(e),this._rhsStubContainer.paintStubs(e)}this.drawCrossHairLabel(t,this._topCanvasBinding.pixelRatio)}drawBackground(e,t){Object(o.clearRect)(e,0,0,Math.ceil(this.size.w*t)+1,Math.ceil(this.size.h*t)+1,this.backgroundColor());const i=this.chart.model();if(!i)return;if(!i.timeScale().isEmpty()){const s=i.model().selection().lineDataSources().reduce((e,t)=>{const i=t.timeAxisPoints();return 0===i.length?e:e.concat(i)},[]);s.length>0&&this._hightlightBackground(e,s,t)}const s=i.model().crossHairSource();s.startMeasurePoint()&&this._hightlightBackground(e,s.measurePoints(),t)}drawBorder(e,t){e.save(),e.fillStyle=this.lineColor();const i=Math.max(1,Math.floor(this.rendererOptions().borderSize*t)),s=Math.ceil(this.size.w*t);e.fillRect(0,0,s+1,i),e.restore()}drawTickMarks(e,t){const i=this.chart.model().timeScale().marks();if(!i||0===i.length)return;let s=i.reduce((e,t)=>e.span>t.span?e:t,i[0]).span;s>30&&s<40&&(s=30),e.save(),e.strokeStyle=this.lineColor();const r=this.rendererOptions(),n=r.borderSize+r.tickLength+r.paddingTop+r.fontSize/2;e.textAlign="center",e.textBaseline="middle",e.fillStyle=this.lineColor();const a=Math.max(1,Math.floor(t)),l=Math.floor(.5*t),c=Math.round(r.tickLength*t);e.beginPath();for(let o=i.length;o--;){const s=Math.round(i[o].coord*t);e.rect(s-l,0,a,c)}e.fill(),e.fillStyle=this.textColor(),Object(o.drawScaled)(e,t,()=>{e.font=this.baseFont();for(let t=0;t<i.length;t++){const r=i[t];r.span<s&&e.fillText(r.label,r.coord,n)}e.font=this.baseBoldFont();for(let t=0;t<i.length;t++){const r=i[t]
|
||
;r.span>=s&&e.fillText(r.label,r.coord,n)}}),e.restore()}drawBackLabels(e,t){e.save();const i=new Set,s=this.chart.model().model();let r=s.dataSources();const n=s.selection().allSources();for(const l of n)i.add(l);s.hoveredSource()&&i.add(s.hoveredSource());for(const l of s.sourcesBeingMoved())i.add(l);const o=s.lineBeingEdited()||s.lineBeingCreated();o&&i.add(o),i.add(this.chart.model().crossHairSource()),r=r.concat(s.customSources());const a=this.rendererOptions();for(let l=0;l<r.length;l++){const s=r[l];if(!i.has(s)&&s.timeAxisViews){const i=s.timeAxisViews();if(i)for(let s=0;s<i.length;s++)i[s].renderer().draw(e,a,t)}}e.restore()}drawCrossHairLabel(e,t){e.save(),e.clearRect(0,0,Math.ceil(this.size.w*t)+1,Math.ceil(this.size.h*t)+1);const i=this.chart.model().model(),s=[],r=i.lineBeingEdited()||i.lineBeingCreated();if(r&&r.timeAxisViews){const e=r.timeAxisViews();e&&e.length&&s.push(e)}this._addViewsOrMaxMin(i.sourcesBeingMoved(),s),this._addViewsOrMaxMin(i.selection().allSources(),s);const n=i.hoveredSource();if(n&&Object(g.a)(n)&&!i.selection().isSelected(n)&&n.timeAxisViews){const e=n.timeAxisViews();e&&e.length&&s.push(e)}const o=i.crossHairSource(),a=o.timeAxisViews&&o.timeAxisViews();a&&a.length&&s.push(a);const l=this.rendererOptions();for(const c of s)for(const i of c)e.save(),i.renderer().draw(e,l,t),e.restore();e.restore()}mouseDownEvent(e){this._mouseDownOrTouchStartEvent(e)}touchStartEvent(e){this._mouseOrTouchEnterEvent(e),this._mouseDownOrTouchStartEvent(e)}mouseDownOutsideEvent(){this._zoomAvailable()&&this._mousedown&&(this._mousedown=!1,this.chart.model().endScaleTime(),this.restoreDefaultCursor())}pressedMouseMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}touchMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}mouseUpEvent(e){this._mouseUpOrTouchEndEvent(e)}touchEndEvent(e){this._mouseUpOrTouchEndEvent(e),this._mouseOrTouchLeaveEvent(e)}contextMenuEvent(e){this._contextMenuOrTouchContextMenuEvent(e)}touchContextMenuEvent(e){this._contextMenuOrTouchContextMenuEvent(e)}mouseEnterEvent(e){this._mouseOrTouchEnterEvent(e)}mouseLeaveEvent(e){this._mouseOrTouchLeaveEvent(e)}mouseDoubleClickEvent(e){this._mouseDoubleClickOrDoubleTapEvent(e)}doubleTapEvent(e){this._mouseDoubleClickOrDoubleTapEvent(e)}_hightlightBackground(e,t,i){const s=this.chart.model().timeScale();let r=t[0].index,n=t[0].index;for(let o=1;o<t.length;o++)r=Math.min(r,t[o].index),n=Math.max(n,t[o].index);const a=Math.floor(s.indexToCoordinate(r)*i),l=Math.ceil(s.indexToCoordinate(n)*i),c=this._backgroundBasedTheme.value(),h=Object(f.axesHighlightColor)(c);Object(o.fillRect)(e,a,0,l-a,Math.ceil(this.size.h*i)+1,h)}_addViewsOrMaxMin(e,t){if(e.length<=1){for(const i of e)if(i.timeAxisViews){const e=i.timeAxisViews();e&&e.length&&t.push(e)}}else t.push(this._minMaxViews(e))}_minMaxViews(e){const t=[];let i=1/0,s=-1/0,r=null,n=null;for(const o of e)if(o.timeAxisViews){const e=o.timeAxisViews();if(e&&e.length)for(let t=0;t<e.length;++t){const o=e[t],a=o.coordinate();a>=s&&(s=a,n=o),a<=i&&(i=a,r=o)}}return n&&t.push(n),r&&t.push(r),t}
|
||
_zoomAvailable(){return!this.chart.model().timeScale().isEmpty()&&this.chart.model().model().zoomEnabled()&&this._options.pressedMouseMoveScale}_mouseDownOrTouchStartEvent(e){if(this._mousedown||!this._zoomAvailable())return;this._mousedown=!0;const t=this.chart.model();t.timeScale().isEmpty()||t.startScaleTime(e.localX)}_pressedMouseOrTouchMoveEvent(e){this._zoomAvailable()&&this.chart.model().scaleTimeTo(e.localX)}_mouseUpOrTouchEndEvent(e){this._zoomAvailable()&&(this._mousedown=!1,this.chart.model().endScaleTime(),this.restoreDefaultCursor())}_contextMenuOrTouchContextMenuEvent(e){this._options.contextMenuEnabled&&this._createContextMenu().then(t=>t.show(e))}_mouseOrTouchEnterEvent(e){this._zoomAvailable()&&this.setCursor("ew-resize")}_mouseOrTouchLeaveEvent(e){this.restoreDefaultCursor()}_mouseDoubleClickOrDoubleTapEvent(e){Object(v.trackEvent)("GUI","Double click time scale"),this.chart.model().resetTimeScale()}_createContextMenu(){return b.ContextMenuManager.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})}}},icPo:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolIcon",(function(){return o}));var s=i("Ocx9"),r=i("Ss5c"),n=i("j3hX");class o extends r.LineDataSource{constructor(e,t){super(e,t||o.createProperties()),this._sizeScale=NaN,this.version=1,document.fonts&&document.fonts.check&&document.fonts.load&&!document.fonts.check("12px FontAwesome")&&document.fonts.load("12px FontAwesome","☺").then(()=>{this._isDestroyed||e.updateSource(this)}),i.e("lt-pane-views").then(i.bind(null,"8GeE")).then(t=>{this._setPaneViews([new t.IconPaneView(this,e)])})}pointsCount(){return 1}name(){return"Icon"}hasEditableCoordinates(){return!1}getAnchorLimit(){return 80}applyTemplate(e){delete e.icon,super.applyTemplate(e)}startChanging(e,t){super.startChanging(e,t);const i=this.properties().childs();i.size.value()<80?this._sizeScale=i.size.value()/80:this._sizeScale=1}getChangePointForSync(e){return null}setPoint(e,t,i){const s=Object.assign({},t),r=this.pointToScreenPoint(this.points()[0])[1],n=this.pointToScreenPoint(s)[1],o=this.properties().childs();if(0===e||1===e){const t=n.subtract(r).normalized(),i=-t.x;let s=Math.acos(i);Math.asin(t.y)>0&&(s=2*Math.PI-s),0===e&&(s+=Math.PI),o.angle.setValue(s)}else{let e=2*n.subtract(r).length();e*=this._sizeScale,o.size.setValue(e),o.scale.setValue(1)}}endChanging(e,t){const i=super.endChanging(e,t);return this._sizeScale=NaN,i}properties(){return super.properties()}getSourceIcon(){return{type:"text",text:String.fromCharCode(this.properties().childs().icon.value())}}static createProperties(e){const t=new s.DefaultProperty("linetoolicon",e);return o._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"XCOO")).then(e=>e.IconsDefinitionsViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("backgroundsColors",new n.LineToolColorsProperty([e.childs().color])),e.addExclusion("angle"),e.addExclusion("scale")}}},
|
||
ijBy:function(e,t,i){"use strict";i.r(t),i.d(t,"SetChartLayoutCommand",(function(){return n}));var s=i("RDU5"),r=i("VNzU");class n extends s.UndoCommand{constructor(e,t){super("Change Chart Layout to "+r.layouts[t].title),this._chartWidgetCollection=e,this._newLayoutType=t,this._oldLayoutType=e.layout.value()}redo(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)}undo(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)}}},ikwP:function(e,t,i){"use strict";i.r(t),i.d(t,"Size",(function(){return o})),i.d(t,"getCanvasDevicePixelRatio",(function(){return a})),i.d(t,"getContext2D",(function(){return l})),i.d(t,"getPrescaledContext2D",(function(){return c})),i.d(t,"getPretransformedContext2D",(function(){return h})),i.d(t,"hardResizeCanvas",(function(){return u})),i.d(t,"resizeCanvasPreservingContent",(function(){return d})),i.d(t,"fillRect",(function(){return p})),i.d(t,"clearRect",(function(){return _})),i.d(t,"drawScaled",(function(){return m})),i.d(t,"createDisconnectedCanvas",(function(){return f})),i.d(t,"createDisconnectedBoundCanvas",(function(){return g})),i.d(t,"createBoundCanvas",(function(){return b})),i.d(t,"calcTextHorizontalShift",(function(){return S})),i.d(t,"disableSelection",(function(){return y}));var s=i("f2KN"),r=i("Eyy1"),n=i("Ialn");class o{constructor(e,t){this.w=e,this.h=t}equals(e){return this.w===e.w&&this.h===e.h}}function a(e){var t,i;return Math.max(1,(null===(i=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===i?void 0:i.devicePixelRatio)||1)}function l(e){const t=Object(r.ensureNotNull)(e.getContext("2d"));return t.setTransform(1,0,0,1,0,0),t}function c(e){const t=Object(r.ensureNotNull)(e.getContext("2d")),i=a(e);return t.setTransform(i,0,0,i,0,0),t}function h(e){const t=Object(r.ensureNotNull)(e.canvas.getContext("2d"));return t.setTransform(e.pixelRatio,0,0,e.pixelRatio,0,0),t.translate(.5,.5),t}function u(e,t){e.resizeCanvas({width:0,height:0}),e.resizeCanvas({width:t.w,height:t.h})}function d(e,t){const i=g(document,t),s=c(i.canvas);return s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(e.canvas,0,0,e.canvasSize.width*e.pixelRatio,e.canvasSize.height*e.pixelRatio),s.restore(),i}function p(e,t,i,s,r,n){e.save(),e.translate(-.5,-.5),e.fillStyle=n,e.fillRect(t,i,s,r),e.restore()}function _(e,t,i,s,r,n){e.save(),e.translate(-.5,-.5),e.globalCompositeOperation="copy",e.fillStyle=n,e.fillRect(t,i,s,r),e.restore()}function m(e,t,i){e.save(),e.scale(t,t),i(),e.restore()}function f(e,t,i){const s=v(e);return void 0===i&&(i=a(s)),s.width=t.w*i,s.height=t.h*i,s}function g(e,t){const i=v(e),r=Object(s.a)(i,{allowDownsampling:!1});return r.resizeCanvas({width:t.w,height:t.h}),r}function v(e){const t=e.createElement("canvas");return y(t),t}function b(e,t){const i=v(Object(r.ensureNotNull)(e.ownerDocument));e.appendChild(i);const n=Object(s.a)(i,{allowDownsampling:!1});return n.resizeCanvas({width:t.w,height:t.h}),n}function S(e,t){
|
||
return"center"===e.textAlign?0:Object(n.isRtl)()?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}function y(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.msUserSelect="none",e.style.MozUserSelect="none",e.style.webkitTapHighlightColor="transparent"}},isVH:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,n=i("j3hX").LineToolColorsProperty;class o extends s{constructor(e,t){super(e,t||o.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"D4q4",7)).then(({TrianglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 3}name(){return"Triangle"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"Zd1D"))).GeneralFiguresDefinitionsViewModel}static createProperties(e){var t=new r("linetooltriangle",e);return o._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.addChild("linesColors",new n([e.childs().color]))}}t.LineToolTriangle=o},it7y:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyDataWindowView",(function(){return n}));var s=i("4miz"),r=i("EYFt");class n extends s.b{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._valueProvider=this._createValuesProvider(e,t),this._items=this._valueProvider.getItems().map(e=>new s.a(e.title,"")),this.update()}update(){this._invalidated=!0}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}_updateImpl(){this._header=this._study.title(!0),this._title=this._study.title();const e=this._valueProvider.getValues(this._currentIndex());for(let t=0;t<e.length;++t){const i=e[t],s=this._items[t];s.setValue(i.value),s.setVisible(i.visible),s.setColor(i.color)}}_currentIndex(){const e=this._model.crossHairSource().lockedIndex;return void 0!==e?e:null!==this._model.crossHairSource().pane?this._model.crossHairSource().appliedIndex():null}_createValuesProvider(e,t){return new r.a(e,t)}}},ivNn:function(e,t,i){"use strict";function s(e){return Math.round(1e10*e)/1e10}Object.defineProperty(t,"__esModule",{value:!0}),t.alignTo=t.fixComputationError=t.isNaN=t.isInteger=t.isNumber=void 0,t.isNumber=function(e){return"number"==typeof e&&isFinite(e)},t.isInteger=function(e){return"number"==typeof e&&e%1==0},t.isNaN=function(e){return!(e<=0||e>0)},t.fixComputationError=s,t.alignTo=function(e,t){var i=e/t,r=Math.floor(i),n=i-r;return n>2e-10?s(n>.5?(r+1)*t:r*t):e}},j3hX:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolMultiplePropertyBaseImpl",(function(){return l})),i.d(t,"LineToolCollectedProperty",(function(){return c})),i.d(t,"LineToolWidthsProperty",(function(){return h})),i.d(t,"LineToolColorsProperty",(function(){return u})),i.d(t,"MultipleLineWidthsProperty",(function(){return p})),i.d(t,"MultipleLineColorsProperty",(function(){return _}));var s=i("txPx"),r=i("aIyQ"),n=i.n(r);const o=Object(s.getLogger)("Chart.LineToolCollectedProperty");class a{applyValue(e,t){
|
||
e.setValue(t)}}class l{constructor(e,t){this._onChange=new n.a,this._properties=e,e.forEach(e=>e.subscribe(this,()=>{this._onChange.fire(this)})),this._showIfProperty=t}visible(){var e;return!this._showIfProperty||(null===(e=this._showIfProperty)||void 0===e?void 0:e.value())}value(){if(0===this._properties.length)return o.logError("Incorrect call, should not request value of 0 properties"),"mixed";const e=this._properties[0].value();return 1===this._properties.length||this._properties.every(t=>t.value()===e)?e:"mixed"}state(){}merge(){}destroy(){this._properties.forEach(e=>e.unsubscribeAll(this))}subscribe(e,t){this._onChange.subscribe(e,t)}unsubscribe(e,t){this._onChange.unsubscribe(e,t)}unsubscribeAll(e){this._onChange.unsubscribeAll(e)}}class c extends l{setValue(e,t,i){if("mixed"===e)return;const s=null!=i?i:new a;this._properties.forEach(t=>s.applyValue(t,e))}}class h extends c{}class u extends c{firstColor(){return this._properties[0].value()}}class d extends l{setValue(e,t,i){if("mixed"===e)return;const s=null!=i?i:new a;this._properties.forEach(t=>t.setValue(e,void 0,s))}}class p extends d{}class _ extends d{}},j8de:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("tc+8"),r=i.n(s);class n extends r.a{constructor(e,t){super(),this._lineSource=e,this._pointIndex=t}value(){return this._lineSource.points()[this._pointIndex].index}setValue(e){const t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.startChanging(this._pointIndex,t),this._setPointImpl(t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this);const i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i),this._lineSource.properties().lastUpdateTime.setValue((new Date).valueOf())}_setPointImpl(e){this._lineSource.setPoint(this._pointIndex,e)}}},jA0t:function(e,t,i){"use strict";var s=function(){var e={};function t(e){return e.is_price_study}function i(e,t){var i=t.slice(0).toLowerCase();if(e){for(var s=0;s<e.length;++s)if(e[s].description.toLowerCase()===i||e[s].shortDescription.toLowerCase()===i)return e[s];throw new Error("Can't find metainfo for `"+t+"`")}throw new Error("There is no studies metainfo at all")}var s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return e.getStudyRecordFromArray=function(e,r){return function(e,r){var n;if(!Array.isArray(e))return{id:(n=i(r.model().studiesMetaData(),e)).id,overlay:t(n)};for(var o,a=e.slice(0),l=a[0],c=t(n=i(r.model().studiesMetaData(),l)),h=n.inputs.map((function(e){return{id:e.id,type:e.type,name:e.name}})),u=a.splice(1),d=0;d<u.length;++d){o||(o={});var p=s[h[d].type]||s.string;o[h[d].id]=p(u[d])}return{id:n.id,name:l,overlay:c,inputs:o}}(e,r)},e}();e.exports=s},jCNj:function(e,t,i){"use strict";var s=i("3UA0").tzData;function r(e){this._name=e;var t=s[e];if(t||(t={time:[],offset:[]},this._invalid=!0),t.time.length!==t.offset.length&&(t={time:[],offset:[]},this._invalid=!0),!t.time_utc){
|
||
for(var i=t.time,r=t.offset,n=i.length,o=new Array(n),a=0;a<n;a++)i[a]*=1e3,r[a]*=1e3,o[a]=i[a]-r[a];t.time_utc=o}this.tz=t}function n(e,t){var i=e.length;if(0===i)return-1;if(isNaN(t))throw Error("Key is NaN");for(var s=0,r=i-1,n=o((s+r)/2);;){if(e[n]>t){if((r=n-1)<s)return n}else if(r<(s=n+1))return n<i-1?n+1:-1;n=o((s+r)/2)}}r.prototype.offset_utc=function(e){return r._offset(this.tz.time_utc,this.tz.offset,e)},r.prototype.offset_loc=function(e){return r._offset(this.tz.time,this.tz.offset,e)},r.prototype.correction_loc=function(e){var t=this.tz.time,i=this.tz.offset,s=n(t,e);if(s<1)return 0;var r=i[s]-i[s-1];if(r>0&&e-t[s-1]<=r)return r;return 0},r.prototype.is_valid=function(){return!this._invalid},r._offset=function(e,t,i){var s=n(e,i);return-1===s?0:t[s]};var o=function(e){return 0|e},a=function(e){return 60*e*1e3},l=function(e,t){return c(e)-c(t)},c=function(e){return e<0?o(e/1e3)-(e%1e3!=0?1:0):o(e/1e3)};function h(e){return e%4==0&&(e%100!=0||e%400==0)}var u={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},d={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,FEBRUARY:1,MARCH:2,APRIL:3,MAY:4,JUNE:5,JULY:6,AUGUST:7,SEPTEMBER:8,OCTOBER:9,NOVEMBER:10,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*o(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=u[t];return t>d.JANUARY+1&&h(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,s=d.get_day_of_year(e)-i;return Math.ceil(s/7)+1},get_minutes_from_midnight:function(e){return 60*d.get_hours(e)+d.get_minutes(e)},set_hms:function(e,t,i,s,r,n){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(s),e.setUTCMilliseconds(r),d.correct_time(e,n)},correct_time:function(e,t){var i=e.getTime(),s=t.correction_loc(i);e.setTime(i+s)},add_days_considering_dst:function(e,t,i){var s=e.offset_utc(t),r=this.clone(t);this.add_date(r,i);var n=e.offset_utc(r);return r.setTime(r.getTime()+s-n),r},add_date:function(e,t){e.setTime(e.getTime()+t*d.secondsPerDay)},add_minutes:function(e,t){e.setTime(e.getTime()+a(t))},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return h(e)?366:365},get_part:function(e,t){switch(t){case d.YEAR:return d.get_year(e);case d.MONTH:return d.get_month(e);case d.DAY_OF_MONTH:return d.get_day_of_month(e);case d.WEEK_OF_YEAR:return d.get_week_of_year(e)
|
||
;case d.DAY_OF_WEEK:return d.get_day_of_week(e);case d.HOUR_OF_DAY:return d.get_hours(e);case d.MINUTE:return d.get_minutes(e);case d.DAY_OF_YEAR:return d.get_day_of_year(e);case d.SECOND:return d.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:function(e){return 1e3*e},time_minutes_diff:function(e,t){return o(l(e,t)/60)},time_seconds_diff:l,utc_to_cal:function(e,t){return new Date(d.utc_to_cal_ts(e,t))},utc_to_cal_ts:function(e,t){return t+e.offset_utc(t)},get_cal:function(e,t,i,s,r,n,o){var a=new Date(Date.UTC(t,i,s,r||0,n||0,o||0)),l=e.offset_utc(+a);return new Date(a.valueOf()-l)},get_cal_from_unix_timestamp_ms:function(e,t){return new Date(t+e.offset_utc(t))},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new r(e)},shift_day:function(e,t){var i=e-1;return(i+=t)>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}};e.exports=d},jFln:function(e,t,i){"use strict";var s=i("Hr11"),r=s.greaterThan,n=s.lessThan,o=window.CanvasEx=i("8Uy/");o.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth],[2*e.lineWidth,e.lineWidth]][e.lineStyle-1]},o.drawLine=function(e,t,i,s,r){isFinite(t)&&isFinite(s)&&isFinite(i)&&isFinite(r)&&(e.lineStyle!==o.LINESTYLE_SOLID?o.drawDashedLine(e,t,i,s,r):o.drawSolidLine(e,t,i,s,r))},o.drawArrow=function(e,t,i,s,r,n){if(isFinite(t)&&isFinite(s)&&isFinite(i)&&isFinite(r)){var o=Math.round(n/2),a=t+o,l=s+o;e.beginPath(),e.moveTo(l,r),e.lineTo(a,i),e.moveTo(t,i+o),e.lineTo(a,i),e.lineTo(t+n,i+o),e.stroke()}},o.drawSolidLine=function(e,t,i,s,r){e.beginPath(),e.moveTo(t,i),e.lineTo(s,r),e.stroke()},o.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==o.LINESTYLE_SOLID&&(i=o.computeDashPattern(e)),o.setLineDash(e,i)},o.setLineDash=function(e,t){"function"==typeof e.setLineDash?e.setLineDash(t):void 0!==e.mozDash?e.mozDash=t:void 0!==e.webkitLineDash&&(e.webkitLineDash=t)},o.drawPoly=function(e,t,i){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var s=0;s<t.length;s++){var r=t[s];e.lineTo(r.x,r.y)}e.closePath(),e.stroke(),i&&e.fill()},o.drawDashedLine=function(e,t,i,s,r){e.save();var n=o.computeDashPattern(e);if(e.beginPath(),"function"==typeof e.setLineDash)e.setLineDash(n);else if(void 0!==e.mozDash)e.mozDash=n;else{if(void 0===e.webkitLineDash)return o.dashedLineTo(e,t,i,s,r,n),e.stroke(),void e.restore();e.webkitLineDash=n}e.moveTo(t,i),e.lineTo(s,r),e.stroke(),e.restore()},o.drawDashedLineHorizontal=function(e,t,i,s){e.save();var r=o.computeDashPattern(e),n=0,a=e.lineWidth,l=a/2;e.translate(-l,-l);for(var c=!0,h=t+s;t<h;){var u=r[n];c&&e.fillRect(t,i,u,a),c=!c,t+=u,n=n===r.length-1?0:n+1}e.restore()},o.drawDashedLineVertical=function(e,t,i,s){e.save();var r=o.computeDashPattern(e),n=0,a=e.lineWidth,l=a/2;e.translate(-l,-l);for(var c=!0,h=i+s;i<h;){var u=r[n];c&&e.fillRect(t,i,a,u),c=!c,i+=u,n=n===r.length-1?0:n+1}e.restore()},o.dashedLineTo=function(e,t,i,s,o,a){var l={thereYet:r,
|
||
cap:Math.min},c={thereYet:r,cap:Math.min};i-o>0&&(c.thereYet=n,c.cap=Math.max),t-s>0&&(l.thereYet=n,l.cap=Math.max),e.moveTo(t,i);for(var h=t,u=i,d=0,p=!0;!l.thereYet(h,s)||!c.thereYet(u,o);){var _=Math.atan2(o-i,s-t),m=a[d];h=l.cap(s,h+Math.cos(_)*m),u=c.cap(o,u+Math.sin(_)*m),p?e.lineTo(h,u):e.moveTo(h,u),d=(d+1)%a.length,p=!p}},o.setFont=function(e,t){if(e.font!==t)try{e.font=t}catch(i){}},"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(e){o.setFont(this,e)},CanvasRenderingContext2D.prototype.lineStyle=o.LINESTYLE_SOLID),e.exports=o},jJ9X:function(e,t,i){},jRfx:function(e,t,i){"use strict";i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l}));var s=i("Eyy1"),r=i("3u3j");class n extends r.a{constructor(e,t,i){super(e,t,i),this._restorePane=!1}redo(){const e=this._chartModel.panes().length,t=this._chartModel.panes()[this._targetPaneIndex()],i=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),r=Object(s.ensureNotNull)(this._chartModel.paneForSource(i)),n=this._chartModel.children(i,!0);r.bulkActionMacro(()=>{n.forEach(e=>this._chartModel.detachSource(e)),this._restorePane=this._chartModel.detachSource(i)});const o="overlay"===this._initialPriceScalePosition?this._initialPriceScalePosition:void 0,a=t.findSuitableScale(i,void 0,o),l=0===a.dataSources().length;if(t.bulkActionMacro(()=>{t.addDataSource(i,a,!1),n.forEach(e=>t.addDataSource(e,a,!1))}),i===this._chartModel.mainSeries()){const e=t.priceScalePosition(a);t.movePriceScale(a,e,0)}if(l){Object(s.ensureNotNull)(i.priceScale()).restoreState(this._newPriceScaleState(t.isOverlay(i)))}this._chartModel.fullUpdate(),e!==this._chartModel.panes().length&&this._chartModel.setShouldBeSavedEvenIfHidden(!0)}undo(){let e;e=this._restorePane?this._chartModel.createPane(this._initialPaneIndex):this._chartModel.panes()[this._initialPaneIndex];const t=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),i=Object(s.ensureNotNull)(this._chartModel.paneForSource(t)),r=this._chartModel.children(t,!0);i.bulkActionMacro(()=>{r.forEach(e=>this._chartModel.detachSource(e)),this._chartModel.detachSource(t)});let n=e.getPriceScaleById(this._initialPriceScaleId);null===n&&(n=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.bulkActionMacro(()=>{e.addDataSource(t,n,!0),r.forEach(t=>e.addDataSource(t,n,!1))}),Object(s.ensureNotNull)(t.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()}}class o extends n{constructor(e,t,i){super(e,t,i)}_targetPaneIndex(){return this._initialPaneIndex-1}}class a extends n{constructor(e,t,i){super(e,t,i)}_targetPaneIndex(){return this._initialPaneIndex+1}}class l extends n{constructor(e,t,i,s){super(e,t,s),this._targetPane=i}_targetPaneIndex(){return this._targetPane}}},jTis:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"CalloutConsts",(function(){return s})),function(e){e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",
|
||
e[e.MinWidth=100]="MinWidth"}(s||(s={}))},jeZR:function(e,t,i){"use strict";i.r(t),i.d(t,"AppliedTimeFrame",(function(){return r}));var s=i("QfUd");class r{constructor(e){this._appliedTimeFrame=new s.a(null),this._appliedTimeFrameInfo=null,this._appliedTimeFrameChangedBound=this._appliedTimeFrameChanged.bind(this),this._model=e,e.mainSeries().dataEvents().seriesTimeFrame().subscribe(this,this._onSeriesTimeFrame),this._appliedTimeFrame.subscribe(this._appliedTimeFrameChangedBound)}destroy(){this._appliedTimeFrame.unsubscribe(this._appliedTimeFrameChangedBound),this._model.timeScale().logicalRangeChanged().unsubscribeAll(this),this._model.mainSeries().dataEvents().seriesTimeFrame().unsubscribeAll(this)}appliedTimeFrame(){return this._appliedTimeFrame}_appliedTimeFrameChanged(){this._model.timeScale().logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame)}_onSeriesTimeFrame(e,t,i,s){if(s){const e=this._model.timeScale();this._appliedTimeFrameInfo={logicalRange:e.logicalRange(),baseIndex:e.baseIndex()},e.logicalRangeChanged().subscribe(this,this._invalidateAppliedTimeFrame)}}_invalidateAppliedTimeFrame(){if(null===this._appliedTimeFrameInfo)return;const e=this._model.timeScale(),t=e.logicalRange(),i=e.baseIndex(),s=this._appliedTimeFrameInfo.logicalRange,r=this._appliedTimeFrameInfo.baseIndex;(null===t||null===s||Math.abs(i-t.left()-(r-s.left()))>=.01||Math.abs(i-t.right()-(r-s.right()))>=.01)&&this._appliedTimeFrame.setValue(null)}}},jenN:function(e,t,i){"use strict";i.r(t);var s=i("txPx"),r=i("7Fue"),n=i("xWfy"),o=i("qySK"),a=i("KcY8");class l extends a.a{constructor(e,t){super(),this._source=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1;const s=this._source.priceScale(),r=this._source.properties().visible.value();if(!s||s.isEmpty()||!r)return;const n=this._source.properties().graphics[this._data.lineType][this._data.styleId];if(!(n.visible&&n.visible.value()&&n.showPrice&&n.showPrice.value()))return;const o=this._source.firstValue();if(null===o)return;const a=this._data.line.level,l=n.color.value();i.background=l,i.textColor=this.generateTextColor(l),i.coordinate=s.priceToCoordinate(a,o),e.text=s.formatPrice(a,o),e.visible=!0}}i.d(t,"createGraphicsPaneViews",(function(){return d})),i.d(t,"createGraphicsPriceAxisViews",(function(){return _})),i.d(t,"isStudyGraphicsEmpty",(function(){return r.a})),i.d(t,"StaticStudyGraphics",(function(){return n.a})),i.d(t,"emptyStudyGraphics",(function(){return n.b})),i.d(t,"loadStudyGraphics",(function(){return n.c})),i.d(t,"saveStudyGraphics",(function(){return n.d})),i.d(t,"LiveStudyGraphics",(function(){return o.a}));const c=Object(s.getLogger)("Chart.StudyGraphics"),h=new Set(["dwgtablecells"]);async function u(e,t,s,r){switch(e){case"hhists":return new((await i.e("study-pane-views").then(i.bind(null,"Gj0v"))).HHistPaneView)(t,s,r);case"horizlines":return new((await i.e("study-pane-views").then(i.bind(null,"1sos"))).HorizLinePaneView)(t,s,r);case"vertlines":return new((await i.e("study-pane-views").then(i.bind(null,"psYU"))).VertLinePaneView)(t,s,r)}
|
||
return null}async function d(e,t,i){const s=[],r=Object.keys(e.graphicsInfo());r.sort((e,t)=>p(e)-p(t));for(const n of r){const r=await u(n,e,t,i);null!==r?s.push(r):h.has(n)||c.logWarn(n+" is not supported by this build of graphics subsystem, skipping")}return s}function p(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function _(e){const t=Object.keys(e.graphicsInfo()),i=[];for(const s of t)switch(s){case"hlines":e.graphics().hlines().forEach((t,r)=>{t.forEach(t=>{void 0!==t.level&&i.push(new l(e,{line:{level:t.level},styleId:r,lineType:s}))})});break;case"horizlines":e.graphics().horizlines().forEach((t,r)=>{t.forEach(t=>{void 0!==t.level&&i.push(new l(e,{line:{level:t.level},styleId:r,lineType:s}))})})}return i}},jkoZ:function(e,t,i){"use strict";var s=i("XlJ7").makeFont,r=i("XlJ7").parseFont,n=(0,i("txPx").getLogger)("Model.ChartTradingUtils"),o={_fontHeightCache:{},_parsedColorCache:{},_parseColor:function(e){if(this._parsedColorCache[e])return this._parsedColorCache[e];var t=document.createElement("div");t.style.color=e;var i=t.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||t.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*\.?\d+)\s*\)$/i),s={r:i[1],g:i[2],b:i[3],a:i[4]||"1"};return this._parsedColorCache[e]=s,s},getColorFromProperties:function(e,t){var i=1-t.value()/100,s=this._parseColor(e.value());return"rgba("+s.r+","+s.g+","+s.b+","+i+")"},setColorToProperties:function(e,t,i){var s=this._parseColor(e);t.setValue("rgb("+s.r+","+s.g+","+s.b+")");var r=100*(1-s.a);i.setValue(Math.max(0,Math.min(r,100)))},getFontFromProperties:function(e,t,i,r){return s(t.value(),e.value(),r.value()?"italic":"",i.value()?"bold":"")},setFontToProperties:function(e,t,i,s,o){var a=r(e);null!==a?(a.family.length>0&&t.setValue(a.family),i.setValue(a.size),s.setValue(a.bold),o.setValue(a.italic)):n.logError("Invalid font: "+e)},fontHeight:function(e){if(!this._fontHeightCache[e]){var t=document.createElement("span");t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;";var i=t.offsetHeight;document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)}return this._fontHeightCache[e]},drawPolyHoverOrPress:function(e,t,i,s){s?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},repaint:function(e){e.lightUpdate()},roundToMinTick:function(e,t){var i=1/e.mainSource().base();return i*Math.round(t/i)}};e.exports=o},jofe:function(e,t,i){"use strict";function s(){let e,t;return{promise:new Promise((i,s)=>{e=i,t=s}),reject:t,resolve:e}}i.r(t),i.d(t,"createDeferredPromise",(function(){return s}))},jpZi:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Eyy1"),r=(i("YFKU"),i("HbRj"),i("RDU5"));const n=window.t("Exclude line tools from group {group}");class o extends r.UndoCommand{constructor(e,t,i){super(n.format({
|
||
group:t.name()})),this._model=e,this._groupId=t.id,this._groupName=t.name(),this._lineToolsIds=i.map(e=>e.id())}redo(){const e=Object(s.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),t=this._lineToolsIds.map(e=>this._model.dataSourceForId(e));e.excludeLineTools(t),0===e.lineTools().length&&this._model.lineToolsGroupModel().removeGroup(e)}undo(){const e=this._lineToolsIds.map(e=>this._model.dataSourceForId(e)),t=this._model.lineToolsGroupModel().groupForId(this._groupId);null!==t?t.addLineTools(e):this._model.lineToolsGroupModel().createGroup(e,this._groupName,this._groupId)}}},jvrd:function(e,t,i){"use strict";i.d(t,"e",(function(){return r})),i.d(t,"c",(function(){return o})),i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return l})),i.d(t,"d",(function(){return c}));var s=i("k9/m");function r(e,t,i){const s=e.barFunction();switch(e.style()){case 3:case 10:case 2:return s(t.value);default:return t.value[-1===i?3:2]}}function n(e){return e>=0?1:-1}function o(e,t){return-1===n(e)!==t?-1:1}function a(e,t,i,s){const r=Math.min(t,Math.max(0,1===s?i:t-i));return i-s*Math.abs(r*e/100)}function l(e,t,i){if(void 0===e.index)return null;const s=e.index();return null===s?null:{index:s,price:t.coordinateToPrice(t.height()/2,i)}}function c(e,t){const i=e.data().bars(),o=i.first(),a=i.last();if(null===o||null===a)return null;let l;if(void 0===t.index){const e=t.time(),r=o.value[0],n=a.value[0];if(e<r-86400||e>n)return null;l=i.searchByTime(e,s.PlotRowSearchMode.NearestRight,4)}else{const e=t.index();if(null===e)return null;l=i.search(e)}return null===l?null:{index:l.index,price:r(e,l,n(t.position()))}}},jy4L:function(e,t,i){"use strict";i.r(t),i.d(t,"makeNextSymbolId",(function(){return r})),i.d(t,"makeNextStudyId",(function(){return o}));let s=0;function r(){return s++,"ss_"+s}let n=0;function o(){return n++,"st"+n}},k4w6:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("2ijp");class r extends s.a{constructor(e){super(),this._series=e,this._model=e.model()}}},"k9/m":function(e,t,i){"use strict";i.r(t),i.d(t,"PlotRowSearchMode",(function(){return l})),i.d(t,"PlotList",(function(){return u})),i.d(t,"mergeMinMax",(function(){return d})),i.d(t,"mergePlotRows",(function(){return p}));var s=i("Eyy1"),r=i("Y7w9"),n=i("tqok"),o=i("txPx");const a=Object(o.getLogger)("Chart.PlotList");var l;!function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(l||(l={}));function c(e){return e.index}function h(e){return e.value[0]}class u{constructor(e=null,t=null){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map,this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}clear(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()}first(){
|
||
return this.size()>0?this._items[this._start]:null}last(){return this.size()>0?this._items[this._end-1]:null}firstIndex(){return this.size()>0?this._indexAt(this._start):null}lastIndex(){return this.size()>0?this._indexAt(this._end-1):null}size(){return this._end-this._start}isEmpty(){return 0===this.size()}contains(e){return null!==this.search(e,l.Exact)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}add(e,t){if(this._shareRead)return a.logDebug("add: readonly collection modification attempt"),!1;const i={index:e,value:t},s=this._nonCachedSearch(e,l.Exact,c);return this._invalidateSearchCaches(),null===s?(this._items.splice(this._lowerbound(e,c),0,i),this._start=0,this._end=this._items.length,!0):(this._items[s]=i,!1)}search(e,t=l.Exact,i){return this._searchImpl(e,t,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,c,i)}searchByTime(e,t=l.Exact,i){return this._searchImpl(e,t,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,h,i)}fold(e,t){let i=t;for(let s=this._start;s<this._end;++s){i=e(this._indexAt(s),this._valueAt(s),i)}return i}findFirst(e,t){const i=void 0!==t&&Math.min(this._start+t,this._end)||this._end;for(let s=this._start;s<i;++s){const t=this._indexAt(s),i=this._valueAt(s);if(e(t,i))return{index:t,value:i}}return null}findLast(e,t){const i=void 0!==t&&Math.max(this._end-t,this._start)||this._start;for(let s=this._end-1;s>=i;--s){const t=this._indexAt(s),i=this._valueAt(s);if(e(t,i))return{index:t,value:i}}return null}each(e){for(let t=this._start;t<this._end;++t){if(e(this._indexAt(t),this._valueAt(t)))break}}reduce(e,t){let i=t;for(let s=this._start;s<this._end;++s){i=e(i,this._indexAt(s),this._valueAt(s))}return i}range(e,t){const i=new u(this._plotFunctions,this._emptyValuePredicate);return i._items=this._items,i._start=this._lowerbound(e,c),i._end=this._upperbound(t),i._shareRead=!0,i}rangeIterator(e,t){const i=this._lowerbound(e,c),s=this._upperbound(t);if(i===s)return{hasNext:()=>!1,next:()=>{throw new Error("Invalid operation")}};let r=i-1;return{hasNext:()=>r<s-1,next:()=>(r+=1,this._items[r])}}minMaxOnRangeCached(e,t,i){if(this.isEmpty())return null;let s=null;for(const r of i){s=d(s,this._minMaxOnRangeCachedImpl(e-r.offset,t-r.offset,r.name))}return s}minMaxOnRange(e,t,i){if(this.isEmpty())return null;let s=null;for(const r of i){s=d(s,this._minMaxOnRange(e-r.offset,t-r.offset,r.name))}return s}merge(e){return this._shareRead?(a.logDebug("merge: readonly collection modification attempt"),null):0===e.length?null:this.isEmpty()||e[e.length-1].index<this._items[0].index?this._prepend(e):e[0].index>this._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)}addTail(e,t=!1){let i=0;t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value);for(let s=i;s<e.length;++s){const t=e[s],i=this.lastIndex();if(null===i){a.logError("Can't add tail to the empty plotlist");break}this.add(i+1,t.value)}
|
||
this._invalidateSearchCaches()}move(e){if(this._shareRead)return void a.logDebug("move: readonly collection modification attempt");if(0===e.length)return;const t=this._items.slice();for(const i of e){const e=this._bsearch(i.old,c);if(null!==e&&void 0!==t[e])if(i.new===n.a)t[e]=void 0;else{t[e]={index:i.new,value:t[e].value};const s=this._bsearch(i.new,c);if(null!==s){const e=t[s];void 0!==e&&e.index===i.new&&(t[s]=void 0)}}}this._items=t.filter(e=>void 0!==e).sort((e,t)=>e.index-t.index),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._start=0,this._end=this._items.length}remove(e){if(this._shareRead)return a.logDebug("remove: readonly collection modification attempt"),null;const t=this._nonCachedSearch(e,l.NearestRight,c);if(null===t)return null;const i=this._items.splice(t);return this._end=this._items.length,this._minMaxCache.clear(),this._invalidateSearchCaches(),i.length>0?i[0]:null}state(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}}restoreState(e){e?(this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._invalidateSearchCaches()):this.clear()}_indexAt(e){return this._items[e].index}_valueAt(e){return this._items[e].value}_length(){return this._items.length}_searchImpl(e,t,i,s,r,n){const o=void 0!==n?i:s,a=void 0!==n?1e4*(t+1)+n:t;let l=o.get(e);if(void 0!==l){const e=l.get(a);if(void 0!==e)return e}const c=this._nonCachedSearch(e,t,r,n);if(null===c)return null;const h={index:this._indexAt(c),value:this._valueAt(c)};return void 0===l&&(l=new Map,o.set(e,l)),l.set(a,h),h}_nonCachedSearch(e,t,i,s){const r=this._lowerbound(e,i),n=r===this._end||e!==i(this._items[r]);if(n&&t!==l.Exact)switch(t){case l.NearestLeft:return this._searchNearestLeft(r,s);case l.NearestRight:return this._searchNearestRight(r,s);default:throw new TypeError("Unknown search mode")}if(void 0===s||n||t===l.Exact)return n?null:r;switch(t){case l.NearestLeft:return this._nonEmptyNearestLeft(r,s);case l.NearestRight:return this._nonEmptyNearestRight(r,s);default:throw new TypeError("Unknown search mode")}}_nonEmptyNearestRight(e,t){const i=Object(s.ensure)(this._emptyValuePredicate),r=Object(s.ensure)(t);for(;e<this._end&&i(this._valueAt(e),r);)e+=1;return e===this._end?null:e}_nonEmptyNearestLeft(e,t){const i=Object(s.ensureNotNull)(this._emptyValuePredicate),r=Object(s.ensure)(t);for(;e>=this._start&&i(this._valueAt(e),r);)e-=1;return e<this._start?null:e}_searchNearestLeft(e,t){if(e===this._start)return null;const i=e-1,s=i!==this._end?i:null;return void 0!==t&&null!==s?this._nonEmptyNearestLeft(s,t):s}_searchNearestRight(e,t){const i=e,s=i!==this._end?i:null;return void 0!==t&&null!==s?this._nonEmptyNearestRight(s,t):s}_bsearch(e,t){const i=this._lowerbound(e,t);return i!==this._end&&e===t(this._items[i])?i:null}_lowerbound(e,t){return Object(r.lowerbound)(this._items,e,(e,i)=>t(e)<i,this._start,this._end)}_upperbound(e){return Object(r.upperbound)(this._items,e,(e,t)=>t.index>e,this._start,this._end)}_plotMinMax(e,t,i){let s=null
|
||
;const r=this._plotFunctions.get(i);if(void 0===r)throw new Error(`Plot "${i}" is not registered`);for(let n=e;n<t;n++){const e=r(this._items[n].value);null==e||Number.isNaN(e)||(null===s?s={min:e,max:e}:(e<s.min&&(s.min=e),e>s.max&&(s.max=e)))}return s}_invalidateCacheForRow(e){const t=Math.floor(e.index/30);this._minMaxCache.forEach(e=>e.delete(t))}_prepend(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]}_append(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]}_updateLast(e){Object(s.assert)(!this.isEmpty(),"plot list should not be empty");const t=this._items[this._end-1];Object(s.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._invalidateSearchCaches(),this._items[this._end-1]=e}_merge(e){return Object(s.assert)(0!==e.length,"plot rows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=p(this._items,e),this._start=0,this._end=this._items.length,e[0]}_minMaxOnRangeCachedImpl(e,t,i){if(this.isEmpty())return null;let r=null;const n=Object(s.ensureNotNull)(this.firstIndex()),o=Object(s.ensureNotNull)(this.lastIndex()),a=Math.max(e,n),l=Math.min(t,o),c=30*Math.ceil(a/30),h=Math.max(c,30*Math.floor(l/30));r=d(r,this._minMaxOnRange(a,Math.min(c,t,l),i));let u=this._minMaxCache.get(i);void 0===u&&(u=new Map,this._minMaxCache.set(i,u));for(let s=Math.max(c+1,a);s<h;s+=30){const e=Math.floor(s/30);let t=u.get(e);if(void 0===t){const s=30*e,r=30*(e+1)-1;t=this._minMaxOnRange(s,r,i),u.set(e,t)}r=d(r,t)}r=d(r,this._minMaxOnRange(h,l,i));return r}_minMaxOnRange(e,t,i){return this._plotMinMax(this._lowerbound(e,c),this._upperbound(t),i)}_invalidateSearchCaches(){this._rowSearchCacheByIndex.clear(),this._rowSearchCacheByIndexWithoutEmptyValues.clear(),this._rowSearchCacheByTime.clear(),this._rowSearchCacheByTimeWithoutEmptyValues.clear()}}function d(e,t){if(null===e)return t;if(null===t)return e;return{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max)}}function p(e,t){const i=function(e,t){const i=e.length,s=t.length;let r=i+s,n=0,o=0;for(;n<i&&o<s;)e[n].index<t[o].index?n++:e[n].index>t[o].index?o++:(n++,o++,r--);return r}(e,t),s=new Array(i);let r=0,n=0;const o=e.length,a=t.length;let l=0;for(;r<o&&n<a;)e[r].index<t[n].index?(s[l]=e[r],r++):e[r].index>t[n].index?(s[l]=t[n],n++):(s[l]=t[n],r++,n++),l++;for(;r<o;)s[l]=e[r],r++,l++;for(;n<a;)s[l]=t[n],n++,l++;return s}},kIXa:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),
|
||
i.e("lt-pane-views").then(i.t.bind(null,"am+t",7)).then(({TimeCyclesPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Time Cycles"}setPoint(e,t,i){var s=Object.assign({},t),r=this._points[0],n=this._points[1];r.price=s.price,n.price=s.price,this._points[e]=s,this.normalizePoints()}addPoint(e,t,i){var r=s.prototype.addPoint.call(this,e,t,!0);if(r){var n=this._points[0];this._points[1].price=n.price,i||(this.normalizePoints(),this.createServerPoints())}return r}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"BABJ"))).TimeCyclesPatternDefinitionsViewModel}static createProperties(e){var t=new r("linetooltimecycles",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolTimeCycles=n},kTaq:function(e,t,i){"use strict";i.r(t),i.d(t,"PlotFillPaneView",(function(){return o}));var s=i("Eyy1"),r=i("gMX9"),n=i("Tmoa");class o extends r.a{constructor(e,t,i){super(e,!!t.fillgaps),this._isHlineFill="hline_hline"===t.type,Object(s.assert)(this._isHlineFill||"plot_plot"===t.type,"Wrong filledArea type: "+t.type),this._isHlineFill&&this._initBandIndexes(t.objAId,t.objBId),this._fillMetaInfo=t,this._fillStyleProps=i;const r=e.metaInfo();for(let n=0;n<r.plots.length;++n){const i=r.plots[n];if("palette"in i&&i.palette===t.palette){this._colorPlotIndex=n,this._colorsMap=Object(s.ensureDefined)(Object(s.ensureDefined)(r.palettes)[t.palette]).valToIndex,this._colorValues=e.properties().palettes[t.palette].colors;break}if(r.isRGB&&"target"in i&&i.target===t.id){this._colorPlotIndex=n;break}}}_getColorByPlotValue(e){if(this._colorsMap){const t=Object(s.ensureDefined)(this._colorsMap)[e];return this._colorValues[Object(s.ensureDefined)(t)].childs().color.value()}return Object(n.rgbaFromInteger)(e)}_isPerBarColoringSupported(){return null!==this._colorPlotIndex}_plotAId(){return this._fillMetaInfo.objAId}_plotBId(){return this._fillMetaInfo.objBId}_color(){return this._fillStyleProps.childs().color.value()}_transparency(){return this._fillStyleProps.childs().transparency.value()}_correctVisibleRange(e){const[t,i]=super._correctVisibleRange(e),s=this._source.getMinFirstBarIndexForPlot(this._fillMetaInfo.id);return[Math.max(s,t),i]}_visible(){return this._fillStyleProps.childs().visible.value()}_initBandIndexes(e,t){this._bandAKey=null,this._bandBKey=null;const i=this._source.metaInfo().bands;if(void 0!==i)for(let s=0;s<i.length;++s){const r=i[s];null!==this._bandAKey||r.id!==e?null===this._bandBKey&&r.id===t&&(this._bandBKey=s):this._bandAKey=s}}}},kcTO:function(e,t,i){"use strict";i.r(t),i.d(t,"customFormatters",(function(){return l})),i.d(t,"formatterOptions",(function(){return c})),i.d(t,"numberToStringWithLeadingZero",(function(){return d})),i.d(t,"isFormatterHasForexAdditionalPrecision",(function(){return p})),i.d(t,"PriceFormatter",(function(){return _}));var s=i("YFKU"),r=i("ogJP"),n=i("Ialn"),o=i("txPx")
|
||
;const a=Object(o.getLogger)("Chart.PriceFormatter"),l={dateFormatter:null,timeFormatter:null},c={decimalSign:".",decimalSignFractional:"'"},h={regExp:/\.0+$/,separator:"."},u={regExp:/'0+$/,separator:"'"};function d(e,t){if(!Object(r.isNumber)(e))return"n/a";if(!Object(r.isInteger)(t))throw new TypeError("invalid length");if(t<0||t>16)throw new TypeError("invalid length");if(0===t)return e.toString();return("0000000000000000"+e.toString()).slice(-t)}function p(e){return"hasForexAdditionalPrecision"in e}class _{constructor(e,t,i,n){if(this.type="price",this._formatterErrors={custom:Object(s.t)("Price format is invalid."),fraction:Object(s.t)("Fraction part is invalid."),secondFraction:Object(s.t)("Second fraction part is invalid.")},t||(t=1),Object(r.isNumber)(e)&&Object(r.isInteger)(e)||(e=100),e<0)throw new TypeError("invalid base");this._priceScale=e,this._minMove=t,this._minMove2=n,this._removeEndingZeroesInfo=i?u:h,i&&void 0!==n&&n>0&&2!==n&&4!==n&&8!==n?a.logDebug("invalid minmove2"):(this._fractional=i,this.calculateDecimal())}isFractional(){return!!this._fractional}state(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}}calculateDecimal(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){let e=this._priceScale;for(this._fractional&&this._minMove2&&(e/=this._minMove2);e>1;)e/=10,this._fractionalLength++}}format(e,t,i,s=!0,r=!0){let o,a="";return e<0?(a=!1===s?"":"−",e=-e):e&&!0===t&&(a="+"),o=this._fractional?a+this._formatAsFractional(e,i):a+this._formatAsDecimal(e,i),r?Object(n.forceLTRStr)(o):o}parse(e){return e=(e=Object(n.stripLTRMarks)(e)).replace("−","-"),this._fractional?this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e):this._parseAsDecimal(e)}hasForexAdditionalPrecision(){return!this._fractional&&10===this._minMove2}withoutEndingZeroes(e){if(-1===e.indexOf(this._removeEndingZeroesInfo.separator))return e;const t=e.replace(this._removeEndingZeroesInfo.regExp,"");return t===e?null:t}static serialize(e){return e.state()}static deserialize(e){return new _(e.priceScale,e.minMove,e.fractional,e.minMove2)}_formatAsDecimal(e,t){let i;t=t||0,i=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,t)*this._priceScale/this._minMove;const s=1/i;let r;if(i>1)r=Math.floor(e);else{const t=Math.floor(Math.round(e/s)*s);r=0===Math.round((e-t)/s)?t:t+s}let n="";if(i>1){let s=+(Math.round(e*i)-r*i).toFixed(this._fractionalLength);s>=i&&(s-=i,r+=1);const o=void 0!==this._fractionalLength?this._fractionalLength:NaN;n=c.decimalSign+d(+s.toFixed(this._fractionalLength)*this._minMove,o+t),n=this._removeEndingZeros(n,t)}return r.toString()+n}_getFractPart(e,t){const i=[0,5],s=[0,2,5,7];return 2===t?void 0===i[e]?-1:i[e]:4===t?void 0===s[e]?-1:s[e]:e}_formatAsFractional(e,t){const i=this._priceScale/this._minMove;let s=Math.floor(e),r=t?Math.floor(e*i)-s*i:Math.round(e*i)-s*i;r===i&&(r=0,s+=1);let n="";if(t){let o=(e-s-r/i)*i;o=Math.round(o*Math.pow(10,t)),n=d(o,t),
|
||
n=this._removeEndingZeros(n,t)}if(!this._fractionalLength)throw new Error("_fractionalLength is not calculated");let o="";if(this._minMove2){const e=r%this._minMove2;r=(r-e)/this._minMove2;const t=d(r,this._fractionalLength),i=this._getFractPart(e,this._minMove2);o=t+c.decimalSignFractional+i}else r=this._getFractPart(r,this._priceScale),o=d(r*this._minMove,this._fractionalLength);return s.toString()+c.decimalSignFractional+o+n}_removeEndingZeros(e,t){for(let i=0;i<t&&"0"===e[e.length-1];i++)e=e.substr(0,e.length-1);return e}_parseAsDecimal(e){let t=new RegExp(/^(-?)[0-9]+$/).exec(e);if(t){const t=parseFloat(e);return{value:t,res:!0,suggest:this.format(t)}}if(t=new RegExp("^(-?)[0-9]+\\"+c.decimalSign+"[0-9]*$").exec(e),t){const t=parseFloat(e.replace(c.decimalSign,"."));return{value:t,res:!0,suggest:this.format(t)}}return{error:this._formatterErrors.custom,res:!1}}_patchFractPart(e,t){const i={0:0,5:1},s={0:0,2:1,5:2,7:3};return 2===t?void 0===i[e]?-1:i[e]:4===t?void 0===s[e]?-1:s[e]:e}_parseAsSingleFractional(e){let t=new RegExp(/^(-?)[0-9]+$/).exec(e);if(t){const t=parseFloat(e);return{value:t,res:!0,suggest:this.format(t)}}if(t=new RegExp("^(-?)([0-9]+)\\"+c.decimalSignFractional+"([0-9]+)$").exec(e),t){const e=!!t[1],i=parseInt(t[2]),s=this._priceScale,r=this._patchFractPart(parseInt(t[3]),s);if(r>=s||r<0)return{error:this._formatterErrors.fraction,res:!1};let n=i+r/s;return e&&(n=-n),{value:n,res:!0,suggest:this.format(n)}}return{error:this._formatterErrors.custom,res:!1}}_parseAsDoubleFractional(e){let t=new RegExp(/^(-?)[0-9]+$/).exec(e);if(t){const t=parseFloat(e);return{value:t,res:!0,suggest:this.format(t)}}if(t=new RegExp("^(-?)([0-9]+)\\"+c.decimalSignFractional+"([0-9]+)\\"+c.decimalSignFractional+"([0-9]+)$").exec(e),t){const e=!!t[1],i=parseInt(t[2]),s=void 0!==this._minMove2?this._minMove2:NaN,r=this._priceScale/s,n=this._minMove2,o=this._patchFractPart(parseInt(t[3]),r),a=this._patchFractPart(parseInt(t[4]),n);if(o>=r||o<0)return{error:this._formatterErrors.fraction,res:!1};if(void 0!==n&&a>=n||a<0)return{error:this._formatterErrors.secondFraction,res:!1};let l=void 0!==n?i+o/r+a/(r*n):NaN;return e&&(l=-l),{value:l,res:!0,suggest:this.format(l)}}return{error:this._formatterErrors.custom,res:!1}}}},krs7:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("ocLq"),n=i("LxhU");class o{constructor(e,t){this._minTick=NaN,this._minPrice=NaN,this._maxPrice=NaN,this._low=NaN,this._high=NaN,this._startPrice=NaN,this._indexLowVbP=NaN,this._indexHighVbP=NaN,this._rowSize=e,this._type=t}init(e,t,i,s,r){this._minTick=e,this._minPrice=t,this._maxPrice=i,this._low=s,this._high=r}getStartPrice(){return this._startPrice}setStartPrice(e){this._startPrice=e}getIndexLowVbP(){return this._indexLowVbP}setIndexLowVbP(e){this._indexLowVbP=e}getIndexHighVbP(){return this._indexHighVbP}setIndexHighVbP(e){this._indexHighVbP=e}type(){return this._type}}class a extends o{constructor(e){super(e,0)}calculate(){this.setStartPrice(this._minPrice);const e=this.rowWidth()
|
||
;let t=Math.floor((this._low-this._minPrice)/e),i=Math.ceil((this._high-this._minPrice)/e)-1;t=Math.max(t,0),i=Math.max(i,0),i=Math.min(i,this._rowSize-1),t=Math.min(t,i),this.setIndexLowVbP(t),this.setIndexHighVbP(i)}rowWidth(){return Math.max((this._maxPrice-this._minPrice)/this._rowSize,this._minTick)}}class l extends o{constructor(e){super(e,1)}calculate(){this.setStartPrice(0);const e=this.rowWidth();let t=Math.floor(this._low/e);const i=Math.ceil(this._high/e)-1;t=Math.min(t,i),this.setIndexLowVbP(t),this.setIndexHighVbP(i)}rowWidth(){return this._minTick*this._rowSize}}var c=i("Kxc7");var h=i("KG+6");class u{constructor(){this._stable=[],this._variable=null,this._owner=null}addStable(e){e.setOwner(this),this._stable.push(e)}setVariable(e){this._variable=e,null!==this._variable&&this._variable.setOwner(this)}primitivesData(e){const t=[];return this._forEach(i=>t.push(...i.primitivesData(e))),t}deleteErasedItems(){this._forEach(e=>e.deleteErasedItems())}markPostedItems(){this._forEach(e=>e.markPostedItems())}isNaN(){return this._all(e=>e.isNaN())}dirty(){null!==this._owner&&this._owner.dirty()}setOwner(e){this._owner=e}_forEach(e){for(const t of this._stable)e(t);null!==this._variable&&e(this._variable)}_all(e){for(const t of this._stable)if(!e(t))return!1;return null===this._variable||e(this._variable)}}var d=i("Hr11");class p{constructor(e,t,i,s){this._value=e,this._name=t,this._owner=i,this._comparer=void 0!==s?s:(e,t)=>null==e?null!=t:e===t}getName(){return this._name}set(e){const t=this._comparer(this._value,e);return t&&this._owner.dirty(),this._value=e,t}get(){return this._value}}class _{constructor(e,t,i){this._owner=null,this._value=e,this._name=t,this._owner=i}getName(){return this._name}set(e){return this._value!==e&&(this._value=e,null!==this._owner&&this._owner.dirty(),!0)}get(){return this._value}}class m extends p{constructor(e,t,i,s){super(e,t,i,s)}}class f{constructor(e){this._owner=e}createField(e,t){return new p(e,t,this)}createDoubleField(e,t){return new p(e,t,this,(e,t)=>!r.Std.equal(e,t))}createDoubleArrayField(e,t){return new m(e,t,this,(e,t)=>{if(e===t)return!1;const i=e.length;if(t.length!==i)return!0;for(let s=0;s<i;s++){const i=e[s],n=t[s];if(!r.Std.equal(i,n))return!0}return!1})}createTimeField(e,t){return new _(e,t,this)}dirty(){null!==this._owner&&this._owner.dirty()}setOwner(e){this._owner=e}}class g{constructor(e){this._mixinJSONObject=new f(this),this._state=0,this._owner=null,this._gen=e,this._id=e.nextGraphicsObjId(),this._id2=this._mixinJSONObject.createField(this.id(),"id")}dirty(){null!==this._owner&&this._owner.dirty()}setOwner(e){this._owner=e}id(){return this._id}unsetOwner(e){this._owner===e&&(this._owner=null)}state(){return this._state}erase(){1===this._state&&this._gen.pushEraseObjCmd(this._id,this.jsonName()),this._state=2,this.dirty()}markAsPosted(){1!==this._state&&(this._state=1,this.dirty())}isErased(){return 2===this._state}isPosted(){return 1===this._state}isNaN(){return!1}_processObjUpdate(){
|
||
1===this._state&&(this._gen.pushEraseObjCmd(this._id,this.jsonName()),this._id=this._gen.nextGraphicsObjId(),this._id2.set(this._id),this._state=0),this.dirty()}}class v extends g{constructor(e,t,i,r,n,o){super(e),Object(s.assert)(t<i),this._priceLow=this._mixinJSONObject.createDoubleField(t,"priceLow"),this._priceHigh=this._mixinJSONObject.createDoubleField(i,"priceHigh"),this._rate=this._mixinJSONObject.createDoubleArrayField(r,"rate"),this._firstBarTime=this._mixinJSONObject.createTimeField(n,"firstBarTime"),this._lastBarTime=this._mixinJSONObject.createTimeField(o,"lastBarTime")}isNaN(){return super.isNaN()||Number.isNaN(this._priceLow.get())||Number.isNaN(this._priceHigh.get())||0===this._rate.get().length}jsonName(){return"hhists"}primitiveData(){return{id:this.id(),priceHigh:this._priceHigh.get(),priceLow:this._priceLow.get(),rate:this._rate.get().slice(),firstBarTime:this._firstBarTime.get(),lastBarTime:this._lastBarTime.get()}}setPriceLow(e){this._priceLow.set(e)&&this._processObjUpdate()}priceLow(){return this._priceLow.get()}priceHigh(){return this._priceHigh.get()}setPriceHigh(e){this._priceHigh.set(e)&&this._processObjUpdate()}rate(){return this._rate.get().slice()}setRate(e){this._rate.set(e)&&this._processObjUpdate()}rateAt(e){return this._rate.get()[e]}ratesSum(){let e=0;for(const t of this._rate.get())!Number.isNaN(t)&&Number.isFinite(t)&&(e+=t);return e}firstBarTime(){return this._firstBarTime.get()}setFirstBarTime(e){this._firstBarTime.set(e)&&this._processObjUpdate()}lastBarTime(){return this._lastBarTime.get()}setLastBarTime(e){this._lastBarTime.set(e)&&this._processObjUpdate()}}function b(e){return Boolean(e.isNaN)}class S{constructor(){this._items=[],this._owner=null}primitivesData(e){const t=[];for(const i of this._items)e.isIgnoredObj(i)||t.push(i.primitiveData());return t}get(e){return this._items[e]}set(e,t){return this.dirty(),t.setOwner(this),this._items[e]=t,t}addAtIndex(e,t){this.dirty(),t.setOwner(this),this._items[e]=t}clear(){this._unsetOwner(this._items),this._items=[],this.dirty()}addAllFromNumber(e,t){this.setOwner(t),this._items.splice(e,0,...t._items);return this._setCachedDataValid(!1),!0}addAll(e){this.setOwner(e),this._items.push(...e._items);return this._setCachedDataValid(!1),!0}remove(e){const t=this._items[e];return this._items.splice(e,1),t.unsetOwner(this),this.dirty(),t}getItems(){return this._items}size(){return this._items.length}add(e){e.setOwner(this),this._items.push(e);return this._setCachedDataValid(!1),!0}deleteErasedItems(){this._items=this._items.filter(e=>!e.isErased())}markPostedItems(){for(const e of this._items)e.markAsPosted()}isNaN(){if(0===this._items.length)return!0;for(const e of this._items){if(!b(e))return!1;if(!e.isNaN())return!1}return!0}setOwner(e){this._owner=e}dirty(){null!==this._owner&&this._owner.dirty()}_unsetOwner(e){for(const t of e)t instanceof g&&t.unsetOwner(this)}_setCachedDataValid(e){e||this.dirty()}}class y{constructor(e,t,i){this.index=e,this.offset=i,this.level=t}isNaN(){return Number.isNaN(this.level)}equals(e){
|
||
return e instanceof y&&(!this.isNaN()&&(!e.isNaN()&&(this.index===e.index&&this.offset===e.offset&&r.Std.equal(this.level,e.level))))}getLevel(){return this.level}getIndex(){return this.index}}class w extends g{constructor(e,t){super(e),this._points=[],t&&(this._points=t)}addPoint(e){this._processObjUpdate(),this._points.push(e)}addPoints(e){this._processObjUpdate(),this._points.push(...e)}setPoint(e,t){const i=this._points[e];t.equals(i)||(this._processObjUpdate(),this._points[e]=t)}point(e){const t=this._points[e];return new y(t.index,t.level,t.offset)}points(){return this._points}pointsCount(){return this._points.length}setPoints(e){if(e.length===this._points.length){let t=!0;for(let i=0;i<e.length;++i)if(!e[i].equals(this._points[i])){t=!1;break}if(t)return}this._processObjUpdate(),this._points=[],this._points.push(...e)}clearPoints(){this._processObjUpdate(),this._points=[]}isNaN(){return super.isNaN()||this._points.length<3}jsonName(){return"polygons"}primitiveData(){return{id:this.id(),points:this._points.map(e=>({index:e.index,offset:e.offset,level:e.level}))}}}class C extends g{constructor(e,t,i,s,r=!1,n=!1){super(e),this._endIndex=this._mixinJSONObject.createTimeField(i,"endIndex"),this._extendLeft=this._mixinJSONObject.createField(r,"extendLeft"),this._extendRight=this._mixinJSONObject.createField(n,"extendRight"),this._level=this._mixinJSONObject.createDoubleField(s,"level"),this._startIndex=this._mixinJSONObject.createTimeField(t,"startIndex")}isNaN(){return super.isNaN()||Number.isNaN(this._level.get())||this._startIndex.get()<0||this._endIndex.get()<0||this._startIndex.get()===this._endIndex.get()&&!this._extendLeft.get()&&!this._extendRight.get()}jsonName(){return"horizlines"}primitiveData(){return{id:this.id(),startIndex:this._startIndex.get(),endIndex:this._endIndex.get(),extendLeft:this._extendLeft.get(),extendRight:this._extendRight.get(),level:this._level.get()}}startIndex(){return this._startIndex.get()}setStartIndex(e){this._startIndex.set(e)&&this._processObjUpdate()}endIndex(){return this._endIndex.get()}setEndIndex(e){this._endIndex.set(e)&&this._processObjUpdate()}level(){return this._level.get()}setLevel(e){this._level.set(e)&&this._processObjUpdate()}isExtendLeft(){return this._extendLeft.get()}setExtendLeft(e){this._extendLeft.set(e)&&this._processObjUpdate()}extendLeft(){return this.isExtendLeft()}isExtendRight(){return this._extendRight.get()}setExtendRight(e){this._extendRight.set(e)&&this._processObjUpdate()}extendRight(){return this.isExtendRight()}}class P{constructor(){this._map=new Map}get(e){const t=this._innerMap(e.start);return t&&t.get(e.end)}set(e,t){this._innerMap(e.start,!0).set(e.end,t)}clear(){this._map.clear()}size(){let e=0;return this._map.forEach(t=>e+=t.size),e}_innerMap(e,t){let i=this._map.get(e);return void 0===i&&t&&(i=new Map,this._map.set(e,i)),i}}class x{constructor(e,t,i,r,n,o,a,l,c,h,u,d,p,_){this._freezedBoxes=new S,this._freezedHists=new S,this._freezedPocs=new S,this._freezedVAHists=new S,this._currentHistsGr=new S,this._currentVAHistsGr=new S,
|
||
this._currentHists=[],this._currentHistsMap=new P,this._currentBox=null,this._currentPoc=null,this._historyBarSet=[],this._prevRtBar=null,this._minPrice=Number.POSITIVE_INFINITY,this._maxPrice=Number.NEGATIVE_INFINITY,this._leftBoxTime=null,this._rightBoxTime=null,this._needRecalc=!1,this._largestHistItem=null,this._rowsLayout=null,this._currentVAStart=0,this._currentVAEnd=0,this._previousVAStart=0,this._previousVAEnd=0,this._idsGenerator=null,Object(s.assert)(1===e||2===e),this._numOfSubHists=e,this._outHists=r,this._outBoxLines=n,this._outPocLines=o,this._extendPocLeftRight=a,this._outVAHists=l,this._vaVolumePercent=c,this._rowsLayoutSupplier=h,this._outHists.addStable(this._freezedHists),this._outVAHists.addStable(this._freezedVAHists),this._maxHHistItems=u,this._layoutIsAutoselected=_,this._leftBoxTimeMutable=d,this._rightBoxTimeMutable=p,this._ctx=t,this._seriesGetter=i}update(e){this._supplyRowsLayout(this._ctx),null===this._currentBox&&this._initCurrentBox(),null===this._currentPoc&&this._initCurrentPoc();const t=this._timeScale().get(e);this._leftBoxTime=this._leftBoxTimeMutable,this._rightBoxTime=this._rightBoxTimeMutable,this._ctx.symbol.isLastBar&&!Number.isNaN(this._rightBoxTime)&&(this._rightBoxTime=Math.min(t+n.Interval.parse(this._ctx.symbol.interval+this._ctx.symbol.resolution).inMilliseconds(t)-1,this._rightBoxTime));const i=r.Std.greaterOrEqual(this._seriesClose().get(e),this._seriesOpen().get(e)),s={high:this._seriesHigh().get(e),low:this._seriesLow().get(e),volume:this._seriesVol().get(e),isUp:i,time:t};this._updateCurrentHistogram(s),this._currentHists.length>0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc(),this._seriesGetter.developingPoc().set(this._currentPoc.level()),this._updateValueArea(),this._vaVolumePercent>0&&(this._seriesGetter.developingVAHigh().set(this._currentHists[this._currentVAEnd].priceHigh()),this._seriesGetter.developingVALow().set(this._currentHists[this._currentVAStart].priceLow()))),this._updateCurrentBox(),this._rebuildOutData()}setIdsGeneratorProxy(e){this._idsGenerator=e}nextGraphicsObjId(){return Object(s.ensureNotNull)(this._idsGenerator).nextGraphicsObjId()}pushEraseObjCmd(e,t){Object(s.ensureNotNull)(this._idsGenerator).pushEraseObjCmd(e,t)}popEraseCmds(){return Object(s.ensureNotNull)(this._idsGenerator).popEraseCmds()}_timeScale(){return this._seriesGetter.time()}_seriesLow(){return this._seriesGetter.low()}_seriesHigh(){return this._seriesGetter.high()}_seriesVol(){return this._seriesGetter.volume()}_seriesOpen(){return this._seriesGetter.open()}_seriesClose(){return this._seriesGetter.close()}_freezeCurrentHistogramAndCleanup(){null!==this._currentBox&&this._freezedBoxes.add(this._currentBox),r.Std.greater(this._getVolume(this._currentHists),0)&&(this._freezedHists.addAll(this._currentHistsGr),this._freezedVAHists.addAll(this._currentVAHistsGr),null!==this._currentPoc&&this._freezedPocs.add(this._currentPoc)),this._currentHists=[],this._currentHistsGr.clear(),this._currentHistsMap.clear(),this._initCurrentBox(),
|
||
this._initCurrentPoc(),this._currentVAHistsGr.clear(),this._historyBarSet=[],this._minPrice=Number.POSITIVE_INFINITY,this._maxPrice=Number.NEGATIVE_INFINITY,this._prevRtBar=null,this._leftBoxTime=null,this._rightBoxTime=null}_supplyRowsLayout(e){null===this._rowsLayout&&e.symbol.isFirstBar&&e.symbol.isNewBar&&(this._rowsLayout=this._rowsLayoutSupplier())}_updateCurrentHistogram(e){if(this._needRecalc=!1,r.Std.greater(this._minPrice,e.low)&&(this._minPrice=e.low,this._needRecalc=!0),r.Std.less(this._maxPrice,e.high)&&(this._maxPrice=e.high,this._needRecalc=!0),this._ctx.symbol.isBarClosed&&this._historyBarSet.length>0){const t=this._historyBarSet[this._historyBarSet.length-1];t.time===e.time&&(this._prevRtBar=t,this._historyBarSet.pop())}this._needRecalc&&0===Object(s.ensureNotNull)(this._rowsLayout).type()?(this._recalculateCurrentResultsOnHistoryBarSet(),this._applyUpdateToCurrentResults(e,!1)):this._applyUpdateToCurrentResults(e,!0),this._ctx.symbol.isBarClosed?(Object(s.assert)(null===this._prevRtBar||e.time===this._prevRtBar.time),this._historyBarSet.push(e),this._prevRtBar=null):this._prevRtBar=e}_getMidLevel(e){return(e.priceHigh()+e.priceLow())/2}_getMidLevelFromList(e){return e.length%2==0?e[e.length/2].priceLow():this._getMidLevel(e[Math.floor(e.length/2)])}_getLargestHistItem(){let e=[],t=this._currentHists[0];for(const i of this._currentHists)r.Std.greater(i.ratesSum(),t.ratesSum())?(t=i,e=[t]):r.Std.equal(i.ratesSum(),t.ratesSum())&&e.push(i);if(e.length>1){const i=this._getMidLevelFromList(this._currentHists);t=e[e.length-1];for(let s=e.length-2;s>=0;s--){const n=e[s];r.Std.lessOrEqual(Math.abs(this._getMidLevel(n)-i),Math.abs(this._getMidLevel(t)-i))&&(t=n)}}return t}_initCurrentPoc(){this._currentPoc=new C(this,0,0,0)}_updateCurrentPoc(){const e=Object(s.ensureNotNull)(this._currentPoc);e.setStartIndex(Object(s.ensureNotNull)(this._leftBoxTime)),e.setEndIndex(Object(s.ensureNotNull)(this._rightBoxTime)),e.setExtendLeft(this._extendPocLeftRight),e.setExtendRight(this._extendPocLeftRight);const t=this._getMidLevel(Object(s.ensureNotNull)(this._largestHistItem));e.setLevel(t)}_getVolume(e){let t=0;for(const i of e)t+=i.ratesSum();return t}_getPocHistItemIndex(){for(let e=0;e<this._currentHists.length;e++)if(this._currentHists[e]===this._largestHistItem)return e;return-1}_calculateValueArea(){const e=this._getPocHistItemIndex();Object(s.assert)(e>=0,"ERROR - PocHistItemIndex == "+e),this._currentVAStart=e-1,this._currentVAEnd=e+1;const t=this._getVolume(this._currentHists)*this._vaVolumePercent*.01;let i=this._currentHists[e].ratesSum(),n=0,o=null;for(;r.Std.lessOrEqual(i+n,t)&&(i+=n,0===o?--this._currentVAStart:1===o&&++this._currentVAEnd,-1!==this._currentVAStart||this._currentVAEnd!==this._currentHists.length);){let t,i;if(this._currentVAStart>-1)if(t=this._currentHists[this._currentVAStart].ratesSum(),this._currentVAEnd<this._currentHists.length)if(i=this._currentHists[this._currentVAEnd].ratesSum(),r.Std.greater(t,i))n=t,o=0;else if(r.Std.greater(i,t))n=i,o=1;else{
|
||
const s=Math.abs(e-this._currentVAStart),r=Math.abs(e-this._currentVAEnd);s<r?(n=t,o=0):r<=s&&(n=i,o=1)}else n=t,o=0;else n=this._currentHists[this._currentVAEnd].ratesSum(),o=1}this._currentVAStart++,this._currentVAEnd--}_isVA(e){return e.priceHigh()>this._getMidLevel(this._currentHists[this._currentVAStart])&&e.priceLow()<this._getMidLevel(this._currentHists[this._currentVAEnd])}_updateValueArea(){if(this._calculateValueArea(),this._needRecalc||this._previousVAStart!==this._currentVAStart||this._previousVAEnd!==this._currentVAEnd){let e=0,t=0;for(;e<this._currentHistsGr.size()&&t<this._currentVAHistsGr.size();){for(;e<this._currentHistsGr.size()&&!this._isVA(this._currentHistsGr.get(e));)e++;for(;t<this._currentVAHistsGr.size()&&this._isVA(this._currentVAHistsGr.get(t));)t++;if(e<this._currentHistsGr.size()&&t<this._currentVAHistsGr.size()){const i=this._currentHistsGr.get(e);this._currentHistsGr.set(e,this._currentVAHistsGr.get(t)),this._currentVAHistsGr.set(t,i)}}for(;e<this._currentHistsGr.size();e++){const t=this._currentHistsGr.get(e);this._isVA(t)&&(this._currentHistsGr.remove(e),e--,this._currentVAHistsGr.add(t))}for(;t<this._currentVAHistsGr.size();t++){const e=this._currentVAHistsGr.get(t);this._isVA(e)||(this._currentVAHistsGr.remove(t),t--,this._currentHistsGr.add(e))}}this._previousVAStart=this._currentVAStart,this._previousVAEnd=this._currentVAEnd}_initCurrentBox(){this._currentBox=new w(this)}_updateCurrentBox(){let e=this._minPrice,t=this._maxPrice;this._currentHists.length>0&&(e=this._currentHists[0].priceLow(),t=this._currentHists[this._currentHists.length-1].priceHigh());const i=[],r=Object(s.ensureNotNull)(this._leftBoxTime),n=Object(s.ensureNotNull)(this._rightBoxTime);i.push(new y(r,e)),i.push(new y(r,t)),i.push(new y(n,t)),i.push(new y(n,e)),Object(s.ensureNotNull)(this._currentBox).setPoints(i)}_recalculateCurrentResultsOnHistoryBarSet(){for(let e=0;e<this._currentHists.length;++e)this._currentHists[e].erase();this._currentHists=[],this._currentHistsGr.clear(),this._currentVAHistsGr.clear(),this._currentHistsMap.clear();for(let e=0;e<this._historyBarSet.length;e++)this._addHistoryBarToHistogram(this._historyBarSet[e],e,this._currentHists,this._currentHistsMap,1);this._currentHists.length>0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc()),this._updateCurrentBox()}_applyUpdateToCurrentResults(e,t){t&&null!==this._prevRtBar&&this._addHistoryBarToHistogram(this._prevRtBar,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,-1),this._addHistoryBarToHistogram(e,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,1),this._updateLastBarTimeInHistogram(this._currentHists)}_addHistoryBarToHistogram(e,t,i,n,o){Object(s.assert)(-1===o||1===o,"Please set sign argument either +1 or -1");const a=e.low,l=e.high,c=isNaN(e.volume)?0:e.volume,h=e.isUp,u=Object(s.ensureNotNull)(this._rowsLayout);u.init(this._ctx.symbol.minTick,this._minPrice,this._maxPrice,a,l);const d=u.rowWidth();if(!r.Std.greater(d,0))return;u.calculate()
|
||
;const p=u.getIndexLowVbP(),_=u.getIndexHighVbP(),m=u.getStartPrice();if(p===_){const e=p*d+m,t=(p+1)*d+m;this._updateResult({start:e,end:t},o*c,h,i,n)}else{let e=0;for(let t=p;t<=_;t++){const s=t*d+m,r=(t+1)*d+m,u=this._rowCoeff(s,r,a,l),p=u*c;e+=u,this._updateResult({start:s,end:r},o*p,h,i,n)}Object(s.assert)(r.Std.equal(e,1,.05),"totalCoeff not equal 1! totalConf = "+e)}}_updateResult(e,t,i,n,o){const a=this._createRates(i,t);Object(s.assert)(null!==this._leftBoxTime,"leftBoxTime is not set (equals null)"),Object(s.assert)(null!==this._rightBoxTime,"rightBoxTime is not set (equals null)");const l=Object(s.ensureNotNull)(this._leftBoxTime),c=Object(s.ensureNotNull)(this._rightBoxTime);let h=o.get(e);if(void 0===h)h=new v(this,e.start,e.end,a,l,c),o.set(e,h),this._verifyHistogramSizeIsNotTooLarge(o.size()),this._currentHistsGr.add(h),x._addInOrder(h,n,0,n.length,(e,t)=>{let i=r.Std.compare(e.firstBarTime(),t.firstBarTime());return 0!==i?i:(i=r.Std.compare(e.priceLow(),t.priceLow()),0!==i?i:r.Std.compare(e.priceHigh(),t.priceHigh()))});else{const e=[];for(let t=0;t<a.length;t++)e[t]=h.rateAt(t)+a[t];h.setRate(e)}}_rebuildOutData(){const e=this._currentHistsMap.size(),t=this._currentHists.length,i=this._currentHistsGr.size(),n=this._currentVAHistsGr.size();Object(s.assert)(e===t&&t===i+n,`Collections of HHistItems are out of sync ${e} ${t} ${i} ${n}`),this._outPocLines.clear(),this._outPocLines.addAll(this._freezedPocs),r.Std.greater(this._getVolume(this._currentHists),0)?(this._outHists.setVariable(this._currentHistsGr),this._outPocLines.add(Object(s.ensureNotNull)(this._currentPoc)),this._outVAHists.setVariable(this._currentVAHistsGr)):(this._outHists.setVariable(null),this._outVAHists.setVariable(null)),this._outBoxLines.clear(),this._outBoxLines.addAll(this._freezedBoxes),this._outBoxLines.add(Object(s.ensureNotNull)(this._currentBox))}_verifyHistogramSizeIsNotTooLarge(e){if(this._layoutIsAutoselected)return;if(e<=this._maxHHistItems)return;const t=Object(s.ensureNotNull)(this._rowsLayout);0===t.type()?r.Std.error('Histogram is too large, please reduce "Row Size" input.'):(Object(s.assert)(1===t.type(),"Unexpected rowsLayout type "+t.type()),r.Std.error('Histogram is too large, please increase "Row Size" input.'))}_createRates(e,t){if(1===this._numOfSubHists)return[t];if(2===this._numOfSubHists){const i=[0,0];return i[e?0:1]=t,i}return Object(s.assert)(!1,"Incorrect value of numOfSubHists = "+this._numOfSubHists),[]}_updateLastBarTimeInHistogram(e){const t=Object(s.ensureNotNull)(this._rightBoxTime);for(const i of e)i.setLastBarTime(t)}_rowCoeff(e,t,i,s){const r=s-i;return(t-e-Math.max(t-s,0)-Math.max(0,i-e))/r}static _addInOrder(e,t,i,s,r){if(i===s)return void t.splice(i,0,e);const n=Object(d.toInt)((i+s)/2),o=t[n];r(e,o)<0?x._addInOrder(e,t,i,n,r):r(e,o)>0?x._addInOrder(e,t,n+1,s,r):t.splice(n,0,e)}}class T extends x{constructor(e,t,i,s,r,n,o,a,l,c,h){super(e,t,i,n,new S,o,!0,a,l,()=>c,h,s,r,!1),this._firstBarTime=s,this._lastBarTime=r}update(e){this._supplyRowsLayout(this._ctx),
|
||
this.timeInRequestedRange(e)&&super.update(e)}timeInRequestedRange(e){const t=this._timeScale().get(e);return this._firstBarTime<=t&&t<this._lastBarTime}}class M{constructor(){this._horizlines=[],this._hhists=[],this._polygons=[],this._vertlines=[],this._containersCache=[],this._containerNamesCache=[],this._containersMapCache=new Map,this._addToCache("horizlines",this._horizlines),this._addToCache("hhists",this._hhists),this._addToCache("polygons",this._polygons),this._addToCache("vertlines",this._vertlines)}primitiveData(e){const t={};let i=!1;for(const s of this._containerNamesCache){const r=[],n=this.getObjsContainer(s);for(const t of n){if(t.isNaN())continue;const i=t.primitiveData(e);i.data.length>0&&r.push(i)}r.length>0&&(t[s]=r,i=!0)}return i?t:null}deleteErasedAndMarkPostedObjs(){this.forEachList(e=>{e.deleteErasedItems(),e.markPostedItems()})}deleteErasedObjs(){this.forEachList(e=>e.deleteErasedItems())}getObjsContainer(e){return Object(s.ensureDefined)(this._containersMapCache.get(e))}forEachList(e){for(const t of this._containersCache)for(const i of t)e(i.data)}_addToCache(e,t){this._containersCache.push(t),this._containerNamesCache.push(e),this._containersMapCache.set(e,t)}}class I{constructor(e,t){this.styleId=e,this.data=t}isNaN(){return this.data.isNaN()}primitiveData(e){return{styleId:this.styleId,data:this.data.primitivesData(e)}}}class L{constructor(e,t){this.id=e,this.type=t}primitiveData(){return{action:"one",id:this.id,type:this.type}}}class O{primitiveData(){return{action:"all"}}}class A{constructor(){this.erase=[],this.create=null,this._modified=!1}primitiveData(e){if(this.isNaN())return null;const t={},i=this.create&&this.create.primitiveData(e);return null!==i&&(t.create=i),null!==this.erase&&this.erase.length>0&&(t.erase=this.erase.map(e=>e.primitiveData())),void 0===t.create&&void 0===t.erase?null:t}setCreate(e){this.create=e,this.create.forEachList(e=>e.setOwner(this))}isNaN(){return(null===this.erase||0===this.erase.length)&&null===this.create}isModified(){return this._modified}setModified(e){this._modified=e}dirty(){this._modified=!0}setOwner(e){throw new Error("Unsupported")}}class E{constructor(){this.isUpdate=!1,this.graphicsCmds=new A,this._offsetsChanged=!1,this._disableGraphicsAndData=!1}isNaN(){return this.graphicsCmds.isNaN()}primitiveData(e){const t={};if(!this._disableGraphicsAndData){const i=this.graphicsCmds.primitiveData(e);null!==i&&(t.graphicsCmds=i)}return this.isUpdate&&(t.isUpdate=!0),void 0===t.graphicsCmds?void 0:t}disable(){this._disableGraphicsAndData=!0}checkForChangeAndResetChangedState(e){const t=this._offsetsChanged,i=this.graphicsCmds.isModified();this.graphicsCmds.setModified(!1),this._offsetsChanged=!1;return i||t||0!==e.length}}var k=i("ogJP");function D(e){return Boolean(e.isPosted)}class V{isIgnoredObj(e,t){return V.isIgnoredObjDefault(e,t)}static isIgnoredObjDefault(e,t){if(void 0===t)return V.isIgnoredObjNaNable(e);const i=e[t];return V.isIgnoredByGeneralRules(e,t)||V.isIgnoredObjNaNable(i)||V.isIgnoredObjListOfNaNables(i)}static isIgnoredObjNaNable(e){
|
||
return b(e)&&e.isNaN()}static isIgnoredObjListOfNaNables(e){if(!Object(k.isArray)(e))return!1;let t=!0;for(const i of e)if(!b(i)||!i.isNaN()){t=!1;break}return t}static isIgnoredObjPosted(e){return D(e)&&e.isPosted()}static isIgnoredObjErased(e){return D(e)&&e.isErased()}static isIgnoredByGeneralRules(e,t){const i=e[t];return Object(k.isArray)(i)&&0===i.length}}class B{isIgnoredObj(e,t){if(void 0===t)return V.isIgnoredObjDefault(e)||V.isIgnoredObjErased(e);const i=e[t];return V.isIgnoredObjDefault(e,t)||V.isIgnoredObjErased(i)}}class R{isIgnoredObj(e,t){if(void 0===t)return V.isIgnoredObjDefault(e)||V.isIgnoredObjErased(e)||V.isIgnoredObjPosted(e);const i=e[t];return V.isIgnoredObjDefault(e,t)||V.isIgnoredObjErased(i)||V.isIgnoredObjPosted(i)}}class N extends class extends class{constructor(e){this._dataObj=new E,this._isDirty=!1,this._eraseCmds=[],this._enableCmdDataStudy=e}init(e){this._dataObj.graphicsCmds.setCreate(e),this.update(!0)}dataObj(){return this._dataObj}setEraseCmds(e){this._eraseCmds=e}resetDirtyState(){this._isDirty=!1}disable(){this._dataObj.disable()}}{constructor(e){super(e),this._snapshotPredicate=new B,this._dataSnapShot={}}getData(){return this._dataSnapShot}getUpdate(){return this._isDirty?this._dataSnapShot:{}}update(e){(this._dataObj.checkForChangeAndResetChangedState(this._eraseCmds)||e)&&(null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.create.deleteErasedObjs(),this._dataObj.graphicsCmds.erase=[new O]),this._makeSnapshot(),this._isDirty=!0)}_makeSnapshot(){this._json=this._dataObj.primitiveData(this._snapshotPredicate),this._dataSnapShot={json:this._json}}}{constructor(e){super(e),this._updatePredicate=new R,this._sendShapshotOnly=!0,this._isFirstNotForcedUpdate=!0}update(e){(this._dataObj.checkForChangeAndResetChangedState(this._eraseCmds)||e)&&(null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.erase=[new O]),this._dataObj.isUpdate=!0,this._makeSnapshot(),null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.erase=this._eraseCmds),this._dataObj.isUpdate=!0,this._jsonUpdate=this._dataObj.primitiveData(this._updatePredicate),null!==this._dataObj.graphicsCmds.create&&this._dataObj.graphicsCmds.create.deleteErasedAndMarkPostedObjs(),this._sendShapshotOnly=e||this._isFirstNotForcedUpdate,this._isFirstNotForcedUpdate=Boolean(e),this._isDirty=!0)}getUpdate(){return this._isDirty?this._enableCmdDataStudy?{json:this._sendShapshotOnly?this._json:void 0,jsonUpdate:this._sendShapshotOnly?void 0:this._jsonUpdate}:{json:this._json,jsonUpdate:this._sendShapshotOnly?void 0:this._jsonUpdate}:{}}}class j{constructor(e){this._haveAnyVolume=!1,this._isDisabled=!1,this._seriesGetter=e}update(e,t){if(this._haveAnyVolume||this._isDisabled)return;const i=this._seriesGetter.volume().get(e);0!==i&&Number.isFinite(i)&&(this._haveAnyVolume=!0),t&&(this._haveAnyVolume||r.Std.error("The data vendor doesn't provide volume data for this symbol."),this._isDisabled=!0)}}var F=i("Y7w9");i.d(t,"VolumeProfileVisibleRange",(function(){return H})),
|
||
i.d(t,"volumeProfileVisibleRangeStudyItem",(function(){return z}));class W{constructor(){this._histPos=-1,this._hist=new Float64Array(2e3),this._times=new Float64Array(2e3)}addHist(e){if(this._histPos>=0){const t=this._times[this._histPos];Object(s.assert)(t<=e,"History order violation"),this._histPos+=t===e?0:1}else this._histPos+=1;if(this._histPos===this._hist.length){const e=new Float64Array(2*this._hist.length);e.set(this._hist),this._hist=e;const t=new Float64Array(this._hist.length);t.set(this._times),this._times=t}this._hist[this._histPos]=NaN,this._times[this._histPos]=e}removeLastIfNaN(){Number.isNaN(this.get(0))&&(this._histPos-=1)}get(e){Object(s.assert)(0===e);const t=this._histPos-e;return this._hist[t]}getLeftOrEqual(e){const t=Object(F.upperbound)(this._times,e,(e,t)=>e<t,0,this._histPos+1);return 0===t?NaN:this._hist[t-1]}set(e){this._hist[this._histPos]=e}indexOf(e){throw new Error("Not implemented")}}class H extends class{findBasicResolutionForFromTo(e,t,i,s){const o=Object(r.getVolumeProfileResolutionForPeriod)(e.value(),t,i,s),a=n.Interval.parse(o);return c.enabled("charting_library_debug_mode")&&console.log(`Selected resolution ${a.value()} for (${e.value()}, ${t}, ${i})`),a}verifyRowSizeInput(e,t){"Number Of Rows"===t&&e>6e3&&r.Std.error('Histogram is too large, please reduce "Row Size" input.')}_getRowsLayout(e,t){return"Number Of Rows"===e?new a(t):new l(t)}}{constructor(){super(...arguments),this._rowsLayout="Number Of Rows",this._rowSize=24,this._volume="Up/Down",this._firstBarTime=0,this._lastBarTime=0,this._vaVolumePercent=70,this._anInt=0,this._eraseCmds=[]}nextGraphicsObjId(){return++this._anInt}pushEraseObjCmd(e,t){this._eraseCmds.push(new L(e,t))}popEraseCmds(){const e=this._eraseCmds;return this._eraseCmds=[],e}init(e,t){this._studyDataUpdate=new N(!0),this._hists=new u,this._pocLines=new S,this._valueAreaHists=new u;const i=new M;i.getObjsContainer("hhists").push(new I("histBars2",this._hists)),i.getObjsContainer("hhists").push(new I("histBarsVA",this._valueAreaHists)),i.getObjsContainer("horizlines").push(new I("pocLines",this._pocLines)),this._studyDataUpdate.init(i),this._rowsLayout=t(0),this._rowSize=t(1),this._volume=t(2),this._firstBarTime=t(3),this._lastBarTime=t(4),this._vaVolumePercent=t(5),this.verifyRowSizeInput(this._rowSize,this._rowsLayout),this._originalResolution=n.Interval.parse(e.symbol.interval+e.symbol.resolution);const o=this._lastBarTime+this._originalResolution.inMilliseconds(this._lastBarTime);0===this._firstBarTime&&0===this._lastBarTime?this._basicResolution=this._originalResolution:this._basicResolution=this.findBasicResolutionForFromTo(this._originalResolution,this._firstBarTime,o,Object(s.ensureDefined)(e.symbol.info)),this._hasSecondarySymbol=!this._originalResolution.isEqualTo(this._basicResolution),this._hasSecondarySymbol&&e.new_sym(e.symbol.tickerid,this._basicResolution.value());const a=this._getRowsLayout(this._rowsLayout,this._rowSize);this._vbPCheckHaveVolumeExpr=new j(this),this._volumeByPriceExpr=new T(function(e){switch(e){case"Up/Down":
|
||
return 2;case"Total":return 1;default:r.Std.error("Invalid study argument value: "+e)}}(this._volume),e,this,this._firstBarTime,o,this._hists,this._pocLines,this._valueAreaHists,this._vaVolumePercent,a,6e3),this._volumeByPriceExpr.setIdsGeneratorProxy(this),this._developingPocSeries=new W,this._developingVAHighSeries=new W,this._developingVALowSeries=new W}main(e,t,i){this._hasSecondarySymbol&&e.select_sym(1),this._timeSeries=e.new_unlimited_var(),this._openSeries=e.new_unlimited_var(),this._highSeries=e.new_unlimited_var(),this._lowSeries=e.new_unlimited_var(),this._closeSeries=e.new_unlimited_var(),this._volumeSeries=e.new_unlimited_var();const n={type:"composite",data:[]};if(i&&i.period===this._basicResolution.value()&&(this._timeSeries.set(r.Std.time(e)),this._openSeries.set(r.Std.open(e)),this._highSeries.set(r.Std.high(e)),this._lowSeries.set(r.Std.low(e)),this._closeSeries.set(r.Std.close(e)),this._volumeSeries.set(r.Std.volume(e)),this._developingPocSeries.addHist(r.Std.time(e)),this._developingVAHighSeries.addHist(r.Std.time(e)),this._developingVALowSeries.addHist(r.Std.time(e)),this._vbPCheckHaveVolumeExpr.update(0,e.symbol.isLastBar),this._volumeByPriceExpr.update(0),this._developingPocSeries.removeLastIfNaN(),this._developingVAHighSeries.removeLastIfNaN(),this._developingVALowSeries.removeLastIfNaN(),e.symbol.isLastBar)){this._studyDataUpdate.setEraseCmds(this.popEraseCmds()),this._studyDataUpdate.update();const e=this._studyDataUpdate.getUpdate();e.json&&n.data.push({nonseries:!0,type:"study_graphics",data:e.json}),e.jsonUpdate&&n.data.push({nonseries:!0,type:"study_graphics",data:e.jsonUpdate})}if(this._hasSecondarySymbol&&e.select_sym(0),i&&i.period===this._originalResolution.value()){Object(s.assert)(e.symbol.time===i.time);const t=i.time,r=t+this._originalResolution.inMilliseconds(t)-1;if(t&&t>=this._firstBarTime){const e=this._developingPocSeries.getLeftOrEqual(r),t=this._developingVAHighSeries.getLeftOrEqual(r),i=this._developingVALowSeries.getLeftOrEqual(r);n.data.push([e,t,i])}else n.data.push([NaN,NaN,NaN])}return n}time(){return this._timeSeries}open(){return this._openSeries}high(){return this._highSeries}low(){return this._lowSeries}close(){return this._closeSeries}volume(){return this._volumeSeries}developingPoc(){return this._developingPocSeries}developingVAHigh(){return this._developingVAHighSeries}developingVALow(){return this._developingVALowSeries}}const z={constructor:H,name:"Volume Profile Visible Range",metainfo:{_metainfoVersion:51,id:"VbPVisible@tv-basicstudies-49",description:"Volume Profile Visible Range",shortDescription:"VPVR",format:{type:"volume"},is_price_study:!0,linkedToSeries:!0,palettes:{},inputs:[{id:"rowsLayout",name:"Rows Layout",defval:"Number Of Rows",options:["Number Of Rows","Ticks Per Row"],type:"text"},{id:"rows",name:"Row Size",defval:24,max:1e6,min:1,type:"integer"},{id:"volume",name:"Volume",defval:"Up/Down",options:["Up/Down","Total"],type:"text"},{id:"first_visible_bar_time",name:"First Visible Bar Time",defval:0,isHidden:!0,max:253370764800,
|
||
min:-253370764800,type:"time"},{id:"last_visible_bar_time",name:"Last Visible Bar Time",defval:0,isHidden:!0,max:253370764800,min:-253370764800,type:"time"},{id:"vaVolume",name:"Value Area Volume",defval:70,max:100,min:0,type:"integer"}],plots:[{id:"developingPoc",type:"line"},{id:"developingVAHigh",type:"line"},{id:"developingVALow",type:"line"}],graphics:{hhists:{histBars2:{location:h.b.Relative,title:"Volume Profile",titles:["Up Volume","Down Volume"]},histBarsVA:{location:h.b.Relative,title:"Value Area",titles:["Value Area Up","Value Area Down"]}},horizlines:{pocLines:{name:"POC",showPrice:!0}}},defaults:{graphics:{hhists:{histBars2:{colors:["#1592e6","#fbc123"],direction:h.a.RightToLeft,percentWidth:30,showValues:!1,transparencies:[76,76],valuesColor:"#424242",visible:!0},histBarsVA:{colors:["#1592e6","#fbc123"],direction:h.a.RightToLeft,percentWidth:30,showValues:!1,transparencies:[30,30],valuesColor:"#424242",visible:!0}},horizlines:{pocLines:{color:"#ff0000",style:0,visible:!0,width:2}}},inputs:{first_visible_bar_time:0,last_visible_bar_time:0,rows:24,rowsLayout:"Number Of Rows",vaVolume:70,volume:"Up/Down"},styles:{developingPoc:{color:"#ff0000",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1},developingVAHigh:{color:"#0000ff",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1},developingVALow:{color:"#0000ff",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1}}},styles:{developingPoc:{histogramBase:0,title:"Developing Poc"},developingVAHigh:{histogramBase:0,title:"Developing VA High"},developingVALow:{histogramBase:0,title:"Developing VA Low"}}}}},l4sv:function(e,t,i){"use strict";i.r(t),i.d(t,"HorizontalLineRenderer",(function(){return a}));var s=i("VdBB"),r=i("jFln"),n=i("gAom"),o=i("Zp/P");class a{constructor(){this._data=null,this._hitTest=new s.HitTestResult(s.HitTestResult.REGULAR)}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data||!1===this._data.visible)return null;const t=Object(o.interactionTolerance)().line,i=Math.abs(e.y-this._data.y)<=t+this._data.linewidth/2,s=void 0===this._data.left||this._data.left-e.x<=t,r=void 0===this._data.right||e.x-this._data.right<=t;return i&&s&&r?this._hitTest:null}draw(e,t){if(null===this._data)return;if(!1===this._data.visible)return;if(this._data.y<-this._data.linewidth/2||this._data.y>t.cssHeight+this._data.linewidth/2)return;const i=t.pixelRatio;e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&Object(r.setLineStyle)(e,this._data.linestyle);const s=void 0!==this._data.left?Math.max(this._data.left,0):0,o=void 0!==this._data.right?Math.min(this._data.right,t.cssWidth):t.cssWidth,a=Math.round(this._data.y*i),l=Math.floor(s*i),c=Math.ceil(o*i);Object(n.drawHorizontalLine)(e,a,l,c)}}},l7mP:function(e,t,i){"use strict";i.r(t),i.d(t,"getImageOfChart",(function(){return r})),i.d(t,"getImageOfChartSilently",(function(){return n}))
|
||
;const s=()=>Promise.all([i.e("react"),i.e(3),i.e(13),i.e(18),i.e(62),i.e(87),i.e(12),i.e("take-chart-image-dialog-impl")]).then(i.bind(null,"fMMV"));function r(e,t={},i){s().then(s=>{s.getImageOfChart(e,t,i)})}function n(e,t={},i){s().then(s=>{s.getImageOfChartSilently(e,t,i)})}},l7y7:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 11" width="22" height="11"><path fill="#000000" d="M5 0H0v4h5v7h4V0H5zm7 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm5 7h-5l4.5-11h4.99L17 11z"/></svg>'},lA7n:function(e,t,i){"use strict";i.r(t);var s=i("Kxc7"),r=i("ulZB");class n extends r.b{constructor(e,t){super(e,t,"FAVORITE_CHARTS_CHANGED","loadChartDialog.favorites",{})}}var o=i("zUrt"),a=i("FBuY"),l=i("Vdly"),c=i("/z0S"),h=i("sQaR");i.d(t,"LoadChartService",(function(){return u}));class u extends h.a{constructor(e=null){super(),this._favoriteChartsService=new n(a.TVXWindowEvents,l),this._chartWidgetCollection=null,this._promise=null,this._dialog=null,this._subscribe=e=>{this._setVisibility(e)},this._getChartEntry=e=>({id:e.id,url:e.url,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:()=>this._isActiveChart(e.id),openAction:()=>o.backend.loadChart(e),deleteAction:()=>new Promise(t=>{o.backend.removeChart(e.image_url,()=>{this._deleteChart(e.id),t()})}),favoriteAction:this._updateFavorites}),this._updateFavorites=e=>this._favoriteChartsService.set(e),this._isActiveChart=e=>null!==this._chartWidgetCollection&&e===this._chartWidgetCollection.metaInfo.id.value(),this._deleteChart=e=>{this._isActiveChart(e)&&(s.enabled("saveload_storage_customization")?null!==this._chartWidgetCollection&&this._chartWidgetCollection.clearChartMetaInfo():location.href="/chart/"+location.search)},this._chartWidgetCollection=e}showLoadDialog(){Object(c.a)(this._showLoadDialog.bind(this),{source:"Load chart",sourceMeta:"Chart"})}show(){this.showLoadDialog()}hide(){var e,t;null===(e=this._dialog)||void 0===e||e.hide(),null===(t=this._dialog)||void 0===t||t.visible().unsubscribe(this._subscribe)}_showLoadDialog(){(s.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise(e=>{o.backend.getCharts(t=>{e(t)})})).then(e=>e.map(this._getChartEntry)).then(e=>{const t=this._promise=Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(20),i.e(35),i.e(41),i.e(64),i.e(85),i.e(0),i.e(5),i.e(4),i.e(10),i.e(14),i.e(29),i.e(37),i.e(56),i.e("load-chart-dialog")]).then(i.bind(null,"EgWQ")).then(i=>{if(this._promise===t){this._dialog&&(this._dialog.hide(),this._dialog.visible().unsubscribe(this._subscribe));const t={charts:e,favoriteChartsService:this._favoriteChartsService,chartWidgetCollection:this._chartWidgetCollection};this._dialog=new i.LoadChartDialogRenderer(t),this._dialog.visible().subscribe(this._subscribe),this._dialog.show()}})})}}},lAUz:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aO4+"),n=i("ogJP"),o=i("Tmoa"),a=i("k9/m"),l=i("Kxc7"),c=i("Zy3/");class h{constructor(e){this._data=e}
|
||
draw(e,t){}drawBackground(e,t){e.save();const i=this._data,s=t.pixelRatio;let r=null;const n=Math.round(this._data.w*s);for(let o=0;o<i.items.length;++o){const t=i.items[o];if(null==t.color){r=null;continue}e.fillStyle=t.color;const a=Math.round(t.x*s);let l=a;if(o>0){i.items[o-1].index===t.index-1&&null!==r&&(l=r+1)}const c=a+n,h=c-l+1;e.fillRect(l,Math.round(i.y*s),h,Math.round(i.h*s)),r=c}e.restore()}hitTest(e){return null}}var u=i("23IT"),d=i("i6cO"),p=i("UAFa");i.d(t,"StudyBackgroundPaneView",(function(){return _}));class _{constructor(e,t,i,r){this._items=[],this._invalidated=!0,this._isMarkersEnabled=l.enabled("source_selection_markers"),this._study=e,this._series=t,this._model=i,this._plotName=r;const n=this._study.metaInfo().plots;for(let o=0;o<n.length;o++){const e=n[o];e.id===this._plotName&&(this._plotIndex=o,Object(s.assert)(Object(u.isBgColorerPlot)(e),"Plot '"+this._plotName+"' is not a background colorer!"))}this._colorProvider=Object(p.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),r)}items(){return this._items}update(){this._invalidated=!0}renderer(){if(!this._study.properties().styles[this._plotName].visible)return null;if(!this._study.properties().styles[this._plotName].visible.value())return null;if(!this._scalesReady())return null;this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={items:this._items,y:0,h:Object(s.ensureNotNull)(this._study.priceScale()).height(),w:this._model.timeScale().barSpacing()},t=new c.CompositeRenderer;return t.append(new h(e)),t}_scalesReady(){const e=this._model.timeScale(),t=this._study.priceScale();return e&&!e.isEmpty()&&null!==t&&!t.isEmpty()}_getTranspValue(){const e=this._study.properties().styles[this._plotName];let t=0;return e.transparency&&(t=e.transparency.value(),t=Object(n.isNumber)(t)?t:40),t}_updateImpl(){this._items=[],Object(s.assert)(this._scalesReady(),"Scales must be ready!");const e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return;const t=this._getTranspValue();let i=Object(s.ensureDefined)(this._series.nearestIndex(e.firstBar(),a.PlotRowSearchMode.NearestRight)),l=Object(s.ensureDefined)(this._series.nearestIndex(e.lastBar(),a.PlotRowSearchMode.NearestLeft));const c=this._study.offset(this._plotName);c>0?(i-=c,l+=c):(i+=c,l-=c);const h=this._study.getMinFirstBarIndexForPlot(this._plotName);if(h>l)return;i=Math.max(h,i);const u=this._study.data().rangeIterator(i,l);for(;u.hasNext();){const e=u.next();let i=e.index;const a=e.value;i+=c;const l=new r.Point(Math.floor(i)-.5,NaN);let h=Object(n.isNumber)(t)?t:50;h=Math.min(h,100),h=Math.max(h,0);const p=this._colorProvider.getPlotPointStyle(a);void 0!==p.colors[d.ColorerType.Background]&&(l.color=Object(o.generateColor)(Object(s.ensureDefined)(p.colors[d.ColorerType.Background]),h)),l.index=i,this._items.push(l)}this._model.timeScale().timedValuesToCoordinates(this._items)}}},lCO3:function(e,t,i){"use strict";i.r(t),i.d(t,"Version",(function(){return r}));var s=i("Eyy1");class r{constructor(e,t){this._major=e,this._minor=t}major(){return this._major}
|
||
minor(){return this._minor}isZero(){return 0===this._major&&0===this._minor}toString(){return this._major+"."+this._minor}compareTo(e){return this._major<e._major?-1:this._major>e._major?1:this._minor<e._minor?-1:this._minor>e._minor?1:0}isLess(e){return this.compareTo(e)<0}isLessOrEqual(e){return this.compareTo(e)<=0}isEqual(e){return 0===this.compareTo(e)}isGreater(e){return this.compareTo(e)>0}isGreaterOrEqual(e){return this.compareTo(e)>=0}static parse(e){if(e instanceof r)return new r(e.major(),e.minor());if("number"==typeof e)return Object(s.assert)(Math.floor(e)===e,"Version should not be a float number"),new r(e,0);if("string"==typeof e){const t=e.split(".");if(1===t.length){const i=parseInt(t[0],10);return Object(s.assert)(!isNaN(i),"Bad version string: "+e),new r(i,0)}if(2===t.length){const i=parseInt(t[0],10);Object(s.assert)(!isNaN(i),"Bad version string: "+e);const n=parseInt(t[1],10);return Object(s.assert)(!isNaN(n),"Bad version string: "+e),new r(i,n)}throw new Error("Bad version string (one dot expected): "+e)}throw new Error("Bad version: "+e)}}r.ZERO=new r(0,0)},lJvs:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("vAx0").ESDPaneView,n=i("fTGZ").BarsMarksContainer,o=i("mMWL"),a=i("FQhm"),l=i("ttUj").Tooltip,c=i("zDbI").CHART_FONT_FAMILY;class h extends r{constructor(e,t){super(e,t,void 0,void 0),this.source=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}_createLollipops(){var e=this.source._model.timeScale(),t=r.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),n=this;Object.keys(this.source._marks).forEach((function(r){var o=this.source._marks[r],a=o.id,c=o.index;null!==c&&(n._lollipops[a]={id:a,basePoint:new s(e.indexToCoordinate(c)+1,t),hovered:i&&i.id===a||a===n.getLastClickedLollipopId(),barY:null,label:o.label,color:o.color,items:o.tooltip,tooltip:n._lollipops.hasOwnProperty(a)?n._lollipops[a].tooltip:new l,visible:!0})}),this)}clearCaches(){this.closeTooltips(),this.clearLastClicked(),this._lollipops={}}update(){this._createLollipops(),this._invalidated=!1}renderer(){return this.update(),r.prototype.renderer.call(this)}_generateTemplateStyle(e,t,i){var s=e+t+i;if(!(s in this.stylesCache)){var r="default"!==e,n={strokeStyle:t,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:r?t:"white",fillCircle:r,strokeStyle:"#E2745B",text:{label:i,strokeStyle:r?"white":t,font:"normal 12px "+c}}};this.stylesCache[s]=n}return this.stylesCache[s]}getTemplate(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]}getStyle(e,t){return this._generateTemplateStyle(e,t.color,t.label)}createText(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach((function(e){t.addTextLine(e)}))}hasTooltip(e){return!!e.tooltip&&e.tooltip.length}}e.exports=class extends n{constructor(e){super(e),
|
||
this.toolname="UserDefinedTimescaleMarks";var t=this;o.hideMarksOnBars().subscribe(this,(function(){t._properties.visible.setValue(!o.hideMarksOnBars().value())})),this._paneView=new h(e,this),this._requestedPointsets=new Set}_initialize(e){this._properties.visible.setValue(!0)}userEditEnabled(){return!1}_plateViewData(e){return{text:e.text}}onClicked(e){a.emit("onTimescaleMarkClick",e.id)}clearMarks(){var e=this._model.chartApi();if(e.connected()){var t=this;Object.keys(this._marks).forEach((function(i){var s=t._getPointsetId(i);e.removePointset(s)}))}this._requestedPointsets.clear(),super.clearMarks(),this._paneView.clearCaches(),this.onNeedRepaint.fire()}_getData(e){var t=this._model.mainSeries().symbolInfo();if(t){var i=this.roundRange(this._rangeDifference(e)),s=this,r=this._model.mainSeries(),n=r.seriesSource().symbolInstanceId(),o=r.properties().interval.value();ChartApiInstance.getTimescaleMarks(t,i.start,i.end,(function(t){var i=s._model.chartApi();t.forEach((function(e){e.index=null;var t=e.id,r=s._getPointsetId(t),a=s._marks[t];if(a&&null!==a.index&&(a.tickmark===e.tickmark?e.index=a.index:s._requestedPointsets.has(r)&&i.connected()&&(i.removePointset(r),s._requestedPointsets.delete(r))),s._marks[t]=e,null===e.index&&i.connected()){s._requestedPointsets.add(r);var l=[[e.tickmark,0]];i.createPointset(r,"turnaround",n,o,l,(function(e){s._onPointsetData(e)}))}}),s),s._loadedRange=s._rangeUnion(e,s._loadedRange),s.onNeedRepaint.fire()}),o)}}_getPointsetId(e){return"pointsetMark_"+e}_onPointsetData(e){var t=e.params.customId.split("_")[1],i=this._marks[t],s=e.params.plots;i&&1===s.length&&(i.index=s[0].value[0])}updatePlateData(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t}hasContextMenu(){return!1}paneViews(){return this._properties.visible.value()?[this._paneView]:[]}onClickOutside(){this._paneView.onClickOutside()}}},"lNN+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolTrianglePattern",(function(){return o}));var s=i("Ocx9"),r=i("Ss5c"),n=i("j3hX");class o extends r.LineDataSource{constructor(e,t){const s=t||o.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"Jej9")).then(t=>{this._setPaneViews([new t.LineToolTrianglePatternPaneView(this,e)])})}pointsCount(){return 4}name(){return"Triangle Pattern"}properties(){return super.properties()}static createProperties(e){const t=new s.DefaultProperty("linetooltrianglepattern",e);return o._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/HOw")).then(e=>e.PatternWithBackgroundDefinitionViewModel)}static _configureProperties(e){r.LineDataSource._configureProperties(e),e.addChild("linesColors",new n.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new n.LineToolColorsProperty([e.childs().textcolor])),e.addChild("backgroundsColors",new n.LineToolColorsProperty([e.childs().backgroundColor]))}}},lReN:function(e,t,i){"use strict";i.r(t),
|
||
i.d(t,"LineToolsGroupControllerApi",(function(){return o}));var s=i("s1Gx"),r=i("Eyy1"),n=i("CW80");class o{constructor(e,t){this._controller=e,this._model=t}createGroupFromSelection(){return this._controller.createGroupFromSelection().id}removeGroup(e){const t=Object(r.ensureDefined)(this._groupById(e));this._controller.removeGroup(t)}groups(){return this._controller.groups().map(e=>e.id)}shapesInGroup(e){const t=Object(r.ensureDefined)(this._groupById(e));return Object(s.sortSources)(t.lineTools()).map(e=>e.id())}excludeShapeFromGroup(e,t){const i=Object(r.ensureDefined)(this._groupById(e)),s=Object(r.ensureNotNull)(this._model.dataSourceForId(t));Object(r.assert)(Object(n.isLineTool)(s),"Passed shapeId is not a line tool"),this._controller.excludeLineToolFromGroup(i,s)}availableZOrderOperations(e){const t=Object(r.ensureDefined)(this._groupById(e));return this._controller.availableZOrderOperations(t)}bringToFront(e){const t=Object(r.ensureDefined)(this._groupById(e));this._controller.bringToFront(t)}bringForward(e){const t=Object(r.ensureDefined)(this._groupById(e));this._controller.bringForward(t)}sendBackward(e){const t=Object(r.ensureDefined)(this._groupById(e));this._controller.sendBackward(t)}sendToBack(e){const t=Object(r.ensureDefined)(this._groupById(e));this._controller.sendToBack(t)}insertAfter(e,t){const i=Object(r.ensureDefined)(this._groupById(e)),s=Object(r.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertAfter(i,s)}insertBefore(e,t){const i=Object(r.ensureDefined)(this._groupById(e)),s=Object(r.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertBefore(i,s)}groupVisibility(e){return Object(r.ensureDefined)(this._groupById(e)).visibility()}setGroupVisibility(e,t){const i=Object(r.ensureDefined)(this._groupById(e));this._controller.setGroupVisibility(i,t)}groupLock(e){return Object(r.ensureDefined)(this._groupById(e)).locked()}setGroupLock(e,t){const i=Object(r.ensureDefined)(this._groupById(e));this._controller.setGroupLock(i,t)}getGroupName(e){return Object(r.ensureDefined)(this._groupById(e)).name()}setGroupName(e,t){const i=Object(r.ensureDefined)(this._groupById(e));this._controller.setGroupName(i,t)}canBeGroupped(e){const t=e.map(e=>Object(r.ensureNotNull)(this._model.dataSourceForId(e)));return!t.some(e=>!Object(n.isLineTool)(e))&&this._controller.canBeGroupped(t)}_groupById(e){return this._controller.groups().find(t=>t.id===e)}}},lTLF:function(e,t,i){"use strict";i.r(t);var s=i("Hr11");class r{constructor(e,t){if(this._base=e,this._integralDividers=t,Object(s.isBaseDecimal)(this._base))this._fractionalDividers=[2,2.5,2];else{this._fractionalDividers=[];for(let e=this._base;1!==e;){if(e%2==0)this._fractionalDividers.push(2),e/=2;else{if(e%5!=0)throw new Error("unexpected base");this._fractionalDividers.push(2),this._fractionalDividers.push(2.5),e/=5}if(this._fractionalDividers.length>100)throw new Error("something wrong with base")}}}tickSpan(e,t,i){const r=0===this._base?0:1/this._base
|
||
;let n=Math.pow(10,Math.max(0,Math.ceil(Object(s.log10)(e-t)))),o=0,a=this._integralDividers[0];for(;;){const e=Object(s.greaterOrEqual)(n,r,1e-14)&&n>r+1e-14,t=Object(s.greaterOrEqual)(n,i*a,1e-14),l=Object(s.greaterOrEqual)(n,1,1e-14);if(!(e&&t&&l))break;n/=a,a=this._integralDividers[++o%this._integralDividers.length]}if(n<=r+1e-14&&(n=r),n=Math.max(1,n),this._fractionalDividers.length>0&&Object(s.equal)(n,1,1e-14))for(o=0,a=this._fractionalDividers[0];Object(s.greaterOrEqual)(n,i*a,1e-14)&&n>r+1e-14;)n/=a,a=this._fractionalDividers[++o%this._fractionalDividers.length];return n}}i.d(t,"PriceTickMarkBuilder",(function(){return n}));class n{constructor(e,t,i,s){this._marks=null,this._priceScale=e,this._base=t,this._coordinateToLogicalFunc=i,this._logicalToCoordinateFunc=s}base(){return this._base}setBase(e){if(e<0)throw new Error("base < 0");this._base=e}tickSpan(e,t,i=0){if(e<t)throw new Error("high < low");const s=this._priceScale.height(),n=(e-t)*this._tickMarkHeight()/s,o=new r(this._base,[2,2.5,2]),a=new r(this._base,[2,2,2.5]),l=new r(this._base,[2.5,2,2]);let c=0;const h=o.tickSpan(e,t,n);h>i&&(c=h);const u=a.tickSpan(e,t,n);u>i&&(c=Math.min(c,u));const d=l.tickSpan(e,t,n);return d>i&&(c=Math.min(c,d)),c>0?c:e-t}rebuildTickMarks(){this._marks=null}marks(){return null===this._marks&&(this._marks=this._rebuildTickMarksImpl()),this._marks}_fontHeight(){return this._priceScale.fontSize()}_tickMarkHeight(){return Math.ceil(2.5*this._fontHeight())}_rebuildTickMarksImpl(){const e=this._priceScale,t=[],i=e.mainSource();if(e.isEmpty()||null===i)return{withoutEndingZerosIfPossible:[],full:[]};let s=i.firstValue();null===s&&(s=0);const r=e.height(),n=this._coordinateToLogicalFunc(r-1,s),o=this._coordinateToLogicalFunc(0,s),a=Math.max(n,o),l=Math.min(n,o);if(a===l)return{withoutEndingZerosIfPossible:[],full:[]};let c=this.tickSpan(a,l),h=a%c;h+=h<0?c:0;const u=a>=l?1:-1;let d=null;const p=e.formatter(),_=[];let m=!1,f=NaN;for(let g=a-h;g>l;g-=c){g===f&&(c=this.tickSpan(a,l,c)),f=g;const i=this._logicalToCoordinateFunc(g,s);if(null!==d&&Math.abs(i-d)<this._tickMarkHeight())continue;const r=p.format(g);if(t.push({coord:i,label:r}),m){const e=p.withoutEndingZeroes&&p.withoutEndingZeroes(r)||null;null!==e?_.push({coord:i,label:e}):m=!1}d=i,e.isLog()&&(c=this.tickSpan(g*u,l))}return{withoutEndingZerosIfPossible:m?_:t,full:t}}}},lUQk:function(e,t,i){"use strict";i.r(t);var s=i("7ktv"),r=i("XPit"),n=i("tc+8"),o=i.n(n),a=i("n5al"),l=i("kcTO"),c=i("wOSo"),h=i("Eyy1"),u=i("Tmoa"),d=i("LxhU"),p=i("KcY8"),_=i("Kxc7"),m=i("oXaB");function f(e){return e<10?"0"+e:e.toString()}const g=[0,1,2,3,9,8,10],v=_.enabled("force_exchange_as_title"),b={alwaysShowGlobalLast:!1,visibleOnHistoryOnly:!1,showCountdown:!0,showSymbolLabel:!0};class S extends p.a{constructor(e,t,i){super(),this._previousCountdown="",this._source=e,this._model=t,this._options=Object.assign(Object.assign({},b),i)}updateCountdown(){this._countdownText()!==this._previousCountdown&&(this.update(),this._model.updateSourcePriceScale(this._source))}_getSource(){
|
||
return this._source}_getModel(){return this._model}_isCountdownEnabled(){return this._options.showCountdown}_countdownText(){const e=d.Interval.parse(this._source.interval());if(e.isDWM()||e.isTicks()||e.isSeconds()&&1===e.multiplier())return"";const t=this._source.data().bars().last();if(null===t)return"";const i=1e3*Object(h.ensure)(t.value[0]),s=d.Interval.parse(this._source.interval()).inMilliseconds(),r=i.valueOf()+s;let n=Math.round((r-this._currentTime())/1e3);if(n<=0)return"";n=Math.min(n,s/1e3);let o=null;n>=3600&&(o=f(Math.floor(n/3600))),n%=3600;const a=f(Math.floor(n/60));n%=60;const l=f(Math.floor(n));return null!==o?`${o}:${a}:${l}`:`${a}:${l}`}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._source.properties();if(12===s.style.value())return;if(this._options.visibleOnHistoryOnly){const e=this._model.timeScale().visibleBarsStrictRange(),t=this._source.data().last();if(null===e||null===t||e.contains(t.index))return}const r=this._model.properties().scalesProperties;let n=r.showSeriesLastValue.value(),o=this._isCountdownEnabled()&&-1!==g.indexOf(s.style.value())&&s.showCountdown.value(),a=this._options.showSymbolLabel&&r.showSymbolLabels.value();const l=r.seriesLastValueMode.value()===m.PriceAxisLastValueMode.LastPriceAndPercentageValue,c=this._source.lastValueData(void 0,this._options.alwaysShowGlobalLast);if(c.noData)return;const h=8===s.style.value();if((n||o||a)&&h&&s.haStyle.showRealLastPrice.value()){const e=this._source.lastValueData(void 0,!1),t=this._source.lastValueData(void 0,!0);e.noData||t.noData||e.index!==t.index||(n=!1,o=!1,a=!1)}if(n||o){const t=this._axisFirstLineText(c,n);e.text=t,i.textColor=this.generateTextColor(i.background),e.textColor=i.textColor;const s=this._source.priceScale().isPercentage(),r=n&&l?s?c.formattedPriceAbsolute:c.formattedPricePercentage:"";e.secondLine=r,i.secondLineTextColor=i.textColor;const a=o?this._countdownText():"";this._previousCountdown=a,e.thirdLine=a,i.thirdLineTextColor=Object(u.generateColor)(i.textColor,25),0===t.length&&0===r.length&&0===a.length||(e.visible=!0)}a&&(t.text=this._paneText(a),t.visible=t.text.length>0),i.background=this._source.priceLineColor(c.color),i.coordinate=c.coordinate,i.floatCoordinate=c.floatCoordinate}_paneText(e){let t="";const i=this._source.symbolInfo();if(v)t+=i?i.exchange+" ":"";else if(e){let e=i&&Object(a.symbolCurrentContract)(i)||this._source.getSymbolName();e.length>40&&(e=e.substr(0,37)+"..."),t+=e+" "}return t.trim()}_axisFirstLineText(e,t){return t?e.text:""}_currentTime(){return Date.now()+1e3*this._source.serverTimeOffset()}}var y=i("TmNs"),w=i("k9/m");class C extends S{lastPrice(){return this._getSource().data().lastProjectionPrice}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const s=this._getModel(),r=this._getSource(),n=r.priceScale(),o=s.timeScale(),a=this.lastPrice();if(o.isEmpty()||n.isEmpty()||void 0===a)return;const l=o.visibleBarsStrictRange();if(null===l)return;const c=l.firstBar(),d=l.lastBar(),p=r.data(),_=p.search(d,w.PlotRowSearchMode.NearestLeft);if(null===_)return
|
||
;const f=r.nearestIndex(c,w.PlotRowSearchMode.NearestRight);if(void 0===f)return;const g=r.model().properties().scalesProperties,v=Object(h.ensureNotNull)(p.valueAt(f))[TradingView.CLOSE_PLOT];let b=i.background,S=g.showSeriesLastValue.value(),y=!1,C=!1,P=!1;const x=r.lastValueData(TradingView.CLOSE_PLOT,!1),T=r.properties();if(8===T.style.value()&&T.haStyle.showRealLastPrice.value()){const e=r.lastValueData(TradingView.CLOSE_PLOT,!0);if(e.noData||e.color===i.background||(b=e.color),!e.noData&&!x.noData){const t=e.index===x.index;y=t&&g.showSymbolLabels.value(),C=g.seriesLastValueMode.value()===m.PriceAxisLastValueMode.LastPriceAndPercentageValue,S=S&&t,P=t&&this._isCountdownEnabled()&&T.showCountdown.value()}}else{b=r.barColorer().barStyle(_.index,!0).barColor}if(i.background=b,i.textColor=this.generateTextColor(b),i.secondLineTextColor=i.textColor,i.thirdLineTextColor=Object(u.generateColor)(i.textColor,25),i.coordinate=n.priceToCoordinate(a,v),e.visible=S||P,!x.noData){x.text=n.formatPrice(a,v),x.formattedPriceAbsolute=n.formatPriceAbsolute(a),x.formattedPricePercentage=n.formatPricePercentage(a,v),e.text=this._axisFirstLineText(x,S);const i=r.priceScale().isPercentage();e.secondLine=S&&C?i?x.formattedPriceAbsolute:x.formattedPricePercentage:"",e.thirdLine=P?this._countdownText():"",t.text=this._paneText(y)}t.visible=y}}var P=i("KtbP"),x=i("YFKU"),T=i("2ijp"),M=i("HGP3"),I=i("8Uy/");const L={light:{lineStyle:I.LINESTYLE_DOTTED,lineWidth:1,textColor:M.a["color-cold-gray-900"],backgroundColor:M.a["color-tv-blue-50"],lineColor:M.a["color-cold-gray-500"]},dark:{lineStyle:I.LINESTYLE_DOTTED,lineWidth:1,textColor:M.a["color-white"],backgroundColor:M.a["color-tv-blue-a800"],lineColor:M.a["color-cold-gray-500"]}};function O(e){return e?L.dark:L.light}class A extends T.a{constructor(e,t,i){super(),this._model=e,this._isVisible=t,this._getValue=i}_updateImpl(){const e=this._lineRendererData;if(e.visible=!1,!this._isVisible.value())return;const t=this._model.mainSeries(),i=t.priceScale(),s=t.firstValue(),r=this._getValue();if(null===s||null===r)return;const n=O(this._model.isDark());e.visible=!0,e.y=i.priceToCoordinate(r,s),e.linestyle=n.lineStyle,e.linewidth=n.lineWidth,e.color=n.lineColor}}class E extends p.a{constructor(e,t,i,s){super(),this._model=e,this._label=t,this._isVisible=i,this._getValue=s}_updateRendererData(e,t,i){if(e.visible=!1,t.visible=!1,!this._isVisible.value())return;const s=this._model.mainSeries(),r=s.priceScale(),n=s.firstValue(),o=this._getValue();if(null===n||null===o)return;const a=O(this._model.isDark());e.visible=!0,t.visible=!0,e.text=r.formatPriceAbsolute(o),t.text=this._label,i.coordinate=r.priceToCoordinate(o,n),i.background=a.backgroundColor,i.textColor=a.textColor}}class k extends y.PriceLineAxisView{constructor(e,t,i){super(),this._model=e,this._isLineVisible=t,this._getValue=i}_isVisible(){return this._isLineVisible.value()}_lineWidth(){return O(this._model.isDark()).lineWidth}_lineStyle(){return O(this._model.isDark()).lineStyle}_priceLineColor(e){return O(this._model.isDark()).lineColor
|
||
}_value(){const e=this._model.mainSeries(),t=e.priceScale(),i=e.firstValue(),s=this._getValue();if(null===i||null===s)return{noData:!0};const r=t.priceToCoordinate(s,i);return{noData:!1,floatCoordinate:r,coordinate:r,color:"",formattedPricePercentage:"",formattedPriceAbsolute:"",text:"",index:0}}}const D=Object(x.t)("High"),V=Object(x.t)("Low"),B=Object(x.t)("Avg");function R(e,t,i,s,r,n){const o=new A(e,r,n),a=new E(e,i,s,n);return{paneView:o,panePriceAxisView:new P.PanePriceAxisView(a,t,e),priceAxisView:a,priceLineAxisView:new k(e,r,n)}}var N=i("C2K+"),j=i("WPIy"),F=i("aIyQ"),W=i.n(F),H=i("ogJP"),z=i("xDuj");i.d(t,"SeriesBase",(function(){return q}));const U=_.enabled("price_scale_always_last_bar_value"),G={countdownEnabled:!0};class q extends s.PriceDataSource{constructor(e,t,i){super(e),this.extendedHours=new o.a,this.requestingIntradayWhenNotSupported=new W.a,this.requestingResolutionWhenNotSupported=new W.a,this._paneView=null,this._priceStep=null,this._symbolInfo=null,this._isPrePostMarketPricesForbiddenProperty=new o.a(!0),this._highLowAvgPriceCache=new Map,this._prevClosePriceAxisView=null,this._priceScaleChanged=new W.a,this._priceScaleAboutToBeChanged=new W.a,this._currency=null,this._unit=null,this._base=100,this._pointValue=1,this._formatter=new l.PriceFormatter(this._base),this._ignoreMinMoveFormatter=new l.PriceFormatter(this._base),this._ignoreMinMovePriceStep=null,this._lastBarCloseTime=null,this._quotesProvider=new c.a,this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate),this._setProperties(t),this._options=Object(H.merge)(Object(H.clone)(G),i);const s=new S(this,e,{alwaysShowGlobalLast:!0,showCountdown:i.countdownEnabled});this._priceAxisView=s;let r=null;U||(r=new S(this,e,{visibleOnHistoryOnly:!0,showSymbolLabel:!1,showCountdown:!1,alwaysShowGlobalLast:!1})),this._priceLinePriceAxisView=new y.SeriesPriceLineAxisView(this),this._priceLineAxisViews=[this._priceLinePriceAxisView];const n=new C(this,e,{showCountdown:i.countdownEnabled});this._priceAxisViews=[s,n],null!==r&&this._priceAxisViews.push(r),this._panePriceAxisView=new P.PanePriceAxisView(s,this,e),this._historyPricePanePriceAxisView=null!==r?new P.PanePriceAxisView(r,this,e):null,this._projectionPriceAxisView=new P.PanePriceAxisView(n,this,e),this._labelPaneViews=[this._panePriceAxisView,this._projectionPriceAxisView],null!==this._historyPricePanePriceAxisView&&this._labelPaneViews.push(this._historyPricePanePriceAxisView),this._highLowAvgPaneViews=[],this._createHighLowAvgViews()}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._model.timeScale().visibleBarsStrictRangeChanged().unsubscribeAll(this)}quotesProvider(){return this._quotesProvider}labelPaneViews(){return this._labelPaneViews}clearHighLowAvgPriceCache(){this._highLowAvgPriceCache.clear()}priceScaleChanged(){return this._priceScaleChanged}priceScaleAboutToBeChanged(){return this._priceScaleAboutToBeChanged}symbolInfo(){return this._symbolInfo}symbolResolved(){return this.dataEvents().symbolResolved()}formatter(e=!0){
|
||
return e?this._formatter:this._ignoreMinMoveFormatter}priceStep(e=!0){return e?this._priceStep:this._ignoreMinMovePriceStep}prevClose(){if(this.priceScale().isEmpty()||this.data().isEmpty())return null;const e=this.quotes(),t=this.firstValue();if(null===e||null===t)return null;const i=e.prev_close_price;return void 0===i?null:{coordinate:this.priceScale().priceToCoordinate(i,t),floatCoordinate:this.priceScale().priceToCoordinate(i,t),text:this.priceScale().formatPrice(i,t)}}hasClosePrice(){return 12!==this.properties().style.value()}nearestValue(e,t,i){const s=this.nearestData(e,i);return s?s.value[t]:void 0}autoScaleInfo(e,t){const i=this.priceRange(e,t);if(null===this._paneView)return{range:i};const s=this._paneView;return{range:i,topPixelMargin:s.topPixelMargin?s.topPixelMargin():void 0,bottomPixelMargin:s.bottomPixelMargin?s.bottomPixelMargin():void 0}}isPrePostMarketPricesForbiddenProperty(){return this._isPrePostMarketPricesForbiddenProperty}quotes(){return this.data().isEmpty()?null:this._quotesProvider.quotes()}base(){return this._base}pointValue(){return this._pointValue}barCloseTime(){return this._lastBarCloseTime}setSymbol(e){return this.properties().symbol.setValue(e)}currency(){return this.properties().currencyId.value()||null}setCurrency(e){this.properties().currencyId.setValue(e)}isConvertedToOtherCurrency(){return Object(a.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().unitId.value()||null}setUnit(e){this.properties().unitId.setValue(e)}isConvertedToOtherUnit(){return Object(a.isConvertedToOtherUnit)(this.symbolInfo())}symbolSource(){return this}title(){return this.symbolTitle()}symbolTitle(e,t){let i=this.properties().symbol.value();const s=this.symbolInfo();return null!==s&&(i=Object(a.symbolTitle)(s,e)),t?i:`${i}, ${Object(z.translatedIntervalString)(this.properties().interval.value())}`}valuesProvider(){return new N.a(this,this.model())}statusProvider(e){return new j.a(this,this._model.properties().scalesProperties.textColor,this.properties().statusViewStyle,e)}open(e){const t=this.data().valueAt(e);return t&&t[1]}high(e){const t=this.data().valueAt(e);return t&&t[2]}low(e){const t=this.data().valueAt(e);return t&&t[3]}close(e){const t=this.data().valueAt(e);return t&&t[4]}moveItem(e,t,i){if(10===this.style()&&0===t){const t=this.priceScale(),i=this.properties().baselineStyle,s=t.height(),r=100-e.y/s*100,n=r<0?0:Math.round(10*r)/10;i.baseLevelPercentage.setValue(Math.max(Math.min(n,100),0))}}_isExtendedHoursAllowed(){return Boolean(this._symbolInfo&&this._symbolInfo.has_extended_hours)}_recreateFormatter(){this._formatter=Object(a.createSeriesFormatter)(this.symbolInfo(),this.properties().minTick.value()),this._ignoreMinMoveFormatter=Object(a.createSeriesFormatter)(this.symbolInfo(),this.properties().minTick.value(),!0),this.priceScale()&&this.priceScale().updateFormatter(),this._formatterChanged.fire()}_recreatePriceStep(){const{minMove:e,priceScale:t}=Object(a.getSeriesPriceFormattingState)(this.symbolInfo()),i=e/t;this._ignoreMinMovePriceStep=1/t,
|
||
this._priceStep!==i&&(this._priceStep=i,this._priceStepChanged.fire())}_recreatePriceFormattingDependencies(){this._recreateFormatter(),this._recreatePriceStep()}_updateIsPrePostMarketPricesForbiddenProperty(){const e=!this.isDWM()&&this.extendedHours.value()||!this._isExtendedHoursAllowed();this._isPrePostMarketPricesForbiddenProperty.setValue(e)}_changeCurrency(){this.setSymbolIntervalCurrencyDelayed(),this.model().checkLineToolSelection(),this._currencyChanged.fire()}_changeUnit(){this.setSymbolIntervalCurrencyDelayed(),this.model().checkLineToolSelection(),this._unitChanged.fire()}_checkCurrencyWillChanged(e){return this._currency!==e}_checkUnitWillChanged(e){return this._unit!==e}_createHighLowAvgViews(){const e=this.properties().highLowAvgPrice,t=this._getHighLowAvgPrice.bind(this),i=function(e,t,i,s){const r=i.childs(),n=R(e,t,D,r.highLowPriceLabelsVisible,r.highLowPriceLinesVisible,()=>s(0)),o=R(e,t,V,r.highLowPriceLabelsVisible,r.highLowPriceLinesVisible,()=>s(1)),a=R(e,t,B,r.averageClosePriceLabelVisible,r.averageClosePriceLineVisible,()=>s(2));return{paneViews:[n.paneView,o.paneView,a.paneView],panePriceAxisViews:[n.panePriceAxisView,o.panePriceAxisView,a.panePriceAxisView],priceAxisViews:[n.priceAxisView,o.priceAxisView,a.priceAxisView],priceLineAxisViews:[n.priceLineAxisView,o.priceLineAxisView,a.priceLineAxisView]}}(this._model,this,e,t);this._highLowAvgPaneViews.push(...i.paneViews),this._labelPaneViews.push(...i.panePriceAxisViews),this._priceAxisViews.push(...i.priceAxisViews),this._priceLineAxisViews.push(...i.priceLineAxisViews)}_getHighLowAvgPrice(e){if(!this._highLowAvgPriceCache.has(e)){const t=this._model.timeScale().visibleBarsStrictRange();if(null===t)return null;const i=this._model.mainSeries().bars(),s=t.firstBar(),n=t.lastBar();if(2===e){const e=function(e,t,i){const s=Object(r.barFunction)("close");let n=0,o=0;for(let r=t;r<=i;r++){const t=e.valueAt(r);null!==t&&(n+=s(t),o++)}return o?n/o:null}(i,s,n);if(null===e)return null;this._highLowAvgPriceCache.set(2,e)}else{const e=function(e,t,i){return e.minMaxOnRangeCached(t,i,[{name:"low",offset:0},{name:"high",offset:0}])}(i,s,n);if(null===e)return null;this._highLowAvgPriceCache.set(1,e.min),this._highLowAvgPriceCache.set(0,e.max)}}return this._highLowAvgPriceCache.get(e)}}},"lW/c":function(e,t,i){"use strict";i.r(t);i("YFKU");var s=i("hY0g"),r=i.n(s),n=i("HySD");class o{constructor(e){this._document=e,this.isFullscreen=new r.a;const t=()=>{const e=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(let t=0;t<e.length;t++){const i=e[t];if(i in this._document){this.isFullscreen.setValue(!!this._document[i]);break}}};t();for(const i of["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"])e.addEventListener(i,t,!1)}enter(){const e=this._document.documentElement;for(const t of["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"])if("function"==typeof e[t]){e[t]();break}this.isFullscreen.setValue(!0)}
|
||
exit(){const e=this._document;for(const t of["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"])if("function"==typeof e[t]){e[t]();break}this.isFullscreen.setValue(!1)}}class a{constructor(e){let t;this.isVisible=new r.a(!0);let i=null;for(const s of["","moz","ms","webkit"]){const r=s?s+"Hidden":"hidden";if(r in e){t=s+"visibilitychange",i=()=>{this.isVisible.setValue(!e[r])},i(),e.addEventListener(t,i,!1);break}}this.destroy=()=>{i&&(e.removeEventListener(t,i,!1),i=null)}}}var l=i("mNbo"),c=i("Eyy1"),h=i("qFKp");i.d(t,"Root",(function(){return u}));class u{constructor(e){this._updateDocumentHeight=e=>{"visual"===this._viewportType&&this._window.document.documentElement.style.setProperty("height",e+"px","important")},this._window=e,this._fullscreenApi=new o(e.document),this._viewportType=h.isChrome||Object(l.a)("any")||!this._window.visualViewport?"quirks":"visual","visual"===this._viewportType?this._viewport=Object(c.ensureDefined)(this._window.visualViewport):this._viewport=this._window;const t=this._layoutSizeSensor=this._window.document.createElement("div");t.id="layout-size-sensor",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.pointerEvents="none",t.style.visibility="hidden",this._initFullscreen()}allocate(){this.free();const e=this._window.document,t=e.createElement("div");t.classList.add("js-rootresizer__contents"),t.style.position="relative",t.style.width="100%",t.style.height="100%",e.body.insertAdjacentElement("afterbegin",t),e.body.insertAdjacentElement("afterbegin",this._layoutSizeSensor),this._visibilityApi=new a(this._window.document);const i={alive:new r.a(!0),fullscreenable:new r.a(!0),container:new r.a(t),width:new r.a,height:new r.a,availWidth:new r.a,availHeight:new r.a,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:()=>{i.alive.setValue(!1)},attach:()=>{i.alive.setValue(!1),this._window.close()},requestFullscreen:()=>{this._requestFullscreen()},exitFullscreen:()=>{this._exitFullscreen()}};return i.alive.subscribe(e=>{e||i!==this._area||this.free()}),this._area=i,this._resizeHandler=()=>{const e=this._width(i)||800,t=this._height(i)||600;i.availHeight.setValue(t),i.availWidth.setValue(e),i.height.setValue(t),i.width.setValue(e)},this._area.height.subscribe(this._updateDocumentHeight,{callWithLast:!0}),this._resizeHandler(),this._viewport.addEventListener("resize",this._resizeHandler),new n.ResizerDetacherState(i).bridge()}free(){if(this._resizeHandler&&(this._viewport.removeEventListener("resize",this._resizeHandler),this._resizeHandler=void 0),this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=void 0),this._area){const e=this._area;this._area=void 0,e.height.unsubscribe(this._updateDocumentHeight),e.alive.setValue(!1);const t=e.container.value(),i=null==t?void 0:t.parentElement;i&&(i.removeChild(t),i.removeChild(this._layoutSizeSensor))}}_height(e){if("visual"===this._viewportType)return this._layoutSizeSensor.clientHeight
|
||
;return e.container.value().clientHeight}_width(e){return e.container.value().clientWidth}_requestFullscreen(){this._fullscreenApi.enter()}_exitFullscreen(){this._fullscreenApi.exit()}_initFullscreen(){this._fullscreenApi.isFullscreen.subscribe(e=>{this._resizeHandler&&this._resizeHandler()})}}},ltKl:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesApi",(function(){return l}));var s=i("Eyy1"),r=i("jRfx"),n=i("HGup"),o=i("/ToI"),a=i("GD+X");class l{constructor(e,t){this._series=e,this._undoModel=t,this._model=t.model()}isUserEditEnabled(){return this._series.userEditEnabled()}setUserEditEnabled(e){this._series.setUserEditEnabled(e)}mergeUp(){this._model.isMergeUpAvailableForSource(this._series)&&new r.c(this._model,this._series,"").redo()}mergeDown(){this._model.isMergeDownAvailableForSource(this._series)&&new r.a(this._model,this._series,"").redo()}unmergeUp(){this._model.isUnmergeAvailableForSource(this._series)&&new n.c(this._model,this._series,"").redo()}unmergeDown(){this._model.isUnmergeAvailableForSource(this._series)&&new n.a(this._model,this._series,"").redo()}detachToRight(){new o.b(this._model,this._series,this._pane(),"right","").redo()}detachToLeft(){new o.b(this._model,this._series,this._pane(),"left","").redo()}detachNoScale(){new o.b(this._model,this._series,this._pane(),"overlay","").redo()}changePriceScale(e){const t=Object(s.ensureNotNull)(this._model.paneForSource(this._series));switch(e){case"new-left":new o.b(this._model,this._series,t,"left","").redo();break;case"new-right":new o.b(this._model,this._series,t,"right","").redo();break;case"no-scale":Object(s.assert)(t.actionNoScaleIsEnabled(this._series),"Unable to leave a pane without any non-overlay price scale"),new o.b(this._model,this._series,t,"overlay","").redo();break;default:const i=this._model.dataSourceForId(e);if(null===i)throw new Error(`There is no study with entityId='${e}'`);const r=this._model.paneForSource(i)===t;Object(s.assert)(r,"Study should be on the main pane");const n=Object(s.ensureNotNull)(i.priceScale());new o.a(this._model,this._series,t,n,"").redo()}}isVisible(){return this._series.properties().visible.value()}setVisible(e){this._series.properties().visible.setValue(e)}bringToFront(){this._model.bringToFront([this._series])}sendToBack(){this._model.sendToBack([this._series])}entityId(){return this._series.id()}chartStyleProperties(e){return this._series.properties().child(c(e)).state(["inputs","inputsInfo"])}setChartStyleProperties(e,t){this._series.properties().child(c(e)).mergeAndFire(t)}barsCount(){return this._series.bars().size()}isLoading(){return this._series.isLoading()}data(){return this._series.data()}priceScale(){return new a.a(this._undoModel,this._series.priceScale())}_pane(){return Object(s.ensureNotNull)(this._model.paneForSource(this._series))}}function c(e){switch(e){case 0:return"barStyle";case 1:return"candleStyle";case 2:return"lineStyle";case 3:return"areaStyle";case 4:return"renkoStyle";case 5:return"kagiStyle";case 6:return"pnfStyle";case 7:return"pbStyle";case 8:return"haStyle";case 9:
|
||
return"hollowCandleStyle";case 10:return"baselineStyle";case 11:return"rangeStyle";case 12:return"hiloStyle";default:Object(s.ensureNever)(e)}throw new Error("unsupported chart style: "+e)}},lxNp:function(e,t,i){"use strict";i.r(t);var s=i("/3z9"),r=i("d700"),n=i("hY0g"),o=i.n(n);var a=i("JWMC");class l{constructor(e,t){this._group=e,this.hotkey=t.hotkey,this.handler=t.handler,this.desc=t.desc,this.element=t.element||null,t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=()=>!0:this.isDisabled=()=>!1}destroy(){this._group&&(this._group.remove(this),this._group=null)}}class c{constructor(e,t){this._actions=[],this._manager=e,this.modal=!(!t||!t.modal),t&&(this.desc=t.desc),t&&t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=()=>!0:this.isDisabled=()=>!1,this._manager.registerGroup(this)}add(e){const t=new l(this,e);return this._actions.push(t),t}remove(e){for(let t=this._actions.length;t-- >0;)this._actions[t]===e&&this._actions.splice(t,1)}handleHotkey(e,t){for(let i=this._actions.length;i-- >0;){const r=this._actions[i];if(r.hotkey===e&&((!r.element||t.target&&r.element.contains(t.target))&&!r.isDisabled()))return r.handler(t),t.preventDefault(),Object(a.trackEvent)("Keyboard Shortcuts",Object(s.humanReadableHash)(e)),!0}return!1}promote(){this._manager.promoteGroup(this)}destroy(){this._actions.length=0,this._manager.unregisterGroup(this)}}i.d(t,"pressedKeys",(function(){return u})),i.d(t,"createGroup",(function(){return d})),i.d(t,"registerWindow",(function(){return p})),i.d(t,"unregisterWindow",(function(){return _})),i.d(t,"Modifiers",(function(){return s.Modifiers}));const h=new class{constructor(){this._groups=[],this._pressedKeys=new o.a(0),this._keyDownListener=e=>{if(e.defaultPrevented)return;const t=Object(s.hashFromEvent)(e);if(this._pressedKeys.setValue(t),!Object(r.a)(t,e.target))for(let i=this._groups.length;i-- >0;){const s=this._groups[i];if(!s.isDisabled()){if(s.handleHotkey(t,e))return;if(s.modal)return}}},this._keyUpListener=e=>{const t=Object(s.hashFromEvent)(e);this._pressedKeys.setValue(t)},this._blurEvent=()=>{this._pressedKeys.setValue(0)},this._mouseEvent=e=>{const t=Object(s.modifiersFromEvent)(e),i=255&this._pressedKeys.value();this._pressedKeys.setValue(t|i)}}listen(e){e.addEventListener("keydown",this._keyDownListener),e.addEventListener("keyup",this._keyUpListener),e.addEventListener("blur",this._blurEvent),e.addEventListener("mousemove",this._mouseEvent)}unlisten(e){e.removeEventListener("keydown",this._keyDownListener),e.removeEventListener("keyup",this._keyUpListener),e.removeEventListener("blur",this._blurEvent),e.removeEventListener("mousemove",this._mouseEvent)}registerGroup(e){this._groups.push(e)}unregisterGroup(e){for(let t=this._groups.length;t--;)this._groups[t]===e&&this._groups.splice(t,1)}promoteGroup(e){let t=this._groups.length-1;for(let i=this._groups.length;i--;){if(this._groups[i]===e)return void(i!==t&&(this._groups.splice(i,1),this._groups.splice(t,0,e)));this._groups[i].modal&&(t=i-1)}
|
||
}pressedKeys(){return this._pressedKeys}},u=h.pressedKeys();function d(e){return new c(h,e)}function p(e){h.listen(e)}function _(e){h.unlisten(e)}p(window)},"m/3z":function(e,t,i){"use strict";i.d(t,"c",(function(){return u})),i.d(t,"b",(function(){return d})),i.d(t,"a",(function(){return p}));var s=i("lxNp"),r=i("/3z9"),n=i("d700"),o=i("hY0g"),a=i.n(o);const l=new a.a(Boolean(s.pressedKeys.value()&r.Modifiers.Shift)),c=new a.a(Boolean(s.pressedKeys.value()&r.Modifiers.Mod)),h=new a.a(Boolean(s.pressedKeys.value()&r.Modifiers.Alt));function u(){return l}function d(){return c}s.pressedKeys.subscribe(e=>{l.setValue(Boolean(e&r.Modifiers.Shift)),c.setValue(Boolean(e&r.Modifiers.Mod)),h.setValue(Boolean(e&r.Modifiers.Alt))});class p{constructor(e,t){this._pressedKeyCode=null,this._boundKeydownHandler=null,this._boundKeyupHandler=null,this._chartWidget=e,this._parent=t,this._boundKeydownHandler=this._keydownHandler.bind(this),this._boundKeyupHandler=this._keyupHandler.bind(this),this._parent.ownerDocument.addEventListener("keydown",this._boundKeydownHandler),this._parent.ownerDocument.addEventListener("keyup",this._boundKeyupHandler)}destroy(){null!==this._boundKeydownHandler&&(this._parent.ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),null!==this._boundKeyupHandler&&(this._parent.ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),this._boundKeyupHandler=null)}_keydownHandler(e){window.document.activeElement===window.document.body&&this._chartWidget.isActive()&&(this._handleMoveDrawingsKeyDown(e)||this._handleScrollKeyDown(e))&&e.preventDefault()}_keyupHandler(e){this._handleScrollKeyUp(e)}_handleMoveDrawingsKeyDown(e){const t=255&Object(r.hashFromEvent)(e),i=this._chartWidget.model();switch(t){case 37:return i.moveSelectedToolsLeft();case 39:return i.moveSelectedToolsRight();case 38:return i.moveSelectedToolsUp();case 40:return i.moveSelectedToolsDown()}return!1}_handleScrollKeyDown(e){if(null!==this._pressedKeyCode)return!1;const t=Object(r.hashFromEvent)(e),i=255&t,s=Object(r.modifiersFromEvent)(e);let o;if(37===i)o=1;else{if(39!==i)return!1;o=-1}return!(r.isMacKeyboard&&s===r.Modifiers.Mod||s!==r.Modifiers.Mod&&s!==r.Modifiers.Alt&&s!==r.Modifiers.None)&&(!Object(n.a)(t,e.target)&&(this._pressedKeyCode=i,s===r.Modifiers.None?this._chartWidget.scrollHelper().moveByBar(o):this._chartWidget.scrollHelper().move(o),!0))}_handleScrollKeyUp(e){if(null===this._pressedKeyCode)return!1;const t=Object(r.hashFromEvent)(e);if(Object(n.a)(t,e.target))return!1;return(255&t)===this._pressedKeyCode&&(this._pressedKeyCode=null,this._chartWidget.scrollHelper().stopMove(),!0)}}},"m/cY":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("tc+8"),r=i.n(s);function n(e){return new r.a(e)}},mE5r:function(e,t,i){"use strict";var s=i("Eyy1"),r=i("ikwP"),n=i("gAom"),o=i("H0vP"),a=i("aO4+"),l=i("XlJ7"),c=i("EsvI"),h=i("OsWk"),u=i("rL76"),d=i("zDbI");const p=parseInt(u.labelheight),_=parseInt(u.bottommargin);function m(e){return e/11}class f{constructor(){
|
||
this._wrapper=document.createElement("div"),this._element=document.createElement("div"),this._labelElement=document.createElement("div"),this._gearElement=document.createElement("div"),this._currentScale=1,this._info=null,this._mode="auto",this._wrapper.appendChild(this._element),this._wrapper.classList.add(u.wrapper),this._element.classList.add(u.label),this._labelElement.className=u.symbol,this._element.appendChild(this._labelElement),this._gearElement.className=u.gear,this._gearElement.innerHTML=h,this._element.appendChild(this._gearElement)}getElement(){return this._wrapper}setMode(e){this._mode!==e&&(this._mode=e)}align(e,t){const i=m(t);Math.abs(i-this._currentScale)>.1&&(this._currentScale=i,Math.abs(this._currentScale-1)>.1?this._element.style.transform=`scale(${this._currentScale})`:(this._currentScale=1,this._element.style.transform=""))}drawLabelForScreenshot(e,t){if(null===this._info||"gear"===this._mode)return;const i=Object(l.makeFont)(t.fontSize,d.CHART_FONT_FAMILY);e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-back"),e.globalAlpha=.5,e.beginPath();const s=m(t.fontSize)*p/2,r=Object(a.point)(t.offset+t.width/2,t.height/2);e.arc(r.x,r.y,s,0,2*Math.PI,!0),e.fill(),e.globalAlpha=1,e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-text"),e.textAlign="center",e.font=i,e.textBaseline="middle",e.fillText(this._info.label,r.x,r.y)}setAxisNameInfo(e){this._info=e,null!==e&&(this._labelElement.textContent=e.label)}static height(e){return(p+_)*e}}var g=i("aIyQ"),v=i.n(g),b=i("S8xo"),S=i("5VQP"),y=i("CPmC");const w={enableTooltip:!0,showLabels:!0,enableMenu:!0,enableHighlight:!0};class C{constructor(e,t,i,s,n){this._invalidated=!0,this._size=new r.Size(0,0),this._offset=0,this._axisInfo=null,this._onLabelHovered=new v.a,this._highlighted=!1,this._labelMode="auto",this._fixedLabelMode=null,this._canvasConfiguredHandler=()=>this.update(),this._isLeft="left"===e,this._rendererOptionsProvider=s.rendererOptionsProvider,this._sourcesTitlesProvider=s.sourcesTitlesProvider,this._contextMenuItemsProvider=s.contextMenuItemsProvider,this._backgroundBasedTheme=s.backgroundBasedTheme,this._getBackgroundTopColor=s.getBackgroundTopColor,this._getBackgroundBottomColor=s.getBackgroundBottomColor,this._showHorizontalBorder=Boolean(s.showHorizontalBorder),this._properties=t,this._axisInfo=i,this._labelOptions=Object.assign(Object.assign({},w),n),this._properties.lineColor.subscribe(this,this._onPropertyChanged),this._cell=document.createElement("div"),this._cell.classList.add(u["price-axis-stub"]),this._labelOptions.enableTooltip&&this._cell.classList.add("apply-common-tooltip"),this._cell.style.width="25px",this._cell.style.height="100%",this._cell.style.position="absolute",this._cell.style.left="0",this._cell.style.overflow="hidden",this._labelOptions.showLabels?(this._label=new f,this._label.setAxisNameInfo(this._axisInfo),this._cell.appendChild(this._label.getElement()),this._labelOptions.enableTooltip&&Object(y.b)(this._cell,"text",e=>this._tooltipContent())):this._label=null,
|
||
this._mouseEventHandler=new b.MouseEventHandler(this._cell,this,{treatHorzTouchDragAsPageScroll:!0,treatVertTouchDragAsPageScroll:!0}),this._canvasBinding=Object(r.createBoundCanvas)(this._cell,new r.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);const o=this._canvasBinding.canvas;o.style.position="absolute",o.style.left="0",o.style.top="0"}destroy(){this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),this._properties.lineColor.unsubscribe(this,this._onPropertyChanged),this._mouseEventHandler.destroy(),$(this._cell).remove()}mouseEnterEvent(e){this._mouseOrTouchEnterEvent(e)}touchStartEvent(e){this._mouseOrTouchEnterEvent(e)}mouseLeaveEvent(e){this._mouseOrTouchLeaveEvent(e)}touchEndEvent(e){this._mouseOrTouchLeaveEvent(e)}mouseClickEvent(e){this._mouseClickOrTapEvent(e)}tapEvent(e){this._mouseClickOrTapEvent(e)}update(){this._invalidated=!0}getElement(){return this._cell}onLabelHovered(){return this._onLabelHovered}setSizeAndOffset(e,t){if(e.w<0||e.h<0)throw new Error("Try to set invalid size to PriceAxisStub "+JSON.stringify(e));this._size.equals(e)||(this._size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._cell.style.width=e.w+"px",this._cell.style.minWidth=e.w+"px",this._cell.style.height=e.h+"px",this._invalidated=!0),this._offset!==t&&(this._offset=t,this._cell.style.left=t+"px")}paint(e){if(e<o.InvalidationLevel.Full&&!this._invalidated)return;if(0===this._size.w||0===this._size.h)return;this._invalidated=!1;const t=Object(r.getContext2D)(this._canvasBinding.canvas);this._drawBackground(t,this._canvasBinding.pixelRatio),this._drawVerticalBorder(t,this._canvasBinding.pixelRatio),this._showHorizontalBorder&&this._drawHorizontalBorder(t,this._canvasBinding.pixelRatio)}hardResetCanvas(){Object(r.hardResizeCanvas)(this._canvasBinding,this._size)}getWidth(){return this._size.w}getImage(){const e=Object(r.createDisconnectedCanvas)(document,this._size),t=Object(r.getPrescaledContext2D)(e),i=this._getBackgroundTopColor(),s=this._getBackgroundBottomColor();return i===s?Object(r.clearRect)(t,0,0,this._size.w,this._size.h,i):Object(n.clearRectWithGradient)(t,0,0,this._size.w,this._size.h,i,s),t.drawImage(this._canvasBinding.canvas,0,0,this._size.w,this._size.h),null!==this._label&&this._label.drawLabelForScreenshot(t,{offset:0,width:this._size.w,height:this._size.h,fontSize:this._properties.fontSize.value(),theme:this._backgroundBasedTheme.value()}),e}setLabelMode(e){e!==this._labelMode&&(this._labelMode=e,null!==this._label&&this._label.setMode(e),this._cell.classList.toggle(u["fixed-gear"],"gear"===e),this._cell.classList.toggle(u["fixed-symbol"],"symbol"===e),this._cell.classList.toggle("apply-common-tooltip","symbol"!==e&&this._labelOptions.enableTooltip))}_setHighlighted(e){this._labelOptions.enableHighlight&&(this._onLabelHovered.fire("stubButton",e),this._highlighted!==e&&(this._highlighted=e,this._invalidated=!0))}_onPropertyChanged(){this._invalidated=!0}_drawVerticalBorder(e,t){
|
||
const i=this._size.w;e.save(),e.fillStyle=this._properties.lineColor.value();const s=Math.max(1,Math.floor(this._rendererOptionsProvider.options().borderSize*t)),r=this._isLeft?Math.floor(i*t)-s:0,n=Math.ceil(this._size.h*t);e.fillRect(r,0,s,n+1),e.restore()}_drawHorizontalBorder(e,t){e.save(),e.fillStyle=this._properties.lineColor.value();const i=Math.max(1,Math.floor(this._rendererOptionsProvider.options().borderSize*t)),s=Math.ceil(this._size.w*t),r=this._isLeft?0:i;e.fillRect(r,0,s-i,i),e.restore()}_drawBackground(e,t){const i=Math.ceil(t*this._size.w),s=Math.ceil(t*this._size.h),o=this._getBackgroundTopColor(),a=this._getBackgroundBottomColor();if(o===a?Object(r.clearRect)(e,0,0,i+1,s+1,o):Object(n.clearRectWithGradient)(e,0,0,i+1,s+1,o,a),this._highlighted){const t=c.themes[this._backgroundBasedTheme.value()].getThemedColor("color-price-axis-highlight");Object(r.fillRect)(e,0,0,i+1,s+1,t),e.globalAlpha=1}}_tooltipContent(){return this._sourcesTitlesProvider().join("\n")}_mouseOrTouchEnterEvent(e){null!==this._label&&"symbol"!==this._labelMode&&this._labelOptions.enableHighlight&&this._setHighlighted(!0)}_mouseOrTouchLeaveEvent(e){"symbol"!==this._labelMode&&this._setHighlighted(!1)}_mouseClickOrTapEvent(e){e.preventDefault(),null===this._fixedLabelMode&&"symbol"!==this._labelMode&&this._labelOptions.enableMenu&&this._labelOptions.showLabels?(this._fixedLabelMode=this._labelMode,this.setLabelMode("gear"),S.ContextMenuManager.createMenu(this._contextMenuItemsProvider(),{statName:"PriceScaleLabelContextMenu"},()=>{this.setLabelMode(Object(s.ensureNotNull)(this._fixedLabelMode)),this._fixedLabelMode=null}).then(e=>e.show((e,t)=>{const i=this._cell.getBoundingClientRect();return{clientX:this._isLeft?i.left:i.right-e,clientY:i.top-Math.min(t,i.top),overrideHeight:i.top<t?i.top:void 0}},this.getElement(),!0))):S.ContextMenuManager.hideAll()}}var P=i("Daqx");i.d(t,"a",(function(){return x}));class x{constructor(e,t,i,s,n){this._axises=[],this._stubs=[],this._size=new r.Size(0,0),this._onLabelHovered=new v.a,this._scalesProperties=e,this._priceAxisWidgetFactory=i,this._rendererOptionsProvider=s.rendererOptionsProvider,this._titlesProvider=s.titlesProvider,this._stubContextMenuProvider=s.stubContextMenuProvider,this._backgroundBasedTheme=s.backgroundBasedTheme,this._getBackgroundTopColor=s.getBackgroundTopColor,this._getBackgroundBottomColor=s.getBackgroundBottomColor,this._showHorisontalBorder=Boolean(s.showHorizontalBorder),this._labelsOptions=Object.assign(Object.assign({},w),n);const o=this._scalesProperties.childs();this._stubProperties={lineColor:o.lineColor,fontSize:o.fontSize},this._side=t,this._cell=document.createElement("td"),this._cell.classList.add("chart-markup-table","price-axis-container"),this._cell.style.width="25px",this._cell.style.position="relative"}destroy(){this.setScales([],0,0,0)}onLabelHovered(){return this._onLabelHovered}setScales(e,t,i,r){for(;e.length>this._axises.length&&this._axises.length<t;){
|
||
const e=Object(P.a)(this._side,this._axises.length),t=this._priceAxisWidgetFactory(this._side,this._rendererOptionsProvider,this._scalesProperties,e,this._backgroundBasedTheme);this._axises.push(t),this._cell.appendChild(t.getElement())}for(;e.length<this._axises.length;){const e=Object(s.ensureDefined)(this._axises.pop());this._cell.removeChild(e.getElement()),e.destroy()}for(let s=0;s<this._axises.length;++s)this._axises[s].setPriceScale(e[s]);const n=t-e.length,o=Math.max(0,n);for(;this._stubs.length>o;){const e=Object(s.ensureDefined)(this._stubs.pop());e.onLabelHovered().unsubscribeAll(this),this._cell.removeChild(e.getElement()),e.destroy()}for(;this._stubs.length<n;){const e=this._labelsOptions.showLabels?Object(P.a)(this._side,this._stubs.length):null,t=this._stubs.length,i=new C(this._side,this._stubProperties,e,this._stubParams(t),this._labelsOptions);i.onLabelHovered().subscribe(this,(t,i)=>{this._labelsOptions.showLabels&&this._labelsOptions.enableHighlight&&this._onLabelHovered.fire({owner:t,axis:Object(s.ensureNotNull)(e)},i)}),this._stubs.push(i),this._cell.appendChild(i.getElement())}const a=this._labelsOptions.enableMenu;1===r?this._stubs.forEach((e,t)=>e.setLabelMode(a?"gear":"symbol")):this._stubs.forEach((e,t)=>e.setLabelMode(t<i&&a?"auto":"symbol"))}getElement(){return this._cell}optimalWidths(){return this._axises.map(e=>e.optimalWidth())}setSizes(e,t){this._size=new r.Size(t.reduce((e,t)=>e+t,0),e),this._cell.style.width=this._size.w+"px",this._cell.style.minWidth=this._size.w+"px",this._cell.style.height=this._size.h+"px",t.length!==this._axises.length+this._stubs.length&&Object(s.assert)(t.length===this._axises.length+this._stubs.length,"Widgets count should be the same as widths one");let i=0;this._forEachWidgetFromLeft((s,n)=>{const o=t[n];s.setSizeAndOffset(new r.Size(o,e),i),i+=o})}update(){this._axises.forEach(e=>e.update()),this._stubs.forEach(e=>e.update())}paint(e){this._axises.forEach((t,i)=>t.paint(e(i))),this._stubs.forEach((t,i)=>t.paint(e(i)))}paintStubs(e){this._stubs.forEach(t=>t.paint(e))}hardResetCanvas(){this._axises.forEach(e=>e.hardResetCanvas()),this._stubs.forEach(e=>e.hardResetCanvas())}restoreDefaultCursor(){this._axises.forEach(e=>e.restoreDefaultCursor())}getWidth(){return this._size.w}findAxisWidgetForScale(e){const t=this._axises.find(t=>t.priceScale()===e);return void 0===t?null:t}getScreenshotData(){const e=this._getImage();return{content:e.toDataURL(),canvas:e,contentHeight:this._size.h,contentWidth:this._size.w}}getImage(){return this._getImage()}slotsCount(){return this._axises.length+this._stubs.length}highlightPriceAxisByLabel(e){this._axises.forEach(t=>{const i=t.axisInfo();t.setHighlighted(null!==i&&i.equals(e))})}axes(){return this._axises}_stubParams(e){return{rendererOptionsProvider:this._rendererOptionsProvider,backgroundBasedTheme:this._backgroundBasedTheme,sourcesTitlesProvider:()=>this._titlesProvider(this._side,e),contextMenuItemsProvider:()=>this._stubContextMenuProvider(this._side,e),getBackgroundTopColor:this._getBackgroundTopColor,
|
||
getBackgroundBottomColor:this._getBackgroundBottomColor,showHorizontalBorder:this._showHorisontalBorder}}_getImage(){const e=Object(r.createDisconnectedCanvas)(document,this._size),t=Object(r.getPrescaledContext2D)(e);let i=0;return this._forEachWidgetFromLeft((e,s)=>{const r=e.getWidth();0!==r&&(t.drawImage(e.getImage(),i,0,r,this._size.h),i+=r)}),e}_forEachWidgetFromLeft(e){const t=[...this._axises,...this._stubs],i="left"===this._side,s=i?-1:t.length,r=i?-1:1;for(let n=i?t.length-1:0;n!==s;n+=r)e(t[n],n,t)}}},"mKT+":function(e,t,i){"use strict";i.r(t);var s=i("QloM");function r(e,t,s,r,n){return Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(15),i.e(19),i.e(21),i.e(23),i.e(28),i.e(30),i.e(31),i.e(34),i.e(39),i.e(43),i.e(44),i.e(46),i.e(48),i.e(49),i.e(59),i.e(66),i.e(71),i.e(89),i.e(0),i.e(5),i.e(4),i.e(10),i.e(14),i.e(12),i.e(17),i.e(25),i.e(26),i.e(27),i.e(36),i.e(40),i.e(45),i.e(54),i.e("new-edit-object-dialog")]).then(i.bind(null,"Y5hB")).then(i=>{const s=new(0,i.EditObjectDialogRenderer)(e,t,r,n);return s.show(),s})}var n=i("3ClC");let o=null;var a=i("CW80");i.d(t,"resolveAndShowEditObjectDialog",(function(){return c}));const l={[s.TabNames.symbol]:"symbol",[s.TabNames.legend]:"legend",[s.TabNames.scales]:"scales",[s.TabNames.trading]:"trading",[s.TabNames.events]:"events",[s.TabNames.text]:"text",[s.TabNames.style]:"style"};async function c(e,t,s={},c,h){const u=c.activeChartWidget.value();if(Object(a.isStudyLineTool)(e),Object(n.isStudy)(e)&&function(e){const{shortId:t}=e.metaInfo();return"Overlay"===t}(e)||Object(a.isLineTool)(e))return u.propertiesDefinitionsForSource(e).then(r=>{if(null!==r){const{tabName:n}=s;return function(e){return Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(15),i.e(16),i.e(19),i.e(20),i.e(21),i.e(28),i.e(30),i.e(31),i.e(34),i.e(39),i.e(43),i.e(44),i.e(46),i.e(48),i.e(53),i.e(71),i.e(94),i.e(0),i.e(5),i.e(4),i.e(10),i.e(14),i.e(12),i.e(17),i.e(29),i.e(25),i.e(26),i.e(27),i.e(33),i.e(36),i.e(40),i.e(51),i.e(65),i.e("source-properties-editor")]).then(i.bind(null,"CbZh")).then(t=>{const i=new(0,t.SourcePropertiesEditorRenderer)(e);return null!==o&&o.hide(),i.show(),o=i,i})}({propertyPages:r,model:t,source:e,activePageId:n&&l[n]})}return null});if(Object(n.isStudy)(e)&&!Object(n.isESDStudy)(e))return r(e,t,0,h);{const{tabName:t}=s,i=Object(n.isESDStudy)(e)?"events":t&&l[t],r=c.getChartPropertiesDialogRenderer();return r.setActivePage(i),r.show()}}},mMWL:function(e,t,i){"use strict";i.r(t),i.d(t,"toolIsCursor",(function(){return d})),i.d(t,"toolIsMeasure",(function(){return p})),i.d(t,"resetToCursor",(function(){return _})),i.d(t,"lockTimeAxisTime",(function(){return y})),i.d(t,"tool",(function(){return w})),i.d(t,"iconTool",(function(){return C})),i.d(t,"cursorTool",(function(){return P})),i.d(t,"isToolCreatingNow",(function(){return x})),i.d(t,"isToolEditingNow",(function(){return T})),i.d(t,"isToolMovingNow",(function(){return M})),
|
||
i.d(t,"isDirectionalMovementActive",(function(){return I})),i.d(t,"createdLineTool",(function(){return L})),i.d(t,"continuedLineTool",(function(){return O})),i.d(t,"cancelledLineTool",(function(){return A})),i.d(t,"beenSetLineToolLastPoint",(function(){return E})),i.d(t,"startedMovingLineTool",(function(){return k})),i.d(t,"movedLineTool",(function(){return D})),i.d(t,"finishedMovingLineTool",(function(){return V})),i.d(t,"startedChangingLineTool",(function(){return B})),i.d(t,"changedLineTool",(function(){return R})),i.d(t,"finishedChangingLineTool",(function(){return N})),i.d(t,"removedLineTool",(function(){return j})),i.d(t,"finishedLineTool",(function(){return F})),i.d(t,"changedLineStyle",(function(){return W})),i.d(t,"copiedLineTool",(function(){return H})),i.d(t,"restoredLineTool",(function(){return z})),i.d(t,"restoredLineToolState",(function(){return U})),i.d(t,"createLineTool",(function(){return Y})),i.d(t,"continueLineTool",(function(){return K})),i.d(t,"cancelLineTool",(function(){return J})),i.d(t,"setLineToolLastPoint",(function(){return Z})),i.d(t,"startMovingLineTool",(function(){return X})),i.d(t,"moveLineTool",(function(){return $})),i.d(t,"finishMovingLineTool",(function(){return Q})),i.d(t,"startChangingLineTool",(function(){return ee})),i.d(t,"changeLineTool",(function(){return te})),i.d(t,"finishChangingLineTool",(function(){return ie})),i.d(t,"removeLineTool",(function(){return se})),i.d(t,"finishLineTool",(function(){return re})),i.d(t,"changeLineStyle",(function(){return ne})),i.d(t,"copyLineTool",(function(){return oe})),i.d(t,"restoreLineTool",(function(){return ae})),i.d(t,"restoreLineToolState",(function(){return le})),i.d(t,"init",(function(){return ue})),i.d(t,"runOnDrawingStateReady",(function(){return de})),i.d(t,"properties",(function(){return pe})),i.d(t,"hideAllDrawings",(function(){return _e})),i.d(t,"hideAllIndicators",(function(){return me})),i.d(t,"lockDrawings",(function(){return fe})),i.d(t,"hideMarksOnBars",(function(){return ge})),i.d(t,"drawOnAllCharts",(function(){return ve})),i.d(t,"lockTimeAxis",(function(){return be}));var s=i("Eyy1"),r=i("m/cY"),n=i("Ocx9"),o=i("hY0g"),a=i.n(o),l=i("aIyQ"),c=i.n(l),h=i("Vdly"),u=i("FQhm");function d(e){return"cursor"===e||"arrow"===e||"dot"===e}function p(e){return"measure"===e}function _(e=!1){if(!e&&m){if(m.childs().stayInDrawingMode.value())return}w.setValue(P.value())}let m=null,f=null,g=null,v=null,b=null,S=null;const y=new a.a,w=new a.a,C=new a.a,P=new a.a,x=new a.a(!1),T=new a.a(!1),M=new a.a(!1),I=new a.a(!1),L=new c.a,O=new c.a,A=new c.a,E=new c.a,k=new c.a,D=new c.a,V=new c.a,B=new c.a,R=new c.a,N=new c.a,j=new c.a,F=new c.a,W=new c.a,H=new c.a,z=new c.a,U=new c.a;function G(e,t){const i=t||{value:!1};return t=>{i.value||(i.value=!0,e.fire(t),i.value=!1)}}const q={value:!1},Y=G(L,q),K=G(O,q),J=G(A,q),Z=G(E,q),X=G(k),$=G(D),Q=G(V),ee=G(B),te=G(R),ie=G(N),se=G(j),re=G(F),ne=G(W,q),oe=G(H,q),ae=G(z),le=G(U);let ce=!1,he=[];function ue(){ce||(w.setValue(h.getValue("chart.cursorPreference","cursor")),
|
||
w.subscribe(e=>d(e)&&P.setValue(e),{callWithLast:!0}),P.subscribe(e=>{e&&h.setValue("chart.cursorPreference",e)}),m=new n.DefaultProperty("drawings"),f=Object(r.a)(),g=Object(r.a)(),v=Object(r.a)(),b=Object(r.a)(),S=Object(r.a)(),f.setValue(!1),g.setValue(!1),v.setValue(!1),b.setValue(!1),S.setValue(!1),w.subscribe(()=>{Object(u.emit)("onSelectedLineToolChanged")}),ce=!0,he.forEach(e=>e()),he=[])}function de(e){ce?e():he.push(e)}function pe(){return Object(s.ensureNotNull)(m)}function _e(){return Object(s.ensureNotNull)(f)}function me(){return Object(s.ensureNotNull)(g)}function fe(){return Object(s.ensureNotNull)(v)}function ge(){return Object(s.ensureNotNull)(b)}function ve(){return pe().childs().drawOnAllCharts}function be(){return Object(s.ensureNotNull)(S)}},mNbo:function(e,t,i){"use strict";function s(e,t=!1){return!1}function r(e){return e}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r}))},mPvX:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolsGroupModel",(function(){return o}));var s=i("aIyQ"),r=i.n(s),n=i("UqOQ");class o{constructor(e){this._onChanged=new r.a,this._groups=[],this._groups=e||[],this._groups.forEach(e=>{e.onChanged().subscribe(null,t=>this._onChanged.fire(e.id,t))})}groups(){return this._groups.filter(e=>e.isActualSymbol())}groupsForAllSymbols(){return this._groups}createGroup(e,t,i){t=t||this._generateNextName();const s=new n.a(e,t,i);this._groups.push(s),s.onChanged().subscribe(null,e=>this._onChanged.fire(s.id,e));const r={visibilityChanged:!1,lockedChanged:!1,titleChanged:!1,isActualIntervalChanged:!1,affectedLineTools:e.map(e=>e.id())};return this._onChanged.fire(s.id,r),s}addGroup(e){this._groups.push(e),e.onChanged().subscribe(null,t=>this._onChanged.fire(e.id,t)),this._onChanged.fire(e.id)}removeGroup(e){const t=this._groups.findIndex(t=>t.id===e.id);this._groups.splice(t,1),this._onChanged.fire(e.id)}groupForId(e){return this._groups.find(t=>t.id===e)||null}groupForLineTool(e){return this._groups.find(t=>t.containsLineTool(e))||null}removeLineTools(e){this._groups.forEach(t=>t.excludeLineTools(e));this._groups.filter(e=>0===e.lineTools().length).forEach(e=>this.removeGroup(e))}state(e){return{groups:(e?this._groups.filter(e=>e.isActualSymbol()):this._groups).map(e=>e.state())}}onChanged(){return this._onChanged}fireChangedAll(){this._groups.forEach(e=>{this._onChanged.fire(e.id)})}static fromState(e,t){const i=[];for(const s of t.groups){const t=n.a.fromState(e,s);null!==t&&i.push(t)}return new o(i)}_generateNextName(){const e=new Set(this.groups().map(e=>e.name()));for(let t=1;;t++){const i="Group "+t,s="Group_"+t;if(!e.has(i)&&!e.has(s))return i}}}},mYjs:function(e,t,i){"use strict";function s(e,t){Promise.all([i.e(67),i.e(32),i.e(58),i.e("change-interval-dialog")]).then(i.t.bind(null,"MuC6",7)).then(i=>{new i.ChangeIntervalDialog(e).show(t)})}i.r(t),i.d(t,"showChangeIntervalDialog",(function(){return s}))},mZrn:function(e,t,i){"use strict";i.r(t);var s=i("FBuY"),r=i("JWMC"),n=i("+6II"),o=i("qocr");const a=/\b(msie|trident)\b/i.test(navigator.userAgent)?1:0
|
||
;function l(e){return e.offsetWidth+a<e.scrollWidth}Object(o.a)(()=>{document.addEventListener("mouseenter",e=>{const t=e.target;var i;t instanceof HTMLElement&&t.matches(".apply-overflow-title")&&((i=t).getAttribute("title")||i.offsetWidth+a>=i.scrollWidth||i.setAttribute("title",i.textContent||""))},!0),document.addEventListener("mouseenter",e=>{const t=e.target;if(t instanceof HTMLElement&&t.matches(".apply-overflow-tooltip")){if(t.matches(".apply-overflow-tooltip--check-children")){let e=!1;const i=t.children;for(let t=0;t<i.length;t++){const s=i[t];if(s instanceof HTMLElement&&l(s)){e=!0;break}}if(!e)return}else if(!l(t))return;let e="";e=t.matches&&t.matches(".apply-overflow-tooltip--allow-text")?t.textContent||"":Array.from(t.childNodes).reduce((e,t)=>(t.nodeType===Node.TEXT_NODE&&e.push(t.textContent||""),e),[]).join("").trim(),Object(n.showOnElement)(t,{text:e});const i=()=>{Object(n.hide)(),["mouseleave","mousedown"].forEach(e=>t.removeEventListener(e,i))};["mouseleave","mousedown"].forEach(e=>t.addEventListener(e,i))}},!0)});var c=i("aIyQ"),h=i.n(c),u=i("VVxS"),d=i("FIi8");i("ULlu");let p;function _(e){window.iframeAuthWidget&&!1===window.user.profile_data_filled&&(window.iframeAuthWidget.preventClose=!0);const t=window.user.available_offers||{};window.TVSettings&&window.TVSettings.sync(window.user.settings),window.is_authenticated?!1===window.user.profile_data_filled&&(Object(r.trackEvent)("Conversion","First login"),delete window.user.profile_data_filled):(Object.keys(t).forEach(e=>{const i=e;t[i].available_for_anons||delete t[i]}),window.user={username:"Guest",following:"0",followers:"0",ignore_list:{},available_offers:t},u.TVLocalStorage.removeItem("trial_availiable"))}p=window.loginStateChange?window.loginStateChange:window.loginStateChange=new h.a,p.subscribe(null,_),s.TVXWindowEvents.on("loginStateChange",e=>{const t=JSON.parse(e);window.user=t.user,window.is_authenticated=!!t.is_authenticated,p.fire()}),s.TVXWindowEvents.on("signOut",()=>{!function(){if(window.initData.lfs){const e=document.getElementsByClassName("js-admin-warning")[0];document.body.removeChild(e)}let e=!0;[/^\/chart\//,/^\/share-your-love\//].forEach(t=>{t.test(window.location.pathname)&&(e=!1)}),e&&window.location.reload()}()}),(()=>{const e={};window.crossTabSyncUserAttr=e=>{const t={};e instanceof Array?e.forEach(e=>{t[e]=window.user[e]}):t[e]=window.user[e],s.TVXWindowEvents.emit("user-obj-changed",JSON.stringify(t))},s.TVXWindowEvents.on("user-obj-changed",t=>{const i=JSON.parse(t);let s;for(s in i)if(i.hasOwnProperty(s)){window.user[s]=i[s];(e[s]||[]).forEach(e=>{e.fire(i[s])})}})})(),window.TradingView.changeLoginState=e=>{window.is_authenticated=!!e,s.TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:window.is_authenticated,user:window.user})),p.fire()},window.loginUser=function(e,t){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),window.user=Object(d.deepExtend)({},e),window.TradingView.changeLoginState(!0),
|
||
"function"==typeof t&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",()=>{t()}):"function"==typeof t&&t()},window.loginRequiredDelegate=new h.a,window.runOrSignIn=(e,t)=>{t||(t={}),e()},window.onLoginStateChange=_,window.TradingView.setTrialAvailiable=e=>{u.TVLocalStorage.setItem("trial_availiable",e?"1":"0")},window.TradingView.notificationsChanged=new h.a},me8f:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBalloon",(function(){return h}));var s=i("YFKU"),r=i("Ocx9"),n=i("Ss5c"),o=i("tc+8"),a=i.n(o),l=i("j3hX");const c=Object(s.t)("Comment");class h extends n.LineDataSource{constructor(e,t){const s=t||h.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"Hyqq")).then(t=>{this._setPaneViews([new t.BalloonPaneView(this,e)])})}pointsCount(){return 1}name(){return"Balloon"}properties(){return super.properties()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new r.DefaultProperty("linetoolballoon",e);return h._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"RhWr")).then(e=>e.BalloonDefinitionsViewModel)}static _configureProperties(e){n.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a(c)),e.addExclusion("text"),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().color]))}}},mf9N:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("GD+X"),n=i("96Yh"),o=i("ogJP"),a=i("RDU5");class l extends a.UndoCommand{constructor(e,t,i){super("Change Pane Height"),this._model=e,this._paneIndex=t,this._paneHeight=i,this._prevStretchFactors=this._model.panes().map(e=>e.stretchFactor())}redo(){this._model.changePanesHeight(this._paneIndex,this._paneHeight)}undo(){const e=this._model.panes();for(let t=0;t<e.length;++t)e[t].setStretchFactor(Object(s.ensureDefined)(this._prevStretchFactors[t]));this._model.fullUpdate()}}i.d(t,"PaneApi",(function(){return c}));class c{constructor(e,t){this._priceScales=new WeakMap,this._pane=e,this._chartWidget=t}hasMainSeries(){return this._pane.containsMainSeries()}getLeftPriceScales(){return this._pane.leftPriceScales().map(this._getPriceScaleApi,this)}getRightPriceScales(){return this._pane.rightPriceScales().map(this._getPriceScaleApi,this)}getMainSourcePriceScale(){const e=this._pane.mainDataSource();if(null===e)return null;const t=e.priceScale();return null===t||this._pane.isOverlay(e)?null:this._getPriceScaleApi(t)}setMaximized(e){if(this._pane.isMaximized()!==e)for(const t of this._chartWidget.paneWidgets())if(t.state()===this._pane){this._chartWidget.toggleMaximizePane(t);break}}legendLoaded(){const e=this._chartWidget.paneByState(this._pane);return Boolean(e&&e.statusWidget())}getAllEntities(){const e=this._pane.model()
|
||
;return this._pane.sourcesByGroup().allIncludingHidden().map(t=>Object(n.entityForDataSource)(e,t)).filter(o.notNull).filter(e=>null!==e.name)}getHeight(){return this._pane.height()}setHeight(e){const t=this._chartWidget.model().model(),i=t.panes();Object(s.assert)(i.length>1,"Unable to change pane's height if there is only one pane");const r=i.indexOf(this._pane);Object(s.assert)(-1!==r,"Invalid pane index");const n=new l(t,r,e);this._chartWidget.model().undoHistory().pushUndoCommand(n)}moveTo(e){const t=this.paneIndex();t!==e&&(Object(s.assert)(e>=0&&e<this._chartWidget.paneWidgets().length,"Invalid pane index"),this._chartWidget.model().movePane(t,e))}paneIndex(){return this._chartWidget.model().model().panes().indexOf(this._pane)}_getPriceScaleApi(e){let t=this._priceScales.get(e);return void 0===t&&(t=new r.a(this._chartWidget.model(),e),this._priceScales.set(e,t)),t}}},mkn5:function(e,t,i){"use strict";(function(t,s){i("AE9l"),i("YFKU");var r=i("UCjq").PaneWidgetBase,n=i("1IXQ").scaleRatioForContextMenuTransformer(7),o=i("CW80").isLineToolName,a=i("YmeR").ActionBinder,l=i("7KDR"),c=l.Action,h=l.Separator,u=i("mMWL"),d=i("FQhm"),p=i("S8xo").MouseEventHandler,_=i("+6II");e.exports.PaneWidget=class extends r{constructor(e,i,s,r){super(e,i,s,r),this.setCursorForTool(),this._mouseEventHandler=new p(this._topCanvasBinding.canvas,this,{treatVertTouchDragAsPageScroll:!this._options.handleScroll.vertTouchDrag,treatHorzTouchDragAsPageScroll:!this._options.handleScroll.horzTouchDrag}),this.actions=[],this.readonlyActions=[],this._prevHoveredHittest=null,this._chart.withModel(this,(function(){var e=this._chartUndoModel();e.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),e.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})),this._highlightedPriceAxis=new t({owner:"",axis:null}),this._highlightedPriceAxis.subscribe(function(e){this._highlightPriceAxisByLabel(e.axis)}.bind(this)),this._prevPinchScale=0,this._isDestroyed=!1}destroy(){for(var e in super.destroy(),this._prevHoveredHittest=null,this._mouseEventHandler.destroy(),this._rowElement.parentElement.removeChild(this._rowElement),this)delete this[e];this._isDestroyed=!0}_highlightPriceAxisByLabel(e){this._lhsPriceAxisesContainer.highlightPriceAxisByLabel(e),this._rhsPriceAxisesContainer.highlightPriceAxisByLabel(e)}chart(){return this._chart}stretchFactor(){return this._state?this._state._stretchFactor:0}setStretchFactor(e){this.hasState()&&(this._state._stretchFactor=e)}hideInplaceEditor(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)}drawRightThere(e){if(o(e)){var t=this._chartUndoModel(),i=t.crossHairSource(),s=t.model().magnet().align(i.price,i.index,this._state);t.createLineTool(this.state(),{index:i.index,price:s},e)}}_updateCommonTooltip(e){var t=this._lastCommonTooltipData,i=null;if(e&&e.hittest){var s=e.hittest.data();s&&(i=s.tooltip||null)}if(null!=t||null!=i){if(null==i||""===i.text)return this._lastCommonTooltipData=null,void _.hide()
|
||
;if(!t||i.text!==t.text||i.rect.x!==t.rect.x||i.rect.y!==t.rect.y||i.rect.w!==t.rect.w||i.rect.h!==t.rect.h){this._lastCommonTooltipData=i;var r=TradingView.clone(i),n=this._paneCell.getBoundingClientRect();r.rect.x+=n.left,r.rect.y+=n.top,_.show(r)}}}createRemoveMenu(){var e=this._chart.actions();return new c({label:window.t("Remove"),statName:"Remove",subItems:[e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools]})}_customActions(){var e={top:[],bottom:[],remove:[]},t=this._chartUndoModel().timeScale(),i=this._state&&this._state.defaultPriceScale();if(!s.enabled("custom_items_in_context_menu"))return e;var r,n=t.isEmpty()?void 0:t.indexToUserTime(t.coordinateToIndex(this._contextMenuX));if(i&&!i.isEmpty()){var o=this._state.mainDataSource().firstValue();r=i.coordinateToPrice(this._contextMenuY,o)}return d.emit("onContextMenu",{unixtime:n?n/1e3:void 0,price:r,callback:function(t){[].concat(t).forEach((function(t){var i;t.text&&(t.text.length>1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new h:new c({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e}update(){this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()}createActionLockScale(e){if(!(e instanceof TradingView.Series))return null;var t=n(e.priceScale(),this._chartUndoModel().model().mainSeriesScaleRatio()),i=new c({checkable:e.priceScale().isLockScale(),label:window.t("Lock Scale")+" "+t,statName:"LockScale"});return i._binding=new a(i,e.priceScale().properties().lockScale,this._chartUndoModel(),"Lock Scale",(function(){var t={lockScale:this.value()};this._undoModel.setPriceScaleMode(t,e.priceScale(),this._undoText)})),i}_updateCrosshairOnZoom(){if(u.lockTimeAxis().value()){var e=this._chartUndoModel().crossHairSource();e.setPosition(e.index,e.price,this.state())}}highlightedPriceAxis(){return this._highlightedPriceAxis}}}).call(this,i("hY0g"),i("Kxc7"))},n0Bl:function(e,t,i){"use strict";i.r(t),i.d(t,"migrateShortcut",(function(){return r}));var s=i("/3z9");function r(e){const t=e.split("+");let i=t.pop().toUpperCase().charCodeAt(0);for(let r=0;r<t.length;r++){const e=t[r].toLowerCase();"ctrl"===e?i|=s.Modifiers.Control:"shift"===e?i|=s.Modifiers.Shift:"alt"===e&&(i|=s.Modifiers.Alt)}return i}},n40Z:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolVertLine",(function(){return h}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ocx9"),o=i("tc+8"),a=i.n(o),l=i("Ss5c"),c=i("GmZZ");class h extends l.LineDataSource{constructor(e,t){const s=t||h.createProperties();super(e,s),this._timeAxisView=new c.a(this),this._paneViewFactory=null,this.properties().childs().extendLine.subscribe(this,()=>e.lightUpdate()),i.e("lt-pane-views").then(i.bind(null,"BSCN")).then(t=>{this._paneViewFactory=i=>new t.VertLinePaneView(this,e,i),this._model.lightUpdate()})}destroy(){this.properties().childs().extendLine.unsubscribeAll(this),super.destroy()}pointsCount(){return 1}properties(){
|
||
return super.properties()}name(){return"Vertical Line"}timeAxisViews(){return this.isSourceHidden()?null:this.properties().childs().showTime.value()?[this._timeAxisView]:null}updateAllViews(){super.updateAllViews(),this._timeAxisView.update()}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}isMultiPaneAvailable(){return!0}isMultiPaneEnabled(){return this.properties().childs().extendLine.value()}paneViews(e){return e=Object(s.ensureDefined)(e),this.isMultiPaneEnabled()||this._model.paneForSource(this)===e?(null===this._getPaneViews(e)&&null!==this._paneViewFactory&&this._setPaneViews([this._paneViewFactory(e)],e,!0),super.paneViews(e)):null}priceAxisViews(){return null}priceAxisPoints(){return[]}pointToScreenPoint(e){const t=this._model.timeScale();if(t.isEmpty())return[new r.Point(0,0),new r.Point(0,0)];const i=t.indexToCoordinate(e.index),s=new r.Point(i,0);return[s,s]}convertYCoordinateToPriceForMoving(e){return 0}static createProperties(e){null!=e&&(void 0===e.textOrientation&&(e.textOrientation="horizontal"),void 0===e.extendLine&&(e.extendLine=!1));const t=new n.DefaultProperty("linetoolvertline",e);return h._configureProperties(t),t}_getAlertPlots(){const e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FkpW")).then(e=>e.VerticalLineDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){l.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")}}},n5al:function(e,t,i){"use strict";i.r(t),i.d(t,"isRequiringRestartSeriesStyles",(function(){return p})),i.d(t,"isRangeBasedStyle",(function(){return _})),i.d(t,"isRangeStyle",(function(){return m})),i.d(t,"isTimeBasedStyle",(function(){return f})),i.d(t,"isValidStyle",(function(){return g})),i.d(t,"setLastUsedStyle",(function(){return v})),i.d(t,"getLastUsedStyle",(function(){return b})),i.d(t,"getDefaultStyle",(function(){return S})),i.d(t,"getChartStyleByResolution",(function(){return y})),i.d(t,"chartStyleStudyId",(function(){return w})),i.d(t,"preparePriceAxisProperties",(function(){return C})),i.d(t,"hasProjection",(function(){return x})),i.d(t,"isPriceSourceStyle",(function(){return T})),i.d(t,"getSeriesPriceFormattingState",(function(){return M})),i.d(t,"createSeriesFormatter",(function(){return I})),i.d(t,"symbolCurrencyConvertible",(function(){return L})),i.d(t,"symbolCurrency",(function(){return O})),i.d(t,"symbolOriginalCurrency",(function(){return A})),i.d(t,"symbolBaseCurrency",(function(){return E})),i.d(t,"isConvertedToOtherCurrency",(function(){return k})),i.d(t,"symbolUnitConvertible",(function(){return D})),i.d(t,"symbolUnit",(function(){return V})),i.d(t,"symbolOriginalUnit",(function(){return B})),i.d(t,"isConvertedToOtherUnit",(function(){
|
||
return R})),i.d(t,"symbolUnitConvertibleGroupsIfExist",(function(){return N})),i.d(t,"symbolCurrentContract",(function(){return j})),i.d(t,"extractSymbolNameFromSymbolInfo",(function(){return F})),i.d(t,"symbolTitle",(function(){return W}));var s=i("Vdly"),r=i("dfhE"),n=i("LxhU"),o=i("kcTO"),a=i("Kxc7"),l=i("nEwK");const c=[4,5,6,7,8],h=[4,5,6,7,8,11],u=[0,1,9,2,3,10],d=[2,10,3];function p(e){return-1!==c.indexOf(e)}function _(e){return-1!==h.indexOf(e)}function m(e){return 11===e}function f(e){return-1!==u.indexOf(e)}function g(e){return _(e)||f(e)}function v(e){g(e)&&11!==e&&s.setValue("chart.lastUsedStyle",e)}function b(){const e=s.getInt("chart.lastUsedStyle");return void 0===e?1:e}function S(e){return e?11:1}function y(e,t){const i=m(t),s=n.Interval.isRange(e);return!i&&s?S(!0):i&&!s?S(!1):t}function w(e,t){const i=r.SYMBOL_STRING_DATA[e];return void 0===i?null:t?`${i.type}-${i.basicStudyVersion}`:i.type}function C(e){const t=e.priceAxisProperties,i=t.lockScale.value(),s=6===e.style.value();(s||i)&&(t.log.setValue(!1),t.percentage.setValue(!1)),t.logDisabled.setValue(!(!s&&!i)),t.percentageDisabled.setValue(!(!s&&!i))}const P=[4,7,5,6];function x(e){return-1!==P.indexOf(e)}function T(e){return d.includes(e)}function M(e,t="default",i=!1){let s,r,n=100,o=1;if("default"===t)null!=e&&(n=e.pricescale,o=e.minmov,s=e.fractional,r=e.minmove2);else{let e=t.split(",");3!==e.length&&(e=["100","1","false"]),n=parseInt(e[0]),o=parseInt(e[1]),s="true"===e[2]}return i&&(o=1),{priceScale:n,minMove:o,fractional:s,minMove2:r}}function I(e,t,i=!1){if("default"===t&&null!=e&&("volume"===e.formatter||"volume"===e.format))return new l.VolumeFormatter(2);const{priceScale:s,minMove:r,fractional:n,minMove2:a}=M(e,t,i);return new o.PriceFormatter(s,r,n,a)}function L(e){return null!==e&&"spread"!==e.type}function O(e,t,i){if(null===e)return null;const s=!t||i?e.currency_id:e.currency_code;return void 0===s||""===s?null:s}function A(e,t){return(t?e.original_currency_code:e.original_currency_id)||O(e,t)}function E(e){return e.base_currency_id||null}function k(e){return!(null===e||!L(e))&&(void 0!==e.original_currency_id&&e.original_currency_id!==e.currency_id)}function D(e){return null!==e&&"spread"!==e.type}function V(e){if(null===e)return null;const t=e.unit_id;return void 0===t||""===t?null:t}function B(e){return e.original_unit_id||V(e)}function R(e){return!(null===e||!D(e))&&(void 0!==e.original_unit_id&&e.original_unit_id!==e.unit_id)}function N(e){return null!==e&&D(e)?e.unit_conversion_types||null:[]}function j(e){return"futures"===e.type&&e.front_contract||null}function F(e,t){let i=e&&(e.pro_name||e.full_name||e.name);return a.enabled("charting_library_single_symbol_request")&&t?i=t:a.enabled("use_ticker_on_symbol_info_update")&&e&&e.ticker&&(i=e.ticker),i}function W(e,t){return t?e.name:`${e.name}, ${e.exchange}`}},nBJD:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e){this._text="",this._color="",this._size="13px",this._bold=!1,this._statusProvider=e}text(){return this._text}getSplitTitle(){
|
||
return[this._text]}color(){return this._statusProvider.color()}bold(){return this._bold}size(){return this._size}}},nEwK:function(e,t,i){"use strict";i.r(t),i.d(t,"PLACE_HOLDER",(function(){return a})),i.d(t,"VolumeFormatter",(function(){return l}));var s=i("YFKU"),r=i("zXvd"),n=i("ogJP"),o=i("ivNn");const a="---";class l{constructor(e){this.type="volume",this._numericFormatter=new r.NumericFormatter,this._fractionalValues=void 0!==e&&e>0,this._precision=e}state(){return{precision:this._precision}}format(e){if(!Object(n.isNumber)(e))return a;let t="";return e<0&&(t="-",e=-e),e>=1e100?Object(s.t)("N/A"):(!this._fractionalValues||e>=995?e=Math.round(e):this._fractionalValues&&(e=+e.toFixed(this._precision)),e<995?t+this._formatNumber(e):e<999995?t+this._formatNumber(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this._formatNumber(e/1e6)+"M"):e<999999999995?(e=1e6*Math.round(e/1e6),t+this._formatNumber(e/1e9)+"B"):(e=1e9*Math.round(e/1e9),t+this._formatNumber(e/1e12)+"T"))}parse(e){if("---"===e)return{error:"not a number",res:!1,value:NaN};const t={K:1e3,M:1e6,B:1e9},i=e.slice(-1);if(t.hasOwnProperty(i)){const s=this._numericFormatter.parse(e.slice(0,-1));return Object(n.isNumber)(s)?{res:!0,value:s*t[i]}:{error:"not a number",res:!1,value:NaN}}{const t=this._numericFormatter.parse(e);return Object(n.isNumber)(t)?{res:!0,value:t}:{error:"not a number",res:!1,value:NaN}}}static serialize(e){return e.state()}static deserialize(e){return new l(e.precision)}_formatNumber(e){return this._fractionalValues&&(e=Object(o.fixComputationError)(e)),this._numericFormatter.format(e).replace(/(\.[1-9]*)0+$/,(e,t)=>t)}}},nW7S:function(e,t,i){"use strict";(function(e){var s=i("aO4+").Point,r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty;class o extends e{constructor(e){super(),this._lineSource=e}value(){var e=180*this._lineSource._angle/Math.PI;return Math.round(e)}setValue(e){var t=e*Math.PI/180;this._lineSource._angle=t;var i=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],r=Math.cos(this._lineSource._angle),n=-Math.sin(this._lineSource._angle),o=new s(r,n),a=i.addScaled(o,this._lineSource._distance),l=this._lineSource.screenPointToPoint(a);this._lineSource._points[1]=l,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)}}class a extends r{constructor(e,t){super(e,t||a.createProperties()),this._properties.addChild("angle",new o(this)),i.e("lt-pane-views").then(i.t.bind(null,"XHET",7)).then(({TrendAnglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}isSynchronizable(){return!1}pointsCount(){return 2}name(){return"Trend Angle"}_calculateAngle(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e);i.length()>0?(i=i.normalized(),this._angle=Math.acos(i.x),i.y>0&&(this._angle=-this._angle),this._distance=t.subtract(e).length()):delete this._angle,
|
||
this.properties().hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)}addPoint(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i}setLastPoint(e,t){super.setLastPoint(e,t),this.points().length>1&&this._calculateAngle()}axisPoints(){if(this.points().length<2)return[];var e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,r=-Math.sin(this._angle)*this._distance,n=t.add(new s(i,r)),o=this.screenPointToPoint(n);return e.push(o),e}setPoint(e,t,i){super.setPoint(e,t,i),this.points().length>1&&1===e&&this._calculateAngle()}restoreData(e){this._angle=e.angle,this._distance=e.distance}state(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t}cloneData(e){this._angle=e._angle,this._distance=e._distance}canHasAlert(){return!0}_getAlertPlots(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"o1gc"))).TrendAngleDefinitionsViewModel}static createProperties(e){var t=new n("linetooltrendangle",e);return a._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolTrendAngle=a}).call(this,i("tc+8"))},"nd9+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolGannComplex",(function(){return h}));var s=i("aO4+"),r=i("Eyy1"),n=i("T6Of"),o=i("Ss5c"),a=i("FaJS"),l=i("LAp3"),c=i("j3hX");class h extends o.LineDataSource{constructor(e,t){super(e,t||h.createProperties()),this.version=2,this._scaleRatioFormatter=new n.LimitedPrecisionNumericFormatter(7),i.e("lt-pane-views").then(i.bind(null,"X4Cb")).then(({GannComplexPaneView:e})=>{this._setPaneViews([new e(this,this.model())])});const s=this.properties();this._adjustScaleRatio(s),s.subscribe(this,this._adjustScaleRatio),s.childs().scaleRatio.subscribe(this,this._correctFirstPoint),this._syncStateExclusions=["scaleRatio"],s.addExclusion("scaleRatio"),this.properties().onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.subscribe(this,this._handleTemplateApplying),this._onTemplateApplied.subscribe(this,this._correctFirstPoint)}properties(){return super.properties()}migrateVersion(e,t,i){1===e&&(this._points.length>=this.pointsCount()?setTimeout(()=>this._migratePoint()):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))}destroy(){const e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.childs().scaleRatio.unsubscribe(this,this._correctFirstPoint),this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint),super.destroy()}pointsCount(){return 2}name(){return"Gann Square"}addPoint(e,t,i){
|
||
this._points.length>1&&this._points.pop();const s=super.addPoint(e,t,i),n=this.priceScale();return!Object(r.ensureNotNull)(n).isLog()&&s&&this._correctFirstPoint(),s}setPoint(e,t,i){super.setPoint(e,t,i),void 0!==i&&i.shift()?this._correctPoint(e):this._correctScaleRatio()}setLastPoint(e,t){const i=this.priceScale();Object(r.ensureNotNull)(i).isLog()||(this._points[1]=e,this._correctPoint(1)),super.setLastPoint(e,t)}isReversed(){return this.properties().childs().reverse.value()}levelsCount(){return this.properties().childs().levels.childCount()}levels(){const e=[],t=this.properties().childs(),i=t.levels.childCount();for(let s=0;s<i;s++){const i=t.levels.childs()[s].childs();e.push({index:s,visible:i.visible.value(),color:i.color.value(),width:i.width.value()})}return e}fanLinesCount(){return this.properties().childs().fanlines.childCount()}fanLines(){const e=[],t=this.properties().childs(),i=t.fanlines.childCount();for(let s=0;s<i;s++){const i=t.fanlines.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsCount(){return this.properties().childs().arcs.childCount()}arcs(){const e=[],t=this.properties().childs(),i=t.arcs.childCount();for(let s=0;s<i;s++){const i=t.arcs.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsBackgroundTransparency(){return this.properties().childs().arcsBackground.childs().transparency.value()}isArcsBackgroundFilled(){return this.properties().childs().arcsBackground.childs().fillBackground.value()}isLabelsVisible(){return this.properties().childs().showLabels.value()}getLabelsStyle(){const e=this.properties().childs(),{font:t,fontSize:i,bold:s,italic:r}=e.labelsStyle.childs(),n=e.levels.childCount();return{textColor:e.levels.childs()[n-1].childs().color.value(),font:t.value(),fontSize:i.value(),bold:s.value(),italic:r.value()}}getScaleRatioStep(){return 1e-7}getScaleRatioFormatter(){return this._scaleRatioFormatter}getPriceDiff(){const e=this.points();if(e.length<2)return null;const[t,i]=e;return i.price-t.price}getIndexDiff(){const e=this.points();if(e.length<2)return null;const[t,i]=e;return i.index-t.index}getScaleRatio(){const e=this.getPriceDiff(),t=this.getIndexDiff();return null!==e&&null!==t&&0!==t?Math.abs(e/t):null}static createProperties(e){const t=Object(l.a)("linetoolganncomplex",e);return h._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"WfUZ")).then(e=>e.GannComplexAndFixedDefinitionsViewModel)}static _configureProperties(e){o.LineDataSource._configureProperties(e);const t=[],i=[],s=e.childs();{const e=s.levels.childCount();for(let r=0;r<e;r++){const e=s.levels.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.fanlines.childCount();for(let r=0;r<e;r++){const e=s.fanlines.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.arcs.childCount()
|
||
;for(let r=0;r<e;r++){const e=s.arcs.childs()[r].childs();t.push(e.width),i.push(e.color)}}e.addChild("linesColors",new c.LineToolColorsProperty(i)),e.addChild("linesWidths",new c.LineToolWidthsProperty(t))}_correctScaleRatio(){const e=this.properties().childs(),t=this.getScaleRatio();e.scaleRatio.setValue(t)}_getAdjustedScaleRatio(){const e=this.model().mainSeries().priceScale(),t=this.model().timeScale();return Object(a.scaleRatio)(t,e)}_adjustScaleRatio(e){const t=e.scaleRatio.value();""!==t&&null!==t||e.scaleRatio.setValue(this._getAdjustedScaleRatio())}_correctPoint(e){if(this._points.length<2)return;const t=this.getIndexDiff();if(null===t)return;const i=this.properties().childs().scaleRatio.value();if(null!==i){const s=this._points[e],r=0===e?this._points[1]:this._points[0],n=s.price-r.price>0,o=s.index-r.index>0;let a=n&&!o||!n&&o?-1:1;0===e&&(a=-a),s.price=r.price+a*t*i,this._pointChanged.fire(e)}this.normalizePoints()}_correctFirstPoint(){this._correctPoint(this.isReversed()?0:1)}_handleRestoringFactoryDefaults(){this.properties().childs().scaleRatio.setValue(this._getAdjustedScaleRatio())}_handleTemplateApplying(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())}_migratePoint(){if(this.points().length<this.pointsCount())return;const e=this._getScreenPoints();if(null===e)return;const t=this.screenPointToPoint(e[1]);this.setPoint(1,t),this._pointAdded.unsubscribe(this,this._migratePoint)}_getScreenPoints(){const e=this._calcAngle();if(null===e)return null;let[t,i]=this.points();this.isReversed()&&([t,i]=[i,t]);const r=this.pointToScreenPoint(t)[0],n=this.pointToScreenPoint(i)[0],o=Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2)),a=new s.Point(Math.cos(e),-Math.sin(e)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1;return[r.addScaled(a,o),r.add(new s.Point(5*o*c,5*o*h))]}_calcAngle(){const[e,t]=this.points(),i=this.pointToScreenPoint(e)[0];let s=this.pointToScreenPoint(t)[0].subtract(i);if(s.length()>0){s=s.normalized();let e=Math.acos(s.x);return s.y>0&&(e=-e),e}return null}}},nda6:function(e,t,i){"use strict";i.r(t),i.d(t,"TimeSpanFormatter",(function(){return s}));i("YFKU");class s{format(e){const t=e<0;e=Math.abs(e);const i=Math.floor(e/86400);e-=86400*i;const s=Math.floor(e/3600);e-=3600*s;const r=Math.floor(e/60);e-=60*r;let n="";return i&&(n+=i+window.t("d",{context:"dates"})+" "),s&&(n+=s+window.t("h",{context:"dates"})+" "),r&&(n+=r+window.t("m",{context:"dates"})+" "),e&&(n+=e+window.t("s",{context:"dates"})+" "),t&&(n="-"+n),n.trim()}}},"ng+v":function(e,t,i){"use strict";i.r(t);var s=i("aO4+"),r=i("Eyy1"),n=i("FQhm"),o=i("txPx"),a=i("fgLi"),l=i("mMWL"),c=i("aIyQ"),h=i.n(c),u=i("tc+8"),d=i.n(u),p=i("j3hX");class _ extends d.a{constructor(e,t){super(),this._lineSource=e,this._pointIndex=t,e.pointAdded().subscribe(this,e=>{this._pointIndex===e&&this._listeners.fire(this)}),e.pointChanged().subscribe(this,e=>{this._pointIndex===e&&this._listeners.fire(this)})}value(){
|
||
const e=this._lineSource.points()[this._pointIndex].price,t=Object(r.ensureNotNull)(this._lineSource.ownerSource()).formatter();if(t.parse){const i=t.format(e),s=t.parse(i);return s.res?s.value:e}return e}setValue(e){const t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(""+e),this._lineSource.startChanging(this._pointIndex,t),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this);const i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i),this._lineSource.properties().lastUpdateTime.setValue((new Date).valueOf())}}var m=i("j8de"),f=i("LxhU"),g=i("dOnf"),v=i("Ocx9"),b=i("WkOR"),S=i("n5al"),y=i("H0vP");i.d(t,"LineDataSourceBase",(function(){return P}));const w=Object(o.getLogger)("Chart.LineDataSource");class C{constructor(){this._states=[]}start(e){this._states.push(e)}finish(e){const t=Object(r.ensureDefined)(this._states.pop());return s=t,(i=e).length!==s.length?{indexesChanged:!0,pricesChanged:!0}:i.reduce((e,t,i)=>{const r=s[i];return e.indexesChanged=e.indexesChanged||t.index!==r.index,e.pricesChanged=e.pricesChanged||t.price!==r.price,e},{indexesChanged:!1,pricesChanged:!1});var i,s}isEmpty(){return 0===this._states.length}}class P extends a.DataSource{constructor(e,t){super(),this._currentPointsetId=null,this._pointChanged=new h.a,this._pointAdded=new h.a,this._alertUndoMode=!1,this._priceAxisViews=[],this._timeAxisViews=[],this._timePoint=[],this._points=[],this._lastPoint=null,this._paneViews=new Map,this._normalizedPointsChanged=new h.a,this._changeStatesStack=new C,this._startMovingPoint=null,this._currentMovingPoint=null,this._fixedPoints=[],this._isActualSymbol=!1,this._isActualInterval=!1,this._isActualCurrency=!1,this._isActualUnit=!1,this._onIsActualIntervalChange=new h.a,this._model=e,this._properties=t,this.localAndServerAlertsMismatch=!1}destroy(){this._paneViews.forEach((e,t)=>this._destroyPanePaneViews(t))}timeAxisPoints(){return this.points()}priceAxisPoints(){return this.points()}normalizedPointsChanged(){return this._normalizedPointsChanged}widthsProperty(){var e;return null!==(e=this._properties.childs().linesWidths)&&void 0!==e?e:null}lineColorsProperty(){var e;return null!==(e=this._properties.childs().linesColors)&&void 0!==e?e:null}backgroundColorsProperty(){var e;return null!==(e=this._properties.childs().backgroundsColors)&&void 0!==e?e:null}textColorsProperty(){var e;return null!==(e=this._properties.childs().textsColors)&&void 0!==e?e:null}pointsProperty(){return this._pointsProperty}startMoving(e,t,i,s){this.isFixed()&&this.restoreFixedPoints(),this._startMovingPoint=e;this._properties.childs().lastUpdateTime.setValue((new Date).valueOf())}move(e,t,i,s){if(i&&(i.shiftOnly()||i.controlShift()))if(this.isFixed()){const t=this._alignScreenPointHorizontallyOrVertically(Object(r.ensureDefined)(e.screen));this._currentMovingPoint={screen:t}}else{const t=this._alignPointHorizontallyOrVertically(Object(r.ensureDefined)(e.logical));this._currentMovingPoint={logical:t}
|
||
}else this._currentMovingPoint=e;this.updateAllViews()}endMoving(e,t){let i=!1,s=!1;if(this._currentMovingPoint&&this._startMovingPoint){if(this.isFixed())this._correctFixedPoints(this._fixedPoints);else{const e=Object(r.ensureDefined)(this._currentMovingPoint.logical),t=Object(r.ensureDefined)(this._startMovingPoint.logical);i=e.index!==t.index,s=e.price!==t.price;if(this._correctPoints(this._points)){n.emit("drawing_event",this._id,"move");for(let e=0;e<this._points.length;e++)this._pointChanged.fire(e)}}this._startMovingPoint=null,this._currentMovingPoint=null}const o={indexesChanged:i,pricesChanged:s};return this.isFixed()?(this.calcPositionPercents(),this.updateAllViews(),o):(this.updateAllViews(),i&&!e?(this._properties.childs().interval.setValue(this._model.mainSeries().interval()),this.normalizePoints(),this.createServerPoints()):this._copyPricesWithoutNormalization(),(s||i)&&this.synchronizeAlert(!this._alertUndoMode),o)}startMovingPoint(){return this._startMovingPoint?Object.assign({},this._startMovingPoint):null}currentMovingPoint(){return this._currentMovingPoint?Object.assign({},this._currentMovingPoint):null}startChanging(e,t){void 0!==e&&void 0!==t&&(e<this._priceAxisViews.length&&this._priceAxisViews[e].setActive(!0),e<this._timeAxisViews.length&&this._timeAxisViews[e].setActive(!0)),this._properties.childs().lastUpdateTime.setValue((new Date).valueOf()),this._changeStatesStack.start(this.points())}endChanging(e,t){const i=this._changeStatesStack.finish(this.points());i.indexesChanged&&this._changeStatesStack.isEmpty()?(this._properties.childs().interval.setValue(this._model.mainSeries().interval()),this.normalizePoints(),t||this.createServerPoints()):this._copyPricesWithoutNormalization();for(let s=0;s<this._priceAxisViews.length;s++)this._priceAxisViews[s].setActive(!1);for(let s=0;s<this._timeAxisViews.length;s++)this._timeAxisViews[s].setActive(!1);return this.synchronizeAlert(!e),i}setPoint(e,t,i,s){if(i&&i.shift()&&"snapTo45Degrees"in this._properties){const i=0===e?1:e-1;this._snapPoint45Degree(t,this.points()[i])}this._points[e].index===t.index?(this._points[e].price=t.price,this._pointChanged.fire(e)):(this._points[e]=t,this._pointChanged.fire(e))}getPoint(e){return this.points()[e]||null}setLastPoint(e,t){this._lastPoint=this._preparePoint(e,t),this.updateAllViews()}lastPoint(){return this._lastPoint}getChangePointForSync(e){return this.getPoint(e)}setPoints(e){this._points=e}calcIsActualSymbol(){const e=this._model.mainSeries();if(e.hasDelayedSymbolIntervalChange())return;const t=this._properties.childs().symbol,i=t.value();if(this._isActualSymbol=e.symbolSameAsCurrent(i),this._isActualSymbol){const s=e.symbol();Object(b.areEqualSymbols)(i,s)||(w.logWarn('Possible drawing "migrating" detected from "'+i+'" to "'+s+'"'),w.logWarn("Series symbolInfo: "+JSON.stringify(e.symbolInfo())),w.logWarn(""+(new Error).stack)),t.setValue(s)}this.calcIsActualInterval(),this.calcIsActualCurrency(),this.calcIsActualUnit(),this._onSourceHiddenMayChange()}calcIsActualCurrency(){const e=this.ownerSource()
|
||
;if(null===e)return void(this._isActualCurrency=!1);const t=this._properties.childs().currencyId.value();if(null!==t){const i=e.symbolSource();if(null===i)return;this._isActualCurrency=t===Object(S.symbolCurrency)(i.symbolInfo(),void 0,!0)}else{const t=Object(r.ensureNotNull)(e.symbolSource()).symbolInfo();this._isActualCurrency=null!==t&&Object(S.symbolCurrency)(t)===Object(S.symbolOriginalCurrency)(t)}this._onSourceHiddenMayChange()}calcIsActualUnit(){const e=this.ownerSource();if(null===e)return void(this._isActualUnit=!1);const t=this._properties.childs().unitId.value();if(null!==t)this._isActualUnit=t===Object(r.ensureNotNull)(e.symbolSource()).unit();else{const t=Object(r.ensureNotNull)(e.symbolSource()).symbolInfo();this._isActualUnit=null!==t&&Object(S.symbolUnit)(t)===Object(S.symbolOriginalUnit)(t)}this._onSourceHiddenMayChange()}calcIsActualInterval(){const e=this._isActualInterval,t=this._properties,i=this._model.mainSeries(),s=f.Interval.parse(i.interval()),r=t.childs().intervalsVisibilities.childs();if(this._isActualInterval=!1,s.isTicks()&&(this._isActualInterval=r.ticks.value()),s.isSeconds()&&s.multiplier()<60){const e=r.seconds.value(),t=r.secondsFrom.value(),i=r.secondsTo.value();this._isActualInterval=e&&s.multiplier()>=t&&s.multiplier()<=i}if(s.isSeconds()&&s.multiplier()>=60){const e=Math.floor(s.multiplier()/60),t=r.minutes.value(),i=r.minutesFrom.value(),n=r.minutesTo.value();this._isActualInterval=t&&e>=i&&e<=n}if(s.isMinutes()&&s.multiplier()<60){const e=r.minutes.value(),t=r.minutesFrom.value(),i=r.minutesTo.value();this._isActualInterval=e&&s.multiplier()>=t&&s.multiplier()<=i}if(s.isMinutes()&&s.multiplier()>=60){const e=Math.floor(s.multiplier()/60),t=r.hours.value(),i=r.hoursFrom.value(),n=r.hoursTo.value();this._isActualInterval=t&&e>=i&&e<=n}if(s.isDays()){const e=r.days.value(),t=r.daysFrom.value(),i=r.daysTo.value();this._isActualInterval=e&&s.multiplier()>=t&&s.multiplier()<=i}if(s.isWeeks()){const e=r.weeks.value(),t=r.weeksFrom.value(),i=r.weeksTo.value();this._isActualInterval=e&&s.multiplier()>=t&&s.multiplier()<=i}if(s.isMonths()){const e=r.months.value(),t=r.monthsFrom.value(),i=r.monthsTo.value();this._isActualInterval=e&&s.multiplier()>=t&&s.multiplier()<=i}s.isRange()&&(this._isActualInterval=r.ranges.value()),!this._isActualInterval&&this._model.selection().isSelected(this)&&this._model.selectionMacro(e=>e.removeSourceFromSelection(this)),this._isActualInterval!==e&&this._onIsActualIntervalChange.fire(),this._onSourceHiddenMayChange()}paneViews(e){if(this.isSourceHidden())return null;const t=this._getPaneViews(this.isMultiPaneAvailable()?e:void 0);if(null===t)return null;if(1===t.length)return[t[0]];const i=[];for(let s=t.length-1;s>=0;--s)i.push(t[s]);return i}detachAlert(){const e=this.getAlertSync();if(e&&this._alertCallbacks){const t=this._alertCallbacks;e.off("destroy",t.remove),e.off("change:hovered",t.hovered),e.off("change:selected",t.selected)}this.hasAlert.setValue(!1)}start(){this.createServerPoints()}isActualSymbol(){return this._isActualSymbol}
|
||
isActualCurrency(){return this._isActualCurrency}isActualInterval(){return this._isActualInterval}isActualUnit(){return this._isActualUnit}onIsActualIntervalChange(){return this._onIsActualIntervalChange}setOwnerSource(e){null!==this._ownerSource&&(this._ownerSource.currencyChanged().unsubscribeAll(this),this._ownerSource.unitChanged().unsubscribeAll(this)),super.setOwnerSource(e),e&&(this.setPriceScale(e.priceScale()),e.currencyChanged().subscribe(this,this.calcIsActualCurrency),e.unitChanged().subscribe(this,this.calcIsActualUnit),this.calcIsActualCurrency(),this.calcIsActualUnit())}dataAndViewsReady(){return this._paneViews.size>0}pointAdded(){return this._pointAdded}pointChanged(){return this._pointChanged}addPoint(e,t,i){const s=this._preparePoint(e,t);return this._addPointIntenal(s,t,i)}restoreExternalPoints(e,t){if(this._timePoint=Object(g.deepCopy)(e.points),t.indexesChanged){if(this.properties().interval.setValue(e.interval),!this.isActualSymbol())return this._clearServerPoints(),void this._normalizedPointsChanged.fire();this.createServerPoints()}else{const t=Math.min(this._points.length,e.points.length);for(let i=0;i<t;i++)this._points[i].price=e.points[i].price;this._normalizedPointsChanged.fire()}}isSourceHidden(){return!this._properties.childs().visible.value()||Object(l.hideAllDrawings)().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol||!this._isActualCurrency||!this._isActualUnit}finish(){}tryCreateServerPoints(){this.isFixed()||this.isSourceHidden()||null===this._currentPointsetId&&this.createServerPoints()}stop(){this._clearServerPoints()}restart(){this.isFixed()||(this._currentPointsetId=null,this.createServerPoints())}isStarted(){return null!==this._currentPointsetId}convertYCoordinateToPriceForMoving(e,t){var i;const s=Object(r.ensureNotNull)(this.priceScale());if(s.isEmpty())return null;const n=this.ownerSource(),o=Object(r.ensure)(null===(i=n||t)||void 0===i?void 0:i.firstValue());return s.coordinateToPrice(e,o)}syncMultichartState(e){const t={points:this._timePoint,interval:this._model.mainSeries().interval()};if(this.linkKey&&this.isSynchronizable()){const i={model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:t,changes:e};Object(l.finishChangingLineTool)(i)}}enableCurrentIntervalVisibility(){let e=f.Interval.parse(this._model.mainSeries().interval());if(e.isTicks()&&this.properties().intervalsVisibilities.ticks.setValue(!0),e.isSeconds())if(e.multiplier()<60){this.properties().intervalsVisibilities.seconds.setValue(!0);const t=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),e.multiplier());this.properties().intervalsVisibilities.secondsFrom.setValue(t);const i=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),e.multiplier());this.properties().intervalsVisibilities.secondsTo.setValue(i)}else e=new f.Interval(f.ResolutionKind.Minutes,e.multiplier()/60);if(e.isMinutes())if(e.multiplier()<60){this.properties().intervalsVisibilities.minutes.setValue(!0)
|
||
;const t=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),e.multiplier());this.properties().intervalsVisibilities.minutesFrom.setValue(t);const i=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),e.multiplier());this.properties().intervalsVisibilities.minutesTo.setValue(i)}else{const t=Math.floor(e.multiplier()/60);this.properties().intervalsVisibilities.hours.setValue(!0);const i=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),t);this.properties().intervalsVisibilities.hoursFrom.setValue(i);const s=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),t);this.properties().intervalsVisibilities.hoursTo.setValue(s)}if(e.isDays()){this.properties().intervalsVisibilities.days.setValue(!0);const t=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),e.multiplier());this.properties().intervalsVisibilities.daysFrom.setValue(t);const i=Math.max(this.properties().intervalsVisibilities.daysTo.value(),e.multiplier());this.properties().intervalsVisibilities.daysTo.setValue(i)}if(e.isWeeks()){this.properties().intervalsVisibilities.weeks.setValue(!0);const t=Math.min(this.properties().intervalsVisibilities.weeksFrom.value(),e.multiplier());this.properties().intervalsVisibilities.weeksFrom.setValue(t);const i=Math.max(this.properties().intervalsVisibilities.weeksTo.value(),e.multiplier());this.properties().intervalsVisibilities.weeksTo.setValue(i)}if(e.isMonths()){this.properties().intervalsVisibilities.months.setValue(!0);const t=Math.min(this.properties().intervalsVisibilities.monthsFrom.value(),e.multiplier());this.properties().intervalsVisibilities.monthsFrom.setValue(t);const i=Math.max(this.properties().intervalsVisibilities.monthsTo.value(),e.multiplier());this.properties().intervalsVisibilities.monthsTo.setValue(i)}}updateLastUpdateTime(){this.properties().lastUpdateTime.setValue((new Date).valueOf())}clonePositionOffset(){return this.isFixed()?{barOffset:0,xCoordOffset:20,yCoordOffset:20}:{barOffset:0,xCoordOffset:0,yCoordOffset:-40}}_snapPoint45Degree(e,t,i){const s=this._model.timeScale(),n=s.indexToCoordinate(t.index),o=s.indexToCoordinate(e.index)-n,a=Object(r.ensureNotNull)(this.priceScale()),l=t.price,c=e.price,h=Object(r.ensureNotNull)(Object(r.ensureNotNull)(this.ownerSource()).firstValue()),u=a.priceToCoordinate(l,h),d=a.priceToCoordinate(c,h)-u,p=Math.round(Math.atan2(o,d)/Math.PI*4);if(2===Math.abs(p))i||(e.price=l);else if(0===Math.abs(p)||4===Math.abs(p))i||(e.index=t.index);else{const t=Math.sqrt(o*o+d*d),i=o<0?-1:1,r=d<0?-1:1;let l=Math.max(Math.abs(d),Math.abs(o));l/=l*Math.sqrt(2)/t;const c=Math.round(s.coordinateToIndex(n+l*i)),p=Math.abs(s.indexToCoordinate(c)-n),_=a.coordinateToPrice(u+p*r,h);e.index=c,e.price=_}}normalizePoint(e){return Object.assign(Object.assign({},this._model.timeScale().normalizeBarIndex(e.index)),{price:e.price})}normalizePoints(){this._timePoint=[];for(let e=0;e<this._points.length;e++)if(void 0!==this._points[e].index){const t=this.normalizePoint(this._points[e]);if(!t.time_t){this._timePoint=[]
|
||
;break}this._timePoint.push(t)}this._normalizedPointsChanged.fire()}_setPaneViews(e,t,i){this._paneViews.set(t,e),void 0!==t&&i&&t.onDestroyed().subscribe(this,()=>this._destroyPanePaneViews(t)),this._model.lightUpdate()}_getPaneViews(e){return this._paneViews.get(e)||null}_updateAllPaneViews(){this._paneViews.forEach(e=>{for(const t of e)t.update()})}_alignPointHorizontallyOrVertically(e){const t=this.pointToScreenPoint(e)[1],i=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._startMovingPoint).logical),s=this.pointToScreenPoint(i)[1],n=Math.abs(s.x-t.x),o=Math.abs(s.y-t.y);if(n<10&&o<10)return e;return{index:n<o?i.index:e.index,price:n<o?e.price:i.price}}_alignScreenPointHorizontallyOrVertically(e){const t=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._startMovingPoint).screen),i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return i<10&&n<10?e:i<n?new s.Point(t.x,e.y):new s.Point(e.x,t.y)}_correctPoints(e){const t=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._currentMovingPoint).logical),i=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._startMovingPoint).logical),s=t.index-i.index,n=t.price-i.price;if(0===s&&0===n)return!1;for(let r=0;r<e.length;r++){const t=e[r];t.index=t.index+s,t.price+=n,e[r]=t}return!0}_correctFixedPoints(e){const t=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._currentMovingPoint).screen),i=Object(r.ensureDefined)(Object(r.ensureNotNull)(this._startMovingPoint).screen),s=t.subtract(i);for(let r=0;r<e.length;r++)e[r]=e[r].add(s)}_currentPointsetIdWithPrefix(){return"pointset_"+this._currentPointsetId}_clearServerPoints(){null!==this._currentPointsetId&&this._model.chartApi().isConnected().value()&&this._model.chartApi().removePointset(this._currentPointsetIdWithPrefix()),this._currentPointsetId=null}_createPointProperty(e){const t=this._pointsProperty.childs().points;t.addProperty(""+e,{});const i=t[e];i.addChild("price",new _(this,e)),i.addChild("bar",new m.a(this,e))}_createPointsProperties(){this._pointsProperty=new d.a,this._pointsProperty.addChild("points",new d.a);for(let e=0;e<this.pointsCount();e++)this._createPointProperty(e)}_alignPointToRangeOfActualData(e){const t=Object(r.ensureNotNull)(this._model.mainSeries().bars().firstIndex()),i=Object(r.ensureNotNull)(this._model.mainSeries().bars().lastIndex());let s=Math.max(e.index,t);return s=Math.min(s,i),Object.assign(Object.assign({},e),{index:s})}_preparePoint(e,t){const i=e;return t&&t.shift()&&this.points().length>=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i}_addPointIntenal(e,t,i){this._points.push(e);const s=this._points.length===this.pointsCount();return s?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),s}_onSourceHiddenMayChange(){this._model.invalidate(y.InvalidationMask.validateAction(()=>{this._isDestroyed||this._processHibernate()}))}_processHibernate(){this.isSourceHidden()?this.isStarted()&&this.stop():this.isStarted()||this.start()}
|
||
static _addCollectedProperties(e){e.hasChild("linewidth")&&e.addChild("linesWidths",new p.LineToolWidthsProperty([Object(r.ensureDefined)(e.child("linewidth"))])),e.hasChild("linecolor")&&e.addChild("linesColors",new p.LineToolColorsProperty([Object(r.ensureDefined)(e.child("linecolor"))])),e.hasChild("backgroundColor")&&e.addChild("backgroundsColors",new p.LineToolColorsProperty([Object(r.ensureDefined)(e.child("backgroundColor"))])),e.hasChild("textColor")&&e.addChild("textsColors",new p.LineToolColorsProperty([Object(r.ensureDefined)(e.child("textColor"))])),e instanceof v.DefaultProperty&&(e.addExclusion("linesWidths"),e.addExclusion("linesColors"),e.addExclusion("backgroundsColors"),e.addExclusion("textsColors"))}_destroyPanePaneViews(e){const t=this._paneViews.get(e);if(void 0!==t)for(const i of t)i.destroy&&i.destroy();void 0!==e&&e.onDestroyed().unsubscribeAll(this),this._paneViews.delete(e)}_copyPricesWithoutNormalization(){const e=Math.min(this._points.length,this._timePoint.length);for(let t=0;t<e;t++)this._timePoint[t].price=this._points[t].price}}},o2pV:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionIndexes",(function(){return r}));var s=i("Eyy1");class r{constructor(e){this._baseIndex=null,this._offsetInBar=null,this._offsetInTime=null,this._barsBetweenPoints=null,this._timescale=e}indexes(){const e=this._timescale.visibleBarsStrictRange();if(null===e)return[];const t=e.firstBar(),i=e.lastBar();if(null===this._offsetInTime||null===this._barsBetweenPoints){const e=this._timescale.barSpacing();this._barsBetweenPoints=Math.floor(120/e),this._offsetInBar=i%this._barsBetweenPoints,this._offsetInTime=this._timescale.indexToTimePoint(this._offsetInBar),this._baseIndex=this._timescale.baseIndex()}const r=this._timescale.baseIndex();this._baseIndex!==r&&(this._baseIndex=r,this._offsetInBar=Object(s.ensureNotNull)(this._timescale.timePointToIndex(this._offsetInTime)));const n=Object(s.ensureNotNull)(this._offsetInBar),o=[];let a=Math.floor((t-n)/this._barsBetweenPoints);const l=Math.floor((i-n)/this._barsBetweenPoints);for(;a<=l;a++)o.push(n+a*this._barsBetweenPoints);return o}clear(){this._offsetInBar=null,this._offsetInTime=null,this._baseIndex=null,this._barsBetweenPoints=null}}},oIoN:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),this.version=n.version,i.e("lt-pane-views").then(i.t.bind(null,"pBAL",7)).then(({DisjointChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 3}name(){return"Disjoint Channel"}hasEditableCoordinates(){return!1}addPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),s.prototype.addPoint.call(this,e)}setLastPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),s.prototype.setLastPoint.call(this,e)}setPoint(e,t,i){var s=.5*(this._points[1].price+this._points[2].price);if(i&&i.shift()&&1===e){
|
||
this._snapPoint45Degree(t,this.points()[0])}if(e<3&&super.setPoint(e,t),0!==e&&2!==e){if(1===e){var r=this._points[1].price-s;this._points[2].price=this._points[1].price-2*r}else if(3===e){r=t.price-this._points[2].price;this._points[0].price=this._points[1].price-r,this._points[0].index=t.index}this.normalizePoints()}}getPoint(e){if(e<3)return s.prototype.getPoint.call(this,e);var t=this._points[0].price-this._points[2].price;return{index:this._points[0].index,price:this._points[1].price-t}}canHasAlert(){return!0}_getAlertPlots(){var e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));var s=this._points[2];s.time=t.time,s.index=t.index;var r,n,o,a,l={price:s.price+(t.price-e.price),time:e.time,index:e.index},c=[];s.index<=l.index?(c.push(s),c.push(l)):(c.push(l),c.push(s)),i[0].price>c[0].price?(r=i,n=c):c[0].price>i[0].price||c[1].price>i[1].price?(r=c,n=i):(r=i,n=c);var h=this.properties().extendLeft.value(),u=this.properties().extendRight.value();return e.index<=t.index?(o=h,a=u):(o=u,a=h),[this._linePointsToAlertPlot(r,"Upper",o,a),this._linePointsToAlertPlot(n,"Lower",o,a)]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"vm8R"))).GeneralTrendFiguresDefinitionsViewModel}static createProperties(e){var t=new r("linetooldisjointangle",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}n.version=1,t.LineToolDisjointChannel=n},oNDq:function(e,t,i){"use strict";i.r(t),i.d(t,"createConfirmDialog",(function(){return r}));var s=i("YFKU");async function r(e){const t={actions:[{key:13,name:"yes",text:s.t("Yes"),type:"success"},{method:"close",name:"no",text:s.t("No"),type:"default"}],actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',content:s.t("Are you sure?"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',destroyOnClose:!0,title:s.t("Confirmation"),width:400,dataset:{"dialog-type":"confirm-dialog"}},{createDialog:r}=await Promise.all([i.e("dialogs-core"),i.e(60),i.e(0),i.e(32),i.e("create-dialog")]).then(i.bind(null,"YDhE"));return r(Object.assign(Object.assign({},t),e))}},oV8k:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e,t){this._id=e,this._model=t}id(){return this._id}isHoveredEnabled(){return!0}isSelectionEnabled(){return!1}priceScale(){return null}paneViews(e){return[]}labelPaneViews(e){return[]}priceAxisViews(e,t){return[]}updateViewsForPane(e){e.containsMainSeries()&&this.updateAllViews()}}},oWyD:function(e,t,i){},oXaB:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"PriceAxisLastValueMode",(function(){return s})),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(s||(s={}))},ocLq:function(e,t,i){"use strict";(function(t){
|
||
var s=i("5B3K").StudyError,r=i("Y7w9"),n=i("ogJP").inherit,o=i("E6p6").SessionStage,a=i("LxhU").Interval,l=i("OLhd").createDwmAligner,c=i("OLhd").createTimeToBarTimeAligner,h=i("5fI3").decodeExtendedSymbol,u=i("5fI3").encodeExtendedSymbolOrGetSimpleSymbolString,d=function(){var e,d="undefined"!=typeof window?window:t,p=d.PineJsCalendar?d.PineJsCalendar:i("jCNj"),_=i("IiTo"),m=i("IDnv").extrapolateBarsFrontToTime,f={};function g(e,t,i,s,r){var n=r,o=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(var a=0;a<t;++a)s(e.get(a),n)&&(o=a,n=e.get(a));return{index:o,value:n}}function v(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=f.n(r),this._isNewBar=r.symbol.isNewBar;var 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))}function b(e,t,i){this._deviation=e;var s=i.new_var(f.high(i)),r=i.new_var(f.low(i));s.get(2*t+1),r.get(2*t+1),this._pivotHigh=new v(t,t,v.HIGH,s,i),this._pivotLow=new v(t,t,v.LOW,r,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=f.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed;var 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)}function S(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0,this.minimumAdditionalDepth=null}function y(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function w(e){y.call(this,e)}function C(e,t,i,s,r,n){var o=h(e);const l="string"==typeof o.symbol?o:o.symbol;this.ticker=l.symbol,this.currencyCode=i||l["currency-id"],this.unitId=s||l["unit-id"];var c=l["currency-id"]!==this.currencyCode||l["unit-id"]!==this.unitId;l["currency-id"]=this.currencyCode,l["unit-id"]=this.unitId,c&&(e=u(o)),this.tickerid=e;var d=a.parse(t);this.resolution=d.letter(),this.interval=d.multiplier(),this.period=d.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.isNewBar=!1,this.isBarClosed=!1,this.session=new _.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=r,this.isAdditionalDepthAllowed=void 0===o.type,this.bb_cache={},n&&this.set_symbolinfo(n)}function P(e,t,i,s,r,n,o,a,l,c){this.body=n,this.symbols=[],this.runner=r,this.inputCallback=a,this.out=o,this.nonseriesOut=l,this.ctx=new S(this.add_sym(e,t,i,s,c)),this.init()}function x(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.isStarted=!1,this.start()}function T(e){this.runner=new x(e)}function M(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTimeMs=0!==this.bars.length?this.bars[0].time:1/0}function I(e,t){this.period=e,this.generateEmptyBars=!!t}function L(){}
|
||
return f.max_series_default_size=10001,f.n=function(e){return e.symbol.index+1},f.nz=function(e,t){return t=t||0,isFinite(e)?e:t},f.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},f.isZero=function(e){return Math.abs(e)<=1e-10},f.toBool=function(e){return isFinite(e)&&!f.isZero(e)},f.eq=function(e,t){return f.isZero(e-t)},f.neq=function(e,t){return!f.eq(e,t)},f.ge=function(e,t){return f.isZero(e-t)||e>t},f.gt=function(e,t){return!f.isZero(e-t)&&e>t},f.lt=function(e,t){return!f.isZero(e-t)&&e<t},f.le=function(e,t){return f.isZero(e-t)||e<t},f.and=function(e,t){return isNaN(e)||isNaN(t)?NaN:f.isZero(e)||f.isZero(t)?0:1},f.or=function(e,t){return isNaN(e)||isNaN(t)?NaN:f.isZero(e)&&f.isZero(t)?0:1},f.not=function(e){return isNaN(e)?NaN:f.isZero(e)?1:0},f.eps=function(){return 1e-10},f.greaterOrEqual=function(e,t,i){return t-e<(i||1e-10)},f.lessOrEqual=function(e,t,i){return e-t<(i||1e-10)},f.equal=function(e,t,i){return Math.abs(e-t)<(i||1e-10)},f.greater=function(e,t,i){return e-t>(i||1e-10)},f.less=function(e,t,i){return t-e>(i||1e-10)},f.compare=function(e,t,i){return f.equal(e,t,i)?0:f.greater(e,t,i)?1:-1},f.max=Math.max,f.min=Math.min,f.pow=Math.pow,f.abs=Math.abs,f.log=Math.log,f.log10=function(e){return Math.log(e)/Math.LN10},f.sqrt=Math.sqrt,f.sign=function(e){return isNaN(e)?NaN:f.isZero(e)?0:e>0?1:-1},f.exp=Math.exp,f.sin=Math.sin,f.cos=Math.cos,f.tan=Math.tan,f.asin=Math.asin,f.acos=Math.acos,f.atan=Math.atan,f.floor=Math.floor,f.ceil=Math.ceil,f.round=Math.round,f.avg=function(e,t,i,s,r,n){if(2===arguments.length)return(e+t)/2;for(var o=0,a=0;a<arguments.length;a++)o+=arguments[a];return o/arguments.length},f.open=function(e){return e.symbol.open},f.high=function(e){return e.symbol.high},f.low=function(e){return e.symbol.low},f.close=function(e){return e.symbol.close},f.hl2=function(e){return(e.symbol.high+e.symbol.low)/2},f.hlc3=function(e){return(e.symbol.high+e.symbol.low+e.symbol.close)/3},f.ohlc4=function(e){return(e.symbol.open+e.symbol.high+e.symbol.low+e.symbol.close)/4},f.volume=function(e){return e.symbol.volume},f.updatetime=function(e){return e.symbol.updatetime},f.time=function(e,t,i){return e.symbol.bartime(t,i)},f.period=function(e){return e.symbol.period},f.tickerid=function(e){return e.symbol.tickerid},f.currencyCode=function(e){return e.symbol.currencyCode},f.unitId=function(e){return e.symbol.unitId},f.ticker=function(e){return e.symbol.ticker},f.interval=function(e){return e.symbol.interval},f.isdwm=function(e){return e.symbol.isdwm()},f.isintraday=function(e){return!e.symbol.isdwm()},f.isdaily=function(e){return"D"===e.symbol.resolution},f.isweekly=function(e){return"W"===e.symbol.resolution},f.ismonthly=function(e){return"M"===e.symbol.resolution},f.year=function(e){return f.timepart(e.symbol,p.YEAR,arguments[1])},f.month=function(e){return f.timepart(e.symbol,p.MONTH,arguments[1])},f.weekofyear=function(e){return f.timepart(e.symbol,p.WEEK_OF_YEAR,arguments[1])},f.dayofmonth=function(e){return f.timepart(e.symbol,p.DAY_OF_MONTH,arguments[1])},f.dayofweek=function(e){
|
||
return f.timepart(e.symbol,p.DAY_OF_WEEK,arguments[1])},f.hour=function(e){return f.timepart(e.symbol,p.HOUR_OF_DAY,arguments[1])},f.minute=function(e){return f.timepart(e.symbol,p.MINUTE,arguments[1])},f.second=function(e){return f.timepart(e.symbol,p.SECOND,arguments[1])},f.add_days_considering_dst=function(e,t,i){return p.add_days_considering_dst(p.get_timezone(e),t,i)},f.selectSessionBreaks=function(e,t){if(f.isdwm(e)||void 0===e.symbol.session.timezone)return[];var i=_.newBarBuilder(e.symbol.period,e.symbol.session),s=[],r=t.length;if(i.moveTo(t[r-1]),1===r&&i.startOfBar(0)===t[0])s.push(t[0]);else{for(var n=r-2;n>=0;--n){var o=t[n];if(!(o>=i.startOfBar(0))){i.moveTo(o);var a=t[n+1];s.push(a)}}s.reverse()}return s},f.iff=function(e,t,i){return f.not(e)?i:t},f.rising=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)>e.get(0))return 0;return 1},f.falling=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)<e.get(0))return 0;return 1},f.timepart=function(e,t,i){var s=p.utc_to_cal(e.timezone,i||e.bartime());return p.get_part(s,t)},f.rsi=function(e,t){return f.isZero(t)?100:f.isZero(e)?0:100-100/(1+e/t)},f.sum=function(e,t,i){var s=i.new_var(),r=f.nz(e.get())+f.nz(s.get(1))-f.nz(e.get(t));return s.set(r),r},f.sma=function(e,t,i){var s=f.sum(e,t,i);return f.na(e.get(t-1))?NaN:s/t},f.rma=function(e,t,i){var s=f.sum(e,t,i),r=t-1,n=e.get(r),o=i.new_var(),a=o.get(1),l=e.get(),c=f.na(n)?NaN:f.na(a)?s/t:(l+a*r)/t;return o.set(c),c},f.fixnan=function(e,t){var i=t.new_var();return isNaN(e)?i.get(1):(i.set(e),e)},f.tr=function(e,t){1===arguments.length&&(t=e,e=void 0);var i=void 0!==e&&!!e,s=t.new_var(f.close(t)),r=s.get(1);return i&&isNaN(r)&&(r=f.close(t)),f.max(f.max(f.high(t)-f.low(t),f.abs(f.high(t)-r)),f.abs(f.low(t)-r))},f.atr=function(e,t){var i=t.new_var(f.tr(t));return f.sma(i,e,t)},f.ema=function(e,t,i){var s=f.sum(e,t,i),r=i.new_var(),n=e.get(0),o=e.get(t-1),a=r.get(1),l=f.na(o)?NaN:f.na(a)?s/t:2*(n-a)/(t+1)+a;return r.set(l),l},f.wma=function(e,t,i){for(var s=0,r=t=Math.round(t);r>=0;r--){s+=(t-r)*e.get(r)}return 2*s/(t*(t+1))},f.vwma=function(e,t,i){var s=i.new_var(f.volume(i)),r=i.new_var(e.get(0)*f.volume(i));return f.sma(r,t,i)/f.sma(s,t,i)},f.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},f.lowestbars=function(e,t,i){return-g(e,t,0,(function(e,t){return f.lt(e,t)}),Number.MAX_VALUE).index},f.lowest=function(e,t,i){return g(e,t,0,(function(e,t){return f.lt(e,t)}),Number.MAX_VALUE).value},f.highestbars=function(e,t,i){return-g(e,t,0,(function(e,t){return f.gt(e,t)}),Number.MIN_VALUE).index},f.highest=function(e,t,i){return g(e,t,0,(function(e,t){return f.gt(e,t)}),Number.MIN_VALUE).value},f.cum=function(e,t){var i=t.new_var(),s=f.nz(i.get(1))+e;return i.set(s),s},f.accdist=function(e){var t=f.high(e),i=f.low(e),s=f.close(e),r=f.volume(e);return f.cum(s===t&&s===i||t===i?0:r*(2*s-i-t)/(t-i),e)},f.correlation=function(e,t,i,s){var r=f.sma(e,i,s),n=f.sma(t,i,s),o=s.new_var(e.get()*t.get());return(f.sma(o,i,s)-r*n)/Math.sqrt(f.variance2(e,r,i)*f.variance2(t,n,i))},f.stoch=function(e,t,i,s,r){
|
||
var n=f.highest(t,s),o=f.lowest(i,s);return f.fixnan(100*(e.get()-o)/(n-o),r)},f.tsi=function(e,t,i,s){var r=s.new_var(f.change(e)),n=s.new_var(f.abs(f.change(e))),o=s.new_var(f.ema(r,i,s)),a=s.new_var(f.ema(n,i,s));return f.ema(o,t,s)/f.ema(a,t,s)},f.cross=function(e,t,i){if(isNaN(e)||isNaN(t))return!1;var s,r=i.new_var((s=e-t)<0?-1:0===s?0:1);return!isNaN(r.get(1))&&r.get(1)!==r.get()},f.linreg=function(e,t,i){for(var s=0,r=0,n=0,o=0,a=0;a<t;++a){var l=e.get(a),c=t-1-a+1;s+=c,r+=l,n+=c*c,o+=l*c}var h=(t*o-s*r)/(t*n-s*s);return r/t-h*s/t+h+h*(t-1-i)},f.sar=function(e,t,i,s){var r=s.new_var(),n=s.new_var(),o=s.new_var(),a=f.high(s),l=f.low(s),c=f.close(s),h=s.new_var(a),u=s.new_var(l),d=s.new_var(c),p=s.new_var(),_=p.get(1),m=n.get(1),g=o.get(1);n.set(m),o.set(g);var v=!1,b=u.get(1),S=u.get(2),y=h.get(1),w=h.get(2),C=d.get(),P=d.get(1);2===f.n(s)&&(f.greater(C,P)?(r.set(1),o.set(h.get()),_=b,g=h.get()):(r.set(-1),o.set(u.get()),_=y,g=u.get()),v=!0,n.set(e),m=e);var x=_+m*(g-_);return 1===r.get()?f.greater(x,u.get())&&(v=!0,r.set(-1),x=Math.max(h.get(),o.get()),o.set(u.get()),n.set(e)):f.less(x,h.get())&&(v=!0,r.set(1),x=Math.min(u.get(),o.get()),o.set(h.get()),n.set(e)),v||(1===r.get()?f.greater(h.get(),o.get())&&(o.set(h.get()),n.set(Math.min(n.get()+t,i))):f.less(u.get(),o.get())&&(o.set(u.get()),n.set(Math.min(n.get()+t,i)))),1===r.get()?(x=Math.min(x,b),f.n(s)>2&&(x=Math.min(x,S))):(x=Math.max(x,y),f.n(s)>2&&(x=Math.max(x,w))),p.set(x),x},f.alma=function(e,t,i,s){for(var r=Math.floor(i*(t-1)),n=t/s*(t/s),o=[],a=0,l=0;l<t;++l){var c=Math.exp(-1*Math.pow(l-r,2)/(2*n));a+=c,o.push(c)}for(l=0;l<t;++l)o[l]/=a;var h=0;for(l=0;l<t;++l)h+=o[l]*e.get(t-l-1);return h},f.wvap=function(e,t){return e.get()-e.get(1)},f.change=function(e){return e.get()-e.get(1)},f.roc=function(e,t){var i=e.get(t);return 100*(e.get()-i)/i},f.dev=function(e,t,i){var s=f.sma(e,t,i);return f.dev2(e,t,s)},f.dev2=function(e,t,i){for(var s=0,r=0;r<t;r++){var n=e.get(r);s+=f.abs(n-i)}return s/t},f.stdev=function(e,t,i){var s=f.variance(e,t,i);return f.sqrt(s)},f.variance=function(e,t,i){var s=f.sma(e,t,i);return f.variance2(e,s,t)},f.variance2=function(e,t,i){for(var s=0,r=0;r<i;r++){var n=e.get(r),o=f.abs(n-t);s+=o*o}return s/i},f.percentrank=function(e,t){if(f.na(e.get(t-1)))return NaN;for(var i=0,s=e.get(),r=1;r<t;r++){var n=e.get(r);f.ge(s,n)&&i++}return 100*i/t},f.createNewSessionCheck=function(e){if(void 0===e.symbol.session.timezone)return function(){return!1};var t=_.newBarBuilder(e.symbol.period,e.symbol.session);return function(e){return t.indexOfBar(e)===o.POST_SESSION&&(t.moveTo(e),!0)}},f.error=function(e){throw new s(e)},v.LOW=0,v.HIGH=1,v.prototype.isPivotFound=function(){return-1!==this._pivotIndex.get()},v.prototype.pivotIndex=function(){return this._pivotIndex.get()},v.prototype.currentValue=function(){return this._currentValue.get()},v.prototype.pivotType=function(){return this._pivotType},v.prototype.reset=function(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)},
|
||
v.prototype.isRightSideOk=function(e){return e-this._currentIndex.get()===this._areaRight},v.prototype.isViolate=function(e,t){if(e<1||isNaN(this._currentValue.get()))return!0;var i=this._series.get(this._index-e);return!!isNaN(i)||(i===this._currentValue.get()?t:this._pivotType===v.HIGH?i>this._currentValue.get():i<this._currentValue.get())},v.prototype.processPoint=function(e){this.isViolate(e,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(e))},v.prototype.isRestartNeeded=function(e){return e-this._currentIndex.get()>this._areaRight},v.prototype.update=function(){if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(var e=!0,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(t=0;t<=this._areaRight;++t)this.processPoint(this._index-this._areaRight+t)}},b.prototype.addPivot=function(e,t,i){this._lastIndex.set(e),this._lastVal.set(t),this._lastType.set(i)},b.prototype.updatePivot=function(e,t){this._lastIndex.set(e),this._lastVal.set(t)},b.prototype.lastPrice=function(){return this._lastVal.get()},b.prototype.lastIndex=function(){return this._lastIndex.get()},b.prototype.addPoint=function(e,t,i){if(isNaN(this._lastVal.get()))this.addPivot(e,t,i);else{var s=this._lastVal.get();if(this._lastType.get()!==i)Math.abs(s-t)/t>this._deviation&&this.addPivot(e,t,i);else(i===v.HIGH?t>s:t<s)&&this.updatePivot(e,t)}},b.prototype.processPivot=function(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())},f.zigzag=function(e,t,i){return new b(e,t,i).lastPrice()},f.zigzagbars=function(e,t,i){var s=new b(e,t,i);return-1===s.lastIndex()?NaN:s.lastIndex()-f.n(i)},S.prototype.new_sym=function(e,t,i,s){return this.symbol.script.add_sym(e,t,i,s)},S.prototype.select_sym=function(e){this.symbol=this.symbol.script.get_sym(e)},S.prototype.new_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new y(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},S.prototype.new_unlimited_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new w(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},S.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new S(this.symbol)),this.ctx[this.ctx_index++]},S.prototype.prepare=function(e){this.ctx_index=0,this.vars_index=0;for(var t=0;t<this.vars.length;t++)this.vars[t].prepare(e);for(var i=0;i<this.ctx.length;i++)this.ctx[i].prepare(e)},S.prototype.maxAdditionalDepth=function(){if(null!==this.minimumAdditionalDepth)return this.minimumAdditionalDepth;for(var e=0,t=0;t<this.vars.length;t++){var i=this.vars[t].mindepth;!isNaN(i)&&i>e&&(e=i)}return e},S.prototype.stop=function(){this.symbol=null,this.vars=null},
|
||
S.prototype.setMinimumAdditionalDepth=function(e){this.minimumAdditionalDepth=e},y.prototype.valueOf=function(){return this.get(0)},y.prototype.get=function(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=f.max(this.mindepth,e),NaN)},y.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},y.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},y.prototype.prepare=function(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)},y.prototype.add_hist=function(){if(!this.hist){var e=f.na(this.mindepth)?f.max_series_default_size:f.max(this.mindepth+1,1);e=Math.round(e);for(var t=new Array(e),i=0;i<e;i++)t[i]=NaN;this.hist=t,this.hist_pos=-1}this.hist_pos=Math.min(this.hist_pos+1,this.hist.length),this.hist_pos===this.hist.length&&(this.hist_pos=this.hist.length-1,this.hist.shift(),this.hist.push(NaN)),this.hist[this.hist_pos]=this.original},y.prototype.adopt=function(e,t,i){this.hist||(this.mindepth=NaN);var s=t.get(),r=e.indexOf(s);if(0!==i){var n=t.get(1);if(!f.na(n))r=r===e.indexOf(n)?-1:r}return r<0?NaN:this._get(r)},y.prototype.indexOf=function(e){if(!this.hist)return this.mindepth=NaN,-1;if(f.na(e))return-1;var t=this.hist.length,i=this.symbol.index+1,s=Math.min(t,i),n=r.upperbound_int(this.hist,e,0,s);return 0===n?-1:s-n},n(w,y),w.prototype.add_hist=function(){if(this.hist||(this.hist=new Float64Array(2e3),this.hist_pos=-1),this.hist_pos=this.hist_pos+1,this.hist_pos===this.hist.length){var e=new Float64Array(2*this.hist.length);e.set(this.hist),this.hist=e}this.hist[this.hist_pos]=this.original},C.prototype.set_symbolinfo=function(e){for(var t in 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.timezone=p.get_timezone(e.timezone),this.session.init(e.timezone,e.session,e.holidays,e.corrections),this.other_sessions)this.other_sessions.hasOwnProperty(t)&&this.other_sessions[t].init(e.timezone,e.session,e.holidays,e.corrections)},C.prototype.get_session=function(e){if(!e)return this.session;var t=this.other_sessions[e];return t||(t=new _.SessionInfo("Etc/UTC","24x7"),this.other_sessions[e]=t),t},C.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution&&"T"!==this.resolution},C.prototype.enable_dwm_aligning=function(e,t){this.dwm_aligner=_.newBarBuilder(this.period,e,t)},C.prototype.bartime=function(e,t){var i=this.time;if(e){var s=e;t&&(s+=t);var r=this.bb_cache[s];if(!r){var n=this.get_session(t);r=_.newBarBuilder(e,n),this.bb_cache[s]=r}i=r.alignTime(i)}if(!this.isdwm()||isNaN(i))return i;var o=p.utc_to_cal(this.timezone,i);return this.session.spec.correctTradingDay(o),p.cal_to_utc(this.timezone,o)},C.prototype.lastbar=function(e){if(!isNaN(e.time)){var t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),
|
||
t=this.dwm_aligner.startOfBar(0));var 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,this.updatetime=e.updatetime,this.isNewBar=i,this.isBarClosed=e.isBarClosed,this.isLastBar=e.isLastBar,this.isNewBar&&(this.index++,this.isFirstBar=0===this.index),this.script.calc(this)}},P.prototype.calc=function(e){var t=this.ctx,i=this.body;t.prepare(e);var s=i.main(t,this.inputCallback,e);if(s&&"composite"===s.type)for(let r=0;r<s.data.length;++r)this._processResult(s.data[r]);else this._processResult(s)},P.prototype._processResult=function(e){var t=this.ctx,i=this;this.out&&e&&(!isNaN(t.symbol.time)||e.nonseries)&&(e.nonseries?("projection"===e.type&&(e.projectionTime=t.symbol.time),this.nonseriesOut(t.symbol,e)):e.bars?e.bars.forEach((function(e){i.out(t.symbol,e)})):this.out(t.symbol,e))},P.prototype.init=function(){var e=this.ctx,t=this.body;t.init&&t.init(e,this.inputCallback),t.main(e,this.inputCallback)},P.prototype.add_sym=function(e,t,i,s,r){var n=this.runner.add_sym(e,t,i,s,this,r);return this.symbols.push(n),n.isdwm()&&this.symbols.length>1&&n.enable_dwm_aligning(this.symbols[0].session,n.session),n},P.prototype.maxAdditionalDepth=function(){return this.symbols[0].isAdditionalDepthAllowed?this.ctx.maxAdditionalDepth():0},P.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},P.prototype.get_sym=function(e){return this.symbols[e]},x.prototype.add_sym=function(e,t,i,s,r,n){var o=new C(e,t,i,s,r,n);return this.symbols.push(o),o},x.prototype.get_sym=function(e){return this.symbols[e]},x.prototype.out=function(e,t){if(this.nonseriesUpdate){var 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)},x.prototype.start=function(){this.isStarted=!0;var e=this.host;this._script=new P(e.tickerid,e.period,e.currencyCode,e.unitId,this,e.body,this.out.bind(this),e.input,e.nonseriesOut,e.symbolInfo);var t=this,i=[],s=this.symbols,r=Object.assign({},e.dataRange,{countBack:e.dataRange.countBack+t._script.maxAdditionalDepth()}),n=s[0];function o(t,s,r){i.push(x.feed.subscribe(t.tickerid,t.currencyCode,t.unitId,t.period,r,e.onErrorCallback,e.symbolInfo,e.sessionId,s,e.forceAlignBars))}function h(i,s){"series"===(s.nonseries?"nonseries":"series")?t.update(i,s):s.lastBar?(t.nonseriesUpdate=s,s.lastBar.isLastBar=!0,t.symbols[0].lastbar(s.lastBar),t.nonseriesUpdate=null):e.nonseriesOut(p,s)}function u(){return r}o(n,u,(function(e){!e.nonseries&&Number.isFinite(e.firstLoadedTimeMs)&&function(e){function i(i,s){var r=c(i,s)(e),n=l(i,s);return null!==n&&(r=n.timeToExchangeTradingDay(r)),{to:r,countBack:t._script.maxAdditionalDepth()}}for(var r=1;r<s.length;r++){var u=s[r],d=u.period;a.isEqual(d,n.period)||o(u,i.bind(null,d),h.bind(null,r))}}(e.firstLoadedTimeMs),h(0,e)}));for(var d=1;d<s.length;d++){var p=s[d];a.isEqual(p.period,n.period)&&o(p,u,h.bind(null,d))}this.subscription=i},
|
||
x.prototype.stop=function(){var e=this.subscription;if(e||this._script){for(var t=0;t<e.length;t++)x.feed.unsubscribe(e[t]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null,this.isStarted=!1}else console.warn("Recurring script engine stop happened.")},x.prototype.update=function(e,t){if(t){var i=this.symbols[e];if(this.isRecalculated){var s=t.bar(t.count()-1);s.isBarClosed=t.isLastBarClosed(),s.isLastBar=!0,i.lastbar(s)}else this.barsets[e]||(this.barsets[e]=t,i.set_symbolinfo(t.symbolinfo()),this.recalc())}else console.error("Unexpected barset = null")},x.prototype.recalc=function(){for(var e=this.symbols,t=0;t<e.length;t++)if(!this.barsets[t])return;try{for(var i=e.length-1;i>=0;i--)for(var s=e[i],r=this.barsets[i],n=r.count(),o=0;o<n;o++){var a=r.bar(o);a.isLastBar=o===n-1,a.isBarClosed=!a.isLastBar||r.isLastBarClosed(),s.lastbar(a)}this.isRecalculated=!0,this.barsets[0]&&this.barsets[0].endOfData&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:this.barsets[0].endOfData,firstLoadedTimeMs:this.barsets[0].firstLoadedTimeMs})}catch(l){if(!l.studyError)throw l;this.host.onErrorCallback(l.message)}},x.feed={subscribe:function(e,t,i,s,r){console.error("must be initialized with setupFeed")},unsubscribe:function(e){console.error("must be initialized with setupFeed")}},T.prototype.stop=function(){this.runner.stop()},T.prototype.isStarted=function(){return this.runner.isStarted},M.prototype.symbolinfo=function(){return this.info},M.prototype.isLastBarClosed=function(){return this.isBarClosed},M.prototype.setLastBarClosed=function(e){this.isBarClosed=e},M.prototype.bar=function(e){return this.bars[e]},M.prototype.count=function(){return this.bars.length},M.prototype.add=function(e,t){var i=e,s=this.bars,r=s.length,n=i.time,o=0===r?NaN:s[r-1].time;0===r||o<n?s.push(i):o===n?s[r-1]=i:console.error("time order violation, prev: "+new Date(o).toUTCString()+", cur: "+new Date(n).toUTCString()),this.isBarClosed=!!t},I.prototype.init=function(e){this.bb=_.newBarBuilder(this.period,e.symbol.session),this.bbEmptyBars=this.generateEmptyBars?_.newBarBuilder(this.period,e.symbol.session):void 0,e.setMinimumAdditionalDepth(0)},I.prototype.extrapolate=function(e,t){return isNaN(e)||isNaN(t)?void 0:m(this.bbEmptyBars,e,t,Number.MAX_SAFE_INTEGER,!0).times},I.prototype.main=function(e){var t=e.symbol.time,i=this.bb.alignTime(t),s=e.new_var(i),r=f.na(i),n=s.get(1),o=f.na(n)?1:f.neq(i,n),a=e.new_var(),l=e.new_var(),c=e.new_var(),h=e.new_var(),u=a.get(1),d=l.get(1),p=c.get(1),_=h.get(1),m=r?NaN:o?f.open(e):u,g=r?NaN:o?f.high(e):f.max(f.high(e),d),v=r?NaN:o?f.low(e):f.min(f.low(e),p),b=r?NaN:f.close(e),S=r?NaN:o?f.volume(e):f.volume(e)+_,y=r?NaN:t,w=e.symbol.isBarClosed&&this.bb.isLastBar(0,t),C=this.generateEmptyBars&&o?this.extrapolate(n,i):void 0,P=e.new_var(f.close(e)).get(1),x=C instanceof Array?P:NaN;return a.set(m),l.set(g),c.set(v),h.set(S),[i,m,g,v,b,S,y,w,C,x]},L.prototype.main=function(e){return[f.open(e),f.high(e),f.low(e),f.close(e),f.volume(e),f.updatetime(e)]},{Std:f,Series:y,Symbol:C,
|
||
SymbolInfo:function(e,t){this.timezone=e||"America/New_York",this.session=t||"0000-0000"},StudyEngine:T,BarSet:M,OHLCV:L,BarBuilder:I,setupFeed:function(e){x.feed=e},getVolumeProfileResolutionForPeriod:function(t,i,s,r){return void 0!==e?e(t,i,s,r):t},overwriteVolumeProfileResolutionForPeriodGetter:function(t){e=t}}}();e.exports=d}).call(this,i("yLpj"))},ocrj:function(e,t,i){"use strict";i.r(t),i.d(t,"RemoveSourcesCommand",(function(){return u}));var s=i("Eyy1"),r=i("RDU5"),n=i("CW80"),o=i("txPx"),a=i("pQ+n"),l=i("3ClC"),c=i("jpZi");const h=Object(o.getLogger)("Chart.RemoveSourcesCommand");class u extends r.UndoCommand{constructor(e,t,i){super(i),this._excludeLineToolsUndoCommands=[],this._initialPriceScaleMode=null,this._chartModel=e,this._sourceIds=Object(a.a)(e,t).map(e=>e.id()),this._sourceStates=[],this._paneIndexes=[],this._priceScalePositionIds=[],this._paneStates=[],this._restorePanes=[];const r=t[0];1===t.length&&Object(l.isStudy)(r)&&(this._initialPriceScaleMode=Object(s.ensureNotNull)(r.priceScale()).mode())}removedIds(){return this._sourceIds}redo(){this._chartModel.panes().length;const e=this._sourceIds.map(e=>Object(s.ensureNotNull)(this._chartModel.dataSourceForId(e)));this._sourceStates=e.map(e=>Object(s.ensureNotNull)(e.state(!1)));const t=e.map(e=>Object(s.ensureNotNull)(this._chartModel.paneForSource(e)));this._paneIndexes=t.map(e=>this._chartModel.panes().indexOf(e));const i=this._chartModel.lineToolsGroupModel(),r=new Map;e.forEach(e=>{if(Object(n.isLineTool)(e)){const t=i.groupForLineTool(e);if(null!==t){const i=r.get(t)||[];i.push(e),r.set(t,i)}}}),r.forEach((e,t)=>{const i=new c.a(this._chartModel,t,e);i.redo(),this._excludeLineToolsUndoCommands.push(i)}),this._priceScalePositionIds=e.map((e,i)=>{if(Object(n.isLineTool)(e))return null;const s=e.priceScale();if(null===s)return null;const r=t[i].priceScalePosition(s);return{id:s.id(),position:r,priceScaleIndex:t[i].priceScaleIndex(s,r)}});const o=new Set;e.forEach((e,t)=>{Object(n.isLineTool)(e)||o.add(this._paneIndexes[t])}),this._paneStates=e.map((e,i)=>{const s=this._paneIndexes[i];return o.has(s)?t[i].state(!1,!0):null}),this._restorePanes=e.map(e=>this._chartModel.removeSource(e))}undo(){const e=[];for(let t=this._sourceStates.length-1;t>=0;t--){const i=this._chartModel.restoreSource(this._restorePanes[t],this._paneIndexes[t],this._paneStates[t],this._sourceStates[t],this._priceScalePositionIds[t]);i&&e.push(i)}e.some((t,i)=>t.id()!==this._sourceIds[e.length-i-1])&&h.logError("Source was restored improperly - source ids does not match"),null!==this._initialPriceScaleMode&&Object(s.ensureNotNull)(e[0].priceScale()).setMode(this._initialPriceScaleMode),this._excludeLineToolsUndoCommands.forEach(e=>e.undo())}}},odCa:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("fgLi").DataSource,n=i("tc+8"),o=i("Ocx9").DefaultProperty,a=i("jTis").CalloutConsts,l=i("j3hX").LineToolColorsProperty;class c extends s{constructor(e,t){super(e,t||c.createProperties()),this._barOffset=0,this._timeScale=e.timeScale(),
|
||
i.e("lt-pane-views").then(i.t.bind(null,"B4Hi",7)).then(({CalloutPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Callout"}_correctPoints(e){var t=this._currentMovingPoint.logical.index-this._startMovingPoint.logical.index,i=this._currentMovingPoint.logical.price-this._startMovingPoint.logical.price,s=e[1];s.index+=t,s.price+=i,e[1]=s}addPoint(e){var t=s.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t}_calculateBarOffset(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)}setLastPoint(e){super.setLastPoint(e),2===this.points().length&&this._calculateBarOffset()}setPoint(e,t){switch(e){case 0:super.setPoint(e,t),this._calculateBarOffset();break;case 1:var i=this.properties();if(!i.wordWrapWidth)return;var s=this._points,r=this._dragStartLeftEdgeIndex,n=Math.round((t.index-r)/2);if(isFinite(r)&&isFinite(n)){s[1]={index:r+n,price:s[1].price},this._calculateBarOffset(),this.normalizePoints();var o=this._timeScale.indexToCoordinate(r+2*n)-this._timeScale.indexToCoordinate(r)-a.RoundRadius-a.TextMargins;if(!isFinite(o))return;i.wordWrapWidth.setValue(Math.max(a.MinWidth,o));break}s[1]=t,this._calculateBarOffset(),this.normalizePoints()}}setPoints(e){super.setPoints(e);var t=this.properties();if(t.wordWrapWidth){var i=this._dragStartLeftEdgeIndex,s=Math.round((e[1].index-i)/2);if(this._calculateBarOffset(),this.normalizePoints(),isFinite(i)&&isFinite(s)){var r=this._timeScale.indexToCoordinate(i+2*s)-this._timeScale.indexToCoordinate(i)-a.RoundRadius-a.TextMargins;if(!isFinite(r))return;t.wordWrapWidth.setValue(Math.max(a.MinWidth,r))}}}_onPointsetUpdated(e){super._onPointsetUpdated(e),0!==e.length&&(this._dragStartLeftEdgeIndex=this.points()[1].index)}move(e,t,i){super.move(e,t,i),this._calculateBarOffset()}state(e){var t=s.prototype.state.call(this,e);return t.barOffset=this._barOffset,t}restoreData(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()}setPriceScale(e){r.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()}template(){var e=s.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_calculatePoint2(){if(!(this._model.lineBeingEdited()===this||this._model.sourcesBeingMoved().includes(this)||this._points.length<2)){var e=this.points()[0],t=this.points()[1];this._points[1]={price:t.price,index:e.index+this._barOffset}}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"xhf0"))).CalloutDefinitionsViewModel}static createProperties(e){var t=new o("linetoolcallout",e);return c._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.hasChild("text")||e.addChild("text",new n(window.t("Text"))),e.addExclusion("text"),e.addChild("textsColors",new l([e.childs().color]))}}t.LineToolCallout=c},
|
||
oiZD:function(e,t,i){"use strict";i.r(t);var s=i("hY0g"),r=i.n(s);i.d(t,"watchedTheme",(function(){return n})),i.d(t,"setTheme",(function(){return o}));const n=new r.a;function o(e){n.setValue(e)}n.subscribe(e=>{!function(e,t=window){const i="theme-"+e,s=t.document.documentElement.classList;for(const r of Array.from(s))r.startsWith("theme-")&&r!==i&&s.remove(r);s.add(i)}(e,window)})},okVO:function(e,t,i){"use strict";i.r(t),i.d(t,"SyncModel",(function(){return o}));var s=i("IiTo"),r=i("IDnv");let n=0;class o{constructor(e,t){this._extrapolatedData=[],this._cacheForFuture=!1,this._modelId=n++,this._builderCache=null,this._resolution=t,this._symbolInfo=e,this._valid=Boolean(e.timezone)&&Boolean(e.session),this._session=new s.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)}getSymbolInfo(){return this._symbolInfo}getSession(){return this._session}getResolution(){return this._resolution}uniqueId(){return this._modelId}distance(e,t){if(!this.isValid())return{success:!1};if(e>t)return{success:!1};if(e===t)return{success:!0,result:0};let i=this._extrapolatedData.length,s=0!==i?this._extrapolatedData[0]:null,n=null!==s?this._extrapolatedData[i-1]:null;const o=e<t;if(1e3*e===s&&this._cacheForFuture===o||(this._extrapolatedData=[1e3*e],i=1,s=null,n=null),null===s||null!==n&&1e3*t>n){const s=Object(r.extrapolateBarsFrontToTime)(this._barBuilder(),n||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length,this._cacheForFuture=o}if(n=this._extrapolatedData[i-1],n<1e3*t)return{success:!1};const a=this._extrapolatedData.indexOf(1e3*t);return-1===a?{success:!1}:{success:!0,result:a}}projectTime(e,t){if(!this.isValid())return e;let i=this._extrapolatedData.length,s=i>0?this._extrapolatedData[0]:null,n=null!==s?this._extrapolatedData[i-1]:null;const o=t>=0;1e3*e===s&&this._cacheForFuture===o||(this._extrapolatedData=[1e3*e],i=1,s=null,n=null);const a=Math.abs(t);if(null===s||a>=i){const s=Object(r.extrapolateBarsFrontByCount)(this._barBuilder(),n||1e3*e,Math.sign(t)*(a-i+1),!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length,this._cacheForFuture=o}return i<a?e:this._extrapolatedData[a]/1e3}isValid(){return this._valid}dataSize(){return this._extrapolatedData.length}_barBuilder(){return null===this._builderCache&&(this._builderCache=Object(s.newBarBuilder)(this._resolution,this._session,this._session)),this._builderCache}}},onDC:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aO4+"),n=i("vwKG"),o=i("4O8T"),a=i.n(o),l=i("0YCj"),c=i.n(l),h=i("txPx");const u=window.t("Move All Scales To Left"),d=window.t("Move All Scales To Right"),p=Object(h.getLogger)("Chart.MergeAllScales");var _=i("MY2c"),m=i("RDU5");class f extends m.UndoCommand{constructor(e,t,i,s,r,n){super(n),this._model=e,this._paneIndex=e.panes().indexOf(t),this._targetPosition=s,this._targetIndex=r,this._scaleId=i.id(),this._sourcePosition=t.priceScalePosition(i),"overlay"!==this._sourcePosition&&(this._sourceIndex=t.priceScaleIndex(i,this._sourcePosition))
|
||
}redo(){const e=this._model.panes()[this._paneIndex],t=Object(s.ensureNotNull)(e.getPriceScaleById(this._scaleId));e.movePriceScale(t,this._targetPosition,this._targetIndex),this._model.fullUpdate()}undo(){const e=this._model.panes()[this._paneIndex],t=Object(s.ensureNotNull)(e.getPriceScaleById(this._scaleId));e.movePriceScale(t,this._sourcePosition,this._sourceIndex),this._model.fullUpdate()}}var g=i("CW80");class v extends m.UndoCommand{constructor(e,t,i,s){super(s),this._createdIds=[],this._model=e,this._withoutShift=i,this._origStates=t.map(e=>e.state(!0));const r=e.lineToolsGroupModel();this._origGroups=t.map(e=>{const t=r.groupForLineTool(e);return t&&t.id})}redo(){const e=this._model.lineToolsGroupModel(),t=this._origStates.map((t,i)=>{const r=Object(s.ensureNotNull)(this._model.dataSourceForId(t.id)),n=0===this._createdIds.length?void 0:Object(s.ensureDefined)(this._createdIds[i]),o=Object(g.cloneLineTool)(this._model,r,!this._withoutShift,n),a=Object(s.ensureNotNull)(r.priceScale());Object(s.ensureNotNull)(this._model.paneForSource(r)).addDataSource(o,a,!1);const l=this._origGroups[i];if(null!==l){const t=e.groupForId(l);t&&t.addLineTools([o])}return this._model.updateSource(o),o});0===this._createdIds.length&&(this._createdIds=t.map(e=>e.id())),this._model.selectionMacro(e=>{e.clearSelection(),t.forEach(t=>{e.addSourceToSelection(t)})}),this._model.setShouldBeSavedEvenIfHidden(!0)}undo(){const e=this._model.lineToolsGroupModel();this._createdIds.forEach(t=>{const i=Object(s.ensureNotNull)(this._model.dataSourceForId(t)),r=e.groupForLineTool(i);null!==r&&r.excludeLineTool(i),this._model.removeSource(i)})}newIds(){return this._createdIds}}var b=i("ocrj"),S=i("jpZi"),y=i("Ltzl"),w=i("HGup"),C=i("jRfx"),P=i("s1Gx"),x=i("0qMc");class T extends m.UndoCommand{constructor(e,t,i,s,r=!0){super("Create "+x.lineToolsLocalizedNames[i],!1),this._lineId=null,this._lineState=null,this._model=e,this._paneIndex=e.panes().indexOf(t),this._lineTool=i,this._ownerSourceId=s.id(),this._needCopyToOtherCharts=r}startCreatingLine(e,t,i){const s=this._model.panes()[this._paneIndex],r=this._model.dataSourceForId(this._ownerSourceId),n=this._model.createLineTool(s,e,this._lineTool,t,i,r);return this._lineId=n.id(),!this._model.lineBeingCreated()}continueCreatingLine(e,t,i,s){const r=this._model.continueCreatingLine(e,t,i,s);return r&&this._model.setShouldBeSavedEvenIfHidden(!0),r}line(){return null===this._lineId?null:this._model.dataSourceForId(this._lineId)}undo(){const e=this.line();null!==e&&(this._lineState=e.state(!1),this._model.removeSource(e),this._lineId=null)}redo(){if(null===this._lineState)return;const e=this._model.restoreSource(!1,this._paneIndex,null,Object(s.ensureNotNull)(this._lineState),null);null!==e&&(this._lineId=e.id(),this._lineState=null)}needCopyToOtherCharts(){return this._needCopyToOtherCharts}}var M=i("GVQo");class I extends m.UndoCommand{constructor(e,t,i){super(i),this._sourcesByPanes=new Map,this._originalState=new Map,this._model=e,t.forEach(t=>{
|
||
const i=Object(s.ensureNotNull)(e.paneForSource(t)),r=e.panes().indexOf(i),n=this._sourcesByPanes.get(r)||[];n.push(t.id()),this._sourcesByPanes.set(r,n)}),Array.from(this._sourcesByPanes.keys()).forEach(t=>{const i=e.panes()[t],s=new Map;i.sourcesByGroup().allIncludingHidden().forEach(e=>{s.set(e.id(),e.zorder())}),this._originalState.set(t,s)})}undo(){this._originalState.forEach((e,t)=>{const i=this._model.panes()[t],r=new Map;e.forEach((e,t)=>{const n=Object(s.ensureNotNull)(i.dataSourceForId(t));r.set(n,e)}),i.setZOrders(r)})}redo(){this._sourcesByPanes.forEach((e,t)=>{const i=this._model.panes()[t],r=e.map(e=>Object(s.ensureNotNull)(i.dataSourceForId(e)));this._paneOperation(i,r)})}}class L extends I{constructor(e,t){super(e,t,`Bring ${t[0].title()} to front`)}_paneOperation(e,t){e.bringToFront(t)}}class O extends I{constructor(e,t){super(e,t,`Send ${t[0].title()} to back`)}_paneOperation(e,t){e.sendToBack(t)}}class A extends I{constructor(e,t,i,s){super(e,t,s),this._targetSource=i}_paneOperation(e,t){e.insertAfter(t,this._targetSource)}}class E extends A{constructor(e,t,i){super(e,t,i,`Insert ${t[0].title()} after ${i.title()}`)}}class k extends I{constructor(e,t,i,s){super(e,t,s),this._targetSource=i}_paneOperation(e,t){e.insertBefore(t,this._targetSource)}}class D extends k{constructor(e,t,i){super(e,t,i,`Insert ${t[0].title()} before ${i.title()}`)}}function V(e,t){const i=t[0],s=e.sourcesByGroup().all().filter(e=>e.zorder()<i.zorder());if(0===s.length)throw new Error("Cannot move backward source that alreadt on back");let r=s[s.length-1];if(Object(g.isLineTool)(r)){const t=e.model().lineToolsGroupModel().groupForLineTool(r);null!==t&&(r=t.lineTools()[0])}return r}class B extends k{constructor(e,t,i){super(e,i,V(t,i),`Send ${i[0].title()} backward`)}}function R(e,t){const i=t[t.length-1],s=e.sourcesByGroup().allExceptSpecialSources().filter(e=>e.zorder()>i.zorder());if(0===s.length)throw new Error("Cannot bring forward source that alreadt on back");let r=s[0];if(Object(g.isLineTool)(r)){const t=e.model().lineToolsGroupModel().groupForLineTool(r);if(null!==t){const e=t.lineTools();r=e[e.length-1]}}return r}class N extends A{constructor(e,t,i){super(e,i,R(t,i),`Send ${i[0].title()} backward`)}}function j(e,t){return Object(s.ensureNotNull)(e.paneForSource(t.lineTools()[0]))}class F extends k{constructor(e,t){super(e,t.lineTools(),V(j(e,t),t.lineTools()),`Send Group ${t.name()} backward`)}}class W extends A{constructor(e,t){super(e,t.lineTools(),R(j(e,t),t.lineTools()),`Bring Group ${t.name()} backward`)}}var H=i("ogJP");class z extends m.UndoCommand{constructor(e,t,i){super("Rearrange panes"),this._chartModel=e,this._index=t,Object(H.isNumber)(i)?this._dstIndex=i:this._dstIndex="up"===i?t-1:t+1}redo(){this._checkIndices()&&this._chartModel.movePane(this._index,this._dstIndex)}undo(){this._checkIndices()&&this._chartModel.movePane(this._dstIndex,this._index)}_checkIndices(){const e=this._chartModel.panes().length;return this._index>=0&&this._index<e&&this._dstIndex>=0&&this._dstIndex<e}}
|
||
var U=i("XcdR"),G=i("Fixu"),q=i("Ocx9"),Y=i("n5al"),K=i("PT1i"),J=i("pPtI");class Z extends m.UndoCommand{constructor(e,t,i,s,r,n){super(s),this._prevPriceAxisProps={},this._property=e,this._mainSeries=i,this._value=t,this._model=r,this._chartWidget=n}redo(){const e=this._mainSeries,t=e.properties();t.style===this._property&&e.isNeedRestart(this._value)&&this._chartWidget.screen.show(),this._prevResolution=t.interval.value(),this._prevValue=this._property.value(),this._storePriceAxisProps(),Object(q.saveDefaultProperties)(!0);const i=t.interval.value(),s=this._model.defaultResolutions(),r=Object(J.getResolutionByChartStyle)(this._value,i,s);K.linking.interval.setValue(r),e.setChartStyleWithIntervalIfNeeded(this._value,r),Object(Y.setLastUsedStyle)(this._value),Object(Y.preparePriceAxisProperties)(t),Object(q.saveDefaultProperties)(!1),this._invalidateModel()}undo(){const e=this._mainSeries;e.properties().style===this._property&&e.isNeedRestart(this._value)&&this._chartWidget.screen.show(),Object(q.saveDefaultProperties)(!0),e.setChartStyleWithIntervalIfNeeded(this._prevValue,this._prevResolution),this._restorePriceAxisProps(),K.linking.interval.setValue(this._prevResolution),Object(q.saveDefaultProperties)(!1),this._invalidateModel()}_storePriceAxisProps(){const e=this._mainSeries.priceScale();this._prevPriceAxisProps=e.mode()}_restorePriceAxisProps(){this._mainSeries.priceScale().setMode(this._prevPriceAxisProps)}_invalidateModel(){this._model&&(this._model.recalculateAllPanes(),this._model.lightUpdate())}}var X=i("ufwo"),$=i("LxhU");class Q extends m.UndoCommand{constructor(e,t){super("Change date range"),this._modelsData=[],this._rangeOptions=t,this._modelsData.push({model:e,prevResolution:e.mainSeries().properties().interval.value(),barSpacing:e.timeScale().barSpacing(),rightOffset:e.timeScale().rightOffset(),rangeOptions:e.appliedTimeFrame().value()})}redo(){const e=[];for(const t of this._modelsData){const i=t.model.mainSeries(),s=i.properties().interval;$.Interval.isEqual(this._rangeOptions.res,s.value())?i.loadDataTo(this._rangeOptions.val):(e.push(s),i.setDefaultTimeframe(this._rangeOptions.val),s.setValueSilently(this._rangeOptions.res))}for(const t of e)t.listeners().fire(t)}undo(){const e=[];for(const t of this._modelsData){const i=t.model.mainSeries(),s=i.properties().interval;t.prevResolution!==s.value()?(e.push(s),null!==t.rangeOptions&&i.setDefaultTimeframe(t.rangeOptions.val),s.setValueSilently(t.prevResolution)):null!==t.rangeOptions&&i.loadDataTo(t.rangeOptions.val);const r=t.model.timeScale();r.setBarSpacing(t.barSpacing),r.setRightOffset(t.rightOffset)}for(const t of e)t.listeners().fire(t)}canMerge(e){return e instanceof Q&&Object(X.rangesAreEqual)(e._rangeOptions,this._rangeOptions)}merge(e){if(!(e instanceof Q))throw new Error("Invalid command to merge");this._modelsData=this._modelsData.concat(e._modelsData)}}var ee=i("//lZ"),te=i("UqOQ");i("YFKU"),i("HbRj");class ie extends m.UndoCommand{constructor(e,t,i){super(i),this._model=e,this._groupId=t.id,this._groupName=t.name(),
|
||
this._lineToolsIds=t.lineTools().map(e=>e.id())}redo(){const e=Object(s.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId));this._model.lineToolsGroupModel().removeGroup(e)}undo(){const e=this._lineToolsIds.map(e=>this._model.dataSourceForId(e)),t=new te.a(e,this._groupName,this._groupId);this._model.lineToolsGroupModel().addGroup(t)}}const se=window.t("Create line tools group");class re extends m.UndoCommand{constructor(e,t){super(se),this._groupId=null,this._model=e,this._sourcesIds=t.map(e=>e.id())}redo(){const e=this._sourcesIds.map(e=>this._model.dataSourceForId(e)),t=null===this._groupId?void 0:this._groupId;this._groupId=this._model.lineToolsGroupModel().createGroup(e,this._title,t).id}undo(){const e=Object(s.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(Object(s.ensureNotNull)(this._groupId)));this._model.lineToolsGroupModel().removeGroup(e)}createdGroupId(){return this._groupId}}const ne=window.t("Add line tool(s) {lineTool} to group {group}");class oe extends m.UndoCommand{constructor(e,t,i){super(ne.format({group:t.name()})),this._model=e,this._groupId=t.id,this._lineToolsIds=i.map(e=>e.id())}redo(){const e=Object(s.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),t=this._lineToolsIds.map(e=>this._model.dataSourceForId(e));e.addLineTools(t)}undo(){const e=this._lineToolsIds.map(e=>this._model.dataSourceForId(e));Object(s.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)).excludeLineTools(e)}}var ae=i("bJYc");class le extends m.UndoCommand{constructor(e,t,i,s){super(s),this._chartModel=e,this._groupId=t.id,this._oldName=t.name(),this._newName=i}redo(){Object(s.ensureNotNull)(this._chartModel.lineToolsGroupModel().groupForId(this._groupId)).setName(this._newName)}undo(){Object(s.ensureNotNull)(this._chartModel.lineToolsGroupModel().groupForId(this._groupId)).setName(this._oldName)}}var ce=i("mMWL");const he=window.t("Create line tools group from selection"),ue=window.t("Removing line tools group {name}"),de=window.t("Add line tool {lineTool} to group {name}"),pe=window.t("Make group {group} visible"),_e=window.t("Make group {group} invisible"),me=window.t("Lock group {group}"),fe=window.t("Unlock group {group}"),ge=window.t("Rename group {group} to {newName}");class ve{constructor(e){this._environment=e}createGroupFromSelection(){const e=this._environment.model();Object(s.assert)(!e.selection().isEmpty(),"Cannot create group from empty selection");const t=Object(P.sortSources)(e.selection().lineDataSources());Object(s.assert)(t.length===e.selection().allSources().length,"A group could contain line tools only");const i=t.reduce((e,t)=>e.zorder()>t.zorder()?e:t,t[0]);let r=i;const n=e.lineToolsGroupModel().groupForLineTool(i);if(null!==n){const e=n.lineTools();r=e[e.length-1]}this._environment.beginUndoMacro(he);const o=new Map,a=new Set;t.forEach(t=>{const i=this._groupForLineTool(t);if(null===i)return;const r=o.get(i)||[];r.push(t),o.set(i,r);const n=Object(s.ensureNotNull)(e.paneForSource(t));a.add(n)}),
|
||
Object(s.assert)(a.size<=1,"All selected sources should be on the same pane"),o.forEach((t,i)=>{const s=new S.a(e,i,t);this._environment.pushUndoCommand(s)});const l=new re(e,Object(P.sortSources)(t));this._environment.pushUndoCommand(l);const c=new E(e,t,r);this._environment.pushUndoCommand(c),this._environment.endUndoMacro();const h=Object(s.ensureNotNull)(l.createdGroupId());return Object(s.ensureNotNull)(e.lineToolsGroupModel().groupForId(h))}removeGroup(e){const t=this._environment.model(),i=e.lineTools();this._environment.beginUndoMacro(ue.format({name:e.name()}));const r=new ie(t,e,"");this._environment.pushUndoCommand(r);const n=new b.RemoveSourcesCommand(t,i,"");this._environment.pushUndoCommand(n),i.forEach(e=>{null!==e.getLinkKey()&&Object(ce.removeLineTool)({model:t,linkKey:Object(s.ensureNotNull)(e.getLinkKey())})}),this._environment.endUndoMacro()}groups(){return this._environment.model().lineToolsGroupModel().groups()}excludeLineToolFromGroup(e,t){const i=this._environment.model(),s=new S.a(i,e,[t]);this._environment.pushUndoCommand(s)}addLineToolToGroup(e,t){const i=this._environment.model(),s=i.lineToolsGroupModel().groupForLineTool(t);if(s===e)return;const r=de.format({lineTool:t.title(),name:e.name()});this._environment.beginUndoMacro(r),null!==s&&this._environment.pushUndoCommand(new S.a(i,s,[t])),this._environment.pushUndoCommand(new oe(i,e,[t])),this._environment.endUndoMacro()}bringToFront(e){const t=this._environment.model(),i=new L(t,e.lineTools());this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])}sendToBack(e){const t=this._environment.model(),i=new O(t,e.lineTools());this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])}bringForward(e){const t=this._environment.model(),i=new W(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])}sendBackward(e){const t=this._environment.model(),i=new F(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])}insertAfter(e,t){const i=this._environment.model();let s;if(t instanceof te.a){const e=t.lineTools();s=e[e.length-1]}else s=t;const r=new E(i,e.lineTools(),s);this._environment.pushUndoCommand(r),this._environment.emitEvent("changeZOrder",[e.lineTools()])}insertBefore(e,t){const i=this._environment.model();let s;if(t instanceof te.a){s=t.lineTools()[0]}else s=t;const r=new D(i,e.lineTools(),s);this._environment.pushUndoCommand(r),this._environment.emitEvent("changeZOrder",[e.lineTools()])}availableZOrderOperations(e){const t=this._environment.model(),i=e.lineTools(),r=i[0],n=i[i.length-1],o=Object(s.ensureNotNull)(t.paneForSource(i[0])).sourcesByGroup().allExceptSpecialSources(),a=o[0],l=o[o.length-1];return{bringForwardEnabled:n!==l,bringToFrontEnabled:n!==l,sendBackwardEnabled:r!==a,sendToBackEnabled:r!==a}}setGroupVisibility(e,t){const i=(t?pe:_e).format({group:e.name()}),s=this._environment.model();this._environment.beginUndoMacro(i),e.lineTools().forEach(e=>{
|
||
const i=e.properties().visible,r=new ae.SetPropertyUndoCommand(i,t,"",s);this._environment.pushUndoCommand(r)}),this._environment.endUndoMacro()}setGroupLock(e,t){const i=(t?me:fe).format({group:e.name()}),s=this._environment.model();this._environment.beginUndoMacro(i),e.lineTools().forEach(e=>{const i=e.properties().frozen,r=new ae.SetPropertyUndoCommand(i,t,"",s);this._environment.pushUndoCommand(r)}),this._environment.endUndoMacro()}setGroupName(e,t){const i=this._environment.model(),s=ge.format({group:e.name(),newName:t}),r=new le(i,e,t,s);this._environment.pushUndoCommand(r)}canBeGroupped(e){const t=this._environment.model();return new Set(e.map(e=>t.paneForSource(e))).size<=1}_groupForLineTool(e){return this._environment.model().lineToolsGroupModel().groups().find(t=>t.containsLineTool(e))||null}}var be=i("3ClC"),Se=i("pQ+n");const ye=window.t("Apply study template {template}");class we extends m.UndoCommand{constructor(e,t,i){super(ye.format({template:i})),this._model=e,this._templateContent=t,this._initialState=e.studyTemplate(!0,!0),this._initialGroupsState=e.lineToolsGroupModel().state()}redo(){const e=this._merge(this._templateContent).filter(g.isLineTool);this._model.lineToolsGroupModel().removeLineTools(e),this._model.mainSeries().onChartStyleChanged();const t=this._model.mainSeries().properties();Object(Y.preparePriceAxisProperties)(t),this._model.recalcVisibleRangeStudies(!0),this._model.setShouldBeSavedEvenIfHidden(!0)}undo(){this._merge(this._initialState),this._model.mainSeries().onChartStyleChanged()}_merge(e){const t=this._model,i=t.mainSeries(),r=i.id();if(i.priceScale().properties().childs().lockScale.setValue(!1),this._initialState.symbol&&e.symbol&&i.properties().symbol.setValue(e.symbol),this._initialState.symbol&&e.interval){const t=Object(Y.getChartStyleByResolution)(e.interval,i.properties().style.value());i.setChartStyleWithIntervalIfNeeded(t,e.interval)}const n=t.panes(),o=[];for(let s=n.length;s--;){const e=n[s],t=e.containsMainSeries(),i=e.dataSources();for(let s=i.length;s--;){const e=i[s];(!t||Object(be.isStudy)(e)&&e.isRemovedByStudyTemplates())&&o.push(e)}}t.resetDeferredStudies();const a=Object(Se.a)(t,o);for(let s=0;s<a.length;++s)t.removeSource(a[s]);const l=e.panes;for(let s=0;s<l.length;s++){let r=-1;const o=Object(H.clone)(l[s]);o.sources.sort((e,t)=>e.zorder-t.zorder);for(let e=0;e<o.sources.length;e++){const t=o.sources[e];if("MainSeries"===t.type){delete t.state,r=e;break}}const a=r>-1,c=a?n[s]:t.createPane(s);if(a){const e=c.getZOrderMinMax(),t=o.sources[r],s=o.sources.slice(0,r);for(let i=0;i<s.length;i++)s[i].zorder=e.minZOrder-(s.length-i);t.zorder=i.zorder();const n=o.sources.slice(r+1);for(let i=0;i<n.length;i++)n[i].zorder=e.maxZOrder+i+1;o.sources=[...s,t,...n]}c.restoreState(o,!1,e.version),null!==c.mainDataSource()||t.removePane(c)}return Object(s.ensureNotNull)(t.paneForSource(i)).changeSourceId(i,r),t.syncESD(),i.priceScale().setMode({autoScale:!0}),t.setVersion(e.version),t.startNotStartedStudies(),t.recalculateAllPanes(),t.fullUpdate(),a}}
|
||
var Ce=i("e3/o"),Pe=i("/tGj");const xe=Object(h.getLogger)("Chart.ChartUndoModel");class Te extends m.UndoCommand{constructor(e,t,i){super("Paste Drawing"),this._needCopyToOtherCharts=!1,this._sourceState=null,this._model=e,this._clipboardData=t,this._paneIndex=this._model.panes().indexOf(i||Object(s.ensureNotNull)(this._model.paneForSource(this._model.mainSeries())))}redo(){const e=this._model.panes()[this._paneIndex],t=Object(s.ensureNotNull)(e.clipboardLineToolOwnerSource(this._clipboardData.source.id));null===this._sourceState&&(this._sourceState=this._getSourceState(t));const i=e.restoreLineTool(this._sourceState,!1,!1),r=Object(s.ensureNotNull)(t.priceScale());i.setOwnerSource(t),i.setPriceScale(r),r.addDataSource(i),i.restoreFixedPoints(),i.calcIsActualSymbol(),i.createServerPoints();const n=Object(Pe.isSymbolSource)(t)||t.metaInfo().is_price_study;this._needCopyToOtherCharts=Boolean(n&&(Object(ce.drawOnAllCharts)().value()||i.linkKey&&i.isSynchronizable())),this._model.setShouldBeSavedEvenIfHidden(!0)}undo(){if(!this._sourceState)return void xe.logError("This command was never executed - nothing to undo");const e=this.source();this._model.removeSource(e)}source(){return Object(s.ensureNotNull)(this._model.dataSourceForId(Object(s.ensureNotNull)(this._sourceState).id))}needCopyToOtherCharts(){return this._needCopyToOtherCharts}_getSourceState(e){const t=Object(H.clone)(this._clipboardData.source);delete t.state.symbol,null!=t.linkKey&&(t.linkKey=Object(Ce.randomHash)());const i=Object(s.ensureNotNull)(e.priceScale()),n=this._model;let o=!1;this._clipboardData.source.state.symbol===Object(s.ensureNotNull)(e.symbolSource()).symbol()&&(Object(Pe.isSymbolSource)(e)?o=!0:Object(be.isStudy)(e)&&(o=Boolean(e.metaInfo().is_price_study)));const a=e=>{const t=e.x*n.timeScale().width(),s=e.y*i.height()-40;return new r.Point(t,s)},l=Object(s.ensureNotNull)(e.firstValue());if(this._model.id()===this._clipboardData.modelId||!o)for(let s=0;s<this._clipboardData.geometry.length;++s){const e=a(this._clipboardData.geometry[s]),r=n.timeScale().coordinateToIndex(e.x),c=n.timeScale().normalizeBarIndex(r);if(o){const e=i.priceToCoordinate(t.points[s].price,l)+-40;c.price=i.coordinateToPrice(e,l)}else c.price=i.coordinateToPrice(e.y,l);t.points[s]=c}return t.id=Object(Ce.guid)(),t}}var Me=i("xo8u"),Ie=i("Yt+L"),Le=i("/ToI");class Oe extends m.UndoCommand{constructor(e,t,i){super("Change Symbol"),this._sourceId=e.id(),this._newSymbol=t,this._prevSymbol=e.symbol(),this._prevCurrency=e.currency(),this._prevUnit=e.unit(),this._chartWidget=i,this._showFade=e===i.model().mainSeries()}redo(){this._showFade&&this._chartWidget.screen.show(),this._currencyProperty().setValue(null),this._unitProperty().setValue(null),this._symbolSource().setSymbol(this._newSymbol)}undo(){this._showFade&&this._chartWidget.screen.show(),this._currencyProperty().setValue(this._prevCurrency),this._unitProperty().setValue(this._prevUnit),this._symbolSource().setSymbol(this._prevSymbol)}_currencyProperty(){return this._symbolSource().properties().currencyId}
|
||
_unitProperty(){return this._symbolSource().properties().unitId}_symbolSource(){return Object(s.ensureNotNull)(this._chartWidget.model().model().dataSourceForId(this._sourceId))}}var Ae=i("JWMC"),Ee=i("gaBL");const ke=Object(h.getLogger)("Chart.ChartUndoModel");class De extends m.UndoCommand{constructor(e,t,i){super("Paste Indicator"),this._sourceState=null,this._model=e,this._clipboardData=t,this._paneId=i}redo(){if(!this._sourceState){const e=Object(H.clone)(this._clipboardData.source);e.id=Object(Ce.guid)(),this._sourceState=e}let e,t;e=this._paneId?Object(s.ensureNotNull)(this._model.paneForId(this._paneId)):this._sourceState.metaInfo.is_price_study?Object(s.ensureNotNull)(this._model.paneForSource(this._model.mainSeries())):this._model.createPane();const i=!e.mainDataSource(),r=e.restoreStudy(this._sourceState,!1);this._sourceState.metaInfo.linkedToSeries&&r.setOwnerSource(this._model.mainSeries()),i||(t=this._sourceState.metaInfo.is_price_study?t=this._model.mainSeries().priceScale():this._paneId?e.findSuitableScale(r):e.defaultPriceScale(),t!==r.priceScale()&&e.move(r,t)),Object(be.isStudy)(r)&&r.start()}undo(){if(null===this._sourceState)return void ke.logError("This command was never executed - nothing to undo");const e=Object(s.ensureNotNull)(this._model.dataSourceForId(this._sourceState.id));this._model.removeSource(e)}state(){return this._sourceState}}class Ve extends m.UndoCommand{constructor(e,t,i,s,r){super("",!1),this._model=e,this._paneA=t,this._paneB=i,this._prevStretchA=s,this._currStretchA=r}redo(){const e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._currStretchA),this._paneB.setStretchFactor(e-this._currStretchA),this._model.fullUpdate()}undo(){const e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._prevStretchA),this._paneB.setStretchFactor(e-this._prevStretchA),this._model.fullUpdate()}}var Be=i("KnF9");class Re extends m.UndoCommand{constructor(e,t,i,s){super("Move",!1),this._endEvent=null,this._model=e,this._sourceId=t.id(),this._itemIndex=i,this._startEvent=s}move(e){this._endEvent=e,this._move(e)}hasChanges(){return null!==this._endEvent}undo(){this._move(this._startEvent)}redo(){this._move(Object(s.ensureNotNull)(this._endEvent))}_move(e){const t=Object(s.ensureNotNull)(this._model.dataSourceForId(this._sourceId));Object(s.assert)(void 0!==t.moveItem,'The method "moveItem" is not defined'),t.moveItem&&t.moveItem(new r.Point(e.localX,e.localY),this._itemIndex,new Be.EnvironmentState(e))}}class Ne extends m.UndoCommand{constructor(e,t,i,s,r,n,o,a,l,c,h,u){super(u),this._studyId=null,this._paneState=null,this._chartModel=e,this._studyMetaInfo=t,this._props=s,this._addAsOverlay=r,this._parentId=null==n?null:n.id(),this._inputs=i,this._targetZOrder=h,this._preferredPriceScale=o,this._allowChangeCurrency=a,this._allowChangeUnit=l,this._paneSize=c}redo(){
|
||
const e=null===this._parentId?void 0:this._chartModel.dataSourceForId(this._parentId),t=this._chartModel.insertStudyWithParams(this._studyMetaInfo,this._inputs,this._targetZOrder,this._props,this._addAsOverlay,e,this._preferredPriceScale,this._allowChangeCurrency,this._allowChangeUnit,this._paneSize,null===this._studyId?void 0:this._studyId);if(this._studyId=t.id(),t.childStudyByRebind().subscribe(null,()=>Object(Ae.trackEvent)("SOS","Apply SOS","Rebind SOS")),this._chartModel.setShouldBeSavedEvenIfHidden(!0),null!==this._paneState){Object(s.ensureNotNull)(this._chartModel.paneForSource(t)).restoreState(this._paneState,!1),this._paneState=null}}undo(){const e=Object(s.ensureNotNull)(this._chartModel.dataSourceForId(Object(s.ensureNotNull)(this._studyId))),t=Object(s.ensureNotNull)(this._chartModel.paneForSource(e)).state();this._chartModel.removeSource(e)&&(this._paneState=t)}insertedStudy(){return this._chartModel.dataSourceForId(Object(s.ensureNotNull)(this._studyId))}}var je=i("pOzK"),Fe=i("cWHH"),We=i.n(Fe),He=i("SwuQ"),ze=i("7MWe"),Ue=i("Kxc7");class Ge extends m.UndoCommand{constructor(e,t,i,s,r,n){super("Zoom"),this._timeScaleState=null,this._priceScaleState=null,this._model=e,this._startBar=t,this._endBar=i,this._startPrice=s,this._endPrice=r,this._pane=n}redo(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)}undo(){this._model.timeScale().restoreState(Object(s.ensureNotNull)(this._timeScaleState)),this._pane.defaultPriceScale().restoreState(Object(s.ensureNotNull)(this._priceScaleState)),this._model.recalculateAllPanes(),this._model.lightUpdate()}}const qe=Object(h.getLogger)("Chart.ChartUndoModel");class Ye extends m.UndoCommand{constructor(e,t,i){super("Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}undo(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void qe.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)}redo(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void qe.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}}}i.d(t,"ChartUndoModelBase",(function(){return Qe}));const Ke=window.t("Send {title} backward"),Je=window.t("Bring {title} forward"),Ze=window.t("Insert {title} after {target}"),Xe=window.t("Insert {title} before {target}");function $e(e,t){return{bringForwardEnabled:e.bringForwardEnabled||t.bringForwardEnabled,bringToFrontEnabled:e.bringToFrontEnabled||t.bringToFrontEnabled,sendBackwardEnabled:e.sendBackwardEnabled||t.sendBackwardEnabled,sendToBackEnabled:e.sendToBackEnabled||t.sendToBackEnabled}}class Qe extends a.a{constructor(e,t,i,s,r,n,o,a,l){super(),this._createLineCommand=null,this._initialTimeScrollState=null,this._initialTimeScrollPos=null,this._currentLineMoveCommand=null,
|
||
this._currentLineChangeCommand=null,this._currentCustomMoveCommand=null,this._zoomStack=new _.a,this._chartWidget=n,this.m_model=new We.a(e,t,i,s,r,this,a,l),this._undoHistory=o,this._lineToolsGroupController=new ve({model:this._model.bind(this),pushUndoCommand:this._pushUndoCommand.bind(this),beginUndoMacro:this._undoHistory.beginUndoMacro.bind(this._undoHistory),endUndoMacro:this._undoHistory.endUndoMacro.bind(this._undoHistory),emitEvent:this.emitEvent.bind(this)})}undoHistory(){return this._undoHistory}lineToolsGroupController(){return this._lineToolsGroupController}mergeAllScales(e){!function(e,t){e.beginUndoMacro("left"===t?u:d),e.model().panes().forEach(i=>{const s="left"===t?i.rightPriceScales():i.leftPriceScales(),r=("left"===t?i.leftPriceScales():i.rightPriceScales()).concat(s),n="overlay"===i.priceScalePosition(i.defaultPriceScale())?r[0]:i.defaultPriceScale();e.movePriceScale(i,n,t,0),r.forEach(t=>{if(t===n)return;let s=t.mainSource();for(;null!==s;){e.moveToScale(s,i,n,"",!0);const r=t.mainSource();if(r===s){p.logError("Loop detected while trying to merge scales");break}s=r}})}),e.endUndoMacro(),e.model().fullUpdate()}(this,e)}movePriceScale(e,t,i,s){const r=new f(this._model(),e,t,i,s,window.t("Move scale"));this._pushUndoCommand(r)}createLineTool(e,t,i,r,o,a,l){const c="Create "+x.lineToolsLocalizedNames[i];if(("LineToolRegressionTrend"===i||"LineToolAnchoredVWAP"===i)&&!this.canCreateStudy())return Object(n.showTooManyStudiesNotice)(),null;this.beginUndoMacro(c);const h=!l;this._createLineCommand=new T(this._model(),e,i,a||Object(s.ensureNotNull)(e.mainDataSource()),h);const u=this._createLineCommand.startCreatingLine(t,r,o||null),d=Object(s.ensureNotNull)(this._createLineCommand.line());let p=null;if(u&&(h&&this.finishLineTool(d),this._pushUndoCommand(this._createLineCommand),this._createLineCommand=null,p={points:d.normalizedPoints(),interval:this.mainSeries().interval()}),h&&void 0===o&&Object(ce.drawOnAllCharts)().value()&&d.isSynchronizable()){const e=Object(s.ensureNotNull)(this.model().externalTimeStamp(t.index)),r={point:{price:t.price,timeStamp:e},linetool:i,properties:d.properties(),symbol:this.mainSeries().symbol(),model:this.model(),linkKey:Object(s.ensureNotNull)(d.getLinkKey()),finalState:p};d.isFixed()&&(r.pointPositionPercents=d.calcPositionPercents()[0]),Object(ce.createLineTool)(r)}return this.endUndoMacro(),d}continueCreatingLine(e,t,i,r){const n=Object(s.ensureNotNull)(this._createLineCommand);this.beginUndoMacro(n.text());const o=Object(s.ensureNotNull)(this._model().lineBeingCreated()),a=n.continueCreatingLine(e,t,i,r);let l=null;if(a&&(this.finishLineTool(o),this._pushUndoCommand(n),this._createLineCommand=null,l={points:o.normalizedPoints(),interval:this.mainSeries().interval()}),n.needCopyToOtherCharts()&&Object(ce.drawOnAllCharts)().value()&&o.isSynchronizable()){const i=Object(s.ensureNotNull)(this._model().externalTimeStamp(e.index));Object(ce.continueLineTool)({point:{price:e.price,timeStamp:i},envState:t,finalState:l,model:this._model()})}return this.endUndoMacro(),a}
|
||
continueExternalLine(e,t,i){const r=Object(s.ensureNotNull)(this._createLineCommand),n=r.continueCreatingLine(e,t,i);return n&&(this._pushUndoCommand(r),this._createLineCommand=null),n}finishLineTool(e){this._model().finishLineTool(e)}loadRange(e){this._pushUndoCommand(new Q(this._model(),e))}zoomFromViewport(){const e=new Ye(Object(s.ensureDefined)(this._zoomStack.head()),this._zoomStack,!1);this._pushUndoCommand(e)}zoomToViewport(e,t,i,s,r){const n=new Ge(this.m_model,e,t,i,s,r),o=new Ye(n,this._zoomStack,!0);this._pushUndoCommand(o)}zoomStack(){return this._zoomStack}withMacro(e,t){const i=this.beginUndoMacro(e);try{t()}finally{this.endUndoMacro()}return i}canZoomIn(){return this.model().canZoomIn()}canZoomOut(){return this.model().canZoomOut()}zoomOut(){const e=this.timeScale().width();if(this.canZoomOut()){try{this.beginUndoMacro("Zoom Out")}catch(t){return}Object(ee.doAnimate)({to:e/5,onStep:e=>{this.startScaleTime(0),this.scaleTimeTo(e),this.endScaleTime()},onComplete:()=>this.endUndoMacro()})}}zoomIn(){const e=this.timeScale().width();if(this.canZoomIn()){try{this.beginUndoMacro("Zoom In")}catch(t){return}Object(ee.doAnimate)({to:e/5,onStep:e=>{this.startScaleTime(e),this.scaleTimeTo(0),this.endScaleTime()},onComplete:()=>this.endUndoMacro()})}}startMovingSources(e,t,i,s){e.filter(e=>e.doesMovingAffectsUndo()).length&&(this._currentLineMoveCommand=new y.SaveLineToolStateUndoCommand(this.model(),e,"Move Drawing(s)",!1)),this.model().startMovingSources(e,t,i,new Map,s)}moveSources(e,t){this.model().moveSources(e,new Map,t)}endMovingSource(e){this.model().endMovingSources(e),null!==this._currentLineMoveCommand&&(this._currentLineMoveCommand.saveNewState(),this._pushUndoCommand(this._currentLineMoveCommand)),this._currentLineMoveCommand=null}startChangingLinetool(e,t,i,s,r){this._currentLineChangeCommand=new y.SaveLineToolStateUndoCommand(this.model(),[e],"Change "+i+" point",!1),this.model().startChangingLinetool(e,t,i,s,r)}changeLinePoint(e,t){this.model().changeLinePoint(e,t)}endChangingLinetool(e){this.model().endChangingLinetool(e),null!==this._currentLineChangeCommand&&(this._currentLineChangeCommand.saveNewState(),this._pushUndoCommand(this._currentLineChangeCommand)),this._currentLineChangeCommand=null}setChartStyleProperty(e,t,i){if(e.value()!==t){const s=new Z(e,t,this.mainSeries(),i,this.model(),this.chartWidget());this._pushUndoCommand(s),this.emitEvent("setChartStyleProperty"),Object(G.a)(e.value())}}restoreState(e,t,i){return this.m_model.restoreState(e,t,i)}async clipboardCopy(e,t=this.selection().dataSources()){if(!Object(Ue.enabled)("datasource_copypaste"))return;for(const s of t)if(Object(be.isStudy)(s)&&s.isChildStudy())throw new Error("Can not copy child study");const i=Object(M.a)(this._model().id(),t);return null!==i?e.write({app:JSON.stringify(i),text:i.title}):void 0}async clipboardCut(e,t=this.selection().dataSources()){if(!Object(Ue.enabled)("datasource_copypaste"))return;await this.clipboardCopy(e,t);const i=1===t.length?"Cut "+t[0].title:"Cut sources";this.beginUndoMacro(i),
|
||
this.m_model.selectionMacro(()=>{this.removeSources(t,!1,i)}),this.endUndoMacro()}async clipboardPaste(e,t){let i=null;if(Object(Ue.enabled)("datasource_copypaste")&&(i=i||await e.read(),i.app)){const e=JSON.parse(i.app);this.pasteSourceFromClip(t,e)}}applyStudyTemplate(e,t){const i=new we(this._model(),e,t);this._pushUndoCommand(i)}startCustomMoving(e,t,i){this._currentCustomMoveCommand=new Re(this.model(),e,t,i)}customMoveBeingProcessed(){return null!==this._currentCustomMoveCommand}processCustomMove(e){Object(s.ensureNotNull)(this._currentCustomMoveCommand).move(e)}endCustomMoving(){null!==this._currentCustomMoveCommand&&this._currentCustomMoveCommand.hasChanges()&&(this._pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null)}cloneLineTools(e,t){for(let s=0;s<Math.min(5,e.length);++s)Object(G.b)(e[s]);this.beginUndoMacro(window.t("Clone line tools"));const i=new v(this._model(),e,t,window.t("Clone line tools"));if(this._pushUndoCommand(i),Object(ce.drawOnAllCharts)().value()){const e=i.newIds().map(e=>Object(s.ensureNotNull)(this.model().dataSourceForId(e)));this.copyToOtherCharts(e)}return this.endUndoMacro(),this.emitEvent("cloneLineTools"),i.newIds()}removeSource(e,t,i){if(this.lineBeingCreated()===e)return void this.cancelCreatingLine();const s="Remove "+e.title();this.removeSources([e],t,s,i)}removeSelectedSources(){const e=this._model().selection().dataSources();if(!e.length)return;const t=e.length>1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}removeSources(e,t,i,r){r||(e=e.filter(e=>e.isUserDeletable()));const n=this._model(),o=n.lineToolsGroupModel();this.beginUndoMacro(i),n.selectionMacro(r=>{const a=new Map;e.forEach(e=>{if(Object(g.isLineTool)(e)){const t=o.groupForLineTool(e);if(null!==t){const i=a.get(t)||[];i.push(e),a.set(t,i)}null!==e.getLinkKey()&&Object(ce.removeLineTool)({model:this.model(),linkKey:Object(s.ensureNotNull)(e.getLinkKey())})}}),a.forEach((e,t)=>{const i=new S.a(n,t,e);this._pushUndoCommand(i)});const l=new b.RemoveSourcesCommand(n,e,i),c=l.removedIds();this._pushUndoCommand(l),!t&&c.length>0&&(1===c.length?this.emitEvent("removeSource",[c[0]]):this.emitEvent("removeSources",[c]))}),this.endUndoMacro()}mergeSourceUp(e){const t=new C.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)}mergeSourceDown(e){const t=new C.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)}mergeToPane(e,t){const i=this._model().panes().indexOf(t),s=new C.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,s)}unmergeSourceUp(e){const t=new w.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)}unmergeSourceDown(e){const t=new w.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)}unmergeToNewBottomPane(e){const t=new w.b(this._model(),e,"Unmerge to new bottom pane");this._mergeUnmergeSource(e,t)}availableZOrderOperations(e){const t=this._model().lineToolsGroupModel(),i=e.filter(g.isLineTool),r=i.map(e=>t.groupForLineTool(e))
|
||
;Object(s.assert)(new Set(r).size<=1,"Cannot move line tools from different group");const n=0===r.length?null:r[0];let o={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1};const a=new Set(i);for(const l of Object(P.sortSources)(e)){if(Object(g.isLineTool)(l)&&null!==n){const e=Object(P.sortSources)(n.lineTools().filter(e=>!a.has(e)||e===l));o=$e(o,{bringForwardEnabled:l!==e[e.length-1],bringToFrontEnabled:l!==e[e.length-1],sendBackwardEnabled:l!==e[0],sendToBackEnabled:l!==e[0]});continue}const e=Object(s.ensureNotNull)(this._model().paneForSource(l)).sourcesByGroup().allExceptSpecialSources();if(0===e.length)continue;const t=l.zorder(),i=e[0].zorder(),r=e[e.length-1].zorder();o=$e(o,{bringForwardEnabled:t!==r,bringToFrontEnabled:t!==r,sendBackwardEnabled:t!==i,sendToBackEnabled:t!==i})}return o}sendToBack(e){if(!this.availableZOrderOperations(e).sendToBackEnabled)throw new Error("Send to back operation is unavailable");let t=null;const i=e[0];if(Object(g.isLineTool)(i)){const s=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==s){const i=s.lineTools();t=new D(this.model(),Object(P.sortSources)(e),i[0])}}null===t&&(t=new O(this.model(),Object(P.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])}bringToFront(e){if(!this.availableZOrderOperations(e).bringToFrontEnabled)throw new Error("Bring to front operation is unavailable");let t=null;const i=e[0];if(Object(g.isLineTool)(i)){const s=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==s){const i=s.lineTools();t=new E(this.model(),Object(P.sortSources)(e),i[i.length-1])}}null===t&&(t=new L(this.model(),Object(P.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])}sendBackward(e){if(!this.availableZOrderOperations(e).sendBackwardEnabled)throw new Error("Send backward operation is unavailable");const t=Ke.format({title:e[0].title()});this._sendBackOrBringForward(t,Object(P.sortSources)(e),(e,t)=>new B(this.model(),e,t))}bringForward(e){if(!this.availableZOrderOperations(e).bringForwardEnabled)throw new Error("Bring forward operation is unavailable");const t=Je.format({title:e[0].title()});this._sendBackOrBringForward(t,Object(P.sortSources)(e),(e,t)=>new N(this.model(),e,t))}insertAfter(e,t){e=Object(P.sortSources)(e);const i=Ze.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(i,e,t,()=>new E(this.model(),e,t))}insertBefore(e,t){e=Object(P.sortSources)(e);const i=Xe.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(i,e,t,()=>new D(this.model(),e,t))}detachToRight(e,t){Object(Ae.trackEvent)("Chart","Move to new right scale");const i=window.t("Move {title} To New Price Scale").format({title:e.title()}),s=new Le.b(this.model(),e,t,"right",i);this._pushUndoCommand(s),this.emitEvent("moveSource",[e])}detachToLeft(e,t){Object(Ae.trackEvent)("Chart","Move to new left scale");const i=window.t("Move {title} To New Left Scale").format({title:e.title()}),s=new Le.b(this.model(),e,t,"left",i)
|
||
;this._pushUndoCommand(s),this.emitEvent("moveSource",[e])}detachNoScale(e,t){Object(Ae.trackEvent)("Chart","Make source no scale");const i=window.t("Make {title} No Scale (Full Screen)").format({title:e.title()}),s=new Le.b(this.model(),e,t,"overlay",i);this._pushUndoCommand(s),this.emitEvent("moveSource",[e])}moveToScale(e,t,i,s,r){Object(Ae.trackEvent)("Chart","Move source to target scale"),this.beginUndoMacro(s);const n=new Le.a(this.model(),e,t,i,s),o=r?null:Object(Ee.sourceNewCurrencyOnPinningToPriceScale)(e,i,this._model()),a=r?null:Object(He.sourceNewUnitOnPinningToPriceScale)(e,i,this._model());this._pushUndoCommand(n),null!==o&&this.setPriceScaleCurrency(i,o),null!==a&&this.setPriceScaleUnit(i,a),this.endUndoMacro(),this.emitEvent("moveSource",[e])}startScrollTime(e){const t=this.timeScale();this._initialTimeScrollState={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()},this._initialTimeScrollPos=e,this.model().startScrollTime(e)}scrollTimeTo(e){let t=!1;return null!==this._initialTimeScrollPos&&null!==this._initialTimeScrollState&&Math.abs(e-this._initialTimeScrollPos)>20&&(this._pushUndoCommand(new U.a(this.model(),this._initialTimeScrollState,"Scroll Time")),this._initialTimeScrollPos=null,this._initialTimeScrollState=null,t=!0),this.model().scrollTimeTo(e),t}endScrollTime(){this.model().endScrollTime(),this._initialTimeScrollPos=null,this._initialTimeScrollState=null}startScaleTime(e){const t=this.timeScale(),i={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()};this._pushUndoCommand(new U.a(this.model(),i,"Scale Time")),this.model().startScaleTime(e)}scaleTimeTo(e){this.model().scaleTimeTo(e)}endScaleTime(){this.model().endScaleTime()}resetTimeScale(){const e=this.timeScale(),t={rightOffset:e.rightOffset(),barSpacing:e.barSpacing()};this._pushUndoCommand(new U.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()}startScalePrice(e,t,i){this._pushUndoCommand(new ze.PriceScaleChangeUndoCommand(this.model(),e,t,t.state())),this.model().startScalePrice(e,t,i)}scalePriceTo(e,t,i){this.model().scalePriceTo(e,t,i)}endScalePrice(e,t){this.model().endScalePrice(e,t)}resetPriceScale(e,t){this._pushUndoCommand(new ze.PriceScaleChangeUndoCommand(this.m_model,e,t,t.state())),this.model().resetPriceScale(e,t)}rearrangePanes(e,t){const i=new z(this._model(),e,t);this._pushUndoCommand(i)}movePane(e,t){const i=new z(this._model(),e,t);this._pushUndoCommand(i)}pasteSourceFromClip(e,t,i){const r=t;if(!r||0===r.sources.length)return null;const n=e||Object(s.ensureNotNull)(this.model().paneForSource(this.mainSeries()));if(!r.sources.some(e=>"drawing"!==e.type||null!==n.clipboardLineToolOwnerSource(e.source.id)))return null;this.beginUndoMacro("Paste "+r.title);let o=0;const a=[];for(const s of r.sources)if("drawing"===s.type&&null!==n.clipboardLineToolOwnerSource(s.source.id)){const e=this.pasteLineTool(n,s);o<5&&(Object(G.d)(e),o+=1),a.push(e)}else"study"===s.type&&s.source&&s.source.metaInfo&&this.checkIfFeatureAvailable(new c.a(s.source.metaInfo))&&a.push(this.pasteStudy(s,i?e:void 0))
|
||
;return this.endUndoMacro(),a}pasteLineTool(e,t){const i=new Te(this.model(),t,e);this._pushUndoCommand(i);const s=i.source();return i.needCopyToOtherCharts()&&this.copyToOtherCharts([s]),s}pasteStudy(e,t){const i=new De(this.model(),e,null==t?void 0:t.id());this._pushUndoCommand(i);const r=Object(s.ensureNotNull)(i.state()).id;return Object(s.ensureNotNull)(this._model().dataSourceForId(r))}setPriceScaleCurrency(e,t){const i=new Me.a(e,t,this.chartWidget(),"Change currency");this._pushUndoCommand(i)}setPriceScaleUnit(e,t){const i=new Ie.a(e,t,this.chartWidget(),"Change unit");this._pushUndoCommand(i)}setSymbol(e,t){e.symbol()!==t&&this._pushUndoCommand(new Oe(e,t,this.chartWidget()))}copyToOtherCharts(e){const t=this.mainSeries(),i=t.syncModel(),r=this.timeScale();if(i)for(const n of e){const e=n.linkKey||Object(Ce.randomHash)();n.linkKey=e;const i=n.state(!1),o=n.normalizedPoints().map(e=>{const t=Object(s.ensureNotNull)(r.timePointToIndex(e.time_t))+e.offset;return{price:e.price,timeStamp:Object(s.ensureNotNull)(this.model().externalTimeStamp(t))}}),a=Object.assign(Object.assign({},i),{linkKey:e,points:o,linetool:n.getType(),model:this.model(),symbol:t.symbol(),finalState:{points:n.normalizedPoints(),interval:t.interval()}});n.isFixed()&&(a.pointPositionPercents=n.calcPositionPercents()),Object(ce.copyLineTool)(a)}}addPaneStretchFactorUndoCommand(e,t,i,s){const r=new Ve(this.model(),e,t,i,s);this._pushUndoCommand(r)}moveSelectedToolsLeft(){return this._moveSelectedTools(2)}moveSelectedToolsUp(){return this._moveSelectedTools(0)}moveSelectedToolsRight(){return this._moveSelectedTools(3)}moveSelectedToolsDown(){return this._moveSelectedTools(1)}_mergeUnmergeSource(e,t){this.beginUndoMacro(t.text());const i=Object(s.ensureNotNull)(this._model().paneForSource(e)),r=new Set(i.sourcesByGroup().lineSources().filter(t=>t.ownerSource()===e));this._model().lineToolsGroupModel().groups().filter(e=>{const t=e.lineTools().some(e=>r.has(e)),i=e.lineTools().some(e=>!r.has(e));return t&&i}).forEach(e=>{this._pushUndoCommand(new S.a(this._model(),e,e.lineTools()))}),this._pushUndoCommand(t),this.endUndoMacro()}_insertStudy(e,t,i,r,n,o,a,l,c,h,u){const d="Insert "+e.description;this.beginUndoMacro(d);const p=new Ne(this.model(),e,t,i,r,n,o,a,l,c,h||null,d);this._pushUndoCommand(p);const _=p.insertedStudy();if(void 0!==u){const e=new je.SetPriceScaleModeCommand(u,Object(s.ensureNotNull)(_.priceScale()),"",this.model());this._pushUndoCommand(e)}return this.endUndoMacro(),_}_insertAfterOrBefore(e,t,i,r){const n=Object(s.ensureNotNull)(this._model().paneForSource(i));if(t.some(e=>Object(g.isLineTool)(e)&&this._model().paneForSource(e)!==n))throw new Error("Cannot insert line tool after target on another pane");this.beginUndoMacro(e),t.forEach(e=>{Object(s.ensureNotNull)(this.model().paneForSource(e))!==n&&this.mergeToPane(e,n)});const o=r();this._pushUndoCommand(o),this.emitEvent("changeZOrder",[t]),this.endUndoMacro()}_sendBackOrBringForward(e,t,i){const r=new Map;t.forEach(e=>{
|
||
const t=Object(s.ensureNotNull)(this._model().paneForSource(e)),i=r.get(t)||[];i.push(e),r.set(t,i)}),this.beginUndoMacro(e),r.forEach((e,t)=>{this._pushUndoCommand(i(t,e))}),this.endUndoMacro(),this.emitEvent("changeZOrder",[t])}_moveSelectedTools(e){const t=this.model().selection().lineDataSources();if(0===t.length)return!1;const i=this.timeScale().visibleBarsStrictRange();if(null===i)return!1;const s=new Map;for(const r of t){const e=r.ownerSource();if(null===e)continue;let t=s.get(e);if(void 0===t){const i=e.priceScale(),r=e.priceStep(),n=e.firstValue();if(null===i||null===r||null===n)continue;const o=i.priceRange();if(null===o)continue;t={sources:[],priceScale:i,priceStep:r,startPrice:o.minValue(),firstValue:n},s.set(e,t)}t.sources.push(r)}if(0===s.size)return!1;this.beginUndoMacro(window.t("Move Drawing(s)"));const n=i.firstBar(),o=this.timeScale().indexToCoordinate(n),a=n+(3===e?1:2===e?-1:0),l=this.timeScale().indexToCoordinate(a);return ce.isDirectionalMovementActive.setValue(!0),s.forEach(t=>{const{startPrice:i,priceStep:s,priceScale:c,firstValue:h}=t,u=i+(0===e?s:1===e?-s:0),d=c.priceToCoordinate(i,h),p=c.priceToCoordinate(u,h),_={logical:{index:n,price:i},screen:new r.Point(o,d)},m={logical:{index:a,price:u},screen:new r.Point(l,p)};this.startMovingSources(t.sources,_,null),this.moveSources(m),this.endMovingSource(!1)}),ce.isDirectionalMovementActive.setValue(!1),this.endUndoMacro(),!0}}},opke:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="currentcolor" d="m13.5 5a1 1 0 0 0 0 19 1 1 0 0 0 0-19m0 1a1 1 0 0 1 0 17 1 1 0 0 1 0-17zm2.31-.6A9.5 9.5 0 0 0 9 14.5a9.5 9.5 0 0 0 6.81 9.1l.99-.78A8.5 8.5 0 0 1 10 14.5a8.5 8.5 0 0 1 6.8-8.32"/></svg>'},p1SQ:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolHorzLinePriceAxisView",(function(){return r}));var s=i("KcY8");class r extends s.a{constructor(e){super(),this._source=e}_updateRendererData(e,t,i){e.visible=!1;const s=this._source.points(),r=this._source.priceScale();if(0===s.length||null===r||r.isEmpty())return;const n=s[0];if(!isFinite(n.price))return;const o=this._source.ownerSource(),a=null!==o?o.firstValue():null;if(null===a)return;const l=this._source.properties().linecolor.value();i.background=l,i.textColor=this.generateTextColor(l),i.coordinate=r.priceToCoordinate(n.price,a),e.text=r.formatPrice(n.price,a),e.visible=!0}}},pJOz:function(e,t,i){"use strict";i.r(t),i.d(t,"drawCircle",(function(){return h})),i.d(t,"drawArrow",(function(){return u})),i.d(t,"TrendLineRenderer",(function(){return d}));var s=i("Eyy1"),r=i("GEp6"),n=i("a7Ha"),o=i("VdBB"),a=i("jFln"),l=i("Zp/P"),c=i("gAom");function h(e,t,i,s,r){t.save(),t.fillStyle="#000000",t.beginPath(),t.arc(e.x*r,e.y*r,i*r,0,2*Math.PI,!1),t.fill(),s.strokeWidth&&(t.lineWidth=s.strokeWidth,t.stroke()),t.restore()}function u(e,t,i,s,r){if(t.subtract(e).length()<1)return;const n=Object(l.getArrowPoints)(e,t,s,!1);for(let o=0;o<n.length;++o){const e=n[o][0],t=n[o][1];Object(a.drawLine)(i,e.x*r,e.y*r,t.x*r,t.y*r)}}class d{constructor(){this._data=null,
|
||
this._hittest=new o.HitTestResult(o.HitTestResult.MOVEPOINT)}setData(e){this._data=e}setHitTest(e){this._hittest=e}draw(e,t){const i=this._data;if(null===i)return;if("points"in i&&i.points.length<2)return;if("floatPoints"in i&&i.floatPoints.length<2)return;const s=t.pixelRatio;e.lineCap="butt",e.strokeStyle=i.color,e.lineWidth=Math.max(1,Math.floor(i.linewidth*s)),Object(a.setLineStyle)(e,i.linestyle);const r="floatPoints"in i?i.floatPoints:i.points,n=r[0],o=r[1];let l=[];i.overlayLineEndings?l=[n.clone(),o.clone()]:this._drawEnds(e,[n,o],i.linewidth,s);const h=this._extendAndClipLineSegment(n,o,t);null!==h&&i.linewidth>0&&(h[0].x===h[1].x?Object(c.drawVerticalLine)(e,Math.round(h[0].x*s),h[0].y*s,h[1].y*s):h[0].y===h[1].y?Object(c.drawHorizontalLine)(e,Math.round(h[0].y*s),h[0].x*s,h[1].x*s):Object(a.drawLine)(e,h[0].x*s,h[0].y*s,h[1].x*s,h[1].y*s)),i.overlayLineEndings&&this._drawEnds(e,l,i.linewidth,s)}hitTest(e,t){const i=this._data;if(null===i)return null;if("points"in i&&i.points.length<2)return null;if("floatPoints"in i&&i.floatPoints.length<2)return null;const s=Object(l.interactionTolerance)().line,n="floatPoints"in i?i.floatPoints:i.points,o=n[0],a=n[1],c=this._extendAndClipLineSegment(o,a,t);if(null!==c){if(Object(r.distanceToSegment)(c[0],c[1],e).distance<=s)return this._hittest}return null}_extendAndClipLineSegment(e,t,i){const r=Object(s.ensureNotNull)(this._data);return Object(l.extendAndClipLineSegment)(e,t,i.cssWidth,i.cssHeight,r.extendleft,r.extendright)}_drawEnds(e,t,i,r){const o=t[0],a=t[1],l=Object(s.ensureNotNull)(this._data);switch(l.leftend){case n.LineEnd.Arrow:u(a,o,e,i,r);break;case n.LineEnd.Circle:h(o,e,i,Object(s.ensureDefined)(l.endstyle),r)}switch(l.rightend){case n.LineEnd.Arrow:u(o,a,e,i,r);break;case n.LineEnd.Circle:h(a,e,i,Object(s.ensureDefined)(l.endstyle),r)}}}},pKDv:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolABCD",(function(){return a}));var s=i("Eyy1"),r=i("Ocx9"),n=i("Ss5c"),o=i("j3hX");class a extends n.LineDataSource{constructor(e,t){const s=t||a.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"bFMU")).then(t=>{this._setPaneViews([new t.ABCDPaneView(this,e)])})}pointsCount(){return 4}name(){return"ABCD Pattern"}properties(){return super.properties()}static createProperties(e){const t=new r.DefaultProperty("linetoolabcd",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"aMeN")).then(e=>e.PatternWithoutBackgroundDefinitionsViewModel)}static _configureProperties(e){n.LineDataSource._configureProperties(e),e.addChild("linesColors",new o.LineToolColorsProperty([Object(s.ensureDefined)(e.child("color"))])),e.addChild("textsColors",new o.LineToolColorsProperty([Object(s.ensureDefined)(e.child("textcolor"))]))}}},pOzK:function(e,t,i){"use strict";i.r(t),i.d(t,"SetPriceScaleModeCommand",(function(){return n}));var s=i("Ocx9"),r=i("RDU5");class n extends r.UndoCommand{constructor(e,t,i,s){super(i),this._newMode=e,
|
||
this._priceScaleId=t.id(),this._model=s,this._oldMode=t.mode()}redo(){this._applyMode(this._newMode)}undo(){this._applyMode(this._oldMode)}_applyMode(e){const t=this._findPriceScaleById();null!==t&&(Object(s.saveDefaultProperties)(!0),t.setMode(e),Object(s.saveDefaultProperties)(!1),this._model&&(this._model.recalculateAllPanes(),this._model.lightUpdate()))}_findPriceScaleById(){const e=this._model.panes();for(let t=0;t<e.length;t++){const i=e[t].getPriceScaleById(this._priceScaleId);if(null!==i)return i}return null}}},pPtI:function(e,t,i){"use strict";i.r(t),i.d(t,"normalizeIntervalString",(function(){return m})),i.d(t,"isAvailable",(function(){return f})),i.d(t,"setLastUsedResolution",(function(){return g})),i.d(t,"getRangeResolution",(function(){return v})),i.d(t,"getTimeBasedResolution",(function(){return b})),i.d(t,"getDefaultResolution",(function(){return S})),i.d(t,"getResolutionByChartStyle",(function(){return y})),i.d(t,"getServerInterval",(function(){return w})),i.d(t,"isResolutionMultiplierValid",(function(){return C})),i.d(t,"getMaxResolutionValue",(function(){return x})),i.d(t,"getResolutionsFromSettings",(function(){return T})),i.d(t,"convertResolutionsFromSettings",(function(){return M})),i.d(t,"mergeResolutions",(function(){return I})),i.d(t,"sortResolutions",(function(){return L})),i.d(t,"getCustomResolutions",(function(){return E})),i.d(t,"getTranslatedResolution",(function(){return k})),i.d(t,"getTranslatedResolutionModel",(function(){return D})),i.d(t,"isSecondsEnabled",(function(){return B})),i.d(t,"isTicksEnabled",(function(){return R}));i("bSeV"),i("YFKU");var s=i("LxhU"),r=i("n5al"),n=i("Vdly"),o=i("PT1i"),a=i("IVMC"),l=i.n(a),c=i("ogJP"),h=i("Kxc7"),u=i.n(h);i("+GxX");const d={[s.ResolutionKind.Ticks]:1,[s.ResolutionKind.Seconds]:60,[s.ResolutionKind.Minutes]:1440,[s.SpecialResolutionKind.Hours]:24,[s.ResolutionKind.Days]:365,[s.ResolutionKind.Weeks]:52,[s.ResolutionKind.Months]:12,[s.ResolutionKind.Range]:1e5,[s.ResolutionKind.Invalid]:NaN},p={[s.ResolutionKind.Ticks]:0,[s.ResolutionKind.Seconds]:1,[s.ResolutionKind.Minutes]:2,[s.SpecialResolutionKind.Hours]:3,[s.ResolutionKind.Days]:4,[s.ResolutionKind.Weeks]:5,[s.ResolutionKind.Months]:6,[s.ResolutionKind.Range]:7,[s.ResolutionKind.Invalid]:8},_={[s.ResolutionKind.Invalid]:"",[s.ResolutionKind.Ticks]:window.t("T",{context:"interval_short"}),[s.ResolutionKind.Seconds]:window.t("s",{context:"interval_short"}),[s.ResolutionKind.Minutes]:window.t("m",{context:"interval_short"}),[s.SpecialResolutionKind.Hours]:window.t("h",{context:"interval_short"}),[s.ResolutionKind.Days]:window.t("D",{context:"interval_short"}),[s.ResolutionKind.Weeks]:window.t("W",{context:"interval_short"}),[s.ResolutionKind.Months]:window.t("M",{context:"interval_short"}),[s.ResolutionKind.Range]:window.t("R",{context:"interval_short"})};function m(e){return s.Interval.parse(e).value()}function f(e){const t=s.Interval.parse(e);if(!B()&&t.isSeconds())return!1;if(!R()&&t.isTicks())return!1;const i=t.value(),r=o.linking.supportedResolutions.value()
|
||
;return void 0!==r?void 0!==r.find(e=>m(e)===i):t.isSeconds()?Boolean(o.linking.seconds.value()):t.isTicks()?Boolean(o.linking.ticks.value()):t.isIntraday()?Boolean(o.linking.intraday.value()):t.isDWM()}function g(e){s.Interval.isValid(e)&&(s.Interval.isRange(e)?n.setValue("chart.lastUsedRangeResolution",e):n.setValue("chart.lastUsedTimeBasedResolution",e))}function v(e){const t=n.getValue("chart.lastUsedRangeResolution");if(void 0!==t&&s.Interval.isRange(t))return t;let i="100R";for(const r of e){const e=s.Interval.parse(r);if(e.isRange()){const t=e.value();if("100R"===t)return t;i=t}}return i}function b(e){const t=n.getValue("chart.lastUsedTimeBasedResolution");if(void 0!==t&&s.Interval.isTimeBased(t))return t;let i="1D";for(const r of e){const e=s.Interval.parse(r);if(e.isTimeBased()){const t=e.value();if("1D"===t)return t;i=t}}return i}function S(e){return e?"100R":"1D"}function y(e,t,i){const n=r.isRangeStyle(e),o=s.Interval.isRange(t);return!n&&o?b(i):n&&!o?v(i):t}function w(e){return s.Interval.isRange(e)?"1":e}function C(e){const t=s.Interval.parse(e),i=P(t.kind()),r=t.multiplier();return t.isValid()&&r<=i}function P(e){const t=d[e];return Number.isNaN(t)?1:t}function x(e){return P(s.Interval.kind(e))}function T(e){const t=M(n.getJSON(e,[]));return l()(t.filter(C).map(m))}function M(e){return Array.isArray(e)?e:Object.keys(e).map(s.Interval.normalize).filter(c.notNull)}function I(...e){let t=[].concat(...e);return t=l()(t.filter(C).map(m)),L(t)}function L(e){return e.sort(A)}function O(e){const t=s.Interval.parse(e),i=t.multiplier()||1;return t.isMinuteHours()?[s.SpecialResolutionKind.Hours,i/60]:[t.kind(),i]}function A(e,t){const[i,s]=O(e),[r,n]=O(t);return i!==r?p[i]-p[r]:s-n}function E(){return[]}function k(e){const{multiplier:t,shortKind:i}=D(e);return`${t}${i}`}function D(e,t){const i=s.Interval.parse(e);let r=i.multiplier(),n=i.kind();if(!i.isValid()){if(t)return null;throw new TypeError("Can't translate invalid interval")}return i.isMinuteHours()&&(r=Math.floor(r/60),n=s.SpecialResolutionKind.Hours),{multiplier:r.toString(),shortKind:V(n),hint:`${r} ${V(n,r)}`,mayOmitMultiplier:i.isDWM()&&1===r,mayOmitShortKind:i.isMinutes()&&!i.isMinuteHours()}}function V(e,t){if(!t)return _[e];switch(e){case s.ResolutionKind.Ticks:return window.t("tick",{plural:"ticks",count:t});case s.ResolutionKind.Days:return window.t("day",{plural:"days",count:t});case s.ResolutionKind.Weeks:return window.t("week",{plural:"weeks",count:t});case s.ResolutionKind.Months:return window.t("month",{plural:"months",count:t});case s.ResolutionKind.Seconds:return window.t("second",{plural:"seconds",count:t});case s.ResolutionKind.Minutes:return window.t("minute",{plural:"minutes",count:t});case s.SpecialResolutionKind.Hours:return window.t("hour",{plural:"hours",count:t});case s.ResolutionKind.Range:return window.t("range",{plural:"ranges",count:t});default:return e}}function B(){return u.a.enabled("seconds_resolution")}function R(){return u.a.enabled("tick_resolution")}},"pQ+n":function(e,t,i){"use strict";function s(e,t){
|
||
const i=new Set,s=t=>{e.children(t,!1).forEach(e=>{i.has(e)||(i.add(e),s(e))})};return t.forEach(s),t.filter(e=>!i.has(e)).map(t=>function e(t,i){let s=[];const r=t.children(i,!1);for(let n=0;n<r.length;n++)s=s.concat(e(t,r[n]));return s.push(i),s}(e,t)).reduce((e,t)=>e.concat(t),[])}i.d(t,"a",(function(){return s}))},pZll:function(e,t,i){"use strict";i.r(t);var s=i("eqEH");const r={id:"SymbolSearchUIService"};var n=i("u5Q5");class o{bindToInput(e,t){return Object(n.bindToInput)(e,t)}}var a=i("PT1i"),l=i("h24c");class c{constructor(){this._symbolGetter=null,this._deferredItems=[],this._symbolSearchActive=!1}setSymbolGetter(e){this._symbolGetter=e,this._deferredItems.forEach(t=>{this._bindToInputImpl(e,t.input,t.options)}),this._deferredItems=[]}bindToInput(e,t){return null===this._symbolGetter?this._deferredItems.push({input:e,options:t}):this._bindToInputImpl(this._symbolGetter,e,t),Promise.resolve({destroy:()=>{},acceptTypeIn:()=>{}})}_bindToInputImpl(e,t,i){const s=$(t);let r=(e,t)=>{};const n=()=>{s.blur(),this._symbolSearchActive||(this._symbolSearchActive=!0,i.currentSymbol=s.val(),e.getSymbol(i).then(e=>{s.blur(),s.trigger("accept-symbol",[e.symbol]),i.callback&&i.callback(e.symbol,e.interval),i.syncWithChartWidget&&!Object(l.skipAccept)(e.symbol,e.interval)&&r(e.symbol,e.interval),!0===i.clearAfterAccept?s.val(""):(""===s.val()&&i.onEmptyApply&&i.onEmptyApply(),s.val(e.symbol)),this._symbolSearchActive=!1}).catch(()=>{s.blur(),this._symbolSearchActive=!1}))},o=e=>{e.preventDefault(),n()};if(i.syncWithChartWidget){Object(l.syncSymbolSearch)(s,!0),a.linking.seriesShortSymbol.subscribe(()=>{Object(l.syncSymbolSearch)(s,!0)});let e=!1;r=(t,i)=>{e=!(t||i),t&&a.linking.symbol.setValue(t),i&&Object(l.setLinkingResolution)(i)},i.syncOnBlur&&s.on("blur",()=>{e&&(Object(l.syncSymbolSearch)(s,!0),e=!1)})}s.focus(n),s.keypress(o),s.keydown(o)}}function h(){return Object(s.service)(r)}i.d(t,"symbolSearchUIService",(function(){return h})),Object(s.hasService)(r)||(window.initData&&window.initData.is_mobile_new?Object(s.registerService)(r,new c):Object(s.registerService)(r,new o))},pvsv:function(e,t,i){"use strict";function s(e,t){Promise.all([i.e("react"),i.e(1),i.e(3),i.e(6),i.e(62),i.e(95),i.e(0),i.e(5),i.e("symbol-info-dialog-impl")]).then(i.t.bind(null,"1Z/g",7)).then(i=>{i.showSymbolInfoDialog(e,t)})}i.r(t),i.d(t,"showSymbolInfoDialog",(function(){return s}))},qE4g:function(e,t,i){"use strict";i.r(t);var s=i("hbEN"),r=i("aO4+"),n=i("f6yo"),o=i("Kxc7"),a=i("oV8k"),l=i("VdBB"),c=i("9uLv"),h=i("Tmoa"),u=i("//lZ"),d=i("gAom"),p=i("ikwP");const _=i("l7y7");var m=i("zDbI").CHART_FONT_FAMILY
|
||
;const f=o.enabled("adaptive_logo"),g=o.enabled("small_no_display"),v=o.enabled("38914"),b="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ","TradingView"),S="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ","TradingView"),y="by{3}{4}".format("",""," "," ","TradingView"),w=v?y:S,C=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,P=C&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,x=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),T=window.urlParams||{};window.initData;function M(e,t,i){const s=Object(p.createDisconnectedBoundCanvas)(document,new p.Size(t,i));return Object(p.getPrescaledContext2D)(s.canvas).drawImage(e,0,0,t,i),s}function I(e){return!f||e>500}T.no_referral_id&&enable(T.referral_id||"","aggressive");class L{constructor({layout:e="site_branding",symbol:t="",model:i,onReadyCallback:s}){this._model=i,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=e,this._symbol=t,this.showAnimatedBranding=o.enabled("show_animated_logo")||"widget_branding"===this._layout,this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=c.color.brandNew,this._colorOldBlue=c.color.brandNew2,this._colorOldGray=c.color.black30,this._strokeColor=c.color.black255,this._brandCircleShadowColor=c.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font="px "+m,this._txt="TradingView",this._onReadyCallback=s,this._upscaleRatio=x?1:2,this._verticalTextShift=C?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,this._init()}_init(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(_,"tvLogo"),this._createFillText()):this._loadImage(_,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}_updateStrokeColor(){const e=Object(h.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>.2?(this._brandCircleColor=c.color.black255,this._animatedColorBg=c.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=c.color.black27,this._animatedColorBg=c.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}_loadImage(e,t){this._needDisplayImage&&(this._image={canvas:new Image},this._image.canvas.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this._image.canvas.addEventListener("load",()=>{P&&(this._image=M(this._image.canvas,this._imageWidth,this._imageHeight)),this._imageReady=!0,"function"==typeof this._onReadyCallback&&this._onReadyCallback()}))}_checkLayout(){switch(this._layout){case"widget_branding":case"widget_referral_branding":case"widget_custom_branding":
|
||
case"fundamental_branding":case"fundamental_custom_branding":case"library_custom_branding":case"library_branding":case"site_branding":this.show=!0;break;case"widget_custom_no_powered_branding":case"fundamental_custom_no_powered_branding":case"library_custom_no_powered_branding":this.show=!1}switch(this._layout){case"library_branding":this._needDisplayImage=!0,this._txt=window.t(b);break;case"library_custom_branding":this._txt=window.t(w)}}_drawTextStroke(e){if(!this._strokeCanv){this._strokeCanv=Object(p.createDisconnectedBoundCanvas)(document,new p.Size(0,0));let e=Object(p.getPretransformedContext2D)(this._strokeCanv);const t=Math.round(this._strokeWidth*this._upscaleRatio);e.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=e.measureText(this._txt).width+2;let i=this._textWidth+2*t,s=(this._fontSize+2*t)*this._upscaleRatio;i%2==0&&(i+=1,s+=1),this._strokeCanv.resizeCanvas({width:i,height:s}),e=Object(p.getPretransformedContext2D)(this._strokeCanv),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.strokeStyle=this._strokeColor,e.lineWidth=this._strokeWidth*this._upscaleRatio,e.lineJoin="round",e.strokeText(this._txt,t,this._verticalTextShift)}e.save(),e.globalAlpha=this._strokeOpacity,e.drawImage(this._strokeCanv.canvas,0,0,this._strokeCanv.canvas.width,this._strokeCanv.canvas.height,0,0,this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio,this._strokeCanv.canvas.height/this._upscaleRatio/this._strokeCanv.pixelRatio),e.restore()}_drawTextFill(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv.canvas,0,0,this._fillCanv.canvas.width,this._fillCanv.canvas.height,0,0,this._fillCanv.canvas.width/this._upscaleRatio/this._fillCanv.pixelRatio,this._fillCanv.canvas.height/this._upscaleRatio/this._fillCanv.pixelRatio),e.restore()}_createFillText(){if(null!==this._fillCanv)return;this._fillCanv=Object(p.createDisconnectedBoundCanvas)(document,new p.Size(0,0));let e=Object(p.getPretransformedContext2D)(this._fillCanv);const t=Math.round(this._strokeWidth*this._upscaleRatio);e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)+2),this._setSizeFillTextCanvas(t),e=Object(p.getPretransformedContext2D)(this._fillCanv),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift)}_updateFillTextWithColor(e){const t=Math.round(this._strokeWidth*this._upscaleRatio);this._setSizeFillTextCanvas(t);const i=Object(p.getPretransformedContext2D)(this._fillCanv);i.clearRect(0,0,this._fillCanv.canvas.width,this._fillCanv.canvas.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}_setSizeFillTextCanvas(e){let t=this._textWidth+2*e,i=(this._fontSize+2*e)*this._upscaleRatio;t%2==0&&(t+=1,i+=1),this._fillCanv.resizeCanvas({width:t,height:i})}
|
||
_drawFillTextCropWidth(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv.canvas,0,0,t*this._upscaleRatio*this._fillCanv.pixelRatio,this._fillCanv.canvas.height,0,0,t,this._fillCanv.canvas.height/this._upscaleRatio/this._fillCanv.pixelRatio),e.restore()}_drawBgCircle(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}_drawFillRectWithRoundedCorner(e,t,i,s,r,n,o){e.save(),Object(d.drawRoundRect)(e,t-1,i-1,s+2,r+2,n),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),Object(d.drawRoundRect)(e,t,i,s,r,n),e.fillStyle=o,e.fill(),e.closePath(),e.restore()}_drawImageWithColor(e){e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image.canvas,0,-.5,this._imageWidth,this._imageHeight),e.restore()}destroy(){this._model.properties().paneProperties.background.unsubscribeAll(this),this._model.onChartThemeLoaded().unsubscribeAll(this)}bottomShift(){return this._bottomShift}hasAnimation(){return this.showAnimatedBranding}minimizedAnimationWidth(){return this._brandCircleSize}maximizedAnimationWidth(){return this._createFillText(),this._fillCanv.canvas.width/this._upscaleRatio/this._fillCanv.pixelRatio+this._brandCircleSize-3}animatedDrawStep(e,t){this._animatedWidth=t}draw(e,t){if(this.showAnimatedBranding){if(this._needDisplayImage&&this._imageReady){e.save();const t=(this._brandCircleSize-this._imageWidth)/2,i=(this._brandCircleSize-this._imageHeight)/2;e.translate(-t,-i),this._drawFillRectWithRoundedCorner(e,0,0,this._animatedWidth,this._brandCircleSize,this._brandCircleSize/2,this._animatedColorBg),e.translate(t,i),this._drawImageWithColor(e);const s=12+(x?-.5:0),r=this._imageWidth+s;this._animatedWidth>r&&(e.translate(this._imageWidth/2+s,.5),this._drawFillTextCropWidth(e,this._animatedWidth-r,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight}}else if("widget_custom_branding"===this._layout||"fundamental_custom_branding"===this._layout){const t="12px "+m;e.font=t;const i=e.measureText(this._txt).width+2;this.width=i+e.measureText("TradingView").width+2,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",i,12),e.restore()}else if(function(e){return!g||e>480}(t))if(this._needDisplayImage&&this._imageReady){e.save();const i=(this._brandCircleSize-this._imageWidth)/2;e.translate(i,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight);const s=12+(x?-.5:0);e.translate(this._imageWidth+s,-.5)
|
||
;const r=I(t);r&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+i,this.width+=r?s+this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio:i,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight}else{e.save(),e.translate(x?-.5:0,-.5);const i=I(t);i&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),i&&(this.width=this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio)}}}class O{constructor({layout:e="site_branding",src:t,onReadyCallback:i}){this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=e,this._src=t,this._onReadyCallback=i,this._init()}_init(){this._checkLayout(),this.show&&(this._img.src=this._src,this._img.addEventListener("load",()=>{this.width=Math.round(this._img.width),this.height=Math.round(this._img.height),P&&(this._img=M(this._img,this.width,this.height).canvas),this._ready=!0,"function"==typeof this._onReadyCallback&&this._onReadyCallback()}))}_checkLayout(){switch(this._layout){case"widget_custom_branding":case"widget_custom_no_powered_branding":case"fundamental_custom_branding":case"fundamental_custom_no_powered_branding":case"library_custom_branding":case"library_custom_no_powered_branding":this.show=!0;break;case"site_branding":case"widget_branding":case"widget_referral_branding":case"fundamental_branding":case"library_branding":this.show=!1}}draw(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}class A extends a.a{constructor(e,t,i,r){super(e,t),this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._showAllowance=i,this._showForPro=r,this._paneHeight=0,this._left=13,this._bottom=16,this._layout="site_branding",this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),"widget_custom_branding"!==this._layout&&"fundamental_custom_branding"!==this._layout||(this._left=8,this._bottom=5);const n=()=>{this._needToShow?this._showBranding=!0:this._showBranding=!1};this._resizeHandlerDelayed=Object(s.default)(n,200),n(),window.addEventListener("resize",this._resizeHandlerDelayed),this._monitorCanvas=Object(p.createDisconnectedBoundCanvas)(document,new p.Size(0,0)),this._monitorCanvas.subscribeCanvasConfigured(()=>{this._init()}),this._model.isSnapshot()?this._init():(this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),null!==this._mainSeries.symbolInfo()&&this._init()),this._cubicBezier=new c.CubicBezier(.4,.01,.22,1),this._renderer={draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}destroy(){window.removeEventListener("resize",this._resizeHandlerDelayed),this._mainSeries.dataEvents().symbolResolved().unsubscribeAll(this),this._powBy&&this._powBy.destroy()}_init(){const e=this._mainSeries.symbolInfo()||{};this._powBy&&this._powBy.destroy(),this._powBy=new L({layout:this._layout,symbol:e.name,model:this._model,onReadyCallback:()=>this._model.fullUpdate()}),this._custom=new O({layout:this._layout,src:this._customLogoSrc,
|
||
onReadyCallback:()=>this._model.fullUpdate()}),this._openAnimation=null,this._closeAnimation=null}_checkLayout(){if(o.enabled("widget"))0;else if(o.enabled("charting_library")||o.enabled("trading_terminal")){const e=JSON.parse(T.logo)||{};e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=o.enabled("widget_logo"),o.enabled("link_to_tradingview")?this._layout="library_custom_branding":this._layout="library_custom_no_powered_branding"):(this._layout="library_branding",this._needToShow=o.enabled("widget_logo"))}else this._layout="site_branding"}_startOpenAnimation(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),this._openAnimation=Object(u.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}_openLink(){if("site_branding"===this._layout)return!1;return window.open(this.tvUrl(),"_blank").opener=null,!0}_toggleOpenAnimatedOrOpenLink(){null!==this._openAnimation&&this._openAnimation.completed()?this._openLink()||this._startCloseAnimation():this._startOpenAnimation()}_startCloseAnimation(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=Object(u.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}onClickOutside(){this._hasAnimation()&&this._startCloseAnimation()}_currentStateForAnimation(){return this._powBy.width}_closedStateForAnimation(){return this._powBy.minimizedAnimationWidth()}_openedStateForAnimation(){return this._powBy.maximizedAnimationWidth()}_animatedDrawStep(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}_hasAnimation(){return this._powBy.hasAnimation()}updateAllViews(){}updateViewsForPane(e){}priceScale(){return null}priceAxisViews(){return[]}hasContextMenu(){return!1}hitTest(e){return!this._showBranding||o.enabled("logo_without_link")?null:this._powBy&&"widget_custom_no_powered_branding"!==this._layout&&"fundamental_custom_no_powered_branding"!==this._layout&&Object(n.pointInBox)(e,Object(r.box)(new r.Point(this._left,this._paneHeight-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)-this._bottom),new r.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom)))?new l.HitTestResult(l.HitTestResult.CUSTOM,{hideCrosshairLinesOnHover:!0,clickHandler:()=>{this._openLink()},tapHandler:()=>{this._hasAnimation()?this._toggleOpenAnimatedOrOpenLink():this._openLink()},mouseEnterHandler:()=>{this._hasAnimation()&&this._startOpenAnimation()},mouseLeaveHandler:()=>{this._hasAnimation()&&this._startCloseAnimation()}}):null}tvUrl(){let e="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink
|
||
;if("library_branding"===this._layout||"library_custom_branding"===this._layout){let t;switch(!0){case o.enabled("charting_library"):t="library";break;case o.enabled("trading_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",e+="utm_source="+window.location.origin+"&utm_medium=library"+(t?"&utm_campaign="+t:""),e}return e}draw(e,t){if(!this._showBranding)return;let i=0;T.utm=!0,Object(p.drawScaled)(e,t.pixelRatio,()=>{e.translate(-.5,-.5),this._powBy&&this._powBy.show&&(i=this._powBy.height-this._powBy.bottomShift(),e.save(),e.translate(this._left,this._paneHeight-this._bottom-i),this._powBy.draw(e,t,this._canvasWidth),e.restore()),this._custom&&this._custom.show&&(e.save(),e.translate(this._left,this._paneHeight-this._bottom-i-this._custom.height),this._custom.draw(e,t),e.restore())})}renderer(e,t){return this._paneHeight=e,this._canvasWidth=t,this._renderer}paneViews(e){if(TradingView.printing)return[];if(!this._showAllowance())return[];if("site_branding"===this._layout&&!this._showForPro&&window.user&&window.user.is_pro)return[];const t=o.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?[{renderer:this.renderer.bind(this)}]:[]}labelPaneViews(e){return[]}}function E(e,t){function i(t){const i=e.getAll();if(1===i.length)return!0;const s=i[0].model();return s&&s.model()===t}e.addCustomSource("branding",(e,s)=>new A(e,s,i.bind(null,s),t))}i.d(t,"addBrandingSource",(function(){return E}))},qJq3:function(e,t,i){"use strict";(function(e,s,r){TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7;var n=i("Eyy1").assert,o=i("Eyy1").ensureNotNull,a=i("lUQk").SeriesBase,l=i("tBG4").SeriesStatusView,c=i("cXAR").SeriesDataWindowView,h=i("gWck").SeriesLegendView,u=i("x0JF"),d=u.SeriesAreaPaneView,p=u.SeriesLinePaneView,_=u.SeriesHollowCandlesPaneView,m=u.SeriesCandlesPaneView,f=u.SeriesBarsPaneView,g=u.SeriesHeikenAshiPaneView,v=u.SeriesBaselinePaneView,b=i("9Jkk").SeriesHiLoPaneView,S=i("biIa").SeriesWaterlinePaneView,y=i("Kxc7"),w=i("BZtw").SeriesDataSource,C=i("ZJKN").BarsRange,P=i("38az").SeriesBarColorer,x=i("XPit").SeriesData,T=i("XPit").barFunction,M=i("k9/m"),I=M.PlotRowSearchMode,L=M.mergeMinMax,O=i("okVO").SyncModel,A=i("JWMC").trackEvent,E=i("txPx").getLogger("Chart.Series"),k=i("dfhE"),D=i("n5al"),V=i("pPtI"),B=V.getServerInterval,R=V.getResolutionByChartStyle,N=i("LxhU").Interval,j=i("WkOR").areEqualSymbols,F=i("WkOR").includesEqualSymbol,W=i("z+Sa").SeriesHorizontalBaseLinePaneView,H=i("Z8aO").SeriesPriceLinePaneView,z=i("FIi8").deepExtend,U=i("5fI3").encodeExtendedSymbolOrGetSimpleSymbolString,G=i("FQhm"),q=(i("qFKp").CheckMobile.any(),i("YWnQ").permissionDenied),Y=!y.enabled("hide_series_legend_item"),K=i("aKms").MarketStatusModel,J=i("2S76").DataUpdatedModeModel,Z=i("DsEq").DataProblemModel,X=i("hY0g"),$=i("uDHo").TIMEFRAMETYPE,Q=i("H0vP").InvalidationMask,ee=y.enabled("display_data_mode")
|
||
;class te extends a{constructor(t,s,r,n){var o=i("OK+B");s.removeProperty("currencyId"),super(t,s,r),this._boxSizeValue=new X,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this.chartWidgetInitialized=new e,this._onStyleChanged=new e,this._onStatusChanged=new e,this._onRestarted=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this._onInReplayStateChanged=new e,this._replayExitedDueUnsupportedInterval=new e,this._replayExitedDueUnavailableForUserInterval=new e,this._onTimeFrameApplied=new e,this.m_model=t,this._chartApi=t._chartApi,this.m_data=null,this._prevChartStyle=s.style.value(),this._seriesSource=new w(t._chartApi,"s",n);var a=this._seriesSource.dataEvents();a.symbolResolved().subscribe(this,this._onSymbolResolved),a.symbolError().subscribe(this,this._onSymbolError),a.seriesTimeFrame().subscribe(this,this._onSeriesTimeFrame),a.seriesError().subscribe(this,this._onSeriesError),a.loading().subscribe(this,this._onSeriesLoading),a.completed().subscribe(this,this._onSeriesCompleted),a.dataUpdated().subscribe(this,this._onDataUpdated),a.barReceived().subscribe(this,this._onBarReceived),this.createPaneView(),this._dataWindowView=new c(this,t),this._legendView=new h(this,t),this._statusView=new l(this,this._model.properties().scalesProperties.textColor,this.properties().statusViewStyle),this._symbolInfo=null,this._prevSymbolInfo=null,this._status=te.STATUS_OFFLINE,this._syncModel=null,this._replaySubscriber=null,this._isReplayResolutionAvailableForUser=null,this._haStyle={studyId:D.chartStyleStudyId(te.STYLE_HEIKEN_ASHI,!0)},this._renkoStyle={studyId:D.chartStyleStudyId(te.STYLE_RENKO,!0)},this._pbStyle={studyId:D.chartStyleStudyId(te.STYLE_PB,!0)},this._kagiStyle={studyId:D.chartStyleStudyId(te.STYLE_KAGI,!0)},this._pnfStyle={studyId:D.chartStyleStudyId(te.STYLE_PNF,!0)},this._rangeStyle={studyId:D.chartStyleStudyId(te.STYLE_RANGE,!0)},this._properties.addExclusion&&(this._properties.addExclusion("visible"),this._properties.addExclusion("currencyId")),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,o.prototype.fullUpdate),this._loading=!0,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,te.prototype._recreateFormatter);var u=this;this.properties().minTick.listeners().subscribe(null,(function(){u.m_model.fullUpdate()})),this._priceLineView=null,this._baseHorizontalLineView=new W(this),this._gotoDateResultCleared=!1,this._gotoDateView=null,this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsDWMProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,(function(e){this._extendedHoursChanged.fire(e),this.restart()})),a.extendedHoursNotPermitted().subscribe(this,(function(){this._properties.extendedHours.setValue(!1)})),this._symbolIntervalChanged.subscribe(this,this.checkInterval),
|
||
this.properties().showCountdown.listeners().subscribe(this,te.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreatePriceFormattingDependencies(),this._isDWMCached=null,this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction(),this._marketStatusModel=new K(this._quotesProvider,this._properties.symbol.listeners()),this._dataUpdatedModeModel=ee?new J({getter:this.symbolInfo.bind(this),onChange:a.symbolResolved()},{getter:this.status.bind(this),onChange:this._onStatusChanged},this._properties.symbol.listeners()):null,this._dataProblemModel=new Z(this._quotesProvider,this._properties.symbol.listeners())}isLoading(){return this._loading}isSymbolInvalid(){return this._status===te.STATUS_INVALID_SYMBOL}styleStudyInfos(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle}}styleStudyInfo(e){return this.styleStudyInfos()[e]}priceLineColor(e){return this.properties().priceLineColor.value()||e}endOfData(){return this._endOfData}serverTimeOffset(){return this._chartApi.serverTimeOffset()}_onChangeShowCountdown(e){var t=this;e.value()?this._countdownUpdateTimer=this.m_model.setInterval((function(){t._priceAxisView.updateCountdown()}),500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)}lastValueData(e,t,i){var s={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return s;var r,n,o=this.m_model.timeScale().visibleBarsStrictRange();if(null===o)return s;if(t){var a=this.data().bars().last();if(null===a)return s;r=a.value,n=a.index}else{var l=this.data().bars().search(o.lastBar(),I.NearestLeft);if(null===l)return s;r=this.data().bars().valueAt(l.index),n=l.index}var c={noData:!1},h=void 0!==e?r[e]:this._barFunction(r);i&&(c.price=h);var u=this.firstValue();c.text=this.priceScale().formatPrice(h,u),c.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(h),c.formattedPricePercentage=this.priceScale().formatPricePercentage(h,u);var d=this.barColorer().barStyle(n,!1);return c.color=d.barColor,c.floatCoordinate=this.priceScale().priceToCoordinate(h,u),c.coordinate=c.floatCoordinate,c.index=n,c}_createIsDWMProperty(){this._isDWMProperty=new s(this.isDWM()),this._onRestarted.subscribe(this,(function(){this._isDWMProperty.setValue(this.isDWM())}))}isDWMProperty(){return this._isDWMProperty}model(){return this.m_model}fixLastBar(e){0}clearData(){n(null===this.m_data,"Cannot clear loaded data"),this._seriesSource.clearData()}data(){return this.m_data||this._seriesSource.data()}isPulse(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0}onTagsChanged(){return this._tagsChanged}onSymbolIntervalChanged(){
|
||
return this._symbolIntervalChanged}onIntervalChanged(){return this._intervalChanged}onStatusChanged(){return this._onStatusChanged}onStyleChanged(){return this._onStyleChanged}onRestarted(){return this._onRestarted}boxSizeValue(){return this._boxSizeValue}status(){return this._status}isDWM(){if(null!==this._isDWMCached)return this._isDWMCached;var e=N.parse(this._properties.interval.value());if(e.isDWM())this._isDWMCached=!0;else{var t=e.isSeconds()?e.multiplier():60*e.multiplier();this._isDWMCached=!(t<216e3)}return this._isDWMCached}createPaneView(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new H(this):null;var e=this._properties.style.value();switch(e){case te.STYLE_BARS:this._paneView=new f(this,this.m_model);break;case te.STYLE_CANDLES:this._paneView=new m(this,this.m_model);break;case te.STYLE_LINE:this._paneView=new p(this,this.m_model);break;case te.STYLE_AREA:this._paneView=new d(this,this.m_model);break;case te.STYLE_HEIKEN_ASHI:this._paneView=new g(this,this.m_model);break;case te.STYLE_HOLLOW_CANDLES:this._paneView=new _(this,this.m_model);break;case te.STYLE_BASELINE:this._paneView=new v(this,this.m_model),this._waterlineView=new S(this);break;case te.STYLE_HILO:this._paneView=new b(this,this.m_model)}if(null===this._paneView)throw Error("Unknown chart style assigned: "+e)}_clearStylePlot(e,t){if(0!==e.size()){var i=t||o(e.firstIndex()),s=o(e.lastIndex())+1;e.range(i,s).each((function(e,t){t[TradingView.STYLE_PLOT]=null}))}}invalidateBarStylesCache(e){E.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.bars(),e),this._clearStylePlot(this.nsBars())}invalidateBarColorerCache(){delete this._barColorerCache,this.invalidateBarStylesCache()}barColorer(){if(this._barColorerCache)return this._barColorerCache;for(var e=null,t=this.m_model.dataSources().length-1;t>=0;t--){var i=this.m_model.dataSources()[t];if(i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()){var s=i.barColorer();null===e?e=s:e.pushBackBarColorer(s)}}return null===e?e=new P(this):e.pushBackBarColorer(new P(this)),this._barColorerCache=e,this._barColorerCache}properties(){return this._properties}_barsState(e){var t=e.state();return t.data.forEach((function(e){e.value.splice(7,1)})),t}state(e){var t={type:this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(t.state.symbol=this._symbolInfo.ticker),e&&(t.bars=this._barsState(this.bars()),t.nsBars=this._barsState(this.nsBars()),t.symbolInfo=this._symbolInfo,t.rtPrice=this.data().lastProjectionPrice),t.boxSize=this.data().boxSize,t.reversalAmount=this.data().reversalAmount,t}restoreState(e,t){t&&this._setStatus(te.STATUS_SNAPSHOT),
|
||
this._properties.mergeAndFire(e.state),this._prevChartStyle=this.properties().style.value(),this.createPaneView(),t&&this.restoreData(e.bars,e.nsBars,e.symbolInfo,e.rtPrice,e.boxSize,e.reversalAmount)}hasStateForAlert(){return!1}stateForAlert(){throw new Error("Not implemented")}idForAlert(){return a.prototype.idForAlert.call(this)}restoreData(e,t,i,s,r,n){this._status=te.STATUS_SNAPSHOT,this.m_data=new x,this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i,!1),this.m_data.lastProjectionPrice=s,this.m_data.boxSize=r,r||(this.properties().style.value()===te.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===te.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=n,n||this.properties().style.value()===te.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value()),this._loading=!1}_setProperties(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),e.currencyId||e.addChild("currencyId",new s(null)),e.unitId||e.addChild("unitId",new s(null)),this._properties=e,this._properties.symbol.listeners().subscribe(this,te.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,te.prototype.changeInterval),this._properties.currencyId.listeners().subscribe(this,te.prototype._changeCurrency),this._properties.unitId.listeners().subscribe(this,te.prototype._changeUnit),this._properties.timeframe.listeners().subscribe(this,te.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,te.prototype.changeProperties)}changeSymbol(){this.setSymbolIntervalCurrencyDelayed(),this.m_model.checkLineToolSelection()}changeInterval(){this.setSymbolIntervalCurrencyDelayed()}changeTimeFrame(){A("GUI","Change timeframe")}changeProperties(e){e!==this._properties.symbol&&e!==this._properties.interval&&e!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this),G.emit("series_properties_changed",this._id))}seriesSource(){return this._seriesSource}_onSymbolResolved(e){this.updateSymbolInfo(e,!1),this.m_model.updateSource(this),this.m_model.realignLineTools(),TradingView.onWidget()||(A("Symbol",e.listed_exchange,e.name),A("Symbol Type",e.type,e.listed_exchange));var t=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties();i.style.value()===te.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<t?i.renkoStyle.inputs.merge({boxSize:t}):i.style.value()===te.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<t?i.pnfStyle.inputs.merge({boxSize:t}):i.style.value()===te.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<t&&i.kagiStyle.inputs.merge({reversalAmount:t})}_onSymbolError(e){this._setStatus(te.STATUS_INVALID_SYMBOL),this._loading=!1,this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),
|
||
e!==q&&this.m_model.resetTimeScale(),this.m_model.realignLineTools()}_onSeriesTimeFrame(e,t,i,s,r){var n=this.m_model.timeScale(),o=t;if(void 0===r)null!==i&&i.type!==$.PeriodBack||(o+=n.defaultRightOffsetProperty().value());else if(r.applyDefaultRightMargin)o+=n.defaultRightOffsetProperty().value();else if(r.percentRightMargin){var a=t-e+1,l=Math.max(0,Math.min(.99,r.percentRightMargin/100));o+=l*a/(1-l)}this.m_model.setTimeViewport(e,o)}_onSeriesError(e){this._loading=!1,y.enabled("charting_library_debug_mode")&&E.logNormal("Error reason: "+e),this._setStatus(y.enabled("no_bars_status")&&this._symbolInfo?te.STATUS_NO_BARS:te.STATUS_INVALID_SYMBOL),this._seriesLoaded=!0,this._enablePriceRangeReady()}_onSeriesLoading(e){this._loading=!0,this._setStatus(te.STATUS_LOADING)}_onSeriesCompleted(e,t){if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalCurrencyChanged())return void E.logNormal("command comes during symbol/interval changing");E.logNormal("series_completed comes when symbol interval delay present but symbol/interval should not be changed")}this._loading=!1;var i=e;switch("pulsed"===i&&(i="delayed"),i){case"streaming":this._setStatus(te.STATUS_READY);break;case"endofday":this._setStatus(te.STATUS_EOD);break;case"delayed":this._setStatus(te.STATUS_DELAYED);break;case"pulsed":this._setStatus(te.STATUS_PULSE);break;case"replay":this._setStatus(te.STATUS_REPLAY)}i.match(/delayed_streaming/)&&this._setStatus(te.STATUS_DELAYED_STREAMING);var s=this.m_model.paneForSource(this);s.recalculatePriceScale(this.priceScale());var r=Q.full();null!==this.m_model.appliedTimeFrame().value()&&r.lockVisibleTimeRangeOnResize(),this.m_model.invalidate(r),this.model().recalcVisibleRangeStudies(!0),this.model().recalcStudyBasedLineTools(),!this.m_priceScale.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),this.model().resetPriceScale(s,this.priceScale())),this._seriesLoaded=!0,this._enablePriceRangeReady()}_onDataUpdated(e,t){if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalCurrencyChanged())return void E.logNormal("command comes during symbol/interval changing");E.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()!==te.STATUS_INVALID_SYMBOL){t&&(this._endOfData=!1),this._lastBarCloseTime=e&&e.closeTime||null,this._boxSizeValue.setValue(this.data().boxSize),this._statusView.update(),this.clearHighLowAvgPriceCache();var i=this.m_model.paneForSource(this);this.m_model.recalculatePane(i),this.m_model.updateSource(this),this.m_model.updateLineTools()}}_onBarReceived(e){this.model().recalcVisibleRangeStudies(!0)}disconnect(){this._seriesSource.stop(),this.m_symbol=void 0,this._predictBars=0,this._status=te.STATUS_OFFLINE}isStarted(){return this._seriesSource.isStarted()}restart(){if(this._status!==te.STATUS_SNAPSHOT){this._loading=!0,this._onRestarted.fire(),this._setStatus(te.STATUS_RESOLVING),this.updateSymbolInfo(null,!0)
|
||
;var e=this._properties.interval.value();this._checkIntervalWillChanged(e)&&this._notifyIntervalChanged(e);var t=null;this._pendingTimeRange&&(t=this._pendingTimeRange,delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),e),this._onTimeFrameApplied.fire(t),e=B(e),this.m_data=null,this._seriesSource.modifySeries(this._getResolvingSymbolObject(),e,t),this._seriesSource.isStarted()||this._seriesSource.start(),this.m_symbol=this._properties.symbol.value(),this._currency=this._properties.currencyId.value(),this._unit=this._properties.unitId.value(),this.m_interval=this._properties.interval.value()}}hasDelayedSymbolIntervalChange(){return!!this._setSymbolIntervalDelay}setSymbolIntervalCurrencyDelayed(){this._isDWMCached=null,this._willSymbolIntervalCurrencyChanged()&&(this._setSymbolIntervalDelay&&(E.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){const e=this._properties;E.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+e.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(e.symbol.value(),e.interval.value(),e.currencyId.value(),e.unitId.value())}.bind(this),30),E.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))}_willSymbolIntervalCurrencyChanged(){var e=this._checkIntervalWillChanged(this._properties.interval.value()),t=this._checkSymbolWillChanged(this._properties.symbol.value()),i=this._checkCurrencyWillChanged(this._properties.currencyId.value()),s=this._checkUnitWillChanged(this._properties.unitId.value());return t||e||i||s}_checkSymbolWillChanged(e){return!this.symbolSameAsCurrent(e)}_checkIntervalWillChanged(e){return!N.isEqual(this.m_interval,e)}rerequestData(){this._setSymbolInterval(this.m_symbol,this.m_interval,this._currency,this._unit,!0)}_notifyIntervalChanged(e){var t={timeframe:this._pendingTimeRange};this._intervalChanged.fire(e,t),this._pendingTimeRange=t.timeframe}_setSymbolInterval(e,t,i,s,r){this.clearGotoDateResult(),N.isRange(t)&&this._properties.rangeStyle.inputs.range.setValue(N.parse(t).multiplier());var n=this._checkSymbolWillChanged(e),o=this._checkIntervalWillChanged(t),a=this._checkCurrencyWillChanged(i),l=this._checkUnitWillChanged(s);if(!(n||o||a||l||r))return this.m_model.realignLineTools(),void this.m_model.updateLineTools();if(this._syncModel=null,this.m_symbol=e,this.m_interval=t,this._currency=i,this._unit=s,this._status!==te.STATUS_SNAPSHOT&&(!this._seriesSource.isStarted()||n||a||l)&&this.updateSymbolInfo(null,!n&&(a||l)),this.m_model.realignLineTools(),this._status!==te.STATUS_SNAPSHOT){this._loading=!0,this._setStatus(te.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),o&&this._notifyIntervalChanged(this.m_interval),this._onRestarted.fire(),this._seriesLoaded=!1;var c=null;this._pendingTimeRange&&(c=this._pendingTimeRange,delete this._pendingTimeRange),
|
||
this._onTimeFrameApplied.fire(c),this._onBeforeModifySeries(this.getSymbolString(),t),this.m_data=null,this._seriesSource.modifySeries(this._getResolvingSymbolObject(),B(t),c,r),this._seriesSource.isStarted()||(this._predictBars=0,this._seriesSource.start()),(n||a||l)&&this.disablePriceRangeReady()}}setDefaultTimeframe(e){this._pendingTimeRange=e}actualSymbol(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()}proSymbol(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()}symbol(){return this.properties().symbol.value()}interval(){return this.properties().interval.value()}bars(){return this.data().m_bars}nsBars(){return this.data().m_nsBars}hl2(e){return(this.high(e)+this.low(e))/2}hlc3(e){return(this.high(e)+this.low(e)+this.close(e))/3}ohlc4(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4}priceRange(e,t){if(!TradingView.isInteger(e))return E.logDebug("Series.priceRange: incorrect startBar"),null;if(!TradingView.isInteger(t))return E.logDebug("Series.priceRange: incorrect endBar"),null;if(this.data().isEmpty())return null;if(this.m_priceScale.isLockScale()){var i=this._model.mainSeriesScaleRatio();if(null!==i){var s=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/i),n=this.data().search(t,I.NearestLeft),o=(n.value[TradingView.HIGH_PLOT]+n.value[TradingView.LOW_PLOT])/2;return new r(o-.5*s,o+.5*s)}}var a=this.priceSource();if(null!==a)var l=this.data().bars().minMaxOnRangeCached(e,t,[{name:a,offset:0}]),c=this.data().nsBars().minMaxOnRangeCached(e,t,[{name:a,offset:0}]);else l=this.data().bars().minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),c=this.data().nsBars().minMaxOnRange(e,t,[{name:"low",offset:0},{name:"high",offset:0}]);var h=null!==(l=L(l,c))?l.min===l.max?new r(l.min-.5,l.max+.5):new r(l.min,l.max):new r(-.5,.5);return this.priceScale().isLog()?new r(this.priceScale().priceToLogical(h.minValue()),this.priceScale().priceToLogical(h.maxValue())):h}nearestData(e,t){if(TradingView.isInteger(e)){var i=this.data().search(e,t);return null!==i?i:void 0}E.logDebug("Series.nearestData: incorrect logicalPoint")}nearestIndex(e,t){var i=this.nearestData(e,t);return i?i.index:void 0}paneViews(){if(!this.properties().visible.value())return null;var e=[this._baseHorizontalLineView,this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),null!==this._waterlineView&&e.push(this._waterlineView),null!==this._priceLineView&&e.push(this._priceLineView),null!==this._gotoDateView&&e.push(this._gotoDateView),e.push(...this._highLowAvgPaneViews),e}dataWindowView(){return this._dataWindowView}legendView(){return this._legendView}statusView(){return Y?this._statusView:null}marketStatusModel(){return this._marketStatusModel}dataUpdatedModeModel(){return this._dataUpdatedModeModel}dataProblemModel(){return this._dataProblemModel}priceAxisViews(e,t){return e.findTargetPriceAxisViews(this,t,this._priceAxisViews,this._priceLineAxisViews)}
|
||
purgeSymbolInfo(){this._symbolInfo=null,this._isDWMCached=null}updateSymbolInfo(e,t){var i=D.extractSymbolNameFromSymbolInfo(e,this.m_symbol);if(this._prevSymbolInfo=t?this._symbolInfo:null,this._symbolInfo=e,e){this._properties.shortName.setValue(e.name);var s=this._properties.symbol.value(),r=i;y.enabled("uppercase_instrument_names")&&(s=s.toUpperCase(),r=r.toUpperCase()),i&&s!==r&&this._properties.symbol.setValue(i),this._currency=D.symbolCurrency(e),this._properties.currencyId.setValue(this._currency),this._unit=D.symbolUnit(e),this._properties.unitId.setValue(this._unit)}this._base=e?e.pricescale/e.minmov:100,this._pointValue=e&&e.pointvalue||1,this._recreatePriceFormattingDependencies(),this._statusView.update(),this.priceScale().updateFormatter();var n=this._getSymbolForApi();this._quotesProvider.setQuotesSessionSymbol(n),this.checkInterval()}_onQuotesUpdate(e,t){}dataPoweredBy(){return null}symbolSameAsCurrent(e){if(j(this.m_symbol,e))return!0;var t=this._symbolInfo;if(t){if(j(t.full_name,e)||j(t.pro_name,e))return!0;if(j(t.ticker,e))return!0;if(t.aliases&&F(t.aliases,e))return!0;if(t.alternatives&&F(t.alternatives,e))return!0;if(0===e.indexOf("FRA:")&&j(t.pro_name,e.replace("FRA:","FWB:")))return!0}return!1}updateAllViews(){this._paneView.update(),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),this._highLowAvgPaneViews.forEach(e=>e.update()),this._labelPaneViews.forEach(e=>e.update()),this._priceAxisViews.forEach(e=>e.update()),this._priceLineAxisViews.forEach(e=>e.update()),this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._waterlineView&&this._waterlineView.update(),null!==this._priceLineView&&this._priceLineView.update(),null!==this._gotoDateView&&this._gotoDateView.update(),this._baseHorizontalLineView.update();var e=this._model.activeStrategySource().value();null!==e&&e.updateAllViews()}_setStatus(e){this._status=e,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()}requestMoreData(e){if((this._status===te.STATUS_READY||this._status===te.STATUS_PULSE||this._status===te.STATUS_DELAYED||this._status===te.STATUS_DELAYED_STREAMING||this._status===te.STATUS_EOD||this._status===te.STATUS_REPLAY)&&!this.m_model.timeScale().isEmpty()){var t=this.m_model.timeScale().visibleBarsStrictRange();if(null!==t&&0!==this.bars().size()){var i=t.lastBar()-o(this.data().last()).index;if(this._predictBars<i&&(this._predictBars=i,this._seriesSource.requestMoreTickmarks(i)),!this._endOfData){var s=o(this.bars().firstIndex()),r=e||s-t.firstBar();r<=0||(Number.isFinite(r)?(this._endOfData=!0,this._loading=!0,this._seriesSource.requestMoreData(r),this._setStatus(te.STATUS_LOADING)):E.logWarn("requestMoreData: invalid bar count: "+r+", visible bars: ["+t.firstBar()+", "+t.lastBar()+"], last index: "+o(this.data().last()).index+", predicted bars: "+this._predictBars+", required bars:"+e))}}}}bindStyleChange(){var e=this;Object.keys(te.STYLE_SHORT_NAMES).map((function(e){
|
||
return te.STYLE_SHORT_NAMES[e]+"Style"})).forEach((function(t){e._properties[t].listeners().subscribe(e,te.prototype.invalidateBarStylesCache)}))}bindJapChartsInputs(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.wicks.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.oneStepBackBuilding.listeners().subscribe(this,this.onInputChanged),this._properties.rangeStyle.inputs.phantomBars.listeners().subscribe(this,this.onInputChanged)}createExtendedHoursProperty(){var e=this;function t(){e.extendedHours.setValue(e._properties.extendedHours.value()&&!1)}e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()}createDividendsAdjustmentProperty(){throw new Error("Not implemented")}dividendsAdjustmentProperty(){return null}setChartStyleWithIntervalIfNeeded(e,t){var i=t;void 0===t&&(i=R(e,this._properties.interval.value(),this._model.defaultResolutions())),N.isEqual(i,this._properties.interval.value())||this._properties.interval.setValue(i),this._properties.style.setValue(e)}isNeedRestart(e){return this._status!==te.STATUS_SNAPSHOT&&(void 0===e&&(e=this.properties().style.value()),!D.isRangeStyle(this._prevChartStyle)&&!D.isRangeStyle(e)&&!(this._prevChartStyle===e||!D.isRequiringRestartSeriesStyles(this._prevChartStyle)&&!D.isRequiringRestartSeriesStyles(e)))}onChartStyleChanged(){this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onStyleChanged.fire(this.properties().style.value()),this.invalidateBarStylesCache()}applyPreferences(e){var t=z({},e);this.m_priceScale.setMode({autoScale:t.priceAxisProperties.autoScale,
|
||
percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),this.setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,this._properties.mergePreferences(t),this._properties.saveDefaults(),this.createPaneView(),this.invalidateBarStylesCache()}barFunction(){return this._barFunction}priceSource(){var e=null;switch(this._properties.style.value()){case te.STYLE_LINE:e=this._properties.lineStyle.priceSource.value();break;case te.STYLE_AREA:e=this._properties.areaStyle.priceSource.value();break;case te.STYLE_BASELINE:e=this._properties.baselineStyle.priceSource.value()}return e}_updateBarFunction(){if(this._properties.style.value()===te.STYLE_HILO)this._barFunction=T("low");else{var e=this.priceSource()||"close";this._barFunction=T(e)}}style(){return this.properties().style.value()}isRangeBasedStyle(){return D.isRangeBasedStyle(this.style())}onInputChanged(){this.restart()}onExtendedHoursChanged(){return this._extendedHoursChanged}_getSymbolForApi(){if(y.enabled("pay_attention_to_ticker_not_symbol")){var e=this._symbolInfo||this._prevSymbolInfo;return e?e.ticker:this.actualSymbol()}return this.actualSymbol()}_getSymbolObject(){var e={symbol:this._getSymbolForApi()},t=this.currency();null!==t&&(e["currency-id"]=t);var i=this.unit();(null!==i&&(e["unit-id"]=i),this.extendedHours.value()&&(e.session="extended"),te.SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value()))&&(e={symbol:e,type:this.styleStudyInfo(this.getStyleShortName()+"Style").studyId+"!",inputs:this.getInputsProperties().state()});return e}getSymbolString(){return U(this._getSymbolObject())}_getResolvingSymbolObject(){return this._getSymbolObject()}getStyleShortName(){var e=this._properties.style.value();if(te.STYLE_SHORT_NAMES.hasOwnProperty(e))return te.STYLE_SHORT_NAMES[e];throw new Error("Missed short name for style "+e)}getStyleProperties(){return this._properties[this.getStyleShortName()+"Style"]}getInputsProperties(){return this.getStyleProperties().inputs||new s}getInputsInfoProperties(){return this.getStyleProperties().inputInfo||new s}getRealVisibleRange(){var e=this.model().timeScale().visibleBarsStrictRange();if(null===e)return null;var t=this.data().search(e.firstBar(),I.NearestRight),i=this.data().search(e.lastBar(),I.NearestLeft);return null===t||null===i?null:new C(t.index,i.index)}firstValue(){var e=this.firstBar();return null===e?null:this._barFunction(e)}firstBar(){var e=this.model().timeScale().visibleBarsStrictRange();if(null===e)return null;var t=e.firstBar(),i=this.data().search(t,I.NearestRight);return null!==i?i.value:null}isSpread(){return null!==this._symbolInfo&&"spread"===this._symbolInfo.type}getSymbolName(){return this._symbolInfo?this._symbolInfo.name:""}loadDataTo(e){var t=this._properties.interval.value();this._onTimeFrameApplied.fire(e),this._seriesSource.modifySeries(this._getResolvingSymbolObject(),B(t),e)}checkInterval(){
|
||
if(this._symbolInfo&&(N.isIntraday(this.interval())&&!this._symbolInfo.has_intraday&&this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var e=N.normalize(this._properties.interval.value());-1===this._symbolInfo.supported_resolutions.indexOf(e)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}}priceScale(){return this.m_priceScale}setPriceScale(e){this.m_priceScale!==e&&(this._priceScaleAboutToBeChanged.fire(),this.m_priceScale=e,this._properties.removeProperty("priceAxisProperties"),this._properties.addChild("priceAxisProperties",e.properties()),this._properties.priceAxisProperties.childChanged(),G.emit("series_event","price_scale_changed"),this._priceScaleChanged.fire(e))}setGotoDateResult(e){this._gotoDateResultCleared=!1,i.e("series-pane-views").then(i.t.bind(null,"+weX",7)).then(({GotoDateView:t})=>{this._gotoDateResultCleared||(this._gotoDateView=new t(this,e),this.m_model.updateSource(this))})}clearGotoDateResult(e){this._gotoDateView=null,this._gotoDateResultCleared=!0}syncModel(){if(!this._syncModel){var e=this.symbolInfo(),t=this.interval();if(!e||!t)return null;this._syncModel=new O(e,t)}return this._syncModel}getSourceIcon(){return{type:"loadSvg",svgId:"series."+this.properties().style.value()}}isStyleSupported(e){return!0}isIntervalSupported(e){return!0}isStyleSupportedForReplay(e){return D.isTimeBasedStyle(e)}isInReplay(){return null!==this._replaySubscriber}onTimeFrameApplied(){return this._onTimeFrameApplied}onInReplayStateChanged(){throw new Error("Not implemented")}replayExitedDueUnsupportedInterval(){throw new Error("Not implemented")}replayExitedDueUnavailableForUserInterval(){throw new Error("Not implemented")}switchToReplay(e,t){throw new Error("Not implemented")}switchToRealtime(){throw new Error("Not implemented")}_removeReplaySubscriber(){throw new Error("Not implemented")}_onBeforeModifySeries(e,t){0}_getTelemetryAdditionalData(e,t){t=void 0===t||t;var i={symbol:this.actualSymbol()};return t&&(i.resolution=this.interval()),void 0!==e&&(i.reason=e),i}_sendTelemetryReport(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var s=Object.assign(t,{additional:i});(void 0).sendChartReport(e,s)}_sendTelemetryCounter(e,t){this._sendTelemetryReport(e,{count:1},t)}destroy(){this._replayExitedDueUnsupportedInterval.destroy(),this._replayExitedDueUnavailableForUserInterval.destroy(),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.destroy(),this.clearGotoDateResult(),this._legendView.destroy(),this._marketStatusModel.destroy(),null!==this._dataUpdatedModeModel&&this._dataUpdatedModeModel.destroy(),this._dataProblemModel.destroy(),this._paneView&&this._paneView.destroy&&this._paneView.destroy(),this._onTimeFrameApplied.destroy(),this._seriesSource.destroy(),super.destroy()}dataEvents(){return this._seriesSource.dataEvents()}moveData(e){return this._seriesSource.moveData(e)}}Object.assign(te,k),TradingView.Series=te,t.Series=te
|
||
}).call(this,i("aIyQ"),i("tc+8"),i("Qb4w").PriceRange)},qXYw:function(e,t,i){"use strict";i.r(t);var s=i("n5al"),r=i("ivNn"),n=i("YFKU"),o=i("qFKp"),a=i("Tmoa"),l=i("Ialn"),c=i("GH0z"),h=i("6I19"),u=i("k9/m"),d=i("CW80"),p=i("mMWL"),_=i("7qT/"),m=i("38az");const f=o.CheckMobile.any(),g=f&&!0,v=new c.PercentageFormatter,b=Object(n.t)("n/a"),S=`${b} (${b}%)`;i.d(t,"OverlayLegendValuesProvider",(function(){return y}));class y extends class{constructor(e,t){this._study=e,this._model=t,this._emptyValues=[{title:Object(n.t)("Open"),visible:!1,value:"",index:0,id:""},{title:Object(n.t)("High"),visible:!1,value:"",index:1,id:""},{title:Object(n.t)("Low"),visible:!1,value:"",index:2,id:""},{title:Object(n.t)("Close"),visible:!1,value:"",index:3,id:""},{title:"",visible:!1,value:"",index:4,id:""},{title:"",visible:!1,value:"",index:5,id:""},{title:Object(n.t)("Change"),visible:!1,value:"",index:6,id:""}]}getItems(){return this._emptyValues}getValues(e){const t=this._emptyValues.map(e=>Object.assign({},e));if(this._model.timeScale().isEmpty())return t;if(0===this._study.data().size())return t;const i=this._showLastPriceAndChangeOnly();if(Object(r.isNumber)(e)||(i?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),Object(r.isNumber)(e)||(e=this._study.data().lastIndex()))),null===e||!Object(r.isNumber)(e))return t;const s=this._study.data().search(e,u.PlotRowSearchMode.NearestLeft,1),n=Object(h.c)(this._model.paneForSource(this._study));if(null===s||null===n)return t;const o=s.index,c=s.value,d=c[1],p=c[2],_=c[3],f=c[4];if(null==d||null==p||null==_||null==f)return t;t[0].value=b,t[1].value=b,t[2].value=b,t[3].value=b,t[6].value=S;for(const r of t)r.visible=!i;const y=t[4];y.visible=!1;const w=this._study.formatter(),C=this._changesData(f,d,o,i);if(void 0!==C.values){const e=Object(l.forceLTRStr)(`${w.format(C.values.change,!0)} (${v.format(C.values.percentChange,!0)})`);t[6].value=e}i?(t[5].value=w.format(f),t[5].visible=!0,t[6].visible=!0):(t[0].value=w.format(d),t[1].value=w.format(p),t[2].value=w.format(_),t[3].value=w.format(f),y.value=w.format(this._study.barFunction()(c)),t[5].visible=!1);let P=null;if(i&&!g)P=void 0===C.values||C.values.change>=0?m.SeriesBarColorer.upColor(this._study.properties()):m.SeriesBarColorer.downColor(this._study.properties());else{const e=this._study.barColorer().barStyle(o,!1),t=null!=e.barBorderColor?e.barBorderColor:e.barColor;P=Object(h.b)(n,t)}P=Object(a.resetTransparency)(Object(h.b)(n,P));for(const r of t)r.color=P;return t}_showLastPriceAndChangeOnly(){return f&&(null===this._model.crossHairSource().pane||Object(d.isLineToolName)(p.tool.value())||null!==this._model.lineBeingEdited())}_changesData(e,t,i,s){if(s&&!g){const e=this._study.quotes();if(null!==e)return{values:{change:e.change,percentChange:e.change_percent},priceDirection:{basedOnCurrentBar:e.change>=0?0:1,basedOnPrevClose:e.change>=0?0:1}}}else{const s=this._study.data().search(i-1,u.PlotRowSearchMode.NearestLeft,1),r=s&&s.value[4]||null;if(null!==r)return{values:{change:e-r,
|
||
percentChange:Object(_.a)(r,e)},priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=r?0:1}}}return{priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=t?0:1}}}}{constructor(e,t){super(e,t),this._showBarChange=t.properties().paneProperties.legendProperties.showBarChange,this._showSeriesOHLC=t.properties().paneProperties.legendProperties.showSeriesOHLC,this._seriesStyle=e.properties().childs().style}getValues(e){const t=super.getValues(e);if(!this._showLastPriceAndChangeOnly()){const e=Object(s.isPriceSourceStyle)(this._seriesStyle.value()),i=this._showSeriesOHLC.value(),r=i&&!e,n=i&&e;t[0].visible=r,t[1].visible=r,t[2].visible=r,t[3].visible=r,t[6].visible=this._showBarChange.value(),t[4].visible=n}return t}}},qcGP:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,n=i("mMWL");class o extends s{constructor(e,t){super(e,t||o.createProperties()),this._priceAxisViews.push(this.createPriceAxisView(3)),i.e("lt-pane-views").then(i.t.bind(null,"9FRF",7)).then(({ParallelChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}calculatePriceDiff(){var e=this.points();if(3===e.length){var t=e[0],i=e[1],s=e[2],r=this._findPriceOffset(t,i,s);null!==r&&isFinite(r)&&(this._priceOffset=r)}}_findPriceOffset(e,t,i){var s=this.priceScale();if(null===s||e.index===t.index)return null;if(s.isLog()){var r=this._model.timeScale();if(r.isEmpty())return null;var n=this.ownerSource().firstValue(),o=r.indexToCoordinate(e.index),a=r.indexToCoordinate(t.index),l=s.priceToCoordinate(e.price,n),c=s.priceToCoordinate(t.price,n),h=l+(m=(c-l)/(a-o))*(r.indexToCoordinate(i.index)-o),u=s.priceToCoordinate(i.price,n)-h,d=(n=this.ownerSource().firstValue(),.5*(l+c)),p=s.coordinateToPrice(d,n),_=d+u;return s.coordinateToPrice(_,n)-p}var m=(t.price-e.price)/(t.index-e.index),f=e.price+m*(i.index-e.index);return i.price-f}setLastPoint(e,t){t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),super.setLastPoint(e),this.calculatePriceDiff()}restorePoints(e,t,i){super.restorePoints(e,t,i),e&&e.length>=3&&(this._priceOffset=e[2].price-e[0].price)}setPoint(e,t,i){if(i&&i.shift())switch(e){case 0:case 1:this._snapPoint45Degree(t,this._points[1-e]);break;case 2:case 3:this._snapPoint45Degree(t,{index:this._points[3-e].index,price:this._points[3-e].price+this._priceOffset})}var s=!1;switch(e){case 0:case 1:super.setPoint(e,t,i);break;case 2:case 3:this._points[e-2].index=t.index,this._points[e-2].price=t.price-this._priceOffset;break;case 4:this._points[2]=t,this.calculatePriceDiff(),s=!0;break;case 5:var r=this._findPriceOffset(this._points[0],this._points[1],t);null!==r&&isFinite(r)&&(this._points[0].price+=r,this._points[1].price+=r,this._priceOffset-=r,s=!0)}if(e%2==0&&this._correctThirdPoint(),s&&this.linkKey){for(var o=[],a=0;a<this._points.length;a++)o.push(this._points[a].price);n.changeLineStyle({model:this._model,linkKey:this.linkKey,state:{prices:o}})}}restoreExternalState(e){if((e=Object.assign({},e)).prices)if(this.isActualSymbol()){
|
||
for(var t=0;t<e.prices.length;t++)this._points[t].price=e.prices[t];this._priceOffset=this._points[2].price-this._points[0].price}else this._priceOffset=void 0;delete e.prices,super.restoreExternalState(e)}onData(e){super.onData(e),this._updateThirdPointAndPriceOffset()}setPoints(e){super.setPoints(e),this.calculatePriceDiff()}getPoint(e){if(e<2)return s.prototype.getPoint.call(this,e);var t=null;switch(e){case 2:case 3:var i=this.points();i.length===this.pointsCount()&&(t={index:i[e-2].index,price:i[e-2].price+this._priceOffset})}return t}pointsCount(){return 3}name(){return"Parallel Channel"}hasEditableCoordinates(){return!1}addPoint(e,t){var i=this.points().length;t&&t.shift()&&2===i&&this._snapPoint45Degree(e,this.points()[0]);var r=s.prototype.addPoint.call(this,e,t);return this._updateThirdPointAndPriceOffset(),r}cloneData(e){this._priceOffset=e._priceOffset}restoreData(e){e.priceOffset&&(this._priceOffset=e.priceOffset)}state(e){var t=s.prototype.state.call(this,e);return t.priceOffset=this._priceOffset,t}canHasAlert(){return!0}axisPoints(){var e=this.points();return e.length<2?[]:(e[2]={index:e[0].index,price:e[0].price+this._priceOffset},e.push({index:e[1].index,price:e[1].price+this._priceOffset}),e)}_getAlertPlots(){var e=[].concat(this._points).splice(0,2);function t(e,t){return e.index<=t.index?[e,t]:[t,e]}var i,s,r,n,o=t((e=e.concat([{price:e[0].price+this._priceOffset,time:e[0].time,index:e[0].index},{price:e[1].price+this._priceOffset,time:e[1].time,index:e[1].index}]))[0],e[1]),a=t(e[2],e[3]);this._priceOffset<0?(s=a,i=o):(s=o,i=a);var l=this.properties().extendLeft.value(),c=this.properties().extendRight.value();return e[0].index<=e[1].index?(r=l,n=c):(r=c,n=l),[this._linePointsToAlertPlot(i,"Upper",r,n),this._linePointsToAlertPlot(s,"Lower",r,n)]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"VkdP"))).ParallelChannelDefinitionsViewModel}_updateThirdPointAndPriceOffset(){this._points.length===this.pointsCount()&&(void 0===this._priceOffset&&this.calculatePriceDiff(),this._correctThirdPoint())}_correctThirdPoint(){var e=this._points[0];this._points[2].index=e.index,this._points[2].price=e.price+this._priceOffset}static createProperties(e){var t=new r("linetoolparallelchannel",e);return o._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolParallelChannel=o},qckB:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor" transform="translate(6 3)"><rect width="15" height="12" rx="2" x=".5" y="8.5"/><path stroke-linecap="round" stroke-width="2" d="M8 15v2"/><path d="M11.5 4a3.5 3.5 0 0 0-7 0v4.5"/></g></svg>'},qgcf:function(e,t,i){"use strict";i.r(t),i.d(t,"calculateLabelPosition",(function(){return p})),i.d(t,"wordWrap",(function(){return f})),i.d(t,"TextRenderer",(function(){return I}))
|
||
;var s=i("aO4+"),r=i("Eyy1"),n=i("f6yo"),o=i("Ialn"),a=i("VdBB"),l=i("gAom"),c=i("jFln"),h=i("ogJP"),u=i("ikwP"),d=i("8Uy/");function p(e,t,i,r,n){const o=.5*(t.x+i.x);let a=i.y;return t.y>i.y?(a-=e.height/2+r.y,a=Math.max(e.height/2,a)):(a+=e.height/2+r.y,a=Math.min(n-e.height/2,a)),new s.Point(o,a)}let _;function m(){const e=document.createElement("canvas");e.width=0,e.height=0,_=Object(r.ensureNotNull)(e.getContext("2d"))}function f(e,t,i){_||m(),i=Object(h.isString)(i)?parseInt(i):i,e+="";const s=!Object(h.isNumber)(i)||!isFinite(i)||i<=0?e.split(/[^\S' '\r\n]*(?:\r\n|\r|\n|$)/):e.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);if(s[s.length-1]||s.pop(),!Object(h.isNumber)(i)||!isFinite(i)||i<=0)return s;_.font=t;const r=[];for(let n=0;n<s.length;n++){const e=s[n],t=_.measureText(e).width;if(t<=i){r.push(e);continue}const o=e.split(/([-)\]},.!?:;])|(\s+)/);let a=0;for(;o.length;){let e=~~(i/t*(o.length+2)/3);if(e<=0||_.measureText(o.slice(0,3*e-1).join("")).width<=i)for(;_.measureText(o.slice(0,3*(e+1)-1).join("")).width<=i;)e++;else for(;e>0&&_.measureText(o.slice(0,3*--e-1).join("")).width>i;);if(e>0)r.push(o.slice(0,3*e-1).join("")),o.splice(0,3*e);else{const e=o[0]+(o[1]||"");if(a=1===a?1:~~(i/_.measureText(e).width*e.length),_.measureText(e.substr(0,a)).width<=i)for(;_.measureText(e.substr(0,a+1)).width<=i;)a++;else for(;a>1&&_.measureText(e.substr(0,--a)).width>i;);a<1&&(a=1),r.push(e.substr(0,a)),o[0]=e.substr(a),o[1]=""}if(_.measureText(o.join("")).width<=i){r.push(o.join(""));break}}}return r}function g(e,t,i){if(0===i)return e.clone();const r=(e.x-t.x)*Math.cos(i)-(e.y-t.y)*Math.sin(i)+t.x,n=(e.x-t.x)*Math.sin(i)+(e.y-t.y)*Math.cos(i)+t.y;return new s.Point(r,n)}function v(e,t){return t+2*C(e)+2*y(e)}function b(e,t){return x(e)*t+P(e)*(t-1)+2*w(e)+2*S(e)}function S(e){return void 0!==e.boxPaddingVert?e.boxPaddingVert*M(e):void 0!==e.boxPadding?e.boxPadding*M(e):x(e)/3}function y(e){return void 0!==e.boxPaddingHorz?e.boxPaddingHorz*M(e):void 0!==e.boxPadding?e.boxPadding*M(e):x(e)/3}function w(e){return(e.backgroundVertInflate||0)*M(e)}function C(e){return(e.backgroundHorzInflate||0)*M(e)}function P(e){return(e.padding||0)*M(e)}function x(e){return Math.ceil(T(e)*M(e))}function T(e){return e.fontsize||e.fontSize||30}function M(e){const t=Math.min(1,Math.max(.2,Math.min(e.scaleX||1,e.scaleY||1)));if(1===t)return t;const i=T(e);return Math.ceil(t*i)/i}class I{constructor(e,t){this._data=null,this._internalData=null,this._boxSize=null,this._linesInfo=null,this._fontInfo=null,this._hittest=t||new a.HitTestResult(a.HitTestResult.MOVEPOINT,{areaName:a.AreaName.Text}),void 0!==e&&this.setData(e)}setData(e){e.horzTextAlign||(e.horzTextAlign=e.horzAlign),function(e,t){if(null===e||null===t)return null===e==(null===t);if(void 0===e.points!=(void 0===t.points))return!1;if(void 0!==e.points&&void 0!==t.points){if(e.points.length!==t.points.length)return!1;for(let r=0;r<e.points.length;++r)if(i=e.points[r],s=t.points[r],i.x!==s.x||i.y!==s.y)return!1}var i,s
|
||
;return e.text===t.text&&e.vertAlign===t.vertAlign&&e.horzAlign===t.horzAlign&&e.horzTextAlign===t.horzTextAlign&&e.font===t.font&&e.offsetX===t.offsetX&&e.offsetY===t.offsetY&&e.bold===t.bold&&e.italic===t.italic&&e.fontsize===t.fontsize&&e.fontSize===t.fontSize&&e.backgroundRoundRect===t.backgroundRoundRect&&e.forceTextAlign===t.forceTextAlign&&e.wordWrapWidth===t.wordWrapWidth&&e.forceCalculateMaxLineWidth===t.forceCalculateMaxLineWidth&&e.padding===t.padding&&e.scaleY===t.scaleY&&e.scaleX===t.scaleX&&e.highlightBorder===t.highlightBorder&&e.backgroundHorzInflate===t.backgroundHorzInflate&&e.backgroundVertInflate===t.backgroundVertInflate&&e.boxPadding===t.boxPadding&&e.boxPaddingVert===t.boxPaddingVert&&e.boxPaddingHorz===t.boxPaddingHorz&&e.angle===t.angle&&e.maxHeight===t.maxHeight}(this._data,e)?this._data=e:(this._data=e,this._internalData=null,this._boxSize=null,this._linesInfo=null,this._fontInfo=null)}hitTest(e){if(null===this._data||void 0===this._data.points||0===this._data.points.length)return null;const t=this._data.angle||0,{boxLeft:i,boxTop:r,boxWidth:o,boxHeight:a}=this._getInternalData(),l=this._getRotationPoint(),c=[g(new s.Point(i,r),l,t),g(new s.Point(i+o,r),l,t),g(new s.Point(i+o,r+a),l,t),g(new s.Point(i,r+a),l,t)];return Object(n.pointInPolygon)(e,c)?this._hittest:null}doesIntersectWithBox(e){return null!==this._data&&void 0!==this._data.points&&0!==this._data.points.length&&Object(n.pointInBox)(this._data.points[0],e)}measure(){if(null===this._data)return{width:0,height:0};const e=this._getBoxSize();return{width:e.boxWidth,height:e.boxHeight}}rect(){if(null===this._data)return{x:0,y:0,width:0,height:0};const e=this._getInternalData();return{x:e.boxLeft,y:e.boxTop,width:e.boxWidth,height:e.boxHeight}}setPoints(e,t){Object(r.ensureNotNull)(this._data).points=e,this._hittest=t||new a.HitTestResult(a.HitTestResult.MOVEPOINT)}fontStyle(e){return null===this._data?"":this._getFontInfo().fontStyle}wordWrap(e,t,i){return f(e,i||this.fontStyle(),t)}draw(e,t){if(null===this._data||void 0===this._data.points||0===this._data.points.length)return;const i=t.pixelRatio,s=this._getInternalData(),r=this._getRotationPoint().scaled(i);e.save(),e.translate(r.x,r.y),e.rotate(this._data.angle||0),e.translate(-r.x,-r.y);const n=this._getFontInfo().fontSize;e.textBaseline=s.textBaseLine,e.textAlign=s.textAlign,e.font=this.fontStyle();const{scaledLeft:o,scaledRight:a,scaledTop:h,scaledBottom:p}=function(e,t){const i=Math.round(e.boxLeft*t),s=Math.round(e.boxTop*t);return{scaledLeft:i,scaledRight:i+Math.round(e.boxWidth*t),scaledTop:s,scaledBottom:s+Math.round(e.boxHeight*t)}}(s,i);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){const t=this._data.borderWidth||Math.max(n/12,1),s=Math.round(t*i),r=s/2;if(this._data.backgroundRoundRect)this._data.backgroundColor&&(Object(l.drawRoundRect)(e,o,h,a-o,p-h,this._data.backgroundRoundRect*i),e.fillStyle=this._data.backgroundColor,e.fill()),
|
||
this._data.borderColor&&(Object(l.drawRoundRect)(e,o-r,h-r,a-o+s,p-h+s,this._data.backgroundRoundRect*i+s),e.strokeStyle=this._data.borderColor,e.lineWidth=s,e.stroke());else if(this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fillRect(o,h,a-o,p-h)),this._data.borderColor||this._data.highlightBorder){let t;this._data.borderColor?(e.strokeStyle=this._data.borderColor,t=s):(e.strokeStyle=this._data.color,Object(c.setLineStyle)(e,d.LINESTYLE_DASHED),t=Math.max(1,Math.floor(i))),e.lineWidth=t,e.beginPath(),e.moveTo(o-t/2,h-t/2),e.lineTo(o-t/2,p+t/2),e.lineTo(a+t/2,p+t/2),e.lineTo(a+t/2,h-t/2),e.lineTo(o-t/2,h-t/2),e.stroke()}}e.fillStyle=this._data.color;const _=(o+Math.round(s.textStart*i))/i,m=.05*n;let f=(h+Math.round((s.textTop+m)*i))/i;const g=P(this._data),v=this._getLinesInfo();for(const l of v.lines)Object(u.drawScaled)(e,i,()=>e.fillText(l,_,f)),f+=n+g;e.restore()}_getLinesMaxWidth(e){if(_||m(),_.textBaseline="alphabetic",_.font=this.fontStyle(),null!==this._data&&this._data.wordWrapWidth&&!this._data.forceCalculateMaxLineWidth)return this._data.wordWrapWidth*M(this._data);let t=0;for(const i of e)t=Math.max(t,_.measureText(i).width);return t}_getInternalData(){if(null!==this._internalData)return this._internalData;const e=Object(r.ensureNotNull)(this._data),t=this._getBoxSize(),i=t.boxWidth,s=t.boxHeight,n=Object(r.ensureDefined)(e.points)[0];let a=n.y;switch(e.vertAlign){case"bottom":a-=s+e.offsetY;break;case"middle":a-=s/2;break;case"top":a+=e.offsetY}let l=n.x;const c=y(e),h=S(e),u=C(e)+c;let d;const p=a+(w(e)+h)+x(e)/2;let _;switch(e.horzAlign){case"left":l+=e.offsetX;break;case"center":l-=i/2;break;case"right":l-=i+e.offsetX}switch(Object(r.ensureDefined)(e.horzTextAlign)){case"left":_="start",d=l+u,Object(o.isRtl)()&&(e.forceTextAlign?_="left":(d=l+i-u,_="right"));break;case"center":_="center",d=l+i/2;break;case"right":_="end",d=l+i-u,Object(o.isRtl)()&&e.forceTextAlign&&(_="right")}return{boxLeft:l,boxTop:a,boxWidth:i,boxHeight:s,textStart:d-l,textTop:p-a,textAlign:_,textBaseLine:"middle"}}_getLinesInfo(){if(null===this._linesInfo){const e=Object(r.ensureNotNull)(this._data);let t=this.wordWrap(e.text,e.wordWrapWidth);if(void 0!==e.maxHeight){const i=function(e){const t=Object(r.ensureDefined)(e.maxHeight),i=x(e),s=P(e);return Math.floor((t+s)/(i+s))}(e);t.length>i&&(t=t.slice(0,i))}this._linesInfo={linesMaxWidth:this._getLinesMaxWidth(t),lines:t}}return this._linesInfo}_getFontInfo(){if(null===this._fontInfo){const e=Object(r.ensureNotNull)(this._data),t=x(e),i=(e.bold?"bold ":"")+(e.italic?"italic ":"")+t+"px "+e.font;this._fontInfo={fontStyle:i,fontSize:t}}return this._fontInfo}_getBoxSize(){if(null===this._boxSize){const e=this._getLinesInfo(),t=Object(r.ensureNotNull)(this._data);this._boxSize={boxWidth:v(t,e.linesMaxWidth),boxHeight:b(t,e.lines.length)}}return this._boxSize}_getRotationPoint(){const{boxLeft:e,boxTop:t,boxWidth:i,boxHeight:n}=this._getInternalData(),{horzAlign:o,vertAlign:a}=Object(r.ensureNotNull)(this._data);let l,c;switch(o){case"center":l=e+i/2;break
|
||
;case"left":l=e;break;case"right":l=e+i}switch(a){case"middle":c=t+n/2;break;case"top":c=t;break;case"bottom":c=t+n}return new s.Point(l,c)}}},qocr:function(e,t,i){"use strict";function s(e,t=!1){("attachEvent"in document?"complete"===document.readyState:"loading"!==document.readyState)?t?setTimeout(()=>e(),1):e():document.addEventListener("DOMContentLoaded",()=>e())}i.d(t,"a",(function(){return s}));new Promise(e=>{s(e)})},qySK:function(e,t,i){"use strict";i.d(t,"b",(function(){return h})),i.d(t,"a",(function(){return u}));var s=i("Eyy1"),r=i("JmuD"),n=i("KG+6"),o=i("fFKx"),a=i("SqfW"),l=i("7Fue"),c=i("xWfy");function h(e){if(!Object(r.isObject)(e))throw new Error("Graphics commands should be wrapped in an object");if(Object(r.hasProperty)(e,"create"),Object(r.hasProperty)(e,"erase")){const t=e.erase;Object(s.assert)(Array.isArray(t),"Collection of erase commands should be array");for(const e of t){if(!Object(r.isObject)(e)||!Object(r.hasProperty)(e,"action"))throw new Error("Command should be an object with 'action' property");Object(s.assert)("all"===e.action||"one"===e.action,"Erase command action should be 'all' or 'one'")}}return e}class u{constructor(){this._indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._dwglabels=new Map,this._dwgboxes=new Map,this._dwglines=new Map,this._dwgtables=new Map,this._dwgtablecells=new Map,this._hhistsByTimePointIndex=new Map}horizlines(){return this._horizlines}vertlines(){return this._vertlines}lines(){return this._lines}hlines(){return this._hlines}textmarks(){return this._textmarks}shapemarks(){return this._shapemarks}backgrounds(){return this._backgrounds}polygons(){return this._polygons}trendchannels(){return this._trendchannels}hhists(){return this._hhists}dwglabels(){return this._dwglabels}dwglines(){return this._dwglines}dwgboxes(){return this._dwgboxes}dwgtables(){return this._dwgtables}dwgtablecells(){return this._dwgtablecells}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}clear(){this._indexes=[],this._clearPrimitives()}extract(){const e=e=>e.extract(),t={indexes:this._indexes,horizlines:p(this._horizlines,e),vertlines:p(this._vertlines,e),lines:p(this._lines,e),hlines:p(this._hlines,e),textmarks:p(this._textmarks,e),shapemarks:p(this._shapemarks,e),backgrounds:p(this._backgrounds,e),polygons:p(this._polygons,e),trendchannels:p(this._trendchannels,e),hhists:p(this._hhists,e),dwglabels:p(this._dwglabels,e),dwglines:p(this._dwglines,e),dwgboxes:p(this._dwgboxes,e),dwgtables:p(this._dwgtables,e),dwgtablecells:p(this._dwgtablecells,e)};return this._hhistsByTimePointIndex=new Map,new c.a("data",t)}replaceIndexesTo(e){this._indexes=e;const t=e=>e.replaceIndexesTo(this._indexes);this._horizlines.forEach(t),this._vertlines.forEach(t),this._lines.forEach(t),this._hlines.forEach(t),this._textmarks.forEach(t),this._shapemarks.forEach(t),
|
||
this._backgrounds.forEach(t),this._polygons.forEach(t),this._trendchannels.forEach(t),this._hhists.forEach(t),this._dwglabels.forEach(t),this._dwgboxes.forEach(t),this._dwglines.forEach(t),this._dwgtables.forEach(t),this._dwgtablecells.forEach(t),this._hhistsByTimePointIndex=Object(l.b)(this._hhists)}processCommands(e,t){void 0!==e.erase&&this._processEraseCommands(e.erase),void 0!==e.create&&this._processCreateCommands(e.create,t)}_processCreateCommands(e,t){for(const i in e){if(!e.hasOwnProperty(i))continue;const r=i;switch(Object(s.assert)(r in t,`There is a '${r}' in study response, but it doesn't present in graphics info!`),r){case"hhists":_(this._hhists,e[r],t[r],this._indexes,n.c);break;case"horizlines":_(this._horizlines,e[r],t[r],this._indexes,o.b);break;case"vertlines":_(this._vertlines,e[r],t[r],this._indexes,a.b)}}this._hhistsByTimePointIndex=Object(l.b)(this._hhists)}_processEraseCommands(e){for(const t of e)if("all"===t.action)this._clearPrimitives();else{const e=e=>e.deleteById(t.id);switch(t.type){case"horizlines":this._horizlines.forEach(e);break;case"vertlines":this._vertlines.forEach(e);break;case"lines":this._lines.forEach(e);break;case"hlines":this._hlines.forEach(e);break;case"textmarks":this._textmarks.forEach(e);break;case"shapemarks":this._shapemarks.forEach(e);break;case"backgrounds":this._backgrounds.forEach(e);break;case"polygons":this._polygons.forEach(e);break;case"trendchannels":this._trendchannels.forEach(e);break;case"hhists":this._hhists.forEach(e);break;case"dwglabels":this._dwglabels.forEach(e);break;case"dwglines":this._dwglines.forEach(e);break;case"dwgboxes":this._dwgboxes.forEach(e);break;case"dwgtables":this._dwgtables.forEach(e);break;case"dwgtablecells":this._dwgtablecells.forEach(e)}}this._hhistsByTimePointIndex=Object(l.b)(this._hhists)}_clearPrimitives(){this._horizlines.clear(),this._vertlines.clear(),this._lines.clear(),this._hlines.clear(),this._textmarks.clear(),this._shapemarks.clear(),this._backgrounds.clear(),this._polygons.clear(),this._trendchannels.clear(),this._hhists.clear(),this._dwglabels.clear(),this._dwgboxes.clear(),this._dwglines.clear(),this._dwgtables.clear(),this._dwgtablecells.clear(),this._hhistsByTimePointIndex=new Map}}class d{constructor(e,t){this._primitivesDataById=new Map,this._primitiveById=new Map,this._materializePrimitive=e,this._indexes=t}forEach(e,t){this._primitiveById.forEach(i=>{e.call(t,i,i,this)})}has(e){let t=!1;return this._primitiveById.forEach(i=>{t=t||i===e}),t}get size(){return this._primitiveById.size}[Symbol.iterator](){throw new Error("Not implemented")}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){throw new Error("Not implemented")}hasId(e){return this._primitiveById.has(e)}addData(e){this._primitivesDataById.set(e.id,e),this._tryMaterialize(e)}deleteById(e){this._primitiveById.delete(e),this._primitivesDataById.delete(e)}clear(){this._primitivesDataById.clear(),this._primitiveById.clear()}replaceIndexesTo(e){this._indexes=e,this._primitiveById.clear(),
|
||
this._primitivesDataById.forEach(this._tryMaterialize,this)}extract(){const e=new Set(this._primitivesDataById.values());return this._primitivesDataById=new Map,this._primitiveById.clear(),e}_tryMaterialize(e){const t=this._materializePrimitive(e,this._indexes);null!==t&&(Object(s.assert)(!this._primitiveById.has(e.id),"primitive with specified id should not exist"),this._primitiveById.set(e.id,t))}}function p(e,t){const i=new Map;return e.forEach((e,s)=>i.set(s,t(e))),i}function _(e,t,i,r,n){if(void 0!==t)for(const o of t){const t=o.styleId;void 0!==i&&Object(s.assert)(t in i,"Every style used by graphics primitive should be declared in study metainfo");let a=e.get(t);void 0===a&&(a=new d(n,r),e.set(t,a)),o.data.forEach(a.addData.bind(a))}}},rCHB:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"LineToolPitchforkStyle",(function(){return s})),function(e){e[e.Original=0]="Original",e[e.Schiff=1]="Schiff",e[e.Inside=2]="Inside",e[e.Schiff2=3]="Schiff2"}(s||(s={}))},rL76:function(e,t,i){e.exports={labelwidth:"19px",labelheight:"19px",bordersize:"2px",bottommargin:"5px",gearheight:"15px",gearwidth:"15px","price-axis-stub":"price-axis-stub-1DJMiIgd",wrapper:"wrapper-1DJMiIgd",label:"label-1DJMiIgd",symbol:"symbol-1DJMiIgd",gear:"gear-1DJMiIgd","fixed-gear":"fixed-gear-1DJMiIgd","fixed-symbol":"fixed-symbol-1DJMiIgd"}},rQHv:function(e,t,i){"use strict";var s=i("IiTo"),r={};e.exports=function(e,t,i){var n,o,a={},l=r[i]||"out_of_session",c=!1,h=i,u=t,d=null;function p(){var e={};e.symbolname=h,e.status="ok",e.values={},e.values.current_session=l,r[h]=l,TradingView.ChartapiMessagerInstances[u].onQuotesData([u].concat([e]))}function _(){if(n)if(o)l="out_of_session";else{var e=s.isTradingNow((new Date).getTime(),n)?"market":"out_of_session";e!==l&&(l=e,p())}}return e(i,null,(function(e){c||function(e){n=new s.SessionInfo(e.timezone,e.session,e.holidays,e.corrections),o=e.expired,d=setInterval(_,6e4),_(),p()}(e)}),(function(){})),a.stop=function(){c=!0,d&&clearInterval(d)},a.marketStatus=function(){return l},a}},rY0k:function(e,t,i){"use strict";var s=i("xDuj").translatedIntervalString,r=i("hOqT").getTranslatedSymbolDescription,n=i("zDbI").CHART_FONT_FAMILY,o=i("di4O"),a=o.watermarkProperty,l=o.restoreWatermarkPropertyDefaults,c=i("ikwP").drawScaled;t.Watermark=function(e,t){var i={},o=a();function h(e,t){var s=e.font;return i.hasOwnProperty(s)||(i[s]={}),i[s].hasOwnProperty(t)||(i[s][t]=e.measureText(t).width),i[s][t]}o.listeners().subscribe(this,(function(){e.updateSource(this)})),this.destroy=function(){o.listeners().unsubscribeAll(this)},this.properties=function(){return o},this.restorePropertiesDefaults=function(){l()};var u={renderer:function(e,i){return{draw:function(a,l){c(a,l.pixelRatio,(function(){var l=t.symbolInfo();a.fillStyle=o.color.value();var c,u=l.name;/QUANDL/.test(l.exchange)&&((c=u.split(/\//)).length&&(u=c[c.length-1]));for(var d={description:l.description,short_description:l.short_description,pro_name:l.pro_name,short_name:l.name,local_description:l.local_description,language:l.language},p=[{
|
||
text:u?u+", "+s(t.interval()):"",font:"96px "+n,lineHeight:117,vertOffset:0},{text:r(d)||"",font:"48px "+n,lineHeight:58,vertOffset:5}],_=0,m=0;m<p.length;m++){if((v=p[m]).text){a.font=v.font;var f=h(a,v.text);v.zoom=f>i?i/f:1,_+=v.lineHeight*v.zoom}}var g=Math.max((e-_)/2,0);for(m=0;m<p.length;m++){var v;(v=p[m]).text&&(a.save(),a.translate(i/2,g),a.textBaseline="top",a.textAlign="center",a.font=v.font,a.scale(v.zoom,v.zoom),a.fillText(v.text,0,v.vertOffset),a.restore(),g+=v.lineHeight*v.zoom)}}))}}},update:function(){}};this.paneViews=function(){return t.symbolInfo()&&o.visibility.value()?[u]:[]}}},s1Gx:function(e,t,i){"use strict";i.r(t),i.d(t,"specialZOrderBase",(function(){return s})),i.d(t,"sortSourcesPreOrdered",(function(){return r})),i.d(t,"sortSources",(function(){return n})),i.d(t,"isSpeciallyZOrderedSource",(function(){return o}));const s=1e7,r={ChartEventsSource:s+1,Dividends:s+2,Splits:s+3,Earnings:s+4,LineToolOrder:s+5,LineToolPosition:s+6,LineToolExecution:s+7,AlertLabel:s+8};function n(e){return[...e].sort((e,t)=>e.zorder()-t.zorder())}function o(e){return e.zorder()>=s}},s9sR:function(e,t,i){"use strict";i.r(t),i.d(t,"SetResolutionUndoCommand",(function(){return o}));var s=i("RDU5"),r=i("LxhU"),n=i("n5al");class o extends s.UndoCommand{constructor(e,t,i,s){super(s),this._property=e,this._value=t,this._prevValue=e.value(),this._chartWidget=i}redo(){this._chartWidget.screen.show(),this._property.setValue(this._value),this._handleResolution(this._value)}undo(){this._chartWidget.screen.show(),this._property.setValue(this._prevValue),this._handleResolution(this._prevValue)}_handleResolution(e){const t=this._chartWidget.model().mainSeries().properties(),i=t.style.value(),s=Object(n.isRangeStyle)(i),o=r.Interval.isRange(e);!s&&o?t.style.setValue(11):s&&!o&&t.style.setValue(Object(n.getLastUsedStyle)())}}},sEk5:function(e,t,i){"use strict";var s=i("fTGZ").BarsMarksContainer,r=i("mMWL"),n=i("CCPt").UserDefinedBarsMarksTooltip;e.exports=class extends s{constructor(e){super(e),this.toolname="UserDefinedBarsMarks";var t=this;r.hideMarksOnBars().subscribe(this,(function(){t._properties.visible.setValue(!r.hideMarksOnBars().value())}))}_initialize(e){this._properties.visible.setValue(!0)}userEditEnabled(){return!1}_plateViewData(e){var t={text:e.text};return"object"==typeof e.color&&(t.theme="user_defined_theme",t.overridedTheme={},t.overridedTheme.border=e.color.border,t.overridedTheme.background=e.color.background),t}onClicked(e){var t=e.id;this._marks[t].onClicked()}clearMarks(){super.clearMarks(),this.onNeedRepaint.fire()}_getData(e){var t=this._model.mainSeries().symbolInfo();if(t){var i=this.roundRange(this._rangeDifference(e)),s=this,r=this._model.mainSeries().properties().interval.value();ChartApiInstance.getMarks(t,i.start,i.end,(function(t){t.forEach((function(e){s._marks[e.id]=e}),s),s._loadedRange=s._rangeUnion(e,s._loadedRange),s.onNeedRepaint.fire()}),r)}}_createTooltip(){return new n}updatePlateData(e,t){return t.barWidth=this.barWidth(),t.text=e.text,
|
||
t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t}hasContextMenu(){return!1}calcIsActualCurrency(){this._isActualCurrency=!0}calcIsActualUnit(){this._isActualUnit=!0}}},sJA2:function(e,t,i){"use strict";i.r(t),i.d(t,"ThemesApi",(function(){return n}));var s=i("EsvI"),r=i("oiZD");class n{constructor(e){this._opts=e}isStdTheme(){const e=this._opts.chartWidgetCollection.getAll().every(e=>Object(s.isStdTheme)(Object(s.extractThemeFromModel)(e.model())));return Promise.resolve(e)}async setStdTheme(e,t=!0,i){await Object(s.loadTheme)(e,!0,!1,this._opts.chartWidgetCollection,t,i)}setStdThemeForLayout(e,t=!0){Object(r.setTheme)(e),t&&Object(s.syncTheme)()}getCurrentThemeName(){return Object(s.getCurrentTheme)().name}}},sQaR:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("hY0g"),r=i.n(s);class n{constructor(){this._container=document.createElement("div"),this._visibility=new r.a(!1)}visible(){return this._visibility.readonly()}_setVisibility(e){this._visibility.setValue(e)}}},t2ex:function(e,t,i){"use strict";var s=i("5rJj"),r=i("Ss5c").LineDataSource,n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends r{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,this._properties._stateVersion=1,i.e("lt-pane-views").then(i.t.bind(null,"R7Bt",7)).then(({FibRetracementPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 2}name(){return"Fib Retracement"}migrateVersion(e,t,i){1===e&&this.properties().extendLines.setValue(!0)}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"17v9"))).FibDrawingsWith24LevelsDefinitionsViewModel}static createProperties(e){var t=new s("linetoolfibretracement",e,!1,{range:[1,24],names:["coeff","color","visible"]});return l._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e);for(var t=[e.child("trendline").child("linewidth"),e.child("levelsStyle").child("linewidth")],i=[e.child("trendline").child("color")],s=1;s<=l.LevelsCount;s++)i.push(e.child("level"+s).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}fibLevelsBasedOnLogScale(){return this.properties().fibLevelsBasedOnLogScale.value()&&this.priceScale().isLog()}}l.version=2,l.LevelsCount=24,t.LineToolFibRetracement=l},tBG4:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesStatusView",(function(){return n}));var s=i("nBJD"),r=i("WPIy");class n extends s.a{constructor(e,t,i){super(new r.a(e,t,i)),this._invalidated=!0,this._series=e,this._series.onRestarted().subscribe(this,this.update),this._series.dataEvents().symbolResolved().subscribe(this,this.update),this._series.dataEvents().completed().subscribe(this,this.update),this._series.boxSizeValue().subscribe(this.update.bind(this)),i.childs().symbolTextSource.listeners().subscribe(this,this.update)}
|
||
getSeriesPrecision(){let e=4;const t=this._series.symbolInfo();return t&&t.pricescale&&(e=Math.round(Math.log(t.pricescale)/Math.log(10))),e}round(e){const t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i?i.toString():""}update(){this._invalidated=!0}text(){return this._updateImpl(),super.text()}color(){return this._updateImpl(),super.color()}bold(){return this._updateImpl(),super.bold()}size(){return this._updateImpl(),super.size()}getSplitTitle(){return this._updateImpl(),this._statusProvider.getSplitTitle()}_updateImpl(){this._invalidated&&(this._bold=this._statusProvider.bold(),this._size=this._statusProvider.size(),this._text=this._statusProvider.text(),this._invalidated=!1)}}},tDUI:function(e,t,i){"use strict";(function(e){var s=i("Eyy1").ensureNotNull,r=i("Ss5c").LineDataSource,n=i("gMtF").LineToolRiskRewardPriceAxisView,o=i("mMWL"),a=i("Ocx9").DefaultProperty,l=i("zXvd").NumericFormatter,c=i("wGNx").RiskRewardPointIndex,h=i("H007"),u=h.RiskRewordEntryPriceProperty,d=h.RiskRewordStopPriceProperty,p=h.RiskRewardTargetPriceProperty,_=i("ogJP").isNumber,m=i("k9/m").PlotRowSearchMode;class f extends r{constructor(t,s){var r=s;if(super(t,r),!s.stopLevel&&!s.profitLevel){var o=t.timeScale().visibleBarsStrictRange(),a=o.firstBar(),h=o.lastBar(),_=t.mainSeries().priceRange(a,h),m=t.mainSeries().priceScale();if(m.isLog()){var g=m.logicalToPrice(_.minValue()),v=m.logicalToPrice(_.maxValue());_=new e(g,v)}if(_&&!_.isEmpty()){var b=Math.round(.2*_.length()*t.mainSeries().base());r.merge({stopLevel:b,profitLevel:b})}}var S=this;r.stopLevel.listeners().subscribe(this,this.recalculate),r.stopLevel.listeners().subscribe(null,(function(){S.properties().stopPrice._listeners.fire(S.properties().stopPrice)})),r.profitLevel.listeners().subscribe(this,this.recalculate),r.profitLevel.listeners().subscribe(null,(function(){S.properties().targetPrice._listeners.fire(S.properties().targetPrice)})),r.addChild("entryPrice",new u(this)),r.addChild("stopPrice",new d(this)),r.addChild("targetPrice",new p(this)),r.addProperty("riskSize",250),r.addProperty("qty",0),r.addProperty("amountTarget",r.accountSize.value()),r.addProperty("amountStop",r.accountSize.value()),this._riskInPercentsFormatter=new l(2),this._riskInMoneyFormatter=new l,r.risk.subscribe(this,this._recalculateRiskSize),r.accountSize.subscribe(this,this._recalculateRiskSize),r.riskDisplayMode.subscribe(this,this._recalculateRisk),r.riskDisplayMode.subscribe(this,this._recalculateRiskSize),r.entryPrice.subscribe(this,this._recalculateRiskSize),r.stopPrice.subscribe(this,this._recalculateRiskSize),r.profitLevel.subscribe(this,this._recalculateRiskSize),r.profitLevel.subscribe(this,this.syncPriceLevels.bind(this)),r.stopLevel.subscribe(this,this._recalculateRiskSize),r.stopLevel.subscribe(this,this.syncPriceLevels.bind(this)),r.qty.subscribe(this,this._recalculateRiskSize),this.pointAdded().subscribe(this,e=>{switch(e){case c.Entry:case c.Close:this._recalculateRiskSize()}}),this.pointChanged().subscribe(this,e=>{switch(e){case c.Entry:
|
||
case c.Close:this._recalculateRiskSize()}}),"percents"===r.riskDisplayMode.value()&&r.risk.value()>100&&r.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["points","entryPrice","stopPrice","targetPrice","stopLevel","profitLevel","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=f.version,this._entryPriceAxisView=new n(this,{colorProperty:r.linecolor,priceProperty:r.entryPrice}),this._stopPriceAxisView=new n(this,{colorProperty:r.stopBackground,priceProperty:r.stopPrice}),this._profitPriceAxisView=new n(this,{colorProperty:r.profitBackground,priceProperty:r.targetPrice}),i.e("lt-pane-views").then(i.t.bind(null,"u+oH",7)).then(({RiskRewardPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}riskFormatter(e){return"percents"===e?this._riskInPercentsFormatter:this._riskInMoneyFormatter}getRiskStep(e){return"percents"===e?.01:1}_roundValue(e){return parseFloat(e.toFixed(2))}hasEditableCoordinates(){return!1}_recalculateRisk(){var e=this.properties(),t=e.riskDisplayMode.value(),i=e.riskSize.value(),s=e.accountSize.value(),r=e.risk.value();r="percents"===t?this._roundValue(i/s*100):this._roundValue(s/100*r),this._riskInChange=!0,e.risk.setValue(this.riskFormatter(t).format(r)),this._riskInChange=!1}_recalculateRiskSize(){if(!this._riskInChange){var e=this.properties(),t=e.risk.value(),i=e.riskDisplayMode.value(),s=e.accountSize.value();"percents"===i?e.riskSize.setValue(t/100*s):t>s?(e.risk.setValue(s),e.riskSize.setValue(s)):e.riskSize.setValue(t)}}lastBarData(){var e=this._model.mainSeries().bars().firstIndex(),t=this._model.mainSeries().bars().lastIndex();if(null===e||null===t||isNaN(e)||isNaN(t))return null;var i=this.points();if(4===i.length){var s=i[c.ActualClose];return s.index<e?null:{closePrice:s.price,index:Math.min(t,s.index)}}var r=i[c.Close];if(r.index<e)return null;var n=Math.min(t,r.index),o=this._model.mainSeries().bars().search(n,m.NearestLeft);return null===o?null:{closePrice:o.value[TradingView.CLOSE_PLOT],index:o.index}}migrateVersion(e,t,i){if(1===e&&this._points.length>=1){var s=[];if(s.push(this._points[0]),n={price:(n=this._points[0]).price,index:this._getClosePointIndex(n.index)},s.push(n),this._points[1]&&s.push(this._points[1]),this._points[2]&&s.push(this._points[2]),this._points=s,this._timePoint.length>=1){var r=[],n=this._timePoint[0];r.push(n);var o={price:n.price,time_t:n.time_t,offset:this._getClosePointIndex(n.offset)};r.push(o),this._timePoint[1]&&s.push(this._points[1]),this._timePoint[2]&&s.push(this._points[2]),this._timePoint=r}}}checkAlert(){this.recalculate()}priceAxisViews(e,t){return this.isSourceHidden()||t!==this.priceScale()||this._model.paneForSource(this)!==e?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]}updateAllViews(){this.isActualSymbol()&&this._properties.visible.value()&&(o.hideAllDrawings().value()&&this.userEditEnabled()||(super.updateAllViews(),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))}restoreExternalState(e){
|
||
(e=Object.assign({},e),this.isActualSymbol())||_(e.entryPrice)&&(this._timePoint[0].price=e.entryPrice,delete e.entryPrice);this.properties().merge(e)}_changeEntryPoint(e){var t=this.properties().stopPrice.value(),i=this.properties().targetPrice.value(),s=1/this._model.mainSeries().base(),r=Math.min(t,i)+s,n=Math.max(t,i)-s;e.price=Math.max(r,Math.min(n,this._roundPrice(e.price))),super.setPoint(0,e),this.properties().stopPrice.setValue(t),this.properties().targetPrice.setValue(i)}setPoint(e,t,i){if(this.isActualSymbol()){switch(this._muteSyncLineStyle(),e){case 0:this._changeEntryPoint(t);break;case 2:this.properties().stopPrice.setValue(this.preparseStopPrice(t.price));break;case 3:this.properties().targetPrice.setValue(this.preparseProfitPrice(t.price));break;case 1:t.price=this._roundPrice(t.price),super.setPoint(1,t),this.recalculate()}this._unmuteSyncLineStyleWithoutApplyingChanges(),this.syncPriceLevels()}}getPoint(e){switch(e){case 0:return this._points[0];case 1:return{index:this._points[1].index,price:this._points[0].price};case 2:return{index:this._points[0].index,price:this.stopPrice()};case 3:return{index:this._points[0].index,price:this.profitPrice()}}return null}setPoints(e){this._muteSyncLineStyle(),super.setPoints(e),this.recalculate(),this._unmuteSyncLineStyleWithoutApplyingChanges(),this.syncPriceLevels()}syncPriceLevels(){if(this.linkKey){var e=this.properties(),t={entryPrice:e.entryPrice.value(),stopLevel:e.stopLevel.value(),profitLevel:e.profitLevel.value()};o.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}}pointsCount(){return 1}name(){return"Risk/Reward"}addPoint(e){e.price=this._roundPrice(e.price),super.addPoint(e,null,!0);var t={price:e.price,index:this._getClosePointIndex(e.index)};super._addPointIntenal(t,null,!0);var i=this.calculateActualEntry(e,t);i&&(super._addPointIntenal(i,null,!0),(t=this.findClosePoint(i,t))&&super._addPointIntenal(t,null,!0));return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}setOwnerSource(e){super.setOwnerSource(e),this._model.mainSeries().symbolInfo()&&(this._recalculateAmount(),this._recalculateQty())}_roundPrice(e){var t=this._model.mainSeries().base();return Math.round(e*t)/t}recalculate(){if(0!==this.points().length){var e=this.properties().targetPrice.value(),t=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],s=this.calculateActualEntry(this.points()[0],this.points()[1]);if(s){i.push(s);var r=this.findClosePoint(s,this.points()[1]);r&&i.push(r)}this._points=i,e!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),t!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice)}}start(){super.start(),this.recalculate()}startMoving(e,t,i){e.logical.price=this._roundPrice(e.logical.price),super.startMoving(e,t,i)}move(e,t,i){e.logical.price=this._roundPrice(e.logical.price),super.move(e,t,i),this.recalculate(),this._entryPriceAxisView.update()}_correctPoints(e){
|
||
return!!this.isActualSymbol()&&r.prototype._correctPoints.call(this,[e[0],e[1]])}entryPrice(){return this.points()[0].price}findClosePoint(e,t){for(var i=this._model.mainSeries().bars(),r=s(i.firstIndex()),n=Math.max(e.index,r),o=s(i.lastIndex()),a=Math.min(o,t.index),l=n;l<=a;l++){var c=i.valueAt(l);if(null!==c){var h=this.checkStopPrice(c);if(null!=h)return{index:l,price:h}}}return null}calculateActualEntry(e,t){var i=this._model.mainSeries().bars();if(i.isEmpty())return null;for(var r=s(i.firstIndex()),n=Math.max(e.index,r),o=e.price,a=s(i.lastIndex()),l=Math.min(a,t.index),c=n;c<=l;c++){var h=i.valueAt(c);if(null!==h&&h[TradingView.HIGH_PLOT]>=o&&h[TradingView.LOW_PLOT]<=o)return{index:c,price:o}}return null}axisPoints(){if(!this._points[c.ActualEntry])return[];var e=this._points[c.ActualEntry],t=null;if(4===this._points.length)t=this._points[c.ActualClose];else{var i=this.lastBarData();if(!i)return[];t={index:i.index,price:i.closePrice}}return[e,t]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"RYNR"))).RiskRewardDefinitionsViewModel}template(){var e=this.properties(),t=r.prototype.template.call(this);return t.stopLevel=e.stopLevel.value(),t.profitLevel=e.profitLevel.value(),t}_applyTemplateImpl(e){delete e.targetPrice,delete e.stopPrice,delete e.entryPrice,super._applyTemplateImpl(e);var t=this.properties();void 0!==e.stopLevel&&t.stopLevel.setValue(e.stopLevel),void 0!==e.profitLevel&&t.profitLevel.setValue(e.profitLevel)}getOrderTemplate(){return null}_propertiesStateExclusions(){return["entryPrice","stopPrice","targetPrice"]}static _configureProperties(e){r._configureProperties(e),e.addExclusion("stopLevel"),e.addExclusion("profitLevel"),e.addExclusion("stopPrice"),e.addExclusion("targetPrice"),e.addExclusion("entryPrice")}_roundQty(e){var t=this._model.mainSeries().symbolInfo();return"bitcoin"===t.type||"crypto"===t.type||"futures"===t.type?Math.round(1e3*e)/1e3:Math.floor(e)}_getClosePointIndex(e){var t=this._model.timeScale(),i=Math.round(t.width()/t.barSpacing());return e+Math.max(3,Math.round(.15*i))}}f.version=2;class g extends f{constructor(e,t){super(e,t||g.createProperties());var i=this.properties();i.entryPrice.subscribe(this,this._recalculateQty),i.stopPrice.subscribe(this,this._recalculateQty),i.riskSize.subscribe(this,this._recalculateQty),i.entryPrice.subscribe(this,this._recalculateAmount),i.profitLevel.subscribe(this,this._recalculateAmount),i.stopLevel.subscribe(this,this._recalculateAmount),i.accountSize.subscribe(this,this._recalculateAmount),i.riskSize.subscribe(this,this._recalculateAmount),i.qty.subscribe(this,this._recalculateAmount)}_recalculateQty(){if(0!==this.points().length){var e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),s=e.riskSize.value(),r=this._model.mainSeries().pointValue(),n=this._roundQty(s/(Math.abs(i-t)*r));e.qty.setValue(n)}}_recalculateAmount(){if(0!==this.points().length){
|
||
var e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),s=e.qty.value(),r=e.stopPrice.value(),n=e.targetPrice.value(),o=this._model.mainSeries().pointValue(),a=this._roundValue(t+(i-n)*s*o),l=this._roundValue(t-(r-i)*s*o);e.amountTarget.setValue(a),e.amountStop.setValue(l)}}name(){return"Risk/Reward short"}stopPrice(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()}profitPrice(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()}calculatePL(e){return this.entryPrice()-e}preparseStopPrice(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)}preparseProfitPrice(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)}checkStopPrice(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.HIGH_PLOT]>=t?this.stopPrice():e[TradingView.LOW_PLOT]<=i?this.profitPrice():null}_orderSide(){throw new Error("not supported")}static createProperties(e){var t=new a("linetoolriskrewardshort",e);return g._configureProperties(t),t}static _configureProperties(e){f._configureProperties(e)}}class v extends f{constructor(e,t){super(e,t||v.createProperties());var i=this.properties();i.entryPrice.subscribe(this,this._recalculateQty),i.stopPrice.subscribe(this,this._recalculateQty),i.riskSize.subscribe(this,this._recalculateQty),i.entryPrice.subscribe(this,this._recalculateAmount),i.profitLevel.subscribe(this,this._recalculateAmount),i.stopLevel.subscribe(this,this._recalculateAmount),i.accountSize.subscribe(this,this._recalculateAmount),i.riskSize.subscribe(this,this._recalculateAmount),i.qty.subscribe(this,this._recalculateAmount)}_recalculateQty(){if(0!==this.points().length){var e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),s=e.riskSize.value(),r=this._model.mainSeries().pointValue(),n=this._roundQty(s/(Math.abs(t-i)*r));e.qty.setValue(n)}}_recalculateAmount(){if(0!==this.points().length){var e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),s=e.qty.value(),r=e.stopPrice.value(),n=e.targetPrice.value(),o=this._model.mainSeries().pointValue(),a=this._roundValue(t+(n-i)*s*o),l=this._roundValue(t-(i-r)*s*o);e.amountTarget.setValue(a),e.amountStop.setValue(l)}}stopPrice(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()}profitPrice(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()}calculatePL(e){return e-this.entryPrice()}preparseStopPrice(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)}preparseProfitPrice(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)}checkStopPrice(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.LOW_PLOT]<=t?this.stopPrice():e[TradingView.HIGH_PLOT]>=i?this.profitPrice():null}name(){return"Risk/Reward long"}_orderSide(){throw new Error("not supported")}
|
||
static createProperties(e){var t=new a("linetoolriskrewardlong",e);return v._configureProperties(t),t}static _configureProperties(e){f._configureProperties(e)}}t.LineToolRiskRewardLong=v,t.LineToolRiskRewardShort=g}).call(this,i("Qb4w").PriceRange)},tG6Q:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;class n extends s{constructor(e,t){super(e,t||n.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"GS+0",7)).then(({LineToolCircleLinesPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 2}name(){return"Cyclic Lines"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"LX4V"))).CyclicAndSineLinesPatternDefinitionsViewModel}static createProperties(e){var t=new r("linetoolcirclelines",e);return n._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolCircleLines=n},tWVy:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));var s=i("aIyQ");const r=new(i.n(s).a);function n(){r.fire()}},"tc+8":function(e,t,i){"use strict";(function(t){var s=i("ogJP").isFunction;function r(e){if(this._listeners=new t,this._childs=[],this._muteChildChanges=!1,void 0!==e)if(this.isPrimitiveType(e))this._value=e;else for(var i in e)this.addProperty(i,e[i])}r.prototype.merge=function(e,t){var i=null;if(t)var s=(i=[]).length;if(void 0===e)return i;if(this.isPrimitiveType(e))return t&&this._value!==e&&i.push(this),this._value=e,i;if(Array.isArray(e))for(var r=0;r<e.length;r++)if(this[r]){var n=this[r].merge(e[r],t);t&&(i=i.concat(n))}else this.addProperty(r,e[r]),t&&i.push(this[r]);else for(var o in e)if(this[o]){n=this[o].merge(e[o],t);t&&void 0!==n&&(i=i.concat(n))}else this.addProperty(o,e[o]),t&&i.push(this[o]);return t&&i.length>s&&i.push(this),i},r.prototype.mergeAndFire=function(e){var t=this.merge(e,!0);this._muteChildChanges=!0,t.forEach((function(e){e._muteChildChanges=!0})),t.forEach((function(e){e._muteChildChanges=!1,e.listeners().fire(e)})),this._muteChildChanges=!1,t.length>0&&this.listeners().fire(this)},r.prototype.state=function(e){var t=s(this.value)?this.value():void 0;void 0===t&&(t={});for(var i=0;i<this._childs.length;i++){var r=this._childs[i];if(!e||-1===e.indexOf(r))if(e){for(var n=[],o=0;o<e.length;o++){var a=e[o];a.startsWith(r+".")&&n.push(a.substr(r.length+1))}t[r]=this[r].state(n)}else t[r]=this[r].state()}return t},r.prototype.clone=function(e){return new r(this.state())},r.prototype.isPrimitiveType=function(e){return null===e||(!!isNumber(e)||(!!new TradingView.TypeValidator(String).check(e)||TradingView.isBoolean(e)))},r.prototype.value=function(){return this._value},r.prototype.listeners=function(){return this._listeners},r.prototype.childCount=function(){return this._childs.length},r.prototype.childNames=function(){return this._childs},r.prototype.child=function(e){return this[e]},r.prototype.setValue=function(e,t){(this._value!==e||t)&&(this._value=e,
|
||
this._listeners.fire(this))},r.prototype.setValueSilently=function(e){this._value=e},r.prototype.addProperty=function(e,t){var i=new r(t);this[e]=i,this._childs.push(e),i.subscribe(this,this.childChanged)},r.prototype.removeProperty=function(e){this[e].unsubscribe(this,this.childChanged),delete this[e],this._childs=this._childs.filter((function(t){return t!==e}))},r.prototype.hasChild=function(e){return this._childs.indexOf(e)>=0},r.prototype.addChild=function(e,t){this[e]&&this[e].unsubscribe(this,this.childChanged),this[e]=t,-1===this._childs.indexOf(e)&&this._childs.push(e),t.subscribe(this,this.childChanged)},r.prototype.childChanged=function(e,t){this._muteChildChanges||this.listeners().fire(this)},r.prototype.subscribe=function(e,t){this.listeners().subscribe(e,t,!1)},r.prototype.unsubscribe=function(e,t){this.listeners().unsubscribe(e,t)},r.prototype.unsubscribeAll=function(e){this.listeners().unsubscribeAll(e)},r.prototype.childs=function(){return this},e.exports=r}).call(this,i("aIyQ"))},teHb:function(e,t,i){"use strict";i.r(t),i.d(t,"ratioStudyItem",(function(){return n}));var s=i("7dm8");class r extends s.a{_doCalculation(e,t,i,s){return e*t/(i*s)}}const n={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:s.b,plots:s.d,styles:s.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:s.c,id:"Ratio@tv-basicstudies-1"},constructor:r}},tqok:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));const s=-2e6},ttUj:function(e,t,i){"use strict";i.r(t),i.d(t,"Tooltip",(function(){return d}));i("oWyD");var s=i("Ialn"),r=i("ULlu"),n=i("3t3b"),o=i("MbIA");function a(e){return"string"==typeof e&&0!==e.trim().length}function l(e,t,i=!1,n=!1){if(e.hasOwnProperty("text")){var o=n&&Object(s.forceLTRStr)(e.text)||e.text;if(e.hasOwnProperty("color")&&i){const i=document.createElement("span");i.style.cssText="color: "+e.color,r.html(i,o),t.appendChild(i)}else r.html(t,o)}else{var a=n&&Object(s.forceLTRStr)(e)||e;r.html(t,a)}return t}function c(e,t){if(Array.isArray(e)&&2===e.length){const i=document.createElement("dl");i.appendChild(l(e[0],document.createElement("dt"))),i.appendChild(l(e[1],document.createElement("dd"),!0,!0)),t.appendChild(i)}else if(e.hasOwnProperty("br")&&e.br)t.appendChild(document.createElement("br"));else{const i=document.createElement("dl");i.appendChild(l(e,document.createElement("dt"))),t.appendChild(i),e.hasOwnProperty("listItem")&&i.classList.add("list-item")}}function h(e,t){var i=Object(s.forceLTRStr)(e.text);e.attr=e.attr||{};const n=document.createElement("a");r.attr(n,"href",e.href),r.addClass(n,e.class),r.attr(n,e.attr.name,e.attr.value),r.html(n,i),t.appendChild(n)}function u(e,t,i=""){if("string"==typeof e){var a=Object(s.forceLTRStr)(e);const i=document.createElement("h2");r.html(i,a),t.appendChild(i)}else if(e.hasOwnProperty("lines"))for(let s=0;s<e.lines.length;s++){const i=e.lines[s];if(i.hasOwnProperty("line"))if(0===s){if(!i.line.isEmpty){const e=document.createElement("h2");void 0!==i.options&&Boolean(i.options.noWrap)&&(e.style.whiteSpace="nowrap"),
|
||
r.html(e,i.line),t.appendChild(e)}}else c(i.line,t);else i.hasOwnProperty("link")&&h(i.link,t)}else{if(e.hasOwnProperty("indicator")){const i=document.createElement("h2");r.html(i,e.indicator),t.appendChild(i)}if(e.hasOwnProperty("timestamp")){const s=document.createElement("dl");s.classList.add("tv-chart-events-tooltip-date");const a=document.createElement("dd");r.html(a,function(e,t){const i=new Date(e+t),s=n.dateFormatProperty.value();return new o.a({dateFormat:s,timeFormat:"%h:%m",dateTimeSeparator:" "}).format(i)}(e.timestamp,i)||"—"),s.appendChild(a),t.appendChild(s)}const a=document.createElement("table");a.classList.add("tv-chart-events-table");const c=document.createElement("tr"),h=document.createElement("tr");a.appendChild(c),a.appendChild(h);const p=document.createElement("th");p.textContent=window.t("Actual"),c.appendChild(p);const _=document.createElement("th");_.textContent=window.t("Forecast"),c.appendChild(_);const m=document.createElement("th");m.textContent=window.t("Previous"),c.appendChild(m);const f=document.createElement("td");var l=e.actual&&Object(s.forceLTRStr)(e.actual);r.html(f,l||"—"),h.appendChild(f);const g=document.createElement("td");var u=e.forecast&&Object(s.forceLTRStr)(e.forecast);r.html(g,u||"—"),h.appendChild(g);const v=document.createElement("td");var d=e.previous&&Object(s.forceLTRStr)(e.previous);r.html(v,d||"—"),h.appendChild(v),t.appendChild(a)}}class d{constructor({direction:e="top",clickable:t=!1,width:i}={}){this._direction=e,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=void 0!==i?i:200,this._tooltip=document.createElement("div"),this._tooltip.classList.add("tv-chart-events-source__tooltip"),this._tooltip.style.position="absolute",this._tooltip.style.width=this._width+"px",this._tooltipContent=document.createElement("div"),this._tooltipContent.classList.add("tv-chart-events-source__tooltip__content"),this._tooltip.appendChild(this._tooltipContent),t&&this._tooltip.classList.add("tv-chart-events-source__tooltip--clickable")}show({items:e=[],x:t=0,y:i=0,wrapElement:s=null,timeOffset:n="",leftBorderColor:o=null}={}){if(!s||function(e){if(!e||0===e.length)return!0;for(let t=0;t<e.length;t++){if(a(e[t])||e[t].id||a(e[t].title))return!1;if(!e[t].lines)continue;const i=e[t].lines,s=i.length;for(let e=0;e<s;e++){const t=i[e];if(a(t)||a(t.line))return!1}}return!0}(e))return;const l=r.contentWidth(s),c=r.contentHeight(s);let h=!1,d=!1;if(this._tooltipShown||(s.appendChild(this._tooltip),this._tooltipShown=!0,h=!0,d=!0),t===this._tooltipX&&i===this._tooltipY||(h=!0),h){const e=Math.max(Math.min(t-this._width/2,l-this._width-10),0);this._tooltip.style.left=Math.round(e)+"px",this._tooltip.style.bottom=Math.round(c-i+10)+"px"}if(this._tooltipItems||(d=!0),!d)for(let r=e.length;r--;)if(this._tooltipItems[r]!==e[r]){d=!0;break}if(d){let t;if(e.length<=1)t=e;else{const i={};for(let t=e.length;t--;){let s=e[t].importance;null==s&&(s=-1),i[s]||(i[s]=[]),i[s].push(e[t])}const s=Object.keys(i).sort((e,t)=>e-t)
|
||
;if(s.length<=1)t=i[s[0]];else{t=[];for(let e=s.length;e--;){const r=i[s[e]];for(let e=r.length;e--;)t.push(r[e])}}}this._tooltipContent.innerHTML="";for(let e=t.length;e--;){const i=t[e];let s="";i.hasOwnProperty("importance")?("string"==typeof i.importance&&("earnings"===i.importance?s="--importance-earnings":"splits"===i.importance?s="--importance-splits":"dividends"===i.importance?s="--importance-dividends":"list"===i.importance&&(s="--importance-list")),0===i.importance?s="--importance-normal":i.importance>0&&(s="--importance-high")):o||(s="--importance-none");let a="tv-chart-events-source__tooltip__item";s&&(a+=" "+a+s);const l=document.createElement("div");r.attr(l,"class",a),o&&(l.style.borderLeftColor=o),u(i,l,n),this._tooltipContent.appendChild(l)}this._tooltipItems=e}"bottom"===this._direction&&(this._tooltip.style.bottom=Math.round(c-i-r.contentHeight(this._tooltipContent)+10)+"px")}hide(){this._tooltipShown&&(this._tooltip.parentElement&&this._tooltip.parentElement.removeChild(this._tooltip),this._tooltipShown=!1)}isOpened(){return this._tooltipShown}getElem(){return this._tooltip}}},txPx:function(e,t,i){"use strict";i.r(t),i.d(t,"LOGLEVEL",(function(){return n})),i.d(t,"getLogLevel",(function(){return _})),i.d(t,"isHighRateEnabled",(function(){return m})),i.d(t,"setLogLevel",(function(){return f})),i.d(t,"getRawLogHistory",(function(){return g})),i.d(t,"serializeLogHistoryEntry",(function(){return v})),i.d(t,"getLogHistory",(function(){return b})),i.d(t,"getLogger",(function(){return y})),i.d(t,"loggingOn",(function(){return C})),i.d(t,"loggingOff",(function(){return P}));const s="undefined"!=typeof window?window:{};let r=!1;try{localStorage.getItem(""),r=!0}catch(T){}var n;!function(e){e[e.ERROR=1]="ERROR",e[e.WARNING=2]="WARNING",e[e.INFO=3]="INFO",e[e.NORMAL=4]="NORMAL",e[e.DEBUG=5]="DEBUG"}(n||(n={}));let o=0;const a=[];let l=null,c=null,h=null,u=NaN,d=n.WARNING,p=!1;function _(){return d}function m(){return p}function f(e){e=Math.max(n.ERROR,Math.min(n.DEBUG,e)),d=e,x()}function g(e,t){let i=a.reduce((e,t)=>e.concat(t),[]);return i.sort((e,t)=>e.id-t.id),void 0!==t&&(i=i.filter(e=>e.subSystemId===t)),"number"==typeof e&&(i=i.slice(-e)),i}function v(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}function b(e,t){return function(e,t){let i,s=0,r=0;for(i=e.length-1;i>=1&&(s+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&(r=8*(1+encodeURIComponent(e[i-1]).length),s+r>t)));i--);return e.slice(i)}(g(e,t).map(v),75497472)}function S(e,t,i,s){if(t===c&&s.id===h)return;const r=new Date;if(e<=n.NORMAL&&function(e,t,i,s,r){const n={id:o,message:String(t),subSystemId:s,timestamp:Number(e)};o+=1,i.push(n),void 0!==r&&i.length>r&&i.splice(0,1)}(r,t,i,s.id,s.maxCount),e<=d&&(!s.highRate||m())&&(!l||s.id.match(l))){const i=r.toISOString()+":"+s.id+":"+t;switch(e){case n.DEBUG:console.debug(i);break;case n.INFO:case n.NORMAL:s.color?console.log("%c"+i,"color: "+s.color):console.log(i);break;case n.WARNING:console.warn(i);break;case n.ERROR:console.error(i)}c=t,
|
||
h=s.id,u&&clearTimeout(u),u=setTimeout(()=>{c=null,h=null,u=NaN},1e3)}}function y(e,t={}){const i=[];a.push(i);const s=Object.assign(t,{id:e});function r(e){return t=>S(e,t,i,s)}return{logDebug:r(n.DEBUG),logError:r(n.ERROR),logInfo:r(n.INFO),logNormal:r(n.NORMAL),logWarn:r(n.WARNING)}}const w=y("logger"),C=s.lon=(e,t)=>{f(n.DEBUG),w.logNormal("Debug logging enabled"),p=Boolean(e),l=t||null,x()},P=s.loff=()=>{f(n.INFO),w.logInfo("Debug logging disabled")};function x(){try{r&&(localStorage.setItem("tv.logger.logHighRate",String(p)),localStorage.setItem("tv.logger.loglevel",String(d)))}catch(e){w.logWarn(`Cannot save logger state (level: ${d}, high-rate: ${p}) to localStorage: ${e.message}`)}}!function(){p=!!r&&"true"===localStorage.getItem("tv.logger.logHighRate");let e=parseInt(r&&localStorage.getItem("tv.logger.loglevel")||"");Number.isNaN(e)&&(e=n.WARNING),f(e),w.logNormal(`Init with settings - level: ${d}, high-rate: ${p}`)}(),s.performance&&s.performance.now?w.logNormal("Sync logger and perf times, now is "+s.performance.now()):w.logWarn("Perf time is not available")},tzRX:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 19" width="33" height="19"><path fill="#2196F3" d="M29.032 7.382a5.47 5.47 0 0 1 .963 2.872A4.502 4.502 0 0 1 28.5 19H6a5.98 5.98 0 0 1-4.222-1.737l9.546-7.556c.35.187.75.293 1.176.293a2.49 2.49 0 0 0 1.066-.238l4.55 3.981a2.5 2.5 0 1 0 4.711-.157l6.205-6.204zm-1.414-1.414l-6.204 6.204A2.494 2.494 0 0 0 20.5 12a2.49 2.49 0 0 0-1.066.238l-4.55-3.981a2.5 2.5 0 1 0-4.801-.118L.608 15.638A6 6 0 0 1 6.061 7a8.001 8.001 0 0 1 15.625-1.227A5.474 5.474 0 0 1 24.5 5c1.157 0 2.231.358 3.118.968z"/></svg>'},"u+0B":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));const s=/[2-9]/g;class r{constructor(e=50){this._actualSize=0,this._usageTick=1,this._oldestTick=1,this._tick2Labels={},this._cache={},this._maxSize=e}reset(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}measureText(e,t,i){return this._getMetrics(e,t,i).width}yMidCorrection(e,t,i){const s=this._getMetrics(e,t,i);return((s.actualBoundingBoxAscent||0)-(s.actualBoundingBoxDescent||0))/2}_getMetrics(e,t,i){const r=i||s,n=String(t).replace(r,"0");if(this._cache[n])return this._cache[n].metrics;if(this._actualSize===this._maxSize){const e=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--}e.save(),e.textBaseline="middle";const o=e.measureText(n);return e.restore(),0===o.width&&t.length||(this._cache[n]={metrics:o,tick:this._usageTick},this._tick2Labels[this._usageTick]=n,this._actualSize++,this._usageTick++),o}}},u0yd:function(e,t,i){"use strict";var s=i("Zp/P").coordinateIsValid,r=i("gyZD").PaneRendererLine;t.PaneRendererArea=TradingView.PaneRendererArea=class extends r{constructor(e){e.forceLineColor=!1,super(e),this.color1=e.color1,this.color2=e.color2,this.bottom=e.bottom,this.isSeries=!!e.isSeries,this._simpleMode=e.simpleMode}_drawImpl(e){if(0!==this.items.length){
|
||
e.translate(-.5,-.5),e.lineCap="butt",e.strokeStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,e.lineWidth=1;for(var t=0;t<this.items.length&&!s(this.items[t].y);)t++;for(var i=this.items.length-1;i>=0&&!s(this.items[i].y);)i--;if(!(t>i)){for(var r={},n=this.items,o=t;o<=i;o++){var a=n[o];if(h=a.style?a.style.color:this.lineColor,o<i&&n[o+1].style){var l=n[o+1].style.color;if(h!==l){var c=r[l]||[];c.push(a),r[l]=c}}(u=r[h]||[]).push(a),r[h]=u}for(var h in r){var u=r[h];e.beginPath();var d=0;for(o=0;o<u.length;o++)u[o].style&&u[o].style.color!==h&&(e.moveTo(Math.round(u[d].x),this.bottom),this.walkLine(e,u.slice(d,o),!0,this.bottom),d=o);if(e.moveTo(Math.round(u[d].x),this.bottom),this.walkLine(e,u.slice(d,u.length),!0,this.bottom),e.closePath(),this.isSeries){var p=e.createLinearGradient(0,0,0,this.bottom);p.addColorStop(0,this.color1),p.addColorStop(1,this.color2),e.fillStyle=p,this._simpleMode=!0}else e.fillStyle=h;e.fill()}e.lineWidth=this.lineWidth,super._drawImpl(e)}}}}},u5Q5:function(e,t,i){"use strict";i.r(t),i.d(t,"loadSymbolSearchImpl",(function(){return u})),i.d(t,"bindToInput",(function(){return d})),i.d(t,"activateKeyPressHandler",(function(){return f})),i.d(t,"showDialog",(function(){return g})),i.d(t,"setSearchRequestDelay",(function(){return v}));var s=i("6et/"),r=i("h24c"),n=i("Kxc7"),o=i("mYjs"),a=i("pPtI"),l=i("PT1i"),c=i("FA0h"),h=i("JWMC");async function u(){return(await Promise.all([i.e(67),i.e(92),i.e(32),i.e(58),i.e("symbolsearch")]).then(i.t.bind(null,"m5UM",7))).default}function d(e,t){return u().then(i=>i.bindToInput(e,t))}function p(e){Object(a.setLastUsedResolution)(e),l.linking.interval.setValue(e)}let _=null;function m(e){if(!Object(r.globalKeypressMatches)(e))return!1;e.preventDefault();const t=String.fromCharCode(e.charCode);return function(e){return/[\d,]/.test(e)}(t)&&n.enabled("show_interval_dialog_on_key_press")?Object(o.showChangeIntervalDialog)({callback:p,ownerDocument:e.target&&e.target.ownerDocument},t):n.enabled("symbol_search_hot_key")&&(g({defaultValue:t,selectSearchOnInit:!1,source:"keyboard"}),Object(h.trackEvent)("GUI","SS","hotkey")),!0}function f(){s.pushBackListener("symbolEdit",m)}function g(e){const t=_=Object(c.a)().then(i=>{t===_&&i.showDefaultSearchDialog(e)});return t}function v(e){return u().then(t=>t.setSearchRequestDelay(e))}},uDHo:function(e,t,i){"use strict";var s,r;function n(e,t){return"period-back"===e.type&&"period-back"===t.type?e.value===t.value:"time-range"===e.type&&"time-range"===t.type&&(e.from===t.from&&e.to===t.to)}i.r(t),i.d(t,"Helpers",(function(){return s})),i.d(t,"TIMEFRAMETYPE",(function(){return r})),i.d(t,"areEqualTimeFrames",(function(){return n})),function(e){e.extractErrorReason=function(e){return e.params[1]}}(s||(s={})),function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(r||(r={}))},ufwo:function(e,t,i){"use strict";i.r(t),i.d(t,"rangesAreEqual",(function(){return n}));var s=i("uDHo"),r=i("LxhU");function n(e,t){return!!r.Interval.isEqual(e.res,t.res)&&Object(s.areEqualTimeFrames)(e.val,t.val)}
|
||
},ulZB:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o}));var s=i("aIyQ"),r=i.n(s);class n{constructor(e,t,i,s,n){this._onChange=new r.a,this._handleChange=()=>{this._onChange.fire(this.get())},this._crossTabEvents=e,this._jsonKeyValueStore=t,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=s,this.defaultStoreValue=this._serialize(n),this._subscribe()}get(){const e=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(e)}set(e,t){const i=this._serialize(e);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,i,t),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(e)}getOnChange(){return this._onChange}destroy(){this._unsubscribe(),this._onChange.destroy(),delete this._onChange}_subscribe(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)}_unsubscribe(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)}}class o extends n{_serialize(e){return e}_deserialize(e){return e}}},"v+eZ":function(e,t,i){"use strict";i.r(t);var s=i("txPx"),r=i("25b6");function n(e,t){e.preventDefault();const i=e.clipboardData;t.text&&i.setData("text/plain",t.text),t.html&&i.setData("text/html",t.html)}var o=i("Eyy1");const a=Object(s.getLogger)("Clipboard");class l{constructor(e){this._e=e}write(e){this._e&&0===this._e.eventPhase&&(a.logWarn("Cannot use an already dispatched ClipboardEvent for writing"),this._e=null);const t=this._toRaw(e);if(!(t.files.length>0))try{return this._e?n(this._e,t):function(e){let t=!1;const i=i=>{i.stopImmediatePropagation(),n(i,e),t=!0};try{document.addEventListener("copy",i,!0),document.execCommand("copy")}finally{document.removeEventListener("copy",i,!0)}if(!t)throw new Error("Could not copy data to clipboard")}(t),Promise.resolve()}catch(i){a.logDebug("Could not write using ClipboardEvent: "+i.message)}return this._writeUsingApi(t)}async _writeUsingApi(e){if(!navigator.clipboard||!navigator.clipboard.write||!window.ClipboardItem)throw new DOMException("ClipboardApi is not supported","NotSupportedError");const t={};for(const i of e.files)t[i.type]=i;return e.text&&(t["text/plain"]=e.text),e.html&&(t["text/html"]=e.html),navigator.clipboard.write([new window.ClipboardItem(t)])}_toRaw(e){const t={files:[]};t.text=e.text,void 0!==e.app?t.html=this._serializeAppData(e.app,e.text):e.html&&(t.html=e.html);for(const i of e.files||[])t.files.push(i);return t}_serializeAppData(e,t){return`<meta charset="utf-8"><span data-tradingview-clip="${Object(r.b)(e)}">${t?Object(r.b)(t.slice(0,256)):"📈"}</span>`}}class c{constructor(e){this._e=e}async read(){this._e&&0===this._e.eventPhase&&(a.logWarn("Cannot use an already dispatched ClipboardEvent for reading"),this._e=null);const e=this._e?this._readUsingEvent(this._e):await this._readUsingApi();return this._fromRaw(e)}_readUsingEvent(e){const t=Object(o.ensure)(e.clipboardData)
|
||
;e.preventDefault();const i={files:[]};for(let s=0;s<t.files.length;s++)i.files.push(t.files[s]);for(let s=0;s<t.items.length;s++){const e=t.items[s];"string"===e.kind&&("text/plain"===e.type?i.text=t.getData(e.type):"text/html"===e.type?i.html=t.getData(e.type):i.files.push(new Blob([t.getData(e.type)],{type:e.type})))}return i}async _readUsingApi(){if(!navigator.clipboard||!navigator.clipboard.read)throw new DOMException("ClipboardApi is not supported","NotSupportedError");let e,t;const i=[],s=await navigator.clipboard.read();for(const r of s)for(const s of r.types)"text/html"===s?e=r.getType(s).then(this._readBlobAsText):"text/plain"===s?t=r.getType(s).then(this._readBlobAsText):i.push(r.getType(s));return{text:await t,html:await e,files:await Promise.all(i)}}_fromRaw(e){const t={};if(void 0!==e.text&&(t.text=e.text),void 0!==e.html){const i=this._parseAppData(e.html);i?t.app=i:t.html=e.html}return e.files.length>0&&(t.files=e.files),t}_parseAppData(e){if(-1===e.slice(0,1024).indexOf("data-tradingview-clip"))return;const t=(new DOMParser).parseFromString(e,"text/html").querySelector("[data-tradingview-clip]");return t?t.getAttribute("data-tradingview-clip")||"":void 0}_readBlobAsText(e){return new Promise((t,i)=>{const s=new FileReader;s.onloadend=()=>{t(s.result)},s.onerror=()=>{i(s.error)},s.readAsText(e)})}}var h=i("d700");function u(e){const t=e.target;return null!==t&&1===t.nodeType&&Object(h.b)(t)}function d(e){const t=e.target;if(null===t)return!1;const i=(t.ownerDocument||t).getSelection();return null!==i&&!i.isCollapsed}i.d(t,"ChartClipboardHandler",(function(){return p}));class p extends class{constructor(e){this._callbacks=Object.assign({},e),this._boundOnCopy=this._onCopyEv.bind(this),this._boundOnCut=this._onCutEv.bind(this),this._boundOnPaste=this._onPasteEv.bind(this)}listen(){document.addEventListener("copy",this._boundOnCopy),document.addEventListener("cut",this._boundOnCut),document.addEventListener("paste",this._boundOnPaste)}async peek(){if("granted"!==(await navigator.permissions.query({name:"clipboard-read"})).state)throw new Error("clipboard-read is not granted");return new c(null).read()}uiRequestCopy(e){this._callbacks.copyRequested&&this._callbacks.copyRequested(new l(null),e)}uiRequestCut(e){this._callbacks.cutRequested&&this._callbacks.cutRequested(new l(null),e)}uiRequestPaste(e){this._callbacks.pasteRequested&&this._callbacks.pasteRequested(new c(null),e)}destroy(){document.removeEventListener("copy",this._boundOnCopy),document.removeEventListener("cut",this._boundOnCut),document.removeEventListener("paste",this._boundOnPaste)}_onCopyEv(e){e.defaultPrevented||this._callbacks.copyRequested&&this._callbacks.copyRequested(new l(e))}_onCutEv(e){e.defaultPrevented||this._callbacks.cutRequested&&this._callbacks.cutRequested(new l(e))}_onPasteEv(e){e.defaultPrevented||this._callbacks.pasteRequested&&this._callbacks.pasteRequested(new c(e))}}{_onCopyEv(e){if(!u(e)&&!d(e))return super._onCopyEv(e)}_onCutEv(e){if(!u(e)&&!d(e))return super._onCutEv(e)}_onPasteEv(e){
|
||
if(!u(e))return super._onPasteEv(e)}}},v5F8:function(e,t,i){"use strict";var s=i("5rJj"),r=i("aDyP").LineToolPitchfork;class n extends r{constructor(e,t){super(e,t||n.createProperties())}name(){return"Modified Schiff Pitchfork"}static createProperties(e){var t=new s("linetoolschiffpitchfork",e,!1,{range:[0,8]});return n._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolSchiffPitchfork=n},vAx0:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("f6yo").pointInCircle,n=i("VdBB").HitTestResult,o=i("Zy3/").CompositeRenderer,a=i("ttUj").Tooltip,l=(i("GH0z").PercentageFormatter,i("55Xp").roundToFirstValuable,i("LxhU").Interval,i("jCNj").utc_to_cal),c=i("jCNj").get_timezone,h=i("3t3b").dateFormatProperty,u=i("gQ5K").DateFormatter,d=i("ikwP"),p=d.Size,_=d.createDisconnectedCanvas,m=d.getPrescaledContext2D,f=i("cPgM").ScaledPaneRenderer,g=i("z+cS").VerticalLineRenderer,v=i("zDbI").CHART_FONT_FAMILY;class b extends f{constructor(e){super(),this.data=e,this._hittest=new n(n.CUSTOM,e)}hitTest(e){return r(e,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null}_drawImpl(e){var t=this.data.template;e.drawImage(t,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5,this.data.templateSize.w,this.data.templateSize.h)}}class S extends f{constructor(e,t){super(),this._data=e,this._paneView=t,this.textRenderer=new y(e.style.lollipop.importance)}_drawImpl(e){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:e.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()}hitTest(e){return null}}class y{constructor(e){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px "+v,this.lineSpacing=8,this.fillStyle="black",e&&(this.importance=e)}draw(e,t){for(var i=t.y,s=0;s<this.lines.length;s++){var r=this.lines[s];e.font=this.font,r.options.fontWeight&&(e.font=r.options.fontWeight+" "+this.font),e.fillStyle=this.fillStyle,r.renderer(e,r.line,{x:t.x,y:i}),i+=this.lineSpacing+this.fontHeight}}measure(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing}basicRenderer(e,t,i){e.fillText(t,i.x,i.y)}addMulticolorTextLine(e,t){this.addTextLine(e,t,this.multicolorRenderer)}addTextLine(e,t,i){i||(i=this.basicRenderer),t||(t={}),this.lines.push({line:e,renderer:i,options:t})}multicolorRenderer(e,t,i){for(var s=i.x,r=0;r<t.length;++r){var n=t[r];e.fillStyle=n.color,e.fillText(n.text,s,i.y),s+=e.measureText(n.text).width}}}t.ESDPaneView=class{constructor(e,t,i,s){this._lastClickedId=null,this._model=e,this._study=t,this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this._hideLollipops=!1,this.defaultStyle=i,this.hoveredStyle=s,
|
||
this._templatesSize=new p(300,150),this.templatesCache.hovered=void 0!==this.hoveredStyle?this.createTemplate(this.hoveredStyle):null,this.templatesCache.default=void 0!==this.defaultStyle?this.createTemplate(this.defaultStyle):null,this._onPaneBgChangeBound=this.onPaneBgChange.bind(this),e.backgroundColor().subscribe(this._onPaneBgChangeBound),e.mainSeries().onSymbolIntervalChanged().subscribe(this,this._onSymbolOrIntervalChanged)}destroy(){this._model.backgroundColor().unsubscribe(this._onPaneBgChangeBound),this._model.mainSeries().onSymbolIntervalChanged().unsubscribeAll(this)}onPaneBgChange(){void 0!==this.defaultStyle&&(this.defaultStyle.lollipop.fillStyle=this._model.backgroundColor().value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach((function(e){0===e.indexOf("default")&&(this.templatesCache[e]=null)}),this))}onClickOutside(){this.clearLastClicked()}clearLastClicked(){this._lastClickedId=null}closeTooltips(){for(var e in this._lollipops)if(this._lollipops.hasOwnProperty(e)){var t=this._lollipops[e];t.visible&&(t.tooltip.isOpened()&&t.tooltip.hide(),t.visible=!1)}}getLastClickedLollipopId(){return this._lastClickedId}_setStackStudies(){this._stackStudies=[]}_getY(){for(var e=0,t=this._model.panes(),i=t.length;i--;){var s=t[i];s.containsMainSeries()&&(e+=s.height())}return e}update(){this._invalidated=!0}updateImpl(){this._setStackStudies();var e=this,t=this._study.data(),i=this._model.timeScale(),s=i.visibleBarsStrictRange(),r=this._model.mainSeries().bars(),n=this._study.priceScale(),o=this._model.mainSeries().firstBar();if(n&&!n.isEmpty()&&!i.isEmpty()&&o&&t){0,this._hideLollipops=!1,this.closeTooltips();var a=this._getY(),l=s.firstBar(),c=s.lastBar();t.range(l,c).each((function(t,s){for(var o=0,h=0;h<e._stackStudies.length;++h)e._stackStudies[h].data().contains(t)&&++o;t>l&&t<c&&e.addLollipop(a,r,i,n,t,s,o)})),this.afterUpdate(a,r,i,n)}}addLollipop(e,t,i,r,n,o,l){var c=o[0],h=this._model.mainSeries().symbolInfo();if(h){var u=h.name,d=null,p=this._study.metaInfo().id+"_"+c+"_"+u,_=this._model.lastHittestData(),m=_&&_.id===p;if(m){var f=t.valueAt(n);if(null!==f){var g=f[TradingView.LOW_PLOT],v=this._model.mainSeries().firstValue();d=r.priceToCoordinate(g,v)}}this._lollipops[p]=Object.assign({id:p,visible:!0,basePoint:new s(i.indexToCoordinate(n),e),hovered:m||p===this.getLastClickedLollipopId(),barY:d,stack:l,tooltip:this._lollipops.hasOwnProperty(p)?this._lollipops[p].tooltip:new a({width:240})},this.extraData(o))}}afterUpdate(e,t,i){}extraData(e){throw new Error("Not Implemented")}createText(e,t){throw new Error("Not Implemented")}showBarLine(){return!0}getStyle(e,t){var i=e;if(t.stack&&(i+="_stack:"+t.stack),"hovered"===i)return this.hoveredStyle;if("default"===i)return this.defaultStyle;if(this._stylesCache||(this._stylesCache={}),!this._stylesCache[i]){var s=TradingView.clone("hovered"===e?this.hoveredStyle:this.defaultStyle);t.stack&&(s.lollipop.incHeight=24*t.stack),this._stylesCache[i]=s}return this._stylesCache[i]}hasTooltip(e){return!0}renderer(e,t){
|
||
if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._hideLollipops)return null;var i=new o;for(var r in this._lollipops)if(this._lollipops.hasOwnProperty(r)){var n=this._lollipops[r],a=this.getStyle(n.hovered?"hovered":"default",n);if(n.visible){var l=Object.assign({tooltipPoint:new s(n.basePoint.x,n.basePoint.y-a.lollipop.circleHeight-15-(a.lollipop.incHeight||0)),style:a,createText:this.createText.bind(this)},n),c=this.getTemplate(n.hovered?"hovered":"default",n),h={circlePoint:new s(n.basePoint.x,n.basePoint.y-a.lollipop.circleHeight-(a.lollipop.incHeight||0)),style:a,template:c,templateSize:this._templatesSize,basePoint:n.basePoint,id:n.id,clickHandler:this._lollipopMouseClickHandler.bind(this,n.id),tapHandler:this._lollipopMouseClickHandler.bind(this,n.id)};if(i.append(new b(h)),n.hovered&&this.hasTooltip(n)&&n.barY&&this.showBarLine()){var u={width:t,height:e,color:a.strokeStyle,linestyle:a.barLine.lineStyle,linewidth:a.lineWidth,x:n.basePoint.x,top:0,bottom:n.basePoint.y-a.lollipop.circleHeight},d=new g;d.setData(u),i.insert(d)}i.append(new S(l,this))}}return i}getTemplate(e,t){var i=e;return t.stack&&(i+="_stack:"+t.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(e,t))),this.templatesCache[i]}createTemplate(e){var t=_(document,this._templatesSize),i=m(t),r=new s(e.lollipop.width/2,e.lollipop.height-e.lollipop.circleHeight-(e.lollipop.incHeight||0));return this.drawCircle(i,e,r),this.drawLabel(i,e,r),t}drawCircle(e,t,i){e.strokeStyle=t.strokeStyle,e.fillStyle=t.lollipop.fillStyle,e.lineWidth=t.lollipop.lineWidth,CanvasEx.setLineStyle(e,CanvasEx.LINESTYLE_SOLID),e.beginPath(),e.arc(i.x,i.y,t.lollipop.radius,0,2*Math.PI,!1),e.closePath(),e.stroke(),t.lollipop.fillCircle&&e.fill()}drawLabel(e,t,i){e.textAlign="center",e.textBaseline="middle",e.fillStyle=t.lollipop.text.strokeStyle,e.font=t.lollipop.text.font,e.fillText(t.lollipop.text.label,i.x,i.y)}_lollipopMouseClickHandler(e){this._lastClickedId=this._lastClickedId===e?null:e}_formatDate(e){var t=c(this._model.properties().timezone.value()),i=l(t,e);return new u(h.value()).format(i)}_onSymbolOrIntervalChanged(){this.clearLastClicked(),this.closeTooltips()}}},vIQA:function(e,t,i){"use strict";var s=i("ocLq");i("2cgs");var r=i("hyq/").pivotPointsStandardStudyItem,n=i("krs7").volumeProfileVisibleRangeStudyItem,o=i("QCyK").spreadStudyItem,a=i("teHb").ratioStudyItem;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),s.Std.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 r=this._context.new_unlimited_var(this._context.symbol.time),n=s.Std[t(0)](this._context),o=this._context.new_unlimited_var(n);return this._context.select_sym(0),[o.adopt(r,i,0)]}}},{name:"Overlay",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},inputs:{symbol:""}},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:"Overlay@tv-basicstudies-1",format:{type:"price",precision:4}},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),s.Std.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 r=this._context.new_unlimited_var(this._context.symbol.time),n=this._context.new_unlimited_var(s.Std.open(this._context)),o=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context));return this._context.select_sym(0),[n.adopt(r,i,1),o.adopt(r,i,1),a.adopt(r,i,1),l.adopt(r,i,1)]}}},{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"}},palettes:{volumePalette:{colors:{0:{color:"#EF5350",width:1,style:0},1:{color:"#26A69A",width:1,style:0}}}},inputs:{showMA:!1,length:20,col_prev_close:!1}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool",isHidden:!0},{id:"length",name:"MA Length",defval:20,type:"integer",min:1,max:2e3},{defval:!1,id:"col_prev_close",name:"Color based on previous close",type:"bool"}],id:"Volume@tv-basicstudies-1",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){return s.Std.gt(e,t)?0:1},this.main=function(e,t){this._context=e,this._input=t
|
||
;var i=s.Std.volume(this._context),r=s.Std.volume(this._context),n=this._context.new_var(r),o=s.Std.sma(n,this._input(1),this._context),a=this._context.new_var(s.Std.close(this._context));return[i,a.get(1)&&this._input(2)?this.f_0(a.get(1),s.Std.close(this._context)):this.f_0(s.Std.open(this._context),s.Std.close(this._context)),o]}}},{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),r=this._input(1),n=i/100,o=Math.ceil(r/2);return[s.Std.zigzag(n,o,this._context),s.Std.zigzagbars(n,o,this._context)]}}},{name:"Sessions",metainfo:{_metainfoVersion:52,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break",halign:"left"}}},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}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){if(s.Std.isdwm(e))return null;var i=s.Std.time(e);if(isNaN(i))return null;var r=this._times.length;if(0!==r&&this._times[r-1]===i||this._times.push(i),!e.symbol.isLastBar||!e.symbol.isNewBar)return null;var n=this._getVerticalLineData(e);return 0===n.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:n}]},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.f_0=function(){var e=this._input(0),t=this._input(1),i=s.Std.atr(e,this._context),r=(e=s.Std.hl2(this._context)+i*t,i=s.Std.hl2(this._context)-i*t,this._context.new_var(s.Std.close(this._context))),n=(t=this._context.new_var(),s.Std.max(i,t.get(1)));return t.set(s.Std.gt(r.get(1),t.get(1))?n:i),i=this._context.new_var(),n=s.Std.min(e,i.get(1)),i.set(s.Std.lt(r.get(1),i.get(1))?n:e),e=this._context.new_var(),r=s.Std.nz(e.get(1),1),r=s.Std.lt(s.Std.close(this._context),t.get(1))?-1:r,e.set(s.Std.gt(s.Std.close(this._context),i.get(1))?1:r),[t=s.Std.eq(e.get(0),1)?t.get(0):i.get(0),s.Std.eq(e.get(0),1)?0:1,1===e.get(0)&&-1===e.get(1)?1:NaN,-1===e.get(0)&&1===e.get(1)?1:NaN]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}},r,n,o,a])},vPbs:function(e,t,i){"use strict";i.r(t),i.d(t,"CHART_WIDGET_COLLECTION_SERVICE",(function(){return r})),i.d(t,"chartWidgetCollectionService",(function(){return n})),i.d(t,"CollectionViewMode",(function(){return o}));var s=i("eqEH");const r={id:"ChartWidgetCollectionService"};function n(){return Object(s.hasService)(r)?Object(s.service)(r):null}var o;!function(e){e.Multichart="multichart",e.ForceFullscreen="force-fullscreen"}(o||(o={}))},vTIA:function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));const s={showPositions:!1,showOrders:!1,showExecutions:!1,extendLeft:!1,lineLength:0,lineWidth:0,lineStyle:0};var r;!function(e){e[e.Background=0]="Background",e[e.Foreground=1]="Foreground",e[e.Topmost=2]="Topmost"}(r||(r={}))},vaqD:function(e,t,i){"use strict";i.r(t),i.d(t,"LoadingScreen",(function(){return n}));var s=i("Kxc7"),r=i("YWnQ");class n{constructor(e,t){this._showed=!1,this._cw=e,this._element=document.createElement("div"),this._element.classList.add("chart-loading-screen"),this._shield=document.createElement("div"),this._shield.classList.add("chart-loading-screen-shield"),this._element.appendChild(this._shield),t.appendChild(this._element),this._cw.withModel(this,this._connectToModel)}show(){this._cw.setInLoadingState(!0),this._showed||(this._showed=!0,this._show())}hide(){this._cw.setInLoadingState(!1),this._showed&&this._hide()}isShown(){return this._showed}_connectToModel(){const e=this._cw.model().mainSeries().dataEvents();e.symbolError().subscribe(this,e=>{e!==r.permissionDenied&&this.hide()}),
|
||
e.seriesError().subscribe(this,()=>{Object(s.enabled)("hide_loading_screen_on_series_error")&&this.hide()}),e.completed().subscribe(this,this.hide)}_show(){const e=this._cw.properties().childs().paneProperties.childs().background.value();this._shield.style.background=e,this._element.classList.add("fade")}_hide(){this._showed=!1,this._element.classList.remove("fade")}}},vq8G:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionRenderer",(function(){return o}));var s=i("VdBB"),r=i("//lt"),n=i("f6yo");class o{constructor(e){this._data=e||null}setData(e){this._data=e}draw(e,t){if(null===this._data||!this._data.visible)return;const i=t.pixelRatio;e.strokeStyle=void 0!==this._data.color?this._data.color:"#1E88E5",e.lineCap="butt";const s=Math.max(1,Math.floor(i));e.lineWidth=s;const r=this._data.vertOffset||0;for(let o=0;o<this._data.points.length;++o){const t=this._data.points[o];(n=t,Number.isFinite(n.x)&&Number.isFinite(n.y))&&(e.fillStyle=this._data.bgColors[o],this._drawMarker(e,t,r,s,i))}var n}hitTest(e){if(!this._data||!this._data.visible)return null;for(let t=0;t<this._data.points.length;t++){const i=this._data.points[t];if(i.subtract(e).length()<=5.5){const e=void 0!==this._data.pointsCursorType?this._data.pointsCursorType[t]:r.PaneCursorType.Default;return new s.HitTestResult(this._data.hittestResult,{pointIndex:i.data,cursorType:e})}}return null}doesIntersectWithBox(e){return!!this._data&&this._data.points.some(t=>Object(n.pointInBox)(t,e))}_drawMarker(e,t,i,s,r){let n=Math.round(3.5*r*2);n%2!=s%2&&(n+=1);let o=Math.round(n+2*(.5*s+.75*r));o%2!=s%2&&(o+=1);const a=Math.round(t.x*r),l=Math.round((t.y+i)*r),c=s%2/2;e.beginPath(),e.arc(a+c,l+c,o/2,0,2*Math.PI,!0),e.closePath(),e.fill(),e.beginPath(),e.arc(a+c,l+c,n/2,0,2*Math.PI,!0),e.closePath(),e.stroke()}}},vu5c:function(e,t,i){"use strict";function s(e,t){const i=()=>{e.completed().unsubscribe(null,s),t(!1)},s=()=>{e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,s,!0)}i.r(t),i.d(t,"onSeriesCompletedOrErrorReceived",(function(){return s}))},vwKG:function(e,t,i){"use strict";i.r(t),i.d(t,"showTooManyStudiesNotice",(function(){return r}));var s=i("brCa");function r(e){"number"!=typeof e&&(e=TradingView.STUDY_COUNT_LIMIT),Object(s.showNoticeDialog)({title:window.t("Warning"),content:window.t("Studies limit exceeded: {0} studies per layout.\nPlease, remove some studies.").format(e)})}},w4Ji:function(e,t,i){"use strict";function s(e){const t=new Map;return e.plots.forEach((e,i)=>{t.set(e.id,e=>e[i+1])}),t}function r(e,t){return null==e[t]}i.r(t),i.d(t,"studyPlotFunctionMap",(function(){return s})),i.d(t,"studyEmptyPlotValuePredicate",(function(){return r}))},w9cH:function(e,t,i){"use strict";function s(e){if(e instanceof Error)return e.stack||e.message;try{return e.outerHTML.slice(0,1024)}catch(t){}try{if(void 0!==e)return JSON.stringify(e).slice(0,1024)}catch(i){}return String(e)}function r(){window.__tv_js_errors||(window.__tv_js_errors=[]),window.addEventListener("error",e=>{const t=(new Date).toISOString()
|
||
;window.__tv_js_errors.push(`${t} ${e.message||"JS error"}. ${e.filename||"<unknown url>"}, line ${e.lineno}, col ${e.colno}.\nError: `+s(e.error))},!1),window.addEventListener("unhandledrejection",e=>{const t=(new Date).toISOString();window.__tv_js_errors.push(t+" Unhandled rejection.\nReason: "+s(e.reason))},!1),document.addEventListener("securitypolicyviolation",e=>{var t,i;const r=(new Date).toISOString(),n="report"===e.disposition?"CSP report-only":"CSP violation";window.__tv_js_errors.push(`${r} ${n}: ${e.violatedDirective||e.effectiveDirective}. ${e.sourceFile||"<unknown url>"}, line ${null!==(t=e.lineno)&&void 0!==t?t:e.lineNumber}, col ${null!==(i=e.colno)&&void 0!==i?i:e.columnNumber}.\nBlocked URI: ${e.blockedURL||e.blockedURI}\nSample: ${e.sample}\nTarget: `+s(e.target))},!1)}i.r(t),i.d(t,"install",(function(){return r}))},wGNx:function(e,t,i){"use strict";var s;i.r(t),i.d(t,"RiskRewardPointIndex",(function(){return s})),function(e){e[e.Entry=0]="Entry",e[e.Close=1]="Close",e[e.ActualEntry=2]="ActualEntry",e[e.ActualClose=3]="ActualClose"}(s||(s={}))},wOSo:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("IWXC"),r=i("aIyQ"),n=i.n(r),o=i("e3/o");class a{constructor(){this._quotes=null,this._quoteSessionSymbol=null,this._quoteSessionClientId="",this._quotesUpdate=new n.a,this._quoteSymbolChanged=new n.a}setQuotesSessionSymbol(e){this._quoteSessionSymbol!==e&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+Object(o.guid)()),this._unsubscribeQuoteSession(),this._quotes=null,e&&(this._quoteSessionSymbol=e,Object(s.getQuoteSessionInstance)("full").subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,this._onUpdate.bind(this))),this._quoteSymbolChanged.fire())}quotesUpdate(){return this._quotesUpdate}quoteSymbolChanged(){return this._quoteSymbolChanged}quotes(){return this._quotes}destroy(){this._unsubscribeQuoteSession()}_onUpdate(e,t){this._quotes=e&&e.values||null,t&&t.values&&this._quotesUpdate.fire(e,t)}_unsubscribeQuoteSession(){this._quoteSessionSymbol&&(Object(s.getQuoteSessionInstance)("full").unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=null,this._quotes=null)}}},wVAQ:function(e,t,i){"use strict";i.r(t),i.d(t,"fetch",(function(){return r}));var s=i("txPx");Object(s.getLogger)("Fetch");function r(e,t,i={}){return window.fetch(e,t)}},wYrq:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("aO4+"),n=i("eJTA"),o=i("Kxc7"),a=i("Hr11"),l=i("ogJP"),c=i("Tmoa"),h=i("dOnf");var u=i("VdBB"),d=i("u0yd"),p=i("Zy3/"),_=i("gyZD"),m=i("Zp8I"),f=i("k9/m"),g=i("o2pV"),v=i("vq8G"),b=i("i6cO"),S=i("Zp/P");class y{constructor(e){this._data=e}draw(e,t){const i=this._data,s=t.pixelRatio,r=Math.max(1,Math.floor(s))%2?.5:0,n=i.vertOffset||0,o=i.lineColor||i.color,a=i.lineWidth||i.height/2;let c="",h=!1;for(const u of i.items){const t=u.x,i=u.y+n;if(Object(l.isNaN)(t)||Object(l.isNaN)(i))continue;let d,p;null!=u.style?(d=u.style.color,p=u.style.width):(d=o,p=a),d!==c&&(c=d,h&&e.fill(),e.beginPath(),e.fillStyle=d)
|
||
;const _=Math.round(t*s)+r,m=Math.round(i*s)+r,f=Math.round(p*s)+r;e.moveTo(_+f,m),e.arc(_,m,f,0,2*Math.PI,!1),h=!0}h&&e.fill()}hitTest(e){const t=this._data,i=t.lineWidth||t.height/2,s=t.vertOffset||0,n=Object(S.interactionTolerance)().series+i;for(const o of t.items){if(!o)continue;if(new r.Point(o.x,o.y+s).subtract(e).length()+i<=n)return new u.HitTestResult(u.HitTestResult.REGULAR)}return null}}class w{constructor(e){this._data=null,this._precalculatedCache=[],this.setData(e)}setData(e){this._data=e,this._precalculatedCache=[]}draw(e,t){if(null===this._data||0===this._data.items.length)return;const i=t.pixelRatio;this._precalculatedCache.length||this._fillPrecalculatedCache(i);const s=Math.max(1,Math.floor(i)),r=Math.round(this._data.histogramBase*i)-Math.floor(s/2),n=r+s,o=this._data.lineColor;for(let a=0;a<this._data.items.length;a++){const t=this._data.items[a],l=this._precalculatedCache[a],c=Math.round(t.y*i),h=t.style?t.style.color:o;let u,d;e.fillStyle=h,c<=r?(u=c,d=n):(u=r,d=c-Math.floor(s/2)+s),e.fillRect(l.left,u,l.right-l.left+1,d-u)}}hitTest(e){if(null===this._data)return null;const t=.5*this._data.barSpacing,i=e.x-t,s=e.x+t;for(const r of this._data.items){const t=r.x;if(t>=i&&t<=s){const t=r.y;if(e.y>=Math.min(t,this._data.histogramBase)&&e.y<=Math.max(t,this._data.histogramBase))return new u.HitTestResult(u.HitTestResult.REGULAR)}}return null}_fillPrecalculatedCache(e){if(null===this._data||0===this._data.items.length)return void(this._precalculatedCache=[]);const t=Math.ceil(this._data.barSpacing*e)<=1?0:Math.max(1,Math.floor(e)),i=Math.round(this._data.barSpacing*e)-t;this._precalculatedCache=new Array(this._data.items.length);for(let r=0;r<this._data.items.length;r++){const t=this._data.items[r],s=Math.round(t.x*e);let n,o;if(i%2){const e=(i-1)/2;n=s-e,o=s+e}else{const e=i/2;n=s-e,o=s+e-1}this._precalculatedCache[r]={left:n,right:o,roundedCenter:s,center:t.x*e,time:t.timePointIndex}}for(let r=1;r<this._data.items.length;r++){const e=this._precalculatedCache[r],i=this._precalculatedCache[r-1];e.time===i.time+1&&(e.left-i.right!==t+1&&(i.roundedCenter>i.center?i.right=e.left-t-1:e.left=i.right+t+1))}let s=Math.ceil(this._data.barSpacing*e);for(let r=0;r<this._data.items.length;r++){const e=this._precalculatedCache[r];e.right<e.left&&(e.right=e.left);const t=e.right-e.left+1;s=Math.min(t,s)}if(t>0&&s<4)for(let r=0;r<this._data.items.length;r++){const e=this._precalculatedCache[r];e.right-e.left+1>s&&(e.roundedCenter>e.center?e.right-=1:e.left+=1)}}}var C=i("GEp6");class P{constructor(e){this._data=e}draw(e,t){var i,s,r,n;const o=t.pixelRatio;let a="",c=!1;for(const h of this._data.items){if(Object(l.isNaN)(h.x)||Object(l.isNaN)(h.y))continue;const t=null!==(s=null===(i=h.style)||void 0===i?void 0:i.color)&&void 0!==s?s:this._data.lineColor,u=Math.max(1,Math.floor((null!==(n=null===(r=h.style)||void 0===r?void 0:r.width)&&void 0!==n?n:this._data.lineWidth)*o));t!==a&&(a=t,c&&e.fill(),e.beginPath(),e.fillStyle=t);let d=3*u;d%2!=u%2&&(d+=1)
|
||
;const p=Math.round(Math.round(h.x*o)-d/2),_=Math.round(Math.round(h.y*o)-d/2),m=p+Math.floor(d/2-u/2),f=_+Math.floor(d/2-u/2);e.rect(p,f,d,u),e.rect(m,_,u,d),c=!0}c&&e.fill()}hitTest(e){const t=Object(S.interactionTolerance)().series+this._data.lineWidth/2;let i,s,n,o;for(let a=1;a<this._data.items.length;++a){i=this._data.items[a-1],s=this._data.items[a],n=i.x,o=s.x;if(Object(C.distanceToSegment)(new r.Point(n,i.y),new r.Point(o,s.y),new r.Point(e.x,e.y)).distance<=t)return new u.HitTestResult(u.HitTestResult.REGULAR)}return null}}class x{constructor(e){this._data=e}draw(e,t){if(0===this._data.items.length)return;const i=t.pixelRatio;e.fillStyle=this._data.lineColor;const s=Math.max(1,Math.floor(this._data.lineWidth*i)),r=s/2,n=Math.max(1,Math.floor(i)),o=Math.round(this._data.histogramBase*i)-Math.floor(n/2),a=o+n;for(const l of this._data.items){let t=s,c=r;l.style?(e.fillStyle=l.style.color,t=Math.max(1,Math.floor(l.style.width*i)),c=t/2):e.fillStyle=this._data.lineColor;const h=t%2?.5:0,u=Math.round(l.x*i)+h,d=Math.round(l.y*i);let p,_;d<=o?(p=d,_=a):(p=o,_=d-Math.floor(n/2)+n),e.fillRect(Math.floor(u-c),p,t,_-p)}}hitTest(e){const t=Object(S.interactionTolerance)().series+this._data.lineWidth/2,i=new Map;for(const n of this._data.items){const o=n.x,a=n.y;let l=t;n.style&&(i.has(n.style.width)?l=Object(s.ensureDefined)(i.get(n.style.width)):i.set(this._data.lineWidth,l));if(Object(C.distanceToSegment)(new r.Point(o,a),new r.Point(o,this._data.histogramBase),new r.Point(e.x,e.y)).distance<=l)return new u.HitTestResult(u.HitTestResult.REGULAR)}return null}}var T=i("23IT"),M=i("UAFa");i.d(t,"StudyPlotPaneView",(function(){return O}));const I=e=>{const t=Object(n.rgbToHsl)(Object(n.parseRgb)(e)),i=t[0]+.05;return t[0]=i-Math.floor(i),Object(n.rgbToHexString)(Object(n.hslToRgb)(t))},L=function(e,t){const i=new Map;return function(...s){const r=""+(t?t.apply(null,s):s[0]);if(!i.has(r)){const t=e.apply(this,s);return i.set(r,t),t}return i.get(r)}}(I);class O{constructor(e,t,i,s){this._histogramBase=null,this._items=[],this._selectionData=null,this._lineColor="",this._lineWidth=1,this._color1="",this._color2="",this._invalidated=!1,this._isMarkersEnabled=o.enabled("source_selection_markers"),this._study=e,this._series=t,this._model=i,this._plotName=s,this._plotIndex=e.metaInfo().plots.findIndex(e=>e.id===s),this._colorProvider=Object(M.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),s),this._selectionIndexer=new g.SelectionIndexes(i.timeScale())}items(){return this._items}update(){this._invalidated=!0}renderer(){const e=this._study.properties().styles[this._plotName];if(!e.visible.value())return null;if(!this._study.priceScale())return null;this._invalidated&&(this._updateImpl(),this._invalidated=!1);const t={};t.barSpacing=this._model.timeScale().barSpacing(),t.items=this._items,t.histogramBase=this._histogramBase?this._histogramBase:Object(s.ensureNotNull)(this._study.priceScale()).height(),t.lineIndex=0,t.lineStyle=e.linestyle.value(),t.lineColor=this._lineColor,t.lineWidth=this._lineWidth,
|
||
t.lineWidth=Object(l.isNumber)(t.lineWidth)?t.lineWidth:1,t.color1=this._color1,t.color2=this._color2,t.bottom=t.histogramBase,t.simpleMode=this._colorProvider.singleColor();const i=new p.CompositeRenderer,r=!!e.joinPoints&&e.joinPoints.value();switch(e.plottype.value()){case T.LineStudyPlotStyle.Line:case T.LineStudyPlotStyle.LineWithBreaks:i.append(new _.PaneRendererLine(t));break;case T.LineStudyPlotStyle.Area:case T.LineStudyPlotStyle.AreaWithBreaks:i.append(new d.PaneRendererArea(t));break;case T.LineStudyPlotStyle.Histogram:i.append(new x(t));break;case T.LineStudyPlotStyle.Columns:i.append(new w(t));break;case T.LineStudyPlotStyle.Cross:if(i.append(new P(t)),r){const e=Object(h.deepCopy)(t);e.lineWidth=1,e.forceLineWidth=!0,i.append(new _.PaneRendererLine(e))}break;case T.LineStudyPlotStyle.Circles:if(i.append(new y(t)),r){const e=Object(h.deepCopy)(t);e.lineWidth=1,e.ignorePaletteLineWidth=!0,i.append(new _.PaneRendererLine(e))}break;case T.LineStudyPlotStyle.StepLine:{const e=new m.PaneRendererStepLine;e.setData(t),i.append(e);break}default:i.append(new _.PaneRendererLine(t))}return this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&this._selectionData&&i.append(new v.SelectionRenderer(this._selectionData)),i}_getTranspValue(){const e=this._study.properties(),t=e.styles[this._plotName];let i=0;const s=this._study.metaInfo();return"Volume@tv-basicstudies"===s.id&&s.version<=46&&"transparency"in e?(i=e.transparency.value(),i=Object(l.isNumber)(i)?i:0,i):(t.transparency&&(i=t.transparency.value(),i=Object(l.isNumber)(i)?i:0),i)}_updateImpl(){var e,t,i,n,o;this._histogramBase=null,this._items=[];const l=this._study.priceScale();if(this._model.timeScale().isEmpty()||null===l||l.isEmpty())return;const h=this._model.timeScale().visibleBarsStrictRange();if(null===h)return;let d=null!==(e=this._series.nearestIndex(h.firstBar()-1,f.PlotRowSearchMode.NearestLeft))&&void 0!==e?e:this._series.bars().firstIndex(),p=null!==(t=this._series.nearestIndex(h.lastBar()+1,f.PlotRowSearchMode.NearestRight))&&void 0!==t?t:this._series.bars().lastIndex();if(null===d||null===p)return;const _=this._study.offset(this._plotName);_>0?(d-=_,p+=_):(d+=_,p-=_);const m=this._study.getMinFirstBarIndexForPlot(this._plotName);if(m>p)return;d=Math.max(m,d);const g=this._study.properties().styles[this._plotName],v=g.plottype.value(),S=[T.LineStudyPlotStyle.Line,T.LineStudyPlotStyle.Area,T.LineStudyPlotStyle.Circles,T.LineStudyPlotStyle.Cross].indexOf(v)>=0,y=this._study.data(),w=this._study.firstValue();if(null===w)return;const C=y.rangeIterator(d,p),P=this._study.priceScale();if(null===P)return;const x=Object(a.clamp)(this._getTranspValue(),0,100),M=new Map,O=(e,t)=>{let i=M.get(e);void 0===i&&(i=new Map,M.set(e,i));let s=i.get(t);if(void 0===s){const r=!this._plotName||"vol"!==this._plotName;s=Object(c.generateColor)(e,t,r),i.set(t,s)}return s};let A=NaN;const E=Object(b.createEmptyStyle)();for(;C.hasNext();){const e=C.next();let t=e.index;const o=e.value;t+=_,t=Math.floor(t);let a=o[this._plotIndex+1];const l=null==a
|
||
;if(a=l?NaN:a,S&&l)continue;const h=new r.Point(t,Object(s.ensure)(a));h.timePointIndex=t;if(this._colorProvider.isColorDefined()&&(h.style={color:O(g.color.value(),100),width:g.linewidth.value(),style:g.linestyle.value()},null!=a)){const e=this._colorProvider.getPlotPointStyle(o,E),t=e.colors[b.ColorerType.Main];void 0!==t&&(h.style.color=Object(c.isHexColor)(t)?O(t,x):t),h.style.width=null!==(i=e.lineWidth)&&void 0!==i?i:h.style.width,h.style.style=null!==(n=e.lineStyle)&&void 0!==n?n:h.style.style}S||isNaN(A)||A===t-1||this._items.push(new r.Point(t-1,NaN)),A=t,this._items.push(h)}if(P.pointsArrayToCoordinates(this._items,w),this._model.timeScale().timedValuesToCoordinates(this._items),g.histogramBase&&(this._histogramBase=P.priceToCoordinate(g.histogramBase.value(),w)),this._model.selection().isSelected(this._study)){const e=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,hittestResult:u.HitTestResult.REGULAR,barSpacing:this._model.timeScale().barSpacing()};const t=Object(s.ensureNotNull)(this._model.paneForSource(this._study)).height();for(let i=0;i<e.length;i++){let s=e[i];const n=this._study.data().valueAt(s);if(s+=_,null===n)continue;const o=n[this._plotIndex+1];if(null==o)continue;const a=this._model.timeScale().indexToCoordinate(Math.floor(s)),l=P.priceToCoordinate(o,w);this._selectionData.points.push(new r.Point(a,l)),this._selectionData.bgColors.push(this._model.backgroundColorAtYPercentFromTop(l/t))}}else this._selectionIndexer.clear();const k=g;this._lineColor=Object(c.generateColor)(k.color.value(),x),this._lineWidth=k.linewidth.value();let D=k.color.value();const V=this._colorProvider.getDefaultPlotPointStyle();V&&(D=V.colors[b.ColorerType.Main],this._lineWidth=null!==(o=V.lineWidth)&&void 0!==o?o:this._lineWidth,this._lineColor=D?Object(c.generateColor)(D,x):this._lineColor),this._color2=Object(c.generateColor)(D,x);const B=this._study.metaInfo().isRGB?I(D):L(D);this._color1=Object(c.generateColor)(B,x)}}},wZIs:function(e,t,i){"use strict";var s=i("dfhE"),r=i("rCHB").LineToolPitchforkStyle,n=i("Ye2/").LineToolBarsPatternMode,o=i("23IT").LineStudyPlotStyle,a=i("8OdW"),l=i("oXaB").PriceAxisLastValueMode,c=i("XXdw").StoriesTimeLineItemType,h=i("4o++").MagnetMode,u=i("a7Ha").LineEnd,d=i("4vW/").ColorType,p=i("bKFv").StatsPosition,_=i("KUek").sessionsPreferencesDefault,m=i("txPx").getLogger("Chart.Defaults"),f=i("zDbI").CHART_FONT_FAMILY,g=function(e){var t=function(e,t){return{color:e,visible:t}},i=function(e,t,i){return{coeff:e,color:t,visible:i}},m=function(e,t,i,s,r){return{coeff:e,color:t,visible:i,linestyle:void 0===s?CanvasEx.LINESTYLE_SOLID:s,linewidth:void 0===r?1:r}},g=function(e,t,i){return{color:e,width:i,visible:t}},v=function(e,t,i,s,r){return{color:e,visible:t,width:i,x:s,y:r}},y=function(e,t,i,s,r,n){return{coeff1:e,coeff2:t,color:i,visible:s,linestyle:void 0===r?CanvasEx.LINESTYLE_SOLID:r,linewidth:void 0===n?1:n}};if(void 0===TradingView.defaultProperties){var w;switch(window.locale){case"ar_AE":w="Asia/Dubai";break;case"au":w="Australia/Sydney"
|
||
;break;case"br":w="America/Sao_Paulo";break;case"ca":w="America/Toronto";break;case"de_DE":case"it":w="Europe/Berlin";break;case"es":w="Europe/Madrid";break;case"fa_IR":w="Asia/Tehran";break;case"fr":case"sv_SE":w="Europe/Paris";break;case"he_IL":case"tr":w="Europe/Athens";break;case"hu_HU":case"pl":w="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":w="Asia/Bangkok";break;case"in":w="Asia/Kolkata";break;case"ja":case"kr":w="Asia/Tokyo";break;case"ms_MY":w="Asia/Singapore";break;case"ru":w="Europe/Moscow";break;case"uk":w="Europe/London";break;case"zh_CN":case"zh_TW":w="Asia/Shanghai";break;default:w="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:w,priceScaleSelectionStrategyName:"auto",dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{backgroundType:d.Solid,background:"#ffffff",backgroundGradientStartColor:"#ffffff",backgroundGradientEndColor:"#ffffff",vertGridProperties:{color:"rgba(42, 46, 57, 0.06)",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"rgba(42, 46, 57, 0.06)",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#9598A1",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:10,bottomMargin:8,axisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0,showBarChange:!0,showBackground:!0,backgroundTransparency:50,wrapText:!1}},scalesProperties:{backgroundColor:"#ffffff",lineColor:"rgba(42, 46, 57, 0.14)",textColor:"#131722",fontSize:12,scaleSeriesOnly:!1,showSeriesLastValue:!0,seriesLastValueMode:l.LastValueAccordingToScale,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1,showBidAskLabels:!1,showPrePostMarketPriceLabel:!0,showFundamentalNameLabel:!1,showFundamentalLastValue:!1,barSpacing:a.DEFAULT_BAR_SPACING,showCurrency:!0,showUnit:!0},mainSeriesProperties:{style:s.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 235, 77, 92, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,bidAsk:{visible:!1,lineStyle:CanvasEx.LINESTYLE_DOTTED,lineWidth:1,bidLineColor:"#2196F3",askLineColor:"#EF5350"},prePostMarket:{visible:!0,lineStyle:CanvasEx.LINESTYLE_DOTTED,lineWidth:1,preMarketColor:"#fb8c00",postMarketColor:"#2196f3"},highLowAvgPrice:{highLowPriceLinesVisible:!1,highLowPriceLabelsVisible:!1,averageClosePriceLineVisible:!1,averageClosePriceLabelVisible:!1},showInDataWindow:!0,visible:!0,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",baseLineColor:"#B2B5BE",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",minTick:"default",extendedHours:!1,dividendsAdjustment:void 0,sessVis:!1,statusViewStyle:{
|
||
fontSize:16,showExchange:!0,showInterval:!0,symbolTextSource:"description"},candleStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350",barColorsOnPrevClose:!1,drawBody:!0},hollowCandleStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",drawBody:!0},haStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{},drawBody:!0},barStyle:{upColor:"#26a69a",downColor:"#ef5350",barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},hiloStyle:{color:"#2196f3",showBorders:!0,borderColor:"#2196f3",showLabels:!0,labelColor:"#2196f3",fontSize:7,drawBody:!0},lineStyle:{color:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",styleType:s.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba(33, 150, 243, 0.28)",color2:"#2196f3",linecolor:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",transparency:100},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,isInverted:!1,alignLabels:!0},renkoStyle:{upColor:"#26a69a",downColor:"#ef5350",borderUpColor:"#26a69a",borderDownColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",inputs:{source:"close",sources:"Close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"source"},sources:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"#26a69a",downColor:"#ef5350",borderUpColor:"#26a69a",borderDownColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"#26a69a",downColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"#26a69a",downColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",
|
||
reversalAmount:3,boxSize:1,style:"ATR",atrLength:14,oneStepBackBuilding:!1},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR length"},oneStepBackBuilding:{name:"One step back building"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 38, 166, 154, 0.28)",topFillColor2:"rgba( 38, 166, 154, 0.05)",bottomFillColor1:"rgba( 239, 83, 80, 0.05)",bottomFillColor2:"rgba( 239, 83, 80, 0.28)",topLineColor:"rgba( 38, 166, 154, 1)",bottomLineColor:"rgba( 239, 83, 80, 1)",topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},rangeStyle:{upColor:"#26a69a",downColor:"#ef5350",thinBars:!0,upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{range:10,phantomBars:!1},inputInfo:{range:{name:"Range"},phantomBars:{name:"Phantom bars"}}}},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_SOLID},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},sessions:_,drawings:{magnet:!1,magnetMode:h.WeakMagnet,stayInDrawingMode:!1,drawOnAllCharts:!0},linetoolorder:{extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineActiveBuyColor:"rgb(64,148,232)",lineInactiveBuyColor:"rgba(64,148,232,.5)",lineActiveSellColor:"rgb(231,86,86)",lineInactiveSellColor:"rgba(231,86,86,.5)",lineStyle:"inherit",lineWidth:"inherit",bodyBorderActiveBuyColor:"rgb(64,148,232)",bodyBorderInactiveBuyColor:"rgba(64,148,232,.5)",bodyBorderActiveSellColor:"rgb(231,86,86)",bodyBorderInactiveSellColor:"rgba(231,86,86,.5)",bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextInactiveLimitColor:"rgba(38,140,2,.5)",bodyTextActiveLimitColor:"rgb(38,140,2)",bodyTextInactiveStopColor:"rgba(231,86,86,.5)",bodyTextActiveStopColor:"rgb(231,86,86)",bodyTextInactiveBuyColor:"rgba(64,148,232,.5)",bodyTextActiveBuyColor:"rgb(64,148,232)",bodyTextInactiveSellColor:"rgba(231,86,86,.5)",bodyTextActiveSellColor:"rgb(231,86,86)",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderActiveBuyColor:"rgb(64,148,232)",quantityBorderInactiveBuyColor:"rgba(64,148,232,.5)",quantityBorderActiveSellColor:"rgb(231,86,86)",quantityBorderInactiveSellColor:"rgba(231,86,86,.5)",quantityBackgroundInactiveBuyColor:"rgba(64,148,232,.5)",quantityBackgroundActiveBuyColor:"rgb(64,148,232)",quantityBackgroundInactiveSellColor:"rgba(231,86,86,.5)",quantityBackgroundActiveSellColor:"rgb(231,86,86)",quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderActiveBuyColor:"rgb(64,148,232)",cancelButtonBorderInactiveBuyColor:"rgba(64,148,232,.5)",
|
||
cancelButtonBorderActiveSellColor:"rgb(231,86,86)",cancelButtonBorderInactiveSellColor:"rgba(231,86,86,.5)",cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconActiveBuyColor:"rgb(64,148,232)",cancelButtonIconInactiveBuyColor:"rgba(64,148,232,.5)",cancelButtonIconActiveSellColor:"rgb(231,86,86)",cancelButtonIconInactiveSellColor:"rgba(231,86,86,.5)",tooltip:"",modifyTooltip:"",cancelTooltip:""},linetoolposition:{extendLeft:"inherit",lineLength:"inherit",lineBuyColor:"rgb(64,148,232)",lineSellColor:"rgb(231,86,86)",lineStyle:"inherit",lineWidth:"inherit",bodyBorderBuyColor:"rgb(64,148,232)",bodyBorderSellColor:"rgb(231,86,86)",bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextPositiveColor:"rgb(38,140,2)",bodyTextNeutralColor:"rgb(100,100,100)",bodyTextNegativeColor:"rgb(231,86,86)",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderBuyColor:"rgb(64,148,232)",quantityBorderSellColor:"rgb(231,86,86)",quantityBackgroundBuyColor:"rgb(64,148,232)",quantityBackgroundSellColor:"rgb(231,86,86)",quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderBuyColor:"rgb(64,148,232)",reverseButtonBorderSellColor:"rgb(231,86,86)",reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconBuyColor:"rgb(64,148,232)",reverseButtonIconSellColor:"rgb(231,86,86)",closeButtonBorderBuyColor:"rgb(64,148,232)",closeButtonBorderSellColor:"rgb(231,86,86)",closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconBuyColor:"rgb(64,148,232)",closeButtonIconSellColor:"rgb(231,86,86)",tooltip:"",protectTooltip:"",closeTooltip:"",reverseTooltip:""},linetoolexecution:{direction:"buy",arrowHeight:8,arrowSpacing:1,arrowBuyColor:"#4094e8",arrowSellColor:"#e75656",text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:10,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{color:"rgba( 61, 133, 198, 1)",size:40,icon:61720,angle:.5*Math.PI,scale:1},linetoolimage:{transparency:.5},linetoolbezierquadro:{linecolor:"#2196f3",linewidth:1,fillBackground:!1,backgroundColor:"rgba(33, 150, 243, 0.2)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal},linetoolbeziercubic:{linecolor:"#00bcd4",linewidth:1,fillBackground:!1,backgroundColor:"rgba(0, 188, 212, 0.2)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal},linetooltrendline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",font:"Verdana",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,
|
||
showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolinfoline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!0,showMiddlePoint:!1,showPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,showDistance:!0,showAngle:!0,statsPosition:p.Center},linetooltimecycles:{linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1,statsPosition:p.Right},linetooldisjointangle:{linecolor:"rgba(0, 150, 136, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(0, 150, 136, 0.2)",transparency:20,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal,font:"Verdana",textcolor:"rgba(0, 150, 136, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{linecolor:"rgba(171, 71, 188, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(171, 71, 188, 0.2)",transparency:20,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Normal,font:"Verdana",textcolor:"rgba(171, 71, 188, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{counterclockwise:!1,linecolor:"rgba(0, 150, 136, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:f,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba(30,136,229,0.9)",extendTop:!1,extendBottom:!1},linetoolpricerange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:f,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba(30,136,229,0.9)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:f,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,borderWidth:1,drawBorder:!1,
|
||
borderColor:"rgba(30,136,229,1)"},linetoolriskrewardshort:{linecolor:"rgba(120, 123, 134, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",fillBackground:!0,stopBackground:"rgba(244, 67, 54, 0.2)",profitBackground:"rgba(0, 150, 136, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,lotSize:1,risk:25,alwaysShowStats:!1,showPriceLabels:!0},linetoolriskrewardlong:{linecolor:"rgba(120, 123, 134, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",fillBackground:!0,stopBackground:"rgba(244, 67, 54, 0.2)",profitBackground:"rgba(0, 150, 136, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,lotSize:1,risk:25,alwaysShowStats:!1,showPriceLabels:!0},linetoolarrow:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:u.Normal,rightEnd:u.Arrow,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolray:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:u.Normal,rightEnd:u.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolextended:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:u.Normal,rightEnd:u.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolhorzline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLine:!0,showTime:!0,showLabel:!1,horzLabelsAlign:"right",
|
||
vertLabelsAlign:"top",font:"Verdana",textcolor:"#2196f3",textOrientation:"vertical",fontsize:14,bold:!1,italic:!1},linetoolcrossline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showTime:!0},linetoolcirclelines:{trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:f,fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m(0,"rgba(120, 123, 134, 1)",!0),level2:m(1,"rgba(33, 150, 243, 1)",!0),level3:m(2,"rgba(33, 150, 243, 1)",!0),level4:m(3,"rgba(33, 150, 243, 1)",!0),level5:m(5,"rgba(33, 150, 243, 1)",!0),level6:m(8,"rgba(33, 150, 243, 1)",!0),level7:m(13,"rgba(33, 150, 243, 1)",!0),level8:m(21,"rgba(33, 150, 243, 1)",!0),level9:m(34,"rgba(33, 150, 243, 1)",!0),level10:m(55,"rgba(33, 150, 243, 1)",!0),level11:m(89,"rgba(33, 150, 243, 1)",!0)},linetooltext:{color:"#2196f3",font:"Verdana",fontsize:14,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:200},linetooltextabsolute:{color:"#2196f3",font:"Verdana",fontsize:14,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,fixedSize:!1,wordWrap:!1,wordWrapWidth:200},linetoolballoon:{color:"#ffffff",backgroundColor:"rgba(156, 39, 176, 0.7)",borderColor:"rgba(156, 39, 176, 0.0)",fontsize:14,transparency:30},linetoolbrush:{linecolor:"#00bcd4",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba(0, 188, 212, 0.5)",transparency:50,leftEnd:u.Normal,rightEnd:u.Normal},linetoolhighlighter:{linecolor:"rgba(236, 64, 122, 0.15)",smooth:5,transparency:85},linetoolpolyline:{linecolor:"#7e57c2",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(126, 87, 194, 0.2)",transparency:50,filled:!1},linetoolsignpost:{itemType:c.Emoji,emoji:"🙂",showImage:!1,plateColor:"#2962FF",fontSize:12,bold:!1,italic:!1},linetoolpath:{lineColor:"#2196f3",lineWidth:2,lineStyle:CanvasEx.LINESTYLE_SOLID,leftEnd:u.Normal,rightEnd:u.Arrow},linetoolarrowmarkleft:{color:"#2196F3",arrowColor:"#2196F3",fontsize:20,font:f,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkup:{color:"#009688",arrowColor:"#009688",fontsize:20,font:f,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkright:{color:"#2196F3",arrowColor:"#2196F3",fontsize:20,font:f,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkdown:{color:"#E53935",arrowColor:"#E53935",fontsize:20,font:f,bold:!1,italic:!1,showLabel:!0},linetoolflagmark:{flagColor:"#2196F3"},
|
||
linetoolnote:{markerColor:"#2196f3",textColor:"#ffffff",backgroundColor:"rgba(33, 150, 243, 0.7)",backgroundTransparency:0,borderColor:"#2196f3",font:"Verdana",fontSize:14,bold:!1,italic:!1,fixedSize:!0},linetoolnoteabsolute:{markerColor:"#2196f3",textColor:"#ffffff",backgroundColor:"rgba(33, 150, 243, 0.7)",backgroundTransparency:0,borderColor:"#2196f3",font:"Verdana",fontSize:14,bold:!1,italic:!1,fixedSize:!0},linetoolpricelabel:{color:"#ffffff",backgroundColor:"#2196f3",borderColor:"#2196f3",fontWeight:"bold",fontsize:14,font:f,transparency:0},linetoolpricenote:{showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textColor:"#2962FF",fontSize:14,bold:!1,italic:!1,snapTo45Degrees:!0,lineColor:"#2962FF",priceLabelBackgroundColor:"#2962FF",priceLabelBorderColor:"#2962FF",priceLabelTextColor:"#ffffff",priceLabelFontSize:12,priceLabelBold:!1,priceLabelItalic:!1},linetoolarrowmarker:{backgroundColor:"#1E88E5",textColor:"#1E88E5",font:f,bold:!0,italic:!1,fontsize:16,showLabel:!0},linetoolrectangle:{color:"#9c27b0",fillBackground:!0,backgroundColor:"rgba(156, 39, 176, 0.2)",linewidth:1,snapTo45Degrees:!0,transparency:50,showLabel:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",textColor:"#9c27b0",fontSize:14,bold:!1,italic:!1,extendLeft:!1,extendRight:!1},linetoolrotatedrectangle:{color:"#4caf50",fillBackground:!0,backgroundColor:"rgba(76, 175, 80, 0.2)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{color:"#e91e63",fillBackground:!0,backgroundColor:"rgba(233, 30, 99, 0.2)",transparency:50,linewidth:1},linetoolarc:{color:"#ab47bc",fillBackground:!0,backgroundColor:"rgba(171, 71, 188, 0.2)",transparency:50,linewidth:1},linetoolprediction:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,sourceBackColor:"rgba(33, 150, 243, 1)",sourceTextColor:"rgba(255, 255, 255, 1)",sourceStrokeColor:"rgba(33, 150, 243, 1)",targetStrokeColor:"rgba(33, 150, 243, 1)",targetBackColor:"rgba(33, 150, 243, 1)",targetTextColor:"rgba(255, 255, 255, 1)",successBackground:"rgba(76, 175, 80, 1)",successTextColor:"rgba(255, 255, 255, 1)",failureBackground:"rgba(244, 67, 54, 1)",failureTextColor:"rgba(255, 255, 255, 1)",intermediateBackColor:"rgba(234, 210, 137, 1)",intermediateTextColor:"rgba(109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{color:"#f57c00",fillBackground:!0,backgroundColor:"rgba(245, 124, 0, 0.2)",transparency:50,linewidth:1},linetoolcallout:{color:"#ffffff",backgroundColor:"rgba(0, 151, 167, 0.7)",transparency:50,linewidth:1,fontsize:14,font:"Verdana",bordercolor:"rgba(0, 151, 167, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:200},linetoolparallelchannel:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba(33, 150, 243, 0.2)",transparency:20,showMidline:!0,midlinecolor:"rgba(33, 150, 243, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,
|
||
showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{color:"rgba(33, 150, 243, 1)",mode:n.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{averageHL:20,variance:50,candleStyle:{upColor:"rgba(178, 223, 219, 1)",downColor:"rgba(239, 154, 154, 1)",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"rgba(0, 150, 136, 1)",borderDownColor:"rgba(244, 67, 54, 1)",wickColor:"rgba(120, 123, 134, 1)"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{fillBackground:!0,transparency:80,style:r.Original,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:m(.25,"rgba(255, 183, 77, 1)",!1),level1:m(.382,"rgba(129, 199, 132, 1)",!1),level2:m(.5,"rgba(76, 175, 80, 1)",!0),level3:m(.618,"rgba(0, 150, 136, 1)",!1),level4:m(.75,"rgba(100, 181, 246, 1)",!1),level5:m(1,"rgba(33, 150, 243, 1)",!0),level6:m(1.5,"rgba(156, 39, 176, 1)",!1),level7:m(1.75,"rgba(233, 30, 99, 1)",!1),level8:m(2,"rgba(229, 115, 115, 1)",!1)},linetoolpitchfan:{fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m(.25,"rgba(255, 183, 77, 1)",!1),level1:m(.382,"rgba(129, 199, 132, 1)",!1),level2:m(.5,"rgba(76, 175, 80, 1)",!0),level3:m(.618,"rgba(0, 150, 136, 1)",!1),level4:m(.75,"rgba(100, 181, 246, 1)",!1),level5:m(1,"rgba(33, 150, 243, 1)",!0),level6:m(1.5,"rgba(156, 39, 176, 1)",!1),level7:m(1.75,"rgba(233, 30, 99, 1)",!1),level8:m(2,"rgba(229, 115, 115, 1)",!1)},linetoolgannfan:{showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:y(1,8,"rgba(255, 183, 77, 1)",!0),level2:y(1,4,"rgba(129, 199, 132, 1)",!0),level3:y(1,3,"rgba(76, 175, 80, 1)",!0),level4:y(1,2,"rgba(0, 150, 136, 1)",!0),level5:y(1,1,"rgba(100, 181, 246, 1)",!0),level6:y(2,1,"rgba(33, 150, 243, 1)",!0),level7:y(3,1,"rgba(156, 39, 176, 1)",!0),level8:y(4,1,"rgba(233, 30, 99, 1)",!0),level9:y(8,1,"rgba(229, 115, 115, 1)",!0)},linetoolganncomplex:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{font:f,fontSize:12,bold:!1,italic:!1},levels:[g("rgba(120, 123, 134, 1)",!0,1),g("rgba(255, 152, 0, 1)",!0,1),g("rgba(129, 199, 132, 1)",!0,1),g("rgba(76, 175, 80, 1)",!0,1),g("rgba(0, 150, 136, 1)",!0,1),g("rgba(120, 123, 134, 1)",!0,1)],
|
||
fanlines:[v("rgba(179, 157, 219, 1)",!1,1,8,1),v("rgba(244, 67, 54, 1)",!1,1,5,1),v("rgba(120, 123, 134, 1)",!1,1,4,1),v("rgba(255, 152, 0, 1)",!1,1,3,1),v("rgba(129, 199, 132, 1)",!0,1,2,1),v("rgba(76, 175, 80, 1)",!0,1,1,1),v("rgba(0, 150, 136, 1)",!0,1,1,2),v("rgba(0, 150, 136, 1)",!1,1,1,3),v("rgba(33, 150, 243, 1)",!1,1,1,4),v("rgba(149, 117, 205, 1)",!1,1,1,5),v("rgba(179, 157, 219, 1)",!1,1,1,8)],arcs:[v("rgba(255, 152, 0, 1)",!0,1,1,0),v("rgba(255, 152, 0, 1)",!0,1,1,1),v("rgba(255, 152, 0, 1)",!0,1,1.5,0),v("rgba(129, 199, 132, 1)",!0,1,2,0),v("rgba(129, 199, 132, 1)",!0,1,2,1),v("rgba(76, 175, 80, 1)",!0,1,3,0),v("rgba(76, 175, 80, 1)",!0,1,3,1),v("rgba(0, 150, 136, 1)",!0,1,4,0),v("rgba(0, 150, 136, 1)",!0,1,4,1),v("rgba(33, 150, 243, 1)",!0,1,5,0),v("rgba(33, 150, 243, 1)",!0,1,5,1)]},linetoolgannfixed:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[g("rgba(120, 123, 134, 1)",!0,1),g("rgba(255, 152, 0, 1)",!0,1),g("rgba(129, 199, 132, 1)",!0,1),g("rgba(76, 175, 80, 1)",!0,1),g("rgba(0, 150, 136, 1)",!0,1),g("rgba(120, 123, 134, 1)",!0,1)],fanlines:[v("rgba(179, 157, 219, 1)",!1,1,8,1),v("rgba(244, 67, 54, 1)",!1,1,5,1),v("rgba(120, 123, 134, 1)",!1,1,4,1),v("rgba(255, 152, 0, 1)",!1,1,3,1),v("rgba(129, 199, 132, 1)",!0,1,2,1),v("rgba(76, 175, 80, 1)",!0,1,1,1),v("rgba(0, 150, 136, 1)",!0,1,1,2),v("rgba(0, 150, 136, 1)",!1,1,1,3),v("rgba(33, 150, 243, 1)",!1,1,1,4),v("rgba(149, 117, 205, 1)",!1,1,1,5),v("rgba(179, 157, 219, 1)",!1,1,1,8)],arcs:[v("rgba(255, 152, 0, 1)",!0,1,1,0),v("rgba(255, 152, 0, 1)",!0,1,1,1),v("rgba(255, 152, 0, 1)",!0,1,1.5,0),v("rgba(129, 199, 132, 1)",!0,1,2,0),v("rgba(129, 199, 132, 1)",!0,1,2,1),v("rgba(76, 175, 80, 1)",!0,1,3,0),v("rgba(76, 175, 80, 1)",!0,1,3,1),v("rgba(0, 150, 136, 1)",!0,1,4,0),v("rgba(0, 150, 136, 1)",!0,1,4,1),v("rgba(33, 150, 243, 1)",!0,1,5,0),v("rgba(33, 150, 243, 1)",!0,1,5,1)]},linetoolgannsquare:{color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:f,showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:t("rgba(149, 152, 161, 1)",!1),hlevel1:i(0,"rgba(120, 123, 134, 1)",!0),hlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),hlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),hlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),hlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),hlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),hlevel7:i(1,"rgba(120, 123, 134, 1)",!0),vlevel1:i(0,"rgba(120, 123, 134, 1)",!0),vlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),vlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),vlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),vlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),vlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),vlevel7:i(1,"rgba(120, 123, 134, 1)",!0)},linetoolfibspeedresistancefan:{fillBackground:!0,transparency:80,grid:{color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:f,showTopLabels:!0,showBottomLabels:!0,
|
||
showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,reverse:!1,hlevel1:i(0,"rgba(120, 123, 134, 1)",!0),hlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),hlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),hlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),hlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),hlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),hlevel7:i(1,"rgba(120, 123, 134, 1)",!0),vlevel1:i(0,"rgba(120, 123, 134, 1)",!0),vlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),vlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),vlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),vlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),vlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),vlevel7:i(1,"rgba(120, 123, 134, 1)",!0)},linetoolfibretracement:{showCoeffs:!0,showPrices:!0,font:f,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0),level12:i(1.272,"rgba(129, 199, 132, 1)",!1),level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetoolfibchannel:{showCoeffs:!0,showPrices:!0,font:f,fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0),level12:i(1.272,"rgba(129, 199, 132, 1)",!1),level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),
|
||
level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetoolprojection:{showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba(33, 150, 243, 0.2)",color2:"rgba(156, 39, 176, 0.2)",linewidth:1,trendline:{visible:!0,color:"rgba(149, 152, 161, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:m(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{color:"#2196F3",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"#2196F3",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolcypherpattern:{color:"#2196F3",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#2196F3",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetooltrianglepattern:{color:"#673AB7",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#673AB7",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolabcd:{color:"#009688",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:1},linetoolthreedrivers:{color:"#673AB7",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolheadandshoulders:{color:"#009688",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"#009688",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolfibwedge:{showCoeffs:!0,font:f,fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:m(.236,"rgba(244, 67, 54, 1)",!0),level2:m(.382,"rgba(129, 199, 132, 1)",!0),level3:m(.5,"rgba(76, 175, 80, 1)",!0),level4:m(.618,"rgba(0, 150, 136, 1)",!0),level5:m(.786,"rgba(100, 181, 246, 1)",!0),level6:m(1,"rgba(120, 123, 134, 1)",!0),level7:m(1.618,"rgba(33, 150, 243, 1)",!1),level8:m(2.618,"rgba(244, 67, 54, 1)",!1),level9:m(3.618,"rgba(103, 58, 183, 1)",!1),level10:m(4.236,"rgba(233, 30, 99, 1)",!1),level11:m(4.618,"rgba(233, 30, 99, 1)",!1)},linetoolfibcircles:{showCoeffs:!0,font:f,fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m(.236,"rgba(244, 67, 54, 1)",!0),level2:m(.382,"rgba(129, 199, 132, 1)",!0),level3:m(.5,"rgba(76, 175, 80, 1)",!0),level4:m(.618,"rgba(0, 150, 136, 1)",!0),level5:m(.786,"rgba(100, 181, 246, 1)",!0),level6:m(1,"rgba(120, 123, 134, 1)",!0),level7:m(1.618,"rgba(33, 150, 243, 1)",!0),level8:m(2.618,"rgba(244, 67, 54, 1)",!0),level9:m(3.618,"rgba(103, 58, 183, 1)",!0),level10:m(4.236,"rgba(233, 30, 99, 1)",!0),level11:m(4.618,"rgba(233, 30, 99, 1)",!0)},linetoolfibspeedresistancearcs:{showCoeffs:!0,font:f,fillBackground:!0,
|
||
transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m(.236,"rgba(244, 67, 54, 1)",!0),level2:m(.382,"rgba(129, 199, 132, 1)",!0),level3:m(.5,"rgba(76, 175, 80, 1)",!0),level4:m(.618,"rgba(0, 150, 136, 1)",!0),level5:m(.786,"rgba(100, 181, 246, 1)",!0),level6:m(1,"rgba(120, 123, 134, 1)",!0),level7:m(1.618,"rgba(33, 150, 243, 1)",!0),level8:m(2.618,"rgba(244, 67, 54, 1)",!0),level9:m(3.618,"rgba(103, 58, 183, 1)",!0),level10:m(4.236,"rgba(233, 30, 99, 1)",!0),level11:m(4.618,"rgba(233, 30, 99, 1)",!0)},linetooltrendbasedfibextension:{showCoeffs:!0,showPrices:!0,font:f,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0),level12:i(1.272,"rgba(129, 199, 132, 1)",!1),level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetooltrendbasedfibtime:{showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m(0,"rgba(120, 123, 134, 1)",!0),level2:m(.382,"rgba(244, 67, 54, 1)",!0),level3:m(.5,"rgba(129, 199, 132, 1)",!1),level4:m(.618,"rgba(76, 175, 80, 1)",!0),level5:m(1,"rgba(0, 150, 136, 1)",!0),level6:m(1.382,"rgba(100, 181, 246, 1)",!0),level7:m(1.618,"rgba(120, 123, 134, 1)",!0),level8:m(2,"rgba(33, 150, 243, 1)",!0),level9:m(2.382,"rgba(244, 67, 54, 1)",!0),level10:m(2.618,"rgba(156, 39, 176, 1)",!0),level11:m(3,"rgba(233, 30, 99, 1)",!0)},linetoolschiffpitchfork:{fillBackground:!0,transparency:80,style:r.Schiff,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:m(.25,"rgba(255, 183, 77, 1)",!1),level1:m(.382,"rgba(129, 199, 132, 1)",!1),level2:m(.5,"rgba(76, 175, 80, 1)",!0),level3:m(.618,"rgba(0, 150, 136, 1)",!1),
|
||
level4:m(.75,"rgba(100, 181, 246, 1)",!1),level5:m(1,"rgba(33, 150, 243, 1)",!0),level6:m(1.5,"rgba(156, 39, 176, 1)",!1),level7:m(1.75,"rgba(233, 30, 99, 1)",!1),level8:m(2,"rgba(229, 115, 115, 1)",!1)},linetoolschiffpitchfork2:{fillBackground:!0,transparency:80,style:r.Schiff2,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:m(.25,"rgba(255, 183, 77, 1)",!1),level1:m(.382,"rgba(129, 199, 132, 1)",!1),level2:m(.5,"rgba(76, 175, 80, 1)",!0),level3:m(.618,"rgba(0, 150, 136, 1)",!1),level4:m(.75,"rgba(100, 181, 246, 1)",!1),level5:m(1,"rgba(33, 150, 243, 1)",!0),level6:m(1.5,"rgba(156, 39, 176, 1)",!1),level7:m(1.75,"rgba(233, 30, 99, 1)",!1),level8:m(2,"rgba(229, 115, 115, 1)",!1)},linetoolinsidepitchfork:{fillBackground:!0,transparency:80,style:r.Inside,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:m(.25,"rgba(255, 183, 77, 1)",!1),level1:m(.382,"rgba(129, 199, 132, 1)",!1),level2:m(.5,"rgba(76, 175, 80, 1)",!0),level3:m(.618,"rgba(0, 150, 136, 1)",!1),level4:m(.75,"rgba(100, 181, 246, 1)",!1),level5:m(1,"rgba(33, 150, 243, 1)",!0),level6:m(1.5,"rgba(156, 39, 176, 1)",!1),level7:m(1.75,"rgba(233, 30, 99, 1)",!1),level8:m(2,"rgba(229, 115, 115, 1)",!1)},linetoolregressiontrend:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba(244, 67, 54, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}},b(TradingView.defaultProperties.chartproperties),S()}if(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"#2196F3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:o.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"#2196F3",backColor:"#E3F2FD",textColor:"#131722"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]){TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:!0,"S1/R1":!0,"S2/R2":!0,"S3/R3":!0,"S4/R4":!0,"S5/R5":!0},colors:{P:"#FB8C00","S1/R1":"#FB8C00","S2/R2":"#FB8C00","S3/R3":"#FB8C00","S4/R4":"#FB8C00","S5/R5":"#FB8C00"},widths:{P:1,"S1/R1":1,"S2/R2":1,"S3/R3":1,"S4/R4":1,"S5/R5":1}}}}if(void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"#2196F3",linewidth:2}),
|
||
void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:t("rgba( 255, 0, 0, 1)",!1),level1:t("rgba( 0, 128, 0, 1)",!1),level2:t("rgba( 0, 0, 255, 1)",!1),level3:t("rgba( 255, 0, 255, 1)",!1),level4:t("rgba( 0, 128, 255, 1)",!0),level5:t("rgba( 255, 0, 0, 1)",!0),level6:t("rgba( 0, 128, 0, 1)",!0),level7:t("rgba( 0, 0, 255, 1)",!0),level8:t("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba(244, 67, 54, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]){TradingView.defaultProperties["study_Overlay@tv-basicstudies"]={style:s.STYLE_LINE,allowExtendTimeScale:!1,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,drawBody:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,drawBody:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},lineStyle:{color:"#FF6D00",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",styleType:s.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"#2196f3",color2:"#2196f3",linecolor:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",transparency:95},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.05)",topFillColor2:"rgba( 83, 185, 135, 0.05)",bottomFillColor1:"rgba( 235, 77, 92, 0.05)",bottomFillColor2:"rgba( 235, 77, 92, 0.05)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,
|
||
plottype:o.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:o.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:o.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:o.Line,histogramBase:0}}}}for(var C=e.split("."),P=TradingView.defaultProperties,x=0;x<C.length;x++)P&&(P=P[C[x]]);return null!=P?TradingView.clone(P):{}};function v(e,t,i,s,r){if(s)for(var n in s){var o=n.split("."),a=c(o[0]),l=void 0!==r&&r===o[0];0!==o.length&&l&&(a=c((o=o.slice(1))[0])),0!==o.length&&e.hasOwnProperty(a)?h(e,o,s[n])||u(n):l&&u(n)}function c(e){return t&&t[e]?t[e]:e}function h(e,t,i,s){var r=c(t[0]);return!!e.hasOwnProperty(r)&&(t.length>1?h(e[r],t.slice(1),i):(e[r]&&e[r].setValue?e[r].setValue(i):e[r]=i,!0))}function u(e){i||m.logWarn("Path `"+e+"` does not exist.")}}function b(e,t,i,s){window.__defaultsOverrides&&v(e,t,i,window.__defaultsOverrides,s)}function S(){var e=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach((function(t){e.test(t)&&b(TradingView.defaultProperties[t],null,!1,t)}))}function y(e,t){return t?function(e,t){var i=g(e);if(!window._UNIT_TESTS){var s=TradingView.clone(TVSettings.getJSON(e,null));if(function(e){var t=new Set(["linetoolregressiontrend"]);return e.startsWith("study_")||t.has(e)}(e)&&s&&function(e){if(!e)return!1;e=e.toString();var t=new RegExp("\\d+").exec(e);return null!==t&&t[0]===e}(s.version)){var r=s.inputs,n=t.updateStudyInputs(s.id,s.version,"last",r,null);s.inputs=n;var o=t.updateStudyState(s,s);s=o}TradingView.merge(i,s)}return i}(e,t):function(e){var t=g(e);if(!window._UNIT_TESTS){var i=TradingView.clone(TVSettings.getJSON(e,null));i&&TradingView.merge(t,i)}return t}(e)}y.create=function(e,t){if(t){var i=g(e);TradingView.defaultProperties[e]=Object.assign(t,i)}},y.remove=function(e){TradingView.defaultProperties[e]=void 0},TradingView.saveDefaults=function(e,t){TVSettings.setJSON(e,t)},TradingView.factoryDefaults=g,window.applyDefaultOverridesToLinetools=S,window.applyDefaultsOverrides=b,window.applyPropertiesOverrides=v,window.defaults=y,t.applyDefaultOverridesToLinetools=S,t.applyDefaultsOverrides=b,t.applyPropertiesOverrides=v,t.defaults=y,t.factoryDefaults=g,t.saveDefaults=TradingView.saveDefaults},wamh:function(e,t,i){"use strict";i.r(t),i.d(t,"ChangeToolBarsThemeUndoCommand",(function(){return o}));var s=i("EsvI"),r=i("oiZD"),n=i("RDU5");class o extends n.UndoCommand{constructor(e,t,i=!0){super("Apply Toolbars Theme"),this._prevThemeName=e,this._themeName=t,this._syncState=i}undo(){Object(s.isStdThemeName)(this._prevThemeName)&&(Object(r.setTheme)(this._prevThemeName),this._syncState&&Object(s.syncTheme)())}redo(){Object(s.isStdThemeName)(this._themeName.toLowerCase())&&(Object(r.setTheme)(this._themeName.toLowerCase()),this._syncState&&Object(s.syncTheme)())}}},wi9r:function(e,t,i){"use strict";(function(e){var t=i("e3/o").randomHash;function s(e){
|
||
this._chartApi=e,this._sessionid="qs_"+t(),this._sessionstarted=!1}s.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},s.prototype.connected=function(){return this._chartApi.connected()},s.prototype.connect=function(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},s.prototype.disconnect=function(){this._chartApi.disconnect()},s.prototype.quoteAddSymbols=function(e,t){e=[].concat(e),t&&t.forcePermission&&(e=e.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,e)},s.prototype.quoteRemoveSymbols=function(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)},s.prototype.quoteFastSymbols=function(e){this._chartApi.quoteFastSymbols(this._sessionid,e)},s.prototype.quoteSetFields=function(e){this._chartApi.quoteSetFields(this._sessionid,e)},s.prototype.onMessage=function(e){switch(e.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler(e)},s.prototype.quoteHibernateAll=function(e){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=s,e&&e.exports&&(e.exports=s)}).call(this,i("YuTi")(e))},wiuq:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolArrowMarker",(function(){return a}));var s=i("Ss5c"),r=i("Ocx9"),n=i("tc+8"),o=i.n(n);class a extends s.LineDataSource{constructor(e,t){super(e,t||a.createProperties()),i.e("lt-pane-views").then(i.bind(null,"Qa6j")).then(({ArrowMarkerPaneView:e})=>{this._setPaneViews([new e(this,this.model())])})}pointsCount(){return 2}name(){return"Trend Line"}static createProperties(e){const t=new r.DefaultProperty("linetoolarrowmarker",e);return a._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FxV7")).then(e=>e.ArrowMarkerDefinitionsViewModel)}static _configureProperties(e){s.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.a("")),e.addExclusion("text")}}},wjVR:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("qFKp"),n=i("jofe"),o=i("FQhm"),a=i("sQaR");let l;class c extends a.a{constructor(){super(),this._dialog=null,this._subscribe=e=>{this._setVisibility(e)}}show(){this._load().then(e=>e.show())}hide(){var e;null===(e=this._dialog)||void 0===e||e.hide()}static getInstance(){return l||(l=new c),l}_load(){return Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(13),i.e(16),i.e(20),i.e(22),i.e(24),i.e(35),i.e(42),i.e(50),i.e(64),i.e(72),i.e(78),i.e(0),i.e(5),i.e(4),i.e(10),i.e(14),i.e(12),i.e(29),i.e(38),i.e(65),i.e(56),i.e("object-tree-dialog")]).then(i.bind(null,"xNz2")).then(e=>{var t,i;return null===(t=this._dialog)||void 0===t||t.hide(),null===(i=this._dialog)||void 0===i||i.visible().unsubscribe(this._subscribe),
|
||
this._dialog=new e.ObjectTreeDialogRenderer,this._dialog.visible().subscribe(this._subscribe),this._dialog})}}var h=i("ogJP"),u=i("dDSx");var d=i("CW80"),p=i("3ClC"),_=i("H0vP"),m=i("mkn5"),f=i("eJTA"),g=i("Hr11"),v=i("S8xo"),b=i("ikwP");i("bc0y");class S{constructor(e,t,i){this._handleEl=null,this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._prevStretchA=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,this._colorCache={lineColor:"",backgroundColor:"",color:""},this._chart=e,this._paneA=e.paneWidgets()[t],this._paneB=e.paneWidgets()[i],this._row=document.createElement("tr"),this._row.style.height="1px",this._cell=document.createElement("td"),this._row.appendChild(this._cell),this._cell.classList.add("pane-separator"),this._cell.setAttribute("colspan","3"),this._cell.style.background=this._color(),this._cell.addEventListener("click",()=>{});const s=document.createElement("div");s.classList.add("handle"),this._cell.appendChild(s),this._mouseEventHandler=new v.MouseEventHandler(s,this,{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0}),this._handleEl=s}destroy(){this._mouseEventHandler.destroy(),this._row.parentElement&&this._row.parentElement.removeChild(this._row)}getElement(){return this._row}hide(){this._row.classList.add("js-hidden")}show(){this._row.classList.remove("js-hidden")}mouseDownEvent(e){this._mouseDownOrTouchStartEvent(e)}touchStartEvent(e){this._mouseDownOrTouchStartEvent(e)}pressedMouseMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}touchMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}mouseUpEvent(e){this._mouseUpOrTouchEndEvent(e)}touchEndEvent(e){this._mouseUpOrTouchEndEvent(e)}update(){this._cell.style.background=this._color().toString()}paint(){}image(){const e=this._paneA.leftPriceAxisesContainer().getWidth(),t=this._paneA.width(),i=this._paneA.rightPriceAxisesContainer().getWidth(),s=this._color(),r=Object(b.createDisconnectedCanvas)(document,new b.Size(e,1)),n=Object(b.getPrescaledContext2D)(r);n.fillStyle=s,n.fillRect(0,0,e,1);const o=Object(b.createDisconnectedCanvas)(document,new b.Size(t,1)),a=Object(b.getPrescaledContext2D)(o);a.fillStyle=s,a.fillRect(0,0,t,1);const l=Object(b.createDisconnectedCanvas)(document,new b.Size(i,1)),c=Object(b.getPrescaledContext2D)(l);return c.fillStyle=s,c.fillRect(0,0,i,1),{type:"separator",leftAxis:{content:r.toDataURL(),canvas:r,contentWidth:e,contentHeight:1},rightAxis:{content:l.toDataURL(),canvas:l,contentWidth:i,contentHeight:1},content:o.toDataURL(),canvas:o,contentWidth:t,contentHeight:1}}static height(){return 1}_mouseDownOrTouchStartEvent(e){this._startY=e.pageY,this._deltaY=0,this._totalHeight=this._paneA.height()+this._paneB.height(),this._totalStretch=this._paneA.state().stretchFactor()+this._paneB.state().stretchFactor(),this._prevStretchA=this._paneA.state().stretchFactor(),this._minPaneHeight=30,this._maxPaneHeight=this._totalHeight-this._minPaneHeight,this._pixelStretchFactor=this._totalStretch/this._totalHeight,
|
||
Object(s.ensureNotNull)(this._handleEl).classList.add("i-active")}_pressedMouseOrTouchMoveEvent(e){this._deltaY=e.pageY-this._startY;const t=this._paneA.height(),i=Object(g.clamp)(t+this._deltaY,this._minPaneHeight,this._maxPaneHeight)*this._pixelStretchFactor,s=this._totalStretch-i;this._paneA.state().setStretchFactor(i),this._paneB.state().setStretchFactor(s),this._chart.adjustSize(),this._paneA.height()!==t&&(this._startY=e.pageY),this._chart.model().model().fullUpdate()}_mouseUpOrTouchEndEvent(e){this._chart.model().addPaneStretchFactorUndoCommand(this._paneA.state(),this._paneB.state(),this._prevStretchA,this._paneA.state().stretchFactor()),this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,Object(s.ensureNotNull)(this._handleEl).classList.remove("i-active")}_color(){const e=this._chart.properties().childs().scalesProperties.childs().lineColor.value(),t=this._chart.model().model().backgroundColor().value();if(this._colorCache.lineColor!==e||this._colorCache.backgroundColor!==t){const i=Object(f.parseRgba)(t),s=Object(f.parseRgba)(e),r=0===i[3]&&0===s[3]?"rgba(0,0,0,0)":Object(f.rgbaToString)(Object(f.blendRgba)(i,s));this._colorCache={lineColor:e,backgroundColor:t,color:r}}return this._colorCache.color}}var y=i("mMWL"),w=i("KnF9"),C=i("VaSN"),P=i("aIyQ"),x=i.n(P),T=i("hY0g"),M=i.n(T),I=i("Tmoa"),L=i("EsvI");const O={moving:"wait_finishing",wait_finishing:"stop",stop:"moving"};class A{constructor(e){this._chartModel=null,this._currentDistance=0,this._deferredFinishTimeout=0,this._finishingTimeout=0,this._moveType="",this._startTime=0,this._state="stop",this._movingTimeout=0,this._chart=e,this._chart.withModel(this,()=>{this._chartModel=this._chart.model()})}destroy(){clearTimeout(this._movingTimeout)}move(e){if(null!==this._chartModel&&"stop"===this._state&&this._chartModel.beginUndoMacro(1===e?"Move Left":"Move Right"),this._state=O.stop,this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=Date.now(),0===this._movingTimeout){const t=this._startTime,i=10,s=()=>{this.moveStep(t,0,50*e,1e3),this._movingTimeout=setTimeout(s,i)};this._movingTimeout=setTimeout(s,i)}}moveStep(e,t,i,s){if(null!==this._chartModel&&!this._chartModel.timeScale().isEmpty()){const r=Date.now();r<e&&(e=r);let n=(r-e)/s;(n>1||!isFinite(n))&&(n=1);const o=1-Math.pow(1-n,3);return this._currentDistance=(i-t)*o+t,this._chartModel.scrollChart(this._currentDistance),n}}moveByBar(e){if(null!==this._chartModel){const t=this._chartModel.timeScale();if(t.isEmpty())return;if("stop"===this._state&&this._chartModel.beginUndoMacro(1===e?"Move Left":"Move Right"),null!==t.visibleBarsStrictRange()){const e=t.indexToCoordinate(t.visibleBarsStrictRange().lastBar())+t.barSpacing()/2;Math.abs(t.width()-e)>t.barSpacing()/6&&this._chartModel.scrollChart(t.width()-e)}if(this._state=O.stop,
|
||
this._moveType="by_bar",this._startTime=Date.now(),!this._movingTimeout){let t=0,i=150;const s=400,r=()=>{this._moveByBarStep(e),t++,i>100&&(i-=t/5*20),this._movingTimeout=setTimeout(r,i)};this._movingTimeout=setTimeout(r,s),this._moveByBarStep(e)}}}stopMove(){"by_bar"===this._moveType?this.stopMoveByBar():this._stopMove()}stopMoveByBar(){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state=O.wait_finishing,this._moveType="",this._movingTimeout=0,this._currentDistance=0,null!==this._chartModel&&this._chartModel.endUndoMacro())}_finishMove(){clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0;const e=this._currentDistance,t=Date.now(),i=()=>{const s=this.moveStep(t,e,0,700);s&&s<1?this._finishingTimeout=setTimeout(i,10):null!==this._chartModel&&(this._state=O.wait_finishing,this._moveType="",this._movingTimeout=0,this._currentDistance=0,this._chartModel.endUndoMacro())};this._finishingTimeout=setTimeout(i,10)}_stopMove(){"moving"===this._state&&(this._state=O.moving,Date.now()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-(Date.now()-this._startTime)):this._finishMove())}_moveByBarStep(e){if(null!==this._chartModel){if(this._chartModel.timeScale().isEmpty())return;this._chartModel.scrollChartByBar(e)}}}var E=i("m/3z"),k=i("Kxc7");class D{constructor(){this._totalDeltaX=0,this._totalDeltaY=0,this._prevWheelTime=0}processWheel(e){e.timeStamp-this._prevWheelTime>100&&this._reset(),this._totalDeltaX+=e.deltaX,this._totalDeltaY+=e.deltaY,this._prevWheelTime=e.timeStamp;const t={deltaX:e.deltaX,deltaY:e.deltaY};return 0===this._totalDeltaX||0===this._totalDeltaY||(Math.abs(this._totalDeltaX)>=Math.abs(3*this._totalDeltaY)&&(t.deltaY=0),Math.abs(this._totalDeltaY)>=Math.abs(3*this._totalDeltaX)&&(t.deltaX=0)),t}_reset(){this._totalDeltaX=0,this._totalDeltaY=0}}var V=i("n5al"),B=i("pPtI");i("brCa");class R{constructor(){this._draggingSource=null,this._activeTouchPanes=new Set,this._scrollingPane=null,this._pinchingPane=null}onPaneDestroyed(e){this._activeTouchPanes.delete(e),this._scrollingPane===e&&(this._scrollingPane=null),this._pinchingPane===e&&(this._pinchingPane=null)}startTouch(e){this._activeTouchPanes.add(e)}endTouch(e){this._activeTouchPanes.delete(e)}hasTouchesOnOtherPanes(e){return this._activeTouchPanes.size>1||1===this._activeTouchPanes.size&&!this._activeTouchPanes.has(e)}trySetDraggingSource(e,t){return!this.hasTouchesOnOtherPanes(t)&&(Object(s.assert)(null===this._draggingSource||this._draggingSource===e),this._draggingSource=e,!0)}clearDraggingSource(){null!==this._draggingSource&&(this._draggingSource=null)}draggingSource(){return this._draggingSource}setScrollingPane(e){Object(s.assert)(null===e||null===this._scrollingPane),this._scrollingPane=e}scrollingPane(){return this._scrollingPane}setPinchingPane(e){Object(s.assert)(null===e||null===this._pinchingPane),this._pinchingPane=e}pinchingPane(){return this._pinchingPane}}i.d(t,"ChartWidgetBase",(function(){return W}))
|
||
;const N=Object(k.enabled)("chart_content_overrides_by_defaults"),j={addToWatchlistEnabled:!0,showFinancialsEnabled:!1,sourceSelectionEnabled:!0,propertyPagesEnabled:!0,paneContextMenuEnabled:!0,priceScaleContextMenuEnabled:!0,currencyConversionEnabled:!1,unitConversionEnabled:!1,goToDateEnabled:!1,marketStatusWidgetEnabled:!0,chartWarningWidgetEnabled:!0,dataProblemWidgetEnabled:!0,paneControlsEnabled:!0,isSymbolAvailable:e=>Promise.resolve(!0),legendWidgetEnabled:!0,chartEventsEnabled:!0,esdEnabled:!1,croppedTickMarks:!0,countdownEnabled:!0,useKineticScroll:r.CheckMobile.any(),handleScale:{mouseWheel:!0,pinch:!0,axisPressedMouseMove:{time:!0,price:!0}},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0}};function F(e,t,i,s=0){const r=t.mainSeries().syncModel(),n=e.mainSeries().syncModel();let o=i;if(null!==r&&null!==n){const t=e.createSyncPoint(r,n);0!==s&&(i=r.projectTime(i,s)),o=t.sourceTimeToTargetTime(i)}return e.timeScale().points().roughIndex(o,n&&n.distance.bind(n))}class W{constructor(e,t,i){this.activePaneWidget=null,this._model=null,this._paneWidgets=[],this._maximizedPaneWidget=null,this._timeAxisWidget=null,this._paneSeparators=[],this._controlBarNavigation=null,this._lineToolsSynchronizer=null,this._modelCreated=new x.a,this._isDestroyed=!1,this._customLegendWidgetsFactoryMap=new Map,this._backgroundTopTheme=new M.a("light"),this._backgroundBasedTheme=new M.a("light"),this._backgroundBottomTheme=new M.a("light"),this._lhsAxesWidth=0,this._rhsAxesWidth=0,this._lhsPriceAxisWidthChanged=new x.a,this._rhsPriceAxisWidthChanged=new x.a,this._mainDiv=null,this._parent=null,this._elTooltipDiv=null,this._hotkeysListener=null,this._mouseWheelHelper=null,this._onWheelBound=null,this._justActivated=!1,this._inited=!1,this._containsData=!1,this._initialLoading=!1,this._defTimeframe=void 0,this._removeMaximizeHotkey=null,this._metaInfoRepository=null,this._invalidationMask=null,this._drawPlanned=!1,this._drawRafId=0,this._inLoadingState=!1,this._timingsMeter=null,this._tagsChanged=new x.a,this._redraw=new x.a,this._updateThemedColorBound=this._updateThemedColor.bind(this),this._saveChartService=null,this._objectTreeDialogController=null,this._chartPaintedPromise=null,this._noExchangeSubscrptionWarning=null,this._paneWidgetsSharedState=new R,this._id=t,this._layoutId=i,this._options=Object(h.merge)(Object(h.clone)(j),e),this._options.customLegendWidgetFactories&&(this._customLegendWidgetsFactoryMap=this._options.customLegendWidgetFactories),this._subscribeToDrawingState(),this.withModel(this,()=>{const e=this.model().model();e.backgroundTopColor().subscribe(this._updateThemedColorBound),e.backgroundColor().subscribe(this._updateThemedColorBound)}),this._scrollHelper=new A(this),this._objectTreeDialogController=c.getInstance()}destroy(){var e,t;null===(e=this._lineToolsSynchronizer)||void 0===e||e.destroy(),null===(t=this._noExchangeSubscrptionWarning)||void 0===t||t.destroy(),null!==this._model&&(this._model.model().backgroundTopColor().unsubscribe(this._updateThemedColorBound),
|
||
this._model.model().backgroundColor().unsubscribe(this._updateThemedColorBound),this._model.destroy()),this._customLegendWidgetsFactoryMap.clear(),this._scrollHelper.destroy(),this._isDestroyed=!0}id(){return this._id}layoutId(){return this._layoutId}getPriceAxisWidthChangedByName(e){return"left"===e?this._lhsPriceAxisWidthChanged:this._rhsPriceAxisWidthChanged}getPriceAxisMaxWidthByName(e){return"left"===e?this._lhsAxesWidth:this._rhsAxesWidth}timeAxisHeight(){return null!==this._timeAxisWidget?this._timeAxisWidget.size.h:0}withModel(e,t){this.model()?t.call(e):this.modelCreated().subscribe(e,t,!0)}images(e){window.TradingView.printing=!0;const t=this.model().selection().allSources();this.model().selectionMacro(e=>e.clearSelection());const i=(t,i)=>{t.paint(i,this.onWidget());const s={showCollapsedLegend:Boolean(null==e?void 0:e.showCollapsedLegend),status:null==e?void 0:e.status};return t.getScreenshotData(s)},s=[];if(null!==this._maximizedPaneWidget){const e=this._paneWidgets.indexOf(this._maximizedPaneWidget);s.push(i(this._maximizedPaneWidget,_.InvalidationMask.light().invalidateForPane(e)))}else for(let o=0;o<this._paneWidgets.length;++o){const e=this._paneWidgets[o];s.push(i(e,_.InvalidationMask.light().invalidateForPane(o))),o<this._paneWidgets.length-1&&s.push(this._paneSeparators[o].image())}let r;this._timeAxisWidget&&(this._timeAxisWidget.paint(_.InvalidationLevel.Light),r=this._timeAxisWidget.getScreenshotData()),window.TradingView.printing=!1,this.model().selectionMacro(e=>{t.forEach(t=>{e.addSourceToSelection(t)})}),this.model().model().lightUpdate();const n=this.mainSeriesQuotesAndMetainfo();return{panes:s,timeAxis:r,colors:{text:this.properties().childs().scalesProperties.childs().textColor.value(),bg:this.properties().childs().paneProperties.childs().background.value(),scales:this.properties().childs().scalesProperties.childs().lineColor.value()},meta:n.meta,ohlc:n.ohlc,quotes:n.quotes}}setSaveChartService(e){this._saveChartService=e,null!==this._lineToolsSynchronizer&&this._lineToolsSynchronizer.setSaveChartService(e)}mainSeriesQuotesAndMetainfo(){let e,t,i;const s=this._model&&this._model.mainSeries();if(s){const r=e=>null==e?"":s.formatter().format(e,void 0,void 0,!0,!1)+"",n=e=>null==e?"":e+"";e={resolution:s.interval(),symbol:s.symbol()};const o=s.symbolInfo();o&&(e.symbol=o.full_name,e.description=o.description,e.exchange=o.exchange);const a=s.bars().last();null!==a&&(t=a.value.slice(1,5).map(r));const l=s.quotes();l&&(i={change:r(l.change),changePercent:n(l.change_percent),last:r(l.last_price)})}return{meta:e,ohlc:t,quotes:i}}updateCrossHairPositionIfNeeded(){if(this._model){const e=y.tool.value();if(this._model.model().setCurrentTool(e),Object(C.lastEventIsTouch)()){const e=this._maximizedPaneWidget||this._paneWidgets[0];if(e.hasState()&&(this._isLineToolModeExceptBrush()||this.selectBarMode().value()||Object(y.toolIsMeasure)(y.tool.value()))){const t=e.state(),i=.5*this._model.model().timeScale().width(),s=.5*t.defaultPriceScale().height()
|
||
;this._model.model().setAndSaveCurrentPosition(i,s,t)}}this._model&&Object(C.lastEventIsTouch)()&&this._model.model().crossHairSource().updateAllViews()}}trackingModePaneWidget(){if(!Object(C.lastEventIsTouch)())return null;for(const e of this.paneWidgets())if(e.trackingModeEnabled())return e;return null}startTrackingMode(){if(Object(C.lastEventIsTouch)()){this.exitTrackingMode(),this.updateCrossHairPositionIfNeeded();const e=this._maximizedPaneWidget||this._paneWidgets[0],t=this.model().model().crossHairSource().currentPoint();e.startTrackingMode(t,t)}}exitTrackingMode(){Object(C.lastEventIsTouch)()&&this.paneWidgets().some(e=>e.trackingModeEnabled())&&(this.paneWidgets().forEach(e=>e.exitTrackingMode()),this.model().model().clearCurrentPosition())}onToolChanged(){this.selectBarMode().value()&&this.toggleSelectBarMode(),this.exitTrackingMode()}setInLoadingState(e){this._inLoadingState=e}paint(e){const t=null!=e?e:_.InvalidationMask.full();t.validationActions().forEach(e=>e()),this._paneWidgets.forEach((e,i)=>{null!==this._maximizedPaneWidget&&this._maximizedPaneWidget!==e||e.paint(t.invalidateForPane(i),!1)}),this._timeAxisWidget&&this._timeAxisWidget.paint(t.invalidateForTimeScale()),this._redraw.fire()}maximizedPaneWidget(){return this._maximizedPaneWidget}isMaximizedPane(){return null!==this._maximizedPaneWidget}unsetActivePaneWidget(){this.activePaneWidget=null}setActivePaneWidget(e){this.activePaneWidget=e}onPaneWidgetDestroyed(e){this.activePaneWidget===e&&(this.activePaneWidget=null)}backgroundTopTheme(){return this._backgroundTopTheme.readonly()}backgroundBasedTheme(){return this._backgroundBasedTheme.readonly()}backgroundBottomTheme(){return this._backgroundBottomTheme.readonly()}lineToolsAndGroupsDTO(){return Object(s.ensureNotNull)(this._lineToolsSynchronizer).prepareDTO()}resetLineToolsInvalidated(e,t){Object(s.ensureNotNull)(this._lineToolsSynchronizer).resetInvalidated(e,t)}applyAlertIdByExternalSource(e,t){var i;null===(i=this._lineToolsSynchronizer)||void 0===i||i.applyAlertIdByExternalSource(e,t)}deleteAlertByExternalSource(e,t){var i;null===(i=this._lineToolsSynchronizer)||void 0===i||i.deleteAlertByExternalSource(e)}shouldBeSavedEvenIfHidden(){return this.model().model().shouldBeSavedEvenIfHidden()}showObjectsTreeDialog(){var e;null===(e=this._objectTreeDialogController)||void 0===e||e.show()}addCustomWidgetToLegend(e,t){this._customLegendWidgetsFactoryMap.set(e,t);for(const i of this.paneWidgets())i.addCustomWidgetToLegend(e,t)}applyIndicatorsToAllChartsAvailable(){if(!this.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return!1;for(const e of this.model().model().panes()){if(e.sourcesByGroup().all().some(e=>Object(p.isStudy)(e)&&!Object(p.isESDStudy)(e)))return!0}return!1}pasteImageAsLineTool(e){(this.activePaneWidget||this._paneWidgets[0]).pasteImageAsLineTool(e)}restoreState(e,t,i){this.adjustSize();Object(s.ensureNotNull)(this._model).restoreState(this._content,t,i);this._setActions()}addCompareAsOverlay(e){const t=this.model()
|
||
;return Object(s.ensureDefined)(this._options.isSymbolAvailable)(e).then(i=>{if(!i)return null;const s=t.createStudyInserter({type:"java",studyId:"Overlay@tv-basicstudies"});return s.setForceOverlay(!0),s.setPreferredPriceScale("as-series"),s.setTargetPriceScaleMode({percentage:!0}),s.insert(async()=>({symbol:e}))})}scrollHelper(){return this._scrollHelper}adjustSize(e){var t;let i=0;const s=null===this._model?null:this._model.model().priceScaleSlotsCount(),r=new Uint32Array(null===s?0:s.left),n=new Uint32Array(null===s?0:s.right),a=Object(b.getCanvasDevicePixelRatio)(document.body),l=(e,t)=>e+t,c=(e,t)=>{t.forEach((t,i)=>{e[i]=Math.max(e[i],t)})};for(const o of this._paneWidgets)if(!this._maximizedPaneWidget||this._maximizedPaneWidget===o){const e=o.leftPriceAxisesContainer().optimalWidths(),t=o.rightPriceAxisesContainer().optimalWidths();c(r,e),c(n,t),i+=o.stretchFactor()}const h=r.reduce(l,0),u=n.reduce(l,0),d=this._width(),p=this._height(),_=Math.max(d-h-u,0),m=this._paneSeparators.length,f=S.height(),g=this.isMaximizedPane()?0:f*m,v=null!==this._timeAxisWidget?this._timeAxisWidget.optimalHeight():0,y=p-v>=61;let w=y?v:0;w%2&&(w+=1);const C=g+w,P=p<C?0:p-C,x=P/i;let T=0,M=!1;const I=null===(t=this._model)||void 0===t?void 0:t.model();for(let o=0;o<this._paneWidgets.length;++o){const e=this._paneWidgets[o];void 0!==I&&e.setState(I.panes()[o]);let t=0;if(this.isMaximizedPane())t=this._maximizedPaneWidget===e?P:0;else{let i=0;i=o===this._paneWidgets.length-1?Math.ceil((P-T)*a)/a:Math.round(e.stretchFactor()*x*a)/a,t=Math.max(i,2),T+=t}e.setPriceAxisSizes("left",t,r),e.setPriceAxisSizes("right",t,n),M=M||t!==e.height(),e.setSize(new b.Size(_,t)),I&&e.state()&&I.setPaneHeight(e.state(),t)}y&&null!==this._timeAxisWidget&&this._timeAxisWidget.setSizes(new b.Size(_,w),r,n),I&&I.setWidth(_,e),this._controlBarNavigation&&this._controlBarNavigation.updatePosition(),this._lhsAxesWidth!==h&&(this._lhsAxesWidth=h,this._lhsPriceAxisWidthChanged.fire(h)),this._rhsAxesWidth!==u&&(this._rhsAxesWidth=u,this._rhsPriceAxisWidthChanged.fire(u)),M&&o.emit("panes_height_changed")}chartPainted(){return this._drawPlanned?(null===this._chartPaintedPromise&&(this._chartPaintedPromise=Object(n.createDeferredPromise)()),this._chartPaintedPromise.promise):Promise.resolve()}_createLineToolsSynchronizerIfNeeded(){0}_updateThemedColor(){const e=this.model().model(),t=e.backgroundColorAtYPercentFromTop(.5);let i=e.backgroundTopColor().value(),s=e.backgroundColor().value();const r=Object(I.isColorDark)(t),n=Object(I.isColorDark)(i),o=Object(I.isColorDark)(s);this.widget().classList.toggle("chart-widget--themed-dark",r),this.widget().classList.toggle("chart-widget--themed-light",!r),this.widget().classList.toggle("chart-widget__top--themed-dark",n),this.widget().classList.toggle("chart-widget__top--themed-light",!n),this.widget().classList.toggle("chart-widget__bottom--themed-dark",o),this.widget().classList.toggle("chart-widget__bottom--themed-light",!o),this._backgroundTopTheme.setValue(n?"dark":"light"),
|
||
this._backgroundBasedTheme.setValue(r?"dark":"light"),this._backgroundBottomTheme.setValue(o?"dark":"light"),i===s&&Object(L.isStdThemedDefaultValue)("chartProperties.paneProperties.background",i,this._backgroundBasedTheme.value())&&(i=null,s=null);for(const a of this._paneWidgets)a.updateThemedColors(i,s)}_isLineToolModeExceptBrush(){const e=y.tool.value();return Object(d.isLineToolName)(e)&&!Object(d.isLineDrawnWithPressedButton)(e)&&!this.selectBarMode().value()}_cancelCreatingLine(){const e=Object(s.ensureNotNull)(this._model).model(),t=e.lineBeingCreated();if(null!==t){const i=Object(s.ensureNotNull)(e.paneForSource(t));Object(s.ensureNotNull)(this.paneByState(i)).cancelCreatingLineTool()}const i=e.crossHairSource().measurePane();if(null!==i){Object(s.ensureNotNull)(this.paneByState(i)).cancelMeasuring()}}_makePaneWidgetsAndSeparators(){const e=this.model().model().panes(),t=e.length,i=this._paneWidgets.length;for(let n=t;n<i;n++){Object(s.ensureDefined)(this._paneWidgets.pop()).destroy();const e=this._paneSeparators.pop();e&&e.destroy()}const r=this._options.containsData;for(let s=i;s<t;s++){const t={contextMenuEnabled:this._options.paneContextMenuEnabled,currencyConversionEnabled:this._options.currencyConversionEnabled,unitConversionEnabled:this._options.unitConversionEnabled,handleScale:this._options.handleScale,handleScroll:this._options.handleScroll,priceScaleContextMenuEnabled:this._options.priceScaleContextMenuEnabled,legendWidgetEnabled:this._options.legendWidgetEnabled,sourceStatusesWidgetEnabled:!r,sourceStatusesWidget:this._options.sourceStatusesWidget,marketStatusWidgetEnabled:this._options.marketStatusWidgetEnabled&&!r,marketStatusWidget:this._options.marketStatusWidget,chartWarningWidgetEnabled:this._options.chartWarningWidgetEnabled&&!r,chartWarningWidget:this._options.chartWarningWidget,dataProblemWidgetEnabled:this._options.dataProblemWidgetEnabled&&!r,legendWidget:this._options.legendWidget,propertyPagesEnabled:this._options.propertyPagesEnabled,sourceSelectionEnabled:this._options.sourceSelectionEnabled,controlsEnabled:this._options.paneControlsEnabled,croppedTickMarks:this._options.croppedTickMarks,countdownEnabled:this._options.countdownEnabled,customLegendWidgetFactories:new Map(this._customLegendWidgetsFactoryMap),useKineticScroll:this._options.useKineticScroll};void 0!==this._options.paneContextMenu&&(t.contextMenu=this._options.paneContextMenu),void 0!==this._options.priceScaleContextMenu&&(t.priceScaleContextMenu=this._options.priceScaleContextMenu);const i=new m.PaneWidget(this,e[s],t,this._paneWidgetsSharedState);if(this._paneWidgets.push(i),s>0){const e=new S(this,s-1,s);this._paneSeparators.push(e),this._timeAxisWidget?this._elMainTable.insertBefore(e.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(e.getElement())}this._timeAxisWidget?this._elMainTable.insertBefore(i.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(i.getElement())}for(let s=0;s<t;s++){const t=e[s],i=this._paneWidgets[s]
|
||
;i.hasState()&&i.state()===t?i.updatePriceAxisWidgets():i.setState(t)}for(let s=t;s--;)this._paneWidgets[s].updateControls();this._updateThemedColor()}_width(){return this._options.width.value()}_height(){return this._options.height.value()}_setElement(e){if(this._mainDiv){this._mainDiv.remove();const e=document.createRange();e.selectNodeContents(Object(s.ensureNotNull)(this._parent)),e.deleteContents()}this._controlBarNavigation&&(this._controlBarNavigation.destroy(),this._controlBarNavigation=null),null!==this._removeMaximizeHotkey&&this._removeMaximizeHotkey(),this._removeMaximizeHotkey=this._initMaximizeHotkey(e);const t=e.ownerDocument,r=t.createElement("div");r.classList.add("chart-container-border"),e.insertBefore(r,e.firstChild),this._parent=r;const n=t.createElement("div");if(n.classList.add("chart-widget"),this._mainDiv=n,this._elTooltipDiv=t.createElement("div"),this._elTooltipDiv.className="tooltip-wrapper",this._mainDiv.appendChild(this._elTooltipDiv),this._elMainTable=t.createElement("table"),this._elMainTable.className="chart-markup-table",this._elMainTable.setAttribute("cellpading","0"),this._elMainTable.setAttribute("cellspacing","0"),this._mainDiv.appendChild(this._elMainTable),this._hotkeysListener&&this._hotkeysListener.destroy(),this._hotkeysListener=new E.a(this,this._mainDiv),(this._options.controlBarEnabled||Object(k.enabled)("control_bar"))&&Promise.all([i.e(77),i.e(10),i.e("chart-widget-gui")]).then(i.bind(null,"TGRH")).then(e=>{this._controlBarNavigation=new e.ControlBarNavigation(this,Object(s.ensureNotNull)(this._mainDiv),this._options.controlBar),this._model&&this.adjustSize()}),this._options.handleScale.mouseWheel||this._options.handleScroll.mouseWheel){this._mouseWheelHelper=new D;const e=this._onMousewheel.bind(this);this._onWheelBound=e,this._mainDiv.addEventListener("wheel",e,{passive:!1})}this.resize(),this._justActivated=!1,this.withModel(this,()=>{r.appendChild(n),n.addEventListener("mousedown",this._beginRequestActive.bind(this)),n.addEventListener("mouseup",this._endRequestActive.bind(this)),n.addEventListener("touchstart",this._beginRequestActive.bind(this)),n.addEventListener("touchmove",this._endRequestActive.bind(this)),n.addEventListener("touchend",this._endRequestActive.bind(this)),n.addEventListener("click",this._requestActive.bind(this))}),this._inited&&(null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),this._paneWidgets.forEach(e=>{e.destroy()}),this._paneWidgets.length=0,this._paneSeparators.forEach(e=>{e.destroy()}),this._paneSeparators.length=0,this._update(_.InvalidationMask.full()))}_makeDefaultModel(){let e;if(this._content&&this._content.timeScale.points){const t=this._content.timeScale.points.items[0];e={startDate:t}}if(!Object(s.ensureNotNull)(this._metaInfoRepository).getInternalMetaInfoArray())throw new Error("Cannot create chart model: studies metainfo is absent");const t=()=>{this._drawPlanned=!1,this._drawRafId=0,this._inLoadingState||(this._invalidationMask&&(this._update(this._invalidationMask),
|
||
this._invalidationMask=null),null!==this._chartPaintedPromise&&(this._chartPaintedPromise.resolve(),this._chartPaintedPromise=null))},i=()=>{const i={readOnly:this.readOnly(),isSnapshot:!!this._containsData,timeScale:this._options.timeScale,crossHair:this._options.crossHair,esdEnabled:this._options.esdEnabled,countdownEnabled:this._options.countdownEnabled,currencyConversionEnabled:this._options.currencyConversionEnabled,unitConversionEnabled:this._options.unitConversionEnabled};void 0!==this._options.watermarkEnabled&&(i.watermarkEnabled=this._options.watermarkEnabled),void 0!==this._options.shiftVisibleRangeOnNewBar&&(i.shiftVisibleRangeOnNewBar=this._options.shiftVisibleRangeOnNewBar);const r=function(e,t,i,s,r,n,o,a,l){const c=new u.ChartUndoModel(e,t,i,s,r,n,o,a,l);return c.model().fullUpdate(),c}(this._chartSession,e=>{if(!(e instanceof _.InvalidationMask))throw new Error("Invalid mask");null!==this._invalidationMask?this._invalidationMask.merge(e):this._invalidationMask=e,this._drawPlanned||(this._drawPlanned=!0,this._options.visible.when(()=>{const e=!document.hidden,i=this.screen&&this.screen.isShown();null!==this._timingsMeter&&e&&!i&&this._timingsMeter.startWaitingDraw();const r=Object(s.ensureNotNull)(Object(s.ensureNotNull)(this._parent).ownerDocument.defaultView);this._drawRafId=r.requestAnimationFrame(t)}))},this.properties(),e,Object(s.ensureNotNull)(this._metaInfoRepository),this,this._options.undoHistory,this._options.barsMarksContainersFactory,i);return this._createSessions(r.model()),r};Object(k.enabled)("lean_chart_load")?this._model=this._model||i():this._model=i(),this._createVolumeIfNeeded();if(this._content){let e={};N&&this._initialLoading&&(e={symbol:this._defSymbol,interval:this._defInterval,style:this._defStyle}),this.restoreState(this._content,this._containsData,e),N&&this._defSymbol&&this.model().model().recalculatePriceRangeOnce()}else this._setActions();return this._createLineToolsSynchronizerIfNeeded(),(()=>{const e=Object(s.ensureNotNull)(this._model);e.onTagsChanged().subscribe(this,()=>this.onModelTagsChanged()),this._initBackgroundColor(),this._updateGui(),this._modelCreated.fire(e),this._tagsChanged.fire();const t=e.mainSeries();this._defTimeframe&&t.setDefaultTimeframe(this._defTimeframe),e.lineCancelled().subscribe(this,()=>this.onLineCancelled()),t.dataEvents().symbolNotPermitted().subscribe(null,e=>{t.properties().symbol.setValue(e)}),t.properties().style.unsubscribe(this,this._onChartStyleChanged),t.properties().style.subscribe(this,this._onChartStyleChanged),t.dataEvents().completed().subscribe(this,()=>this._addPerfMark("SeriesCompleted"),!0),t.dataEvents().barReceived().subscribe(this,()=>this._addPerfMark("SeriesFirstDataReceived"),!0);this._options.handleSessionErrors&&(t.dataEvents().chartTypeNotPermitted().subscribe(null,()=>{t.properties().interval.setValue("D")}),t.dataEvents().intradaySpreadNotPermitted().subscribe(null,()=>{t.properties().interval.setValue("D")}),t.dataEvents().customIntervalNotPermitted().subscribe(null,()=>{
|
||
t.properties().interval.setValue(Object(B.getDefaultResolution)(Object(V.isRangeStyle)(t.properties().style.value())))}),t.dataEvents().intradayExchangeNotPermitted().subscribe(null,()=>{t.properties().interval.setValue("D")})),this._options.handleSessionErrors&&(t.requestingIntradayWhenNotSupported.subscribe(null,()=>{t.properties().interval.setValue("D")}),t.requestingResolutionWhenNotSupported.subscribe(null,e=>{t.properties().interval.setValue(e)}))})()}_subscribeToDrawingState(){if(this._options.readOnly)return;Object(y.init)();const e=(e,t)=>{if(null===this._model)return;const i=this._model.model();e.model!==i&&t(i,this._model)},t=(e,t)=>e.dataSources().find(e=>Object(d.isLineTool)(e)&&e.getLinkKey()===t)||null;y.createdLineTool.subscribe(null,t=>{e(t,(e,i)=>{const r=Object(s.ensureNotNull)(e.paneForSource(e.mainSeries()));let n,o=null;if(void 0===t.pointPositionPercents){if(o=F(e,t.model,t.point.timeStamp),null===o)return;n=t.point.price}else{const i=t.pointPositionPercents.x*e.timeScale().width(),s=e.mainSeries().priceScale(),r=t.pointPositionPercents.y*s.height(),a=e.mainSeries().firstValue();if(null===a)return;o=e.timeScale().coordinateToIndex(i),n=s.coordinateToPrice(r,a)}const a={index:Object(s.ensureNotNull)(o),price:n},l=i.createLineTool(r,a,t.linetool,t.properties,t.linkKey,e.mainSeries(),!0);null!==l&&!Boolean(this.model().lineBeingCreated())&&t.finalState&&l.restoreExternalPoints(t.finalState,{indexesChanged:!0,pricesChanged:!0})})}),y.continuedLineTool.subscribe(null,t=>{e(t,(e,i)=>{const s=F(e,t.model,t.point.timeStamp);if(null===s)return;const r={index:s,price:t.point.price},n=e.lineBeingCreated();if(null===n)return;i.continueExternalLine(r,null===t.envState?void 0:t.envState,!!t.finalState)&&t.finalState&&n.restoreExternalPoints(t.finalState,{indexesChanged:!0,pricesChanged:!0})})}),y.cancelledLineTool.subscribe(null,t=>{e(t,(e,t)=>{e.cancelCreatingLine()})}),y.beenSetLineToolLastPoint.subscribe(null,t=>{e(t,(e,i)=>{const s=e.lineBeingCreated();if(null===s||s.getLinkKey()!==t.linkKey)return;const r=F(e,t.model,t.point.timeStamp);if(null===r)return;const n={index:r,price:t.point.price};s.setLastPoint(n),s.updateAllViews(),e.lightUpdate()})}),y.startedMovingLineTool.subscribe(null,i=>{e(i,(e,s)=>{const r=i.linkKeys.map(t.bind(null,e)).filter(h.notNull);if(r.length){const t=F(e,i.model,i.point.timeStamp);if(null===t)return;const s={index:t,price:i.point.price},n=void 0!==i.itemIndex?i.itemIndex:null;e.startMovingSources(r,{logical:s},n,i.pointPositionPercents,null===i.envState?void 0:i.envState,!0)}})}),y.movedLineTool.subscribe(null,t=>{e(t,(e,i)=>{if(!e.sourcesBeingMoved().filter(e=>(e=>t.linkKeys.some(t=>e.getLinkKey()===t))(e)).length)return;const s=F(e,t.model,t.point.timeStamp);if(null===s)return;const r={index:s,price:t.point.price};e.moveSources({logical:r},t.pointPositionPercents,null===t.envState?void 0:t.envState,!0)})}),y.finishedMovingLineTool.subscribe(null,t=>{e(t,(e,i)=>{const s=e.sourcesBeingMoved();if(0===s.length)return;s.forEach(i=>{const s=(e=>{
|
||
for(let i=0;i<t.linkKeys.length;i++)if(t.linkKeys[i]===e.getLinkKey())return{state:t.finalStates[i],changes:t.changes[i]};return null})(i);e.endMovingSources(null!==s,!0),null!==s&&(i.restoreExternalPoints(s.state,s.changes),s.state.pointPositionPercents&&i.restorePositionPercents(s.state.pointPositionPercents))})})}),y.startedChangingLineTool.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);if(null!==r){const t=r.getPoint(i.pointIndex),s=t?t.index:F(e,i.model,i.point.timeStamp);if(null===s)return;if(r.isActualSymbol()&&r.isActualCurrency()&&r.isActualUnit()){const t={index:s,price:i.point.price};e.startChangingLinetool(r,t,i.pointIndex,null===i.envState?void 0:i.envState,!0)}}})}),y.changedLineTool.subscribe(null,t=>{e(t,(e,i)=>{const r=e.lineBeingEdited();if(null===r||r.getLinkKey()!==t.linkKey)return;let n=null;if(n=t.changes.indexesChanged?F(e,t.model,t.point.timeStamp):Object(s.ensureNotNull)(e.linePointBeingChanged()).index,null!==n&&r.isActualSymbol()&&r.isActualCurrency()&&r.isActualUnit()){const i={index:n,price:t.point.price};e.changeLinePoint(i,void 0,!0)}})}),y.finishedChangingLineTool.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);null!==r&&r.isActualSymbol()&&r.isActualCurrency()&&r.isActualUnit()&&null!==e.lineBeingEdited()&&e.endChangingLinetool(!!i.finalState,!0),null!==r&&i.finalState&&r.restoreExternalPoints(i.finalState,i.changes)})}),y.removedLineTool.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);null!==r&&s.removeSource(r,!1)})}),y.finishedLineTool.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);null!==r&&Object(d.isLineDrawnWithPressedButton)(r.toolname)&&r.finish()})}),y.changedLineStyle.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);null!==r&&(r.restoreExternalState(i.state),r.propertiesChanged(!0))})}),y.restoredLineToolState.subscribe(null,i=>{e(i,(e,s)=>{const r=t(e,i.linkKey);if(null!==r){const t=Object.assign({},i.state);t.indexes=i.state.points.map(t=>({index:F(e,i.model,t.time_t),price:t.price})),e.restoreLineToolState(r,t)}})}),y.restoredLineTool.subscribe(null,t=>{e(t,(e,i)=>{e.restoreSource(t.state.restorePane,t.state.paneIndex,t.state.paneState,t.state.sourceState,null)})}),y.copiedLineTool.subscribe(null,t=>{e(t,(e,i)=>{const r=Object(s.ensureNotNull)(e.paneForSource(e.mainSeries()));let n;if(t.pointPositionPercents){const e={index:0,price:0};if(n=i.createLineTool(r,e,t.linetool,null,t.linkKey,void 0,!0),null===n)return;n.restorePositionPercents(Object(s.ensureDefined)(t.pointPositionPercents))}else{const o=t.points.map(i=>({index:Object(s.ensureNotNull)(F(e,t.model,i.timeStamp)),price:i.price})),a=o[0];if(n=i.createLineTool(r,a,t.linetool,null,t.linkKey,void 0,!0),null===n)return;if(e.lineBeingCreated())for(let e=1;e<o.length;e++)e!==o.length-1||!Object(d.isLineDrawnWithPressedButton)(t.linetool)&&"LineToolGhostFeed"!==t.linetool||n.finish(),i.continueCreatingLine(o[e],new w.EnvironmentState(void 0),e<o.length-1,!0)}n.properties().interval.setValue(t.state.interval),n.restoreExternalState(t.state),n.restoreData&&n.restoreData(t),
|
||
n.propertiesChanged(!0),t.finalState&&(n.calcIsActualSymbol(),n.restoreExternalPoints(t.finalState,{pricesChanged:!0,indexesChanged:!0}))})})}}},ww0J:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("X0WL");const r={NONE:"Default"};class n extends s.a{constructor(e,t){super(t),this._source=e}getSplitTitle(){return this._source.titleInParts(!0,r,void 0,!1)}text(){return this._source.isFailed()?`${this._source.title(!0,r,void 0,!1)}: ${this._source.status()}`:`${this._source.title(!0,r,void 0,!1)} ${this._source.status()}`}}},x0JF:function(e,t,i){"use strict";var s=i("aO4+").Point,r=i("vq8G").SelectionRenderer,n=i("VdBB").HitTestResult,o=i("29fS").PaneRendererBars,a=i("gyZD").PaneRendererLine,l=i("Zp8I").PaneRendererStepLine,c=i("u0yd").PaneRendererArea,h=i("/hKg").PaneRendererCandles,u=i("M7/j").PaneRendererBaseline,d=i("Zy3/").CompositeRenderer,p=i("Tmoa"),_=i("k9/m").PlotRowSearchMode,m=i("Kxc7"),f=i("Zp/P"),g=i("o2pV").SelectionIndexes;function v(e,t){this.m_series=e,this.m_model=t,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=m.enabled("source_selection_markers"),this._selectionData=null,this._selectionIndexer=new g(t.timeScale())}function b(e,t){return void 0!==e[TradingView.OPEN_PLOT]&&void 0!==e[TradingView.HIGH_PLOT]&&void 0!==e[TradingView.LOW_PLOT]&&void 0!==e[TradingView.CLOSE_PLOT]&&(t.open=e[TradingView.OPEN_PLOT],t.high=e[TradingView.HIGH_PLOT],t.low=e[TradingView.LOW_PLOT],t.close=e[TradingView.CLOSE_PLOT],!0)}function S(e,t){v.call(this,e,t)}function y(e,t){v.call(this,e,t)}function w(e,t){v.call(this,e,t)}function C(e,t){v.call(this,e,t)}function P(e,t){this.m_series=e,this.m_model=t,this.m_items=[],this._isMarkersEnabled=m.enabled("source_selection_markers"),this._selectionIndexer=new g(t.timeScale())}function x(e,t){P.call(this,e,t),this._invaidated=!0}function T(e,t){P.call(this,e,t),this._invaidated=!0}function M(e,t){P.call(this,e,t),this._invaidated=!0,this._renderer=new u}v.prototype._series=function(){return this.m_series},v.prototype._model=function(){return this.m_model},v.prototype._bars=function(){return this.m_bars},v.prototype.update=function(){this._invalidated=!0},v.prototype._updateImpl=function(e){var t=this;if((e=e||b,this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty())&&(null!==(a=this.m_model.timeScale().visibleBarsStrictRange())&&0!==this.m_series.bars().size())){for(var i=this.m_series.nearestIndex(a.firstBar(),_.NearestRight),r=this.m_series.nearestIndex(a.lastBar(),_.NearestLeft);i<=r;i++){if(null!==this.m_series.bars().valueAt(i))break}if(!(i>r)){var o,a=this.m_series.bars().range(i,r),l=this.m_series.priceScale(),c=this.m_series.barColorer(),h={};if(a.each((function(i,s){var r,n={};(n.time=Math.round(i),e(s,n))&&(h.value=s,r=s[TradingView.STYLE_PLOT]?s[TradingView.STYLE_PLOT]:c.barStyle(i,!1,h),s[TradingView.STYLE_PLOT]=r,h.previousValue=s,n.color=r.barColor,n.borderColor=r.barBorderColor,n.wickColor=r.barWickColor,n.hollow=r.isBarHollow,t.m_bars.push(n))}),this),
|
||
0!==this.m_bars.length&&(o=this.m_series.firstValue(),l.barPricesToCoordinates(this.m_bars,o)),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_model.selection().isSelected(this.m_series)){var u=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0};var d=this.m_model.paneForSource(this.m_series).height();this._selectionData.hittestResult=n.REGULAR;for(var p=0;p<u.length;p++){var m=u[p],f=this.m_series.bars().valueAt(m);if(null!==f){var g=.5*(f[TradingView.OPEN_PLOT]+f[TradingView.CLOSE_PLOT]),v=this.m_model.timeScale().indexToCoordinate(m),S=this.m_series.priceScale().priceToCoordinate(g,o);this._selectionData.points.push(new s(v,S)),this._selectionData.bgColors.push(this.m_model.backgroundColorAtYPercentFromTop(S/d))}}}else this._selectionIndexer.clear()}}},v.prototype.items=function(){return this.m_bars},inherit(S,v),S.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing();var t=this.m_series.properties();e.dontDrawOpen=t.barStyle.dontDrawOpen.value(),e.thinBars=t.style.value()===TradingView.Series.STYLE_RANGE?t.rangeStyle.thinBars.value():t.barStyle.thinBars.value();var i=new d;return i.append(new o(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&i.append(new r(this._selectionData)),i},inherit(y,v),y.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.wickVisible=this.m_series.properties().candleStyle.drawWick.value(),e.bodyVisible=this.m_series.properties().candleStyle.drawBody.value(),e.borderVisible=this.m_series.properties().candleStyle.drawBorder.value(),e.borderColor=this.m_series.properties().candleStyle.borderColor.value(),e.wickColor=this.m_series.properties().candleStyle.wickColor.value(),e.barWidth=f.optimalBarWidth(e.barSpacing);var t=new d;return t.append(new h(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&t.append(new r(this._selectionData)),t},inherit(w,v),w.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.wickVisible=this.m_series.properties().haStyle.drawWick.value(),e.bodyVisible=this.m_series.properties().haStyle.drawBody.value(),e.borderVisible=this.m_series.properties().haStyle.drawBorder.value(),e.borderColor=this.m_series.properties().haStyle.borderColor.value(),e.wickColor=this.m_series.properties().haStyle.wickColor.value(),e.barWidth=f.optimalBarWidth(e.barSpacing);var t=new d;return t.append(new h(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&t.append(new r(this._selectionData)),t},inherit(C,v),C.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),
|
||
e.wickVisible=this.m_series.properties().hollowCandleStyle.drawWick.value(),e.bodyVisible=this.m_series.properties().hollowCandleStyle.drawBody.value(),e.borderVisible=this.m_series.properties().hollowCandleStyle.drawBorder.value(),e.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),e.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),e.barWidth=f.optimalBarWidth(e.barSpacing);var t=new d;return t.append(new h(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&t.append(new r(this._selectionData)),t},P.prototype.update=function(){if(this.m_items=[],this.m_model.timeScale().isEmpty()||!this.m_series.priceScale()||this.m_series.priceScale().isEmpty())return;const e=this.m_model.timeScale().visibleBarsStrictRange();if(null===e)return;if(0===this.m_series.bars().size())return;var t=this.m_series.nearestIndex(e.firstBar()-1,_.NearestLeft),i=this.m_series.nearestIndex(e.lastBar()+1,_.NearestRight);const r=this.m_series.bars().range(t,i);var o=this.m_series.priceScale(),a={color:this.m_series.properties().lineStyle.color.value()},l=this.m_series.barFunction();let c;if(r.each(function(t,i){var r=l(i);if(null==r)return!1;void 0===c&&e.contains(t)&&(c=r);var n=new s(t,r);return n.style=a,this.m_items.push(n),!1}.bind(this)),o.pointsArrayToCoordinates(this.m_items,c),this.m_model.timeScale().timedValuesToCoordinates(this.m_items),this.m_model.selection().isSelected(this.m_series)){var h=this._selectionIndexer.indexes();this._selectionData={points:[],isDark:this.m_model.isDark(),bgColors:[],visible:!0};var u=this.m_model.paneForSource(this.m_series).height();this._selectionData.hittestResult=n.REGULAR;for(var d=0;d<h.length;d++){var p=h[d],m=this.m_series.data().valueAt(p);if(null!==m){var f=l(m),g=this.m_model.timeScale().indexToCoordinate(p),v=this.m_series.priceScale().priceToCoordinate(f,c);this._selectionData.points.push(new s(g,v)),this._selectionData.bgColors.push(this.m_model.backgroundColorAtYPercentFromTop(v/u))}}}else this._selectionIndexer.clear()},inherit(x,P),x.prototype.update=function(){this._invalidated=!0},x.prototype.renderer=function(){this._invalidated&&(P.prototype.update.call(this),this._invalidated=!1);var e,t,i=this.m_series.properties().lineStyle,s={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:i.color.value(),lineStyle:i.linestyle.value(),withMarkers:i.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,lineWidth:i.linewidth.value(),simpleMode:!0};return i.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP?(e=new l).setData(s):e=new a(s),this.m_model.selection().isSelected(this.m_series)?((t=new d).append(e),this._isMarkersEnabled&&t.append(new r(this._selectionData))):t=e,t},inherit(T,P),T.prototype.update=function(){this._invalidated=!0},T.prototype.renderer=function(){this._invalidated&&(P.prototype.update.call(this),this._invalidated=!1);var e={simpleMode:!1};e.barSpacing=this.m_model.timeScale().barSpacing(),e.items=this.m_items,
|
||
e.lineColor=this.m_series.properties().areaStyle.linecolor.value(),e.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),e.lineWidth=this.m_series.properties().areaStyle.linewidth.value();var t=this.m_series.properties().areaStyle.transparency.value();e.isSeries=!0,e.color1=p.generateColor(this.m_series.properties().areaStyle.color1.value(),t),e.color2=p.generateColor(this.m_series.properties().areaStyle.color2.value(),t),e.bottom=this.m_series.priceScale().height();var i=new d;return i.append(new c(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&i.append(new r(this._selectionData)),i},inherit(M,P),M.prototype.update=function(){this._invalidated=!0},M.prototype._updateImpl=function(){P.prototype.update.call(this);var e=this.m_series.properties().baselineStyle,t=e.transparency.value();this._topFillColor1=p.generateColor(e.topFillColor1.value(),t),this._topFillColor2=p.generateColor(e.topFillColor2.value(),t),this._bottomFillColor1=p.generateColor(e.bottomFillColor1.value(),t),this._bottomFillColor2=p.generateColor(e.bottomFillColor2.value(),t),this._topLineColor=e.topLineColor.value(),this._bottomLineColor=e.bottomLineColor.value(),this._topLineWidth=e.topLineWidth.value(),this._bottomLineWidth=e.bottomLineWidth.value(),this._barSpacing=this.m_model.timeScale().barSpacing(),this._bottom=this.m_series.priceScale().height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-e.baseLevelPercentage.value())/100))},M.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this.m_items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,lineStyle:CanvasEx.LINESTYLE_SOLID,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});var e=new d;return e.append(this._renderer),this.m_model.selection().isSelected(this.m_series)&&e.append(new r(this._selectionData)),e},t.SeriesBarsPaneView=S,t.SeriesCandlesPaneView=y,t.SeriesHollowCandlesPaneView=C,t.SeriesLinePaneView=x,t.SeriesAreaPaneView=T,t.SeriesHeikenAshiPaneView=w,t.SeriesBaselinePaneView=M,t.SeriesBarCandlesPaneView=v},"x2L+":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));var s=i("m/cY"),r=i("Vdly");function n(){return r.getBool("Chart.ShowMarketOpenStatus",!0)}const o=Object(s.a)(n());function a(){o.setValue(!0),r.remove("Chart.ShowMarketOpenStatus")}r.onSync.subscribe(null,()=>o.setValue(n())),o.subscribe(null,()=>r.setValue("Chart.ShowMarketOpenStatus",o.value()))},x5Tw:function(e,t,i){"use strict";i.r(t),i.d(t,"setupChartEventHint",(function(){return h}));var s=i("Eyy1"),r=(i("YFKU"),i("Vdly")),n=i("mMWL"),o=i("e92V"),a=i("qFKp"),l=i("/3z9"),c=i("Kxc7");function h(e,t=!1){if(!c.enabled("popup_hints"))return;const h=e.getContainer()
|
||
;let u=null,d=null;function p(e,t,r){if(u)u.show(e,r?void 0:_.bind(null,t));else{const o=n.tool.value();Promise.all([i.e("react"),i.e(93),i.e("chart-event-hint")]).then(i.bind(null,"PN5r")).then(i=>{u=new i.ChartEventHintRenderer(Object(s.ensureNotNull)(h)),o===n.tool.value()&&u.show(e,r?void 0:_.bind(null,t))})}}function _(e){r.setValue(e,!0,{forceFlush:!0}),Object(s.ensureNotNull)(u).destroy(),null!==d&&d(),u=null}n.tool.subscribe((function(){if(Boolean(r.getBool("hint.touchPainting")))return;const e=n.tool.value();Object(o.isStudyLineToolName)(e)&&"LineToolRegressionTrend"!==e&&!a.CheckMobile.any()?p(window.t("Click to set a point"),"hint.touchPainting"):a.CheckMobile.any()&&!Object(o.isLineDrawnWithPressedButton)(e)&&Object(o.isLineToolName)(e)?p(window.t("Move the point to position the anchor then tap to place"),"hint.touchPainting"):u&&u.hide()})),n.createdLineTool.subscribe(null,(function(){const e=n.tool.value();"LineToolPath"!==e||Boolean(r.getBool("hint.finishBuildPathByDblClick"))?"LineToolPolyline"!==e||Boolean(r.getBool("hint.finishBuildPolylineByDblClick"))||p(window.t("Double-click to finish Polyline"),"hint.finishBuildPolylineByDblClick"):p(window.t("Double-click to finish Path"),"hint.finishBuildPathByDblClick")})),n.finishedLineTool.subscribe(null,(function(){if(u){const e=n.tool.value();"LineToolPath"===e?_("hint.finishBuildPathByDblClick"):"LineToolPolyline"===e&&_("hint.finishBuildPolylineByDblClick")}})),t||a.CheckMobile.any()||Boolean(r.getBool("hint.startFocusedZoom"))||(d=function(e,t){let i=!1;const s=r=>{r?(i&&t(r),e.onZoom().unsubscribe(null,s)):i||(t(r),i=!0)};return e.onZoom().subscribe(null,s),()=>e.onZoom().unsubscribe(null,s)}(e,(function(e){if(Boolean(r.getBool("hint.startFocusedZoom")))return;if(e)u&&(d=null,_("hint.startFocusedZoom"));else{const e=l.isMacKeyboard?"⌘":"Ctrl";p(window.t("Press and hold {0} while zooming to maintain the chart position").format(e),"hint.startFocusedZoom")}})))}},x8jL:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("MY2c"),n=i("bOGh"),o=i("RDU5");class a extends o.UndoCommand{constructor(e,t,i){super(i),this._wv=e,this._newValue=t,this._oldValue=e.value()}redo(){this._wv.setValue(this._newValue)}undo(){this._wv.setValue(this._oldValue)}}var l=i("txPx"),c=i("aIyQ"),h=i.n(c);i.d(t,"createUndoHistory",(function(){return d}));const u=Object(l.getLogger)("Common.UndoHistory");function d(){const e=[],t=new r.a,i=new r.a,o=new h.a;function l(s){if(e.length>0)e[e.length-1].addCommand(s);else{i.clear();const e=t.head(),r=e&&e.text();e&&e.canMerge(s)?e.merge(s):t.push(s);const n=s.text();""!==n&&n!==r&&u.logNormal("DO: "+n)}s.executeOnPush()&&s.redo(),e.length||o.fire(c())}function c(){const e=t.head(),s=i.head();return{enableUndo:!t.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!i.isEmpty(),redoText:void 0===s?void 0:s.text()}}return{beginUndoMacro:function(t){const i=new n.a(t);return e.push(i),i},clearStack:function(){t.clear(),i.clear(),o.fire(c())},createUndoCheckpoint:function(){return{lastActualCommand:t.isEmpty()?null:t.head()}},
|
||
endUndoMacro:function(){const t=Object(s.ensureDefined)(e.pop());t.isEmpty()||l(t)},pushUndoCommand:l,redo:function(){if(i.isEmpty())return!1;const e=i.pop();return!!e&&(e.redo(),t.push(e),u.logNormal("REDO: "+e.text()),o.fire(c()),!0)},redoStack:function(){return i},setWatchedValue:function(e,t,i){if(e.value()!==t){const s=new a(e,t,i);l(s),s.redo()}},undo:function(){if(t.isEmpty())return!1;const e=t.pop();return!!e&&(e.undo(),i.push(e),u.logNormal("UNDO: "+e.text()),o.fire(c()),!0)},undoStack:function(){return t},undoToCheckpoint:function(e){for(;!t.isEmpty()&&e.lastActualCommand!==t.head();)t.pop().undo();i.clear(),o.fire(c())},state:c,onChange:function(){return o}}}},xDuj:function(e,t,i){"use strict";i.r(t),i.d(t,"translatedIntervalString",(function(){return r}));i("YFKU");var s=i("pPtI");function r(e){const t=Object(s.getTranslatedResolutionModel)(e,!0);return null===t?e:t.multiplier+(t.mayOmitShortKind?"":t.shortKind)}},xWfy:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return u})),i.d(t,"c",(function(){return d})),i.d(t,"d",(function(){return p}));var s=i("tqok"),r=i("fFKx"),n=i("SqfW"),o=i("7Fue");class a{constructor(e,t){if(this._indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._dwglabels=new Map,this._dwglines=new Map,this._dwgboxes=new Map,this._dwgtables=new Map,this._dwgtablecells=new Map,"data"===e){const e=t;this._indexes=e.indexes,this._vertlines=l(e.vertlines,this._indexes,n.b),this._horizlines=l(e.horizlines,this._indexes,r.b)}else if("state"===e){const e=t;this._indexes=e.indexes||[],this._vertlines=c(e.vertlines,this._indexes,n.b),this._horizlines=c(e.horizlines,this._indexes,r.b)}this._hhistsByTimePointIndex=Object(o.b)(this._hhists)}horizlines(){return this._horizlines}vertlines(){return this._vertlines}lines(){return this._lines}hlines(){return this._hlines}textmarks(){return this._textmarks}shapemarks(){return this._shapemarks}backgrounds(){return this._backgrounds}polygons(){return this._polygons}trendchannels(){return this._trendchannels}hhists(){return this._hhists}dwglabels(){return this._dwglabels}dwglines(){return this._dwglines}dwgboxes(){return this._dwgboxes}dwgtables(){return this._dwgtables}dwgtablecells(){return this._dwgtablecells}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}}function l(e,t,i){const s=new Map;return e.forEach((e,r)=>{const n=s.get(r)||new Set;e.forEach(e=>{const s=i(e,t);null!==s&&n.add(s)}),s.set(r,n)}),s}function c(e,t,i){const s=new Map;if(void 0===e)return s;for(const r of e){const e=r.styleId,n=s.get(e)||new Set;r.data.forEach(e=>{const s=i(e,t);null!==s&&n.add(s)}),s.set(e,n)}return s}function h(e,t,i,s){const r=[];return e.forEach((e,n)=>{e.forEach(e=>{!function(e,t,i){let s=null;for(const r of e)r.styleId===t&&(s=r);null===s&&(s={styleId:t,data:[]},e.push(s)),s.data.push(i)}(r,n,s(e,t(e),i))})}),
|
||
r.length>0?r:void 0}function u(){return new a}function d(e){return new a("state",e)}function p(e){const t=function(e){const t=new Set;e.horizlines().forEach((e,i)=>{e.forEach(e=>{t.add(e.startIndex),t.add(e.endIndex)})}),e.vertlines().forEach((e,i)=>{e.forEach(e=>{t.add(e.index)})}),e.lines().forEach((e,i)=>{e.forEach(e=>{t.add(e.startIndex),t.add(e.endIndex)})}),e.textmarks().forEach((e,i)=>{e.forEach(e=>{t.add(e.time)})}),e.shapemarks().forEach((e,i)=>{e.forEach(e=>{t.add(e.time)})}),e.backgrounds().forEach((e,i)=>{e.forEach(e=>{t.add(null!==e.start?e.start:s.a),t.add(e.stop)})}),e.polygons().forEach((e,i)=>{e.forEach(e=>{e.points.forEach(e=>{t.add(e.index)})})}),e.trendchannels().forEach((e,i)=>{e.forEach(e=>{t.add(e.startIndex),t.add(e.endIndex)})}),e.hhists().forEach((e,i)=>{e.forEach(e=>{t.add(e.firstBarTime),t.add(e.lastBarTime)})}),e.dwglabels().forEach((e,i)=>{e.forEach(e=>{t.add(e.x)})}),e.dwglines().forEach((e,i)=>{e.forEach(e=>{t.add(e.x1),t.add(e.x2)})}),e.dwgboxes().forEach((e,i)=>{e.forEach(e=>{t.add(e.left),t.add(e.right)})});const i=Array.from(t);return i.sort((e,t)=>e-t),i}(e),i={indexes:t};let o=0;const a=()=>++o;return i.vertlines=h(e.vertlines(),a,t,n.a),i.horizlines=h(e.horizlines(),a,t,r.a),i}},xdS3:function(e,t,i){},xnA2:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX").LineToolColorsProperty;class o extends s{constructor(e,t){super(e,t||o.createProperties()),this.version=o.version,i.e("lt-pane-views").then(i.t.bind(null,"CR3a",7)).then(({FibChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return o.LevelsCount}migrateVersion(e,t,i){i.properties.removeProperty("reverse")}pointsCount(){return 3}name(){return"Fib Channel"}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"17v9"))).FibDrawingsWith24LevelsDefinitionsViewModel}static createProperties(e){var t=new r("linetoolfibchannel",e,!1,{range:[1,24],names:["coeff","color","visible"]});return o._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);var t=[];for(let i=1;i<=o.LevelsCount;i++)t.push(e.child("level"+i).child("color"));e.addChild("linesColors",new n(t)),e.addExclusion("linesColors")}}o.LevelsCount=24,o.version=2,t.LineToolFibChannel=o},xo8u:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Eyy1"),r=i("RDU5"),n=i("n5al");class o extends r.UndoCommand{constructor(e,t,i,r){super(r),this._newSourcesCurrencies=new Map,this._oldSourcesCurrencies=new Map,this._showFade=!1,this._chartWidget=i;const o=i.model().mainSeries();for(const a of e.seriesLikeSources()){if(!a.isVisible())continue;const e=t||Object(n.symbolOriginalCurrency)(Object(s.ensureNotNull)(a.symbolInfo()));this._newSourcesCurrencies.set(a.id(),e),this._oldSourcesCurrencies.set(a.id(),a.currency()),this._showFade=this._showFade||a===o&&a.currency()!==e}}redo(){
|
||
this._applyCurrencies(this._newSourcesCurrencies)}undo(){this._applyCurrencies(this._oldSourcesCurrencies)}_applyCurrencies(e){this._showFade&&this._chartWidget.screen.show();const t=this._chartWidget.model().model();e.forEach((e,i)=>{Object(s.ensureNotNull)(t.dataSourceForId(i)).setCurrency(e)}),this._chartWidget.model().selectionMacro(e=>{e.clearSelection()})}}},xrEm:function(e,t,i){},xt3Q:function(e,t,i){"use strict";i.r(t),i.d(t,"TradingViewApiBase",(function(){return s}));class s{constructor(e){this._studyTemplatesDrawer=null;const{chartApiInstance:t,chartWidgetCollection:i,studyMarket:s,financialsDialog:r,saveChartService:n,loadChartService:o}=e;this._chartWidgetCollection=i,this._studyMarket=s,this._financialsDialog=r,this._saveChartService=n,this._loadChartLayoutDialog=o,this._intervalsService=null}dialogs(){return{Indicators:this._studyMarket,Financials:this._financialsDialog,Compare:null,ObjectsTree:null,ChartProperties:this._chartWidgetCollection.getChartPropertiesDialogRenderer(),ChartLayoutSaveAs:this._saveChartService.getSaveAsController(),ChartLayoutRename:this._saveChartService.getRenameController(),ChartLayoutCreate:this._saveChartService.getCreateController(),ChartLayoutLoad:this._loadChartLayoutDialog}}studyTemplatesDrawerApi(){throw new Error("not implemented")}intervalsService(){throw new Error("not implemented")}}},"xz+e":function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("7KDR").Action,n=i("Ocx9").DefaultProperty,o=i("j3hX").LineToolColorsProperty,a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],l=[{value:a[0],title:window.t("Supermillennium")},{value:a[1],title:window.t("Millennium")},{value:a[2],title:window.t("Submillennium")},{value:a[3],title:window.t("Grand Supercycle")},{value:a[4],title:window.t("Supercycle")},{value:a[5],title:window.t("Cycle")},{value:a[6],title:window.t("Primary")},{value:a[7],title:window.t("Intermediate")},{value:a[8],title:window.t("Minor",{context:"wave"})},{value:a[9],title:window.t("Minute",{context:"wave"})},{value:a[10],title:window.t("Minuette")},{value:a[11],title:window.t("Subminuette")},{value:a[12],title:window.t("Micro")},{value:a[13],title:window.t("Submicro")},{value:a[14],title:window.t("Minuscule")}];class c extends s{constructor(e,t){super(e,t||c.createProperties()),this.version=c.version,i.e("lt-pane-views").then(i.t.bind(null,"Ht/7",7)).then(({ElliottLabelsPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}static migrateState(e){var t={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])}migrateVersion(e,t,i){
|
||
if(i.properties.hasChild("background")&&i.properties.removeProperty("background"),i.properties.hasChild("backgroundColor")&&i.properties.removeProperty("backgroundColor"),i.properties.hasChild("showBackground")&&i.properties.removeProperty("showBackground"),1===e){var s=Object.assign({},this._timePoint[0]);this._timePoint.unshift(s),this._points.length>0&&(s=Object.assign({},this._points[0]),this._points.unshift(s))}}applyTemplate(e){delete e.background,delete e.backgroundColor,delete e.showBackground,super.applyTemplate(e)}name(){return"Elliott Labels"}additionalActions(e){var t=this;return[new r({label:window.t("Degree"),subItems:a.map((function(i){var s=l.filter((function(e){return e.value===i}))[0];return new r({label:s.title,checkable:!0,checked:t.properties().degree.value()===i,onExecute:function(){e.setProperty(t.properties().degree,i,"Change Elliott Degree")}})}))})]}label(e){var t=a.length-this.properties().degree.value()-1,i=Math.floor(t/3);return{group:i,bold:!!(i%2),decoration:["","brackets","circle"][t%3],label:this.labelsGroup()[i][e]}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"UHSU"))).ElliottPatternDefinitionsViewModel}availableDegreesValues(){return l}static createProperties(e){var t=new n("linetoolelliott",e);return c._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.addChild("linesColors",new o([e.color])),e.addExclusion("linesColors")}}c.version=4;class h extends c{pointsCount(){return 6}static _configureProperties(e){c._configureProperties(e)}}class u extends h{constructor(e,t){super(e,t||u.createProperties())}name(){return"Elliott Impulse Wave (12345)"}labelsGroup(){return u._labelsGroups}static createProperties(e){var t=new n("linetoolelliottimpulse",e);return u._configureProperties(t),t}static _configureProperties(e){h._configureProperties(e)}}u._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]];class d extends h{constructor(e,t){super(e,t||d.createProperties())}name(){return"Elliott Triangle Wave (ABCDE)"}labelsGroup(){return d._labelsGroups}static createProperties(e){var t=new n("linetoolelliotttriangle",e);return d._configureProperties(t),t}static _configureProperties(e){h._configureProperties(e)}}d._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]];class p extends h{constructor(e,t){super(e,t||p.createProperties())}name(){return"Elliott Triple Combo Wave (WXYXZ)"}labelsGroup(){return p._labelsGroups}static createProperties(e){var t=new n("linetoolelliotttriplecombo",e);return p._configureProperties(t),t}static _configureProperties(e){h._configureProperties(e)}}p._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]];class _ extends c{pointsCount(){return 4}
|
||
static _configureProperties(e){c._configureProperties(e)}}class m extends _{constructor(e,t){super(e,t||m.createProperties())}name(){return"Elliott Correction Wave (ABC)"}labelsGroup(){return m._labelsGroups}static createProperties(e){var t=new n("linetoolelliottcorrection",e);return m._configureProperties(t),t}static _configureProperties(e){_._configureProperties(e)}}m._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]];class f extends _{constructor(e,t){super(e,t||f.createProperties())}name(){return"Elliott Double Combo Wave (WXY)"}labelsGroup(){return f._labelsGroups}static createProperties(e){var t=new n("linetoolelliottdoublecombo",e);return f._configureProperties(t),t}static _configureProperties(e){_._configureProperties(e)}}f._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],t.LineToolElliott=c,t.LineToolElliottImpulse=u,t.LineToolElliottTriangle=d,t.LineToolElliottTripleCombo=p,t.LineToolElliottCorrection=m,t.LineToolElliottDoubleCombo=f},xzdg:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("YFKU"),n=i("ikwP"),o=i("ogJP"),a=i("jFln"),l=i("u+0B"),c=i("XlJ7"),h=i("JWMC"),u=i("zDbI"),d=i("CPmC"),p=i("gAom"),_=i("Hr11"),m=i("+cnz"),f=i("CxTi");class g{constructor(){this._width=null,this._currencyInfo=null,this._unitInfo=null,this._fontSize=0,this._currencyAndUnitLabelsWrapper=document.createElement("div"),this._currencyAndUnitLabelsWrapper.className=f["price-axis-currency-label-wrapper"],this._controlsContainer=document.createElement("table"),this._controlsContainer.className=f["price-axis-currency-label"],this._currencyAndUnitLabelsWrapper.appendChild(this._controlsContainer),this._currencyLabelTr=document.createElement("tr"),this._currencyLabelTr.className=f["price-axis-currency-label-dropdown"],this._currencyLabelTr.classList.add("apply-common-tooltip"),Object(d.b)(this._currencyLabelTr,"text",e=>this._currencyTooltipContent());const e=document.createElement("td");this._currencyText=document.createElement("span"),this._currencyText.className=f["price-axis-currency-label-text"],e.appendChild(this._currencyText),this._currencyLabelTr.appendChild(e);const t=document.createElement("td");this._currencyArrowDown=document.createElement("span"),this._currencyArrowDown.className=f["price-axis-currency-label-arrow-down"],this._currencyArrowDown.innerHTML=m,t.appendChild(this._currencyArrowDown),this._currencyLabelTr.appendChild(t),this._unitLabelTr=document.createElement("tr"),this._unitLabelTr.className=f["price-axis-currency-label-dropdown"],this._unitLabelTr.classList.add("apply-common-tooltip"),Object(d.b)(this._unitLabelTr,"text",e=>this._unitTooltipContent());const i=document.createElement("td");this._unitText=document.createElement("span"),this._unitText.className=f["price-axis-currency-label-text"],i.appendChild(this._unitText),this._unitLabelTr.appendChild(i);const s=document.createElement("td");this._unitArrowDown=document.createElement("span"),
|
||
this._unitArrowDown.className=f["price-axis-currency-label-arrow-down"],this._unitArrowDown.innerHTML=m,s.appendChild(this._unitArrowDown),this._unitLabelTr.appendChild(s),this._controlsContainer.appendChild(this._currencyLabelTr),this._controlsContainer.appendChild(this._unitLabelTr),this.hideCurrency(),this.hideUnit()}element(){return this._currencyAndUnitLabelsWrapper}currencyLabelElement(){return this._currencyLabelTr}unitLabelElement(){return this._unitLabelTr}isVisible(){return this.currencyLabelVisible()||this.unitLabelVisible()}width(){if(null!==this._width)return this._width;let e=0;if(this.currencyLabelVisible()){const t=this._currencyLabelTr.getBoundingClientRect();e=Math.max(e,t.right-t.left+1+8)}if(this.unitLabelVisible()){const t=this._unitLabelTr.getBoundingClientRect();e=Math.max(e,t.right-t.left+1+8)}return this._width=e,e}drawLabel(e,t,i,s){if(!this.isVisible())return;const r=this.currencyLabelVisible()?this._currencyText.textContent||"":this._unitText.textContent||"",o=this._unitText.textContent||"";e.font=Object(c.makeFont)(this._fontSize,u.CHART_FONT_FAMILY);const a=new l.a,h=2*Number(f.css_value_currency_label_text_horizontal_padding)+Math.max(a.measureText(e,r),a.measureText(e,o)),d=a.yMidCorrection(e,r),m=a.yMidCorrection(e,o),g=Math.round(t/2*i),v=Object(_.ceiledEven)(h*i/2),b=this._controlsContainer.style,S=Math.round(this.labelTop()*i),y=Math.round(this.labelBottom()*i),w=y-S,C=Math.round(Number(f.css_value_currency_label_radius)*i);Object(p.drawRoundRect)(e,g-v,S,2*v,w,C),e.fillStyle=b.backgroundColor,e.fill();const P=Math.max(1,Math.floor(i));e.lineWidth=P,e.strokeStyle=s?f.css_value_border_color_dark:f.css_value_border_color_light,Object(p.drawRoundRect)(e,g-v+P/2,S+P/2,2*v-P,w-P,C),e.stroke();const x=S+(y-S-1)/2,T=this._isMultiLine();T&&Object(p.drawHorizontalLine)(e,Math.floor(x+P/2),g-v,g+v);const M=this._oneLineHeight()/2*i,I=T?Math.ceil(x-M):x,L=Math.ceil(x+M);e.fillStyle=b.color,e.textBaseline="middle",e.textAlign="center",Object(n.drawScaled)(e,i,()=>e.fillText(r,g/i,(I+d)/i)),T&&Object(n.drawScaled)(e,i,()=>e.fillText(o,g/i,(L+m)/i))}showCurrency(){this._currencyLabelTr.classList.remove("js-hidden"),this._width=null,this._updateMultiLine(),this._updateVisibility()}hideCurrency(){this._currencyLabelTr.classList.add("js-hidden"),this._width=null,this._updateMultiLine(),this._updateVisibility()}showUnit(){this._unitLabelTr.classList.remove("js-hidden"),this._width=null,this._updateMultiLine(),this._updateVisibility()}hideUnit(){this._unitLabelTr.classList.add("js-hidden"),this._width=null,this._updateMultiLine(),this._updateVisibility()}currencyLabelVisible(){return!this._currencyLabelTr.classList.contains("js-hidden")}unitLabelVisible(){return!this._unitLabelTr.classList.contains("js-hidden")}setCurrencyInfo(e){if(null!==this._currencyInfo&&this._currencyInfo.selectedCurrency===e.selectedCurrency&&this._currencyInfo.readOnly===e.readOnly&&this._currencyInfo.originalCurrencies.size===e.originalCurrencies.size)return this._currencyInfo=e,!1;this._currencyInfo=e
|
||
;const t=null===e.selectedCurrency?Object(r.t)("Mixed"):Object(s.ensureDefined)(e.displayedValues.get(e.selectedCurrency));return this._currencyText.textContent!==t&&(this._currencyText.textContent=t,this._width=null),this._currencyArrowDown.classList.contains("js-hidden")!==e.readOnly&&(this._currencyArrowDown.classList.toggle("js-hidden",e.readOnly),this._currencyLabelTr.classList.toggle(f.readonly,e.readOnly),this._width=null),!0}setUnitInfo(e){if(null!==this._unitInfo&&this._unitInfo.selectedUnit===e.selectedUnit&&0===this._unitInfo.availableGroups.size==(0===e.availableGroups.size)&&this._unitInfo.originalUnits.size===e.originalUnits.size)return this._unitInfo=e,!1;this._unitInfo=e;const t=null===e.selectedUnit?Object(r.t)("Mixed"):Object(s.ensureDefined)(e.names.get(e.selectedUnit));return this._unitText.textContent!==t&&(this._unitText.textContent=t,this._width=null),this._unitArrowDown.classList.contains("js-hidden")!==(0===e.availableGroups.size)&&(this._unitArrowDown.classList.toggle("js-hidden",0===e.availableGroups.size),this._unitLabelTr.classList.toggle(f.readonly,0===e.availableGroups.size),this._width=null),!0}updateColors(e,t){const i=this._controlsContainer.style;i.background=e,i.color=t}currencyInfo(){return this._currencyInfo}unitInfo(){return this._unitInfo}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this._currencyLabelTr.style.fontSize=e+"px",this._unitLabelTr.style.fontSize=e+"px",this._width=null,this._setLineHeight(this._oneLineHeight()))}labelTop(){return Number(f.css_value_currency_label_top)}labelBottom(){const e=this.labelTop(),t=this._oneLineHeight();let i=e+t;return this._isMultiLine()&&(i+=t+1),i}_currencyTooltipContent(){const e=this._currencyInfo;return null===e?"":null===e.selectedCurrency?Array.from(e.currencies).map(t=>Object(s.ensureDefined)(e.displayedValues.get(t))).join(", "):""}_unitTooltipContent(){const e=this._unitInfo;return null===e?"":null===e.selectedUnit?Array.from(e.units).map(t=>Object(s.ensureDefined)(e.names.get(t))).join(", "):e.descriptions.get(e.selectedUnit)||""}_setLineHeight(e){this._currencyLabelTr.style.lineHeight=e+"px",this._unitLabelTr.style.lineHeight=e+"px"}_updateMultiLine(){this._controlsContainer.classList.toggle(f.multiline,this._isMultiLine())}_updateVisibility(){this._currencyAndUnitLabelsWrapper.classList.toggle("js-hidden",!this.isVisible())}_oneLineHeight(){return 7+this._fontSize}_isMultiLine(){return this.unitLabelVisible()&&this.currencyLabelVisible()}}async function v(e,t,s){const[r,n]=await Promise.all([Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"9agd")),t()]);return r.showUnitConversion(e,s,n)}var b=i("S8xo"),S=i("5VQP");i.d(t,"PriceAxisWidgetBase",(function(){return w}));const y={contextMenuEnabled:!0,currencyConversionEnabled:!1,unitConversionEnabled:!1,countdownEnabled:!0,contextMenu:{general:!0,source:!0},pressedMouseMoveScale:!0,croppedTickMarks:!0};class w{
|
||
constructor(e,t,i,s,r,a){this._priceScale=null,this._widthCache=new l.a(500),this._color=null,this._fontSize=null,this._currencyFontSize=0,this._currencyLabelWidth=null,this._isVisible=!0,this._updateTimeout=null,this._currencyMenu=null,this._currencyMenuEnabled=!0,this._currencyMenuEventHandler=null,this._unitMenu=null,this._unitMenuEnabled=!0,this._unitMenuEventHandler=null,this._prevOptimalWidth=0,this._size=new n.Size(-1,-1),this._currentCursorClassName="",this._mouseDown=!1,this._destroyed=!1,this._pane=e,this._undoModel=t,this._properties=i,this._isLeft="left"===s,this._options=Object(o.merge)(Object(o.clone)(y),r),this._rendererOptionsProvider=a,this._cell=document.createElement("div"),this._cell.className="price-axis",this._cell.style.width="25px",this._cell.style.left="0",this._canvasConfiguredHandler=()=>{this._undoModel.model().lightUpdate()},this._canvasBinding=Object(n.createBoundCanvas)(this._cell,new n.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);const c=this._canvasBinding.canvas;c.style.position="absolute",c.style.zIndex="1",c.style.left="0",c.style.top="0",this._topCanvasConfiguredHandler=()=>this._undoModel.model().lightUpdate(),this._topCanvasBinding=Object(n.createBoundCanvas)(this._cell,new n.Size(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);const h=this._topCanvasBinding.canvas;if(h.style.position="absolute",h.style.zIndex="2",h.style.left="0",h.style.top="0",this._options.currencyConversionEnabled||this._options.unitConversionEnabled){this._currencyLabel=new g,this._cell.appendChild(this._currencyLabel.element());const e=()=>this._currencyMenuEnabled=null===this._currencyMenu||!this._currencyMenu.isOpened(),t=()=>this._showCurrenciesContextMenu();this._currencyMenuEventHandler=new b.MouseEventHandler(this._currencyLabel.currencyLabelElement(),{touchStartEvent:e,mouseDownEvent:e,mouseClickEvent:t,tapEvent:t});const i=()=>this._unitMenuEnabled=null===this._unitMenu||!this._unitMenu.isOpened(),s=()=>this._showUnitsContextMenu();this._unitMenuEventHandler=new b.MouseEventHandler(this._currencyLabel.unitLabelElement(),{touchStartEvent:i,mouseDownEvent:i,mouseClickEvent:s,tapEvent:s})}else this._currencyLabel=null;this._properties.childs().fontSize.subscribe(this,this._onFontSizeChanged)}getElement(){return this._cell}onOptimalWidthNeedToBeRecalculated(e){const t=this.optimalWidth();(this._prevOptimalWidth<t||e)&&null===this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._undoModel.model().fullUpdate(),this._updateTimeout=null},100)),this._prevOptimalWidth=t}optimalWidth(){var e;if(!this.isVisible())return 0;let t=0;const i=this.rendererOptions();if(this._pane.hasState()){const i=Object(n.getContext2D)(this._canvasBinding.canvas);Object(a.setFont)(i,this.baseFont());const s=this.backLabels(!0);for(let e=s.length;e--;){if(!s[e].isAxisLabelVisible())continue;const r=this._widthCache.measureText(i,s[e].text());t=Math.max(t,r);const n=s[e].secondLineText()
|
||
;n&&(t=Math.max(t,this._widthCache.measureText(i,n)));const o=s[e].thirdLineText();o&&(t=Math.max(t,this._widthCache.measureText(i,o)))}const r=this.priceScale(),o=r.marks(!0);o.length>0&&(t=Math.max(t,this._widthCache.measureText(i,o[0].label),this._widthCache.measureText(i,o[o.length-1].label)));const l=(null===(e=r.mainSource())||void 0===e?void 0:e.firstValue())||null;if(null!==l){const e=r.coordinateToPrice(1,l),s=r.coordinateToPrice(this._size.h-2,l);t=Math.max(t,this._widthCache.measureText(i,r.formatPrice(Math.floor(Math.min(e,s))+.11111111111111,l)),this._widthCache.measureText(i,r.formatPrice(Math.ceil(Math.max(e,s))-.11111111111111,l)))}}let r=0;this._isCurrencyLabelVisible()&&(null===this._currencyLabelWidth&&(this._currencyLabelWidth=Object(s.ensureNotNull)(this._currencyLabel).width()),r=this._currencyLabelWidth);const o=t||34;let l=Math.max(r,Math.ceil(i.borderSize+i.tickLength+i.paddingInner+i.paddingOuter+o+4));return l+=l%2,l}getImage(){const e=this._size,t=Object(n.createDisconnectedCanvas)(document,e);if(Object(n.getPrescaledContext2D)(t).drawImage(this._canvasBinding.canvas,0,0,e.w,e.h),null!==this._currencyLabel&&this._currencyLabel.isVisible()){const i=this._undoModel.model().isDark();this._currencyLabel.drawLabel(Object(n.getContext2D)(t),e.w,Object(n.getCanvasDevicePixelRatio)(t),i)}return t}priceScale(){return Object(s.ensureNotNull)(this._priceScale)}setPriceScale(e){this._priceScale!==e&&(null!==this._priceScale&&this._priceScale.onMarksChanged().unsubscribe(this,this.onOptimalWidthNeedToBeRecalculated),this._priceScale=e,null!==e&&e.onMarksChanged().subscribe(this,this.onOptimalWidthNeedToBeRecalculated))}isVisible(){return this._isVisible}setVisible(e){(e=!!e)!==this._isVisible&&(this._cell.style.display=e?"table-cell":"none",this._isVisible=e)}destroy(){null!==this._currencyMenu&&(this._currencyMenu.close(),this._currencyMenu=null),null!==this._currencyMenuEventHandler&&this._currencyMenuEventHandler.destroy(),null!==this._unitMenu&&(this._unitMenu.close(),this._unitMenu=null),null!==this._unitMenuEventHandler&&this._unitMenuEventHandler.destroy(),this._topCanvasBinding.unsubscribeCanvasConfigured(this._topCanvasConfiguredHandler),this._topCanvasBinding.destroy(),this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),null!==this._priceScale&&this._priceScale.onMarksChanged().unsubscribe(this,this.onOptimalWidthNeedToBeRecalculated),this._priceScale=null,this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._properties.childs().fontSize.unsubscribe(this,this._onFontSizeChanged),this._destroyed=!0}backgroundColor(){return this._pane.state().model().backgroundColor().value()}backgroundTopColor(){return this._pane.state().model().backgroundTopColor().value()}lineColor(){return this._properties.childs().lineColor.value()}textColor(){return this._properties.childs().textColor.value()}fontSize(){return this._properties.childs().fontSize.value()}baseFont(){
|
||
return Object(c.makeFont)(this.fontSize(),u.CHART_FONT_FAMILY,"")}rendererOptions(){let e=this._rendererOptionsProvider.options();return this._color===e.color&&this._fontSize===e.fontSize||(this._color=e.color),this._fontSize!==e.fontSize&&(this._widthCache.reset(),this._fontSize=e.fontSize,this._currencyLabelWidth=null,this._currencyFontSize=0,this._updateCurrencyLabelFont(),this.onOptimalWidthNeedToBeRecalculated()),e}mouseEnterEvent(e){this._mouseEnterOrTouchStartEvent(e)}mouseMoveEvent(e){this._mouseOrTouchMoveEvent(e)}mouseDownEvent(e){this._mouseDownOrTouchStartEvent(e)}touchStartEvent(e){this._mouseOrTouchMoveEvent(e),this._mouseEnterOrTouchStartEvent(e),this._mouseDownOrTouchStartEvent(e)}pressedMouseMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}touchMoveEvent(e){this._pressedMouseOrTouchMoveEvent(e)}mouseDownOutsideEvent(){if(!this._zoomAvailable()||!this._pane.hasState())return;const e=this._pane.state(),t=this.priceScale();this._mouseDown&&(this._mouseDown=!1,this._undoModel.endScalePrice(e,t),this.restoreDefaultCursor())}mouseUpEvent(e){this._mouseUpOrTouchEndEvent(e)}touchEndEvent(e){this._mouseLeaveOrTouchEndEvent(e),this._mouseUpOrTouchEndEvent(e)}mouseClickEvent(e){this._mouseClickOrTapEvent(e)}tapEvent(e){this._mouseClickOrTapEvent(e)}mouseLeaveEvent(e){this._mouseLeaveOrTouchEndEvent(e)}mouseDoubleClickEvent(e){this._mouseDoubleClickOrDoubleTapEvent(e)}doubleTapEvent(e){this._mouseDoubleClickOrDoubleTapEvent(e)}contextMenuEvent(e){this._contextMenuOrTouchContextMenuEvent(e)}touchContextMenuEvent(e){this._contextMenuOrTouchContextMenuEvent(e)}reset(){const e=this._pane.state(),t=this.priceScale();this._undoModel.resetPriceScale(e,t),this.onOptimalWidthNeedToBeRecalculated(!0)}sizeReady(){return this.getWidth()>=this.optimalWidth()&&null===this._updateTimeout}_isCurrencyLabelVisible(){return null!==this._currencyLabel&&this._currencyLabel.isVisible()}_updateCurrencyLabel(){if(null!==this._currencyLabel){if(this._options.currencyConversionEnabled){const e=this.priceScale().currency(this._undoModel.model().availableCurrencies());null!==e&&this._properties.childs().showCurrency.value()?(this._currencyLabel.showCurrency(),this._currencyLabel.updateColors(this.backgroundTopColor(),this.textColor()),this._currencyLabel.setCurrencyInfo(e)&&(this._currencyLabelWidth=null,this.onOptimalWidthNeedToBeRecalculated())):this._currencyLabel.hideCurrency()}if(this._options.unitConversionEnabled){const e=this.priceScale().unit(this._undoModel.model().availableUnits());null!==e&&this._properties.childs().showUnit.value()?(this._currencyLabel.showUnit(),this._currencyLabel.updateColors(this.backgroundTopColor(),this.textColor()),this._currencyLabel.setUnitInfo(e)&&(this._currencyLabelWidth=null,this.onOptimalWidthNeedToBeRecalculated())):this._currencyLabel.hideUnit()}this._updateCurrencyLabelFont()}}_updateCurrencyLabelFont(){if(null===this._currencyLabel)return;const e=this.fontSize();e!==this._currencyFontSize&&(this._currencyLabel.setFontSize(e),this._currencyFontSize=e,this._currencyLabelWidth=null,
|
||
this.onOptimalWidthNeedToBeRecalculated())}_alignLabels(){let e=this._size.h/2;const t=[],i=this.priceScale(),s=i.orderedSources().slice(),r=this._pane.state(),n=this.rendererOptions();if(i===r.defaultPriceScale()){const e=r.priceDataSources();for(let t=0;t<e.length;t++)r.isOverlay(e[t])&&s.push(e[t])}const o=i.mainSource();for(const c of[s,r.customSources()])for(let s=0;s<c.length;++s){const n=c[s],a=n.priceAxisViews(r,i);if(a){const i=a.filter(e=>!e.ignoreAlignment()&&e.isVisible());if(!i.length)continue;t.push(...i),o===n&&(e=i[0].floatCoordinate())}}const a=t.filter(t=>t.floatCoordinate()<=e),l=t.filter(t=>t.floatCoordinate()>e);a.sort((e,t)=>t.floatCoordinate()-e.floatCoordinate()),a.length>0&&l.length>0&&l.push(a[0]),l.sort((e,t)=>e.floatCoordinate()-t.floatCoordinate());for(const c of t)c.setFixedCoordinate(c.coordinate());if(i.properties().childs().alignLabels.value()){for(let e=1;e<a.length;e++){const t=a[e],i=a[e-1],s=t.height(n),r=t.coordinate(),o=i.getFixedCoordinate();r>o-s&&t.setFixedCoordinate(o-s)}for(let e=1;e<l.length;e++){const t=l[e],i=l[e-1],s=i.height(n),r=t.coordinate(),o=i.getFixedCoordinate();r<o+s&&t.setFixedCoordinate(o+s)}}}_drawTickMarks(e,t){const i=this.priceScale().marks();e.save(),Object(a.setFont)(e,this.baseFont());const r=this.rendererOptions(),o=this._isLeft?Math.floor((this._size.w-r.tickLength)*t):0,l=this._isLeft?Math.round(o-r.paddingInner*t):Math.round(o+(r.tickLength+r.paddingInner)*t),c=Math.round(r.tickLength*t),h=Math.max(1,Math.floor(t)),u=Math.floor(.5*t),d=this.fontSize(),p=this._isCurrencyLabelVisible()?Object(s.ensureNotNull)(this._currencyLabel).labelBottom():0,_=i.map(t=>{if(this._options.croppedTickMarks)return{visible:!0,yCorrection:this._widthCache.yMidCorrection(e,t.label)};const i=t.coord-d/2,s=t.coord+d/2,r=!(s>this._size.h||i<p);return{visible:!(s>this._size.h||i<p),yCorrection:r?this._widthCache.yMidCorrection(e,t.label):0}});e.fillStyle=this.lineColor(),e.beginPath();for(let s=i.length;s--;)_[s].visible&&e.rect(o,Math.round(i[s].coord*t)-u,c,h);e.fill(),e.fillStyle=this.textColor(),e.textAlign=this._isLeft?"right":"left",e.textBaseline="middle",Object(n.drawScaled)(e,t,()=>{for(let s=i.length;s--;){if(!_[s].visible)continue;const r=i[s];e.fillText(r.label,l/t,r.coord+_[s].yCorrection)}}),e.restore()}_hasAlertLabel(){return!1}_showCurrenciesContextMenu(){if(!this._currencyMenuEnabled)return;Object(h.trackEvent)("GUI","Currency conversion");v(Object(r.t)("Currencies"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"aWqZ"))).currencyActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).currencyInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).currencyLabelElement()).then(e=>{this._destroyed?e.close():this._currencyMenu=e})}_showUnitsContextMenu(){if(!this._unitMenuEnabled)return;Object(h.trackEvent)("GUI","Unit conversion")
|
||
;v(Object(r.t)("Units"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"hpdS"))).unitActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).unitInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).unitLabelElement()).then(e=>{this._destroyed?e.close():this._unitMenu=e})}_onFontSizeChanged(){this._currencyLabelWidth=null,this._currencyFontSize=0,this._updateCurrencyLabelFont(),this.onOptimalWidthNeedToBeRecalculated()}_mouseOrTouchMoveEvent(e){if(!this._priceScale)return;this.dataSourceAtPoint(e.localX,e.localY)?this._setCursorClassName("pointer"):this._setResizeCursor()}_mouseDownOrTouchStartEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state();this._mouseDown=!0,this._undoModel.startScalePrice(t,this.priceScale(),e.localY)}_mouseEnterOrTouchStartEvent(e){this._setResizeCursor()}_pressedMouseOrTouchMoveEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._undoModel.scalePriceTo(t,i,e.localY)}_mouseUpOrTouchEndEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._mouseDown=!1,this._undoModel.endScalePrice(t,i),this.restoreDefaultCursor()}_mouseClickOrTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t&&this._undoModel.selectionMacro(e=>{e.selection().isSelected(t)||(e.clearSelection(),e.addSourceToSelection(t))})}_mouseLeaveOrTouchEndEvent(e){this._setCursorClassName("")}_mouseDoubleClickOrDoubleTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t?this._pane.processDoubleClickOnSource(t):(this.reset(),Object(h.trackEvent)("GUI","Double click price scale"))}_contextMenuOrTouchContextMenuEvent(e){if(this._options.contextMenuEnabled){const t=this.dataSourceAtPoint(e.localX,e.localY);if(null!==t&&this._options.contextMenu.source){return void this._undoModel.model().selectionMacro(i=>{i.selection().isSelected(t)||(i.clearSelection(),i.addSourceToSelection(t)),this._pane.showContextMenuForSelection(e)})}this._options.contextMenu.general&&S.ContextMenuManager.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"}).then(t=>t.show(e))}}_setResizeCursor(){const e=this.priceScale();e.isPercentage()||e.isIndexedTo100()?this._setCursorClassName(""):this._zoomAvailable()&&this._setCursorClassName("ns-resize")}_setCursorClassName(e){let t="";e&&(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t)}_zoomAvailable(){return!this.priceScale().isEmpty()&&this._undoModel.model().zoomEnabled()&&this._options.pressedMouseMoveScale}}},"y/Xm":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyOverlayBase",(function(){return y}))
|
||
;var s=i("Eyy1"),r=i("qFKp"),n=i("GVHu"),o=i("XPit"),a=i("n5al"),l=i("tc+8"),c=i.n(l),h=i("5fI3"),u=i("Kxc7"),d=i("wOSo"),p=i("BZtw"),_=i("pPtI"),m=i("k9/m");const f=r.CheckMobile.any()&&!1,g=u.enabled("uppercase_instrument_names"),v=u.enabled("study_overlay_compare_legend_option"),b=u.enabled("secondary_series_extend_time_scale");function S(e,t){return null==e[t]}class y extends n.Study{constructor(e,t,i,s){t.hasChild("currencyId")||t.addChild("currencyId",new c.a(null)),t.hasChild("unitId")||t.addChild("unitId",new c.a(null)),super(e,t,i,s),this._seriesSource=null,this.m_data=new m.PlotList(Object(o.seriesPlotFunctionMap)(),S),this._quotesProvider=new d.a,f&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate),this.properties().childs().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().childs().unitId.subscribe(this,this._onUnitChanged),this.properties().childs().allowExtendTimeScale.subscribe(this,this._onAllowExtendTimeScaleChanged),this._onAllowExtendTimeScaleChanged()}symbol(){const e=this.properties().childs().inputs.childs().symbol.value(),t=this.symbolInfo(),i=t?t.name:e;return g?i.toUpperCase():i}setSymbol(e){this._properties.inputs.symbol.setValue(e)}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this._properties.inputs.symbol.value();return e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null}data(){return null===this._seriesSource?super.data():this._seriesSource.data().bars()}symbolResolved(){return this.symbolsResolved()}quotes(){return this._quotesProvider.quotes()}currency(){return this._properties.currencyId.value()||null}setCurrency(e){this._properties.currencyId.setValue(e)}isConvertedToOtherCurrency(){return Object(a.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this._properties.unitId.value()||null}setUnit(e){this._properties.unitId.setValue(e)}isConvertedToOtherUnit(){return Object(a.isConvertedToOtherUnit)(this.symbolInfo())}symbolSource(){return this}state(e,t){const i=super.state(e,t);return i}symbolTitle(e,t){return this.title(!0,{},!1,e)}title(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return g?r.toUpperCase():r}titleInParts(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return[g?r.toUpperCase():r]}isStarted(){return null===this._seriesSource?super.isStarted():this._seriesSource.isStarted()}sourceId(){return null===this._seriesSource?super.sourceId():Object(s.ensureNotNull)(this._seriesSource.instanceId())}moveData(e){null===this._seriesSource?super.moveData(e):this._seriesSource.moveData(e)}_resolvedSymbolKey(e,t,i){const s=null!=t?t:this.currency(),r=null!=i?i:this.unit();return e+(null===s?"":"_#_"+s)+(null===r?"":"_#_"+r)}_addSymbolToMap(e,t){var i,s;const r=this._resolvedSymbolKey(e,null!==(i=Object(a.symbolCurrency)(t))&&void 0!==i?i:void 0,null!==(s=Object(a.symbolUnit)(t))&&void 0!==s?s:void 0);this._resolvedSymbols[r]=t}_onCurrencyChanged(){this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()}_onUnitChanged(){this.isStarted()&&this._tryChangeInputs(),
|
||
this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return null!==s&&(t["unit-id"]=s),t}_onSymbolResolved(e,t){super._onSymbolResolved(e,t),f&&this._setQuotesSymbol(e),this.setCurrency(Object(a.symbolCurrency)(t)),this.setUnit(Object(a.symbolUnit)(t)),this.model().realignLineTools()}_setQuotesSymbol(e){const t=this.symbolInfo(),i=Object(a.extractSymbolNameFromSymbolInfo)(t,e);this._quotesProvider.setQuotesSessionSymbol(i)}_createStudyOnServer(){null===this._seriesSource?super._createStudyOnServer():this._modifyStudyOnServer(Object(s.ensureDefined)(this._inputs))}_modifyStudyOnServer(e){null===this._seriesSource?super._modifyStudyOnServer(e):(this._seriesSource.modifySeries(Object(h.decodeExtendedSymbol)(e.symbol),Object(_.getServerInterval)(this._series.properties().interval.value())),this._seriesSource.isStarted()||this._seriesSource.start())}_stopStudyOnServer(){null===this._seriesSource?super._stopStudyOnServer():this._seriesSource.stop()}_titleInParts(e,t,i,s){const r=this.properties().childs().inputs.childs().symbol.value(),n=this.symbolInfo();let o;if(n){if(o=n.name,v){const e=this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value();"description"===e?o=n.description:"ticker-and-description"===e&&(o=`${n.name}, ${n.description}`)}if(!s&&n.exchange&&0!==n.exchange.length)return[o,[n.exchange]]}else o=r;return[o]}_onAllowExtendTimeScaleChanged(){const e=this.isStarted();if(e&&this.stop(!0),b&&this.properties().childs().allowExtendTimeScale.value()){this._seriesSource=new p.SeriesDataSource(this._model.chartApi(),"st_o_");const e=this._seriesSource.dataEvents();e.seriesError().subscribe(this,e=>{this._onStudyError(e)}),e.loading().subscribe(this,this._onStudyLoading),e.completed().subscribe(this,(e,t)=>{this._onStudyCompleted(t)}),e.dataUpdated().subscribe(this,()=>{const e=this._model.paneForSource(this);this._model.recalculatePane(e),this._updateSources(),this.priceRangeReady()||this._enablePriceRangeReady()})}else{if(null!==this._seriesSource){const e=this._seriesSource.dataEvents();e.seriesError().unsubscribeAll(this),e.loading().unsubscribeAll(this),e.completed().unsubscribeAll(this),e.dataUpdated().unsubscribeAll(this),this._seriesSource.destroy()}this._seriesSource=null}e&&this.start(!0)}}},yMne:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return n}));var s=i("J2xC");const r=parseInt(s["css-value-header-toolbar-height"]),n=3},yUly:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"SvjA",7)).then(({TrendBasedFibTimePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 3}name(){return"Trend-Based Fib Time"}migrateVersion(e,t,i){}processErase(e,t){
|
||
var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"u52p"))).TrendBasedFibTimeDefinitionsViewModel}static createProperties(e){var t=new r("linetooltrendbasedfibtime",e,!1,{range:[1,11]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,l.version=1,t.LineToolTrendBasedFibTime=l},yfAl:function(e,t,i){"use strict";i.r(t);var s=i("aO4+"),r=i("Eyy1"),n=i("txPx"),o=i("aIyQ"),a=i.n(o),l=i("e3/o"),c=i("Y7w9"),h=i("GxN8"),u=i("7ktv"),d=i("MWAT"),p=i("CW80"),_=i("s1Gx");const m=new Map([["trading",e=>Object(p.isTrading)(e)],["drawing",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["drawingsForAllSymbols",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["phantom",e=>Object(p.isLineTool)(e)&&e.isPhantom()],["restRowSources",e=>!Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)],["leftPriceScale",(e,t)=>"left"===g(e,t)],["rightPriceScale",(e,t)=>"right"===g(e,t)],["overlayPriceScale",(e,t)=>"overlay"===g(e,t)]]),f=new Map([["trading","visibleSorted"],["drawing","visibleSorted"],["drawingsForAllSymbols","allSorted"],["phantom","visibleSorted"],["restRowSources","visibleSorted"],["leftPriceScale","visibleSorted"],["rightPriceScale","visibleSorted"],["overlayPriceScale","visibleSorted"]]);function g(e,t){const i=e.priceScale();return null===i?"overlay":t.priceScalePosition(i)}class v{constructor(e){this._groupedSources=new Map,this._sources=null,this._pane=e}clear(){this._groupedSources.clear(),this._sources=null}destroy(){this.clear()}all(){return this._groupedSources.has("visibleSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("visibleSorted"))}allIncludingHidden(){return this._groupedSources.has("allSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("allSorted"))}allExceptSpecialSources(){if(!this._groupedSources.has("exceptSpecial")){const e=this.allIncludingHidden().filter(e=>e.zorder()<_.specialZOrderBase);this._groupedSources.set("exceptSpecial",e)}return Object(r.ensureDefined)(this._groupedSources.get("exceptSpecial"))}tradingSources(){return this._getSourcesByGroupType("trading")}lineSources(){return this._getSourcesByGroupType("drawing")}lineSourcesForAllSymbols(){return this._getSourcesByGroupType("drawingsForAllSymbols")}phantomSources(){return this._getSourcesByGroupType("phantom")}allExceptLineAndTradingSources(){return this._getSourcesByGroupType("restRowSources")}hitTestSources(){if(!this._groupedSources.has("hitTest")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources())
|
||
;this._groupedSources.set("hitTest",e)}return Object(r.ensureDefined)(this._groupedSources.get("hitTest"))}generalSources(){if(!this._groupedSources.has("general")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources());this._groupedSources.set("general",Object(_.sortSources)(e))}return Object(r.ensureDefined)(this._groupedSources.get("general"))}leftPriceScalesSources(){return this._getSourcesByGroupType("leftPriceScale")}rightPriceScalesSources(){return this._getSourcesByGroupType("rightPriceScale")}overlayPriceScaleSources(){return this._getSourcesByGroupType("overlayPriceScale")}_getSourcesByGroupType(e){const t=Object(r.ensureDefined)(f.get(e));return this._groupedSources.has(t)?this._groupedSources.has(e)||this._groupSources(e):(this._sortSources(),this._groupSources(e)),Object(r.ensureDefined)(this._groupedSources.get(e))}_sortSources(){null===this._sources&&(this._sources=this._pane.dataSources());const e=Object(_.sortSources)(this._sources),t=e.filter(e=>!Object(p.isLineTool)(e)||e.isActualSymbol()&&e.isActualCurrency()&&e.isActualUnit());this._groupedSources.set("allSorted",e),this._groupedSources.set("visibleSorted",t)}_groupSources(e){const t=Object(r.ensureDefined)(f.get(e)),i=m.get(e);if(void 0!==i){const s=Object(r.ensureDefined)(this._groupedSources.get(t)).filter(e=>i(e,this._pane));this._groupedSources.set(e,s)}}}var b=i("1Wlv"),S=i("FaJS"),y=i("Qb4w");i.d(t,"PaneBase",(function(){return P}));const w=Object(n.getLogger)("Chart.Pane");function C(e,t,i){e.setMargins({top:t,bottom:i})}class P{constructor(e,t,i,s){this.m_dataSources=[],this._sourceAlertSubscriptions=new Map,this.m_mainDataSource=null,this._cachedOrderedSources=new v(this),this._sourcesById=new Map,this._dataSourcesCollectionChanged=new a.a,this._sourcePropertiesChanged=new a.a,this._sourcesZOrderChanged=new a.a,this._tagsChanged=new a.a,this._stretchFactor=1e3,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._rightPriceScales=[],this._leftPriceScales=[],this._lockedPriceScale=null,this._currentPriceScaleRatio=null,this._onPriceScalesChanged=new a.a,this._isRecalculatingScales=!1,this._priceDataSources=[],this._bulkActionsActive=0,this._priceScaleSelectionStrategy=Object(d.createPriceScaleSelectionStrategy)(i.properties().priceScaleSelectionStrategyName.value()),this._id=null!=s?s:Object(l.randomHashN)(6)}id(){return this._id}bulkActionMacro(e){this._bulkActionsActive+=1,e(),this._bulkActionsActive-=1,0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}sourcesByGroup(){return this._cachedOrderedSources}dataSourceForId(e){return this._sourcesById.get(e)||null}changeSourceId(e,t){Object(r.assert)(this.hasDataSource(e)),this._sourcesById.delete(e.id()),e.setId(t),this._sourcesById.set(t,e)}movePriceScale(e,t,i){const s=this.priceScalePosition(e);if(s!==t)this.removePriceScale(e),this._placePriceScale(e,t,i),e.invalidateMargins(),this._invalidateSourcesCache();else if(void 0!==i&&"overlay"!==s){const t="left"===s?this._leftPriceScales:this._rightPriceScales,r=t.indexOf(e)
|
||
;t.splice(r,1),t.splice(i,0,e)}}isEmpty(){return null===this.m_mainDataSource}recalculatePriceScale(e){if(!e)return;const t=e.sourcesForAutoscale();if((e.isAutoScale()||e.priceRangeShouldBeRecalculatedOnce())&&t&&t.length>0&&!this.timeScale().isEmpty()){const t=this.timeScale().visibleBarsStrictRange();e.recalculatePriceRange(t)}e.updateAllViews()}onSourceTagsChanged(){this._tagsChanged.fire()}getZOrderMinMax(){const e=this.sourcesByGroup().all();if(0===e.length)return{minZOrder:0,maxZOrder:0};let t=1/0,i=-1/0;for(const s of e)if(!Object(_.isSpeciallyZOrderedSource)(s)){const e=s.zorder();t=Math.min(t,e),i=Math.max(i,e)}return{minZOrder:t,maxZOrder:i}}insertDataSource(e,t,i){t||(t=this.findSuitableScale(e)),this._addSourceToCollections(e);let s=!1;(e===this.model().mainSeries()||null===this.m_mainDataSource)&&(this.m_mainDataSource=e,s=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),t.invalidateMargins(),e.onTagsChanged&&e.onTagsChanged().subscribe(this,this.onSourceTagsChanged),e.setZorder(i),s&&this._processMainSourceChange(),this._tagsChanged.fire(),e instanceof u.PriceDataSource&&this.recalculatePriceScale(t),this._invalidateSourcesCache()}addDataSource(e,t,i){let s=e.zorder();i||(Object(p.isLineTool)(e)?(s=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=s)):s=this.getZOrderMinMax().minZOrder-1),this.insertDataSource(e,t,s)}removeDataSource(e,t,i){const s=this.m_dataSources.indexOf(e);if(-1===s)return void w.logDebug("removeDataSource: invalid data source");this._removeSourceFromCollections(s,!!i),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null);const r=e.priceScale();this._removeSourceFromPriceScale(e),e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,this.onSourceTagsChanged),e instanceof u.PriceDataSource&&!t&&this._processMainSourceChange(),this._tagsChanged.fire(),r&&e instanceof u.PriceDataSource&&this.recalculatePriceScale(r),this._invalidateSourcesCache()}hasDataSource(e){return this._sourcesById.has(e.id())}dataSources(){return this.m_dataSources}priceDataSources(){return this._priceDataSources}replaceSource(e,t,i){const s=this.m_mainDataSource===e,r=e.zorder();this.insertDataSource(t,i,r),this.removeDataSource(e,s),this._sourcesById.set(t.id(),t),s&&(this.m_mainDataSource=t,this._processMainSourceChange())}isOverlay(e){const t=e.priceScale();return null===t||"overlay"===this.priceScalePosition(t)}updateAllViews(){for(const e of this.m_dataSources)e.updateAllViews();for(const e of this.model().customSources())e.updateViewsForPane(this)}priceScalePosition(e){return this._leftPriceScales.includes(e)?"left":this._rightPriceScales.includes(e)?"right":"overlay"}createPriceScaleAtPosition(e,t){const i=this.properties().childs().axisProperties.state();i.autoScale=!0;const s=new b.PriceScale(this.model().properties().scalesProperties,i);return s.setHeight(this.height()),C(s,this._defaultTopMargin(),this._defaultBottomMargin()),
|
||
this._placePriceScale(s,e,t),s}removePriceScale(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this),e===this._lockedPriceScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null);const t=this._leftPriceScales.indexOf(e);-1!==t&&(this._leftPriceScales[t].invalidateMargins(),this._leftPriceScales.splice(t,1));const i=this._rightPriceScales.indexOf(e);if(-1!==i&&(this._rightPriceScales[i].invalidateMargins(),this._rightPriceScales.splice(i,1)),null===e.mainSource()){const t=e.dataSources().length;0!==t&&w.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+t)}this._onPriceScalesChanged.fire()}move(e,t,i){const s=e.priceScale();this._removeSourceFromPriceScale(e),t.addDataSource(e),e.setPriceScale(t),t.invalidateMargins(),this._processMainSourceChange(),this._invalidateSourcesCache(),e.isIncludedInAutoScale()&&(null!==s&&this.recalculatePriceScale(s),this.recalculatePriceScale(t)),this._onPriceScalesChanged.fire()}setZOrder(e,t){e.setZorder(t),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}setZOrders(e){e.forEach((e,t)=>{t.setZorder(e)}),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire(),this.model().lightUpdate()}containsMainSeries(){return this._sourcesById.has(this.model().mainSeries().id())}applyPriceScaleRatio(e,t){var i;null!==this._lockedPriceScale&&this._lockedPriceScale!==e||this._currentPriceScaleRatio===t||!this.isMainPane()||null===this._lockedPriceScale&&e!==(null===(i=this.mainDataSource())||void 0===i?void 0:i.priceScale())||(this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e),!0,!0),null!==this._lockedPriceScale?this._tryToApplyNewPriceScaleRatio():e.isLog()||this.model().mainSeriesScaleRatioPropertyOnChanged())}sendToBack(e){this._batchReorder(e,0,c.moveBefore)}bringToFront(e){const t=this.sourcesByGroup().allExceptSpecialSources().length-1;this._batchReorder(e,t,c.moveAfter)}sendBackward(e){const t=this.sourcesByGroup().allIncludingHidden(),i=t.indexOf(e[0]);if(0===i)this.bringToFront(e);else{const s=t[i-1];this.insertBefore(e,s)}}bringForward(e){const t=this.sourcesByGroup().allExceptSpecialSources(),i=t.indexOf(e[e.length-1]);if(i===t.length-1)this.sendToBack(e);else{const s=t[i+1];this.insertAfter(e,s)}}insertAfter(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveAfter)}insertBefore(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveBefore)}priceScaleSelectionStrategy(){return this._priceScaleSelectionStrategy}findTargetPriceAxisViews(e,t,i,s){if(Object(h.a)(e)&&this.model().paneForSource(e)!==this)return[];const r=e.priceScale();if(t===r)return i;if(null===r)return[];if("overlay"===this.priceScalePosition(r))return t===this.defaultPriceScale()?i:[];const n=this.priceScalePosition(t);if(n!==this.priceScalePosition(r))return[]
|
||
;const o="left"===n?this.leftPriceScales():this.rightPriceScales();return o.indexOf(t)<o.indexOf(r)?s:[]}onPriceScalesChanged(){return this._onPriceScalesChanged}setPaneSize(e){let t;switch(e){case"large":t=1;break;case"medium":t=.6;break;case"small":t=.3;break;case"tiny":t=.15;break;default:throw new Error("Unknown size enum value: "+e)}this._stretchFactor=1e3*t}stretchFactor(){return this._stretchFactor}setStretchFactor(e){this._stretchFactor=e}customSources(e){return this.model().customSources(e)}onTagsChanged(){return this._tagsChanged}dataSourcesCollectionChanged(){return this._dataSourcesCollectionChanged}sourcePropertiesChanged(){return this._sourcePropertiesChanged}sourceZOrderChanged(){return this._sourcesZOrderChanged}lineToolsForArea(e){const t=this.height(),i=this.width(),s=this.logicalRectToPixels(e);return[...this.m_dataSources,...this.model().multiPaneSources(this)].filter(p.isLineTool).filter(e=>(e.paneViews(this)||[]).some(e=>{const r=e.renderer(t,i);return r&&r.doesIntersectWithBox&&r.doesIntersectWithBox(s)}))}logicalRectToPixels(e){const t=this.defaultPriceScale(),i=this.timeScale(),n=Object(r.ensureNotNull)(Object(r.ensureNotNull)(t.mainSource()).firstValue()),o=t.priceToCoordinate(e.p1.price,n),a=i.indexToCoordinate(e.p1.index),l=t.priceToCoordinate(e.p2.price,n),c=i.indexToCoordinate(e.p2.index),h=new s.Point(Math.min(a,c),Math.min(o,l)),u=new s.Point(Math.max(a,c),Math.max(o,l));return Object(s.box)(h,u)}clipboardLineToolOwnerSource(e){const t=this.dataSourceForId(e);if(null!==t){const e=t.ownerSource();if(null!==e&&null!==e.firstValue())return e}const i=this.mainDataSource();if(null!==i&&null!==i.firstValue())return i;for(const s of this.dataSources())if(s instanceof u.PriceDataSource&&null!==s.firstValue())return s;return null}realignLineTools(){let e=!1;for(const t of this.m_dataSources)Object(p.isLineTool)(t)&&(t.calcIsActualSymbol(),t.updateAllViews(),e=!0);return this._invalidateSourcesCache(),e}startScalePrice(e,t){e.startScale(t)}scalePriceTo(e,t){e.scaleTo(t),this.updateAllViews()}endScalePrice(e){e.endScale()}resetPriceScale(e){const t=this.timeScale().visibleBarsStrictRange();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()}restorePriceScaleState(e,t){e.restoreState(t),this.updateAllViews()}_addSourceToCollections(e,t){this.m_dataSources.push(e),this._sourcesById.set(e.id(),e),this._invalidateSourcesCache(),t||0!==this._bulkActionsActive||this._dataSourcesCollectionChanged.fire();const i=()=>{this._sourcePropertiesChanged.fire(e)};e.properties().subscribe(this,i),e.zOrderChanged().subscribe(this,t=>this._sourcesZOrderChanged.fire(e,t)),Object(p.isLineTool)(e)&&(e.normalizedPointsChanged().subscribe(this,i),e.hasAlert.subscribe(i)),e instanceof u.PriceDataSource&&(e.currencyChanged().subscribe(this,()=>this._invalidateSourcesCache()),e.unitChanged().subscribe(this,()=>this._invalidateSourcesCache()),this._priceDataSources.push(e)),this._sourceAlertSubscriptions.set(e.id(),i),e.isMultiPaneAvailable()&&this.model().addMultiPaneSource(e)}
|
||
_removeSourceFromCollections(e,t){const i=this.m_dataSources[e];i.properties().unsubscribeAll(this),i.zOrderChanged().unsubscribeAll(this),this.m_dataSources.splice(e,1),this._sourcesById.delete(i.id());const s=i.id();if(this._sourceAlertSubscriptions.has(s)&&(i.hasAlert.unsubscribe(this._sourceAlertSubscriptions.get(s)),this._sourceAlertSubscriptions.delete(s)),this._invalidateSourcesCache(),t||0!==this._bulkActionsActive||this._dataSourcesCollectionChanged.fire(),i instanceof u.PriceDataSource){i.currencyChanged().unsubscribeAll(this),i.unitChanged().unsubscribeAll(this);const e=this._priceDataSources.indexOf(i);Object(r.assert)(-1!==e),this._priceDataSources.splice(e,1)}i.isMultiPaneAvailable()&&this.model().removeMultiPaneSource(i)}_recalculatePriceScaleByScaleRatio(e){this.isMainPane()&&e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToPriceScale():this._tryToApplyNewPriceScaleRatio())}_defaultBottomMargin(){return.01*this.properties().childs().bottomMargin.value()}_defaultTopMargin(){return.01*this.properties().childs().topMargin.value()}_updateMargins(){const e=this._defaultTopMargin(),t=this._defaultBottomMargin();for(const i of this._leftPriceScales)C(i,e,t);for(const i of this._rightPriceScales)C(i,e,t);for(const i of this.m_dataSources)if(this.isOverlay(i)){const s=i.priceScale();null!==s&&(C(s,e,t),this.recalculatePriceScale(s))}for(const i of this._leftPriceScales)this.recalculatePriceScale(i);for(const i of this._rightPriceScales)this.recalculatePriceScale(i);this.updateAllViews()}_batchReorder(e,t,i){i(this.sourcesByGroup().allIncludingHidden(),e,t).forEach((e,t)=>e.setZorder(t+1)),this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire(),this.model().fullUpdate()}_placePriceScale(e,t,i){if("overlay"===t)return void e.invalidateMargins();const s="left"===t?this._leftPriceScales:this._rightPriceScales,n=void 0===i?s.length:i;s.splice(n,0,e),e.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,e)),e.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._onPriceScaleSetMinMaxPriceRange.bind(this,e)),e.isLockScale()&&(Object(r.assert)(null===this._lockedPriceScale),this._lockedPriceScale=e,this._currentPriceScaleRatio=null),e.invalidateMargins(),this._onPriceScalesChanged.fire()}_onPriceScaleModeChanged(e,t,i){if(i.lockScale&&(this._lockedPriceScale!==e&&null!==this._lockedPriceScale&&this._lockedPriceScale.setMode({lockScale:!1}),this._lockedPriceScale=e,this._currentPriceScaleRatio=Object(S.scaleRatio)(this.timeScale(),e)),t.lockScale&&!i.lockScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null),t.percentage===i.percentage&&t.indexedTo100===i.indexedTo100)return;const s=this.timeScale().visibleBarsStrictRange();null!==s&&(e.recalculatePriceRange(s),e.updateAllViews())}_applyOldScaleRatioToPriceScale(){
|
||
this._isRecalculatingScales||null===this._currentPriceScaleRatio||null===this._lockedPriceScale||(this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(this._lockedPriceScale,this._currentPriceScaleRatio,this._mainSourceVisiblePriceRange(this._lockedPriceScale)),this._isRecalculatingScales=!1)}_setNewPriceRangeByScaleRatio(e,t,i,s,r){const n=Object(S.priceRangeByScaleRatio)(e,this.timeScale().barSpacing(),t);e.setPriceRange(null!==n?n:i,s,r)}_applyOldScaleRatioToTimeScale(){this._isRecalculatingScales||null===this._currentPriceScaleRatio||(this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(),this._isRecalculatingScales=!1)}_tryToApplyNewPriceScaleRatio(){const e=Object(r.ensureNotNull)(this._lockedPriceScale),t=Object(S.scaleRatio)(this.timeScale(),e);this._currentPriceScaleRatio===t||e.isLog()||(this._currentPriceScaleRatio=t,this.model().mainSeriesScaleRatioPropertyOnChanged())}_recalculateTimeScaleByScaleRatio(e){e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToTimeScale():this._tryToApplyNewPriceScaleRatio())}_setNewBarSpacingByScaleRatio(){const e=this.timeScale().getValidBarSpacing(Object(S.barSpacingByScaleRatio)(Object(r.ensureNotNull)(this._lockedPriceScale),this._currentPriceScaleRatio));this.timeScale().isValidBarSpacing(e)&&this.timeScale().setBarSpacing(e)}_mainSourceVisiblePriceRange(e){const t=this.timeScale().visibleBarsStrictRange();return null!==t?Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.mainSource()).priceRange(t.firstBar(),t.lastBar())):new y.PriceRange(-.5,.5)}_setMinMaxPriceRange(){const e=Object(r.ensureNotNull)(this._lockedPriceScale),t=Object(S.priceRangeByScaleRatio)(e,this.timeScale().maxBarSpacing(),this._currentPriceScaleRatio),i=Object(S.priceRangeByScaleRatio)(e,this.timeScale().minBarSpacing(),this._currentPriceScaleRatio);null!==t&&e.setMaxPriceRange(t),null!==i&&e.setMinPriceRange(i)}_onPriceScaleSetMinMaxPriceRange(e){e===this._lockedPriceScale&&this._setMinMaxPriceRange()}_removeSourceFromPriceScale(e){const t=e.priceScale();if(t&&t.dataSources().indexOf(e)>=0&&t.removeDataSource(e),t&&null===t.mainSource()){const e=t.dataSources().length;0!==e&&w.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+e),this.removePriceScale(t)}}}},yi8X:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolInfoLine",(function(){return n}));var s=i("Ocx9"),r=i("WPQD");class n extends r.LineToolTrendLine{constructor(e,t){super(e,t||n.createProperties())}pointsCount(){return 2}name(){return"Info Line"}static createProperties(e){const t=new s.DefaultProperty("linetoolinfoline",e);return n._configureProperties(t),t}static _configureProperties(e){r.LineToolTrendLine._configureProperties(e)}}},"z+Sa":function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesHorizontalBaseLinePaneView",(function(){return r}));var s=i("k4w6");class r extends s.a{constructor(e){super(e)}_updateImpl(){this._lineRendererData.visible=!1;const e=this._series.priceScale().mode();if(!e.percentage&&!e.indexedTo100)return
|
||
;const t=this._series.firstValue();null!==t&&(this._lineRendererData.visible=!0,this._lineRendererData.y=this._series.priceScale().priceToCoordinate(t,t),this._lineRendererData.color=this._series.properties().baseLineColor.value())}}},"z+cS":function(e,t,i){"use strict";i.r(t),i.d(t,"VerticalLineRenderer",(function(){return a}));var s=i("VdBB"),r=i("jFln"),n=i("gAom"),o=i("Zp/P");class a{constructor(){this._data=null,this._hitTest=null}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data)return null;const t=Object(o.interactionTolerance)().line,i=this._hitTest||new s.HitTestResult(s.HitTestResult.MOVEPOINT),r=Math.abs(e.x-this._data.x)<=t+this._data.linewidth/2,n=void 0===this._data.top||this._data.top-e.y<=t,a=void 0===this._data.bottom||e.y-this._data.bottom<=t;return r&&n&&a?i:null}draw(e,t){if(null===this._data)return;if(this._data.linewidth<=0)return;if(this._data.x<-this._data.linewidth/2||this._data.x>t.cssWidth+this._data.linewidth/2)return;const i=t.pixelRatio;e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&Object(r.setLineStyle)(e,this._data.linestyle);const s=void 0!==this._data.top?Math.max(this._data.top,0):0,o=void 0!==this._data.bottom?Math.min(this._data.bottom,t.cssHeight):t.cssHeight,a=Math.round(this._data.x*i),l=Math.floor(s*i),c=Math.ceil(o*i);Object(n.drawVerticalLine)(e,a,l,c)}}},"z61+":function(e,t,i){"use strict";var s=i("Eyy1"),r=i("0YCj"),n=i.n(r),o=i("23IT"),a=i("ogJP"),l=i("txPx");const c=["first_visible_bar_time","last_visible_bar_time"];function h(e){return!e.groupId&&!e.isHidden&&!c.includes(e.id)}var u=i("Ecpn");i.d(t,"a",(function(){return p}));const d=Object(l.getLogger)("Platform.GUI.PropertyDialog.Indicators.MetaInfo");class p{constructor(e){this._metaInfo=e}hasUserEditableInputs(){return this._metaInfo.inputs.some(h)}getUserEditableInputs(){return this._metaInfo.inputs.filter(h)}hasUserEditableProperties(){return n.a.isScriptStrategy(this._metaInfo)}hasUserEditableStyles(){const e=this._metaInfo;return e.plots.length>0||void 0!==e.bands||void 0!==e.filledAreas||Object(u.a)(e.shortId)||n.a.isScriptStrategy(this._metaInfo)||Object.values(e.graphics).some(e=>void 0!==e)}getUserEditablePlots(){const e=new Set,t=this._metaInfo;return t.plots.filter(i=>{if(Object(o.isColorerPlot)(i)||Object(o.isTextColorerPlot)(i)||Object(o.isDataOffsetPlot)(i)||Object(o.isOhlcColorerPlot)(i)||Object(o.isAlertConditionPlot)(i))return!1;if(Object(o.isOhlcPlot)(i)){const r=i.target;if(e.has(r))return!1;e.add(r);const n=Object(s.ensureDefined)(t.ohlcPlots);return!Object(s.ensureDefined)(n[r]).isHidden}{const e=t.styles?t.styles[i.id]:void 0;return void 0===e||!e.isHidden}})}hasUserEditableOptions(){return this.hasUserEditableInputs()||this.hasUserEditableProperties()||this.hasUserEditableStyles()}getStrategyProperties(){const e=this._metaInfo,t=e.inputs.filter(m),i=Object.assign({},_);for(const s of t){const t=s.internalID;i[t]=s,
|
||
_.hasOwnProperty(t)||d.logWarn(`Unknown strategy input internal id ${t} in ${e.fullId}`)}return Object(a.clone)(i)}}const _={currency:void 0,backtest_fill_limits_assumption:void 0,calc_on_every_tick:void 0,calc_on_order_fills:void 0,commission_value:void 0,commission_type:void 0,initial_capital:void 0,pyramiding:void 0,slippage:void 0,default_qty_type:void 0,default_qty_value:void 0,margin_long:void 0,margin_short:void 0};function m(e){return"strategy_props"===e.groupId}},"z8/4":function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayLegendView",(function(){return n}));var s=i("JjUe"),r=i("qXYw");class n extends s.OverlayDataWindowView{constructor(e,t){super(e,t),this._additional=null,this._showBarChange=t.properties().paneProperties.legendProperties.showBarChange,this._showSeriesOHLC=t.properties().paneProperties.legendProperties.showSeriesOHLC,this._studyOverlay=e,this._showBarChange.subscribe(this,this.update),this._showSeriesOHLC.subscribe(this,this.update)}isValuesVisible(){return this._showSeriesOHLC.value()||this._showBarChange.value()}additional(){return this._additional}destroy(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)}_updateImpl(){super._updateImpl()}_createValuesProvider(e,t){return new r.OverlayLegendValuesProvider(e,t)}}},zDbI:function(e,t,i){"use strict";i.r(t),i.d(t,"CHART_FONT_FAMILY",(function(){return r}));var s=i("mNbo");const r=Object(s.a)("old")?"system-ui, -apple-system":"'Trebuchet MS', Roboto, Ubuntu, sans-serif"},zL3Q:function(e,t,i){"use strict";i.d(t,"a",(function(){return _})),i.d(t,"b",(function(){return m}));var s=i("hY0g"),r=i.n(s),n=i("4o++"),o=i("mMWL"),a=i("CW80"),l=i("m/3z");const c=new r.a(!1),h=new r.a(n.MagnetMode.WeakMagnet),u=Object(l.b)(),d=Object(l.c)();function p(){const e=u.value();if(d.value()&&(o.isToolEditingNow.value()||o.isToolCreatingNow.value()))return void c.setValue(!1);const t=o.tool.value(),i=e&&(Object(a.isLineToolName)(t)||o.isToolEditingNow.value()||Object(o.toolIsMeasure)(t)),s=Object(o.properties)().childs().magnet.value();h.setValue(!s&&i?n.MagnetMode.StrongMagnet:Object(o.properties)().childs().magnetMode.value()),c.setValue(i?!s:s)}function _(){return c}function m(){return h}Object(o.runOnDrawingStateReady)(()=>{Object(o.properties)().childs().magnet.subscribe(null,p),Object(o.properties)().childs().magnetMode.subscribe(null,p),u.subscribe(p),d.subscribe(p),o.tool.subscribe(p),o.isToolEditingNow.subscribe(p),p()})},zM7N:function(e,t,i){"use strict";i.d(t,"c",(function(){return c})),i.d(t,"b",(function(){return h})),i.d(t,"e",(function(){return u})),i.d(t,"d",(function(){return d}));var s=i("YFKU"),r=i("eJTA"),n=i("/McG"),o=i("8pII"),a=i("FZIs");function l(){return{[a.a.Light]:JSON.parse(JSON.stringify(n)),[a.a.Dark]:JSON.parse(JSON.stringify(o))}}function c(){return[a.a.Light,a.a.Dark]}function h(e){return l()[e]}function u(e){return{[a.a.Light]:s.t("Light",{context:"colorThemeName"}),[a.a.Dark]:s.t("Dark",{context:"colorThemeName"})}[e]||e}function d(e){const t=l();return c().some(i=>p(t[i],e))}function p(e,t){
|
||
let i=e.content===t.content;return function(e={},t){try{!function e(t,i,s){for(const r in t)if(t.hasOwnProperty(r)){const n=i.concat(r);if("object"==typeof t[r])e(t[r],n,s);else if(s(n,t[r]))throw new Error("exit")}}(e,[],t)}catch(i){return}}(e.content,(e,s)=>{const n=function(e,t={}){let i=t;for(let s=0;s<e.length;s++){if(!i||"object"!=typeof i)return;i=i[e[s]]}if("string"==typeof i||"number"==typeof i)return i;return}(e,t.content);return i=function(e,t){if("string"==typeof e&&"string"==typeof t)try{return Object(r.areEqualRgb)(Object(r.parseRgb)(e),Object(r.parseRgb)(t))}catch(i){return e===t}return e===t}(s,n),!i}),i}i.d(t,"a",(function(){return a.a}))},zRdu:function(e,t,i){"use strict";var s;i.d(t,"a",(function(){return s})),function(e){e[e.Separator=0]="Separator",e[e.Action=1]="Action",e[e.ActionAsync=2]="ActionAsync"}(s||(s={}))},zUrt:function(e,t,i){"use strict";i.r(t),i.d(t,"backend",(function(){return s}));const s=i("Ery9")},zXvd:function(e,t,i){"use strict";i.r(t),i.d(t,"NumericFormatter",(function(){return n}));var s=i("kcTO"),r=i("nc0P");class n{constructor(e){this._precision=e}format(e){return(void 0!==this._precision?e.toFixed(this._precision):n.formatNoE(e)).replace(".",s.formatterOptions.decimalSign)}parse(e){const t=e.replace(s.formatterOptions.decimalSign,".");let i=parseFloat(t);return this._precision&&(i=+i.toFixed(this._precision)),i}static formatNoE(e){if(!Number.isFinite(e))return String(e);const t=new r.Big(e);return t.lt(1)?t.toFixed():t.toString()}}},zZ5f:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX").LineToolColorsProperty;class o extends s{constructor(e,t){super(e,t||o.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"xp9B",7)).then(({FibSpeedResistanceFanPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}hLevelsCount(){return o.HLevelsCount}vLevelsCount(){return o.VLevelsCount}pointsCount(){return 2}name(){return"Fib Speed Resistance Fan"}processErase(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"2PB4"))).FibSpeedResistanceFanDefinitionsViewModel}static createProperties(e){void 0!==e&&void 0===e.reverse&&(e.reverse=!0);var t=new r("linetoolfibspeedresistancefan",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return o._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);var t=[e.child("grid").child("color")];for(let i=1;i<=o.HLevelsCount;i++)t.push(e.child("hlevel"+i).child("color"));for(let i=1;i<=o.VLevelsCount;i++)t.push(e.child("vlevel"+i).child("color"));e.addChild("linesColors",new n(t)),e.addExclusion("linesColors")}}o.HLevelsCount=7,o.VLevelsCount=7,t.LineToolFibSpeedResistanceFan=o},ziJ5:function(e,t,i){"use strict";(function(e){
|
||
var s=i("QIuV").LineToolTrading,r=i("Ss5c").LineDataSource,n=i("RTYN").PositionAveragePriceAxisView,o=i("jkoZ"),a=i("Ocx9").DefaultProperty,l=i("kcTO").PriceFormatter,c=i("s1Gx").sortSourcesPreOrdered.LineToolPosition;function h(e){return null==e?e="":e+="",e}class u{constructor(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0,this._direction="buy",this._profitState="neutral"}setDirection(e){return this._direction=e,this._line.updateAllViewsAndRedraw(),this}setProfitState(e){return this._profitState=e,this._line.updateAllViewsAndRedraw(),this}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0}setPrice(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this}getText(){return this._data.bodyText}setText(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this}setTooltip(e){return this._line.properties().tooltip.setValue(h(e)),this}getTooltip(){return this._line.properties().tooltip.value()}setProtectTooltip(e){return this._line.properties().protectTooltip.setValue(h(e)),this}getProtectTooltip(){return this._line.properties().protectTooltip.value()}setCloseTooltip(e){return this._line.properties().closeTooltip.setValue(h(e)),this}getCloseTooltip(){return this._line.properties().closeTooltip.value()}setReverseTooltip(e){return this._line.properties().reverseTooltip.setValue(h(e)),this}getReverseTooltip(){return this._line.properties().reverseTooltip.value()}getQuantity(){return this._data.quantityText}setQuantity(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this}getExtendLeft(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e}setExtendLeft(e){return this._line.properties().extendLeft.setValue(e),this}getLineLength(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e}setLineLength(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this}getLineColor(){var e=this._line.properties();return("buy"===this._direction?e.lineBuyColor:e.lineSellColor).value()}setLineColor(e){return"buy"===this._direction?this.setLineBuyColor(e):this.setLineSellColor(e),this}setLineBuyColor(e){return this._line.properties().lineBuyColor.setValue(e),this}setLineSellColor(e){return this._line.properties().lineSellColor.setValue(e),this}getLineStyle(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e}setLineStyle(e){return this._line.properties().lineStyle.setValue(e),this}getLineWidth(){var e=this._line.properties().lineWidth.value()
|
||
;return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e}setLineWidth(e){return this._line.properties().lineWidth.setValue(e),this}getBodyBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.bodyBorderBuyColor:e.bodyBorderSellColor).value()}setBodyBorderColor(e){return"buy"===this._direction?this.setBodyBorderBuyColor(e):this.setBodyBorderSellColor(e),this}setBodyBorderBuyColor(e){return this._line.properties().bodyBorderBuyColor.setValue(e),this}setBodyBorderSellColor(e){return this._line.properties().bodyBorderSellColor.setValue(e),this}getBodyBackgroundColor(){return o.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)}setBodyBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this}getBodyTextColor(){var e=this._line.properties();return("positive"===this._profitState?e.bodyTextPositiveColor:"negative"===this._profitState?e.bodyTextNegativeColor:e.bodyTextNeutralColor).value()}setBodyTextColor(e){return"positive"===this._profitState?this.setBodyTextPositiveColor(e):"negative"===this._profitState?this.setBodyTextNegativeColor(e):this.setBodyTextNeutralColor(e),this}setBodyTextPositiveColor(e){return this._line.properties().bodyTextPositiveColor.setValue(e),this}setBodyTextNegativeColor(e){return this._line.properties().bodyTextNegativeColor.setValue(e),this}setBodyTextNeutralColor(e){return this._line.properties().bodyTextNeutralColor.setValue(e),this}getBodyFont(){return o.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)}setBodyFont(e){return o.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this}getQuantityBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.quantityBorderBuyColor:e.quantityBorderSellColor).value()}setQuantityBorderColor(e){return"buy"===this._direction?this.setQuantityBorderBuyColor(e):this.setQuantityBorderSellColor(e),this}setQuantityBorderBuyColor(e){return this._line.properties().quantityBorderBuyColor.setValue(e),this}setQuantityBorderSellColor(e){return this._line.properties().quantityBorderSellColor.setValue(e),this}getQuantityBackgroundColor(){var e=this._line.properties();return("buy"===this._direction?e.quantityBackgroundBuyColor:e.quantityBackgroundSellColor).value()}setQuantityBackgroundColor(e){return"buy"===this._direction?this.setQuantityBackgroundBuyColor(e):this.setQuantityBackgroundSellColor(e),this}setQuantityBackgroundBuyColor(e){return this._line.properties().quantityBackgroundBuyColor.setValue(e),this}setQuantityBackgroundSellColor(e){return this._line.properties().quantityBackgroundSellColor.setValue(e),this}getQuantityTextColor(){
|
||
return o.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)}setQuantityTextColor(e){return o.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this}getQuantityFont(){return o.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)}setQuantityFont(e){return o.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this}getReverseButtonBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonBorderBuyColor:e.reverseButtonBorderSellColor).value()}setReverseButtonBorderColor(e){return"buy"===this._direction?this.setReverseButtonBorderBuyColor(e):this.setReverseButtonBorderSellColor(e),this}setReverseButtonBorderBuyColor(e){return this._line.properties().reverseButtonBorderBuyColor.setValue(e),this}setReverseButtonBorderSellColor(e){return this._line.properties().reverseButtonBorderSellColor.setValue(e),this}getReverseButtonBackgroundColor(){return o.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)}setReverseButtonBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this}getReverseButtonIconColor(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonIconBuyColor:e.reverseButtonIconSellColor).value()}setReverseButtonIconColor(e){return"buy"===this._direction?this.setReverseButtonIconBuyColor(e):this.setReverseButtonIconSellColor(e),this}setReverseButtonIconBuyColor(e){return this._line.properties().reverseButtonIconBuyColor.setValue(e),this}setReverseButtonIconSellColor(e){return this._line.properties().reverseButtonIconSellColor.setValue(e),this}getCloseButtonBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.closeButtonBorderBuyColor:e.closeButtonBorderSellColor).value()}setCloseButtonBorderColor(e){return"buy"===this._direction?this.setCloseButtonBorderBuyColor(e):this.setCloseButtonBorderSellColor(e),this}setCloseButtonBorderBuyColor(e){return this._line.properties().closeButtonBorderBuyColor.setValue(e),this}setCloseButtonBorderSellColor(e){return this._line.properties().closeButtonBorderSellColor.setValue(e),this}getCloseButtonBackgroundColor(){return o.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)}setCloseButtonBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this}getCloseButtonIconColor(){var e=this._line.properties()
|
||
;return("buy"===this._direction?e.closeButtonIconBuyColor:e.closeButtonIconSellColor).value()}setCloseButtonIconColor(e){return"buy"===this._direction?this.setCloseButtonIconBuyColor(e):this.setCloseButtonIconSellColor(e),this}setCloseButtonIconBuyColor(e){return this._line.properties().closeButtonIconBuyColor.setValue(e),this}setCloseButtonIconSellColor(e){return this._line.properties().closeButtonIconSellColor.setValue(e),this}block(){this._blocked=!0,this._line.updateAllViewsAndRedraw()}unblock(){this._blocked=!1,this._line.updateAllViewsAndRedraw()}isFunction(e){return"function"==typeof e}onReverse(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this}callOnReverse(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)}isOnReverseCallbackPresent(){return this.isFunction(this._onReverseCallback)}onClose(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this}setCloseEnabled(e){return this._closeEnabled===e||(this._closeEnabled=e,this._onCloseCallback&&this._line.updateAllViewsAndRedraw()),this}isCloseEnabled(){return this._closeEnabled}callOnClose(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)}isOnCloseCallbackPresent(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)}onModify(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this}callOnModify(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)}onContextMenu(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this}shouldShowContextMenu(){return this.isFunction(this._onContextMenuCallback)}callOnContextMenu(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)}remove(){this._line._model.removeSource(this._line),delete this._line}}class d extends s{constructor(e,t){super(e,t||d.createProperties()),this._adapter=new u(this),i.e("lt-pane-views").then(i.t.bind(null,"GzSs",7)).then(({PositionPaneView:e})=>{this._setPaneViews([new e(this,this._model)])});var s=e.mainSeries().symbolInfo(),r=null!==s?s.pricescale:100,n=null!==s&&s.fractional?s.minmov:1,o=null!==s&&s.fractional,a=null!==s?s.minmove2:void 0;this._formatter=new l(r,n,o,a)}zorder(){return c}setPoint(e,t,i){this._points[e]=t,this.normalizePoints()}addPoint(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}name(){return"Position"}createPriceAxisView(e){return this._priceAxisView=new n(this,{pointIndex:e,backgroundPropertyGetter:()=>this._adapter.getLineColor()}),this._priceAxisView}paneViews(){
|
||
return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?r.prototype.paneViews.call(this):null}priceAxisViews(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?r.prototype.priceAxisViews.call(this,t,i):null}hasContextMenu(){return this._adapter.shouldShowContextMenu()}contextMenuItems(){return this._adapter.callOnContextMenu()}formatter(){return this._formatter}static createProperties(e){var t=new a("linetoolposition",e,!1,!1);return d._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e)}}t.LineToolPosition=d}).call(this,i("Kxc7"))},zqZp:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,n=i("j3hX").LineToolColorsProperty;class o extends s{constructor(e,t){super(e,t||o.createProperties()),i.e("lt-pane-views").then(i.t.bind(null,"Ni7V",7)).then(({PriceLabelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}pointsCount(){return 1}name(){return"Price Label"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"hQgR"))).PriceLabelDefinitionsViewModel}static createProperties(e){var t=new r("linetoolpricelabel",e);return o._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e),e.addChild("linesColors",new n([e.childs().borderColor])),e.addChild("textsColors",new n([e.childs().color]))}}t.LineToolPriceLabel=o}},[["/G2Z","runtime","vendors"]]]); |