initial commit with charts and assistant chat

This commit is contained in:
2026-03-02 00:08:19 -04:00
commit d907c5765e
1828 changed files with 50054 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6602],{25812:(e,t,o)=>{var n;o.d(t,{ToolboxType:()=>n}),function(e){e[e.Delete=0]="Delete"}(n||(n={}))},95616:(e,t,o)=>{o.r(t),o.d(t,{ActionsProvider:()=>at,createActionCopyPrice:()=>et,createActionOrder:()=>Je,createActionToggleVisibilityDataSources:()=>nt,createActionTrade:()=>Ze,createChangeIntervalsVisibilitiesAction:()=>Xe,createDrawHorizontalLineAction:()=>it,createLinesAction:()=>tt,createPasteAction:()=>Ke,createSyncDrawingActions:()=>ot,createVisualOrderAction:()=>Qe});var n=o(50151),i=o(9343),a=(o(60521),o(87465)),r=o(11542),l=o(37103),s=o(41706),c=o(96708),d=o(36313),u=o(2088),h=o(32823),p=(o(70002),o(68335)),g=(o(25812),o(55456)),S=o(84526),m=o(92848),b=o(26610),v=o(22455),_=o(29242),w=o(95804),f=(o(78861),o(46082)),I=o(13896),A=o(81922),T=o(56616),y=o(69422),C=o(43337),W=o(42516),N=o(14429),P=o(58570),F=o(72104);o(91682);Error;(0,i.getLogger)("Chart.ActionsProvider");const E=new w.TranslatedString("change visibility",r.t(null,void 0,o(1924))),x=new w.TranslatedString("pin to scale {label}",r.t(null,void 0,o(81566))),L=new w.TranslatedString("pin to right scale",r.t(null,void 0,o(7495))),M=new w.TranslatedString("pin to left scale",r.t(null,void 0,o(78690))),k=(new w.TranslatedString("change earnings visibility",r.t(null,void 0,o(6819))),new w.TranslatedString("change dividends visibility",r.t(null,void 0,o(53929))),new w.TranslatedString("change splits visibility",r.t(null,void 0,o(47474))),new w.TranslatedString("change continuous contract switch visibility",r.t(null,void 0,o(18867))),new w.TranslatedString("change futures contract expiration visibility",r.t(null,void 0,o(85532))),new w.TranslatedString("change latest news and Minds visibility",r.t(null,void 0,o(50243))),new w.TranslatedString("show all ideas",r.t(null,void 0,o(13336)))),D=new w.TranslatedString("show ideas of followed users",r.t(null,void 0,o(91395))),O=new w.TranslatedString("show my ideas only",r.t(null,void 0,o(57460))),U=(new w.TranslatedString("change events visibility on chart",r.t(null,void 0,o(6119))),new w.TranslatedString("add this symbol to entire layout",r.t(null,void 0,o(62306)))),j=new w.TranslatedString("add this indicator to entire layout",r.t(null,void 0,o(96677))),R=(new w.TranslatedString("add this strategy to entire layout",r.t(null,void 0,o(58156))),new w.TranslatedString("add this financial metric to entire layout",r.t(null,void 0,o(67608))),
new w.TranslatedString("lock objects",r.t(null,void 0,o(18942)))),H=new w.TranslatedString("unlock objects",r.t(null,void 0,o(51198))),V=new w.TranslatedString("anchor objects",r.t(null,void 0,o(63869))),B=new w.TranslatedString("unanchor objects",r.t(null,void 0,o(99234))),z=new w.TranslatedString("change visibility at current interval and above",r.t(null,void 0,o(45800))),q=new w.TranslatedString("change visibility at current interval and below",r.t(null,void 0,o(75645))),G=new w.TranslatedString("change visibility at current interval",r.t(null,void 0,o(84331))),$=new w.TranslatedString("change visibility at all intervals",r.t(null,void 0,o(57916))),Y=(r.t(null,void 0,o(66823)),(0,_.appendEllipsis)(r.t(null,void 0,o(264))),r.t(null,void 0,o(98334))),Z=r.t(null,void 0,o(27298)),J=r.t(null,void 0,o(3564)),K=r.t(null,void 0,o(94559)),Q=r.t(null,void 0,o(2165)),X=r.t(null,void 0,o(16986)),ee=r.t(null,void 0,o(12645)),te=r.t(null,void 0,o(44579)),oe=r.t(null,void 0,o(29436)),ne=r.t(null,void 0,o(81054)),ie=r.t(null,void 0,o(32538)),ae=r.t(null,void 0,o(72046)),re=r.t(null,void 0,o(90095)),le=r.t(null,void 0,o(14115)),se=r.t(null,void 0,o(33110)),ce=r.t(null,void 0,o(28280)),de=r.t(null,void 0,o(76150)),ue=r.t(null,void 0,o(94210)),he=r.t(null,void 0,o(60035)),pe=r.t(null,void 0,o(10761)),ge=r.t(null,void 0,o(11254)),Se=r.t(null,void 0,o(35049)),me=r.t(null,void 0,o(19271)),be=r.t(null,void 0,o(15512)),ve=r.t(null,void 0,o(46545)),_e=r.t(null,void 0,o(52160)),we=r.t(null,void 0,o(17293)),fe=r.t(null,void 0,o(21973)),Ie=r.t(null,void 0,o(55481)),Ae=r.t(null,void 0,o(71179)),Te=r.t(null,void 0,o(4077)),ye=r.t(null,void 0,o(54853)),Ce=r.t(null,void 0,o(20177)),We=r.t(null,void 0,o(494)),Ne=r.t(null,void 0,o(60668)),Pe=r.t(null,void 0,o(58026)),Fe=r.t(null,void 0,o(56982)),Ee=((0,_.appendEllipsis)(r.t(null,void 0,o(35088))),(0,_.appendEllipsis)(r.t(null,void 0,o(2439))),(0,_.appendEllipsis)(r.t(null,void 0,o(32514)))),xe=(r.t(null,void 0,o(78358)),(0,_.appendEllipsis)(r.t(null,void 0,o(76266))),r.t(null,void 0,o(49680))),Le=r.t(null,void 0,o(12537)),Me=(r.t(null,void 0,o(93553)),r.t(null,void 0,o(74975))),ke=r.t(null,void 0,o(99894)),De=r.t(null,void 0,o(5837)),Oe=r.t(null,void 0,o(24185)),Ue=(r.t(null,void 0,o(37113)),r.t(null,void 0,o(29449)),r.t(null,void 0,o(50849)),r.t(null,void 0,o(33158)),r.t(null,void 0,o(81465)),r.t(null,void 0,o(62986)),r.t(null,void 0,o(55418))),je=r.t(null,void 0,o(10261)),Re=r.t(null,void 0,o(44020)),He=((0,_.appendEllipsis)(r.t(null,void 0,o(32514))),r.t(null,void 0,o(97878)),r.t(null,void 0,o(39010))),Ve=r.t(null,void 0,o(26090)),Be=(r.t(null,void 0,o(95754)),r.t(null,void 0,o(35679)),r.t(null,void 0,o(9140)),r.t(null,void 0,o(46607)),r.t(null,void 0,o(39079)),(0,_.appendEllipsis)(r.t(null,void 0,o(75594)))),ze=(0,_.appendEllipsis)(r.t(null,void 0,o(88853))),qe=r.t(null,void 0,o(35140)),Ge=r.t(null,void 0,o(68422)),$e=r.t(null,void 0,o(92957)),Ye=r.t(null,void 0,o(58764));r.t(null,void 0,o(10996)),r.t(null,void 0,o(3061));async function Ze(e,t,o){return null}function Je(e){
throw new Error("not supported")}function Ke(e,t){return!t.isEmpty()&&l.enabled("datasource_copypaste")?new N.ActionWithStandardIcon({actionId:"Chart.Clipboard.PasteSource",options:{label:qe.trim(),shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+86),statName:"Paste",onExecute:()=>e.chartWidgetCollection().clipboard.uiRequestPaste(t)}}):null}function Qe(e,t){const o=e.model(),n=o.availableZOrderOperations(t),i=[new N.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringToFront",options:{label:we,statName:"BringToFront",disabled:!n.bringToFrontEnabled,onExecute:()=>o.bringToFront(t)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendToBack",options:{label:fe,statName:"SendToBack",disabled:!n.sendToBackEnabled,onExecute:()=>o.sendToBack(t)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringForward",options:{label:Ie,statName:"BringForward",disabled:!n.bringForwardEnabled,onExecute:()=>o.bringForward(t)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendBackward",options:{label:Ae,statName:"SendBackward",disabled:!n.sendBackwardEnabled,onExecute:()=>o.sendBackward(t)}})];return new N.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder",options:{label:Te,iconId:"Chart.VisualOrder",statName:"VisualOrder",subItems:i}})}function Xe(e,t){const o=e.model(),n=(e,n)=>{const i=f.Interval.parse(o.mainSeries().interval()),a=(0,A.getIntervalsVisibilitiesForMode)(i,e),r=[],l=[];t.forEach((e=>{const t=e.properties().intervalsVisibilities.childs();r.push(t.ticks),l.push(a.ticks),r.push(t.seconds),l.push(a.seconds),r.push(t.secondsFrom),l.push(a.secondsFrom),r.push(t.secondsTo),l.push(a.secondsTo),r.push(t.minutes),l.push(a.minutes),r.push(t.minutesFrom),l.push(a.minutesFrom),r.push(t.minutesTo),l.push(a.minutesTo),r.push(t.hours),l.push(a.hours),r.push(t.hoursFrom),l.push(a.hoursFrom),r.push(t.hoursTo),l.push(a.hoursTo),r.push(t.days),l.push(a.days),r.push(t.daysFrom),l.push(a.daysFrom),r.push(t.daysTo),l.push(a.daysTo),r.push(t.weeks),l.push(a.weeks),r.push(t.weeksFrom),l.push(a.weeksFrom),r.push(t.weeksTo),l.push(a.weeksTo),r.push(t.months),l.push(a.months),r.push(t.monthsFrom),l.push(a.monthsFrom),r.push(t.monthsTo),l.push(a.monthsTo),r.push(t.ranges),l.push(a.ranges)})),o.setProperties(r,l,n,(0,W.sourcesAffectState)(t))},i=[new N.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndAbove",options:{label:Ce,statName:"currentAndAboveIntervals",onExecute:()=>n(3,z)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndBelow",options:{label:We,statName:"currentAndBelowIntervals",onExecute:()=>n(2,q)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.Current",options:{label:Ne,statName:"currentInterval",onExecute:()=>n(1,G)}}),new N.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.All",options:{label:Pe,statName:"allIntervals",onExecute:()=>n(0,$)}})];return new N.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility",options:{label:ye,
statName:"IntervalsVisibility",subItems:i}})}function et(e,t){const o=e.defaultPriceScale(),n=void 0!==t?o.coordinateToPrice(t,e.mainDataSource()?.firstValue()??0):e.model().mainSeries().lastValueData(4,!0,!0).price,i=e.mainDataSource()?.formatter();if(void 0===n||!i)return null;const a=i.format(n),r=i.format(n,{ignoreLocaleNumberFormat:!0,noExponentialForm:!0});return new N.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopyPrice",options:{label:`${Ge} ${a}`,statName:"CopyPrice",onExecute:()=>(0,T.getClipboard)().writeText(r)}})}function tt(e){const t=e.actions(),o=[t.showPriceLine];return o.push(t.showHighLowPriceLines),l.enabled("show_average_close_price_line_and_label")&&o.push(t.showAverageClosePriceLine),new N.ActionWithStandardIcon({actionId:"Chart.Lines",options:{label:Fe,statName:"Lines",subItems:o}})}function ot(e,t){return[]}function nt(e,t){const o=t[0].properties().visible.value(),n=o?Z:Y,i=o?"Chart.Hide":"Chart.ShowObject",a=o?"Chart.SelectedObject.Hide":"Chart.SelectedObject.Show";return new N.ActionWithStandardIcon({actionId:a,options:{checkable:!0,statName:"ToggleVisibilitySelectedObject",label:n,iconId:i,onExecute:()=>{const n=e.model();n.withMacro(E,(()=>{t.forEach((e=>{n.setProperty(e.properties().visible,!o,E,I.lineToolsDoNotAffectChartInvalidation&&(0,b.isLineTool)(e))}))}))}}})}function it(e,t,i){let a;if(i)a=i.price;else{const o=e.crosshairSource();a=e.model().magnet().align(o.price,o.index,t)}const l=(0,n.ensureNotNull)(t.mainDataSource()).formatter().format(a);return new N.ActionWithStandardIcon({actionId:"Chart.Crosshair.PlusButton.DrawHorizontalLine",options:{label:r.t(null,{replace:{price:l}},o(56916)),statName:"DrawHorizontalLineAtPrice",iconId:"Chart.AddHorzLine",shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Alt+72),onExecute:async()=>{await(0,P.ensureLineToolLoaded)("LineToolHorzLine"),e.drawRightThere("LineToolHorzLine",t,i,"ContextMenu")}}})}class at{constructor(e,t){this._chartWidget=e,this._options=(0,a.merge)((0,a.clone)(F.defaultChartWidgetActionsOptions),t||{})}async contextMenuActionsForSources(e,t,o,i,a){const r=e[0],l=this._options,c=[];if(r===this._chartWidget.model().mainSeries()&&l.mainSeries)c.push(...await this._contextMenuActionsForSeries(r,o));else if((0,u.isStudy)(r)&&l.studies)c.push(...await this._contextMenuActionsForStudy(r,(0,n.ensureDefined)(t),o));else if((0,b.isLineTool)(r)&&l.lineTools){const t=e.filter(b.isLineTool);c.push(...await this._contextMenuActionsForLineTool(t))}else 0;return c.length&&a?.length&&c.push(new s.Separator),c.push(...a??[]),c}async actionForLineTools(e,t){switch(t){case"Chart.SelectedObject.ToggleAnchored":return this._createActionToggleAnchorLineTools(e);case"Chart.SelectedObject.InsertRowTable":{if(1!==e.length)return null;const t=e[0];return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertRowTable"===e.getState().actionId))[0]??null}case"Chart.SelectedObject.InsertColumnTable":{if(1!==e.length)return null;const t=e[0]
;return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertColumnTable"===e.getState().actionId))[0]??null}}throw new Error(`Unsupported actionId: ${t}`)}_isReadOnly(){return this._chartWidget.readOnly()}_createActionScale(e){const t=(0,n.ensureNotNull)(e.priceScale()),o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(e)),a=i.priceScalePosition(t),r=("left"===a?i.leftPriceScales():i.rightPriceScales()).indexOf(t),l=o.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",s="overlay"===a?"":(0,c.getPriceAxisNameInfo)(a,r).label,d=de.format({label:s}),u={"left-needname":d,"left-dontneedname":he,"right-needname":d,"right-dontneedname":pe,"overlay-needname":ue,"overlay-dontneedname":ue}[a+"-"+l];return new N.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{label:u,iconId:"Chart.PriceScale",subItems:this._createActionScaleItems(e)}})}_createActionResetInputPoints(e){const t=e.metaInfo(),n=t.inputs.filter(y.isTimeOrPriceNotHiddenInput);return 0===n.length?null:new N.ActionWithStandardIcon({actionId:"Chart.Source.ResetInputPoints",options:{label:ze,onExecute:async()=>{let i;try{const a=e.properties().childs().inputs.state();for(const e of Object.keys(a))n.find((t=>t.id===e))||delete a[e];const r=new C.Property({inputs:a}),l=await Promise.all([o.e(5234),o.e(8185),o.e(1681),o.e(5371),o.e(2202),o.e(5563),o.e(2647),o.e(3439),o.e(1171),o.e(8933),o.e(3672),o.e(2537),o.e(3359),o.e(8894),o.e(5743),o.e(3425),o.e(1697),o.e(4587),o.e(7833),o.e(8752),o.e(9487),o.e(445),o.e(846),o.e(8220),o.e(3329),o.e(9970),o.e(6052),o.e(9590),o.e(4678),o.e(9965),o.e(9742),o.e(4248),o.e(2227),o.e(4931),o.e(9418),o.e(4426),o.e(9026),o.e(9928),o.e(8604),o.e(5893),o.e(3030)]).then(o.bind(o,73339));i=(await l.selectInputValuesOnChart(this._chartWidget,n,r,t.shortDescription,t.inputs)).customSourceId,e.properties().mergeAndFire(r.state())}finally{void 0!==i&&this._chartWidget.model().model().removeCustomSource(i)}}}})}_createActionLayoutChartsSync(){return new LayoutChartsSyncContextMenuAction(this._chartWidget.linkingGroupIndex().readonly(),(e=>this._chartWidget.model().setLinkingGroupIndex(e)))}_createActionScaleDetach(e,t,o,i){const a=this._chartWidget.model().model(),r=(0,n.ensureNotNull)(a.paneForSource(e));if(!r.canCreateNewPriceScale())return null;const l=(0,n.ensureNotNull)(e.priceScale()),s=l.canDetachSource(e),d=r.priceScalePosition(l),u=s||d!==t;if(!u)return null;const h=a.priceScaleSlotsCount(),p={left:{labelled:oe,sided:se},right:{labelled:oe,sided:ce}},g="left"===t?r.leftPriceScales().length:r.rightPriceScales().length,S=h[t]>g?"labelled":"sided",m=(0,c.getPriceAxisNameInfo)(t,g).label,b=p[t][S].format({label:m});return new N.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{checkable:!1,disabled:!u,label:b,statName:i,payload:e,onExecute:o}})}_onDetachLeft(e){const t=e.getPayload(),o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(t))
;this._chartWidget.model().detachToLeft(t,i)}_onDetachRight(e){const t=e.getPayload(),o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(t));this._chartWidget.model().detachToRight(t,i)}_createActionScaleDetachLeft(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")}_createActionScaleDetachRight(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")}_onMoveToScale(e){const t=e.getPayload();if(t.datasource.priceScale()===t.priceScale)return;const o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,i,t.priceScale,t.undoText)}_createMoveToScaleAction(e,t,o,n){const i=e.priceScale()===t;return new N.ActionWithStandardIcon({actionId:"Chart.Source.MoveToOtherScale",options:{checkable:!0,checked:i,label:o,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:n},onExecute:this._onMoveToScale.bind(this)}})}_onNoScale(e){const t=e.getPayload().datasource,o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(t));i.isOverlay(t)||this._chartWidget.model().detachNoScale(t,i)}_createActionNoScale(e){const t=this._chartWidget.model().model(),o=(0,n.ensureNotNull)(t.paneForSource(e)),i=o.actionNoScaleIsEnabled(e);return new N.ActionWithStandardIcon({actionId:"Chart.Source.MoveToNoScale",options:{checkable:!0,checked:o.isOverlay(e),label:ge,disabled:!i,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)}})}_createActionScaleItems(e){const t=[],o=this._chartWidget.model().model(),i=(0,n.ensureNotNull)(o.paneForSource(e)),a=o.priceScaleSlotsCount().totallySlots>1,r=i.rightPriceScales(),l=i.leftPriceScales(),d=this._createActionScaleDetachRight(e),u=this._createActionScaleDetachLeft(e),h=r.length+l.length+(null===d?0:1)+(null===u?0:1)>2,p={right:{hidden:{checked:{labelled:J,sided:K},unchecked:{labelled:Q,sided:X}},visible:{checked:{labelled:ee,sided:te},unchecked:{labelled:oe,sided:ne}}},left:{hidden:{checked:{labelled:J,sided:ie},unchecked:{labelled:Q,sided:ae}},visible:{checked:{labelled:ee,sided:re},unchecked:{labelled:oe,sided:le}}}},g={right:L,left:M},S={left:i.visibleLeftPriceScales(),right:i.visibleRightPriceScales()},m=(t,o)=>{const n=("right"===o?r:l)[t],i=S[o].includes(n)?"visible":"hidden",s=e.priceScale()===n?"checked":"unchecked",d=a?"labelled":"sided",u=p[o],h=(0,c.getPriceAxisNameInfo)(o,t).label;return{actionText:u[i][s][d].format({label:h}),undoText:a?x.format({label:h}):g[o]}};t.push(...r.map(((t,o)=>{const n=m(o,"right");return this._createMoveToScaleAction(e,t,n.actionText,n.undoText)}))),null!==d&&t.push(d);h&&(r.length>0||null!==d)&&t.push(new s.Separator);t.push(...l.map(((t,o)=>{const n=m(o,"left");return this._createMoveToScaleAction(e,t,n.actionText,n.undoText)}))),null!==u&&t.push(u);h&&(l.length>0||null!==u)&&t.push(new s.Separator);return t.push(this._createActionNoScale(e)),t}_createActionMergeUp(e){const t=this._chartWidget.model()
;return t.model().isMergeUpAvailableForSource(e)?new N.ActionWithStandardIcon({actionId:"Chart.Source.MergeUp",options:{label:me,statName:"MergeUp",onExecute:()=>t.mergeSourceUp(e)}}):null}_createActionUnmergeUp(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new N.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeUp",options:{label:be,statName:"UnmergeUp",onExecute:()=>t.unmergeSourceUp(e)}}):null}_createActionMergeDown(e){const t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new N.ActionWithStandardIcon({actionId:"Chart.Source.MergeDown",options:{label:ve,statName:"MergeDown",onExecute:()=>t.mergeSourceDown(e)}}):null}_createActionUnmergeDown(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new N.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeDown",options:{label:_e,statName:"UnmergeDown",onExecute:()=>t.unmergeSourceDown(e)}}):null}_mergeContentMenuItems(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(a.notNull)}_createActionMove(e){const t=this._mergeContentMenuItems(e);return t.length>0?new N.ActionWithStandardIcon({actionId:"Chart.Source.MoveToPane",options:{label:Se,iconId:"Chart.Move",subItems:t}}):null}async _createDetailsMetricsAction(e){return null}async _contextMenuActionsForSeries(e,t){const o=[],i=this._chartWidget.model().model(),a=(0,n.ensureNotNull)(i.paneForSource(e)),r=this._chartWidget.actions(),c=t&&"localY"in t?t.localY:void 0;if(this._isReadOnly())o.push(nt(this._chartWidget,[e])),o.push(new s.Separator),o.push(this._createActionScale(e));else{0,o.length>0&&!(o[o.length-1]instanceof s.Separator)&&o.push(new s.Separator),l.enabled("symbol_info")&&o.push(r.showSymbolInfoDialog);const t=await this._createDetailsMetricsAction(e);if(t&&o.push(t),o.length>0&&!(o[o.length-1]instanceof s.Separator)&&o.push(new s.Separator),!a.isEmpty()&&l.enabled("datasource_copypaste")){const e=et(a,c),t=Ke(this._chartWidget,a);(e||t)&&(e&&o.push(e),t&&o.push(t),o.push(new s.Separator))}o.push(Qe(this._chartWidget,[e]));const n=this._createActionMove(e);null!==n&&o.push(n),o.push(this._createActionScale(e)),o.push(nt(this._chartWidget,[e])),o.push(new s.Separator),r.addToWatchlist&&(r.addToWatchlist.prepare(),o.push(r.addToWatchlist)),l.enabled("text_notes")&&o.push(r.addToTextNotes),o[o.length-1]instanceof s.Separator||o.push(new s.Separator),l.enabled("show_chart_property_page")&&!this._chartWidget.onWidget()&&o.push(r.mainSeriesPropertiesAction),o[o.length-1]instanceof s.Separator&&o.pop()}return o}_createActionAddChildStudy(e){throw new Error("unsupported")}_createActionAddFundamentals(e){return null}_createActionShowSymbolInfoDialog(e,t){const o=this._chartWidget.model().model();return new N.ActionWithStandardIcon({actionId:"Chart.Dialogs.ShowSymbolInfo",options:{label:Be,iconId:"Chart.SymbolInfo",checkable:!1,statName:"SymbolInfo",onExecute:()=>{const n={symbolInfo:e.symbolInfo(),
unitDescription:e=>e?t.description(e):"",dateFormatter:o.dateFormatter()};(0,S.showSymbolInfoDialog)(n)}}})}_createActionShowProperties(e){return new N.ActionWithStandardIcon({actionId:"Chart.Indicator.ShowSettingsDialog",options:{label:Ee,iconId:"Settings",statName:"EditSelectedObject",onExecute:()=>this._chartWidget.showSourceProperties(e)}})}async _contextMenuActionsForStudy(e,t,o){const n=t!==this._chartWidget.model().paneForSource(e),i=this._chartWidget.actions(),a=(o&&"localY"in o&&o.localY,[]);if(!e.userEditEnabled())return a;if(this._chartWidget.readOnly())a.push(nt(this._chartWidget,[e])),a.push(new s.Separator),e.isLinkedToSeries()||a.push(this._createActionScale(e));else{0,l.enabled("study_on_study")&&e.canHaveChildren()&&a.push(this._createActionAddChildStudy(e));const t=this._createApplyToEntireLayoutCommand(e);null!==t&&a.push(t);const o=this._createAddIndicatorToFavoritesCommand(e);if(o&&a.push(o),a.length>0&&!(a[a.length-1]instanceof s.Separator)&&a.push(new s.Separator),l.enabled("symbol_info")&&(0,u.isCompareOrOverlayStudy)(e)&&null!==e.symbolInfo()&&(a.push(this._createActionShowSymbolInfoDialog(e,this._chartWidget.model().model().availableUnits())),a.push(new s.Separator)),n||a.push(Qe(this._chartWidget,[e])),a.push(Xe(this._chartWidget,[e])),!e.isLinkedToSeries()&&!n){const t=this._createActionMove(e);null!==t&&a.push(t),a.push(this._createActionScale(e))}a.push(new s.Separator);const r=e.metaInfo();if(e.copiable()){const t=new N.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopySource",options:{label:xe,shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+67),statName:"Copy",onExecute:()=>{this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy([e])}}});a.push(t)}a.push(nt(this._chartWidget,[e])),a.push(i.studyRemove);this._options.objectTree&&i.paneObjectTree&&a.push(new s.Separator,i.paneObjectTree),l.enabled("property_pages")&&new h.MetaInfoHelper(r).hasUserEditableOptions()&&a.push(new s.Separator,this._createActionShowProperties(e)),a[a.length-1]instanceof s.Separator&&a.pop()}return a}_createLineToolTemplateAction(e){return e.length,null}_createActionToggleLockLineTools(e){const t=e[0].properties().frozen.value(),o=t?ke:De;return new N.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleLocked",options:{label:o,statName:"ToggleLockSelectedObject",checkable:!0,iconId:t?"Chart.UnlockObject":"Chart.LockObject",onExecute:()=>{if(1===e.length)this._chartWidget.toggleLockSelectedObject();else{const o=t?H:R,n=this._chartWidget.model();n.withMacro(o,(()=>{e.forEach((e=>{n.setProperty(e.properties().frozen,!t,o,I.lineToolsDoNotAffectChartInvalidation)}))}))}}}})}_createActionToggleAnchorLineTools(e){const t=e.filter((e=>e.anchorable()));if(0===t.length)return null;const o=t[0].properties().anchored.value();return new N.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleAnchored",options:{label:Oe,statName:"ToggleAnchoredSelectedObject",checkable:!0,checked:o,onExecute:()=>{const e=o?B:V,n=this._chartWidget.model();n.withMacro(e,(()=>{t.forEach((t=>{
n.setProperty(t.properties().childs().anchored,!o,e,I.lineToolsDoNotAffectChartInvalidation)}))}))}}})}async _contextMenuActionsForLineTool(e){const t=[],o=this._chartWidget.actions(),n=(this._chartWidget.model().model(),()=>{t.push(Qe(this._chartWidget,e))}),i=()=>{t.push(Xe(this._chartWidget,e))},a=()=>{const o=e.filter((e=>e.cloneable()));if(o.length>0){const e=new N.ActionWithStandardIcon({actionId:"Chart.LineTool.Clone",options:{label:Le,iconId:"Chart.Clone",shortcutHint:(0,p.humanReadableModifiers)(p.Modifiers.Mod)+"Drag",statName:"Clone",onExecute:()=>this._chartWidget.model().cloneLineTools(o,!1)},id:"Clone"});t.push(e)}return!!o.length},r=()=>{const o=e.filter((e=>e.copiable()));if(o.length>0){const e=new s.Action({actionId:"Chart.Clipboard.CopyLineTools",options:{label:xe,shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+67),statName:"Copy",onExecute:()=>this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy(o)},id:"Copy"});t.push(e)}return!!o.length},c=()=>{const e=(this._chartWidget,[]);return t.push(...e),e.length>0},u=e=>{const o=new N.ActionWithStandardIcon({actionId:"Chart.ScrollToLineTool",options:{label:Me.format({lineToolName:e.title(d.TitleDisplayTarget.StatusLine)}),statName:"GoToLineTool",checkable:!1,onExecute:async()=>this._chartWidget.model().scrollToLineTool(e)}});t.push(o)},h=e=>{const t=this._chartWidget.model().model().lineToolsGroupModel(),o=e.map((e=>t.groupForLineTool(e)));return new Set(o).size<=1};if(1===e.length){const d=e[0];let h={actions:[],placement:"CustomAction"};if(d.additionalActions&&(h=await d.additionalActions(this._chartWidget.model())),h.actions.length>0&&"BeforeAll"===h.placement&&(t.push(...h.actions),t.push(new s.Separator)),this._chartWidget.readOnly())t.push(nt(this._chartWidget,[d]));else if(d.userEditEnabled()){0,n(),i(),this._options.objectTree&&o.paneObjectTree&&t.push(o.paneObjectTree),t.push(new s.Separator);let e=a();e=r()||e,e&&t.push(new s.Separator),e=c(),e&&t.push(new s.Separator),h.actions.length>0&&"CustomAction"===h.placement&&(t.push(...h.actions),t.push(new s.Separator));const p=this._createActionToggleAnchorLineTools([d]);p&&(t.push(p),t.push(new s.Separator)),t.push(this._createActionToggleLockLineTools([d])),t.push(nt(this._chartWidget,[d])),t.push(o.lineRemove),d.points().length>0&&this._options.gotoLineTool&&(t.push(new s.Separator),u(d));const g=await this._chartWidget.propertiesDefinitionsForSource(d);l.enabled("property_pages")&&null!==g&&(t.push(new s.Separator),t.push(o.format))}}else{const d=this._createLineToolTemplateAction(e);null!==d&&t.push(d),this._options.objectTree&&o.paneObjectTree&&t.push(o.paneObjectTree),h(e)&&n(),i(),t.length>0&&t.push(new s.Separator);let u=a();u=r()||u,u&&t.push(new s.Separator),u=c(),u&&t.push(new s.Separator),t.push(this._createActionToggleLockLineTools(e)),t.push(nt(this._chartWidget,e)),t.push(o.lineRemove),l.enabled("property_pages")&&(t.push(new s.Separator),t.push(o.format))}return t}_createEarningsShow(){return null}_createDividendsShow(){return null}_createSplitsShow(){return null}
_contextMenuActionsForESD(){return[]}_contextMenuActionsForRollDates(){return[]}_contextMenuActionsForFuturesContractExpiration(){return[]}_contextMenuActionsForisLatestUpdates(){return[]}_contextMenuActionsForPublishedTimeline(e){const t=this._chartWidget.actions(),o=[];if(o.push(t.lineHide),window.is_authenticated){const t=e.properties().childs().filter,n=new s.Action({actionId:"Chart.ShowAllIdeas",options:{checked:t.value()===PublishedChartsFilter.None,checkable:!0,label:Ue,name:"ToggleAllIdeas",statName:"ToggleAllIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.None,k)}}),i=new s.Action({actionId:"Chart.ShowIdeasOfFollowedUsers",options:{checked:t.value()===PublishedChartsFilter.Following,checkable:!0,label:je,name:"ToggleIdeasOfPeopleAndUser",statName:"ToggleIdeasOfPeopleAndUser",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Following,D)}}),a=new s.Action({actionId:"Chart.ShowMyIdeasOnly",options:{checked:t.value()===PublishedChartsFilter.Private,checkable:!0,label:Re,name:"ToggleUserIdeas",statName:"ToggleUserIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Private,O)}});o.push(new s.Separator,n,i,a)}return o}_contextMenuActionsForTradingDrawings(e){return e.contextMenuItems()}async _contextMenuActionsForAlertLabel(e,t){return[]}_contextMenuActionsForChartEvents(e){return[]}_createApplyToEntireLayoutCommand(e){if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;const t=this._chartWidget.model().model();if(e.parentSources().length>0)return null;const o=(0,n.ensureNotNull)(t.paneForSource(e)),i=t.paneForSource(t.mainSeries())===o,a=e instanceof g.StudyCompare&&e.priceScale()===t.mainSeries().priceScale()&&(0,n.ensureNotNull)(e.priceScale()).isPercentage(),r=i?void 0:t.panes().indexOf(o);let l=Ve,c=j,d="AddStudyToEntireLayout";return(0,v.isActingAsSymbolSource)(e)&&(l=He,c=U,d="AddSymbolToEntireLayout"),new s.Action({actionId:"Chart.AddIndicatorToAllCharts",options:{label:l,statName:d,onExecute:()=>{const o=(0,n.ensureNotNull)((0,m.clipboardDataForSources)(t.id(),[e])),l=this._chartWidget.chartWidgetCollection(),s={isOnMainPane:i,asCompare:a,paneIndex:r};l.applyIndicatorToAllCharts(this._chartWidget,o,s,c)}},id:"applyStudyToEntireLayout"})}_createAddIndicatorToFavoritesCommand(e){const t=e.metaInfo();let n;if(!l.enabled("items_favoriting")||(0,u.isCompareOrOverlayStudy)(e))return null;{const{description_localized:e,description:i}=t,a=e||r.t(i,{context:"study"},o(83477));n=()=>o.e(9790).then(o.bind(o,9698)).then((({isFavorite:e,toggleFavorite:t})=>({label:e(a)?Ye:$e,onExecute:()=>t(a)})))}return new N.ActionWithStandardIcon({actionId:"Chart.Indicator.AddFavorites",id:"addIndicatorToFavorites",optionsLoader:n,options:{statName:"AddIndicatorToFavorites",iconId:"Indicator.AddToFavorites"}})}}},48282:(e,t,o)=>{o.d(t,{isCustomStudy:()=>i});const n={VbPFixed:!0,PivotPointsStandard:!0,VbPVisible:!0,VbPAnchored:!0};function i(e){return e in n}},32823:(e,t,o)=>{o.d(t,{
MetaInfoHelper:()=>h});var n=o(50151),i=o(9343),a=o(19844),r=o(4359),l=o(87465),s=o(69422);function c(e){return!e.groupId&&!e.isHidden&&e.id!==s.RangeDependentStudyInputNames.FirstBar&&e.id!==s.RangeDependentStudyInputNames.LastBar}var d=o(48282);const u=(0,i.getLogger)("Platform.GUI.PropertyDialog.Indicators.MetaInfo");class h{constructor(e){this._metaInfo=e}hasUserEditableInputs(){return this._metaInfo.inputs.some(c)}getUserEditableInputs(){return this._metaInfo.inputs.filter(c)}hasUserEditableProperties(){return a.StudyMetaInfo.isScriptStrategy(this._metaInfo)}hasUserEditableStyles(){const e=this._metaInfo;return e.plots.length>0||void 0!==e.bands||void 0!==e.filledAreas||(0,d.isCustomStudy)(e.shortId)||a.StudyMetaInfo.isScriptStrategy(this._metaInfo)||Object.values(e.graphics).some((e=>void 0!==e))}getUserEditablePlots(){const e=new Set,t=this._metaInfo;return t.plots.filter((o=>{if((0,r.isColorerPlot)(o)||(0,r.isTextColorerPlot)(o)||(0,r.isDataOffsetPlot)(o)||(0,r.isOhlcColorerPlot)(o)||(0,r.isAlertConditionPlot)(o)||(0,r.isDataPlot)(o))return!1;if((0,r.isOhlcPlot)(o)){const i=o.target;if(e.has(i))return!1;e.add(i);const a=(0,n.ensureDefined)(t.ohlcPlots);return!(0,n.ensureDefined)(a[i]).isHidden}{const e=t.styles?t.styles[o.id]:void 0;return void 0===e||!e.isHidden}}))}hasUserEditableOptions(){return this.hasUserEditableInputs()||this.hasUserEditableProperties()||this.hasUserEditableStyles()}getStrategyProperties(){const e=this._metaInfo,t=e.inputs.filter(g),o={...p};for(const n of t){const t=n.internalID;o[t]=n,p.hasOwnProperty(t)||u.logWarn(`Unknown strategy input internal id ${t} in ${e.fullId}`)}return(0,l.clone)(o)}}const p={currency:void 0,backtest_fill_limits_assumption:void 0,calc_on_every_tick:void 0,calc_on_order_fills:void 0,commission_value:void 0,commission_type:void 0,initial_capital:void 0,pyramiding:void 0,slippage:void 0,default_qty_type:void 0,default_qty_value:void 0,margin_long:void 0,margin_short:void 0,use_bar_magnifier:void 0,process_orders_on_close:void 0,fill_orders_on_standard_ohlc:void 0};function g(e){return"strategy_props"===e.groupId}}}]);