(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[19526],{749028:(e,t,s)=>{"use strict";s.d(t,{isSignedExchangeAgreement:()=>l,saveExchangeAgreement:()=>o});var i=s(120780),r=s(526698);function o(e){return(0,i.fetch)("/exchange-agreement/",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(e)}).then((e=>e.ok?e.json():e.json().then((t=>{throw new r.AggregateError((0,r.accumulateErrors)(t.errors,e.status))}))))}const a={};async function l(e){let t="/is-signed-exchange-agreement/";if(e.exchange&&(t+=`?exchange=${e.exchange}`,a[e.exchange]))return a[e.exchange];const s=await(0,i.fetch)(t);if(!s.ok){const e=await s.json();throw Error(e.detail)}const r=await s.json();return e.exchange&&(a[e.exchange]=r),r}},875049:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var i=s(345848);const r={filterNamesMap:{script_type:"Indicators and Strategies","script_type-indicators":"Indicators","script_type-strategies":"Strategies",stream:"All Markets","stream-stocks":"Stocks","stream-indices":"Indices","stream-commodities":"Commodities","stream-currencies":"Currencies","stream-bitcoin":"Bitcoin","interval-all":"All Intervals","interval-m":"Short Term","interval-h":"Medium Term","interval-dwm":"Long Term","sort-unmoderated":"Unmoderated","sort-trending":"Trending","sort-discussed":"Most Discussed","sort-viewed":"Most Viewed","sort-agreed":"Most Agreed","sort-suggested":"Suggested","sort-recent":"All Ideas","time-day":"Today","time-week":"This Week","time-month":"This Month","time-all":"All Time","by-everyone":"Everyone","by-following":"Following","by-me":"My Ideas"},goProFeaturesMap:{customIntervals:"Add Custom Interval",intradaySpread:"Inraday Spread",kagiRenko:"Japanese Intraday Chart",alerts:{prefix:"New Alerts Limit",widget:"Widget",chart:"Chart Header"},multipleCharts:"Multiple Charts Layout",savedChartsLimit:"Save Chart Limit",studyLimit:"Studies Limit",multipleWatchLists:{prefix:"Watchlists",new:"Create New List",rename:"Rename List",saveAs:"Save List As"},importWatchlist:"Watchlists Import Watchlist",exportWatchlist:"Watchlists Export Watchlist",BATSExchangePopup:"BATS Exchange Popup",DataQualityPopup:"Data Quality Popup",FreeDelayPopup:"Free Delay Popup",proRTProduct:"Volume Profile",studyOnStudy:"Unlimited Study on Study"},trackFeature:{savedChartsLimit:!0,BATSExchangePopup:!0,FreeDelayPopup:!0,DataQualityPopup:!0,intradaySpread:!0,studyOnStudy:!0},trackGoPro:function(e,t,s){s&&!t&&(t=s,s=null);var o=r.goProFeaturesMap[t];if(o){if(s){if("string"==typeof o)return;o="{0} {1}".format(o.prefix,o[s])}(0,i.trackEvent)(e,o)}}},o=r},405117:(e,t,s)=>{"use strict";s.d(t,{trackGoProFeature:()=>r});var i=s(875049);function r(e,t){i.default.trackGoPro("Gopro Features",e,t)}},766269:(e,t,s)=>{"use strict";s.d(t,{FuturesCotractExpirationTime:()=>l});var i=s(988124),r=s(401580),o=s(44031),a=s(444331);class l{constructor(e,t){this._utcTime=new r.WatchedValue(null),this._expired=new r.WatchedValue(!1),this._sessionSpec=new r.WatchedValue(null),this._sessionSpecCache=null,this._utcDayStart=new Date(0), this._timeoutId=null,this._expiredBySymbolInfoTypespecs=!1,this._expiredByQuotesTypespecs=null,this._marketStatusSpawn=e.spawn(),this._quotesUpdate=t,this._quotesUpdate.subscribe(this,this._onQuotesUpdate)}destroy(){this._marketStatusSpawn.destroy(),this._clearTimeoutIfNeeded(),this._quotesUpdate.unsubscribeAll(this)}reset(){this._expiredBySymbolInfoTypespecs=!1,this._expiredByQuotesTypespecs=null,this._utcTime.setValue(null),this._expired.setValue(!1)}utcTime(){return this._utcTime.readonly()}expired(){return this._expired.readonly()}utcDayStart(){return this._utcDayStart}sessionSpec(){return this._sessionSpec.readonly()}setSymbolInfo(e){var t;if(this._clearTimeoutIfNeeded(),null===e||!(0,a.isFuturesContractSymbol)(e)||void 0===e.expiration)return this._utcTime.setValue(null),void this._expired.setValue(!1);null!==this._sessionSpecCache&&this._sessionSpecCache.timezone===e.timezone&&this._sessionSpecCache.session===e.session&&this._sessionSpecCache.corrections===e.corrections&&this._sessionSpecCache.holidays===e.session_holidays||(this._sessionSpecCache={timezone:e.timezone,session:e.session,corrections:e.corrections,holidays:e.session_holidays,spec:new o.SessionSpec(e.timezone,e.session,e.session_holidays,e.corrections)},this._sessionSpec.setValue(null));const s=this._sessionSpecCache.spec;this._utcDayStart=function(e){const t=Math.floor(e/1e4)%1e4,s=Math.floor(e/100)%100-1,i=e%100;return new Date(Date.UTC(t,s,i))}(e.expiration);const r=s.bordersOfDailyBar(this._utcDayStart);if(null===r)return this._utcTime.setValue(null),this._expired.setValue(!1),void this._sessionSpec.setValue(s);const l=(0,i.get_timezone)(e.timezone);this._utcTime.setValue((0,i.cal_to_utc)(l,r.to)+1e3),this._sessionSpec.setValue(s),this._expiredBySymbolInfoTypespecs=Boolean(null===(t=e.typespecs)||void 0===t?void 0:t.includes("expired")),this._updateExpired()}_updateExpired(){this._clearTimeoutIfNeeded();const e=this._utcTime.value();if(null===e)return;if(this._expiredByQuotesTypespecs||this._expiredBySymbolInfoTypespecs)return void this._expired.setValue(!0);const t=window.ChartApiInstance.serverTime();let s;switch(this._marketStatusSpawn.value()){case"out_of_session":case"holiday":s=e-3e5-t;break;case"market":case"pre_market":case"post_market":s=e+3e5-t;break;default:s=e-t}s>0&&(this._timeoutId=setTimeout((()=>this._updateExpired()),Math.min(2e9,s))),this._expired.setValue(s<=0)}_clearTimeoutIfNeeded(){null!==this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null)}_onQuotesUpdate(e,t){var s,i;let r=!1;if(null===this._expiredByQuotesTypespecs)this._expiredByQuotesTypespecs=Boolean(null===(s=e.values.typespecs)||void 0===s?void 0:s.includes("expired")),r=this._expiredByQuotesTypespecs;else if(void 0!==t.values.typespecs){const e=Boolean(null===(i=t.values.typespecs)||void 0===i?void 0:i.includes("expired"));r=this._expiredByQuotesTypespecs!==e,this._expiredByQuotesTypespecs=e}r&&null!==this._utcTime.value()&&this._updateExpired()}}},188177:(e,t,s)=>{"use strict";s.d(t,{MarketStatusModel:()=>c}) ;var i=s(650151),r=s(401580),o=s(66732),a=s(444331),l=s(44031),n=s(766269),h=s(988124);function d(e){return window.ChartApiInstance.serverTime()/1e3-e}function u(e,t,s){return e<=s?t<=s?1/0:t/1e3:Math.min(e,t)/1e3}class c{constructor(e){var t,s;this._currentSession=new r.WatchedValue(null),this._delistedByTypespecs=new r.WatchedValue(!1),this._sessionsSpec=null,this._nextSessionEdgeInternal=null,this._nextSessionEdge=new r.WatchedValue(null),this._recalcNextSessionEdgeTimerId=null,this._delay=0,this._futuresContractExpirationTime=null,this._quotesProvider=e,this._futuresContractExpirationTime=new n.FuturesCotractExpirationTime(this._currentSession.readonly(),e.quotesUpdate()),e.quoteSymbolChanged().subscribe(this,(()=>{(0,i.ensureNotNull)(this._futuresContractExpirationTime).reset(),this._nextSessionEdgeInternal=null,this._recalculateNextSessionEdge()})),this._marketStatus=(0,o.combine)(((e,t,s)=>null===e?e:t?"delisted":s?"expired":function(e){switch(e){case"market":return"market";case"pre_market":return"pre_market";case"post_market":return"post_market";case"out_of_session":return"out_of_session";case"holiday":return"holiday"}(0,i.ensureNever)(e)}(e)),this._currentSession.weakReference(),this._delistedByTypespecs.weakReference(),(null!==(s=null===(t=this._futuresContractExpirationTime)||void 0===t?void 0:t.expired())&&void 0!==s?s:new r.WatchedValue(!1)).weakReference()),e.quotesUpdate().subscribe(this,(e=>{var t;this._currentSession.setValue(null!==(t=null==e?void 0:e.values.current_session)&&void 0!==t?t:null)})),e.quoteSymbolChanged().subscribe(this,(()=>{this._currentSession.setValue(null)}))}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.quoteSymbolChanged().unsubscribeAll(this),null!==this._recalcNextSessionEdgeTimerId&&clearTimeout(this._recalcNextSessionEdgeTimerId),(0,i.ensureNotNull)(this._futuresContractExpirationTime).destroy(),this._marketStatus.destroy()}futuresContractExpirationTime(){return this._futuresContractExpirationTime}setSymbolInfo(e){var t,s,r,o,n,h;if((0,i.ensureNotNull)(this._futuresContractExpirationTime).setSymbolInfo(e),this._nextSessionEdgeInternal=null,null===e)return void(this._sessionsSpec=null);this._delay=(0,a.getSymbolDelaySeconds)(e);const d=new l.SessionSpec(e.timezone,null!==(t=e.session_display)&&void 0!==t?t:e.session,e.session_holidays,e.corrections);let u,c;const p=null===(s=e.subsessions)||void 0===s?void 0:s.find((e=>"premarket"===e.id)),_=null===(r=e.subsessions)||void 0===r?void 0:r.find((e=>"postmarket"===e.id));void 0!==p&&(u=new l.SessionSpec(e.timezone,null!==(o=p["session-display"])&&void 0!==o?o:p.session,e.session_holidays,p["session-correction"])),void 0!==_&&(c=new l.SessionSpec(e.timezone,null!==(n=_["session-display"])&&void 0!==n?n:_.session,e.session_holidays,_["session-correction"])),this._delistedByTypespecs.setValue(Boolean(null===(h=e.typespecs)||void 0===h?void 0:h.includes("discontinued"))),this._sessionsSpec={general:d,preMarket:u,postMarket:c},this._recalculateNextSessionEdge()}status(){ return this._marketStatus}currentSession(){return this._currentSession}nextSessionEdge(){return this._nextSessionEdge}_getNextSessionEdgeInternal(){var e;if(null===this._sessionsSpec||"24x7"===this._sessionsSpec.general.spec())return null;const t=1e3*d(this._delay);if(null===this._nextSessionEdgeInternal||(null!==(e=this._nextSessionEdgeInternal.timestamp)&&void 0!==e?e:1/0)<=t/1e3){const{general:e,preMarket:s,postMarket:i}=this._sessionsSpec,r=(0,h.get_timezone)(e.timezone()),o=(0,h.utc_to_cal)(r,t),a=u((0,h.cal_to_utc)(r,e.alignToNearestSessionStart(o,1)),(0,h.cal_to_utc)(r,e.alignToNearestSessionEnd(o,1)),t),l=u(void 0!==s?(0,h.cal_to_utc)(r,s.alignToNearestSessionStart(o,1)):1/0,void 0!==s?(0,h.cal_to_utc)(r,s.alignToNearestSessionEnd(o,1)):1/0,t),n=u(void 0!==i?(0,h.cal_to_utc)(r,i.alignToNearestSessionStart(o,1)):1/0,void 0!==i?(0,h.cal_to_utc)(r,i.alignToNearestSessionEnd(o,1)):1/0,t);let c=Math.min(a,l,n);if(c===1/0){const t=d(this._delay),s=6e4,i=new Date(Math.round(new Date(1e3*t).getTime()/s)*s).getTime()+s,o=(0,h.utc_to_cal)(r,i),a=u((0,h.cal_to_utc)(r,e.alignToNearestSessionStart(o,1)),(0,h.cal_to_utc)(r,e.alignToNearestSessionEnd(o,1)),i),p=Math.min(a,l,n);p!==1/0?(this._nextSessionEdgeInternal={timestamp:c},c=p):this._nextSessionEdgeInternal={timestamp:null}}this._nextSessionEdgeInternal=c===n?{timestamp:c,status:"post_market"}:c===l?{timestamp:c,status:"pre_market"}:{timestamp:c}}return this._nextSessionEdgeInternal}_recalculateNextSessionEdge(){const e=this._getNextSessionEdgeInternal();if(null===e||null===e.timestamp)return void this._nextSessionEdge.setValue(null);const t={status:e.status,remainingSeconds:Math.max(0,e.timestamp-d(this._delay))};if(null===this._recalcNextSessionEdgeTimerId){const e=Number.isFinite(t.remainingSeconds)?Math.ceil(t.remainingSeconds%60):1;this._recalcNextSessionEdgeTimerId=setTimeout((()=>this._recalculateNextSessionEdgeByTimer()),1e3*e)}this._nextSessionEdge.setValue(t)}_recalculateNextSessionEdgeByTimer(){this._recalcNextSessionEdgeTimerId=null,this._recalculateNextSessionEdge()}}},147675:(e,t,s)=>{"use strict";s.d(t,{CRUCIAL_REALTIME_BATS:()=>u,DELAY_WITHOUT_AGREEMENT:()=>c,firstReplacedByBatsExchange:()=>p,getExchange:()=>b,isDelay:()=>m,isDelayForGuest:()=>g,isDelayWithoutMarketAgreement:()=>S,isEod:()=>_,isTickByTick:()=>y,witoutRealtime:()=>v});var i=s(650151),r=s(59171),o=s.n(r),a=s(778016),l=s(519073);const n=["DJ","JSE","BELEX"],h=["NZX"],d=["BIVA"],u=["AMEX","NASDAQ","NYSE"],c=["ICESG","TURQUOISE","TAIFEX","FINRA","FINRA_ATDS_BONDS","FINRA_BTDS_BONDS"];function p(e){const t=o().getExchanges(e.pro_name),s=o().getExchanges(e.full_name);for(let e=0;e0}function v(e){return"index"===e.type&&n.includes(e.listed_exchange)||"futures"===e.type&&h.includes(e.listed_exchange)||d.includes(e.listed_exchange)}function y(e,t){return!((0,a.enabled)("TICK_BY_TICK_PUSH_DATA")||m(e.delay)||_(e,t)||(0, l.hasCryptoTypespec)(e.typespecs||[]))}function g(e,t){return t.listed_exchange===e&&!window.is_authenticated}function S(e){return c.includes(e.listed_exchange)}async function b(e){{const t=(0,i.ensureDefined)(window.pro);await new Promise((e=>{t.runOrUpdate(e)}));const s=t.getProduct(function(e){return`exchange-${e.pro_perm}`}(e)),r=function(e){let t;if(!window.pro)throw new Error("Pro module not defined");t=window.pro.getProductsByType(window.pro.PRODUCT_TYPES.exchange).find((t=>{var s;return Boolean(null===(s=t.included_exchanges)||void 0===s?void 0:s.includes(e))}));return t||null}(s.exchange||"");return r&&["cme-full","us-stocks","finra"].includes(r.exchange)?s:r||s}}},736029:(e,t,s)=>{"use strict";s.d(t,{extrapolateBarsFrontByCount:()=>o,extrapolateBarsFrontToTime:()=>r});var i=s(987571);function r(e,t,s,i,o=!1){if(t>s){const a=r(e,s,t,i,o);return a.count=-a.count,a}return a(e,t,1,((e,t)=>t>s||0!==i&&e>i),o)}function o(e,t,s,i=!1){const r=s<0?-1:1;return a(e,t,r,((e,t)=>e>=s*r),i)}function a(e,t,s,r,o){let a=0,l=t;e.moveTo(l);let n=0,h=Number.MAX_VALUE,d=!1,u=t;const c=[];for(;!r(a,l);){if(n>15)throw new Error("Internal error 0x10 while extrapolating.");const r=e.indexOfBar(l);if(r===i.SessionStage.PRE_SESSION&&1===s)l=e.startOfBar(0),e.moveTo(l);else if(r===i.SessionStage.PRE_SESSION&&-1===s)l=e.startOfBar(i.SessionStage.PRE_SESSION),e.moveTo(l);else if(r===i.SessionStage.POST_SESSION&&1===s)l=e.startOfBar(i.SessionStage.POST_SESSION),e.moveTo(l);else{if(r===i.SessionStage.POST_SESSION&&-1===s)throw new Error("Internal error 0x12 while extrapolating.");{const p=e.startOfBar(r);if(p>t&&s>0||t>p&&s<0){if(d&&h===p)throw new Error("Internal error 0x11 while extrapolating.");d=!0,h=p,n=0,a++,u=p,o&&c.push(u)}if(0===r&&-1===s)l=p-1;else{l=e.startOfBar(r+s);const t=e.startOfBar(i.SessionStage.POST_SESSION);l>t&&(e.moveTo(t),l=e.startOfBar(0))}}}n++}return{time:u,times:c,count:a}}},432078:(e,t,s)=>{"use strict";s.d(t,{ComputedTimePointWeights:()=>a});var i=s(674981);function r(e,t){for(let s=0;s=.5?Math.ceil(e):Math.floor(e),s=e-t;if(t>=this._invalidatedFromIndex){const e=this._invalidatedFromIndex;let s=this._items[e-1];const i=Math.min(this._maxIndexWithWeight,t);this._createItems(i);for(let t=e;t<=i;++t)s=this._fillItem(t,s);this._invalidatedFromIndex=i+1}if(t>this._maxIndexWithWeight){return this._items[this._maxIndexWithWeight].barEndTotal+(t-this._maxIndexWithWeight-.5)+s}const i=this._items[t] ;return i.barCenterTotal+i.weight*s}rangeWeight(e,t){const s=[];if(null===this._maxIndexWithWeight)return[{index:e,barStartTotal:e-.5,barCenterTotal:e,barEndTotal:e+.5,weight:1}];if(e=this._invalidatedFromIndex){const i=this._invalidatedFromIndex;let r=this._items[i-1];const o=Math.min(this._maxIndexWithWeight,t);this._createItems(o);for(let t=i;t<=o;++t)r=this._fillItem(t,r),t>=e&&s.push(r);this._invalidatedFromIndex=o+1}return 0===s.length&&s.push(this._items[this._maxIndexWithWeight]),s}index(e){if(null===this._maxIndexWithWeight)return e;if(0!==this._invalidatedFromIndex&&this._items[this._invalidatedFromIndex-1].barEndTotal-.001>=e){const t=(0,i.lowerbound)(this._items,e,((e,t)=>e.barEndTotal-.001e)return this._invalidatedFromIndex=i+1,i+(e-s.barCenterTotal)/s.weight;this._invalidatedFromIndex=this._maxIndexWithWeight+1}const t=this._items[this._maxIndexWithWeight];return this._maxIndexWithWeight+.5+e-t.barEndTotal}state(e){return{maxIndexWithWeight:this._maxIndexWithWeight,items:this._items.slice(),weightsMap:Array.from(this._weightsMap.entries())}}restoreState(e){this._maxIndexWithWeight=e.maxIndexWithWeight,this._items=e.items.slice(),this._weightsMap=new Map(e.weightsMap)}_createItems(e){const t=e-(this._items.length-1);if(t>0){const e=this._items.length;this._items=this._items.concat(Array.from({length:t},((t,s)=>({barStartTotal:1,barCenterTotal:1,barEndTotal:1,weight:1,index:s+e}))))}}_fillItem(e,t){var s;const i=this._items[e],r=null!==(s=this._weightsMap.get(e))&&void 0!==s?s:1;return i.weight=r,i.barCenterTotal=void 0===t?0:t.barEndTotal+r/2,i.barStartTotal=i.barCenterTotal-r/2,i.barEndTotal=i.barCenterTotal+r/2,i}}class a{constructor(){this._baseIndex=0,this._preBaseIndexWeights=new o,this._postBaseIndexWeights=new o,this._weightsMap=new Map}setBaseIndex(e){this._baseIndex=e,this._preBaseIndexWeights=new o,this._postBaseIndexWeights=new o;for(const[e,t]of this._weightsMap)this.setWeight(e,t)}indexToTotalWeight(e){const t=e-this._baseIndex;return t<0?-this._preBaseIndexWeights.totalWeight(-t):this._postBaseIndexWeights.totalWeight(t)}totalWeightToIndex(e){return e<0?this._baseIndex-this._preBaseIndexWeights.index(-e):this._baseIndex+this._postBaseIndexWeights.index(e)}clear(){this._preBaseIndexWeights=new o,this._postBaseIndexWeights=new o,this._weightsMap.clear()}setWeight(e,t){const s=e-this._baseIndex;s<=0&&this._preBaseIndexWeights.setWeight(-s,t),s>=0&&this._postBaseIndexWeights.setWeight(s,t),this._weightsMap.set(e,t)}indexRangeToWeights(e,t,s){const i=e-this._baseIndex,o=t-this._baseIndex;let a=0;if(s=null!=s?s:[],i<0){ const e=this._preBaseIndexWeights.rangeWeight(Math.max(1,-o),-i),t=e.length-s.length;t>0&&r(s,t);for(let t=e.length-1;t>=0;t-=1){const i=e[t],r=s[a];r.center=-i.barCenterTotal,r.left=-i.barEndTotal,r.right=-i.barStartTotal,r.timePointIndex=this._baseIndex-i.index,a+=1}}if(o>=0){const e=this._postBaseIndexWeights.rangeWeight(Math.max(0,i),o),t=e.length+a-s.length;t>0&&r(s,t);for(const t of e){const e=s[a];e.center=t.barCenterTotal,e.left=t.barStartTotal,e.right=t.barEndTotal,e.timePointIndex=this._baseIndex+t.index,a+=1}}return s.slice(0,a)}moveData(e){const t=new Map;for(const s of e){const e=this._weightsMap.get(s.old);if(void 0!==e){t.set(s.new,e),this._weightsMap.delete(s.old);const i=s.old-this._baseIndex;i<=0&&this._preBaseIndexWeights.deleteItemByIndex(-i),i>=0&&this._postBaseIndexWeights.deleteItemByIndex(i)}}for(const[e,s]of t)this.setWeight(e,s)}state(e){return{type:"computed",state:{baseIndex:this._baseIndex,preBaseIndexWeights:this._preBaseIndexWeights.state(e),postBaseIndexWeights:this._postBaseIndexWeights.state(e),weightsMap:Array.from(this._weightsMap.entries())}}}restoreState(e){this._baseIndex=e.state.baseIndex,this._weightsMap=new Map(e.state.weightsMap),this._preBaseIndexWeights.restoreState(e.state.preBaseIndexWeights),this._postBaseIndexWeights.restoreState(e.state.postBaseIndexWeights)}needAdjustingOnDataRestoring(){return!0}}},746118:(e,t,s)=>{"use strict";s.d(t,{SeriesBase:()=>li});var i,r=s(316230),o=s(650151),a=s(638456),l=s(345848),n=s(251954),h=s(201089),d=s(268222),u=s(974655),c=s(507795),p=s(544421),_=s(195447),m=s(534741),v=s(291784),y=s(354950),g=s(444331);!function(e){e.Regular="regular",e.Extended="extended",e.PreMarket="premarket",e.PostMarket="postmarket"}(i||(i={}));var S=s(624444),b=s(339315),f=s(833642),w=s(444372),P=s(244842),C=s(665570),x=s(985715),I=s(29469),V=s(628544);const T=w.t(null,void 0,s(389659)),B=w.t(null,void 0,s(590522)),D=P.enabled("hide_unresolved_symbols_in_legend");class R extends x.StatusProviderBase{constructor(e,t,s){super(),this._series=e,this._statusViewProperties=t,this._options=s||{}}text(){return(0,I.generateTitleForGui)(this._getTitleGenerationOptions())}getSplitTitle(){return(0,I.generateSplitTitleForGui)(this._getTitleGenerationOptions())}bold(){return!1}size(){return this._statusViewProperties.childs().fontSize.value()+"px"}errorStatus(){const e=this._series.unsupportedResolutionState().value(),t=e?(0,V.getErrorFromUnsupportedResolutionState)(e):this._series.seriesErrorMessage();return null!==t?{error:t,title:e?B:T}:null}_getTitleGenerationOptions(){const e=this._series.symbolInfo(),t=this._statusViewProperties.childs(),s=this._series.symbolTextSourceProxyProperty().value();let i;t.showExchange.value()&&e&&(i=(0,g.getSymbolExchange)(e));const r=null!==null?null:void 0,o=this._series.getInputsProperties().state();return 17===this._series.style()&&(o.type=this._series.properties().childs().volFootprintStyle.childs().type.value()),{description:M(s,e),exchange:i,symbol:D&&null===e?"":this._series.symbol(), interval:t.showInterval.value()&&!this._options.hideResolution?this._series.interval():void 0,style:this._series.properties().childs().style.value(),inputs:o,boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,ticker:A(s,e),priceSource:r}}}function A(e,t){return"ticker-and-description"!==e?"":null!==t?t.name:void 0}function M(e,t){if(null!==t)return"ticker"===e?t.name:"long-description"===e&&void 0!==t.long_description?t.long_description:(0,C.getTranslatedSymbolDescription)({pro_name:t.pro_name||void 0,short_name:t.name||void 0,description:t.description||void 0,short_description:t.short_description||void 0,local_description:t.local_description||void 0,language:t.language||void 0})}class k extends f.StatusView{constructor(e,t,s){super(new R(e,t,s)),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)),t.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(),s=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return s?s.toString():""}update(){this._invalidated=!0}text(){return this._updateImpl(),super.text()}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)}}var E=s(150335),N=s(782086),L=s(168883),F=s(885482),W=s(616117);const O=a.CheckMobile.any(),U=P.enabled("hide_resolution_in_legend");class j extends N.DataWindowView{constructor(e,t){super(),this._invalidated=!0,this._series=e,this._model=t,this.update()}update(){this._invalidated=!0}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}series(){return this._series}_updateImpl(){var e,t;const s=this._getValuesProvider();this._valuesProvider!==s&&(this._valuesProvider=s,this._items=this._valuesProvider.getItems().map((e=>new N.DataWindowItem(e.id,e.title,"",e.unimportant))));const i=this._series.symbolInfo();if(i){const e=[i.name];if(U||e.push((0,L.translatedIntervalString)(this._series.interval())),(0,g.isEconomicSymbol)(i)){const t=(0,g.getSourceForEconomySymbol)(i);null!==t&&e.push(t)}else e.push((0,a.onWidget)()||"forex"===i.type?i.exchange:i.listed_exchange);this._header=e.join(` ${g.symbolTitleSeparator} `),this._title=i.description}else this._header=this._series.symbol();let r=this._model.crossHairSource().appliedIndex();P.enabled("use_last_visible_bar_value_in_legend")&&!(0, E.isNumber)(r)&&(r=null!==(t=null===(e=this._model.timeScale().visibleBarsStrictRange())||void 0===e?void 0:e.lastBar())&&void 0!==t?t:NaN);const o=this._valuesProvider.getValues(r);for(let e=0;ee||t||s||i),s.showBarChange.weakReference(),s.showSeriesOHLC.weakReference(),s.showVolume.weakReference(),s.showLastDayChange.weakReference()),this._visibilityProperty.subscribe(this,this.update)}areValuesVisible(){return this._visibilityProperty.value()}additional(){const e=this._series.dataPoweredBy();return null!==e&&e.length>0?w.t(null,void 0,s(493345))+" "+e:null}marketTitle(){const e=this._series.marketStatusModel().status().value();return this._showLastPriceAndChangeOnly()&&("pre_market"===e||"post_market"===e)?`${H}:`:""}destroy(){this._backgroundColorSpawn.destroy(),this._visibilityProperty.destroy()}_getValuesProvider(){return this._series.legendValuesProvider()}}var G=s(188177),$=s(261066),X=s(223699),Q=s(547944),Y=s(736029),Z=s(541558);let K=0;class J{constructor(e,t){this._extrapolatedData=[],this._cacheForFuture=!1,this._modelId=K++,this._builderCache=null,this._uniqueId=(0,Z.randomHashN)(6),this._resolution=t,this._symbolInfo=e,this._valid=Boolean(e.timezone)&&Boolean(e.session),this._session=new Q.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections)}syncSourceTarget(){return{uniqueId:this._uniqueId,resolution:this._resolution,symbolInfo:this._symbolInfo,session:this._session.state()}}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 s=this._extrapolatedData.length,i=0!==s?this._extrapolatedData[0]:null,r=null!==i?this._extrapolatedData[s-1]:null;const o=er){const i=(0,Y.extrapolateBarsFrontToTime)(this.barBuilder(),r||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(i.times),s=this._extrapolatedData.length,this._cacheForFuture=o}if(r=this._extrapolatedData[s-1],r<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 s=this._extrapolatedData.length,i=s>0?this._extrapolatedData[0]:null,r=null!==i?this._extrapolatedData[s-1]:null;const o=t>=0;1e3*e===i&&this._cacheForFuture===o||(this._extrapolatedData=[1e3*e],s=1,i=null,r=null);const a=Math.abs(t);if(null===i||a>=s){const i=(0,Y.extrapolateBarsFrontByCount)(this.barBuilder(),r||1e3*e,Math.sign(t)*(a-s+1),!0);this._extrapolatedData=this._extrapolatedData.concat(i.times),s=this._extrapolatedData.length,this._cacheForFuture=o}return se.exchange.toUpperCase()));if(!(null==t?void 0:t.includes(e.listed_exchange.toUpperCase()))&&!(null==t?void 0:t.includes(e.pro_perm.toUpperCase())))return!1}return async function(e){try{return(await(0,ie.isSignedExchangeAgreement)({exchange:e.pro_perm})).response}catch(e){return!1}}(e)}var oe=s(59171),ae=s.n(oe);var le=s(928691);const ne=(0,h.getLogger)("Chart.Definitions.Series");function he(e,t){return"TickByTick"===e?{mode:e,updatePeriod:t}:{mode:e}}async function de(e,t,s){const i=[];return(0,te.isDelay)(e.delay)?async function(e){const t=[];return(0,te.witoutRealtime)(e)?t.push(he("DelayNoRealtime")):(0,te.isDelayForGuest)("MOEX",e)?t.push(he("MOEXDelayForGuest")):(0,te.isDelayForGuest)("TFEX",e)?t.push(he("TFEXDelayForGuest")):(0,te.isDelayForGuest)("CHIXAU",e)?t.push(he("CHIXAuDelayForGuest")):(0,te.isDelayForGuest)("NGM",e)?t.push(he("NGMDelayForGuest")):(0,te.isDelayForGuest)("ICESG",e)?t.push(he("ICESGDelayForGuest")):(0,te.isDelayForGuest)("TAIFEX",e)?t.push(he("TAIFEXDelayForGuest")):(0,te.isDelayForGuest)("TURQUOISE",e)?t.push(he("TURQUOISEDelayForGuest")):(0,te.isDelayForGuest)("ADX",e)?t.push(he("ADXDelayForGuest")):(0,te.isDelayForGuest)("LUXSE",e)?t.push(he("LUXSEDelayForGuest")):(0,te.isDelayForGuest)("NSENG",e)?t.push(he("NSENGDelayForGuest")):(0,te.isDelayForGuest)("FINRA",e)?t.push(he("FINRADelayForGuest")):(0,te.isDelayForGuest)("TRADEGATE",e)?t.push(he("TRADEGATEDelayForGuest")):["BER","DUS","HAM","HAN","MUN"].some((t=>(0,te.isDelayForGuest)(t,e)))?t.push(he("DEForGuest")):["MIL"].some((t=>(0,te.isDelayForGuest)(t,e)))?t.push(he("MILDelayForGuest")):await re(e)?t.push(he("DelayToRealtime")):(0,te.isDelayWithoutMarketAgreement)(e)?t.push(he("DelayWithoutMarketAgreement")):t.push(he("DelayToRealtime")),t}(e):(0,te.isEod)(e,t)?(i.push(he("EOD")),i):((0,te.isTickByTick)(e,t)&&0!==s&&i.push(he("TickByTick",s)),function(e){return ae().hasBatsSymbols(e.full_name)}(e)&&i.push(he("BATSToRealtime")),i)} class ue{constructor(e,t,s){this._dataUpdatedInfoStatus=new ee.WatchedObject(null),this._symbolInfo=e,this._status=t,this._updatePeriod=s,this._symbolInfo.subscribe(this._update.bind(this)),this._status.subscribe(this._update.bind(this)),this._updatePeriod.subscribe(this._update.bind(this))}destroy(){this._symbolInfo.release(),this._status.release(),this._updatePeriod.release()}status(){return this._dataUpdatedInfoStatus.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=(0,o.ensureNotNull)(await(0,te.getExchange)(e))}catch(e){ne.logWarn(`Cannot get exchange ${(0,le.errorToString)(e)}`)}return t.description||e.listed_exchange}exchange(){const e=this._symbolInfo.value();return null!==e?e.exchange:""}proName(){const e=this._symbolInfo.value();return null!==e?e.pro_name:""}country(){var e;return(null===(e=this._symbolInfo.value())||void 0===e?void 0:e.country)||""}proPerm(){const e=this._symbolInfo.value();return null!==e?e.pro_perm:""}firstReplacedByBatsExchange(){const e=this._symbolInfo.value();return e&&(0,te.firstReplacedByBatsExchange)(e)}isSpread(){const e=this._symbolInfo.value();return null!==e&&"spread"===e.type}async _update(){const e=this._symbolInfo.value();if(null===e)return void this._dataUpdatedInfoStatus.setValue(null);const t=this._status.value();if("string"==typeof t)return void this._dataUpdatedInfoStatus.setValue(null);if(2===t||1===t)return;const s=await de(e,t,this._updatePeriod.value());0!==s.length?this._dataUpdatedInfoStatus.setValue(s):this._dataUpdatedInfoStatus.setValue(null)}}var ce=s(120780),pe=s(466931),_e=s(389137),me=s(405069);const ve=(0,h.getLogger)("Chart.DataProblemModel");class ye{constructor(e,t){this._mainDataProblem=new ee.WatchedObject(null),this._supportPortalProblems=new ee.WatchedObject([]),this._allDataProblems=new ee.WatchedObject([]),this._pushStreamHandler=null,this._destroyed=!1,this._quotesProvider=e,this._quotesProvider.quotesUpdate().subscribe(this,this._update.bind(this)),this._symbolInfo=t,this._symbolInfo.subscribe((e=>{e||this._mainDataProblem.setValue(null)})),this._mainDataProblem.subscribe((()=>this._updateAllDataProblems())),this._supportPortalProblems.subscribe((()=>this._updateAllDataProblems())),this._requestSupportPortalProblems()}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._symbolInfo.release(),null!==this._pushStreamHandler&&me.pushStreamMultiplexer.off("support-portal-problem",this._pushStreamHandler),this._destroyed=!0}dataProblems(){return this._allDataProblems}_resetStatus(){this._mainDataProblem.setValue(null)}_update(e){void 0===e.values||void 0===e.values.data_problem?this._resetStatus():this._mainDataProblem.setValue((0,_e.clone)(e.values.data_problem))}_updateAllDataProblems(){ const e=this._mainDataProblem.value(),t=this._supportPortalProblems.value();this._allDataProblems.setValue(null===e?t:[e,...t])}async _requestSupportPortalProblems(){{const e=await(0,ce.fetch)(`${pe.supportPortalProblemsHost}/support/support-portal-problems/?language=${window.locale}`);if(this._destroyed)return;if(!e.ok)return void ve.logWarn("Couldn't load support portal problems");const t=(await e.json()).issues,s=()=>{const e=t.filter((e=>e.show_on_chart&&!1!==e.is_active&&(void 0===e.language||e.language.some((e=>e===window.locale||"all"===e))))).map((e=>({severity:"low",title:e.title,text:e.description})));this._supportPortalProblems.setValue(e)};s(),this._pushStreamHandler=e=>{switch(e.action){case"created":t.push(e.data);break;case"modified":{const s=t.findIndex((t=>t.id===e.data.id));-1!==s?t[s]={...t[s],...e.data}:t.push(e.data);break}case"deleted":{const s=t.findIndex((t=>t.id===e.data.id));-1!==s&&t.splice(s,1);break}}s()},me.pushStreamMultiplexer.on("support-portal-problem",this._pushStreamHandler)}}}var ge=s(356747),Se=s(246733),be=s(229765),fe=s(909598),we=s(988124);function Pe(e){return e<10?`0${e}`:e.toString()}function Ce(e,t=Date.now()/1e3){let s=Math.ceil(e-t);if(s<=0)return"";if(s<3600){const e=Math.floor(s/60),t=Math.ceil(s%60);return`${Pe(e)}:${Pe(t)}`}if(s<86400){const e=Math.floor(s/3600);s%=3600;const t=Math.floor(s/60);s%=60;const i=Math.ceil(s);return`${Pe(e)}:${Pe(t)}:${Pe(i)}`}{const i=new Date(1e3*e),r=new Date(1e3*t),o=we.get_year(i),a=we.get_year(r),l=we.get_month(i),n=we.get_month(r),h=we.get_day_of_month(r),d=xe(i)-xe(r)>=0?0:-1;let u=12*(o-a)+(l-n)+d;if(u>0){const t=we.get_days_in_month(n,a);!function(e,t){const s=we.get_day_of_month(e);e.setUTCMonth(we.get_month(e)+t),we.get_day_of_month(e)!==s&&e.setUTCDate(0)}(r,u);const s=we.get_days_in_month(we.get_month(r),we.get_year(r)),i=h!==t&&s===we.get_day_of_month(r)?t-h:0;let o=Math.ceil((e-r.getTime()/1e3)/86400)+i;return o>=s&&(u++,o=0),`${u}M ${o}d`}if(-1===d){if(we.get_days_in_month(n,a)-s/86400<1/24)return"1M 0d"}let c=Math.floor(s/86400);s%=86400;let p=Math.ceil(s/3600);return 24===p&&(p=0,c+=1),c===we.get_days_in_month(l,o)?"1M 0d":`${c}d ${p}h`}}function xe(e){return 86400*e.getUTCDate()+3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()}var Ie=s(740086),Ve=s(964824);const Te=P.enabled("force_exchange_as_title"),Be=P.enabled("chart_style_hilo_last_price");const De={alwaysShowGlobalLast:!1,visibleOnHistoryOnly:!1,showCountdown:!0,showSymbolLabel:!0,useSolidBodyColor:!0};class Re extends be.PriceAxisView{constructor(e,t,s){super(),this._previousCountdown="",this._source=e,this._model=t,this._options={...De,...s}}updateCountdown(){this._countdownText()!==this._previousCountdown&&(this.update((0,Ve.sourceChangeEvent)(this._source.id())),this._model.updateSourcePriceScale(this._source))}_getSource(){return this._source}_getModel(){return this._model}_isCountdownEnabled(){return this._options.showCountdown}_countdownText(){{const e=this._source.barCloseTime();return null===e?"":Ce(e,this._currentTime()/1e3)}} _updateRendererData(e,t,s){var i;if(e.visible=!1,t.visible=!1,!this._source.isVisible())return;const r=this._source.properties().childs();if(!Be&&12===r.style.value())return;const a=this._model.timeScale().visibleBarsStrictRange(),l=this._source.data().last();if(null===a||null===l)return;if(this._options.visibleOnHistoryOnly&&a.contains(l.index))return;const n=this._model.properties().childs().scalesProperties.childs();let h=n.showSeriesLastValue.value(),d=this._isCountdownEnabled()&&r.showCountdown.value()&&(12===(u=r.style.value())?Be:(0,g.isTimeBasedStyle)(u))&&(this._options.alwaysShowGlobalLast||a.contains(l.index));var u;let c=this._options.showSymbolLabel&&n.showSymbolLabels.value();const p=n.seriesLastValueMode.value()===fe.PriceAxisLastValueMode.LastPriceAndPercentageValue,_=this._source.lastValueData(void 0,this._options.alwaysShowGlobalLast);if(_.noData)return;const m=8===r.style.value();if((h||d||c)&&m&&r.haStyle.childs().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||(h=!1,d=!1,c=!1)}const v=(0,Se.resetTransparency)(this._source.priceLineColor(_.color));if(this._options.useSolidBodyColor?(s.background=v,s.borderColor=void 0):(s.background=this._model.backgroundColorAtYPercentFromTop((null!==(i=s.fixedCoordinate)&&void 0!==i?i:s.coordinate)/(0,o.ensureNotNull)(this._model.paneForSource(this._source)).height()),s.borderColor=v),s.coordinate=_.coordinate,s.floatCoordinate=_.floatCoordinate,h||d){const t=this._axisFirstLineText(_,h);e.text=t,this._options.useSolidBodyColor?(s.textColor=this.generateTextColor(s.background),e.borderVisible=!1):(e.borderVisible=!0,s.textColor=v),e.textColor=s.textColor;const i=h&&p?(0,Ie.getOppositeModePriceText)(this._source.priceScale(),_):"";e.secondLine=i,s.secondLineTextColor=s.textColor;const r=d?this._countdownText():"";this._previousCountdown=r,e.thirdLine=r,s.thirdLineTextColor=(0,Se.generateColor)(s.textColor,25),0===t.length&&0===i.length&&0===r.length||(e.visible=!0)}c&&(t.text=this._paneText(c),t.visible=t.text.length>0)}_paneText(e){let t="";const s=this._source.symbolInfo();return Te?t=(0,g.displayedSymbolExchange)(s):e&&(t=(0,g.displayedSymbolName)(s)),t}_axisFirstLineText(e,t){return t?(0,Ie.getCurrentModePriceText)(this._source.priceScale(),e):""}_currentTime(){return window.ChartApiInstance.serverTime()}}var Ae=s(177126),Me=s(175203),ke=s(95452),Ee=s(855611),Ne=s(30574),Le=s(782856);function Fe(e){const[t]=function(e){const t=new Set;e.isSpread()&&t.add(Le.DataSourceDangerReason.Spread);const s=e.symbolInfo();return"CRYPTOCAP"===(null==s?void 0:s.exchange)&&t.add(Le.DataSourceDangerReason.CryptoCap),t}(e);return null!=t?t:null}var We=s(710455);const Oe={0:{background:"rgba(242, 54, 69, 0.15)",line:"#F23645"},1:{background:"rgba(255, 152, 0, 0.15)",line:"#FF9800"},2:{background:"rgba(8, 153, 129, 0.15)",line:"#089981"}};class Ue extends We.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(){ return null}_drawImpl(e){if(null===this._data)return;const t=Oe[this._data.predictionCode],s=e.context;s.fillStyle=t.background,s.fillRect(Math.max(0,this._data.startX),0,e.mediaSize.width,e.mediaSize.height),s.strokeStyle=t.line,s.beginPath(),s.lineWidth=1;const i=Math.round(this._data.startX);s.moveTo(i,0),s.lineTo(i,e.mediaSize.height),s.stroke()}}class je{constructor(e,t,s,i){this._renderer=new Ue,this._startX=0,this._series=t,this._timeScale=e,this._lastKnownBarIndex=s,this._direction=i}update(){this._startX=this._timeScale.indexToCoordinate(this._lastKnownBarIndex)+.5*this._timeScale.barSpacing()+1}renderer(){const e=(0,p.barFunction)("close"),t=this._series.data().bars(),s=e((0,o.ensureNotNull)(t.valueAt(this._lastKnownBarIndex))),i=e((0,o.ensureNotNull)(t.last()).value);let r=0;i>s?r=1:i{null==e||e.abort()};try{s=await this._createStudy(e.signal)}catch(e){return}this._study=s,this._applySeriesPropertiesToStudy(),s.properties().subscribe(this,this._applyStudyPropertiesToSeries),this._applyStudyPropertiesToSeries();const i=e=>{this._status=e,this._onStatusChanged.fire()};s.onStatusChanged().subscribe(this,i),i(s.status()),this._destroyStudy=()=>{var e;s.properties().unsubscribeAll(this),s.onStatusChanged().unsubscribeAll(this),s.stop(),null===(e=s.destroy)||void 0===e||e.call(s),this._status=void 0,this._onStatusChanged.fire(),this._study=null,this._destroyStudy=null},this._series.style()===this.requiredStyle()&&this._study.start()}else null===(s=this._destroyStudy)||void 0===s||s.call(this)}wasCompletedBefore(){var e;return Boolean(null===(e=this._study)||void 0===e?void 0:e.wasCompletedBefore())}status(){return this._status} onStatusChanged(){return this._onStatusChanged}legendValuesProvider(){return null}dataWindowValuesProvider(){return null}state(e){return{}}restoreState(e,t){}priceRange(e,t){var s,i;return null!==(i=null===(s=this._study)||void 0===s?void 0:s.priceRange(e,t,{scaleSeriesOnly:!1,targetPriceScale:this._series.priceScale()}))&&void 0!==i?i:null}autoScaleInfo(e,t,s){var i;return null===(i=this._study)||void 0===i?void 0:i.autoScaleInfo(e,t,s)}requestMoreDataIndex(){return null}}var Ye=s(70843),Ze=s(832696),Ke=s(266325),Je=s(142257);class et extends Je.UndoCommand{constructor(e,t,i,r){super(new Xe.TranslatedString("TPO Reset all splits and merges",w.t(null,void 0,s(543775)))),this._binding=e,this._splitsAndMerges=r}redo(){const e=this._binding.state(!1);e.splitsAndMerges={},this._binding.restoreState(e)}undo(){const e=this._binding.state(!1);e.splitsAndMerges=this._splitsAndMerges,this._binding.restoreState(e)}}function tt(e,t,s){"state"in e?(e.customFields&&(null==t||t.restoreStateCustomFields(e.customFields)),e.data&&s&&(null==t||t.restoreData(e.data))):null==t||t.restoreStateCustomFields(e)}class st extends Qe{constructor(){super(...arguments),this._state={},this._inputBarBuilder=null}bindToSeriesProperties(e){const t=e.childs().tpoStyle;t.subscribe(this,(()=>{null!==this._study&&this._study.properties().mergeAndFire((0,Ye.prepareStudyPropertiesState)(t.state()))}));const s="tpoStyle.levels";e.setThemedColors([{path:`${s}.pocColor`,colors:Ze.tpoThemedColors.poc},{path:`${s}.poorHighColor`,colors:Ze.tpoThemedColors.poorHigh},{path:`${s}.poorLowColor`,colors:Ze.tpoThemedColors.poorLow},{path:`${s}.singleprintsColor`,colors:Ze.tpoThemedColors.singleprints},{path:`${s}.vahColor`,colors:Ze.tpoThemedColors.vah},{path:`${s}.valColor`,colors:Ze.tpoThemedColors.val}])}requiredStyle(){return 18}state(e){var t,s,i,r,o;return e?null!==(s=null===(t=this._study)||void 0===t?void 0:t.state(!0))&&void 0!==s?s:null:null!==(r=null===(i=this._study)||void 0===i?void 0:i.stateCustomFields())&&void 0!==r?r:"state"in this._state?null!==(o=this._state.customFields)&&void 0!==o?o:{}:this._state}restoreState(e,t){this._state=e,this._withData=t,tt(e,this._study,t)}requestMoreDataIndex(){const e=this._series.symbolInfo(),t=this._series.bars().firstIndex(),s=this._series.model().timeScale().logicalRange(),i=this._series.syncModel();if(!e||null===t||!s||!i)return null;const r=Math.floor(s.left()),a=this._series.bars().search(r,m.PlotRowSearchMode.NearestRight);if(!a)return null;const l=this._series.properties().childs().tpoStyle.childs().inputs.childs(),n=function(e,t){switch(e){case"Day":return`${t}D`;case"Week":return`${t}W`;case"Month":return`${t}M`}(0,o.ensureNever)(e)}(l.period.value(),l.periodsNum.value());if(null===this._inputBarBuilder||this._inputBarBuilder.symbolInfo!==e||this._inputBarBuilder.inputResolution!==n){const t=new Q.SessionInfo(e.timezone,e.session,e.session_holidays);this._inputBarBuilder={symbolInfo:e,inputResolution:n,barBuilder:(0,Q.newBarBuilder)(n,t,t)}}const h=this._inputBarBuilder.barBuilder,d=1e3*a.value[0] ;h.moveTo(d);const u=h.startOfBar(0);return r-(0,Y.extrapolateBarsFrontToTime)(i.barBuilder(),u,d,1e3).count}async _createStudy(e){var t;const i=await(0,Ke.respectAbort)(e,Promise.resolve().then(s.bind(s,556983))),r=await i.createTpoPeriodicStudy(this._series.model(),et.bind(this,this));if(e.aborted)throw r.stop(),null===(t=r.destroy)||void 0===t||t.call(r),(0,Ke.createAbortError)();return tt(this._state,r,this._withData),r.properties().childs().inputs.childs().ticksPerRow.subscribe(this,(e=>{this._series.properties().childs().tpoStyle.childs().inputs.childs().ticksPerRow.setValue(e.value())})),r}_applySeriesPropertiesToStudy(){var e;null===(e=this._study)||void 0===e||e.properties().mergeAndFire((0,Ye.prepareStudyPropertiesState)(this._series.properties().childs().tpoStyle.state()))}_applyStudyPropertiesToSeries(){const e=(0,o.ensureNotNull)(this._study).properties().childs().inputs.childs().ticksPerRow.value();this._series.properties().childs().tpoStyle.childs().inputs.childs().ticksPerRow.setValue(e)}}var it=s(490515);function rt(e,t,s){(null==e?void 0:e.customFields)&&(null==t||t.restoreStateCustomFields(e.customFields)),(null==e?void 0:e.data)&&s&&(null==t||t.restoreData(e.data))}class ot extends Qe{bindToSeriesProperties(e){const t=e.childs().volFootprintStyle,s=t.state();t.hasChild("bgColors")&&t.removeProperty("bgColors"),t.addChild("bgColors",new it.VolumeFootprintBgColorsProperty(s.bgColors)),t.childs().inputs.subscribe(this,(()=>{null!==this._study&&this._study.properties().childs().inputs.mergeAndFire(t.childs().inputs.state())}))}requiredStyle(){return 17}state(e){var t,s;return null!==(s=null===(t=this._study)||void 0===t?void 0:t.state(e))&&void 0!==s?s:null}restoreState(e,t){this._state=e,this._withData=t,rt(e,this._study,t)}async _createStudy(e){var t;const i=await(0,Ke.respectAbort)(e,Promise.resolve().then(s.bind(s,205838))),r=await i.createVolumeFootprintStudy(this._series.model());if(e.aborted)throw r.stop(),null===(t=r.destroy)||void 0===t||t.call(r),(0,Ke.createAbortError)();return rt(this._state,r,this._withData),r}_applySeriesPropertiesToStudy(){var e;null===(e=this._study)||void 0===e||e.properties().childs().inputs.mergeAndFire(this._series.properties().childs().volFootprintStyle.childs().inputs.state())}_applyStudyPropertiesToSeries(){}}var at=s(881861),lt=s(634005),nt=s(241981);function ht(e,t,s){(null==e?void 0:e.data)&&s&&(null==t||t.restoreData(e.data))}class dt extends Qe{constructor(){super(...arguments),this._inputBarBuilder=null,this._legendValuesProvider=null,this._dataWindowValuesProvider=null}bindToSeriesProperties(e){e.childs().svpStyle.subscribe(this,(()=>{this._applySeriesPropertiesToStudy()}))}requiredStyle(){return 20}requestMoreDataIndex(){if(this._series.intervalObj().isDWM())return null;const e=this._series.symbolInfo(),t=this._series.bars().firstIndex(),s=this._series.model().timeScale().logicalRange(),i=this._series.syncModel();if(!e||null===t||!s||!i)return null;const r=Math.floor(s.left()),o=this._series.bars().search(r,m.PlotRowSearchMode.NearestRight) ;if(!o)return null;if(null===this._inputBarBuilder||this._inputBarBuilder.symbolInfo!==e){const t=new Q.SessionInfo(e.timezone,e.session,e.session_holidays);this._inputBarBuilder={symbolInfo:e,barBuilder:(0,Q.newBarBuilder)("1D",t,t)}}const a=this._inputBarBuilder.barBuilder,l=1e3*o.value[0];a.moveTo(l);const n=a.startOfBar(0);return r-(0,Y.extrapolateBarsFrontToTime)(i.barBuilder(),n,l,1e3).count}legendValuesProvider(){return this._legendValuesProvider}dataWindowValuesProvider(){return this._dataWindowValuesProvider}state(e){var t,s;return null!==(s=null===(t=this._study)||void 0===t?void 0:t.state(e))&&void 0!==s?s:null}restoreState(e,t){this._state=e,this._withData=t,ht(e,this._study,t)}async _createStudy(e){var t;const i=await(0,Ke.respectAbort)(e,Promise.resolve().then(s.bind(s,410491))),r=await i.createSessionVolumeStudy(this._series.model());if(e.aborted)throw r.stop(),null===(t=r.destroy)||void 0===t||t.call(r),(0,Ke.createAbortError)();return ht(this._state,r,this._withData),this._legendValuesProvider=new lt.StudyLegendValuesProvider(r,this._series.model(),!0),this._dataWindowValuesProvider=new nt.StudyDataWindowValuesProvider(r,this._series.model()),r}_applySeriesPropertiesToStudy(){var e;null===(e=this._study)||void 0===e||e.properties().mergeAndFire((0,at.prepareStudyPropertiesState)(this._series.properties().childs().svpStyle.state()))}_applyStudyPropertiesToSeries(){}}class ut{constructor(e){this._onStatusChanged=new $e.Delegate,this._bindings=[new st(e),new ot(e),new dt(e)],this._bindings.forEach((e=>e.onStatusChanged().subscribe(this,(()=>this._onStatusChanged.fire())))),this._series=e}destroy(){this._bindings.forEach((e=>e.destroy()))}bindToSeriesProperties(e){this._bindings.forEach((t=>t.bindToSeriesProperties(e)))}paneViews(e){return this._bindings.reduce(((t,s)=>t.concat(s.paneViews(e))),[])}stop(){this._bindings.forEach((e=>e.stop()))}restart(){var e;null===(e=this._activeBinding())||void 0===e||e.restart()}moveData(e){var t;null===(t=this._activeBinding())||void 0===t||t.moveData(e)}clearData(){this._bindings.forEach((e=>e.clearData()))}updateAllViews(e){this._bindings.forEach((t=>t.updateAllViews(e)))}syncStudy(e){this._bindings.forEach((t=>t.syncStudy(e)))}onStatusChanged(){return this._onStatusChanged}wasCompletedBefore(){var e,t;return null===(t=null===(e=this._activeBinding())||void 0===e?void 0:e.wasCompletedBefore())||void 0===t||t}dataWindowValuesProvider(){var e,t;return null!==(t=null===(e=this._activeBinding())||void 0===e?void 0:e.dataWindowValuesProvider())&&void 0!==t?t:null}legendValuesProvider(){var e,t;return null!==(t=null===(e=this._activeBinding())||void 0===e?void 0:e.legendValuesProvider())&&void 0!==t?t:null}status(){var e;return null===(e=this._activeBinding())||void 0===e?void 0:e.status()}priceRange(e,t){return(0,v.mergePriceRanges)(this._bindings.map((s=>s.priceRange(e,t))))}requestMoreDataIndex(){var e,t;return null!==(t=null===(e=this._activeBinding())||void 0===e?void 0:e.requestMoreDataIndex())&&void 0!==t?t:null}getInputsInfoProperties(){var e,t ;return null===(t=null===(e=this._activeBinding())||void 0===e?void 0:e.properties())||void 0===t?void 0:t.inputs}state(e){return this._bindings.reduce(((t,s)=>(t[s.requiredStyle()]=s.state(e),t)),{})}restoreState(e,t){for(const s of this._bindings){const i=e[s.requiredStyle()];i&&s.restoreState(i,t)}}autoScaleInfos(e,t,s){return this._bindings.map((i=>i.autoScaleInfo(e,t,s))).filter(_e.isExistent)}_activeBinding(){var e;return null!==(e=this._bindings.find((e=>e.requiredStyle()===this._series.style())))&&void 0!==e?e:null}}var ct=s(234271),pt=s(432078);class _t extends pt.ComputedTimePointWeights{constructor(e){super(),this._middleVolume=e,this._minValidVolume=.9*e}setVolume(e,t){this.setWeight(e,1+Math.log2(Math.max(t,this._minValidVolume)/this._middleVolume))}}class mt extends be.PriceAxisView{constructor(e,t){super(),this._source=e,this._model=t}_updateRendererData(e,t,s){e.visible=!1;const i=this._source;if(!this._model.properties().childs().scalesProperties.childs().showSeriesPrevCloseValue.value())return;if(i.isDWM())return;const r=i.prevClose();if(null===r)return;const o=(0,Se.resetTransparency)(this._source.properties().childs().prevClosePriceLineColor.value());s.background=o,s.textColor=this.generateTextColor(o),s.coordinate=r.coordinate,e.text=(0,Ie.getCurrentModePriceText)(i.priceScale(),r),e.visible=!0}}var vt=s(955831);class yt extends vt.HorizontalLinePaneView{constructor(e){super(),this._series=e,this._model=e.model()}}var gt=s(458963);class St extends yt{constructor(e){super(e),this._lineRendererData.linestyle=gt.LINESTYLE_DOTTED}_updateImpl(){this._lineRendererData.visible=!1;const e=this._series.properties().childs();if(!e.showPrevClosePriceLine.value())return;if(this._series.isDWM())return;const t=this._series.prevClose();null!==t&&(this._lineRendererData.visible=!0,this._lineRendererData.y=t.coordinate,this._lineRendererData.color=e.prevClosePriceLineColor.value(),this._lineRendererData.linewidth=e.prevClosePriceLineWidth.value())}}var bt=s(969419),ft=s(956725),wt=s(9640),Pt=s(86441),Ct=s(63316),xt=s(315801);class It{constructor(e,t){this._bars=[],this._invalidated=!0,this._isMarkersEnabled=(0,P.enabled)("source_selection_markers"),this._selectionData=null,this._blockSize=0,this._series=e,this._model=t,this._selectionIndexer=new Ct.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}nearestIndex(e,t){var s,i;return null!==(i=null===(s=this.bars().search(e,t))||void 0===s?void 0:s.index)&&void 0!==i?i:null}items(){return this._bars}_updateImpl(){if(this._bars=[],6===this._series.properties().childs().style.value()&&!this._series.data().boxSize)return;const e=this._series.priceScale(),t=this._model.timeScale();if(t.isEmpty()||e.isEmpty())return;const s=t.visibleStrictDataRange(this.bars());if(null===s)return;if(0===this.bars().size())return;if(this._series.data().bars().isEmpty())return;let i=s.firstBar();const r=s.lastBar(),a=this._series.firstValue();if(null===a)return;for(;i<=r;i++){if(null!==this.bars().valueAt(i))break}if(i>r)return ;const l=this.bars().range(i,r),n={},h=this._series.properties().childs().style.value(),d=6===h?(0,o.ensureDefined)(this._series.data().boxSize):0;if(l.each(((e,t)=>{n.value=t;const s=this._barItem(n,t,e);return null===s||(n.previousValue=t,this._bars.push(s)),!1})),6===h&&(this._blockSize=(e.priceToCoordinate(0,a)-e.priceToCoordinate(500,a))/500*d),e.barPricesToCoordinates(this._bars,a),t.fillBarBorders(this._bars),this._model.selection().isSelected(this._series)){const s=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,barSpacing:t.barSpacing(),hittestResult:xt.HitTarget.Regular};const i=(0,o.ensureNotNull)(this._model.paneForSource(this._series)).height();this._selectionData.hittestResult=xt.HitTarget.Regular;for(let r=0;r=e.start&&s<=e.end){i=e;break}if(void 0===i)throw new Error("Last price animation internal logic error");const r=i.easing((s-i.start)/(i.end-i.start));return{fillColor:Zt(t,r,i.startFillAlpha,i.endFillAlpha),strokeColor:Zt(t,r,i.startStrokeAlpha,i.endStrokeAlpha),radius:(o=r,a=i.startRadius,l=i.endRadius,a+(l-a)*o)};var o,a,l}class Jt{constructor(e){this._renderer=new Xt,this._invalidated=!0,this._stageInvalidated=!0,this._startTime=performance.now(),this._endTime=this._startTime-1,this._series=e}update(e){if(this._invalidated=!0,"data-source-change"===e.type&&e.sourceId===this._series.id()&&e.realtime&&this._series.seriesLoaded()){const e=performance.now(),t=this._endTime-e;if(t>0)return void(t<650&&(this._endTime+=2600));this._startTime=e,this._endTime=e+2600}}invalidateStage(){this._stageInvalidated=!0}animationActive(){return performance.now()<=this._endTime}stopAnimation(){this._endTime=this._startTime-1}renderer(e){return this._invalidated?(this._updateImpl(e),this._invalidated=!1,this._stageInvalidated=!1):this._stageInvalidated&&(this._updateRendererDataStage(),this._stageInvalidated=!1),this._renderer}_updateImpl(e){this._renderer.setData(null);const t=this._series.model().timeScale(),s=t.visibleBarsStrictRange(),i=this._series.firstValue(),r=this._series.lastValueData(void 0,!0,!0);if(null===s||null===i||void 0===r.index||void 0===r.price||!s.contains(r.index))return;const o=new Pt.Point(t.indexToCoordinate(r.index),this._series.priceScale().priceToCoordinate(r.price,i)),a=r.color,l=this._series.properties().childs();let n;switch(this._series.style()){case 3:n=l.areaStyle.childs().linewidth.value();break;case 10:const t=l.baselineStyle,s=Math.round(e.mediaSize.height*(Math.abs(100-t.childs().baseLevelPercentage.value())/100));n=o.y<=s?t.childs().topLineWidth.value():t.childs().bottomLineWidth.value();break;case 14:n=l.lineWithMarkersStyle.childs().linewidth.value();break;case 15:n=l.steplineStyle.childs().linewidth.value();break;default:n=l.lineStyle.childs().linewidth.value()} const h=Kt(this._duration(),a);this._renderer.setData({seriesLineColor:a,seriesLineWidth:n,fillColor:h.fillColor,strokeColor:h.strokeColor,radius:h.radius,center:o})}_updateRendererDataStage(){const e=this._renderer.data();if(null!==e){const t=Kt(this._duration(),e.seriesLineColor);e.fillColor=t.fillColor,e.strokeColor=t.strokeColor,e.radius=t.radius}}_duration(){return this.animationActive()?performance.now()-this._startTime:2599}}var es=s(572230),ts=s(401580),ss=s(175878),is=s(826989),rs=s(276871);const os=P.enabled("chart_style_hilo_last_price");class as extends yt{constructor(e){super(e),this._lineRendererData.linestyle=gt.LINESTYLE_DOTTED}_updateImpl(){this._lineRendererData.visible=!1;const e=this._series.properties().childs();if(!e.showPriceLine.value())return;if(!os&&12===e.style.value())return;const t=this._series.lastValueData(void 0,!0);t.noData||(this._lineRendererData.visible=!0,this._lineRendererData.y=t.coordinate,this._lineRendererData.color=this._series.priceLineColor(t.color),this._lineRendererData.linewidth=e.priceLineWidth.value())}}var ls=s(147664),ns=s(262550),hs=s(142119),ds=s(230058),us=s(756930),cs=s(787123);class ps extends us.PaneRendererSeriesBase{constructor(e){super(),this._barSpacing=1,this._barWidth=1,this._isPriceScaleInverted=!1,this._bars=e.bars,this._barSpacing=e.barSpacing,this._isPriceScaleInverted=e.isPriceScaleInverted}_drawImpl(e){const{context:t,horizontalPixelRatio:s,verticalPixelRatio:i}=e;t.save(),this._barWidth=Math.round(this._barSpacing*s),this._drawWicks(t,s,i),this._drawBorder(t,s,i),this._drawBars(t,s,i)}_getTolerance(){return(0,wt.interactionTolerance)().series+.5}_drawBars(e,t,s){let i="",r=null;const o=this._calculateBorderWidth(t);for(const a of this._bars){if(this._barWidth<=2*o)continue;let l=Math.round(Math.min(a.open,a.close)*s),n=Math.round(Math.max(a.open,a.close)*s),h=Math.round(a.center*t)-Math.floor(.5*this._barWidth),d=h+this._barWidth-1;if(a.color!==i){const t=a.color;e.fillStyle=t,i=t}null!==r&&(h=Math.max(r+1,h-1),h=Math.min(h,d)),r=d,h+=o,l+=o,d-=o,n-=o,l>n||e.fillRect(h,l,d-h+1,n-l+1)}}_drawBorder(e,t,s){const i=this._calculateBorderWidth(t);let r="",o=null;for(const a of this._bars){a.borderColor!==r&&(e.fillStyle=a.borderColor,r=a.borderColor);let l=Math.round(a.center*t)-Math.floor(.5*this._barWidth);const n=l+this._barWidth-1,h=Math.round(Math.min(a.open,a.close)*s),d=Math.round(Math.max(a.open,a.close)*s);if(null!==o&&(l=Math.max(o+1,l-1),l=Math.min(l,n)),this._barSpacing*t>2*i)(0,cs.fillRectInnerBorder)(e,l,h,n-l+1,d-h+1,i);else{const t=n-l+1;e.fillRect(l,h,t,d-h+1)}o=n}}_drawWicks(e,t,s){const i=this._bars;let r=Math.min(Math.floor(t),Math.floor(this._barSpacing*t));r=Math.max(Math.floor(t),Math.min(r,this._barWidth));const o=Math.floor(.5*r);let a="";for(const l of i){l.wickColor!==a&&(e.fillStyle=l.wickColor,a=l.wickColor);let i=Math.round(Math.min(l.open,l.close)*s),n=Math.round(Math.max(l.open,l.close)*s);this._isPriceScaleInverted&&([n,i]=[i,n]);const h=Math.round(l.high*s),d=Math.round(l.low*s),u=Math.round(t*l.center)-o,c=u+r-1-u+1 ;e.fillRect(u,h,c,i-h),d!==n&&e.fillRect(u,n+1,c,d-n-1)}}_calculateBorderWidth(e){let t=Math.floor(e);this._barWidth<=2*t&&(t=Math.floor(.5*(this._barWidth-1)));const s=Math.max(Math.floor(e),t);return this._barWidth<=2*s?Math.floor(e):s}}class _s extends Vt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:this._model.timeScale().barSpacing(),isPriceScaleInverted:this._series.priceScale().isInverted()},t=new hs.CompositeRenderer;return t.append(new ps(e)),this._model.selection().isSelected(this._series)&&this._isMarkersEnabled&&this._selectionData&&t.append(new ds.SelectionRenderer(this._selectionData)),t}}class ms extends Tt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:this._model.timeScale().barSpacing(),isPriceScaleInverted:this._series.priceScale().isInverted()};return new ps(e)}}class vs extends Vt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:.9*this._model.timeScale().barSpacing(),isPriceScaleInverted:this._series.priceScale().isInverted()},t=new hs.CompositeRenderer;return t.append(new ps(e)),this._model.selection().isSelected(this._series)&&this._isMarkersEnabled&&this._selectionData&&t.append(new ds.SelectionRenderer(this._selectionData)),t}}class ys extends Tt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:.9*this._model.timeScale().barSpacing(),isPriceScaleInverted:this._series.priceScale().isInverted()};return new ps(e)}}var gs,Ss=s(203308);class bs extends us.PaneRendererSeriesBase{constructor(e){super(),this._bars=e.bars,this._barSpacing=e.barSpacing,this._barLineWidth=Math.max(1,(0,wt.optimalBarWidth)(e.barSpacing,1))}_drawImpl(e){const{context:t,horizontalPixelRatio:s,verticalPixelRatio:i}=e;let r,o,a;t.save(),t.lineCap="square";const l=Math.floor(s)%2?1:0;for(const e of this._bars){const n=Math.round(s*this._barLineWidth*.5),h=Math.round(s*e.center-n),d=void 0===o||e.isUp?Math.round(i*e.high-n):o,u=2*n;let c;if(e.isTwoColorBar){const s=Math.round(i*e.additionalPrice-i*e.high+n),o=d+s,a=Math.round(i*e.low-i*e.additionalPrice+n),p=void 0!==r&&e.isUp?r:o+a;t.fillStyle=e.upColor,t.fillRect(h,d,u+l,s),t.fillStyle=e.downColor,t.fillRect(h,o,u+l,p+n-o+1),c=p}else{const s=Math.round(i*e.low-i*e.high+n),o=void 0!==r&&e.isUp?r:d+s;t.fillStyle=e.color,t.fillRect(h,d,u+l,o+n-d+1),c=o}if(!e.combinedWithProjection){e.isTwoColorBar?t.fillStyle=e.isUp?e.downColor:e.upColor:t.fillStyle=e.color;const r=void 0===a?Math.round((e.center-this._barSpacing)*s+n):a+2*n,h=Math.round(e.center*s-n)-r+1,d=2*n+l;if(e.isUp)t.fillRect(r,c-n+1-l,h,d);else{const s=void 0===o?Math.round(e.open*i-n):o;t.fillRect(r,s,h,d)}}a=h,r=c,o=d}t.restore()}_getTolerance(){return(0,wt.interactionTolerance)().series+this._barLineWidth/4}}function fs(e,t){const s={};return s.upColor=e.upColor,s.downColor=e.downColor,s.isTwoColorBar=e.isTwoColorBar,(0,Ss.default)(t)&&(s.additionalPrice=t),s} class ws extends Vt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:this._model.timeScale().barSpacing()},t=new hs.CompositeRenderer;return t.append(new bs(e)),this._model.selection().isSelected(this._series)&&this._isMarkersEnabled&&this._selectionData&&t.append(new ds.SelectionRenderer(this._selectionData)),t}_barItem(e,t,s){const i=super._barItem(e,t,s);if(null===i)return null;const r=fs(this._series.barColorer().barStyle(s,!1,e),t[6]);return{...i,...r}}}class Ps extends Tt{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={bars:this._bars,barSpacing:this._model.timeScale().barSpacing()};return new bs(e)}_barItem(e,t,s){const i=super._barItem(e,t,s);if(null===i)return null;const r=this._series.barColorer().barStyle(s,!0,e),a=t[6],l=fs(r,a);return(0,Ss.default)(a)&&i.timePointIndex===(0,o.ensureNotNull)(this.bars().lastIndex())&&(l.combinedWithProjection=!0),{...i,...l}}}!function(e){e[e.EllipseWidth=.9]="EllipseWidth",e[e.EllipseRadius=.95]="EllipseRadius",e[e.SimplifiedEllipseWidth=.86]="SimplifiedEllipseWidth"}(gs||(gs={}));class Cs extends us.PaneRendererSeriesBase{constructor(e){super(),this._bars=e.bars,this._barSpacing=e.barSpacing,this._barWidth=e.barSpacing}_drawImpl(e){const{context:t,horizontalPixelRatio:s,verticalPixelRatio:i}=e;if(0===this._bars.length)return;t.save();const r=this._bars.reduce(((e,t)=>Math.max(e,(t.low-t.high)/t.additionalNum)),0);this._barSpacing>1&&r>=1?this._drawFillSigns(t,s,i):this._drawSimplified(t,s,i),t.restore()}_getTolerance(){return(0,wt.interactionTolerance)().series+this._barWidth/8}_drawBarCross(e,t,s,i){!function(e,t,s,i,r){e.moveTo(t,s),e.lineTo(t+i,s+r),e.moveTo(t+i,s),e.lineTo(t,s+r)}(e,t.center-.5*this._barWidth,t.high+i*s,this._barWidth,s)}_drawBarEllipse(e,t,s,i){!function(e,t,s,i,r){e.save(),e.translate(t+i/2,s+r/2),e.scale(i/2,r/2),e.moveTo(1,0),e.arc(0,0,gs.EllipseRadius,0,2*Math.PI,!1),e.restore()}(e,t.center-this._barWidth*gs.EllipseWidth*.5,t.high+i*s,this._barWidth*gs.EllipseWidth,s)}_drawFillSigns(e,t,s){e.scale(t,s),e.lineCap="butt",e.lineWidth=1;for(const t of this._bars){const s=(t.low-t.high)/t.additionalNum;if(t.isMergedBar&&(e.beginPath(),t.isUp?this._drawBarEllipse(e,t,s,t.additionalNum-1):this._drawBarCross(e,t,s,0),e.strokeStyle=t.isUp?t.downColor:t.upColor,e.stroke()),e.beginPath(),t.isUp)for(let i=t.additionalNum-1-(t.isMergedBar?1:0);i>-1;i--)this._drawBarCross(e,t,s,i);else for(let i=t.isMergedBar?1:0;ie.value.splice(7,1))),t}function ai(e){const{seriesStatus:t,additionalStudyStatus:s}=e;if(b.seriesLoadingStatuses.has(t))return 2;if(s){if(4!==t&&s.type===Gs.StudyStatusType.Error)return 13;if(b.seriesReadyStatuses.has(t)&&(s.type===Gs.StudyStatusType.Loading||s.type===Gs.StudyStatusType.Undefined))return 2}return t}class li extends u.PriceDataSource{constructor(e,t,a,n){var h,u,c;t.removeProperty("currencyId"),super(e,"_seriesId"),this.requestingStyleIsNotSupported=new $e.Delegate,this.requestingStyleSupportRecovered=new $e.Delegate,this._paneView=null,this._futureBarsPaneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=null,this._gotoDateView=null,this._baseHorizontalLineView=null,this._priceStep=null,this._symbolInfo=new ts.WatchedValue(null),this._isPrePostMarketPricesAvailableProperty=new y.Property(!1),this._isBackAdjustmentForbiddenProperty=new y.Property(!0),this._isSettlementAsCloseForbiddenProperty=new y.Property(!0),this._highLowPriceCache=new Map,this._averagePriceCache=new Map,this._prevClosePriceAxisView=null,this._priceScaleAboutToBeChanged=new $e.Delegate,this._onRestarted=new $e.Delegate,this._onStatusChanged=new $e.Delegate,this._tagsChanged=new $e.Delegate,this._intervalChanged=new $e.Delegate,this._sessionIdChanged=new $e.Delegate,this._requestMoreDataAvailable=!0,this._lineStyleLastPriceCirclePaneView=new Jt(this),this._prevClosePriceLineView=null,this._dataPoweredBy=null,this._symbolResolvingActive=new ts.WatchedValue(!1),this._predictBars=0,this._syncModel=null,this._data=null,this._lastCompleteFlags=null,this._haStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(8,!0))},this._renkoStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(4,!0))},this._pbStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(7,!0))},this._kagiStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(5,!0))},this._pnfStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(6,!0))},this._rangeStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(11,!0))},this._volFootprintStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(17,!0))},this._tpoStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(18,!0))},this._svpStyle={studyId:(0,o.ensureNotNull)((0,g.chartStyleStudyId)(20,!0))},this._barColorerCache=null,this._boxSizeValue=new ts.WatchedValue,this._base=100,this._pointValue=1,this._formattingDeps=null,this._defaultFormatter=new S.PriceFormatter({priceScale:this._base}),this._formatter=new S.PriceFormatter({priceScale:this._base}),this._ignoreMinMoveFormatter=new S.PriceFormatter({priceScale:this._base}),this._ignoreMinMovePriceStep=null,this._lastBarCloseTime=null,this._onSessionIdPropertyChangedBound=this._onSessionIdPropertyChanged.bind(this),this._ignoreSessionIdProxyPropertyChanges=!1,this._textSourceIsAlwaysTickerRestrictionEnabled=!1,this._lastPriceAnimationActive=!1, this._currentSession="out_of_session",this._onStyleChanged=new $e.Delegate,this._intervalObj=null,this._obsoleteZOrder=0,this._seriesErrorMessage=null,this._seriesAlwaysFalseHibernatedVW=new ts.WatchedValue(!1),this._styleToRecover=null,this._precomputedBarStyles=new WeakMap,this._doNotShowLastAvailableBar=!1,this._gotoDateResultCleared=!1,this._endOfDataPaneView=null,this._pendingTimeRange=null,this._replaySubscriber=new ts.WatchedValue(null),this._symbolIntervalChanged=new $e.Delegate,this._isReplayResolutionAvailableForUser=null,this._onInReplayStateChanged=new $e.Delegate,this._replayExitedDueUnsupportedInterval=new $e.Delegate,this._replayExitedDueUnavailableForUserInterval=new $e.Delegate,this._onTimeFrameApplied=new $e.Delegate,this._seriesLoaded=!1,this._seriesCompleted=!1,this._status=new ts.WatchedValue({seriesStatus:0}),this._prevRequestedInterval="",this._isActingAsSymbolSource=new ts.WatchedValue(!0),this._unsupportedResolutionState=new ts.WatchedValue(null),this._countdownUpdateTimer=null,this._deferredDestroyed=(0,d.createDeferredPromise)(),this._volumePointWeights=null,this._studyBindings=null,this._updateTimeScaleTimePointWeights=()=>{this._model.timeScale().setTimePointWeights(19===this.style()?this._volumePointWeights:null)},this._seriesStatus=(0,zs.combine)(ai,this._status.weakReference()),this._studyBindings=new ut(this),this._studyBindings.onStatusChanged().subscribe(this,(()=>{var e;const t=this.status(),s=this._status.value(),i=null===(e=this._studyBindings)||void 0===e?void 0:e.status();this._updateStatus({...this._status.value(),additionalStudyStatus:i}),this.status()!==t&&(this._statusView.update(),this._model.updateSource(this)),(0,r.default)(s,this._status)||this._onStatusChanged.fire()})),this._seriesSource=new ss.SeriesDataSource(e.chartApi(),"s",n);const p=this._seriesSource.dataEvents();p.symbolResolved().subscribe(this,this._onSymbolResolved),p.symbolError().subscribe(this,this._onSymbolError),p.seriesTimeFrame().subscribe(this,this._onSeriesTimeFrame),p.seriesError().subscribe(this,this._onSeriesError),p.loading().subscribe(this,this._onSeriesLoading),p.completed().subscribe(this,this._onSeriesCompleted),p.dataUpdated().subscribe(this,this._onDataUpdated),p.barReceived().subscribe(this,this._onBarReceived),p.unsupportedResolutionRequested().subscribe(this,this._onUnsupportedResolutionRequested),this._quotesProvider=new ge.QuotesProvider(void 0,e.collapsed().spawnOwnership()),this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate);const _=t.childs();if(t.hasChild("extendedHours")){(0,o.ensureDefined)(_.extendedHours).value()&&!t.hasChild("sessionId")&&t.addChild("sessionId",new y.Property("extended")),t.removeProperty("extendedHours")}t.hasChild("sessionId")||t.addChild("sessionId",new y.Property(i.Regular)),(0,qs.allChartStyles)().includes(_.style.value())||_.style.setValueSilently(2);const m=_.lineStyle.childs();if(_.lineStyle.hasChild("styleType")){let e,t;const s=m.styleType.value();0===s&&(t=14,e=_.lineWithMarkersStyle.childs()),1===s&&(t=15, e=_.steplineStyle.childs()),e&&(e.color.setValueSilently(m.color.value()),e.linestyle.setValueSilently(m.linestyle.value()),e.linewidth.setValueSilently(m.linewidth.value()),e.priceSource.setValueSilently(m.priceSource.value())),void 0!==t&&2===_.style.value()&&_.style.setValue(t),_.lineStyle.removeProperty("styleType")}null===(h=this._studyBindings)||void 0===h||h.bindToSeriesProperties(t),this._setProperties(t),this._sessionIdProxyProperty=new y.Property(_.sessionId.value()),_.sessionId.subscribe(this,(()=>this._updateSessionIdProxyProperty())),this._sessionIdProxyProperty.subscribe(this,this._onSessionIdProxyPropertyChanged),this._symbolTextSourceProxyProperty=new y.Property,this._recalcSymbolTextSourceProxyProperty(),_.statusViewStyle.childs().symbolTextSource.subscribe(this,this._recalcSymbolTextSourceProxyProperty),this._symbolTextSourceProxyProperty.subscribe(this,(()=>e.lightUpdate())),this._options=(0,_e.merge)((0,_e.clone)(ii),a),this._prevChartStyle=_.style.value(),this._priceAxisView=new Re(this,e,{alwaysShowGlobalLast:!Zs,showCountdown:a.countdownEnabled});let v=null;$s||Zs||(v=new Re(this,e,{visibleOnHistoryOnly:!0,showSymbolLabel:!1,showCountdown:!1,alwaysShowGlobalLast:!1,useSolidBodyColor:!1})),this._priceLinePriceAxisView=new Rt.SeriesPriceLineAxisView(this),this._priceLineAxisViews=[this._priceLinePriceAxisView];const f=new At(this,e,{showCountdown:a.countdownEnabled});this._priceAxisViews=[this._priceAxisView,f],null!==v&&this._priceAxisViews.push(v),this._prevClosePriceAxisView=new mt(this,e),this._priceAxisViews.unshift(this._prevClosePriceAxisView),this._prevClosePriceLineView=new St(this),this._panePriceAxisView=new Mt.PanePriceAxisView(this._priceAxisView,this,e),this._historyPricePanePriceAxisView=null!==v?new Mt.PanePriceAxisView(v,this,e):null,this._projectionPriceAxisView=new Mt.PanePriceAxisView(f,this,e),this._labelPaneViews=[this._panePriceAxisView,this._projectionPriceAxisView],null!==this._historyPricePanePriceAxisView&&this._labelPaneViews.push(this._historyPricePanePriceAxisView),this._highLowAvgPaneViews=[],this._averagePaneViews=[],this._createHighLowAvgViews(),this._subscribeRestartToSessionIdChange(),_.visible.subscribe(this,this._updateLastPriceAnimationActive),this._updateLastPriceAnimationActive(),_.minTick.subscribe(this,this._onFormatterPropsChanged),this._dataWindowView=new j(this,e),this._legendView=new z(this,e),this._statusView=new k(this,_.statusViewStyle),this._marketStatusModel=new G.MarketStatusModel(this._quotesProvider),this._dataUpdatedModeModel=Xs?new ue(this._symbolInfo.spawn().ownership(),this._seriesStatus.spawn().ownership(),(0,q.createWVFromGetterAndSubscription)((()=>{var e;return null===(e=this._lastCompleteFlags)||void 0===e?void 0:e.rt_update_period}),p.completed()).ownership()):null,this._dataProblemModel=new ye(this._quotesProvider,this._symbolInfo.spawn().ownership()),_.backAdjustment.subscribe(this,(()=>{this.isStarted()&&this.restart()})),_.settlementAsClose.subscribe(this,(()=>{this.isDWM()&&this.isStarted()&&this.restart()})), this._symbolResolvingActive.subscribe((()=>e.realignLineTools())),this._intervalChanged.subscribe(this,(()=>e.realignLineTools())),P.enabled("widget")||Promise.all([s.e(32662),s.e(5987),s.e(98996),s.e(43387),s.e(66458),s.e(4343),s.e(52078),s.e(16005),s.e(2182),s.e(90385),s.e(62526),s.e(66849)]).then(s.bind(s,271804)).then((e=>{this._endOfDataPaneView=new e.EndOfDataLollipopPaneView(this)})),null===(u=this._studyBindings)||void 0===u||u.syncStudy(this.style()),qe.alertsAvailable&&this._symbolResolvingActive.subscribe(this._updateAlertCreationAvailable.bind(this)),this.createPaneView(),this._properties.addExcludedKey("visible",1),this._properties.addExcludedKey("currencyId",1),this._futureBarsPaneView=null,this._priceLineView=null,this._baseHorizontalLineView=new Hs(this);for(const[,e]of Object.entries(b.STYLE_SHORT_NAMES))null===(c=this._properties.child(`${e}Style`))||void 0===c||c.subscribe(this,(()=>this.invalidateBarStylesCache()));const w=_.renkoStyle.childs().inputs.childs();w.boxSize.subscribe(this,this.restart),w.style.subscribe(this,this.restart),w.atrLength.subscribe(this,this.restart),w.percentageLTP.subscribe(this,this.restart),w.wicks.subscribe(this,this.restart),w.sources.subscribe(this,this.restart),_.pbStyle.childs().inputs.childs().lb.subscribe(this,this.restart);const C=_.kagiStyle.childs().inputs.childs();C.reversalAmount.subscribe(this,this.restart),C.style.subscribe(this,this.restart),C.atrLength.subscribe(this,this.restart),C.percentageLTP.subscribe(this,this.restart);const x=_.pnfStyle.childs().inputs.childs();x.boxSize.subscribe(this,this.restart),x.reversalAmount.subscribe(this,this.restart),x.sources.subscribe(this,this.restart),x.style.subscribe(this,this.restart),x.atrLength.subscribe(this,this.restart),x.percentageLTP.subscribe(this,this.restart),x.oneStepBackBuilding.subscribe(this,this.restart),_.rangeStyle.childs().inputs.childs().phantomBars.subscribe(this,this.restart),this._isDWMProperty=new y.Property(this.isDWM()),this._onRestarted.subscribe(this,(()=>this._isDWMProperty.setValue(this.isDWM()))),_.dividendsAdjustment.subscribe(this,(()=>{const e=_.dividendsAdjustment.value();(0,l.trackEvent)("Dividends adjust",!0===e?"On":"Off"),this.restart()})),this._dataPoweredBy=null,_.showCountdown.subscribe(this,this._onShowCountdownChanged),this._onShowCountdownChanged(_.showCountdown),this._recreatePriceFormattingDependencies(),_.lineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.lineWithMarkersStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.steplineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.areaStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.baselineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.columnStyle.childs().priceSource.subscribe(this,this._updateBarFunction),_.tpoStyle.childs().priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction(),this._isInReplay=(0,zs.combine)((e=>null!==e),this._replaySubscriber.weakReference()), this._legendValuesProvider=new zt(this,this.model()),this._dataWindowValuesProvider=new qt.SeriesValuesProvider(this,this.model())}setId(e){var t;super.setId(e),null===(t=(0,ct.getPersistentLogger)())||void 0===t||t.addPersistentLogEntry(`Set series Id to ${e}`,h.LOGLEVEL.INFO,"chart.series")}supportsPressedChunks(){return!0}pressedChunks(e,t){return this.data().pressedChunks(e,t)}seriesErrorMessage(){const{seriesStatus:e,additionalStudyStatus:t}=this._status.value();return this.isFailed()?this._seriesErrorMessage:b.seriesLoadingStatuses.has(e)?null:(null==t?void 0:t.type)===Gs.StudyStatusType.Error?(0,Gs.convertStudyStatusToString)({type:Gs.StudyStatusType.Error,errorDescription:t.errorDescription},!0):null}destroy(){this._seriesStatus.destroy(),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.destroy(),this.clearGotoDateResult(),this._legendView.destroy(),this._marketStatusModel.destroy(),this._studyBindings&&this._studyBindings.destroy(),null!==this._dataUpdatedModeModel&&this._dataUpdatedModeModel.destroy(),this._dataProblemModel.destroy(),this._paneView&&this._paneView.destroy&&this._paneView.destroy(),this._seriesSource.destroy(),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.destroy(),this._model.timeScale().visibleBarsStrictRangeChanged().unsubscribeAll(this),this._unsubscribeRestartToSessionIdChange(),this._replayExitedDueUnsupportedInterval.destroy(),this._replayExitedDueUnavailableForUserInterval.destroy(),this._onTimeFrameApplied.destroy(),this._deferredDestroyed.resolve(),this._properties.destroy(),this._isInReplay.destroy(),super.destroy()}isActingAsSymbolSource(){return this._isActingAsSymbolSource.readonly()}barColorer(){if(this._barColorerCache)return this._barColorerCache;let e=null;const t=this._model.dataSources();for(let s=t.length-1;s>=0;s--){const i=t[s];if((0,Ws.isStudy)(i)&&i.hasBarColorer()&&!i.isSourceHidden()){const t=(0,o.ensureNotNull)(i.barColorer());null===e?e=t:e.pushBackBarColorer(t)}}return null===e?e=new Fs.SeriesBarColorer(this):e.pushBackBarColorer(new Fs.SeriesBarColorer(this)),this._barColorerCache=e,e}createPaneView(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new as(this):null;const e=this._properties.childs().style.value();switch(e){case 0:this._paneView=new Bs.SeriesBarsPaneView(this,this._model);break;case 17:case 19:case 1:this._paneView=new Ds.SeriesCandlesPaneView(this,this._model,1===e||19===e?1:.2);break;case 2:case 18:case 14:case 15:this._paneView=new Rs.SeriesLinePaneView(this,this._model);break;case 3:this._paneView=new As.SeriesAreaPaneView(this,this._model);break;case 16:this._paneView=new Ms.SeriesHLCAreaPaneView(this,this._model);break;case 8:this._paneView=new ks(this,this._model);break;case 9:this._paneView=new Es.SeriesHollowCandlesPaneView(this,this._model);break;case 13:this._paneView=new Ts.SeriesColumnsPaneView(this,this._model);break;case 10:{this._paneView=new Ns.SeriesBaselinePaneView(this,this._model) ;const e=this._properties.childs().baselineStyle.childs();this._waterlineView=new ls.SeriesWaterlinePaneView({paneHeight:()=>this.priceScale().height(),color:()=>e.baselineColor.value(),baseLevelPercentage:()=>e.baseLevelPercentage.value()});break}case 12:this._paneView=new ns.SeriesHiLoPaneView(this,this._model)}switch(e){case 4:this._paneView=new _s(this,this._model),this._projectionBarsPaneView=new ms(this,this._model);break;case 7:this._paneView=new vs(this,this._model),this._projectionBarsPaneView=new ys(this,this._model);break;case 5:this._paneView=new ws(this,this._model),this._projectionBarsPaneView=new Ps(this,this._model);break;case 6:this._paneView=new Is(this,this._model),this._projectionBarsPaneView=new Vs(this,this._model)}if(11===e&&(this._properties.childs().rangeStyle.childs().barStyle.value()===Us.RangeBarStyle.Bars?(this._paneView=new Bs.SeriesBarsPaneView(this,this._model),this._projectionBarsPaneView=new Bt(this,this._model)):(this._paneView=new Ds.SeriesCandlesPaneView(this,this._model),this._projectionBarsPaneView=new Dt(this,this._model))),20===e&&(this._paneView=Ge.instance()),null===this._paneView)throw Error("Unknown chart style assigned: "+e)}properties(){return this._properties}zorder(){return 0}quotesProvider(){return this._quotesProvider}currentSession(){return this._currentSession}syncModel(){if(!this._syncModel){const e=this.symbolInfo(),t=this.interval();if(!e||!t)return null;this._syncModel=new J(e,t)}return this._syncModel}labelPaneViews(){return this._labelPaneViews}topPaneViews(){const e=[];if(null!==this._gotoDateView&&e.push(this._gotoDateView),this._lastPriceAnimationActive){const t=this._lineStyleLastPriceCirclePaneView;t.animationActive()&&setTimeout((()=>this._model.invalidate(es.InvalidationMask.cursor())),0),t.invalidateStage(),e.push(t)}return 0!==e.length?e:null}paneViews(e){var t,s;if(!this.properties().childs().visible.value()||!this._model.isSnapshot()&&!this._wasCompletedBefore())return null;const i=[(0,o.ensureNotNull)(this._baseHorizontalLineView),(0,o.ensureNotNull)(this._paneView)];return i.push(...null!==(s=null===(t=this._studyBindings)||void 0===t?void 0:t.paneViews(e))&&void 0!==s?s:[]),this._endOfDataPaneView&&i.push(this._endOfDataPaneView),this._futureBarsPaneView&&i.push(this._futureBarsPaneView),this._projectionBarsPaneView&&i.push(this._projectionBarsPaneView),null!==this._waterlineView&&i.push(this._waterlineView),i.push((0,o.ensureNotNull)(this._prevClosePriceLineView)),null!==this._priceLineView&&i.push(this._priceLineView),window.TradingView.printing&&this._lastPriceAnimationActive&&(this._lineStyleLastPriceCirclePaneView.stopAnimation(),i.push(this._lineStyleLastPriceCirclePaneView)),i.push(...this._highLowAvgPaneViews),i.push(...this._averagePaneViews),i}priceAxisViews(e,t){return e.findTargetPriceAxisViews(this,t,this._priceAxisViews,this._priceLineAxisViews)}clearHighLowPriceCache(){this._highLowPriceCache.clear()}clearAveragePriceCache(){this._averagePriceCache.clear()}priceScale(){return(0,o.ensureNotNull)(this._priceScale)}setPriceScale(e){ this._priceScale!==e&&(this._priceScaleAboutToBeChanged.fire(),this._priceScale=e,this._properties.removeProperty("priceAxisProperties"),this._properties.addChild("priceAxisProperties",e.properties()),this._properties.childs().priceAxisProperties.childChanged(null,""),(0,n.emit)("series_event","price_scale_changed"),this._priceScaleChanged.fire(e))}priceScaleChanged(){return this._priceScaleChanged}priceScaleAboutToBeChanged(){return this._priceScaleAboutToBeChanged}applyPreferences(e){const t=(0,_e.clone)(e);this.priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),this.setChartStyleWithIntervalIfNeeded(t.style);const{style:s,interval:i,...r}=t;this._properties.mergePreferences(r),this._properties.saveDefaults(),this.createPaneView(),this.invalidateBarStylesCache()}disconnect(){var e;null===(e=this._studyBindings)||void 0===e||e.stop(),this._seriesSource.stop(),this._predictBars=0,this._updateStatus({...this._status.value(),seriesStatus:0}),this._model.isSnapshot()||this._symbolInfo.setValue(null)}isStarted(){return this._seriesSource.isStarted()}isCompleted(){return this._seriesCompleted}restart(){var e;if(5===this._status.value().seriesStatus)return;this._seriesLoaded=!1,this._seriesCompleted=!1,this._lastCompleteFlags=null,this._onRestarted.fire(),this._setStatus(1),this._updateSymbolInfo(null);let t=this._properties.childs().interval.value();X.Interval.isEqual(t,this._prevRequestedInterval)&&this._notifyIntervalChanged(t);let s=null;this._pendingTimeRange&&(s=this._pendingTimeRange,this._pendingTimeRange=null),this._removeReplaySubscriber(),this._onBeforeModifySeries(this.getSymbolString(),t),this._onTimeFrameApplied.fire(s),t=(0,rs.getServerInterval)(t),this._data=null,this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesRestart),this._seriesSource.modifySeries(this._getResolvingSymbolObject(),t,s),this._seriesSource.isStarted()||this._seriesSource.start(),this._prevRequestedInterval=this.interval(),null===(e=this._studyBindings)||void 0===e||e.restart(),this.updateAllViews((0,Ve.sourceChangeEvent)(this.id())),this._model.lightUpdate()}isSymbolInvalid(){return 4===this._status.value().seriesStatus}getSymbolString(){return(0,$t.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject())}getAlertSymbolString(){return(0,$t.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(this.actualSymbol()))}invalidateBarStylesCache(e){ti.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.bars(),e),this._clearStylePlot(this.nsBars())}isLoading(){return b.seriesLoadingStatuses.has(this.statusWV().value())}isFailed(){const e=this.status();return 12===e||4===e||10===e||14===e}isStatusError(){return 12===this.status()}unsupportedResolutionState(){return this._unsupportedResolutionState.readonly()}actualSymbol(){return(0,g.actualSymbol)(this.symbolInfo(),this.symbol())}proSymbol(){return(0, g.proSymbol)(this.symbolInfo(),this.symbol())}onStyleChanged(){return this._onStyleChanged}style(){return this.properties().childs().style.value()}setStyle(e){this.setSymbolParams({style:e})}isRangeBasedStyle(){return(0,g.isRangeBasedStyle)(this.style())}symbolSameAsCurrent(e){return this.symbol()===e||(0,Gt.symbolSameAsCurrent)(e,this.symbolInfo())}symbolSameAsResolved(e){return this._model.isSnapshot()?this.symbolSameAsCurrent(e):this._seriesSource.symbolSameAsResolved(e)}status(){return this._seriesStatus.value()}statusWV(){return this._seriesStatus}compositeStatusVW(){return this._status}symbol(){return this.properties().childs().symbol.value()}symbolChanged(){return this.properties().childs().symbol.listeners()}seriesSource(){return this._seriesSource}symbolInfo(){return this._symbolInfo.value()}symbolResolved(){return this.dataEvents().symbolResolved()}symbolResolvingActive(){return this._symbolResolvingActive}symbolHibernated(){return this._seriesAlwaysFalseHibernatedVW}getSymbolName(){var e,t;return null!==(t=null===(e=this.symbolInfo())||void 0===e?void 0:e.name)&&void 0!==t?t:""}firstValue(){const e=this.firstBar();return null===e?null:this._barFunction(e,0)}firstBar(){const e=this.model().timeScale().visibleBarsStrictRange();if(null===e)return null;const t=e.firstBar(),s=this.data().search(t,m.PlotRowSearchMode.NearestRight);return null!==s?s.value:null}formatter(e=!0){return e?this._formatter:this._ignoreMinMoveFormatter}defaultFormatter(){return this._defaultFormatter}priceStep(e=!0){return e?this._priceStep:this._ignoreMinMovePriceStep}bars(){return this.data().bars()}nsBars(){return this.data().nsBars()}interval(){return this.properties().childs().interval.value()}setInterval(e){this.setSymbolParams({interval:e})}intervalObj(){const e=this.interval();if(null!==this._intervalObj&&this._intervalObj.resolutionString===e)return this._intervalObj.interval;const t=X.Interval.parse(e);return this._intervalObj={resolutionString:e,interval:t},t}prevClose(){const e=this.priceScale();if(e.isEmpty()||this.data().isEmpty())return null;const t=this.quotes(),s=this.firstValue();if(null===t||null===s)return null;const i=t.prev_close_price;return void 0===i?null:{coordinate:e.priceToCoordinate(i,s),floatCoordinate:e.priceToCoordinate(i,s),formattedPricePercentage:e.formatPricePercentage(i,s,{signPositive:!0}),formattedPriceAbsolute:e.formatPriceAbsolute(i),formattedPriceIndexedTo100:e.formatPriceIndexedTo100(i,s)}}priceLineColor(e){return this.properties().childs().priceLineColor.value()||e}hasClosePrice(){return ei||12!==this.properties().childs().style.value()}lastValueData(e,t,s){var i;const r={noData:!0},o=this.priceScale();if(this.model().timeScale().isEmpty()||o.isEmpty()||this.data().isEmpty())return r;const a=this.model().timeScale().visibleBarsStrictRange(),l=this.firstValue();if(null===a||null===l)return r;let n,h;if(t){const e=this.data().bars().last();if(null===e)return r;n=e.value,h=e.index}else{const e=this.data().bars().search(a.lastBar(),m.PlotRowSearchMode.NearestLeft);if(null===e)return r;n=e.value, h=e.index}const d=null!==(i=void 0!==e?n[e]:this._barFunction(n,2))&&void 0!==i?i:NaN,u=this.barColorer().barStyle(h,!1),c=o.priceToCoordinate(d,l),p={...o.getFormattedValues(d,l,!0),noData:!1,color:u.barColor,floatCoordinate:c,coordinate:c,index:h};return s&&(p.price=d),p}isDWM(){return this.intervalObj().isDWM()}isPulse(){var e;const t=this.symbolInfo();return null!==t&&(null!==(e=t.resolutions)&&void 0!==e?e:[]).length>0}data(){var e;return null!==(e=this._data)&&void 0!==e?e:this._seriesSource.data()}clearData(){var e;(0,o.assert)(null===this._data,"Cannot clear loaded data"),null===(e=this._studyBindings)||void 0===e||e.clearData(),this._seriesSource.clearData()}nearestData(e,t){var s;return null!==(s=this.data().search(e,t))&&void 0!==s?s:void 0}nearestIndex(e,t){var s;return null===(s=this.nearestData(e,t))||void 0===s?void 0:s.index}nearestValue(e,t,s){var i;const r=this.nearestData(e,s);return null!==(i=null==r?void 0:r.value[t])&&void 0!==i?i:void 0}onSymbolIntervalChanged(){return this._symbolIntervalChanged}onIntervalChanged(){return this._intervalChanged}onStatusChanged(){return this._onStatusChanged}onRestarted(){return this._onRestarted}fixLastBar(e){if(!this._futureBarsPaneView){const t=this.bars().lastIndex();t&&(this._futureBarsPaneView=new je(this.model().timeScale(),this,t,e))}}requestMoreData(e){var t,s;if(!b.seriesReadyStatuses.has(this._status.value().seriesStatus))return;if(this._model.timeScale().isEmpty())return;const i=this._model.timeScale().visibleBarsStrictRange();if(null===i)return;if(0===this.bars().size())return;const r=i.lastBar()-(0,o.ensureNotNull)(this.data().last()).index;if(this._predictBarse.isVisible())),r=(e,t)=>void 0===e?t:void 0===t?e:Math.max(e,t),o=i.map((i=>i.autoScaleInfo(e,t,{...s,forceOverlayOnly:!0})));this._studyBindings&&o.push(...this._studyBindings.autoScaleInfos(e,t,s));const a=(e,t)=>({range:e.range?t.range?e.range.merge(t.range):e.range:t.range,topPixelMargin:r(e.topPixelMargin,t.topPixelMargin),bottomPixelMargin:r(e.bottomPixelMargin,t.bottomPixelMargin)});l=o.reduce(a,l)}return l}onChartStyleChanged(){var e,t;this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.isInReplay().value()&&!(0,g.isStyleSupportedForReplay)(this.style())&&this._removeReplaySubscriber(),this.restart());const s=this.properties();this._prevChartStyle!==s.childs().style.value()&&(null===(e=this._studyBindings)||void 0===e||e.syncStudy(this.style())),this._prevChartStyle=s.childs().style.value(),this._onStyleChanged.fire(s.childs().style.value()),this.invalidateBarStylesCache(),this._updateLastPriceAnimationActive(),(null===(t=this._styleToRecover)||void 0===t?void 0:t.originalStyle)!==this.style()&&(this._styleToRecover=null),this._updateTimeScaleTimePointWeights()}setChartStyleWithIntervalIfNeeded(e,t){const s=this.interval(),i=null!=t?t:(0,rs.getResolutionByChartStyle)(e,s,this._model.defaultResolutions()),r=X.Interval.isEqual(i,s);this.setSymbolParams({interval:r?void 0:i,style:e})}getInputsProperties(){var e;const t=this._properties.child(`${this.getStyleShortName()}Style`);return null!==(e=null==t?void 0:t.childs().inputs)&&void 0!==e?e:new y.Property}getInputsInfoProperties(){var e,t;const s=null===(e=this._studyBindings)||void 0===e?void 0:e.getInputsInfoProperties();if(s)return s;const i=this._properties.child(`${this.getStyleShortName()}Style`);return null!==(t=null==i?void 0:i.childs().inputInfo)&&void 0!==t?t:new y.Property}getSourceIcon(){return{type:"loadSvg", svgId:`series.${this.style()}`}}purgeSymbolInfo(){this._symbolInfo.setValue(null)}idForAlert(){return(0,ke.getSeriesIdForAlert)(this.getSymbolString(),this.interval())}hasStateForAlert(){return super.hasStateForAlert()&&!(0,g.isEconomicSymbol)(this.symbolInfo())}stateForAlert(){var e;const t=this.idForAlert(),s=Ee.FormattersSerializer.serialize(this._formatter);let r;const o=this.isDWM()?i.Regular:this.sessionIdProxyProperty().value(),a=this.symbolInfo();if(a&&a.subsessions&&a.subsessions.length>1){const t=null===(e=a.subsessions)||void 0===e?void 0:e.find((e=>e.id===o));t&&(r=(0,Ne.translateSessionExtendedDescription)(t.description))}const l=this.properties().childs(),n={id:t,uniqueId:t,type:"MainSeries",proSymbol:this.proSymbol(),actualSymbol:this.actualSymbol(),symbolString:this.getSymbolString(),interval:this.interval(),style:l.style.value(),styleInputs:this.getInputsProperties().state(),sessionId:o,sessionDescription:r,dividendsAdjustment:l.dividendsAdjustment.value(),backAdjustment:l.backAdjustment.value()&&!this.isBackAdjustmentForbiddenProperty().value(),settlementAsClose:l.settlementAsClose.value()&&!this.isSettlementAsCloseForbiddenProperty().value(),boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount,isSpread:this.isSpread(),formatter:s},h=Fe(this);return h&&(n.dangerReason=h),n}styleStudyInfos(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle,volFootprintStyle:this._volFootprintStyle,tpoStyle:this._tpoStyle,svpStyle:this._svpStyle}}dataEvents(){return this._seriesSource.dataEvents()}isSpread(){var e;return"spread"===(null===(e=this.symbolInfo())||void 0===e?void 0:e.type)}isYield(){const e=this.symbolInfo();return null!==e&&(0,Os.isYield)(e)}dividendsAdjustmentProperty(){return this._properties.childs().dividendsAdjustment}sessionIdProxyProperty(){return this._sessionIdProxyProperty}symbolTextSourceProxyProperty(){return this._symbolTextSourceProxyProperty}setTextSourceIsAlwaysTickerRestrictionEnabled(e){this._textSourceIsAlwaysTickerRestrictionEnabled=e,this._recalcSymbolTextSourceProxyProperty()}isDWMProperty(){return this._isDWMProperty}isPrePostMarketPricesAvailableProperty(){return this._isPrePostMarketPricesAvailableProperty}isSettlementAsCloseForbiddenProperty(){return this._isSettlementAsCloseForbiddenProperty}isBackAdjustmentForbiddenProperty(){return this._isBackAdjustmentForbiddenProperty}getStyleShortName(){const e=this.style(),t=b.STYLE_SHORT_NAMES[e];return(0,o.assert)(!!t,`Missed short name for style ${e}`),t}invalidateBarColorerCache(){this._barColorerCache=null,this.invalidateBarStylesCache()}replayExitedDueUnsupportedInterval(){return this._replayExitedDueUnsupportedInterval}replayExitedDueUnavailableForUserInterval(){return this._replayExitedDueUnavailableForUserInterval}onTimeFrameApplied(){return this._onTimeFrameApplied}onInReplayStateChanged(){return this._onInReplayStateChanged}dataWindowView(){return this._dataWindowView}statusView(){ return Ys?this._statusView:null}legendView(){return this._legendView}marketStatusModel(){return this._marketStatusModel}isMainSeries(){return!0}dataUpdatedModeModel(){return this._dataUpdatedModeModel}dataProblemModel(){return this._dataProblemModel}setDefaultTimeframe(e){this._pendingTimeRange=e}loadDataTo(e){const t=this._properties.childs().interval.value();this._onTimeFrameApplied.fire(e),this._seriesSource.modifySeries(this._getResolvingSymbolObject(),(0,rs.getServerInterval)(t),e)}isInReplay(){return this._isInReplay}quotes(){return this.data().isEmpty()?null:this._quotesProvider.quotes()}base(){return this._base}pointValue(){return this._pointValue}barCloseTime(){return this._lastBarCloseTime}priceSource(){let e=null;const t=this._properties.childs();switch(t.style.value()){case 2:e=t.lineStyle.childs().priceSource.value();break;case 18:e=t.tpoStyle.childs().priceSource.value();break;case 14:e=t.lineWithMarkersStyle.childs().priceSource.value();break;case 15:e=t.steplineStyle.childs().priceSource.value();break;case 3:e=t.areaStyle.childs().priceSource.value();break;case 10:e=t.baselineStyle.childs().priceSource.value();break;case 13:e=t.columnStyle.childs().priceSource.value()}return e}updateAllViews(e){var t,s,i,r,o,a,l,n,h,d,u;null===(t=this._paneView)||void 0===t||t.update(e),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),this._averagePaneViews.forEach((t=>t.update(e))),this._highLowAvgPaneViews.forEach((t=>t.update(e))),this._labelPaneViews.forEach((t=>t.update(e))),this._priceAxisViews.forEach((t=>t.update(e))),this._priceLineAxisViews.forEach((t=>t.update(e))),null===(s=this._futureBarsPaneView)||void 0===s||s.update(e),null===(i=this._projectionBarsPaneView)||void 0===i||i.update(e),null===(r=this._waterlineView)||void 0===r||r.update(e),null===(o=this._prevClosePriceLineView)||void 0===o||o.update(e),null===(a=this._priceLineView)||void 0===a||a.update(e),null===(l=this._gotoDateView)||void 0===l||l.update(e),null===(n=this._endOfDataPaneView)||void 0===n||n.update(e),null===(h=this._baseHorizontalLineView)||void 0===h||h.update(e);const c=this._model.activeStrategySource().value();null==c||c.updateAllViews(e),null===(d=this._model.replayStudyStrategy().value())||void 0===d||d.updateAllViews(e),this._lineStyleLastPriceCirclePaneView.update(e),null===(u=this._studyBindings)||void 0===u||u.updateAllViews(e)}styleStudyInfo(e){return this.styleStudyInfos()[e]}barFunction(){return this._barFunction}precomputedBarStyle(e){return this._precomputedBarStyles.get(e)}setPrecomputedBarStyle(e,t){this._precomputedBarStyles.set(e,t)}symbolParams(){return(0,Gt.symbolParams)(this)}compareSymbolParams(e){return(0,Gt.compareSymbolParams)(this,e,this._model.unitConversionEnabled())}setSymbolParams(e){const{symbol:t,currency:s,unit:i,style:r,interval:a}=e,{symbolChanged:l,intervalChanged:n,currencyChanged:h,unitChanged:d,styleChanged:u}=this.compareSymbolParams(e),c=[ri("symbol",t,l),ri("interval",a,n),ri("currency",s,h),ri("unit",i,d),ri("style",r,u)].filter((e=>null!==e)).join("; ") ;ti.logInfo(`Applying series symbol params: ${c}`);const p=this.properties().childs();void 0!==t&&p.symbol.setValue(t),void 0!==s&&p.currencyId.setValue(s),void 0!==i&&p.unitId.setValue(i),n&&p.interval.setValue((0,o.ensureDefined)(a)),void 0!==r&&u&&p.style.setValue(r);let _=!1;u&&(_=this.isNeedRestart(),this.onChartStyleChanged()),!_&&(l||n||h||d)&&this._applySymbolParamsChanges({symbolChanged:l,currencyChanged:h,unitChanged:d,intervalChanged:n,styleChanged:u}),(l||h||d)&&this.model().checkLineToolSelection()}setSymbol(e){this.setSymbolParams({symbol:e})}currency(){return this.properties().childs().currencyId.value()||null}setCurrency(e){this.setSymbolParams({currency:e})}isConvertedToOtherCurrency(){return(0,g.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().childs().unitId.value()||null}setUnit(e){this.setSymbolParams({unit:e})}measureUnitId(){return(0,g.measureUnitId)(this.symbolInfo())}isConvertedToOtherUnit(){return(0,g.isConvertedToOtherUnit)(this.symbolInfo(),this._model.unitConversionEnabled())}valueAt(e,t){var s,i;return null!==(i=null===(s=this.data().search(e))||void 0===s?void 0:s.value[t])&&void 0!==i?i:null}symbolSource(){return this}barsProvider(){return this}title(e){return this.symbolTitle(e)}name(){return this.symbolTitle(js.TitleDisplayTarget.StatusLine)}symbolTitle(e,t,s,i="exchange"){let r=this.properties().childs().symbol.value();const o=this.symbolInfo();if(null!==o){const{type:e}=o;r=(0,g.symbolTitle)(o,t,"forex"===e?"exchange":i)}return s?r:`${r}, ${(0,L.translatedIntervalString)(this.properties().childs().interval.value())}`}setObsoleteZOrder(e){this._obsoleteZOrder=e}obsoleteZOrder(){return this._obsoleteZOrder}legendValuesProvider(){var e,t;return null!==(t=null===(e=this._studyBindings)||void 0===e?void 0:e.legendValuesProvider())&&void 0!==t?t:this._legendValuesProvider}dataWindowValuesProvider(){var e,t;return null!==(t=null===(e=this._studyBindings)||void 0===e?void 0:e.dataWindowValuesProvider())&&void 0!==t?t:this._dataWindowValuesProvider}statusProvider(e){return new R(this,this.properties().childs().statusViewStyle,e)}moveItem(e,t,s){if(10===this.style()&&0===t){const t=this.priceScale(),s=this.properties().childs().baselineStyle,i=t.height(),r=100-e.y/i*100,o=r<0?0:Math.round(10*r)/10;s.childs().baseLevelPercentage.setValue(Math.max(Math.min(o,100),0))}}rerequestData(){this._applySymbolParamsChanges({force:!0})}switchToReplay(e,t){this._replaySubscriber.setValue(e),this._isReplayResolutionAvailableForUser=t,this._onInReplayStateChanged.fire(),e.modifySeries(this.getSymbolString(),this._properties.childs().interval.value()),this.rerequestData()}switchToRealtime(){this.isInReplay().value()&&(this._removeReplaySubscriber(),this.rerequestData())}async canChangeResolution(e){{if(!this.isInReplay().value())return!0;const t=await(0,o.ensureNotNull)(this._replaySubscriber.value()).canChangeResolution(this.getSymbolString(),e);return t||this._replayExitedDueUnsupportedInterval.fire(),t}}requestMoreDataAvailable(){return this._requestMoreDataAvailable} seriesLoaded(){return this._seriesLoaded}endOfData(){var e;return void 0!==(null===(e=this._lastCompleteFlags)||void 0===e?void 0:e.data_completed)}endOfDataType(){var e,t;return null!==(t=null===(e=this._lastCompleteFlags)||void 0===e?void 0:e.data_completed)&&void 0!==t?t:null}dataPoweredBy(){return this._dataPoweredBy}boxSizeValue(){return this._boxSizeValue}isUserDeletable(){return!1}changeTimeFrame(){(0,l.trackEvent)("GUI","Change timeframe")}onTagsChanged(){return this._tagsChanged}state(e){var t,s;const i=this.obsoleteZOrder();let r={type:"MainSeries",id:this.id(),zorder:i,haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle,volFootprintStyle:this._volFootprintStyle,tpoStyle:this._tpoStyle,svpStyle:this._svpStyle,formattingDeps:this._formattingDeps,studyBindings:null===(t=this._studyBindings)||void 0===t?void 0:t.state(!!e)};const o=this.properties().state();if(o.symbol=(0,g.symbolToSaveInState)(null!==(s=this.symbolInfo())&&void 0!==s?s:this._model.chartApi().lastSymbolResolveInfo(o.symbol),o.symbol),this._model.unitConversionEnabled()||(o.unitId=null),r.state=o,e){let e=this.bars();const t=this._model.timeScale().visibleExtendedDataRange(e,0);null!==t&&(e=e.range(t.firstBar(),t.lastBar())),r={...r,bars:oi(e),nsBars:oi(this.nsBars()),symbolInfo:this.symbolInfo(),rtPrice:this.data().lastProjectionPrice,boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount}}return r}restoreState(e,t){var s,i,r;t&&this._setStatus(5),!this._model.unitConversionEnabled()&&e.state&&delete e.state.unitId,e.state&&X.Interval.isRange(e.state.interval)&&(e.state.style=11);const o=e.state;if(void 0!==o){const e=o.style,t=ze.chartStylePermissions.get(e);t&&!this._model.isSnapshot()&&(o.style=2,(0,He.runOrGoProWithoutSync)((()=>{o.style=e}),t.feature,{feature:t.featureName}))}if(this._properties.mergeAndFire(e.state),this._properties.hasChild("esdBreaksStyle")&&this._properties.removeProperty("esdBreaksStyle"),this._prevChartStyle=this.properties().childs().style.value(),this.createPaneView(),t){const t=e;this.restoreData(t.bars,t.nsBars,t.symbolInfo,t.rtPrice,t.boxSize,t.reversalAmount)}e.formattingDeps&&(this._formattingDeps=e.formattingDeps,this._recreatePriceFormattingDependencies()),null===(s=this._studyBindings)||void 0===s||s.restoreState(null!==(i=e.studyBindings)&&void 0!==i?i:{},t),null===(r=this._studyBindings)||void 0===r||r.syncStudy(this.style())}restoreData(e,t,s,i,r,o){this._updateStatus({seriesStatus:5}),this._data=new p.SeriesData,this._data.bars().restoreState(e),this._data.nsBars().restoreState(t),this._updateSymbolInfo(s),this._data.lastProjectionPrice=i,this._data.boxSize=r;const a=this.properties().childs();r||(6===a.style.value()?this._data.boxSize=a.pnfStyle.childs().inputs.childs().boxSize.value():4===a.style.value()&&(this._data.boxSize=a.renkoStyle.childs().inputs.childs().boxSize.value())),this._data.reversalAmount=o, o||5===a.style.value()&&(this._data.reversalAmount=a.kagiStyle.childs().inputs.childs().reversalAmount.value())}async setGotoDateResult(e,t){this._gotoDateResultCleared=!1;const i=await s.e(4079).then(s.bind(s,228579));this._gotoDateResultCleared||(this._gotoDateView=new i.GotoDateView(this,e,t),this._gotoDateView.doNotShowLastAvailableBar(this._doNotShowLastAvailableBar),this._model.updateSource(this))}clearGotoDateResult(){this._gotoDateView=null,this._gotoDateResultCleared=!0}doNotShowLastAvailableBar(e){var t;this._doNotShowLastAvailableBar=e,null===(t=this._gotoDateView)||void 0===t||t.doNotShowLastAvailableBar(e)}dataUpdated(){return this.dataEvents().dataUpdated()}moveData(e){var t;this._seriesSource.moveData(e),null!==this._volumePointWeights&&this._volumePointWeights.moveData(e),null===(t=this._studyBindings)||void 0===t||t.moveData(e)}async seriesCreated(){const e=this._seriesSource.instanceId();if(null!==e)return e;const t=await Promise.race([this._deferredDestroyed.promise.then((()=>{})),this._model.isSnapshot()?Promise.resolve(null):new Promise((e=>{this.dataEvents().created().subscribe(this,e,!0)}))]);if(void 0===t)throw new Error("Series has been destroyed");return t}_updateBarFunction(){this._barFunction=(0,Ls.barFunctionByStyle)(this.style(),this.priceSource())}_setProperties(e){e.hasChild("timeframe")||e.merge({timeframe:""}),e.hasChild("shortName")||e.merge({shortName:""}),e.hasChild("currencyId")||e.addChild("currencyId",new y.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new y.Property(null)),this._properties=e;const t=e.childs();t.currencyId.subscribe(this,this._onCurrencyChanged),t.unitId.subscribe(this,this._onUnitChanged),t.timeframe.subscribe(this,this.changeTimeFrame),e.subscribe(this,this._onPropertiesChanged)}_updateSessionIdProxyProperty(e){const t=this._properties.childs().sessionId.value();let s=t;if(e){const e=this.symbolInfo();null!==e&&(s=e.subsession_id||t)}this._ignoreSessionIdProxyPropertyChanges=!0,this._sessionIdProxyProperty.setValue(s),this._ignoreSessionIdProxyPropertyChanges=!1}_onSessionIdProxyPropertyChanged(){this._ignoreSessionIdProxyPropertyChanges||this._properties.childs().sessionId.setValue(this._sessionIdProxyProperty.value()),this._updateLastPriceAnimationActive()}_onSymbolResolved(e){this._seriesErrorMessage=null,this._updateSymbolInfo(e),this._model.updateSource(this),this._model.onWidget()||((0,l.trackEvent)("Symbol",e.listed_exchange,e.name),(0,l.trackEvent)("Symbol Type",e.type,e.listed_exchange));const t=e.minmov/e.pricescale,s=this.properties().childs();4===s.style.value()&&s.renkoStyle.childs().inputs.childs().boxSize.value(){e[t]=s[t].toString()})),t=t.format(e)}Js&&ti.logNormal("Error reason: "+t),this._seriesErrorMessage=t;const i=Ks&&this.symbolInfo()?10:4;this._setStatus(i),this._seriesLoaded=!0,this._sendTelemetryCounter("series_error",this._getTelemetryAdditionalData(t)),this._enablePriceRangeReady()}_onSeriesLoading(e){this._setStatus(2)}_onDataUpdated(e,t,s,i){var r;const a=this.symbolInfo();if(i&&a){let e=0,t=0;if((0,g.hasVolume)(a))for(const s of this.bars().fullRangeIterator()){const i=s.value[5];0!==i&&(e+=i,t+=1)}this._volumePointWeights=t>0?new _t(e/t):null,this._updateTimeScaleTimePointWeights()}if(null!==this._volumePointWeights){const e=t?this.bars().fullRangeIterator():s?this.bars().rangeIterator(s.index,(0,o.ensureNotNull)(this.bars().lastIndex())):null;if(null!==e)for(const t of e)this._volumePointWeights.setVolume(t.index,t.value[5])}t?this._requestMoreDataAvailable=!0:this._lastPriceAnimationActive&&this._seriesLoaded&&this._lineStyleLastPriceCirclePaneView.update((0,Ve.sourceChangeEvent)(this.id())),this._lastBarCloseTime=e&&e.closeTime||null,this._boxSizeValue.setValue(this.data().boxSize),this._statusView.update(),this.clearAveragePriceCache(),this.clearHighLowPriceCache();const l=this.model(),n=(0,o.ensureNotNull)(l.paneForSource(this));l.recalculatePane(n,(0,Ve.sourceChangeEvent)({sourceId:this.id(),realtime:!t,firstUpdatedTimePointIndex:null!==(r=null==s?void 0:s.index)&&void 0!==r?r:void 0})),l.updateSource(this)}_setStatus(e){const t={...this._status.value(),seriesStatus:e};this._updateStatus(t),this._statusView.update(),this.model().updateSource(this),this._onStatusChanged.fire()}_onBarReceived(e){this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.DataUpdate)} _onUnsupportedResolutionRequested(){const e=(0,o.ensureNotNull)(this._getStateForUnsupportedResolution());this._seriesErrorMessage=e.reason,this._unsupportedResolutionState.setValue(e),this._setStatus(14),this._seriesLoaded=!0,this._seriesSource.clearData(),this._model.timeScale().points().clear(),this._enablePriceRangeReady()}_getStateForUnsupportedResolution(){const e=this.symbolInfo();if(null===e)return null;const t=this.interval(),s=(0,V.getResolutionUnsupportedReason)(e,t);if(null===s)return null;const i=e.name;if("less_than_frequency"!==s)return{ticker:i,reason:s,unsupportedResolution:t,applicableResolution:"D"};{const r=(0,o.ensureDefined)(e.data_frequency);let a=(0,rs.getApplicableIntervalForFrequency)(r,t);const l=this._model.defaultResolutions();if(!(l.includes(a)||window.is_authenticated&&window.user.is_pro)){const e=l.find((e=>(0,rs.compareResolutions)(e,a)>=0));a=null!=e?e:l[l.length-1]}return{ticker:i,reason:s,applicableResolution:a,unsupportedResolution:t}}}_recreateFormatter(){var e,t,s;this._defaultFormatter=(0,g.createSeriesFormatter)(null!==(e=this.symbolInfo())&&void 0!==e?e:this._formattingDeps,"default"),this._formatter=(0,g.createSeriesFormatter)(null!==(t=this.symbolInfo())&&void 0!==t?t:this._formattingDeps,this.properties().childs().minTick.value()),this._ignoreMinMoveFormatter=(0,g.createSeriesFormatter)(this.symbolInfo(),this.properties().childs().minTick.value(),!0),null===(s=this._priceScale)||void 0===s||s.updateFormatter(),this._formatterChanged.fire()}_recreatePriceStep(){const{minMove:e,priceScale:t}=(0,g.getSeriesPriceFormattingState)(this.symbolInfo()),s=e/t;this._ignoreMinMovePriceStep=1/t,this._priceStep!==s&&(this._priceStep=s,this._priceStepChanged.fire())}_recreatePriceFormattingDependencies(){this._recreateFormatter(),this._recreatePriceStep()}_onQuotesUpdate(e,t){if(Qs){const e=void 0!==t.values.change||void 0!==t.values.change_percent;e&&this._legendView.update();const s=void 0!==t.values.prev_close_price;s&&((0,o.ensureNotNull)(this._prevClosePriceLineView).update((0,Ve.sourceChangeEvent)(this.id())),(0,o.ensureNotNull)(this._prevClosePriceAxisView).update((0,Ve.sourceChangeEvent)(this.id()))),(e||s)&&this.model().updateSource(this)}void 0!==e.values.current_session&&e.values.current_session!==this._currentSession&&(this._currentSession=e.values.current_session,this._updateLastPriceAnimationActive())}_updateIsPrePostMarketPricesForbiddenProperty(){const e=(0,g.symbolHasPreOrPostMarket)(this.symbolInfo())&&(this.isDWM()||(0,g.isRegularSessionId)(this.sessionIdProxyProperty().value()));this._isPrePostMarketPricesAvailableProperty.setValue(e)}_updateSettlementAsCloseForbiddenProperty(){var e;const t=this.isDWM()&&Boolean(null===(e=this.symbolInfo())||void 0===e?void 0:e.has_settlement);this._isSettlementAsCloseForbiddenProperty.setValue(!t)}_updateBackAdjustmentForbiddenProperty(){var e;const t=Boolean(null===(e=this.symbolInfo())||void 0===e?void 0:e.has_backadjustment);this._isBackAdjustmentForbiddenProperty.setValue(!t)}_removeReplaySubscriber(){{ if(!this.isInReplay().value())return;const e=this._replaySubscriber.value();this._replaySubscriber.setValue(null),this._isReplayResolutionAvailableForUser=null,this._onInReplayStateChanged.fire(),null==e||e.destroy()}}_getSymbolForApi(){return this.symbol()}_getSymbolObject(e){const t=this._getExtendedSymbolObject(e),s=this.properties().childs().style.value();if(b.SYMBOL_STRING_DATA.hasOwnProperty(s)&&!b.chartStylesWithAttachedStudies.includes(s)){return{symbol:t,type:this.styleStudyInfo(this.getStyleShortName()+"Style").studyId+"!",inputs:this.getInputsProperties().state()}}return t}_getExtendedSymbolObject(e){const t={symbol:null!=e?e:this._getSymbolForApi()},s=this.properties().childs();null!==this.currency()&&(t["currency-id"]=this.currency());const i=this.unit();return this._model.unitConversionEnabled()&&null!==i&&(t["unit-id"]=i),this.isDWM()||(t.session=s.sessionId.value()),t.adjustment=s.dividendsAdjustment.value()?"dividends":"splits",s.backAdjustment.value()&&(t.backadjustment="default"),s.settlementAsClose.value()||(t["settlement-as-close"]=!1),t}_checkChartStyle(){const e=this.style();(0,g.isCloseBasedSymbol)(this.symbolInfo())?(0,g.isSingleValueBasedStyle)(e)||(this.requestingStyleIsNotSupported.fire(),this._styleToRecover={correctedStyle:this.style(),originalStyle:e}):null!==this._styleToRecover&&(this.requestingStyleSupportRecovered.fire(this._styleToRecover.originalStyle),this._styleToRecover=null)}_updateSymbolInfo(e){if(this._symbolInfo.setValue(e),e){const t=this._properties.childs();t.shortName.setValue(e.name);const s=(0,g.extractSymbolNameFromSymbolInfo)(e,this.symbol());s&&t.symbol.setValue(s);const i=(0,g.symbolCurrency)(e),r=(0,g.symbolUnit)(e,this._model.unitConversionEnabled());"alwaysOff"===(0,$.currencyUnitVisibilityProperty)().value()||i===t.currencyId.value()&&r===t.unitId.value()||this._model.fullUpdate(),t.currencyId.setValue(i),t.unitId.setValue(r),this._updateSessionIdProxyProperty(!0)}this._base=e?e.pricescale/e.minmov:100,this._pointValue=e&&e.pointvalue||1;const t=(0,$t.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getExtendedSymbolObject());this._quotesProvider.setQuotesSessionSymbol(t),this._marketStatusModel.setSymbolInfo(e),e&&this._recreatePriceFormattingDependencies(),this._statusView.update(),this.priceScale().updateFormatter(),this._symbolResolvingActive.setValue(!e),this._updateIsPrePostMarketPricesForbiddenProperty(),this._dataPoweredBy=(0,Ae.getDataVendorString)(e),this._updateBackAdjustmentForbiddenProperty(),this._updateSettlementAsCloseForbiddenProperty()}_createHighLowAvgViews(){const e=this.properties().childs().highLowAvgPrice,t=this._getHighLowPrice.bind(this),s=function(e,t,s,i){const r=s.childs(),o=jt(e,t,{label:Ot,labelVisible:r.highLowPriceLabelsVisible,lineVisible:r.highLowPriceLinesVisible,lineColor:r.highLowPriceLinesColor,lineWidth:r.highLowPriceLinesWidth},(()=>i(0))),a=jt(e,t,{label:Ut,labelVisible:r.highLowPriceLabelsVisible,lineVisible:r.highLowPriceLinesVisible,lineColor:r.highLowPriceLinesColor,lineWidth:r.highLowPriceLinesWidth},(()=>i(1))) ;return{paneViews:[o.paneView,a.paneView],panePriceAxisViews:[o.panePriceAxisView,a.panePriceAxisView],priceAxisViews:[o.priceAxisView,a.priceAxisView],priceLineAxisViews:[o.priceLineAxisView,a.priceLineAxisView]}}(this._model,this,e,t);this._highLowAvgPaneViews.push(...s.paneViews),this._labelPaneViews.push(...s.panePriceAxisViews),this._priceAxisViews.push(...s.priceAxisViews),this._priceLineAxisViews.push(...s.priceLineAxisViews)}_createAverageViews(){}_getHighLowPrice(e){if(!this._highLowPriceCache.has(e)){const e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return null;const t=function(e,t,s){return e.minMaxOnRangeCached(t,s,[{name:"low",offset:0},{name:"high",offset:0}])}(this._model.mainSeries().bars(),e.firstBar(),e.lastBar());if(null===t)return null;this._highLowPriceCache.set(1,t.min),this._highLowPriceCache.set(0,t.max)}return this._highLowPriceCache.get(e)}_getAveragePrice(e){return null}_onSeriesCompleted(e){var t;if(14===this._status.value().seriesStatus)return;this._sendTelemetryCounter("series_loaded",this._getTelemetryAdditionalData()),this._seriesErrorMessage=null;let i=e.updateMode;switch("pulsed"===i&&(i="delayed"),i){case"streaming":this._setStatus(3);break;case"endofday":this._setStatus(6);break;case"delayed":this._setStatus(8);break;case"replay":this._setStatus(11)}i.match(/delayed_streaming/)&&this._setStatus(9),this._lastCompleteFlags=null!==(t=e.flags)&&void 0!==t?t:null;const r=(0,o.ensureNotNull)(this._model.paneForSource(this));r.recalculatePriceScale(this.priceScale(),(0,Ve.sourceChangeEvent)(this.id()));const a=es.InvalidationMask.full();if(null!==this._model.appliedTimeFrame().value()&&a.lockVisibleTimeRangeOnResize(),this._model.invalidate(a),!this.priceScale().isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale().correctOffset(),this.model().timeScale().correctBarSpacing(),this.model().resetPriceScale(r,this.priceScale())),this._seriesLoaded=!0,this._seriesCompleted=!0,this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesCompleted),this.model().recalcStudyBasedLineTools(),!si){si=!0;(0,s(975420).trackTiming)("Chart","Time to series",window.performance.now())}this.requestMoreData(),this._enablePriceRangeReady()}_notifyIntervalChanged(e){var t,s;const i={timeframe:null!==(t=this._pendingTimeRange)&&void 0!==t?t:void 0};this._intervalChanged.fire(e,i),this._pendingTimeRange=null!==(s=i.timeframe)&&void 0!==s?s:null}_onCurrencyChanged(){this._currencyChanged.fire()}_onUnitChanged(){this._unitChanged.fire()}async _applySymbolParamsChanges(e){this._lastCompleteFlags=null,this.clearGotoDateResult();const t=this.interval(),s=this.currency(),i=this.unit(),r=X.Interval.isRange(t);r&&this._properties.childs().rangeStyle.childs().inputs.childs().range.setValue(X.Interval.parse(t).multiplier());const{symbolChanged:a,intervalChanged:l,currencyChanged:n,unitChanged:h,force:d}=e,u=l&&X.Interval.parse(t).isDWM()!=X.Interval.parse(t).isDWM();if((null!==s&&n||null!==i&&h)&&this.isInReplay().value()){ const e=this.symbolInfo();(null===e||null!==s&&e.original_currency_id!==s||null!==i&&e.original_unit_id!==i)&&this._removeReplaySubscriber()}if(this._syncModel=null,this._prevRequestedInterval=t,5!==this._status.value().seriesStatus&&(!this._seriesSource.isStarted()||a||n||h||u)&&this._updateSymbolInfo(null),this.isInReplay().value()){const e=()=>this._removeReplaySubscriber();a?e():l&&(r||X.Interval.isTicks(t)?e():(0,o.ensureNotNull)(this._isReplayResolutionAvailableForUser)(t)?await this.canChangeResolution(t)||(e(),this._replayExitedDueUnsupportedInterval.fire()):(e(),this._replayExitedDueUnavailableForUserInterval.fire()))}if(5===this._status.value().seriesStatus)return void this._model.realignLineTools();this._setStatus(1),this._updateIsPrePostMarketPricesForbiddenProperty(),this._updateBackAdjustmentForbiddenProperty(),this._updateSettlementAsCloseForbiddenProperty(),this._symbolIntervalChanged.fire(),l&&this._notifyIntervalChanged(t),this._onRestarted.fire(),this._seriesLoaded=!1,this._seriesCompleted=!1,this._lineStyleLastPriceCirclePaneView.stopAnimation();let p=null;this._pendingTimeRange&&(p=this._pendingTimeRange,this._pendingTimeRange=null),this._onTimeFrameApplied.fire(p),this._onBeforeModifySeries(this.getSymbolString(),t);const _=this._shouldDefineNumberOfBarsForModifySeries(e)&&this._visibleBarsCount()||null;this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesRestart),this._data=null,this._seriesSource.modifySeries(this._getResolvingSymbolObject(),(0,rs.getServerInterval)(t),p,d,_),this._seriesSource.isStarted()||(this._predictBars=0,this._seriesSource.start()),(a||n||h)&&this.disablePriceRangeReady(),this.updateAllViews((0,Ve.sourceChangeEvent)(this.id())),this._model.lightUpdate()}_onBeforeModifySeries(e,t){const s=this._replaySubscriber.value();null==s||s.modifySeries(e,t)}_getResolvingSymbolObject(){let e=this._getSymbolObject(this._symbolForResolve());const t=this._replaySubscriber.value();return t&&(e=t.generateReplaySymbol(e)),e}_onSessionIdPropertyChanged(){this._sessionIdChanged.fire(),this.isDWM()||(this.restart(),this._updateLastPriceAnimationActive())}_subscribeRestartToSessionIdChange(){this.properties().childs().sessionId.subscribe(this,this._onSessionIdPropertyChangedBound)}_unsubscribeRestartToSessionIdChange(){this.properties().childs().sessionId.unsubscribe(this,this._onSessionIdPropertyChangedBound)}_updateLastPriceAnimationActive(){if(!this._options.lastPriceAnimationEnabled||P.enabled("disable_pulse_animation"))return;const e=this._lastPriceAnimationActive,t=this.properties().childs(),s=t.style.value(),i=3===s||10===s||2===s||14===s||15===s;if(!this._model.isSnapshot()&&t.visible.value()&&i){const e=this.currentSession(),t=!(0,g.isRegularSessionId)(this.sessionIdProxyProperty().value())&&!this.isDWM();this._lastPriceAnimationActive="market"===e||t&&("pre_market"===e||"post_market"===e)}else this._lastPriceAnimationActive=!1;this._lastPriceAnimationActive&&e!==this._lastPriceAnimationActive&&this.model().invalidate(es.InvalidationMask.cursor())} _onPropertiesChanged(e){const t=this._properties.childs();e!==t.symbol&&e!==t.interval&&e!==t.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews((0,Ve.sourceChangeEvent)(this._id)),this.model().updateSource(this),(0,n.emit)("series_properties_changed",this._id))}_recalcSymbolTextSourceProxyProperty(){this._textSourceIsAlwaysTickerRestrictionEnabled?this._symbolTextSourceProxyProperty.setValue("ticker"):this._symbolTextSourceProxyProperty.setValue(this._properties.childs().statusViewStyle.childs().symbolTextSource.value())}_clearStylePlot(e,t){if(0===e.size())return;if(void 0===t&&e!==this.nsBars())return void(this._precomputedBarStyles=new WeakMap);const s=null!=t?t:(0,o.ensureNotNull)(e.firstIndex()),i=(0,o.ensureNotNull)(e.lastIndex())+1;e.range(s,i).each(((e,t)=>(this._precomputedBarStyles.delete(t),!1)))}_visibleBarsCount(){const e=this._model.timeScale().visibleBarsStrictRange();return null==e?void 0:e.count()}_symbolForResolve(){var e;const t=this.symbol();return this._seriesSource.symbolSameAsResolved(t)&&null!==(e=this._seriesSource.resolvedSymbol())&&void 0!==e?e:t}_shouldDefineNumberOfBarsForModifySeries(e){return!1}_onShowCountdownChanged(e){e.value()?this._countdownUpdateTimer=this._model.setInterval((()=>{var e,t;return null===(t=(e=this._priceAxisView).updateCountdown)||void 0===t?void 0:t.call(e)}),500):null!==this._countdownUpdateTimer&&(this._model.clearInterval(this._countdownUpdateTimer),this._countdownUpdateTimer=null)}_onFormatterPropsChanged(){this._recreateFormatter(),this._model.fullUpdate()}_updateStatus(e){14!==e.seriesStatus&&this._unsupportedResolutionState.setValue(null),this._status.setValue(e)}_wasCompletedBefore(){var e,t;return this.isCompleted()&&(null===(t=null===(e=this._studyBindings)||void 0===e?void 0:e.wasCompletedBefore())||void 0===t||t)}}},100161:(e,t,s)=>{"use strict";s.d(t,{chartStylePermissions:()=>i});const i=new Map([[18,{feature:"TPO_PERIODIC",featureName:"TPOChartStyle"}],[17,{feature:"VOLUME_FOOTPRINT",featureName:"volumeFootprint"}],[19,{feature:"VOLUME_CANDLES",featureName:"volumeCandles"}]])},442410:(e,t,s)=>{"use strict";s.d(t,{SeriesDataEvents:()=>r});var i=s(707957);class r{constructor(){this._created=new i.Delegate,this._modified=new i.Delegate,this._loading=new i.Delegate,this._completed=new i.Delegate,this._error=new i.Delegate,this._symbolError=new i.Delegate,this._symbolResolved=new i.Delegate,this._seriesError=new i.Delegate,this._symbolNotPermitted=new i.Delegate,this._symbolInvalid=new i.Delegate,this._symbolGroupNotPermitted=new i.Delegate,this._chartTypeNotPermitted=new i.Delegate,this._intradaySpreadNotPermitted=new i.Delegate,this._intradayExchangeNotPermitted=new i.Delegate,this._customIntervalNotPermitted=new i.Delegate,this._secondsIntervalNotPermitted=new i.Delegate,this._ticksIntervalNotPermitted=new i.Delegate,this._tickMarksRangeChanged=new i.Delegate,this._barReceived=new i.Delegate,this._seriesTimeFrame=new i.Delegate,this._dataUpdated=new i.Delegate,this._unsupportedResolutionRequested=new i.Delegate}destroy(){ this._created.destroy(),this._modified.destroy(),this._loading.destroy(),this._completed.destroy(),this._error.destroy(),this._symbolError.destroy(),this._symbolResolved.destroy(),this._seriesError.destroy(),this._symbolInvalid.destroy(),this._symbolNotPermitted.destroy(),this._symbolGroupNotPermitted.destroy(),this._chartTypeNotPermitted.destroy(),this._intradaySpreadNotPermitted.destroy(),this._intradayExchangeNotPermitted.destroy(),this._customIntervalNotPermitted.destroy(),this._secondsIntervalNotPermitted.destroy(),this._ticksIntervalNotPermitted.destroy(),this._tickMarksRangeChanged.destroy(),this._barReceived.destroy(),this._seriesTimeFrame.destroy(),this._dataUpdated.destroy(),this._unsupportedResolutionRequested.destroy()}created(){return this._created}modified(){return this._modified}loading(){return this._loading}completed(){return this._completed}error(){return this._error}symbolError(){return this._symbolError}symbolResolved(){return this._symbolResolved}seriesError(){return this._seriesError}symbolInvalid(){return this._symbolInvalid}symbolNotPermitted(){return this._symbolNotPermitted}symbolGroupNotPermitted(){return this._symbolGroupNotPermitted}chartTypeNotPermitted(){return this._chartTypeNotPermitted}intradaySpreadNotPermitted(){return this._intradaySpreadNotPermitted}intradayExchangeNotPermitted(){return this._intradayExchangeNotPermitted}customIntervalNotPermitted(){return this._customIntervalNotPermitted}secondsIntervalNotPermitted(){return this._secondsIntervalNotPermitted}ticksIntervalNotPermitted(){return this._ticksIntervalNotPermitted}tickMarksRangeChanged(){return this._tickMarksRangeChanged}barReceived(){return this._barReceived}seriesTimeFrame(){return this._seriesTimeFrame}dataUpdated(){return this._dataUpdated}unsupportedResolutionRequested(){return this._unsupportedResolutionRequested}fireCompleted(e){this._completed.fire(e)}fireCreated(e){this._created.fire(e)}fireModified(){this._modified.fire()}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()}fireSymbolInvalid(){this._symbolInvalid.fire()}fireSymbolNotPermitted(e){this._symbolNotPermitted.fire(e)}fireSymbolGroupNotPermitted(e){this._symbolGroupNotPermitted.fire(e)}fireChartTypeNotPermitted(e){this._chartTypeNotPermitted.fire(e),this.fireError()}fireIntradaySpreadNotPermitted(){this._intradaySpreadNotPermitted.fire(),this.fireError()}fireIntradayExchangeNotPermitted(){this._intradayExchangeNotPermitted.fire(),this.fireError()}fireCustomIntervalNotPermitted(e){this._customIntervalNotPermitted.fire(e),this.fireError()}fireSecondsIntervalNotPermitted(){this._secondsIntervalNotPermitted.fire(),this.fireError()}fireTicksIntervalNotPermitted(){this._ticksIntervalNotPermitted.fire(),this.fireError()}fireTickMarksRangeChanged(e){this._tickMarksRangeChanged.fire(e)}fireBarReceived(e){this._barReceived.fire(e)}fireSeriesTimeFrame(e,t,s,i,r){ this._seriesTimeFrame.fire(e,t,s,i,r)}fireDataUpdated(e,t,s,i){this._dataUpdated.fire(e,t,s,i)}fireUnsupportedResolutionRequested(){this._unsupportedResolutionRequested.fire()}}},628544:(e,t,s)=>{"use strict";s.d(t,{getErrorFromUnsupportedResolutionState:()=>h,getResolutionUnsupportedReason:()=>d});var i=s(444372),r=s(223699),o=s(276871);const a=i.t(null,void 0,s(67581)),l=i.t(null,void 0,s(263100)),n=i.t(null,void 0,s(202260));function h(e,t=!1){const s=t?`${e.ticker}`:e.ticker;switch(e.reason){case"unsupported_intraday":{const e=t?"D, W, M":"D, W, M";return a.format({ticker:s,availableResolutions:e})}case"unsupported_ticks":return l.format({ticker:s});case"less_than_frequency":{const i=t?`${e.applicableResolution}`:e.applicableResolution;return n.format({ticker:s,resolution:i})}}}function d(e,t){if(null===e)return null;const s=e.data_frequency;if(void 0!==s){if((0,o.getApplicableIntervalForFrequency)(s,t)!==t)return"less_than_frequency"}return r.Interval.isIntraday(t)&&!e.has_intraday?"unsupported_intraday":r.Interval.isTicks(t)&&!e["is-tickbars-available"]?"unsupported_ticks":null}},881861:(e,t,s)=>{"use strict";s.d(t,{prepareStudyPropertiesState:()=>d,svpStylePreferencesDefault:()=>h});var i=s(242907),r=s(488530),o=s(379048),a=s(396372);const l={profilesSessions:"All",customSession:"0930-1600",customSessionTZ:"Exchange",volume:a.HHistVolumeMode.UpDown,vaVolume:70,extendPocRight:!1,extendVAHRight:!1,extendVALRight:!1,rowsLayout:"Number Of Rows",rows:24},n=Object.keys(l),h={...r.lineStyleDefault,inputs:l,volumeProfile:{visible:!0,valuesColor:"",showValues:!0,volumeColorUp:"",volumeColorDown:"",valueAreaColorUp:"",valueAreaColorDown:"",histogramBoxColor:"",placement:a.HHistDirection.LeftToRight,percentWidth:100},vah:{visible:!1,color:"",linestyle:o.LineStyle.Dashed,linewidth:2},val:{visible:!1,color:"",linestyle:o.LineStyle.Dashed,linewidth:2},poc:{visible:!1,color:"",linestyle:o.LineStyle.Solid,linewidth:2},developingPoc:{visible:!1,color:"",linestyle:o.LineStyle.Solid,linewidth:1},developingVA:{visible:!1,color:"",linestyle:o.LineStyle.Solid,linewidth:1}};function d(e){return{inputs:(0,i.pickFields)(e.inputs,n),styles:{developingPoc:{color:e.developingPoc.color,display:e.developingPoc.visible?15:0,linestyle:e.developingPoc.linestyle,linewidth:e.developingPoc.linewidth},developingVAHigh:{color:e.developingVA.color,display:e.developingVA.visible?15:0,linestyle:e.developingVA.linestyle,linewidth:e.developingVA.linewidth},developingVALow:{color:e.developingVA.color,display:e.developingVA.visible?15:0,linestyle:e.developingVA.linestyle,linewidth:e.developingVA.linewidth}},graphics:{hhists:{histBars2:{colors:[e.volumeProfile.volumeColorUp,e.volumeProfile.volumeColorDown],direction:e.volumeProfile.placement,percentWidth:e.volumeProfile.percentWidth,showValues:e.volumeProfile.showValues,valuesColor:e.volumeProfile.valuesColor,visible:e.volumeProfile.visible},histBarsVA:{colors:[e.volumeProfile.valueAreaColorUp,e.volumeProfile.valueAreaColorDown],direction:e.volumeProfile.placement, percentWidth:e.volumeProfile.percentWidth,showValues:e.volumeProfile.showValues,valuesColor:e.volumeProfile.valuesColor,visible:e.volumeProfile.visible}},horizlines:{pocLines:{color:e.poc.color,style:e.poc.linestyle,visible:e.poc.visible,width:e.poc.linewidth},vahLines:{color:e.vah.color,style:e.vah.linestyle,visible:e.vah.visible,width:e.vah.linewidth},valLines:{color:e.val.color,style:e.val.linestyle,visible:e.val.visible,width:e.val.linewidth}},polygons:{histBoxBg:{color:e.volumeProfile.histogramBoxColor}}}}}},70843:(e,t,s)=>{"use strict";s.d(t,{prepareStudyPropertiesState:()=>l,tpoStylePreferencesDefault:()=>a});var i=s(488530),r=s(379048),o=s(396372);const a={...i.lineStyleDefault,styles:{splitByBlocks:!1},inputs:{period:"Day",periodsNum:1,rowSize:"Auto",ticksPerRow:100,vaPercent:70,blockSize:"30m",mergePoints:"",extendPoorHigh:!1,extendPoorLow:!1,extendPOC:!1,extendSingleprints:!1},tpo:{colors:{gradientColors:["","","",""]},showBlocks:!0,showLetters:!0,nonVaOpacity:30},levels:{showPOC:!0,pocColor:"",showPoorHigh:!1,poorHighColor:"",showPoorLow:!1,poorLowColor:"",showSingleprints:!1,singleprintsColor:"",showVAH:!0,vahColor:"",showVAL:!0,valColor:"",showMidpoint:!0,showOpenPrice:!1,showClosePrice:!1,initialBalanceRange:{levels:2,visible:!0}},volumeProfile:{visible:!0,valuesColor:"",showValues:!0,vah:{visible:!1,color:"",linestyle:r.LineStyle.Dashed,linewidth:2},val:{visible:!1,color:"",linestyle:r.LineStyle.Dashed,linewidth:2},poc:{visible:!1,color:"",linestyle:r.LineStyle.Solid,linewidth:2},volumeColor:"",valueAreaColor:"",placement:o.HHistDirection.LeftToRight}};function l(e){const t={...e.inputs};return"Auto"===t.rowSize&&delete t.ticksPerRow,{inputs:t,styles:{splitByBlocks:e.styles.splitByBlocks},graphics:{tpoBlockSets:{tpo:{colors:e.tpo.colors.gradientColors,showBlocks:e.tpo.showBlocks,showLetters:e.tpo.showLetters,nonVaOpacity:e.tpo.nonVaOpacity}},tpoLevels:{tpo:{tpoPoc:{visible:e.levels.showPOC,color:e.levels.pocColor},tpoMidpoint:{visible:e.levels.showMidpoint},tpoPoorHigh:{visible:e.levels.showPoorHigh,color:e.levels.poorHighColor},tpoPoorLow:{visible:e.levels.showPoorLow,color:e.levels.poorLowColor},tpoSingleprints:{visible:e.levels.showSingleprints,color:e.levels.singleprintsColor},tpoVal:{visible:e.levels.showVAL,color:e.levels.valColor},tpoVah:{visible:e.levels.showVAH,color:e.levels.vahColor},volumePoc:{visible:e.volumeProfile.poc.visible,style:e.volumeProfile.poc.linestyle,color:e.volumeProfile.poc.color,width:e.volumeProfile.poc.linewidth},volumeVah:{visible:e.volumeProfile.vah.visible,style:e.volumeProfile.vah.linestyle,color:e.volumeProfile.vah.color,width:e.volumeProfile.vah.linewidth},volumeVal:{visible:e.volumeProfile.val.visible,style:e.volumeProfile.val.linestyle,color:e.volumeProfile.val.color,width:e.volumeProfile.val.linewidth}}},tpos:{tpo:{closePrice:{visible:e.levels.showClosePrice},openPrice:{visible:e.levels.showOpenPrice},initialBalanceRange:{...e.levels.initialBalanceRange}}},tpoVolumeRows:{tpo:{visible:e.volumeProfile.visible,valuesColor:e.volumeProfile.valuesColor, showValues:e.volumeProfile.showValues,direction:e.volumeProfile.placement,colors:{nonVa:e.volumeProfile.volumeColor,va:e.volumeProfile.valueAreaColor}}}}}}},490515:(e,t,s)=>{"use strict";s.d(t,{VolumeFootprintBgColorsProperty:()=>R,getBgColorsDefaults:()=>D});var i=s(822914),r=s(852290),o=s(650151),a=s(195294),l=s(331633),n=s(86746),h=s(354950);const d=(0,a.getHexColorByName)("color-cold-gray-200"),u=(0,a.getHexColorByName)("color-black"),c=(0,a.getHexColorByName)("color-tv-blue-200"),p=(0,a.getHexColorByName)("color-tv-blue-400"),_=(0,a.getHexColorByName)("color-tv-blue-600"),m=(0,a.getHexColorByName)("color-tv-blue-800"),v=(0,a.getHexColorByName)("color-tv-blue-a800"),y=(0,a.getHexColorByName)("color-ripe-red-200"),g=(0,a.getHexColorByName)("color-ripe-red-400"),S=(0,a.getHexColorByName)("color-ripe-red-600"),b=(0,a.getHexColorByName)("color-ripe-red-800"),f=(0,a.getHexColorByName)("color-ripe-red-a700"),w=(0,a.getHexColorByName)("color-ripe-red-a900"),P=(0,a.getHexColorByName)("color-minty-green-200"),C=(0,a.getHexColorByName)("color-minty-green-400"),x=(0,a.getHexColorByName)("color-minty-green-600"),I=(0,a.getHexColorByName)("color-minty-green-800"),V=(0,a.getHexColorByName)("color-minty-green-a900"),T=new Map([[n.StdTheme.Light,{adjBuyBgColors:[P,C,x,I],adjSellBgColors:[y,g,S,f],adjTotalBgColors:[c,p,_,m],buyBgColor:C,sellBgColor:g,totalBgColor:p,pocColor:u}],[n.StdTheme.Dark,{adjBuyBgColors:[V,I,x,C],adjSellBgColors:[w,b,S,g],adjTotalBgColors:[v,m,_,p],buyBgColor:I,sellBgColor:b,totalBgColor:m,pocColor:d}]]);function B(e){return e===n.StdTheme.Light?(0,o.ensureDefined)(T.get(n.StdTheme.Light)):(0,o.ensureDefined)(T.get(n.StdTheme.Dark))}function D(){return(0,i.default)(B(l.watchedTheme.value()))}class R extends h.Property{constructor(e){super((0,r.default)(D(),e)),this._onThemeChanged=e=>{let t=n.StdTheme.Dark,s=n.StdTheme.Light;e!==n.StdTheme.Dark&&(t=n.StdTheme.Light,s=n.StdTheme.Dark);const i=B(s),r=B(t),o=this.state(),a=this.childs(),l=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3];l(i.adjBuyBgColors,o.adjBuyBgColors)&&a.adjBuyBgColors.merge(r.adjBuyBgColors),l(i.adjSellBgColors,o.adjSellBgColors)&&a.adjSellBgColors.merge(r.adjSellBgColors),l(i.adjTotalBgColors,o.adjTotalBgColors)&&a.adjTotalBgColors.merge(r.adjTotalBgColors),i.buyBgColor===o.buyBgColor&&a.buyBgColor.merge(r.buyBgColor),i.sellBgColor===o.sellBgColor&&a.sellBgColor.merge(r.sellBgColor),i.totalBgColor===o.totalBgColor&&a.totalBgColor.merge(r.totalBgColor),i.pocColor===o.pocColor&&a.pocColor.merge(r.pocColor)},l.watchedTheme.subscribe(this._onThemeChanged)}destroy(){super.destroy(),l.watchedTheme.unsubscribe(this._onThemeChanged)}}},30574:(e,t,s)=>{"use strict";s.d(t,{translateSessionDescription:()=>o,translateSessionExtendedDescription:()=>n,translateSessionShortDescription:()=>l});var i=s(444372);const r=new Map([["Premarket",i.t(null,{context:"sessions"},s(156935))],["Postmarket",i.t(null,{context:"sessions"},s(798801))],["Regular Trading Hours",i.t(null,{context:"sessions"},s(824380))],["Extended Trading Hours",i.t(null,{ context:"sessions"},s(897442))],["Electronic Trading Hours",i.t(null,{context:"sessions"},s(475610))]]);function o(e){var t;return null!==(t=r.get(e))&&void 0!==t?t:e}const a=new Map([["Premarket",i.t(null,{context:"sessions"},s(556137))],["Postmarket",i.t(null,{context:"sessions"},s(332929))],["Regular Trading Hours",i.t(null,{context:"sessions"},s(663798))],["Extended Trading Hours",i.t(null,{context:"sessions"},s(333021))],["Electronic Trading Hours",i.t(null,{context:"sessions"},s(333021))]]);function l(e){var t;return null!==(t=a.get(e))&&void 0!==t?t:e}function n(e){var t;return null!==(t=r.get(e))&&void 0!==t?t:e}},193149:(e,t,s)=>{"use strict";s.d(t,{formatAppendingResolutionString:()=>o});var i=s(276871),r=s(31341);function o(e){const t=(0,i.getTranslatedResolution)(e);return(0,r.isRtl)()?" "+(0,r.forceRTLStr)(" ,"+t):", "+t}},126290:(e,t,s)=>{"use strict";s.d(t,{formatSymbolAndResolution:()=>l});var i=s(59171),r=s.n(i),o=s(919892),a=s(193149);function l(e,t){const s=function(e,t){let s=(0,o.unwrapSimpleSymbol)(e);t||(s=r().shortName(s));return s}(e.symbol,t);if(e.crossInterval)return s;return s+(0,a.formatAppendingResolutionString)(e.resolution)}},242907:(e,t,s)=>{"use strict";function i(e,t){const s=Object.create(Object.getPrototypeOf(e));for(const i of t)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=e[i]);return s}s.d(t,{pickFields:()=>i})},993544:e=>{e.exports=''}}]);