(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7078],{55647:e=>{e.exports={backButton:"backButton-yMMXpYEB"}},69101:e=>{e.exports={wrapper:"wrapper-nGEmjtaX",container:"container-nGEmjtaX",tab:"tab-nGEmjtaX",active:"active-nGEmjtaX",title:"title-nGEmjtaX",icon:"icon-nGEmjtaX",withoutIcon:"withoutIcon-nGEmjtaX",titleText:"titleText-nGEmjtaX",nested:"nested-nGEmjtaX",isTablet:"isTablet-nGEmjtaX",isMobile:"isMobile-nGEmjtaX",showLastDivider:"showLastDivider-nGEmjtaX",medium:"medium-nGEmjtaX",large:"large-nGEmjtaX",withoutArrow:"withoutArrow-nGEmjtaX",accessible:"accessible-nGEmjtaX"}},22944:e=>{e.exports={"tablet-normal-breakpoint":"(max-width: 768px)","tablet-small-breakpoint":"(max-width: 440px)",withSidebar:"withSidebar-F0WBLDV5",content:"content-F0WBLDV5",tabContent:"tabContent-F0WBLDV5",applyToAllButton:"applyToAllButton-F0WBLDV5"}},15852:e=>{e.exports={themesButtonText:"themesButtonText-w7kgghoW",themesButtonIcon:"themesButtonIcon-w7kgghoW",defaultsButtonText:"defaultsButtonText-w7kgghoW",defaultsButtonItem:"defaultsButtonItem-w7kgghoW",remove:"remove-w7kgghoW"}},40359:e=>{e.exports={separator:"separator-QjUlCDId",small:"small-QjUlCDId",normal:"normal-QjUlCDId",large:"large-QjUlCDId"}},22265:(e,t,i)=>{"use strict";i.d(t,{DialogSidebarItem:()=>u,DialogSidebarWrapper:()=>h});var n,o=i(50959),l=i(97754),a=i.n(l),s=i(9745),r=i(65631),c=i(68648),m=i(69101);function h(e){return o.createElement("div",{className:m.wrapper,...e})}function u(e){const{mode:t,title:i,icon:n,isActive:l,onClick:h,tag:u="div",reference:d,className:b,mobileFontSize:p="medium",showLastDivider:g,useBoldIconsForMobile:v,hideArrow:y,...C}=e,{isMobile:T,isTablet:_}=(0,r.getSidebarMode)(t),S=function(){if(T&&v)return n?.bold;return l?n?.bold:n?.default}();return o.createElement(u,{...C,ref:d,title:_?i:"",className:a()(m.tab,_&&m.isTablet,T&&m.isMobile,l&&m.active,y&&m.withoutArrow,b,_&&"apply-common-tooltip"),onClick:h},n&&o.createElement(s.Icon,{className:m.icon,icon:S}),!_&&o.createElement("span",{className:a()(m.title,!n&&m.withoutIcon,"medium"===p?m.medium:m.large,g&&m.showLastDivider)},o.createElement("span",{className:a()(m.titleText,"apply-overflow-tooltip")},i),T&&!y&&o.createElement(s.Icon,{className:m.nested,icon:c})))}!function(e){e.Medium="medium",e.Large="large"}(n||(n={}))},65631:(e,t,i)=>{"use strict";var n,o;function l(e){return{isMobile:"mobile"===e,isTablet:"tablet"===e}}i.d(t,{getSidebarMode:()=>l}),function(e){e.Bold="bold",e.Default="default"}(n||(n={})),function(e){e.Tablet="tablet",e.Mobile="mobile"}(o||(o={}))},56080:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GeneralChartPropertiesDialogRenderer:()=>he});var n=i(11542),o=i(50959),l=i(97737),a=i(72852),s=i(50182),r=i(66849),c=i(33066),m=i(1765),h=i(3354),u=i(90692),d=i(9745),b=i(37103),p=i(90397),g=i(51613),v=i(22489),y=(i(40167),i(3615));const C=n.t(null,void 0,i(6113));var T=i(50655),_=i(29242),S=i(62576),f=i(51768),k=i(70412),A=i(32563),E=i(71843),w=i(15852);function P(e){const{themeName:t,chartWidgetCollection:i,onRemove:n,manager:l}=e,[a,s]=(0,
k.useHoverDeprecated)(),r=o.useCallback((()=>function(e,t,i,n,o){(0,y.showConfirm)({text:C.format({name:e}),onConfirm:async({dialogClose:i})=>{await(0,v.removeTheme)(e),t&&t(e),i()},onClose:i,onCancel:n},o)}(t,n,void 0,void 0,l)),[t,n,l]),c=o.useCallback((()=>{(0,E.loadTheme)(i,{themeName:t,standardTheme:!1}).then((()=>{(0,f.trackEvent)("GUI","Switch to custom theme")}))}),[t,i]);return o.createElement("div",{...s},o.createElement(p.AccessibleMenuItem,{"data-series-theme-item-theme-name":t,className:w.defaultsButtonItem,isActive:!1,label:t,onClick:c,toolbox:o.createElement(S.MenuRemoveButton,{className:w.remove,hidden:!A.mobiletouch&&!a,onClick:r})}))}var L=i(95276),M=i(73607),B=i(44996);const D=n.t(null,void 0,i(93553)),x=n.t(null,void 0,i(62518)),I=(0,_.appendEllipsis)(n.t(null,void 0,i(76266))),N=n.t(null,void 0,i(77571)),R=b.enabled("chart_template_storage");class F extends o.PureComponent{constructor(e){super(e),this._manager=null,this._reference=o.createRef(),this._handleApplyDefaults=()=>{const{model:e,chartWidgetCollection:t}=this.props;e.restorePreferences();const i=(0,v.getCurrentTheme)().name;(0,E.loadTheme)(t,{themeName:i,standardTheme:!0,applyOverrides:!0,onlyActiveChart:!0})},this._handleSaveAs=()=>{if(R){const{model:e}=this.props;window.runOrSignIn((()=>async function(e,t,n,o){const[l,a]=await Promise.all([Promise.all([i.e(1715),i.e(7648)]).then(i.bind(i,57351)),(0,v.getThemeNames)()]);l.showThemeSaveDialog(e,t,a,n,o)}(e.model().template(),this._syncThemeList,this._handleRenameClose)),{source:"Save theme in chart properties"})}},this._handleRemoveTheme=e=>{this.setState({themes:this.state.themes.filter((t=>t!==e))})},this._syncThemeList=()=>{R&&(0,v.getThemeNames)().then((e=>{this.setState({themes:e})}))},this._handleListboxFocus=e=>{e.target instanceof HTMLElement&&(0,M.handleAccessibleMenuFocus)(e,this._reference)},this._handleRenameClose=()=>{this._reference.current?.focus()},this.state={themes:[]},this._syncThemeList()}componentDidMount(){v.themeListChanged.subscribe(this,this._syncThemeList)}componentWillUnmount(){v.themeListChanged.unsubscribeAll(this)}render(){return o.createElement(T.SlotContext.Consumer,null,(e=>(this._manager=e,o.createElement(u.MatchMedia,{rule:"(max-width: 768px)"},(e=>o.createElement(L.ControlDisclosure,{id:"series-theme-manager",className:!e&&w.themesButtonText,hideArrowButton:e,"data-name":"theme-select",ref:this._reference,buttonChildren:this._getPlaceHolderItem(e),onListboxFocus:this._handleListboxFocus,onListboxKeyDown:M.handleAccessibleMenuKeyDown},this._getThemeItems(e)))))))}_getPlaceHolderItem(e){return e?o.createElement(d.Icon,{className:w.themesButtonIcon,icon:B}):D}_getThemeItems(e){const{isApplyToAllVisible:t,chartWidgetCollection:i,applyToAllCallback:n}=this.props,{themes:l}=this.state;return o.createElement(o.Fragment,null,e&&t&&o.createElement(p.AccessibleMenuItem,{className:w.defaultsButtonItem,isActive:!1,label:N,onClick:n}),o.createElement(p.AccessibleMenuItem,{"data-name":"series-theme-manager-apply-defaults",className:w.defaultsButtonItem,isActive:!1,
label:x,onClick:this._handleApplyDefaults}),R&&o.createElement(p.AccessibleMenuItem,{"data-name":"series-theme-manager-save-as",className:w.defaultsButtonItem,isActive:!1,label:I,onClick:this._handleSaveAs}),l.length>0&&o.createElement(o.Fragment,null,o.createElement(g.PopupMenuSeparator,{key:"separator"}),l.map((e=>o.createElement(P,{key:e,themeName:e,onRemove:this._handleRemoveTheme,chartWidgetCollection:i,manager:this._manager})))))}}var G=i(87713),V=i(71953),W=i(73986),z=i(97754),j=i.n(z),X=i(50238),H=i(26981),K=i(22265),O=i(65631),U=i(69101);const q=(0,o.forwardRef)(((e,t)=>{const[i,n]=(0,X.useRovingTabindexElement)(t),{className:l}=e;return o.createElement(K.DialogSidebarItem,{...e,className:j()(U.accessible,l),tag:"button",reference:i,tabIndex:n})}));function Q(e){const{mode:t,className:i,...n}=e,{isMobile:l,isTablet:a}=(0,O.getSidebarMode)(t),s=j()(U.container,a&&U.isTablet,l&&U.isMobile,i);return o.createElement(H.Toolbar,{...n,className:s,orientation:"vertical",blurOnEscKeydown:!1,blurOnClick:!1,"data-role":"dialog-sidebar"})}var J=i(86656);const Y={areaSymbolMinTick:"normal",areaSymbolTimezone:"normal",barSymbolMinTick:"normal",barSymbolTimezone:"normal",baselineSymbolMinTick:"normal",baselineSymbolTimezone:"normal",bidAskCheckableListGroup:"big",candleSymbolMinTick:"normal",candleSymbolTimezone:"normal",dateFormat:"normal",haSymbolMinTick:"normal",haSymbolTimezone:"normal",hiloSymbolMinTick:"normal",hiloSymbolTimezone:"normal",hiLowCheckableListGroup:"big",hollowCandleSymbolMinTick:"normal",hollowCandleSymbolTimezone:"normal",kagiAtrLength:"normal",kagiReversalAmount:"normal",kagiStyle:"normal",kagiSymbolMinTick:"normal",kagiSymbolTimezone:"normal",lineSymbolMinTick:"normal",lineSymbolTimezone:"normal",sessionId:"normal",lockScale:"normal",mainSeriesSymbolAreaPriceSource:"normal",mainSeriesSymbolBaseLevelPercentage:"normal",mainSeriesSymbolBaseLinePriceSource:"normal",mainSeriesSymbolLinePriceSource:"normal",mainSeriesSymbolStyleType:"normal",navButtons:"big",paneButtons:"big",scalesCurrencyUnit:"big",autoLogButtonsVisibility:"big",pbLb:"normal",pbSymbolMinTick:"normal",pbSymbolTimezone:"normal",pnfAtrLength:"normal",pnfBoxSize:"normal",pnfReversalAmount:"normal",pnfSources:"normal",pnfStyle:"normal",pnfSymbolMinTick:"normal",pnfSymbolTimezone:"normal",prevCloseCheckableListGroup:"big",prePostMarketCheckableListGroup:"big",rangeSymbolMinTick:"normal",rangeSymbolTimezone:"normal",renkoAtrLength:"normal",renkoBoxSize:"normal",renkoStyle:"normal",renkoSymbolMinTick:"normal",renkoSymbolTimezone:"normal",scalesPlacement:"normal",symbolLastValueLabel:"big",symbolTextSource:"normal",symbolCheckableListGroup:"big",studiesCheckableListGroup:"big",tradingNotifications:"normal",tpoSymbolMinTick:"normal",tpoSymbolTimezone:"normal",tradingSoundMelody:"normal",volFootprintSymbolMinTick:"normal",volFootprintSymbolTimezone:"normal",volFootprintRowSize:"normal",volFootprintAtrLength:"normal",volFootprintTicksPerRow:"normal",volFootprintDisplay:"normal",volFootprintType:"normal",volFootprintTableCheckableList:"big",
volFootprintSummaryMode:"big",mainSeriesLinesLabelsGroupVAH:"normal",mainSeriesLinesLabelsGroupVAL:"normal",mainSeriesLinesLabelsGroupPOC:"normal",mainSeriesLinesLabelsGroupPoorHigh:"normal",mainSeriesLinesLabelsGroupPoorLow:"normal",mainSeriesLinesLabelsGroupSingleprints:"normal",mainSeriesVolumeProfileGroupVAL:"normal",mainSeriesVolumeProfileGroupVAH:"normal",mainSeriesVolumeProfileGroupPOC:"normal",watermark:"big"};var Z=i(48199),$=i(24640),ee=i(55647);function te(e){return o.createElement(Z.BackButton,{className:ee.backButton,size:"medium","aria-label":n.t(null,{context:"input"},i(41256)),preservePaddings:!0,flipIconOnRtl:(0,$.isRtl)(),...e})}var ie=i(22692),ne=i(22944);const oe="properties_dialog.last_page_id";class le extends o.PureComponent{constructor(e){super(e),this._renderChildren=({requestResize:e,isSmallWidth:t})=>(this._requestResize=e,o.createElement("div",{className:ne.content},this._renderTabs(t),this._renderTabContent(t))),this._renderApplyToAllButton=()=>o.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletNormal},(e=>this._renderApplyToAll(e))),this._renderFooterLeft=()=>{const{model:e,chartWidgetCollection:t}=this.props,{isApplyToAllVisible:i}=this.state;return o.createElement(F,{model:e,isApplyToAllVisible:i,applyToAllCallback:this._handleApplyToAll,chartWidgetCollection:t})},this._createTabClickHandler=e=>()=>this._selectPage(e),this._selectPage=(e,t)=>{const{activePage:i}=this.state;e!==i&&(i&&i.definitions.unsubscribe(this._onChangeActivePageDefinitions),null!==e&&(t||m.default.setValue(oe,e.id),e.definitions.subscribe(this._onChangeActivePageDefinitions)),this.setState({activePage:e,tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize()})))},this._onChangeActivePageDefinitions=()=>{V.logger.logNormal("Definition collection was updated"),this.setState({tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize()}))},this._onTabVisibilityChanged=()=>{const e=this.props.pages.filter((e=>e.visible.value()));this.setState({visiblePages:e});const t=this.state.activePage;null===t||e.includes(t)||this._selectPage(0===e.length?null:e[0],!0)},this._handleCancel=()=>{this.props.onCancel(),this.props.onClose()},this._handleSubmit=()=>{this.props.onSubmit(),this.props.onClose()},this._handleScroll=()=>{G.globalCloseDelegate.fire()},this._handleApplyToAll=()=>{const{chartWidgetCollection:e,model:t}=this.props,{isApplyToAllVisible:i}=this.state;i&&e.applyPreferencesToAllCharts(t)},this._syncApplyToAllVisibility=()=>{const{chartWidgetCollection:e}=this.props;this.setState({isApplyToAllVisible:(0,h.isMultipleLayout)(e.layout.value())})},this._handleBackClick=()=>{const{activePage:e}=this.state;e&&e.definitions.unsubscribe(this._onChangeActivePageDefinitions),this.setState({activePage:null})},this._handleForceFocus=e=>{(0,ie.updateTabIndexes)(),setTimeout((()=>{const[t]=(0,ie.queryTabbableElements)(e);t&&t.focus()}))};const{pages:t,activePageId:i}=e,n=t.filter((e=>e.visible.value()));let l=n.find((e=>e.id===i))??null;if(!l){const e=m.default.getValue(oe),t=n.find((t=>t.id===e))
;l=t||(n.length>0?n[0]:null)}this.state={activePage:l,visiblePages:n,isApplyToAllVisible:(0,h.isMultipleLayout)(e.chartWidgetCollection.layout.value()),tableKey:Date.now()}}componentDidMount(){const{chartWidgetCollection:e,pages:t}=this.props,{activePage:i}=this.state;e.layout.subscribe(this._syncApplyToAllVisibility),i&&i.definitions.subscribe(this._onChangeActivePageDefinitions),t.forEach((e=>e.visible.subscribe(this._onTabVisibilityChanged)))}componentWillUnmount(){const{chartWidgetCollection:e,pages:t}=this.props,{activePage:i}=this.state;i&&i.definitions.unsubscribe(this._onChangeActivePageDefinitions),e.layout.unsubscribe(this._syncApplyToAllVisibility),t.forEach((e=>e.visible.unsubscribe(this._onTabVisibilityChanged)))}render(){const{isOpened:e,onClose:t,shouldReturnFocus:l}=this.props,{activePage:a}=this.state;return o.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletSmall},(r=>o.createElement(s.AdaptiveConfirmDialog,{className:ne.withSidebar,dataName:"series-properties-dialog",onClose:t,isOpened:e,title:null!==a&&r?a.title:n.t(null,void 0,i(32514)),footerLeftRenderer:this._renderFooterLeft,additionalButtons:this._renderApplyToAllButton(),additionalHeaderElement:null!==a&&r?o.createElement(te,{onClick:this._handleBackClick}):void 0,onSubmit:this._handleSubmit,onForceFocus:this._handleForceFocus,onCancel:this._handleCancel,render:this._renderChildren,submitOnEnterKey:!1,shouldReturnFocus:l})))}_renderTabContent(e){const{pages:t}=this.props,i=this._getCurrentPage(e);if(i){const e=t.find((e=>e.id===i.id)),n=e?e.definitions.value():[];return o.createElement(J.TouchScrollContainer,{className:ne.tabContent,onScroll:this._handleScroll},o.createElement(r.ControlCustomWidthContext.Provider,{value:Y},o.createElement(c.PropertyTable,{key:this.state.tableKey},n.map((e=>o.createElement(a.Section,{key:e.id,definition:e}))))))}return null}_renderTabs(e){const{activePage:t,visiblePages:i}=this.state;if(t&&e)return null;const n=this._getCurrentPage(e);return o.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletNormal},(e=>o.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletSmall},(t=>{const l=t?"mobile":e?"tablet":void 0;return o.createElement(Q,{mode:l,onScroll:this._handleScroll},i.map((e=>o.createElement(q,{key:e.id,mode:l,"data-name":e.id,title:e.title,icon:e.icon,onClick:this._createTabClickHandler(e),isActive:n?e.id===n.id:void 0}))))}))))}_renderApplyToAll(e){const{isApplyToAllVisible:t}=this.state;return!e&&t&&o.createElement("span",{className:ne.applyToAllButton},o.createElement(l.Button,{appearance:"stroke",onClick:this._handleApplyToAll},n.t(null,void 0,i(77571))))}_getCurrentPage(e){const{pages:t}=this.props,{activePage:i}=this.state;let n=null;return i?n=i:!e&&t.length&&(n=t[0]),n}}var ae=i(76422),se=i(38414),re=i(36313),ce=i(87896);const me=n.t(null,void 0,i(32514));class he extends se.DialogRenderer{constructor(e){super(),this._handleClose=()=>{this._rootInstance?.unmount(),this._setVisibility(!1),this._onClose&&this._onClose()},this._handleSubmit=()=>{},this._handleCancel=()=>{
this._model.undoToCheckpoint(this._checkpoint)},this._propertyPages=e.propertyPages,this._model=e.model,this._activePageId=e.activePageId,this._onClose=e.onClose,this._chartWidgetCollection=e.chartWidgetCollection,this._checkpoint=this._ensureCheckpoint(e.undoCheckPoint)}hide(e){e?this._handleCancel():this._handleSubmit(),this._handleClose()}isVisible(){return this.visible().value()}show(e){this.visible().value()||(this._rootInstance=(0,ce.createReactRoot)(o.createElement(le,{title:me,isOpened:!0,onSubmit:this._handleSubmit,onClose:this._handleClose,onCancel:this._handleCancel,pages:this._propertyPages,model:this._model,activePageId:this._activePageId,chartWidgetCollection:this._chartWidgetCollection,shouldReturnFocus:e?.shouldReturnFocus}),this._container),this._setVisibility(!0),ae.emit("edit_object_dialog",{objectType:"mainSeries",scriptTitle:this._model.mainSeries().title(re.TitleDisplayTarget.StatusLine)}))}_ensureCheckpoint(e){return void 0===e&&(e=this._model.createUndoCheckpoint()),e}}},51613:(e,t,i)=>{"use strict";i.d(t,{PopupMenuSeparator:()=>r});var n,o=i(50959),l=i(97754),a=i.n(l),s=i(40359);function r(e){const{size:t="normal",className:i,ariaHidden:n=!1}=e;return o.createElement("div",{className:a()(s.separator,"small"===t&&s.small,"normal"===t&&s.normal,"large"===t&&s.large,i),role:"separator","aria-hidden":n})}!function(e){e.Small="small",e.Large="large",e.Normal="normal"}(n||(n={}))},11098:e=>{e.exports={accessible:"accessible-NQERJsv9",active:"active-NQERJsv9"}},11064:e=>{e.exports={button:"button-Y1TCZogJ",active:"active-Y1TCZogJ"}},90397:(e,t,i)=>{"use strict";i.d(t,{AccessibleMenuItem:()=>m});var n=i(50959),o=i(97754),l=i.n(o),a=i(3343),s=i(50238),r=i(16396),c=i(11098);function m(e){const{className:t,reference:i,...o}=e,[m,h]=(0,s.useRovingTabindexElement)(i??null);return n.createElement(r.PopupMenuItem,{...o,className:l()(c.accessible,e.isActive&&c.active,t),reference:m,tabIndex:h,onKeyDown:function(e){if(e.target!==e.currentTarget)return;const t=(0,a.hashFromEvent)(e);13!==t&&32!==t||(e.preventDefault(),m.current instanceof HTMLElement&&m.current.click())},"data-role":"menuitem","aria-disabled":e.isDisabled||void 0,toolboxRole:"toolbar"})}},62576:(e,t,i)=>{"use strict";i.d(t,{MenuRemoveButton:()=>h});var n=i(50959),o=i(97754),l=i.n(o),a=i(11542),s=i(50238),r=i(96040),c=i(60925),m=i(11064);function h(e){const{onClick:t,isActive:o,onKeyDown:h,...u}=e,[d,b]=(0,s.useRovingTabindexElement)(null);return n.createElement("button",{ref:d,tabIndex:b,onClick:t,onKeyDown:h,className:l()(m.button,o&&m.active,"apply-common-tooltip"),"aria-label":a.t(null,void 0,i(67410)),"data-tooltip":a.t(null,void 0,i(67410)),type:"button"},n.createElement(r.RemoveButton,{...u,isActive:o,title:"",icon:c}))}},68648:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentcolor" stroke-width="1.3" d="M12 9l5 5-5 5"/></svg>'}}]);