(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[2306],{66783:t=>{"use strict";var e=Object.prototype.hasOwnProperty;function o(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}t.exports=function(t,i){if(o(t,i))return!0;if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;var n=Object.keys(t),s=Object.keys(i);if(n.length!==s.length)return!1;for(var r=0;r{t.exports={}},51338:t=>{t.exports={}},1414:t=>{t.exports={button:"button-D4RPB3ZC",content:"content-D4RPB3ZC","icon-only":"icon-only-D4RPB3ZC",link:"link-D4RPB3ZC","color-brand":"color-brand-D4RPB3ZC","variant-primary":"variant-primary-D4RPB3ZC","variant-secondary":"variant-secondary-D4RPB3ZC","color-gray":"color-gray-D4RPB3ZC","color-green":"color-green-D4RPB3ZC","color-red":"color-red-D4RPB3ZC","color-black":"color-black-D4RPB3ZC","size-xsmall":"size-xsmall-D4RPB3ZC","start-icon-wrap":"start-icon-wrap-D4RPB3ZC","end-icon-wrap":"end-icon-wrap-D4RPB3ZC","with-start-icon":"with-start-icon-D4RPB3ZC","with-end-icon":"with-end-icon-D4RPB3ZC","size-small":"size-small-D4RPB3ZC","size-medium":"size-medium-D4RPB3ZC","size-large":"size-large-D4RPB3ZC","size-xlarge":"size-xlarge-D4RPB3ZC",animated:"animated-D4RPB3ZC",stretch:"stretch-D4RPB3ZC",grouped:"grouped-D4RPB3ZC","adjust-position":"adjust-position-D4RPB3ZC","first-row":"first-row-D4RPB3ZC","first-col":"first-col-D4RPB3ZC","no-corner-top-left":"no-corner-top-left-D4RPB3ZC","no-corner-top-right":"no-corner-top-right-D4RPB3ZC","no-corner-bottom-right":"no-corner-bottom-right-D4RPB3ZC","no-corner-bottom-left":"no-corner-bottom-left-D4RPB3ZC","text-wrap":"text-wrap-D4RPB3ZC","multiline-content":"multiline-content-D4RPB3ZC","secondary-text":"secondary-text-D4RPB3ZC","primary-text":"primary-text-D4RPB3ZC"}},70132:t=>{t.exports={}},19619:t=>{t.exports={}},12005:t=>{t.exports={wrap:"wrap-Nn3SCuEL",icon:"icon-Nn3SCuEL",colorBg:"colorBg-Nn3SCuEL",color:"color-Nn3SCuEL",multicolor:"multicolor-Nn3SCuEL",white:"white-Nn3SCuEL"}},31188:t=>{t.exports={button:"button-BuUjli6L"}},20835:t=>{t.exports={item:"item-KdWj36gM",withIcon:"withIcon-KdWj36gM",icon:"icon-KdWj36gM",labelRow:"labelRow-KdWj36gM",multiWidth:"multiWidth-KdWj36gM",buttonWrap:"buttonWrap-KdWj36gM",buttonLabel:"buttonLabel-KdWj36gM"}},93402:t=>{t.exports={container:"container-mdcOkvbj",sectionTitle:"sectionTitle-mdcOkvbj",separator:"separator-mdcOkvbj",customButton:"customButton-mdcOkvbj"}},80679:t=>{t.exports={container:"container-iiEYaqPD",form:"form-iiEYaqPD",swatch:"swatch-iiEYaqPD",inputWrap:"inputWrap-iiEYaqPD",inputHash:"inputHash-iiEYaqPD",input:"input-iiEYaqPD",buttonWrap:"buttonWrap-iiEYaqPD",hueSaturationWrap:"hueSaturationWrap-iiEYaqPD",saturation:"saturation-iiEYaqPD",hue:"hue-iiEYaqPD"}},1369:t=>{t.exports={hue:"hue-r4uo5Wn6",pointer:"pointer-r4uo5Wn6",pointerContainer:"pointerContainer-r4uo5Wn6"}},30099:t=>{t.exports={opacity:"opacity-EnWts7Xu",opacitySlider:"opacitySlider-EnWts7Xu", opacitySliderGradient:"opacitySliderGradient-EnWts7Xu",pointer:"pointer-EnWts7Xu",dragged:"dragged-EnWts7Xu",opacityPointerWrap:"opacityPointerWrap-EnWts7Xu",opacityInputWrap:"opacityInputWrap-EnWts7Xu",opacityInput:"opacityInput-EnWts7Xu",opacityInputPercent:"opacityInputPercent-EnWts7Xu"}},35257:t=>{t.exports={saturation:"saturation-NFNfqP2w",pointer:"pointer-NFNfqP2w"}},87466:t=>{t.exports={swatches:"swatches-sfn7Lezv",swatch:"swatch-sfn7Lezv",hover:"hover-sfn7Lezv",empty:"empty-sfn7Lezv",white:"white-sfn7Lezv",selected:"selected-sfn7Lezv",contextItem:"contextItem-sfn7Lezv"}},94720:(t,e,o)=>{"use strict";o.d(e,{Button:()=>w});var i=o(50959),n=o(97754),s=o(95604),r=o(9745),a=o(1414),l=o.n(a);function c(t){const{color:e="brand",size:o="medium",variant:i="primary",stretch:r=!1,icon:a,startIcon:c,endIcon:d,iconOnly:h=!1,className:p,isGrouped:u,cellState:g,disablePositionAdjustment:_=!1,primaryText:m,secondaryText:v,isAnchor:y=!1}=t,w=function(t){let e="";return 0!==t&&(1&t&&(e=n(e,l()["no-corner-top-left"])),2&t&&(e=n(e,l()["no-corner-top-right"])),4&t&&(e=n(e,l()["no-corner-bottom-right"])),8&t&&(e=n(e,l()["no-corner-bottom-left"]))),e}((0,s.getGroupCellRemoveRoundBorders)(g));return n(p,l().button,l()[`size-${o}`],l()[`color-${e}`],l()[`variant-${i}`],r&&l().stretch,(a||c)&&l()["with-start-icon"],d&&l()["with-end-icon"],h&&l()["icon-only"],w,u&&l().grouped,u&&!_&&l()["adjust-position"],u&&g.isTop&&l()["first-row"],u&&g.isLeft&&l()["first-col"],m&&v&&l()["multiline-content"],y&&l().link)}function d(t){const{startIcon:e,icon:o,iconOnly:n,children:s,endIcon:a,primaryText:c,secondaryText:d}=t,h=null!=e?e:o,p=!(e||o||a||n)&&!s&&c&&d;return i.createElement(i.Fragment,null,h&&i.createElement(r.Icon,{icon:h,className:l()["start-icon-wrap"]}),s&&i.createElement("span",{className:l().content},s),a&&!n&&i.createElement(r.Icon,{icon:a,className:l()["end-icon-wrap"]}),p&&function(t){return t.primaryText&&t.secondaryText&&i.createElement("div",{className:l()["text-wrap"]},i.createElement("span",{className:l()["primary-text"]}," ",t.primaryText," "),"string"==typeof t.secondaryText?i.createElement("span",{className:l()["secondary-text"]}," ",t.secondaryText," "):i.createElement("span",{className:l()["secondary-text"]},i.createElement("span",null,t.secondaryText.firstLine),i.createElement("span",null,t.secondaryText.secondLine)))}(t))}var h=o(86332),p=o(90186);function u(t){const{className:e,color:o,variant:i,size:n,stretch:s,animated:r,icon:a,iconOnly:l,startIcon:c,endIcon:d,primaryText:h,secondaryText:u,...g}=t;return{...g,...(0,p.filterDataProps)(t),...(0,p.filterAriaProps)(t)}}function g(t){const{reference:e,...o}=t,{isGrouped:n,cellState:s,disablePositionAdjustment:r}=(0,i.useContext)(h.ControlGroupContext),a=c({...o,isGrouped:n,cellState:s,disablePositionAdjustment:r});return i.createElement("button",{...u(o),className:a,ref:e},i.createElement(d,{...o}))}function _(t="default"){switch(t){case"default":return"primary";case"stroke":return"secondary"}}function m(t="primary"){switch(t){case"primary":return"brand";case"success": return"green";case"default":return"gray";case"danger":return"red"}}function v(t="m"){switch(t){case"s":return"xsmall";case"m":return"small";case"l":return"large"}}function y(t){const{intent:e,size:o,appearance:i,useFullWidth:n,icon:s,...r}=t;return{...r,color:m(e),size:v(o),variant:_(i),stretch:n,startIcon:s}}function w(t){return i.createElement(g,{...y(t)})}},86332:(t,e,o)=>{"use strict";o.d(e,{ControlGroupContext:()=>i});const i=o(50959).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},95604:(t,e,o)=>{"use strict";function i(t){let e=0;return t.isTop&&t.isLeft||(e+=1),t.isTop&&t.isRight||(e+=2),t.isBottom&&t.isLeft||(e+=8),t.isBottom&&t.isRight||(e+=4),e}o.d(e,{getGroupCellRemoveRoundBorders:()=>i})},56073:(t,e,o)=>{"use strict";function i(t,e=!1){const o=getComputedStyle(t),i=[o.height];return"border-box"!==o.boxSizing&&i.push(o.paddingTop,o.paddingBottom,o.borderTopWidth,o.borderBottomWidth),e&&i.push(o.marginTop,o.marginBottom),i.reduce(((t,e)=>t+(parseFloat(e)||0)),0)}function n(t,e=!1){const o=getComputedStyle(t),i=[o.width];return"border-box"!==o.boxSizing&&i.push(o.paddingLeft,o.paddingRight,o.borderLeftWidth,o.borderRightWidth),e&&i.push(o.marginLeft,o.marginRight),i.reduce(((t,e)=>t+(parseFloat(e)||0)),0)}o.d(e,{outerHeight:()=>i,outerWidth:()=>n})},70114:(t,e,o)=>{"use strict";o.d(e,{ColorPickerButton:()=>m});var i=o(50959),n=o(97754),s=o.n(n),r=o(50151),a=o(9745),l=o(24377),c=o(87095),d=o(56512),h=o(27797),p=o(6914),u=o(8087),g=o(43982),_=o(12005);function m(t){const{property:e,icon:o,propertyApplier:n,title:m,undoText:v,className:y}=t,w=(0,g.useProperty)(e),b=(0,i.useRef)(null),f=w?(0,l.parseRgba)(w)[3]:void 0,C=""===w,P=String(W()).toLowerCase()===p.white,[S,x,T]=(0,d.useCustomColors)();return i.createElement(u.ToolWidgetMenu,{className:y,content:i.createElement("div",{className:_.wrap},i.createElement(a.Icon,{className:_.icon,icon:o}),i.createElement("div",{className:_.colorBg},i.createElement("div",{className:s()(_.color,C&&_.multicolor,P&&_.white),style:C?void 0:{backgroundColor:w}}))),arrow:!1,title:m,ref:b,"data-name":t["data-name"],menuDataName:`${t["data-name"]}-menu`},i.createElement(h.ColorPicker,{color:W(),opacity:f,onColorChange:function(t,e){const o=w?(0,c.alphaToTransparency)((0,l.parseRgba)(w)[3]):0;E((0,c.generateColor)(String(t),o,true)),e||(0,r.ensureNotNull)(b.current).close()},onOpacityChange:function(t){E((0,c.generateColor)(w,(0,c.alphaToTransparency)(t),!0))},selectOpacity:void 0!==f,selectCustom:!0,customColors:S,onAddColor:function(t){x(t),(0,r.ensureNotNull)(b.current).close()},onRemoveCustomColor:T}));function W(){return w?(0,l.rgbToHexString)((0,l.parseRgb)(w)):null}function E(t){n.setProperty(e,t,v)}}},61259:(t,e,o)=>{"use strict";o.d(e,{LineWidthButton:()=>w});var i=o(50959),n=o(97754),s=o(50151),r=o(9745),a=o(8087),l=o(43982),c=o(16396),d=o(40173),h=o(22978),p=o(14631),u=o(6096),g=o(6483),_=o(66611),m=o(20835);const v=(0,d.mergeThemes)(c.DEFAULT_POPUP_MENU_ITEM_THEME,m),y=[{value:1,icon:h},{value:2,icon:p},{value:3,icon:u},{value:4, icon:g}];function w(t){const{multipleProperty:e,title:o,undoText:d,propertyApplier:h,className:p,isSmallScreen:u}=t,g=(0,l.useProperty)((0,s.ensureDefined)(e)),w="mixed"===g||!g,b=function(t){const e=y.find((e=>e.value===t));if(!e)return _;return e.icon}(g);return i.createElement(a.ToolWidgetMenu,{className:p,arrow:!1,title:o,"data-name":t["data-name"],menuDataName:`${t["data-name"]}-menu`,content:i.createElement("div",null,w?i.createElement("div",{className:m.multiWidth},i.createElement(r.Icon,{icon:_})):i.createElement("div",{className:m.buttonWrap},!u&&i.createElement(r.Icon,{icon:b}),i.createElement("div",{className:n(!u&&m.buttonLabel)},`${g}px`)))},y.map((({value:t,icon:e})=>i.createElement(c.PopupMenuItem,{key:t,theme:v,label:`${t}px`,icon:e,isActive:t===g,onClick:f,onClickArg:t}))));function f(t){t&&e&&(h.beginUndoMacro(d),e.setValue(t,void 0,{applyValue:(t,e)=>{h.setProperty(t,e,d)}}),h.endUndoMacro())}}},43982:(t,e,o)=>{"use strict";o.d(e,{useProperty:()=>n});var i=o(50959);const n=t=>{const[e,o]=(0,i.useState)(t.value());return(0,i.useEffect)((()=>{const e=t=>{o(t.value())};e(t);const i={};return t.subscribe(i,e),()=>t.unsubscribe(i,e)}),[t]),e}},27797:(t,e,o)=>{"use strict";o.d(e,{ColorPicker:()=>D});var i=o(50959),n=o(97754),s=o.n(n),r=o(44352),a=o(24377),l=o(50151),c=o(49483),d=o(20520),h=o(16396);const p=i.createContext(void 0);var u=o(6914),g=o(35149),_=o(87466);function m(t){const{index:e,color:s,selected:a,onSelect:m}=t,[v,y]=(0,i.useState)(!1),w=(0,i.useContext)(p),b=(0,i.useRef)(null),f=Boolean(w)&&!c.CheckMobile.any();return i.createElement(i.Fragment,null,i.createElement("div",{ref:b,style:s?{color:s}:void 0,className:n(_.swatch,v&&_.hover,a&&_.selected,!s&&_.empty,String(s).toLowerCase()===u.white&&_.white),onClick:function(){m(s)},onContextMenu:f?C:void 0}),f&&i.createElement(d.PopupMenu,{isOpened:v,onClose:C,position:function(){const t=(0,l.ensureNotNull)(b.current).getBoundingClientRect();return{x:t.left,y:t.top+t.height+4}},onClickOutside:C},i.createElement(h.PopupMenuItem,{className:_.contextItem,label:r.t(null,void 0,o(54336)),icon:g,onClick:function(){C(),(0,l.ensureDefined)(w)(e)},dontClosePopup:!0})));function C(){y(!v)}}class v extends i.PureComponent{constructor(){super(...arguments),this._onSelect=t=>{const{onSelect:e}=this.props;e&&e(t)}}render(){const{colors:t,color:e,children:o}=this.props;if(!t)return null;const n=e?(0,a.parseRgb)(String(e)):void 0;return i.createElement("div",{className:_.swatches},t.map(((t,e)=>i.createElement(m,{key:String(t)+e,index:e,color:t,selected:n&&(0,a.areEqualRgb)(n,(0,a.parseRgb)(String(t))),onSelect:this._onSelect}))),o)}}var y=o(54368),w=o(94720);function b(t){const e=`Invalid RGB color: ${t}`;if(null===t)throw new Error(e);const o=t.match(/^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i);if(null===o)throw new Error(e);const[,i,n,s]=o;if(!i||!n||!s)throw new Error(e);const r=parseInt(i,16)/255,a=parseInt(n,16)/255,l=parseInt(s,16)/255,c=Math.max(r,a,l),d=Math.min(r,a,l);let h;const p=c,u=c-d,g=0===c?0:u/c;if(c===d)h=0;else{switch(c){case r: h=(a-l)/u+(a{this._container=t},this._handlePosition=t=>{const{hsv:{h:e},onChange:o}=this.props;if(!o)return;const i=(0,l.ensureNotNull)(this._container).getBoundingClientRect(),n=t.clientX-i.left,s=t.clientY-i.top;let r=n/i.width;r<0?r=0:r>1&&(r=1);let a=1-s/i.height;a<0?a=0:a>1&&(a=1),o({h:e,s:r,v:a})},this._mouseDown=t=>{window.addEventListener("mouseup",this._mouseUp),window.addEventListener("mousemove",this._mouseMove)},this._mouseUp=t=>{window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._handlePosition(t)},this._mouseMove=(0,f.default)(this._handlePosition,100),this._handleTouch=t=>{this._handlePosition(t.nativeEvent.touches[0])}}render(){const{className:t,hsv:{h:e,s:o,v:n}}=this.props,r=`hsl(${360*e}, 100%, 50%)`;return i.createElement("div",{className:s()(C.saturation,t),style:{backgroundColor:r},ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},i.createElement("div",{className:C.pointer,style:{left:100*o+"%",top:100*(1-n)+"%"}}))}}var S=o(1369);class x extends i.PureComponent{constructor(){super(...arguments),this._container=null,this._refContainer=t=>{this._container=t},this._handlePosition=t=>{const{hsv:{s:e,v:o},onChange:i}=this.props;if(!i)return;const n=(0,l.ensureNotNull)(this._container).getBoundingClientRect();let s=(t.clientY-n.top)/n.height;s<0?s=0:s>1&&(s=1),i({h:s,s:e,v:o})},this._mouseDown=t=>{window.addEventListener("mouseup",this._mouseUp),window.addEventListener("mousemove",this._mouseMove)},this._mouseUp=t=>{window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._handlePosition(t)},this._mouseMove=(0,f.default)(this._handlePosition,100),this._handleTouch=t=>{this._handlePosition(t.nativeEvent.touches[0])}}render(){const{className:t,hsv:{h:e}}=this.props;return i.createElement("div",{className:s()(S.hue,t)},i.createElement("div",{className:S.pointerContainer,ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},i.createElement("div",{className:S.pointer,style:{top:100*e+"%"}})))}}var T=o(80679);const W="#000000",E=r.t(null,{context:"Color Picker"},o(40276));class L extends i.PureComponent{constructor(t){super(t),this._handleHSV=t=>{const e=function(t){const{h:e,s:o,v:i}=t;let n,s,r;const a=Math.floor(6*e),l=6*e-a,c=i*(1-o),d=i*(1-l*o),h=i*(1-(1-l)*o);switch(a%6){case 0:n=i,s=h,r=c;break;case 1:n=d,s=i,r=c;break;case 2:n=c,s=i,r=h;break;case 3:n=c,s=d,r=i;break;case 4:n=h,s=c,r=i;break;case 5:n=i,s=c,r=d;break;default:n=0,s=0,r=0}return"#"+[255*n,255*s,255*r].map((t=>("0"+Math.round(t).toString(16)).replace(/.+?([a-f0-9]{2})$/i,"$1"))).join("")}(t)||W;this.setState({color:e,inputColor:e.replace(/^#/,""),hsv:t}), this.props.onSelect(e)},this._handleInput=t=>{const e=t.currentTarget.value;try{const t=b(e),o=`#${e}`;this.setState({color:o,inputColor:e,hsv:t}),this.props.onSelect(o)}catch(t){this.setState({inputColor:e})}},this._handleAddColor=()=>this.props.onAdd(this.state.color);const e=t.color||W;this.state={color:e,inputColor:e.replace(/^#/,""),hsv:b(e)}}render(){const{color:t,hsv:e,inputColor:o}=this.state;return i.createElement("div",{className:T.container},i.createElement("div",{className:T.form},i.createElement("div",{className:T.swatch,style:{backgroundColor:t}}),i.createElement("div",{className:T.inputWrap},i.createElement("span",{className:T.inputHash},"#"),i.createElement("input",{type:"text",className:T.input,value:o,onChange:this._handleInput})),i.createElement("div",{className:T.buttonWrap},i.createElement(w.Button,{size:"s",onClick:this._handleAddColor},E))),i.createElement("div",{className:T.hueSaturationWrap},i.createElement(P,{className:T.saturation,hsv:e,onChange:this._handleHSV}),i.createElement(x,{className:T.hue,hsv:e,onChange:this._handleHSV})))}}var B=o(93402);const k=r.t(null,{context:"Color Picker"},o(53585)),N=r.t(null,{context:"Color Picker"},o(81865));class D extends i.PureComponent{constructor(t){super(t),this._handleAddColor=t=>{this.setState({isCustom:!1}),this._onToggleCustom(!1);const{onAddColor:e}=this.props;e&&e(t)},this._handleSelectColor=t=>{const{onColorChange:e}=this.props,{isCustom:o}=this.state;e&&e(t,o)},this._handleCustomClick=()=>{this.setState({isCustom:!0}),this._onToggleCustom(!0)},this._handleOpacity=t=>{const{onOpacityChange:e}=this.props;e&&e(t)},this.state={isCustom:!1}}componentDidUpdate(t,e){t.selectOpacity!==this.props.selectOpacity&&this.props.menu&&this.props.menu.update()}render(){const{color:t,opacity:e,selectCustom:o,selectOpacity:n,customColors:r,onRemoveCustomColor:a}=this.props,{isCustom:l}=this.state,c="number"==typeof e?e:1;return l?i.createElement(L,{color:t,onSelect:this._handleSelectColor,onAdd:this._handleAddColor}):i.createElement("div",{className:B.container},i.createElement(v,{colors:u.basic,color:t,onSelect:this._handleSelectColor}),i.createElement(v,{colors:u.extended,color:t,onSelect:this._handleSelectColor}),i.createElement("div",{className:B.separator}),i.createElement(p.Provider,{value:a},i.createElement(v,{colors:r,color:t,onSelect:this._handleSelectColor},o&&i.createElement("div",{className:s()(B.customButton,"apply-common-tooltip"),onClick:this._handleCustomClick,title:k}))),n&&i.createElement(i.Fragment,null,i.createElement("div",{className:B.sectionTitle},N),i.createElement(y.Opacity,{color:t,opacity:c,onChange:this._handleOpacity})))}_onToggleCustom(t){const{onToggleCustom:e}=this.props;e&&e(t)}}},54368:(t,e,o)=>{"use strict";o.d(e,{Opacity:()=>l});var i=o(50959),n=o(97754),s=o(50151),r=o(37160),a=o(30099);class l extends i.PureComponent{constructor(t){super(t),this._container=null,this._pointer=null,this._raf=null,this._refContainer=t=>{this._container=t},this._refPointer=t=>{this._pointer=t},this._handlePosition=t=>{ null===this._raf&&(this._raf=requestAnimationFrame((()=>{const e=(0,s.ensureNotNull)(this._container),o=(0,s.ensureNotNull)(this._pointer),i=e.getBoundingClientRect(),n=o.offsetWidth,a=t.clientX-n/2-i.left,l=(0,r.clamp)(a/(i.width-n),0,1);this.setState({inputOpacity:Math.round(100*l).toString()}),this.props.onChange(l),this._raf=null})))},this._onSliderClick=t=>{this._handlePosition(t.nativeEvent),this._dragSubscribe()},this._mouseUp=t=>{this.setState({isPointerDragged:!1}),this._dragUnsubscribe(),this._handlePosition(t)},this._mouseMove=t=>{this.setState({isPointerDragged:!0}),this._handlePosition(t)},this._onTouchStart=t=>{this._handlePosition(t.nativeEvent.touches[0])},this._handleTouch=t=>{this.setState({isPointerDragged:!0}),this._handlePosition(t.nativeEvent.touches[0])},this._handleTouchEnd=()=>{this.setState({isPointerDragged:!1})},this._handleInput=t=>{const e=t.currentTarget.value,o=Number(e)/100;this.setState({inputOpacity:e}),Number.isNaN(o)||o>1||this.props.onChange(o)},this.state={inputOpacity:Math.round(100*t.opacity).toString(),isPointerDragged:!1}}componentWillUnmount(){null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null),this._dragUnsubscribe()}render(){const{color:t,opacity:e,hideInput:o}=this.props,{inputOpacity:s,isPointerDragged:r}=this.state,l={color:t||void 0};return i.createElement("div",{className:a.opacity},i.createElement("div",{className:a.opacitySlider,style:l,ref:this._refContainer,onMouseDown:this._onSliderClick,onTouchStart:this._onTouchStart,onTouchMove:this._handleTouch,onTouchEnd:this._handleTouchEnd},i.createElement("div",{className:a.opacitySliderGradient,style:{backgroundImage:`linear-gradient(90deg, transparent, ${t})`}}),i.createElement("div",{className:a.opacityPointerWrap},i.createElement("div",{className:n(a.pointer,r&&a.dragged),style:{left:100*e+"%"},ref:this._refPointer}))),!o&&i.createElement("div",{className:a.opacityInputWrap},i.createElement("input",{type:"text",className:a.opacityInput,value:s,onChange:this._handleInput}),i.createElement("span",{className:a.opacityInputPercent},"%")))}_dragSubscribe(){const t=(0,s.ensureNotNull)(this._container).ownerDocument;t&&(t.addEventListener("mouseup",this._mouseUp),t.addEventListener("mousemove",this._mouseMove))}_dragUnsubscribe(){const t=(0,s.ensureNotNull)(this._container).ownerDocument;t&&(t.removeEventListener("mousemove",this._mouseMove),t.removeEventListener("mouseup",this._mouseUp))}}},6914:(t,e,o)=>{"use strict";o.d(e,{basic:()=>a,extended:()=>c,white:()=>n});var i=o(48891);const n=i.colorsPalette["color-white"],s=["ripe-red","tan-orange","banana-yellow","iguana-green","minty-green","sky-blue","tv-blue","deep-blue","grapes-purple","berry-pink"],r=[200,300,400,500,600,700,800,900].map((t=>`color-cold-gray-${t}`));r.unshift("color-white"),r.push("color-black"),s.forEach((t=>{r.push(`color-${t}-500`)}));const a=r.map((t=>i.colorsPalette[t])),l=[];[100,200,300,400,700,900].forEach((t=>{s.forEach((e=>{l.push(`color-${e}-${t}`)}))}));const c=l.map((t=>i.colorsPalette[t]))},56512:(t,e,o)=>{"use strict" ;o.d(e,{useCustomColors:()=>l});var i=o(50959),n=o(56840),s=o(76422);function r(t,e){(0,i.useEffect)((()=>(s.subscribe(t,e,null),()=>{s.unsubscribe(t,e,null)})),[t,e])}var a=o(24377);function l(){const[t,e]=(0,i.useState)((0,n.getJSON)("pickerCustomColors",[]));r("add_new_custom_color",(o=>e(c(o,t)))),r("remove_custom_color",(o=>e(d(o,t))));const o=(0,i.useCallback)((e=>{const o=e?(0,a.parseRgb)(e):null;t.some((t=>null!==t&&null!==o&&(0,a.areEqualRgb)((0,a.parseRgb)(t),o)))||(s.emit("add_new_custom_color",e),(0,n.setJSON)("pickerCustomColors",c(e,t)))}),[t]),l=(0,i.useCallback)((e=>{(e>=0||e29&&o.shift(),o}function d(t,e){return e.filter(((e,o)=>t!==o))}},84877:(t,e,o)=>{"use strict";o.d(e,{MatchMediaMap:()=>r});var i=o(50959),n=o(66783),s=o.n(n);class r extends i.Component{constructor(t){super(t),this._handleMediaChange=()=>{const t=l(this.state.queries,((t,e)=>e.matches));let e=!1;for(const o in t)if(t.hasOwnProperty(o)&&this.state.matches[o]!==t[o]){e=!0;break}e&&this.setState({matches:t})};const{rules:e}=this.props;this.state=a(e)}shouldComponentUpdate(t,e){return!s()(t,this.props)||(!s()(e.rules,this.state.rules)||!s()(e.matches,this.state.matches))}componentDidMount(){this._migrate(null,this.state.queries)}componentDidUpdate(t,e){s()(t.rules,this.props.rules)||this._migrate(e.queries,this.state.queries)}componentWillUnmount(){this._migrate(this.state.queries,null)}render(){return this.props.children(this.state.matches)}static getDerivedStateFromProps(t,e){if(s()(t.rules,e.rules))return null;const{rules:o}=t;return a(o)}_migrate(t,e){null!==t&&l(t,((t,e)=>{e.removeListener(this._handleMediaChange)})),null!==e&&l(e,((t,e)=>{e.addListener(this._handleMediaChange)}))}}function a(t){const e=l(t,((t,e)=>window.matchMedia(e)));return{queries:e,matches:l(e,((t,e)=>e.matches)),rules:{...t}}}function l(t,e){const o={};for(const i in t)t.hasOwnProperty(i)&&(o[i]=e(i,t[i]));return o}},9629:(t,e,o)=>{"use strict";o.r(e),o.d(e,{FavoriteDrawingToolbar:()=>v});var i=o(44352),n=o(3809),s=o(71810),r=(o(50151),o(32563)),a=o(70027),l=o(39347),c=o(10643),d=o(88348),h=o(54819),p=o(56840),u=o(11417),g=o(58275),_=o.n(g),m=o(18341);o(70132);class v extends n.FloatingToolbar{constructor(t){super({allowSortable:!r.mobiletouch,dragOnlyInsideToolbar:!0,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition",positionStorageType:"device"}),this._linetoolsWidgets={},this._canBeShownValue=new(_())(!1),this._attachHandlers(),this._loadVisibilityState(),this._hideAction=this._createHideToolbarAction()}show(){this._canBeShownValue.value()&&(this.isVisible()||this._renderAllLinetools(),super.show())}showAndSaveSettingsValue(){this._canBeShownValue.value()&&(u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible","true"),this.show())}hideAndSaveSettingsValue(){u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible","false"),this.hide()} canBeShown(){return this._canBeShownValue.readonly()}_onFavoriteAdded(t){this.addWidget(this._createLinetoolWidget(t)),s.LinetoolsFavoritesStore.favorites().filter(y).length>0&&(this._canBeShownValue.setValue(!0),this.showAndSaveSettingsValue())}_onFavoriteRemoved(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===s.LinetoolsFavoritesStore.favorites().filter(y).length&&(this._canBeShownValue.setValue(!1),this.hide())}_onFavoriteMoved(){this._renderAllLinetools()}_onSelectedLinetoolChanged(t){Object.keys(this._linetoolsWidgets).forEach((e=>{this._linetoolsWidgets[e].classList.toggle("i-active",t===e)}))}_createLinetoolWidget(t){const e=`${h.lineToolsInfo[t].icon}`,o=(0,a.parseHtmlElement)(e);return o.addEventListener("click",(async e=>{e.preventDefault(),await(0,m.initLineTool)(t),d.tool.value()!==t&&d.tool.setValue(t)})),this._linetoolsWidgets[t]=o,o}_renderAllLinetools(){this._linetoolsWidgets={},this.removeWidgets(),s.LinetoolsFavoritesStore.favorites().filter((t=>h.lineToolsInfo[t]&&!0)).forEach((t=>{this.addWidget(this._createLinetoolWidget(t))}))}_attachHandlers(){s.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),s.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),s.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),s.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,(()=>{this._loadVisibilityState(),this._renderAllLinetools()})),this.onWidgetsReordered().subscribe(this,((t,e)=>{if(s.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(this,this._onFavoriteMoved),!s.LinetoolsFavoritesStore.moveFavorite(s.LinetoolsFavoritesStore.favorite(t),e))throw new Error("Something went wrong");s.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved)})),this.onContextMenu((t=>{t.preventDefault(),c.ContextMenuManager.showMenu([this._hideAction],t)})),d.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))}_createHideToolbarAction(){return new l.Action({actionId:"Chart.FavoriteDrawingToolsToolbar.Hide",label:i.t(null,void 0,o(74813)),onExecute:()=>{this.hideAndSaveSettingsValue()}})}_loadVisibilityState(){const t=s.LinetoolsFavoritesStore.favorites().filter(y).length>0;this._canBeShownValue.setValue(t);const e=s.LinetoolsFavoritesStore.favoritesCount()>0;let o;const i=p.getValue("ChartFavoriteDrawingToolbarWidget.visible");void 0!==i?(p.remove("ChartFavoriteDrawingToolbarWidget.visible",{forceFlush:!0}),o="false"!==i,u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible",i)):o="false"!==u.TVLocalStorage.getItem("ChartFavoriteDrawingToolbarWidget.visible"),o&&e?this.show():this.hide()}}function y(t){return!0}},3809:(t,e,o)=>{"use strict";o.d(e,{FLOATING_TOOLBAR_REACT_WIDGETS_CLASS:()=>C,FloatingToolbar:()=>S}) ;var i=o(59064),n=o(32563),s=o(61345),r=o(56840),a=o(57898),l=o.n(a),c=o(58275),d=o.n(c),h=o(38881);class p extends h.ChunkLoader{_startLoading(){return Promise.all([o.e(1553),o.e(2377)]).then(o.bind(o,13367)).then((t=>t.HammerJS))}}var u=o(11417),g=o(50151),_=o(56073);var m=o(49483);class v{constructor(t){var e,o;this._helper=null,this._handleDragStart=t=>{var e;if(null!==this._helper)return;const o=this._source;o.classList.add("ui-draggable-dragging");const[i,n]=[(0,_.outerWidth)(o),(0,_.outerHeight)(o)];this._helper={startTop:parseFloat(o.style.top)||0,startLeft:parseFloat(o.style.left)||0,nextTop:null,nextLeft:null,raf:null,size:[i,n],containment:this._containment instanceof HTMLElement?[parseInt(getComputedStyle(this._containment).borderLeftWidth)+parseInt(getComputedStyle(this._containment).paddingLeft),parseInt(getComputedStyle(this._containment).borderTopWidth)+parseInt(getComputedStyle(this._containment).paddingTop),this._containment.offsetWidth-parseInt(getComputedStyle(this._containment).borderRightWidth)-parseInt(getComputedStyle(this._containment).paddingRight)-parseInt(getComputedStyle(o).marginLeft)-parseInt(getComputedStyle(o).marginRight)-i,this._containment.offsetHeight-parseInt(getComputedStyle(this._containment).borderBottomWidth)-parseInt(getComputedStyle(this._containment).paddingBottom)-parseInt(getComputedStyle(o).marginTop)-parseInt(getComputedStyle(o).marginBottom)-n]:"window"===this._containment?[window.scrollX,window.scrollY,window.scrollX+document.documentElement.offsetWidth-i,window.scrollY+document.documentElement.offsetHeight-n]:null},null===(e=this._start)||void 0===e||e.call(this)},this._handleDragMove=t=>{var e;if(null===this._helper)return;const{current:o,initial:i}=t.detail,n=this._source,s=this._helper.nextTop,r=this._helper.nextLeft,a="y"===this._axis||!1===this._axis||0!==o.movementY;if(a){const t=this._helper.startTop;isFinite(t)&&(this._helper.nextTop=o.clientY-i.clientY+t)}const l="x"===this._axis||!1===this._axis||0!==o.movementY;if(l){const t=this._helper.startLeft;isFinite(t)&&(this._helper.nextLeft=o.clientX-i.clientX+t)}if(null!==this._helper.containment){const[t,e,o,i]=this._helper.containment;a&&this._helper.nextTop&&(this._helper.nextTop=Math.min(this._helper.nextTop,i),this._helper.nextTop=Math.max(this._helper.nextTop,e)),l&&this._helper.nextLeft&&(this._helper.nextLeft=Math.min(this._helper.nextLeft,o),this._helper.nextLeft=Math.max(this._helper.nextLeft,t))}null!==this._helper.raf||s===this._helper.nextTop&&r===this._helper.nextLeft||(this._helper.raf=requestAnimationFrame((()=>{null!==this._helper&&(null!==this._helper.nextTop&&(n.style.top=this._helper.nextTop+"px",this._helper.nextTop=null),null!==this._helper.nextLeft&&(n.style.left=this._helper.nextLeft+"px",this._helper.nextLeft=null),this._helper.raf=null)}))),null===(e=this._drag)||void 0===e||e.call(this)},this._handleDragStop=t=>{var e;if(null===this._helper)return;this._source.classList.remove("ui-draggable-dragging"),this._helper=null,null===(e=this._stop)||void 0===e||e.call(this)} ;const i=this._source=t.source;i.classList.add("ui-draggable");const n=this._handle=null!==(e=t.handle?i.querySelector(t.handle):null)&&void 0!==e?e:i;n.classList.add("ui-draggable-handle"),this._start=t.start,this._stop=t.stop,this._drag=t.drag,this._backend=new y({handle:n,onDragStart:this._handleDragStart,onDragMove:this._handleDragMove,onDragStop:this._handleDragStop}),this._axis=null!==(o=t.axis)&&void 0!==o&&o,this._containment=t.containment}destroy(){const t=this._source;t.classList.remove("ui-draggable"),t.classList.remove("ui-draggable-dragging");this._handle.classList.remove("ui-draggable-handle"),this._backend.destroy(),null!==this._helper&&(this._helper.raf&&cancelAnimationFrame(this._helper.raf),this._helper=null)}}class y{constructor(t){this._initial=null,this._handlePointerDown=t=>{if(null!==this._initial)return;if(!(t.target instanceof Element&&this._handle.contains(t.target)))return;if(this._initial=t,!this._dispatchEvent(this._createEvent("pointer-drag-start",t)))return void(this._initial=null);t.preventDefault();const e=this._getEventTarget();e.addEventListener("pointermove",this._handlePointerMove),e.addEventListener("pointerup",this._handlePointerUp),e.addEventListener("pointercancel",this._handlePointerUp),e.addEventListener("lostpointercapture",this._handlePointerUp),e.setPointerCapture(t.pointerId)},this._handlePointerMove=t=>{null!==this._initial&&this._initial.pointerId===t.pointerId&&(t.preventDefault(),this._dispatchEvent(this._createEvent("pointer-drag-move",t)))},this._handlePointerUp=t=>{if(null===this._initial||this._initial.pointerId!==t.pointerId)return;t.preventDefault();const e=this._getEventTarget();e.removeEventListener("pointermove",this._handlePointerMove),e.removeEventListener("pointerup",this._handlePointerUp),e.removeEventListener("pointercancel",this._handlePointerUp),e.removeEventListener("lostpointercapture",this._handlePointerUp),e.releasePointerCapture(this._initial.pointerId),this._dispatchEvent(this._createEvent("pointer-drag-stop",t)),this._initial=null};const e=this._handle=t.handle;this._onDragStart=t.onDragStart,this._onDragMove=t.onDragMove,this._onDragStop=t.onDragStop,e.style.touchAction="none";this._getEventTarget().addEventListener("pointerdown",this._handlePointerDown)}destroy(){this._handle.style.touchAction="";const t=this._getEventTarget();t.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._handlePointerUp),t.removeEventListener("pointercancel",this._handlePointerUp),t.removeEventListener("lostpointercapture",this._handlePointerUp),null!==this._initial&&(t.releasePointerCapture(this._initial.pointerId),this._initial=null)}_getEventTarget(){return m.CheckMobile.iOS()||(0,m.isMac)()&&n.touch?window.document.documentElement:this._handle}_dispatchEvent(t){switch(t.type){case"pointer-drag-start":this._onDragStart(t);break;case"pointer-drag-move":this._onDragMove(t);break;case"pointer-drag-stop":this._onDragStop(t)}return!t.defaultPrevented} _createEvent(t,e){return(0,g.assert)(null!==this._initial),new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:{backend:this,initial:this._initial,current:e}})}}var w=o(70027),b=o(51768),f=o(25388);o(19619);const C="floating-toolbar-react-widgets",P=`
${f}
`;class S{constructor(t){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new(d())(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new(l()),this._responsiveResizeFunction=null,this._showTimeStamp=null,this._draggable=null,this._preventClickUntilAnimation=t=>{null!==this._showTimeStamp&&performance.now()-this._showTimeStamp{this.isVisible()&&this._widget.classList.remove("i-closed")}))):this._widget.classList.remove("i-closed"),this._onWindowResize())}hide(t=!1){if(!this.isVisible())return;const e=this._widget.classList.contains("i-closed");if(this._widget.classList.add("i-closed"),this._visibility.setValue(!1),t||e)this._setHiddingTimeout(null),this._widget.classList.add("i-hidden");else{const t=setTimeout((()=>{this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")}),this.hideDuration()) ;this._setHiddingTimeout(t)}window.removeEventListener("resize",this._windowResizeListener)}raise(){S._toolbars.length+S._startZIndex!==this._zIndex()&&(S._toolbars.splice(S._toolbars.indexOf(this),1),S._toolbars.push(this),S._updateAllZIndexes())}hideDuration(){return.75*s.dur}addWidget(t,e={}){const o=this.widgetsCount();if(void 0===e.index&&(e.index=o),e.index<0||e.index>o)throw new Error(`Index must be in [0, ${o}]`);const i=document.createElement("div");i.className="tv-floating-toolbar__widget js-widget",i.appendChild(t);const n=e.index===o?null:this._content.childNodes.item(e.index);this._content.insertBefore(i,n),this._onWindowResize()}getReactWidgetContainer(){return this._reactWidgetsContainer}removeWidget(t){const e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())}widgetsCount(){return this._content.childNodes.length}showWidget(t){const e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")}hideWidget(t){const e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")}removeWidgets(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()}onWidgetsReordered(){return this._reorderedDelegate}onContextMenu(t){if(n.mobiletouch){(new p).load().then((e=>{const o=new e(this._widget);o.get("press").set({time:500}),o.on("press",(e=>{this._preventWidgetTouchEndEvent(),t(e.srcEvent)}))}))}else this._widget.addEventListener("contextmenu",t)}checkPosition(){const t=this._getCorrectedWidgetRect(),e={left:t.left,top:t.top};this._correctPosition(e),t.left===e.left&&t.top===e.top||(this._widget.style.left=e.left+"px",this._widget.style.top=e.top+"px")}_determineCurrentLayoutVertical(t){const e=this._isVertical?t.height:t.width;return window.innerWidtht.left&&(t.left=Math.min(t.left+i,o.left)),n<0?t.top=Math.max(0,window.innerHeight-e.height):o&&o.top>t.top&&(t.top=Math.min(t.top+n,o.top))}_getCorrectedWidgetRect(){const t=this._widget.getBoundingClientRect();if(this._widget.classList.contains("i-closed")){const e=1/.925-1,o=t.width*e,i=t.height*e;return{bottom:t.bottom+i/2,height:t.height+i,left:t.left-o/2,right:t.right+o/2,top:t.top-i/2,width:t.width+o}}return t}_getSavedPosition(){var t;let e;if("device"===this._options.positionStorageType){const t=u.TVLocalStorage.getItem(this._options.positionSettingsKey);e=null!==t?JSON.parse(t):null}else e=null!==(t=(0,r.getJSON)(this._options.positionSettingsKey))&&void 0!==t?t:null;return null!==e&&"top"in e&&"left"in e?e:null}_setHiddingTimeout(t){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId), this._hiddingTimeoutId=t}_preventWidgetTouchEndEvent(){const t=e=>{e.preventDefault(),this._widget.removeEventListener("touchend",t)};this._widget.addEventListener("touchend",t)}_updateLayoutType(){this._widget.classList.toggle("i-vertical",this._isVertical)}_updateAxisOption(){0}_onWindowResize(){if("auto"===(this._options.layout||"auto")){const t=this._isVertical,e=this._getCorrectedWidgetRect();this._isVertical=this._determineCurrentLayoutVertical(e),this._updateLayoutType(),t!==this._isVertical&&(this._onVerticalChanged(this._isVertical,t),this._updateAxisOption())}this.checkPosition(),this._resizeResponsive()}_resizeResponsive(){if(null===this._responsiveResizeFunction)return;let t=this._options.layout||"auto";"auto"===t&&(t=this._isVertical?"vertical":"horizontal");const e="vertical"===t?this._widget.clientHeight:this._widget.clientWidth,o=("vertical"===t?window.innerHeight:window.innerWidth)-e;this._responsiveResizeFunction(e,o,t)}_setZIndex(t){this._widget.style.zIndex=String(t)}_zIndex(){return Number(this._widget.style.zIndex)}_loadPosition(){var t;const e=null!==(t=this._getSavedPosition())&&void 0!==t?t:this._options.defaultPosition;this._widget.style.left=Math.round(e.left)+"px",this._widget.style.top=Math.round(e.top)+"px",this._onWindowResize()}_savePosition(){const t=this._widget.getBoundingClientRect();if("device"===this._options.positionStorageType)try{u.TVLocalStorage.setItem(this._options.positionSettingsKey,JSON.stringify({left:t.left,top:t.top}))}catch(t){}else(0,r.setJSON)(this._options.positionSettingsKey,{left:t.left,top:t.top})}_init(){this._loadPosition(),this._draggable=new v({source:this._widget,containment:"window",handle:".js-drag",start:i.globalCloseMenu,stop:this._savePosition.bind(this)}),this._widget.addEventListener("pointerdown",this.raise.bind(this))}_initSortable(){let t=-1;lazyJqueryUI(this._content).sortable({start:(e,o)=>{t=o.item.index()},stop:(e,o)=>{const i=o.item.index();t!==i&&((0,b.trackEvent)("Floating Toolbar","User Sort"),this._reorderedDelegate.fire(t,i))},tolerance:"pointer",distance:5,containment:!!this._options.dragOnlyInsideToolbar&&"parent",scroll:!1,placeholder:"sortable-placeholder",forcePlaceholderSize:!0}),this._updateAxisOption()}static _updateAllZIndexes(){S._toolbars.forEach(((t,e)=>{t._setZIndex(S._startZIndex+e)}))}}S._startZIndex=20,S._toolbars=[]},89824:(t,e,o)=>{"use strict";o.d(e,{LineToolPropertiesWidgetBase:()=>ft});var i=o(50959),n=o(962),s=o(44352),r=o(36298),a=o(14483),l=o(58275),c=o.n(l),d=o(1722),h=o(88348),p=o(68806),u=o(50151),g=o(59452),_=o.n(g);class m extends(_()){constructor(t,e,o){super(),this._listenersMappers=[],this._isProcess=!1,this._baseProperty=t,this._propertyApplier=e,this._undoText=o}destroy(){this._baseProperty.destroy()}value(){return this._baseProperty.value()}setValue(t){this._isProcess=!0,this._baseProperty.setValue(t,void 0,{applyValue:(t,e)=>this._propertyApplier.setProperty(t,e,this._undoText)}),this._isProcess=!1,this._listenersMappers.forEach((t=>{t.method.call(t.obj,this)}))}subscribe(t,e){const o=o=>{ this._isProcess||e.call(t,this)},i={obj:t,method:e,callback:o};this._listenersMappers.push(i),this._baseProperty.subscribe(t,o)}unsubscribe(t,e){var o;const i=(0,u.ensureDefined)(null===(o=this._listenersMappers.find((o=>o.obj===t&&o.method===e)))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(t,i)}unsubscribeAll(t){this._baseProperty.unsubscribeAll(t)}}var v=o(69152),y=o(84877),w=o(3809),b=o(24437);const f=w.FLOATING_TOOLBAR_REACT_WIDGETS_CLASS+"__button";function C(t){const{templateButton:e,propertyButtons:o,commonButtons:n,isDrawingFinished:s,activeChartWidget:r}=t,a=r.hasModel()&&r.model().selection().dataSources();return a&&a.length?i.createElement(y.MatchMediaMap,{rules:{isSmallWidth:b.DialogBreakpoints.TabletSmall,isSmallHeight:"screen and (max-height: 430px)"}},(({isSmallWidth:t,isSmallHeight:e})=>i.createElement(i.Fragment,null,l(),s&&i.createElement(i.Fragment,null,Boolean(o.length)&&o.map(((o,n)=>i.createElement(o.component,{...o.props,key:`${o.props.title}_${n}`,className:f,isSmallScreen:t||e}))),Boolean(n.length)&&n.map(((o,n)=>{const s=t||e;return s?o.showForSmallScreen?i.createElement(o.component,{...o.props,isSmallScreen:s,key:`${o.props.title}_${n}`,className:f}):null:i.createElement(o.component,{...o.props,key:`${o.props.title}_${n}`,className:f})})))))):l();function l(){return null===e?null:i.createElement(e.component,{...e.props,isDrawingFinished:s,className:f})}}var P=o(51768),S=o(50813),x=o(61964);function T(t){const{title:e,activeChartWidget:o,className:n}=t;return i.createElement(S.ToolWidgetIconButton,{className:n,icon:x,title:e,onClick:async function(){(0,P.trackEvent)("GUI","Context action on drawings","Settings");const t=o.model().selection().lineDataSources(),e=t.length;1===e?await o.showChartPropertiesForSource(t[0],void 0,{onWidget:o.onWidget()}):e>1&&await o.showChartPropertiesForSources({sources:t})},"data-name":"settings"})}var W=o(43982),E=o(97754),L=o(66427),B=o(31188);function k(t){const{className:e,...o}=t;return i.createElement(L.ToolButton,{className:E(e,B.button),tooltipPosition:"horizontal",...o})}var N=o(65186),D=o(91244);function I(t){const{activeChartWidget:e,className:n}=t,r=e.model().selection().lineDataSources();if(0===r.length)return null;const a=r[0].properties().frozen,l=(0,W.useProperty)(a),c=l?{title:s.t(null,void 0,o(15101)),icon:N}:{title:s.t(null,void 0,o(42284)),icon:D};return i.createElement(k,{className:n,isActive:Boolean(l),onClick:function(){(0,P.trackEvent)("GUI","Context action on drawings","Lock"),e.toggleLockSelectedObject()},"data-name":Boolean(l)?"unlock":"lock",...c})}var M=o(35149);function A(t){const{title:e,activeChartWidget:o,className:n}=t;return i.createElement(S.ToolWidgetIconButton,{className:n,icon:M,title:e,"data-name":"remove",onClick:function(){(0,P.trackEvent)("GUI","Context action on drawings","Remove"),o.removeSelectedSources()}})}var R=o(9745),V=o(32563),F=o(8087),z=o(58451),O=o(10643),U=o(73212),H=o(68335),j=o(4741),Z=o(39347),$=o(84959);function G(t,e){const i=[(0,U.createVisualOrderAction)(t,e),(0, U.createChangeIntervalsVisibilitiesAction)(t,e)],n=function(t,e){const i=[],n=H.isMacKeyboard?" +":"",r=e.filter((t=>t.cloneable()));r.length>0&&i.push(new Z.Action({actionId:"Chart.LineTool.Clone",name:"clone",icon:o(36296),shortcutHint:H.humanReadableModifiers(j.Modifiers.Mod)+n+" Drag",label:s.t(null,void 0,o(52977)),onExecute:()=>{t.model().cloneLineTools(r,!1),(0,P.trackEvent)("GUI","Context action on drawings","Clone")}}));const a=e.filter((t=>t.copiable()));if(a.length>0){const e={actionId:"Chart.Clipboard.CopyLineTools",name:"copy",label:s.t(null,void 0,o(35216)),shortcutHint:H.humanReadableModifiers(j.Modifiers.Mod)+n+" C",onExecute:()=>{t.chartWidgetCollection().clipboard.uiRequestCopy(a)}};i.push(new Z.Action(e,"Copy"))}return function(t,e){return!!(null==t?void 0:t.isMultipleLayout().value())&&e.some((t=>t.isSynchronizable()))}(t,e)?(i.push(...(0,U.createSyncDrawingActions)(t,e)),i):i}(t,e);return n.length&&i.push(new Z.Separator,...n),i.push(new Z.Separator,function(t){return new Z.Action({actionId:"Chart.SelectedObject.Hide",label:s.t(null,void 0,o(31971)),icon:$,onExecute:()=>{t.hideSelectedObject()},name:"hide"})}(t)),i}var q=o(44996);function Y(t){const{title:e,activeChartWidget:o,isSmallScreen:n,className:s}=t,r=o.model().selection().lineDataSources(),[a,l]=(0,i.useState)([]),c=(0,i.useRef)(null),d=(0,i.useMemo)((()=>new U.ActionsProvider(o)),[o]),h=(0,i.useCallback)((()=>d.contextMenuActionsForSources(r)),[d,r]),p=(0,i.useCallback)((()=>{if(n)return;const t=G(o,r);l(K(t))}),[n,o,r]),u=(0,i.useCallback)((t=>{n&&h().then((e=>{window.matchMedia(b.DialogBreakpoints.TabletSmall).matches?O.ContextMenuManager.showMenu(K(e),t,{mode:"drawer","data-name":"more-menu"}):l(K(e))}))}),[n,h]);return(0,i.useEffect)((()=>{var t;a.length&&(null===(t=c.current)||void 0===t||t.update())}),[a]),i.createElement(F.ToolWidgetMenu,{className:s,ref:c,arrow:!1,onOpen:p,onClick:u,title:e,content:i.createElement(R.Icon,{icon:q}),"data-name":"more",menuDataName:"more-menu",closeOnEsc:!0},i.createElement(z.ActionsTable,{parentIsOpened:!0,items:a}))}function K(t){if(V.touch&&!window.matchMedia("(pointer:fine)").matches){const e=t.filter((t=>"Copy"!==t.id));if(e.length===t.length)return e;const o=[];return e.forEach((t=>{("separator"!==t.type||o.length>0&&"separator"!==o[o.length-1].type)&&o.push(t)})),o}return t}var X=o(95586),J=o(501),Q=o(23851),tt=o(57740);function et(t){const{property:e,propertyApplier:n,title:r,undoText:a,className:l}=t,c=(0,W.useProperty)(e),d=(0,i.useMemo)((()=>[new Z.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToSolid",icon:J,label:s.t(null,void 0,o(1277)),active:X.LineStyle.Solid===c,onExecute:()=>n.setProperty(e,X.LineStyle.Solid,a)}),new Z.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDashed",icon:Q,label:s.t(null,void 0,o(59317)),active:X.LineStyle.Dashed===c,onExecute:()=>n.setProperty(e,X.LineStyle.Dashed,a)}),new Z.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDotted",icon:tt,label:s.t(null,void 0,o(42973)),active:X.LineStyle.Dotted===c, onExecute:()=>n.setProperty(e,X.LineStyle.Dotted,a)})]),[n,e,c]);return i.createElement(F.ToolWidgetMenu,{className:l,arrow:!1,content:i.createElement(R.Icon,{icon:ot(c)}),title:r,"data-name":t["data-name"],menuDataName:`${t["data-name"]}-menu`},i.createElement(z.ActionsTable,{items:d}))}function ot(t){switch(t){case X.LineStyle.Solid:return J;case X.LineStyle.Dashed:return Q;case X.LineStyle.Dotted:return tt;default:return""}}const it=[10,11,12,14,16,20,24,28,32,40];function nt(t){const{property:e,propertyApplier:o,title:n,undoText:s,className:r}=t,a=(0,W.useProperty)(e),l=it.map((t=>new Z.Action({actionId:"Chart.LineTool.Toolbar.ChangeFontSizeProperty",label:t.toString(),onExecute:()=>o.setProperty(e,t,s),active:t===a})));return i.createElement(F.ToolWidgetMenu,{arrow:!1,content:a,className:r,title:n,"data-name":t["data-name"],menuDataName:`${t["data-name"]}-menu`},i.createElement(z.ActionsTable,{items:l}))}var st=o(57898),rt=o.n(st);o(51338),o(26006);class at extends w.FloatingToolbar{constructor(t){super(at._prepareOptions(t)),this._onWidgetStateChangedDelegate=new(rt()),this._statedWidgets=[],this._currentPopup=null,this._onWindowClickedListener=this._onWindowClicked.bind(this)}show(){super.show(),document.addEventListener("mousedown",this._onWindowClickedListener)}hide(t){super.hide(t),document.removeEventListener("mousedown",this._onWindowClickedListener)}destroy(){this._closePopup(),super.destroy()}addGroupedWidget(t,e={}){(0,u.assert)(t.states.length>0&&-1!==at._getStateIndexById(t,t.currentStateId),`Argument is invalid (count: ${t.states.length}, state: ${t.currentStateId})`);const o=document.createElement("div");o.className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&o.classList.add(t.widgetAddClass),o.setAttribute("title",t.tooltip);const i={isEnabled:!0,statedWidget:t,toolbarWidget:o},n=this._onWidgetClicked.bind(this,i);i.clickListener=n,o.addEventListener("click",n),this._updateWidgetPreview(i),this.addWidget(o,e),this._statedWidgets.push(i)}findGroupedWidget(t){const e=this._statedWidgets.length;for(let o=0;o{const s=this._createSubWidget(t,i),r=this._onSubWidgetClicked.bind(this,t,i.id);s.addEventListener("click",r),e.widgets.push({clickListener:r,stateWidget:i,widget:s}),s.classList.add(`tv-grouped-floating-toolbar__sub-widget--slide-right-${n}`),s.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-"+(o-n+1)),i.readonly||e.element.appendChild(s)})),this._currentPopup=e,this._updateSubWidgetsState(t.statedWidget),t.toolbarWidget.classList.add("i-dropped"),this._getWidget().appendChild(this._currentPopup.element),Promise.resolve().then((()=>{this._currentPopup&&this._currentPopup.element.classList.add("i-opened")})),this._updatePopupPosition()}_closePopup(){if(this._statedWidgets.forEach((t=>{t.toolbarWidget.classList.remove("i-dropped")})),!this._currentPopup)return;const t=this._currentPopup.widgets,e=this._currentPopup.element;this._currentPopup=null,t.forEach((t=>{t.widget.removeEventListener("click",t.clickListener)})),e.classList.remove("i-opened"),e.addEventListener("transitionend",(t=>{t.target===e&&this._getWidget().removeChild(e)}))}_updateWidgetPreview(t){const e=at._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);(0,u.assert)(-1!==e,`Unknown state id: ${t.statedWidget.currentStateId}`);const o=t.statedWidget.states[e].widget.cloneNode(!0);t.toolbarWidget.firstChild?t.toolbarWidget.replaceChild(o,t.toolbarWidget.firstChild):(t.toolbarWidget.appendChild(o),t.toolbarWidget.appendChild(at._createCaret()))}_updateSubWidgetsState(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach((e=>{e.widget.classList.toggle(at._activeSubWidgetClass,e.stateWidget.id===t.currentStateId)}))}_updatePopupPosition(){if(!this._currentPopup)return;const t=this._currentPopup.createdFor,e=this._getWidget().getBoundingClientRect(),o=this._findWrapperForWidget(t);if(!o||!this._currentPopup)throw new Error("Toolbar has no wrapper for preview's widget or there is no popup");const i=o.getBoundingClientRect(),n=this._currentPopup.element.getBoundingClientRect(),s=this._currentPopup.element;if(this.isVertical())s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top=i.top-e.top+1+"px", s.style.left="",e.left>window.innerWidth-e.right?s.classList.add("tv-grouped-floating-toolbar__popup--at-left"):s.classList.remove("tv-grouped-floating-toolbar__popup--at-left");else{s.classList.remove("tv-grouped-floating-toolbar__popup--at-left");let t=0;i.left+n.width>window.innerWidth?e.left+n.width>window.innerWidth&&(t=e.width-n.width):t=i.left-e.left+1,s.style.left=`${t}px`,e.bottom+n.height>window.innerHeight?s.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top="")}}_isPopupCreatedForWidget(t){return Boolean(this._currentPopup&&this._currentPopup.stateWidgetId===t)}_createSubWidget(t,e){const o=document.createElement("div");return o.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&o.classList.add(t.statedWidget.stateWidgetAddClass),o.appendChild(e.widget),o}_onSubWidgetClicked(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))}_onWindowClicked(t){if(this.isVisible()&&this._currentPopup&&!at._isEventInElement(t,this._currentPopup.element)){for(let e=0;e{h.isDirectionalMovementActive.value()||(t?this._floatingToolbar.hide(!0):this._toolbarRendered&&this._floatingToolbar.show())},this._chartWidgetCollection=t,this._floatingToolbar=new at({defaultPosition:{top:lt.HEADER_TOOLBAR_HEIGHT_EXPANDED+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position", positionStorageType:"device",layout:"horizontal","data-name":"drawing-toolbar"}),this._container=this._floatingToolbar.getReactWidgetContainer(),this._isToolMovingNowSpawn=h.isToolMovingNow.spawn(),this._isToolEditingNowSpawn=h.isToolEditingNow.spawn(),this._toolSpawn=h.tool.spawn(),this._iconToolSpawn=h.iconTool.spawn(),this._emojiToolSpawn=h.emojiTool.spawn(),this._selectedSourcesSpawn=this._chartWidgetCollection.selectedSources.spawn(),this._isToolMovingNowSpawn.subscribe(this._handleSourceEdit),this._isToolEditingNowSpawn.subscribe(this._handleSourceEdit),this._toolSpawn.subscribe(this._onToolChanged.bind(this),{callWithLast:!0}),this._iconToolSpawn.subscribe((()=>this._onToolChanged(h.tool.value()))),this._emojiToolSpawn.subscribe((()=>this._onToolChanged(h.tool.value()))),this._selectedSourcesSpawn.subscribe((()=>this.onSourceChanged(this.selectedSources()))),this._chartWidgetCollection.onAboutToBeDestroyed.subscribe(this,this.destroy,!0)}destroy(){this._isToolMovingNowSpawn.destroy(),this._isToolEditingNowSpawn.destroy(),this._toolSpawn.destroy(),this._iconToolSpawn.destroy(),this._emojiToolSpawn.destroy(),this._selectedSourcesSpawn.destroy()}refresh(){this.onSourceChanged(this.selectedSources())}onSourceChanged(t){if(!(null==t?void 0:t.length))return this._propertiesVisible=!1,this._toolbarVisible=!1,void this.hide();if(this._createCommonButtons(),t.every((e=>e.toolname===t[0].toolname))?this._showTemplatesOf({sources:t}):this._templatesButton&&this._clearTemplatesButton(),1===t.length){const e=t[0];e.isAvailableInFloatingWidget()&&this.activeChartWidget().model().model().dataSourceForId(e.id())?(!e.userEditEnabled()||!(0,dt.isLineDrawnWithPressedButton)(e.toolname)&&this.activeChartWidget().model().lineBeingCreated()||this._isDrawingFinished.setValue(!0),this.showPropertiesOf(e.toolname,e.properties(),!0),this._toolbarVisible=!0):this.hide()}else this._clearProperties(),this._createWidthsButton(void 0,!0),this._createColorsButton(void 0,!0),this._createBackgroundsButton(void 0,!0),this._createTextColorsButton(void 0,!0),this._propertiesVisible=!0;this._updateVisibility()}activeChartWidget(){return this._chartWidgetCollection.activeChartWidget.value()}selectedSources(){return this._chartWidgetCollection.selectedSources.value().filter(ct.isLineTool)}hide(){var t;this._updateVisibilityTimeout&&clearTimeout(this._updateVisibilityTimeout),this._updateVisibilityTimeout=setTimeout((()=>{(0,ct.unsetNewToolProperties)(),this._floatingToolbar.hide(!0),this._isToolbarRendered()&&this._unmountToolbar(),this._clearProperties(),this._clearCommonButtons()}),0),null===(t=this._lineToolsDoNotAffectChartInvalidation)||void 0===t||t.destroy(),delete this._lineToolsDoNotAffectChartInvalidation,delete this._propertyApplier}templatesList(){return this._templatesList}_onToolChanged(t,e){this._currentTool=t;const o=this.selectedSources();this._isDrawingToolExcludingCustomUrlEventTool(t)?(this._isDrawingFinished.setValue(!1),this._updateVisibility()):o&&o.length?(o.length>1&&this._isDrawingFinished.setValue(!0), this.onSourceChanged(this.selectedSources())):this.hide()}_propertyApplierImpl(){return this._propertyApplier||(this._lineToolsDoNotAffectChartInvalidation||(this._lineToolsDoNotAffectChartInvalidation=new ut.FeatureToggleWatchedValue("do_not_invalidate_chart_on_changing_line_tools",!1)),this._propertyApplier=new pt.PropertyApplierWithoutSavingChart((()=>this.activeChartWidget().model()),this._lineToolsDoNotAffectChartInvalidation)),this._propertyApplier}_clearProperties(){this._clearPropertyButtons(),this._lineWidthsProperty&&(this._lineWidthsProperty.destroy(),this._lineWidthsProperty=null),this._lineColorsProperty&&(this._lineColorsProperty.destroy(),this._lineColorsProperty=null),this._currentProperties&&(this._currentProperties=null)}_show(){this._updateVisibilityTimeout&&clearTimeout(this._updateVisibilityTimeout),this._updateVisibilityTimeout=setTimeout((()=>{this._renderToolbar(),this._floatingToolbar.show(),this._floatingToolbar.checkPosition()}),0)}_addPropertyButton(t){this._propertyButtons.push(t),this._renderToolbar()}_addCommonButton(t){this._commonButtons.push(t),this._renderToolbar()}_addTemplatesButton(t){this._templatesButton=t}_renderToolbar(){null!==this._container&&this.activeChartWidget()&&this.activeChartWidget().hasModel()&&(n.render(i.createElement(C,{templateButton:this._templatesButton,propertyButtons:this._propertyButtons,commonButtons:this._commonButtons,isDrawingFinished:this._isDrawingFinished.value(),activeChartWidget:this.activeChartWidget()}),this._container),this._toolbarRendered=!0)}_unmountToolbar(){null!==this._container&&(n.unmountComponentAtNode(this._container),this._toolbarRendered=!1)}_clearTemplatesButton(){this._templatesButton=null}_clearPropertyButtons(){this._propertyButtons=[]}_clearCommonButtons(){this._commonButtons=[]}_isToolbarRendered(){return this._toolbarRendered}_createSettingsButton(){const t={component:T,props:{title:mt,activeChartWidget:this.activeChartWidget()}};this._addCommonButton(t)}_createLockButton(){const t={component:I,props:{title:"Lock",activeChartWidget:this.activeChartWidget()}};this._addCommonButton(t)}_createRemoveButton(){const t={component:A,props:{title:vt,activeChartWidget:this.activeChartWidget()},showForSmallScreen:!0};this._addCommonButton(t)}_createDotsButton(){this._addCommonButton({component:Y,props:{title:yt,activeChartWidget:this.activeChartWidget()},showForSmallScreen:!0})}_createAlertButton(){}_createSourceActions(){this._createLockButton()}_createLineStyleButton(t){const e=this.selectedSources();if(0===e.length)return!1;const o=e[0];if(!(0,ht.isDataSource)(o))return!1;const i={component:et,props:{property:o.properties().linestyle||t,title:wt,propertyApplier:this._propertyApplierImpl(),"data-name":"style",undoText:_t}};return this._addPropertyButton(i),!0}_createFontSizeButton(t){const e=this.selectedSources();if(0===e.length)return!1;const o=e[0];if(!(0,ht.isDataSource)(o))return!1;const i={component:nt,props:{property:o.properties().fontsize||t,title:bt,propertyApplier:this._propertyApplierImpl(),"data-name":"font-size", undoText:gt}};return this._addPropertyButton(i),!0}_createCommonButtons(){this._commonButtons.length&&this._clearCommonButtons(),a.enabled("property_pages")&&this._createSettingsButton(),this._createSourceActions(),this._createRemoveButton(),this._createDotsButton()}_prepareProperties(t){const e=this.selectedSources().filter((e=>e.properties()[t]));if(!(e.filter((e=>e.properties()[t].visible())).length<1))return e.map((e=>e.properties()[t])).filter(d.notNull)}_createProperty(t,e,o,i){if(e){const t=this._prepareProperties(o);if(!t)return;return this._isWidthProperty(t[0])?new m(new p.MultipleLineWidthsProperty(t),this._propertyApplierImpl(),i):new v.CollectibleColorPropertyUndoWrapper(new p.MultipleLineColorsProperty(t),this._propertyApplierImpl(),i)}if(t&&t.visible())return this._isWidthProperty(t)?new p.MultipleLineWidthsProperty([t]):new v.CollectibleColorPropertyDirectWrapper(new p.MultipleLineColorsProperty([t]))}_shouldShowBackgroundProperty(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}_isDrawingToolExcludingCustomUrlEventTool(t){return Boolean(null==t?void 0:t.toLowerCase().includes("linetool"))&&"LineToolTweet"!==t&&"LineToolIdea"!==t&&"LineToolImage"!==t}_updateVisibility(){this._isDrawingFinished.value()&&(this._toolbarVisible||this._propertiesVisible)?this._show():this.hide()}_showTemplatesOf(t){}_isWidthProperty(t){return t instanceof p.LineToolWidthsProperty}}},26916:(t,e,o)=>{"use strict";var i=o(36298).TranslatedString,n=o(89824).LineToolPropertiesWidgetBase;const s=o(70114).ColorPickerButton,r=o(61259).LineWidthButton;var a=o(94071),l=o(21065),c=o(48984),d=new i("change line tool(s) color",o(44352).t(null,void 0,o(68519))),h=new i("change line tool(s) background color",o(44352).t(null,void 0,o(74350))),p=new i("change line tool(s) text color",o(44352).t(null,void 0,o(16631))),u=new i("change line tool(s) line width",o(44352).t(null,void 0,o(41648))),g=o(44352).t(null,void 0,o(40054)),_=o(44352).t(null,void 0,o(12928)),m=o(44352).t(null,void 0,o(19221)),v=o(44352).t(null,void 0,o(21327)),y=o(44352).t(null,void 0,o(38455)),w=o(44352).t(null,void 0,o(71845)),b=o(44352).t(null,void 0,o(32733)),f=o(44352).t(null,void 0,o(23886)),C=o(44352).t(null,void 0,o(86327)),P=o(44352).t(null,void 0,o(47059)),S=o(44352).t(null,void 0,o(36785)),x=o(44352).t(null,void 0,o(49593)),T=o(44352).t(null,void 0,o(67455)),W=o(44352).t(null,void 0,o(79964)),E=o(44352).t(null,void 0,o(45320));class L extends n{constructor(t){super(t),this._templatesButton=null}_createWidthsButton(t,e){if(this._lineWidthsProperty&&(this._lineWidthsProperty.destroy(),this._lineWidthsProperty=null),this._lineWidthsProperty=this._createProperty(t,e,"linesWidths",u),!this._lineWidthsProperty)return!0;var o=C;e&&(1!==this.selectedSources().filter((t=>t.properties().linesWidths)).length&&(o=P));return this._addPropertyButton({component:r,props:{title:o,multipleProperty:this._lineWidthsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-width",undoText:u}}),!0}_createColorsButton(t,e){ return this._lineColorsProperty&&(this._lineColorsProperty.destroy(),this._lineColorsProperty=null),this._lineColorsProperty=this._createProperty(t,e,"linesColors",d),!this._lineColorsProperty||(this._addPropertyButton({component:s,props:{icon:a,title:_,property:this._lineColorsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-color",undoText:d}}),!0)}_createBackgroundsButton(t,e){return this._backgroundsProperty&&(this._backgroundsProperty.destroy(),this._backgroundsProperty=null),this._backgroundsProperty=this._createProperty(t,e,"backgroundsColors",h),!this._backgroundsProperty||(this._addPropertyButton({component:s,props:{icon:l,title:w,property:this._backgroundsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"background-color",undoText:h}}),!0)}_createTextColorsButton(t,e){return this._textColorsProperty&&(this._textColorsProperty.destroy(),this._textColorsProperty=null),this._textColorsProperty=this._createProperty(t,e,"textsColors",p),!this._textColorsProperty||(this._addPropertyButton({component:s,props:{icon:c,title:v,property:this._textColorsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"text-color",undoText:p}}),!0)}_getPossibleProperty(t){for(var e=[],o=this._defaultToolProperties(),i=0;i{"use strict";o.d(e,{CollectibleColorPropertyDirectWrapper:()=>l,CollectibleColorPropertyUndoWrapper:()=>a});var i=o(50151),n=o(59452),s=o.n(n);class r extends(s()){constructor(t){super(),this._listenersMappers=[],this._isProcess=!1,this._baseProperty=t}destroy(){this._baseProperty.destroy()}value(){const t=this._baseProperty.value();return"mixed"===t?"":t}visible(){return this._baseProperty.visible()}setValue(t){this._isProcess=!0,this._baseProperty.setValue(""===t?"mixed":t,void 0,{applyValue:this._applyValue.bind(this)}),this._isProcess=!1,this._listenersMappers.forEach((t=>{t.method.call(t.obj,this)}))}subscribe(t,e){const o=o=>{this._isProcess||e.call(t,this)},i={obj:t,method:e,callback:o};this._listenersMappers.push(i),this._baseProperty.subscribe(t,o)}unsubscribe(t,e){var o;const n=(0,i.ensureDefined)(null===(o=this._listenersMappers.find((o=>o.obj===t&&o.method===e)))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(t,n)}unsubscribeAll(t){this._baseProperty.unsubscribeAll(t)}}class a extends r{constructor(t,e,o){super(t),this._propertyApplier=e,this._undoText=o}_applyValue(t,e){this._propertyApplier.setProperty(t,e,this._undoText)}}class l extends r{_applyValue(t,e){t.setValue(e)}}},87919:(t,e,o)=>{"use strict";o.d(e,{PropertyApplierWithoutSavingChart:()=>i});class i{constructor(t,e){this._undoModelSupplier=t,this._featureToggle=e}setProperty(t,e,o){this._undoModelSupplier().setProperty(t,e,o,this._featureToggle.value())}beginUndoMacro(t){return this._undoModelSupplier().beginUndoMacro(t,this._shouldWeKeepChartValidated())}endUndoMacro(){this._undoModelSupplier().endUndoMacro()}setWatchedValue(t,e,o){ this._undoModelSupplier().undoHistory().setWatchedValue(t,e,o,!0)}_shouldWeKeepChartValidated(){const t=this._undoModelSupplier().model().isAutoSaveEnabled().value();return this._featureToggle.value()&&t}}},44996:t=>{t.exports=''},23851:t=>{t.exports=''},57740:t=>{t.exports=''},501:t=>{t.exports=''},36296:t=>{t.exports=''},21065:t=>{t.exports=''},25388:t=>{t.exports=''},22978:t=>{t.exports=''},14631:t=>{t.exports=''},6096:t=>{t.exports=''},6483:t=>{t.exports=''},66611:t=>{ t.exports=''},94071:t=>{t.exports=''},48984:t=>{t.exports=''},61964:t=>{t.exports=''}}]);