Files
ai/charting_library/bundles/floating-toolbars.9319534e46a9e0511fbc.js
2023-02-03 06:21:24 +00:00

27 lines
80 KiB
JavaScript

(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<n.length;r++)if(!e.call(i,n[r])||!o(t[n[r]],i[n[r]]))return!1;return!0}},62632:()=>{},42024:()=>{},6539:t=>{t.exports={button:"button-YKkCvwjV",content:"content-YKkCvwjV","icon-only":"icon-only-YKkCvwjV","color-brand":"color-brand-YKkCvwjV","variant-primary":"variant-primary-YKkCvwjV","variant-secondary":"variant-secondary-YKkCvwjV","color-gray":"color-gray-YKkCvwjV","color-green":"color-green-YKkCvwjV","color-red":"color-red-YKkCvwjV","size-xsmall":"size-xsmall-YKkCvwjV","size-small":"size-small-YKkCvwjV","size-medium":"size-medium-YKkCvwjV","size-large":"size-large-YKkCvwjV","size-xlarge":"size-xlarge-YKkCvwjV","with-start-icon":"with-start-icon-YKkCvwjV","with-end-icon":"with-end-icon-YKkCvwjV","start-icon-wrap":"start-icon-wrap-YKkCvwjV","end-icon-wrap":"end-icon-wrap-YKkCvwjV",animated:"animated-YKkCvwjV",stretch:"stretch-YKkCvwjV",grouped:"grouped-YKkCvwjV","adjust-position":"adjust-position-YKkCvwjV","first-row":"first-row-YKkCvwjV","first-col":"first-col-YKkCvwjV","no-corner-top-left":"no-corner-top-left-YKkCvwjV","no-corner-top-right":"no-corner-top-right-YKkCvwjV","no-corner-bottom-right":"no-corner-bottom-right-YKkCvwjV","no-corner-bottom-left":"no-corner-bottom-left-YKkCvwjV"}},99376:()=>{},24302:()=>{},64547:t=>{t.exports={button:"button-SS83RYhy"}},69124:t=>{t.exports={wrap:"wrap-HhKLwxmq",icon:"icon-HhKLwxmq",colorBg:"colorBg-HhKLwxmq",color:"color-HhKLwxmq",multicolor:"multicolor-HhKLwxmq",white:"white-HhKLwxmq"}},88168:t=>{t.exports={button:"button-Ou6proUJ"}},2680:t=>{t.exports={item:"item-Fil3AvDD",withIcon:"withIcon-Fil3AvDD",icon:"icon-Fil3AvDD",labelRow:"labelRow-Fil3AvDD",multiWidth:"multiWidth-Fil3AvDD",buttonWrap:"buttonWrap-Fil3AvDD",buttonLabel:"buttonLabel-Fil3AvDD"}},10667:t=>{t.exports={container:"container-WiTVOllB",sectionTitle:"sectionTitle-WiTVOllB",separator:"separator-WiTVOllB",customButton:"customButton-WiTVOllB"}},99565:t=>{t.exports={container:"container-UpS01XRM",form:"form-UpS01XRM",swatch:"swatch-UpS01XRM",inputWrap:"inputWrap-UpS01XRM",inputHash:"inputHash-UpS01XRM",input:"input-UpS01XRM",buttonWrap:"buttonWrap-UpS01XRM",hueSaturationWrap:"hueSaturationWrap-UpS01XRM",saturation:"saturation-UpS01XRM",hue:"hue-UpS01XRM"}},24429:t=>{t.exports={hue:"hue-oQv2KoOx",pointer:"pointer-oQv2KoOx",pointerContainer:"pointerContainer-oQv2KoOx"}},15381:t=>{t.exports={opacity:"opacity-YL5Gjk00",opacitySlider:"opacitySlider-YL5Gjk00",opacitySliderGradient:"opacitySliderGradient-YL5Gjk00",pointer:"pointer-YL5Gjk00",dragged:"dragged-YL5Gjk00",opacityPointerWrap:"opacityPointerWrap-YL5Gjk00",opacityInputWrap:"opacityInputWrap-YL5Gjk00",opacityInput:"opacityInput-YL5Gjk00",
opacityInputPercent:"opacityInputPercent-YL5Gjk00"}},88440:t=>{t.exports={saturation:"saturation-lJHGRPyu",pointer:"pointer-lJHGRPyu"}},24590:t=>{t.exports={swatches:"swatches-qgksmXjR",swatch:"swatch-qgksmXjR",hover:"hover-qgksmXjR",empty:"empty-qgksmXjR",white:"white-qgksmXjR",selected:"selected-qgksmXjR",contextItem:"contextItem-qgksmXjR"}},94720:(t,e,o)=>{"use strict";o.d(e,{Button:()=>y});var i=o(59496),n=o(97754),s=o(95604),r=o(9745),a=o(6539),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}=t,m=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"],m,u&&l().grouped,u&&!_&&l()["adjust-position"],u&&g.isTop&&l()["first-row"],u&&g.isLeft&&l()["first-col"])}function d(t){const{size:e,startIcon:o,icon:n,iconOnly:s,children:a,endIcon:c}=t,d=null!=o?o:n;return i.createElement(i.Fragment,null,d&&"xsmall"!==e&&i.createElement(r.Icon,{icon:d,className:l()["start-icon-wrap"]}),a&&i.createElement("span",{className:l().content},a),c&&!s&&"xsmall"!==e&&i.createElement(r.Icon,{icon:c,className:l()["end-icon-wrap"]}))}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,...h}=t;return{...h,...(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 w(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 y(t){return i.createElement(g,{...w(t)})}},86332:(t,e,o)=>{"use strict";o.d(e,{ControlGroupContext:()=>i});const i=o(59496).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})},14593:(t,e,o)=>{"use strict";o.d(e,{ToolWidgetIconButton:()=>a})
;var i=o(59496),n=o(97754),s=o(4825),r=o(64547);const a=i.forwardRef((t,e)=>{const{className:o,id:a,...l}=t;return i.createElement(s.ToolWidgetButton,{"data-name":a,...l,ref:e,className:n(o,r.button)})})},56588:(t,e,o)=>{"use strict";o.r(e),o.d(e,{FavoriteDrawingToolbar:()=>_});var i=o(28353),n=o(95952),s=o(89377),r=o(32563),a=o(62046),l=o(28296),c=o(97056),d=o(85733),h=o(92469),p=o(56840),u=o(52714),g=o.n(u);o(99376);class _ extends n.FloatingToolbar{constructor(t){super({allowSortable:!r.mobiletouch,dragOnlyInsideToolbar:!0,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition",positionStorageType:"device"}),this._linetoolsWidgets={},this._canBeShownValue=new(g())(!1),this._attachHandlers(),this._loadVisibilityState(),this._hideAction=this._createHideToolbarAction()}show(){this._canBeShownValue.value()&&(p.setValue("ChartFavoriteDrawingToolbarWidget.visible",!0),this.isVisible()||this._renderAllLinetools(),super.show())}hide(){p.setValue("ChartFavoriteDrawingToolbarWidget.visible",!1),super.hide()}canBeShown(){return this._canBeShownValue.readonly()}_correctPosition(t){super._correctPosition(t);const e=this._getSavedPosition();if(!e)return;const o=this._getCorrectedWidgetRect();if(!o.width)return;const i=window.innerWidth-o.right,n=window.innerHeight-o.bottom;e.left>t.left&&i>0&&(t.left=Math.min(t.left+i,e.left)),e.top>t.top&&n>0&&(t.top=Math.min(t.top+n,e.top))}_onFavoriteAdded(t){this._canBeShownValue.setValue(!0),this.addWidget(this._createLinetoolWidget(t)),this.show()}_onFavoriteRemoved(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===s.LinetoolsFavoritesStore.favoritesCount()&&(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=`<span class="tv-favorited-drawings-toolbar__widget apply-common-tooltip ${t===d.tool.value()?"i-active":""}" title="${h.lineToolsInfo[t].localizedName}" data-name="FavoriteToolbar${t}">${h.lineToolsInfo[t].icon}</span>`,o=(0,a.parseHtmlElement)(e);return o.addEventListener("click",e=>{e.preventDefault(),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]).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:(0,i.t)("Hide Favorite Drawing Tools Toolbar"),onExecute:()=>{this.hide()}})}_loadVisibilityState(){const t=s.LinetoolsFavoritesStore.favoritesCount()>0;this._canBeShownValue.setValue(t);p.getBool("ChartFavoriteDrawingToolbarWidget.visible",!0)&&t?this.show():this.hide()}}},95952:(t,e,o)=>{"use strict";o.d(e,{FLOATING_TOOLBAR_REACT_WIDGETS_CLASS:()=>S,FloatingToolbar:()=>T});var i=o(59064),n=o(32563),s=o(68587),r=o(56840),a=o(2872),l=o.n(a),c=o(52714),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(88537);function _(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 m(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)}var v=o(49483);class w{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]=[m(o),_(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 v.CheckMobile.iOS()||(0,v.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 b=o(62046),f=o(51768),C=o(25570);o(24302);const S="floating-toolbar-react-widgets",x=`<div class="tv-floating-toolbar i-closed i-hidden"><div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">${C}</div><div class="tv-floating-toolbar__content js-content"></div><div class="${S}"></div></div></div>`;class T{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.hideDuration()&&t.stopPropagation()},T._toolbars.push(this),this._options=t,this._widget=(0,b.parseHtmlElement)(x),this._content=this._widget.getElementsByClassName("js-content").item(0),this._reactWidgetsContainer=this._widget.getElementsByClassName(S).item(0),this._setZIndex(T._startZIndex+T._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options["data-name"]&&(this._widget.dataset.name=this._options["data-name"]),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType(),this._updateAxisOption()),this._widget.addEventListener("click",this._preventClickUntilAnimation,!0)}destroy(){this.hide(!0),
T._toolbars.splice(T._toolbars.indexOf(this),1),this._widget.removeEventListener("click",this._preventClickUntilAnimation,!0),document.body.contains(this._widget)&&document.body.removeChild(this._widget),null!==this._draggable&&this._draggable.destroy(),this._widget.innerHTML="",this._responsiveResizeFunction=null}setResponsiveResizeFunc(t){this._responsiveResizeFunction=t}isVisible(){return this._visibility.value()}visibility(){return this._visibility.readonly()}isVertical(){return this._isVertical}show(){this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),this._showTimeStamp=performance.now(),this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(()=>{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(){T._toolbars.length+T._startZIndex!==this._zIndex()&&(T._toolbars.splice(T._toolbars.indexOf(this),1),T._toolbars.push(this),T._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.innerWidth<e&&window.innerWidth<window.innerHeight}_getWidget(){return this._widget}_findWrapperForWidget(t){const e=this._content.getElementsByClassName("js-widget");for(let o=0;o<e.length;++o){const i=e.item(o);if(i.contains(t))return i}return null}_onVerticalChanged(t,e){}_correctPosition(t){const e=this._getCorrectedWidgetRect();t.left+e.width>window.innerWidth&&(t.left=Math.max(0,window.innerWidth-e.width)),t.top+e.height>window.innerHeight&&(t.top=Math.max(0,window.innerHeight-e.height)),t.left=Math.max(0,t.left),t.top=Math.max(0,t.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 w({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,f.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(){T._toolbars.forEach((t,e)=>{t._setZIndex(T._startZIndex+e)})}}T._startZIndex=20,T._toolbars=[]},36052:(t,e,o)=>{"use strict";o.d(e,{LineToolPropertiesWidgetBase:()=>ft});var i=o(59496),n=o(87995),s=o(28353),r=o(24980),a=o(67337),l=o(52714),c=o.n(l),d=o(80643),h=o(14291),p=o(85733),u=o(37865),g=o(88537),_=o(2015),m=o.n(_);class v extends(m()){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,g.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 w=o(88451),y=o(84877),b=o(95952),f=o(24437);const C=b.FLOATING_TOOLBAR_REACT_WIDGETS_CLASS+"__button";function S(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:f.DialogBreakpoints.TabletSmall,isSmallHeight:"screen and (max-height: 428px)"}},({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:C,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:C}):null:i.createElement(o.component,{...o.props,key:`${o.props.title}_${n}`,className:C})})))):l();function l(){return null===e?null:i.createElement(e.component,{...e.props,isDrawingFinished:s,className:C})}}var x=o(51768),T=o(14593),P=o(57979);function W(t){const{title:e,activeChartWidget:o,className:n}=t;return i.createElement(T.ToolWidgetIconButton,{className:n,icon:P,title:e,onClick:async function(){(0,x.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 E=o(43982),k=o(97754),L=o(16534),B=o(88168);function I(t){const{className:e,...o}=t;return i.createElement(L.ToolButton,{className:k(e,B.button),tooltipPosition:"horizontal",...o})}var N=o(28358),M=o(56717);function A(t){const{activeChartWidget:e,className:o}=t,n=e.model().selection().lineDataSources();if(0===n.length)return null;const r=n[0].properties().frozen,a=(0,E.useProperty)(r),l=a?{title:(0,s.t)("Unlock"),icon:N}:{title:(0,s.t)("Lock"),icon:M};return i.createElement(I,{className:o,isActive:Boolean(a),onClick:function(){(0,x.trackEvent)("GUI","Context action on drawings","Lock"),e.toggleLockSelectedObject()},"data-name":Boolean(a)?"unlock":"lock",...l})}var D=o(78679);function V(t){const{title:e,activeChartWidget:o,className:n}=t;return i.createElement(T.ToolWidgetIconButton,{className:n,icon:D,title:e,"data-name":"remove",onClick:function(){(0,x.trackEvent)("GUI","Context action on drawings","Remove"),o.removeSelectedSources()}})}var R=o(9745),F=o(32563),z=o(68335),O=o(25760),j=o(35390),U=o(8312),H=o(28296),K=o(9481),Y=o(97056),G=o(61671),q=o(31328),$=o(26159),X=o(48111);function J(t){const{title:e,activeChartWidget:n,isSmallScreen:r,className:a}=t,l=n.model(),c=l.selection().lineDataSources(),[d,h]=(0,i.useState)([]),p=(0,i.useRef)(null),u=(0,i.useMemo)(()=>new G.ActionsProvider(n),[n]);return i.createElement(i.Fragment,null,i.createElement(K.KeyboardDocumentListener,{keyCode:27,eventType:"keyup",handler:function(){(0,g.ensureNotNull)(p.current).close()}}),i.createElement(j.ToolWidgetMenu,{className:a,ref:p,arrow:!1,onOpen:r?void 0:function(){const t=[new H.Action({actionId:"Chart.Source.VisualOrder",label:(0,s.t)("Visual order"),icon:$,subItems:_(),name:"visual-order"})],e=function(){const t=[],e=z.isMacKeyboard?" +":"",i=c.filter(t=>t.cloneable());i.length>0&&t.push(new H.Action({actionId:"Chart.LineTool.Clone",name:"clone",icon:o(16788),shortcutHint:z.humanReadableModifiers(O.Modifiers.Mod)+e+" Drag",label:(0,s.t)("Clone"),onExecute:()=>{l.cloneLineTools(i,!1),(0,x.trackEvent)("GUI","Context action on drawings","Clone")}}));const r=c.filter(t=>t.copiable());if(r.length>0){const o={actionId:"Chart.Clipboard.CopyLineTools",name:"copy",label:(0,s.t)("Copy"),shortcutHint:z.humanReadableModifiers(O.Modifiers.Mod)+e+" C",onExecute:()=>{n.chartWidgetCollection().clipboard.uiRequestCopy(r)}};t.push(new H.Action(o,"Copy"))}if(!function(){if(!(null==n?void 0:n.isMultipleLayout()))return!1;return c.some(t=>t.isSynchronizable())}())return t;return t.push(...(0,G.createSyncDrawingActions)(n,c)),t}();e.length&&t.push(new H.Separator,...e);t.push(new H.Separator,new H.Action({actionId:"Chart.SelectedObject.Hide",label:(0,s.t)("Hide"),icon:X,onExecute:()=>{n.hideSelectedObject()},name:"hide"})),h(Z(t))},onClick:r?function(t){u.contextMenuActionsForSources(c).then(e=>{
window.matchMedia(f.DialogBreakpoints.TabletSmall).matches?Y.ContextMenuManager.showMenu(Z(e),t,{mode:"drawer","data-name":"more-menu"}):h(Z(e))})}:void 0,title:e,content:i.createElement(R.Icon,{icon:q}),"data-name":"more",menuDataName:"more-menu"},i.createElement(U.ActionsTable,{parentIsOpened:!0,items:d})));function _(){const t=[],e=l.availableZOrderOperations(c),o=new H.Action({actionId:"Chart.Source.VisualOrder.BringToFront",name:"bring-to-front",label:(0,s.t)("Bring to Front"),onExecute:()=>{l.bringToFront(c)},disabled:1===c.length&&!e.bringToFrontEnabled}),i=new H.Action({actionId:"Chart.Source.VisualOrder.SendToBack",name:"send-to-back",label:(0,s.t)("Send to Back"),onExecute:()=>{l.sendToBack(c)},disabled:1===c.length&&!e.sendToBackEnabled}),n=new H.Action({actionId:"Chart.Source.VisualOrder.BringForward",name:"bring-forward",label:(0,s.t)("Bring Forward"),onExecute:()=>{l.bringForward(c)},disabled:1===c.length&&!e.bringForwardEnabled}),r=new H.Action({actionId:"Chart.Source.VisualOrder.SendBackward",name:"send-backward",label:(0,s.t)("Send Backward"),onExecute:()=>{l.sendBackward(c)},disabled:1===c.length&&!e.sendBackwardEnabled});return t.push(o,i,n,r),t}}function Z(t){if(F.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 Q=o(95936),tt=o(20618),et=o(19726),ot=o(56326);function it(t){const{property:e,propertyApplier:o,title:n,undoText:r,className:a}=t,l=(0,E.useProperty)(e),c=(0,i.useMemo)(()=>[new H.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToSolid",icon:tt,label:(0,s.t)("Line"),active:Q.LineStyle.Solid===l,onExecute:()=>o.setProperty(e,Q.LineStyle.Solid,r)}),new H.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDashed",icon:et,label:(0,s.t)("Dashed line"),active:Q.LineStyle.Dashed===l,onExecute:()=>o.setProperty(e,Q.LineStyle.Dashed,r)}),new H.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDotted",icon:ot,label:(0,s.t)("Dotted line"),active:Q.LineStyle.Dotted===l,onExecute:()=>o.setProperty(e,Q.LineStyle.Dotted,r)})],[o,e,l]);return i.createElement(j.ToolWidgetMenu,{className:a,arrow:!1,content:i.createElement(R.Icon,{icon:nt(l)}),title:n,"data-name":t["data-name"],menuDataName:t["data-name"]+"-menu"},i.createElement(U.ActionsTable,{items:c}))}function nt(t){switch(t){case Q.LineStyle.Solid:return tt;case Q.LineStyle.Dashed:return et;case Q.LineStyle.Dotted:return ot;default:return""}}const st=[10,11,12,14,16,20,24,28,32,40];function rt(t){const{property:e,propertyApplier:o,title:n,undoText:s,className:r}=t,a=(0,E.useProperty)(e),l=st.map(t=>new H.Action({actionId:"Chart.LineTool.Toolbar.ChangeFontSizeProperty",label:t.toString(),onExecute:()=>o.setProperty(e,t,s),active:t===a}));return i.createElement(j.ToolWidgetMenu,{arrow:!1,content:a,className:r,title:n,"data-name":t["data-name"],menuDataName:t["data-name"]+"-menu"},i.createElement(U.ActionsTable,{items:l}))}
var at=o(2872),lt=o.n(at);o(42024),o(62632);class ct extends b.FloatingToolbar{constructor(t){super(ct._prepareOptions(t)),this._onWidgetStateChangedDelegate=new(lt()),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,g.assert)(t.states.length>0&&-1!==ct._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<e;++o){if(this._statedWidgets[o].statedWidget.id===t)return o}return-1}removeGroupedWidget(t){const e=this._statedWidgets.length;for(let o=0;o<e;++o){const e=this._statedWidgets[o];if(e.statedWidget.id===t)return this._isPopupCreatedForWidget(t)&&this._closePopup(),void 0!==e.clickListener&&e.toolbarWidget.removeEventListener("click",e.clickListener),this.removeWidget(e.toolbarWidget),this._statedWidgets.splice(o,1),void this._updatePopupPosition()}(0,g.assert)(!1,`Unknown groupId(${t})`)}updateGroupedWidget(t,e){this._closePopup();const o=this._ensuredGetWidgetDataForId(t);o.statedWidget.currentStateId=e.currentStateId,o.statedWidget.states=e.states,this._updateWidgetPreview(o)}setGroupedWidgetEnabled(t,e){const o=this._ensuredGetWidgetDataForId(t);o.isEnabled=e,o.toolbarWidget.classList.toggle("i-disabled",!e)}setGroupedWidgetState(t,e){const o=this._ensuredGetWidgetDataForId(t);(0,g.assert)(-1!==ct._getStateIndexById(o.statedWidget,e),`Unknown stateId (${e})`),o.statedWidget.currentStateId=e,this._updateSubWidgetsState(o.statedWidget),this._updateWidgetPreview(o)}onWidgetStateChanged(){return this._onWidgetStateChangedDelegate}_onVerticalChanged(t,e){this._updatePopupPosition()}_ensuredGetWidgetDataForId(t){for(const e of this._statedWidgets)if(e.statedWidget.id===t)return e;throw new Error(`Unknown groupId(${t})`)}_onWidgetClicked(t,e){const o=this._currentPopup&&this._isPopupCreatedForWidget(t.statedWidget.id);this._closePopup(),!o&&t.isEnabled&&this._createPopup(t)}_createPopup(t){const e={createdFor:t.toolbarWidget,element:document.createElement("div"),stateWidgetId:t.statedWidget.id,widgets:[]};e.element.className+="tv-grouped-floating-toolbar__popup js-popup";const o=t.statedWidget.states.length;t.statedWidget.states.forEach((i,n)=>{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=ct._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);(0,g.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(ct._createCaret()))}_updateSubWidgetsState(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach(e=>{e.widget.classList.toggle(ct._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&&!ct._isEventInElement(t,this._currentPopup.element)){for(let e=0;e<this._statedWidgets.length;++e)if(ct._isEventInElement(t,this._statedWidgets[e].toolbarWidget))return;this._closePopup()}}static _getStateIndexById(t,e){for(let o=0;o<t.states.length;++o)if(t.states[o].id===e)return o;return-1}static _createCaret(){const t=document.createElement("div");return t.className="tv-caret tv-caret--small tv-caret--colored tv-grouped-floating-toolbar__caret",t}static _prepareOptions(t){return t.addClass?t.addClass+=" tv-grouped-floating-toolbar":t.addClass=" tv-grouped-floating-toolbar",t}static _isEventInElement(t,e){return t.target===e||e.contains(t.target)}}ct._activeSubWidgetClass="tv-grouped-floating-toolbar__sub-widget--current";var dt=o(18387),ht=o(35878),pt=o(44159),ut=o(46627);const gt=new r.TranslatedString("change line tool(s) font size",(0,s.t)("change line tool(s) font size")),_t=new r.TranslatedString("change line tool(s) line style",(0,s.t)("change line tool(s) line style")),mt=(0,s.t)("Settings"),vt=(0,s.t)("Remove"),wt=(0,s.t)("More"),yt=(0,s.t)("Style"),bt=(0,s.t)("Font size");class ft{constructor(t){this._isDrawingFinished=new(c())(!0),this._currentTool=null,this._updateVisibilityTimeout=null,this._lineWidthsProperty=null,this._lineColorsProperty=null,this._currentProperties=null,this._container=null,this._toolbarRendered=!1,this._templatesButton=null,this._propertyButtons=[],this._commonButtons=[],this._handleSourceEdit=t=>{p.isDirectionalMovementActive.value()||(t?this._floatingToolbar.hide(!0):this._toolbarRendered&&this._floatingToolbar.show())},this._chartWidgetCollection=t,this._floatingToolbar=new ct({defaultPosition:{top:dt.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=p.isToolMovingNow.spawn(),this._isToolEditingNowSpawn=p.isToolEditingNow.spawn(),this._toolSpawn=p.tool.spawn(),this._iconToolSpawn=p.iconTool.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(p.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._selectedSourcesSpawn.destroy()}activeChartWidget(){
return this._chartWidgetCollection.activeChartWidget.value()}selectedSources(){return this._chartWidgetCollection.selectedSources.value().filter(h.isLineTool)}hide(){var t;this._updateVisibilityTimeout&&clearTimeout(this._updateVisibilityTimeout),this._updateVisibilityTimeout=setTimeout(()=>{(0,h.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}_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(S,{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:W,props:{title:mt,activeChartWidget:this.activeChartWidget()}};this._addCommonButton(t)}_createLockButton(){const t={component:A,props:{title:"Lock",activeChartWidget:this.activeChartWidget()}};this._addCommonButton(t)}_createRemoveButton(){const t={component:V,props:{title:vt,activeChartWidget:this.activeChartWidget()},showForSmallScreen:!0};this._addCommonButton(t)}_createDotsButton(){this._addCommonButton({component:J,props:{title:wt,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:it,props:{property:o.properties().linestyle||t,title:yt,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:rt,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 v(new u.MultipleLineWidthsProperty(t),this._propertyApplierImpl(),i):new w.CollectibleColorPropertyUndoWrapper(new u.MultipleLineColorsProperty(t),this._propertyApplierImpl(),i)}if(t&&t.visible())return this._isWidthProperty(t)?new u.MultipleLineWidthsProperty([t]):new w.CollectibleColorPropertyDirectWrapper(new u.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}_isWidthProperty(t){return t instanceof u.LineToolWidthsProperty}}},87805:(t,e,o)=>{"use strict";var i=o(28353).t,n=o(24980).TranslatedString,s=(o(85733),o(36052).LineToolPropertiesWidgetBase),r=o(44601).isLineDrawnWithPressedButton;const a=o(70114).ColorPickerButton,l=o(61259).LineWidthButton;o(14291).setNewToolProperties;o(67337);var c=o(58912),d=o(98510),h=o(95990),p=(new n("apply drawing template",i("apply drawing template")),new n("change line tool(s) color",i("change line tool(s) color"))),u=new n("change line tool(s) background color",i("change line tool(s) background color")),g=new n("change line tool(s) text color",i("change line tool(s) text color")),_=new n("change line tool(s) line width",i("change line tool(s) line width")),m=i("Color"),v=i("Line tool colors"),w=i("Text color"),y=i("Line tool text colors"),b=i("Background color"),f=i("Line tool backgrounds"),C=i("Style"),S=i("Font Size"),x=i("Line tool width"),T=i("Line tool widths"),P=i("Profit background color"),W=i("Stop background color"),E=i("Marker color"),k=i("Background color 1"),L=i("Background color 2");class B extends s{constructor(t){super(t),this._hasAlertWathcedValue=null,this._templatesButton=null}_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()}findSourceOnWidget(t){for(var e=0;e<this.activeChartWidget().model().panes().length;e++)for(var o=this.activeChartWidget().model().panes()[e].sourcesByGroup().all(),i=0;i<o.length;i++)if(o[i]===t)return o[i]}onSourceChanged(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),this._hasAlertWathcedValue=null),!t||!t.length)return this._propertiesVisible=!1,this._toolbarVisible=!1,void this.hide();if(this._createCommonButtons(),1===t.length){var e=t[0];e.isAvailableInFloatingWidget()&&this.findSourceOnWidget(e)?(!e.userEditEnabled()||!r(e.toolname)&&this.activeChartWidget().model().lineBeingCreated()||(this._isDrawingFinished.setValue(!0),e.canHasAlert()&&(this._hasAlertWathcedValue=e.hasAlert.spawn())),this.showPropertiesOf(e.toolname,e.properties(),!0),this.showTemplatesOf({source:e}),this._toolbarVisible=!0):this.hide()}else this._clearProperties(),this._templatesButton&&(this._clearTemplatesButton(),this._templatesButton=null),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()}_createWidthsButton(t,e){if(this._lineWidthsProperty&&(this._lineWidthsProperty.destroy(),this._lineWidthsProperty=null),this._lineWidthsProperty=this._createProperty(t,e,"linesWidths",_),!this._lineWidthsProperty)return!0;var o=x;e&&(1!==this.selectedSources().filter(t=>t.properties().linesWidths).length&&(o=T));return this._addPropertyButton({component:l,props:{title:o,multipleProperty:this._lineWidthsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-width",undoText:_}}),!0}_createColorsButton(t,e){return this._lineColorsProperty&&(this._lineColorsProperty.destroy(),this._lineColorsProperty=null),this._lineColorsProperty=this._createProperty(t,e,"linesColors",p),!this._lineColorsProperty||(this._addPropertyButton({component:a,props:{icon:c,title:v,property:this._lineColorsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-color",undoText:p}}),!0)}_createBackgroundsButton(t,e){return this._backgroundsProperty&&(this._backgroundsProperty.destroy(),this._backgroundsProperty=null),this._backgroundsProperty=this._createProperty(t,e,"backgroundsColors",u),!this._backgroundsProperty||(this._addPropertyButton({component:a,props:{icon:d,title:f,property:this._backgroundsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"background-color",undoText:u}}),!0)}_createTextColorsButton(t,e){return this._textColorsProperty&&(this._textColorsProperty.destroy(),this._textColorsProperty=null),this._textColorsProperty=this._createProperty(t,e,"textsColors",g),!this._textColorsProperty||(this._addPropertyButton({component:a,props:{icon:h,title:y,property:this._textColorsProperty,
propertyApplier:this._propertyApplierImpl(),"data-name":"text-color",undoText:g}}),!0)}showTemplatesOf(t){}templatesList(){return this._templatesList}_getPossibleProperty(t){for(var e=[],o=this._defaultToolProperties(),i=0;i<o.length;i++){var n=o[i];n.name in t&&e.push(n)}return e}showPropertiesOf(t,e,o){this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases());var i=this._toolExceptionCases[t]||this._getPossibleProperty(e);if(this._clearProperties(),this._propertiesVisible=!1,i.length){for(var n={},s=0;s<i.length;s++){for(var r=i[s],l=e,c=r.name.split("."),d=0;d<c.length;++d)l=l&&l[c[d]];var h=r.showIf;if("function"!=typeof h||h(l,e)){var p=r.factory;if(p&&p.call(this,l,o))continue;if(!l)continue;if(this._propertiesVisible=!0,"combobox"!==r.inputType){const t={component:a,props:{icon:r.iconSvgCode,title:r.title,"data-name":r.dataName,property:l,propertyApplier:this._propertyApplierImpl(),undoText:r.undoText}};this._addPropertyButton(t);continue}n[r.name]=l}}this._currentProperties=n}}_updateVisibility(){this._isDrawingFinished.value()&&(this._toolbarVisible||this._propertiesVisible)?this._show():this.hide()}refresh(){this.onSourceChanged(this.selectedSources())}_defaultToolProperties(){return[{name:"linesColors",inputType:"colorPicker",iconSvgCode:c,title:m,factory:B.prototype._createColorsButton,dataName:"line-tool-color"},{name:"backgroundsColors",inputType:"colorPicker",iconSvgCode:d,title:b,factory:B.prototype._createBackgroundsButton,dataName:"background-color",showIf:this._shouldShowBackgroundProperty},{name:"textsColors",title:w,inputType:"colorPicker",iconSvgCode:h,factory:B.prototype._createTextColorsButton,dataName:"text-color"},{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton},{name:"linestyle",title:C,inputType:"combobox",factory:B.prototype._createLineStyleButton}]}_regressionToolExceptionCases(){return[{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton}]}_pathExceptionCases(){return[{name:"linesColors",inputType:"colorPicker",iconSvgCode:c,title:m,factory:B.prototype._createColorsButton,dataName:"line-tool-color"},{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton},{name:"lineStyle",title:C,inputType:"combobox",factory:B.prototype._createLineStyleButton}]}_riskPropertiesExceptionCases(){return[{name:"textcolor",title:w,inputType:"colorPicker",iconSvgCode:h,dataName:"text-color",undoText:g},{name:"profitBackground",title:P,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",undoText:u},{name:"stopBackground",title:W,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",undoText:u}]}_rangeExceptionCases(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:c,title:m,dataName:"line-tool-color",undoText:p},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:d,title:b,dataName:"background-color",showIf:this._shouldShowBackgroundProperty,undoText:u},{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton}]}
_brushPropertiesExceptionCase(){return[{name:"linesColors",inputType:"colorPicker",iconSvgCode:c,title:m,factory:B.prototype._createColorsButton,dataName:"line-tool-color"},{name:"backgroundsColors",inputType:"colorPicker",iconSvgCode:d,title:b,dataName:"background-color",factory:B.prototype._createBackgroundsButton},{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton}]}_bezierPropertiesExceptionCases(){return[{name:"linesColors",inputType:"colorPicker",iconSvgCode:c,title:m,factory:B.prototype._createColorsButton,dataName:"line-tool-color"},{name:"backgroundsColors",inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",title:b,factory:B.prototype._createBackgroundsButton,showIf:this._shouldShowBackgroundProperty},{name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton},{name:"linestyle",title:C,inputType:"combobox",factory:B.prototype._createLineStyleButton}]}_textPropertiesExceptionCases(){return[{name:"color",title:w,inputType:"colorPicker",iconSvgCode:h,dataName:"text-color",undoText:g},{name:"backgroundColor",title:b,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",showIf:this._shouldShowBackgroundProperty,undoText:u},{name:"fontsize",title:S,inputType:"combobox",factory:B.prototype._createFontSizeButton}]}_notePropertiesExceptionCases(){return[{name:"markerColor",title:E,inputType:"colorPicker",iconSvgCode:c,dataName:"line-tool-color",undoText:p},{name:"textColor",title:w,inputType:"colorPicker",iconSvgCode:h,dataName:"text-color",undoText:g},{name:"fontSize",title:S,inputType:"combobox",factory:B.prototype._createFontSizeButton}]}_createToolExceptionCases(){return{LineToolBrush:B.prototype._brushPropertiesExceptionCase(),LineToolBezierQuadro:B.prototype._bezierPropertiesExceptionCases(),LineToolBezierCubic:B.prototype._bezierPropertiesExceptionCases(),LineToolText:B.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:B.prototype._textPropertiesExceptionCases(),LineToolBalloon:B.prototype._textPropertiesExceptionCases(),LineToolCallout:B.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:B.prototype._textPropertiesExceptionCases(),LineToolDateRange:B.prototype._rangeExceptionCases(),LineToolPriceRange:B.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:B.prototype._rangeExceptionCases(),LineToolNote:B.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:B.prototype._notePropertiesExceptionCases(),LineToolRiskRewardLong:B.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:B.prototype._riskPropertiesExceptionCases(),LineToolPath:B.prototype._pathExceptionCases(),LineToolRegressionTrend:B.prototype._regressionToolExceptionCases(),LineToolBarsPattern:[{name:"color",title:m,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",undoText:p}],LineToolProjection:[{name:"color1",title:k,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",undoText:u},{name:"color2",title:L,inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",undoText:u},{
name:"linesWidths",inputType:"combobox",factory:B.prototype._createWidthsButton}],LineToolSignpost:[{name:"linesColors",inputType:"colorPicker",iconSvgCode:d,dataName:"background-color",title:m,factory:B.prototype._createBackgroundsButton,showIf:function(t,e){return e&&e.showImage.value()}},{name:"fontSize",title:S,inputType:"combobox",factory:B.prototype._createFontSizeButton}]}}}t.exports=B},88451:(t,e,o)=>{"use strict";o.d(e,{CollectibleColorPropertyUndoWrapper:()=>a,CollectibleColorPropertyDirectWrapper:()=>l});var i=o(88537),n=o(2015),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)}}},44159:(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}}},70114:(t,e,o)=>{"use strict";o.d(e,{ColorPickerButton:()=>m});var i=o(59496),n=o(97754),s=o.n(n),r=o(88537),a=o(9745),l=o(24377),c=o(68906),d=o(56512),h=o(27797),p=o(6914),u=o(35390),g=o(43982),_=o(69124);function m(t){const{property:e,icon:o,propertyApplier:n,title:m,undoText:v,className:w}=t,y=(0,g.useProperty)(e),b=(0,i.useRef)(null),f=y?(0,l.parseRgba)(y)[3]:void 0,C=""===y,S=String(W()).toLowerCase()===p.white,[x,T,P]=(0,d.useCustomColors)();return i.createElement(u.ToolWidgetMenu,{className:w,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,S&&_.white),style:C?void 0:{backgroundColor:y}}))),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=y?(0,c.alphaToTransparency)((0,l.parseRgba)(y)[3]):0;E((0,c.generateColor)(String(t),o,true)),e||(0,r.ensureNotNull)(b.current).close()},onOpacityChange:function(t){E((0,c.generateColor)(y,(0,c.alphaToTransparency)(t),!0))},selectOpacity:void 0!==f,selectCustom:!0,customColors:x,onAddColor:function(t){T(t),(0,r.ensureNotNull)(b.current).close()},onRemoveCustomColor:P}));function W(){return y?(0,l.rgbToHexString)((0,l.parseRgb)(y)):null}function E(t){n.setProperty(e,t,v)}}},61259:(t,e,o)=>{"use strict";o.d(e,{LineWidthButton:()=>y});var i=o(59496),n=o(97754),s=o(88537),r=o(9745),a=o(35390),l=o(43982),c=o(16396),d=o(40173),h=o(98985),p=o(47441),u=o(93129),g=o(37500),_=o(4873),m=o(2680);const v=(0,d.mergeThemes)(c.DEFAULT_POPUP_MENU_ITEM_THEME,m),w=[{value:1,icon:h},{value:2,icon:p},{value:3,icon:u},{value:4,icon:g}];function y(t){const{multipleProperty:e,title:o,undoText:d,propertyApplier:h,className:p,isSmallScreen:u}=t,g=(0,l.useProperty)((0,s.ensureDefined)(e)),y="mixed"===g||!g,b=function(t){const e=w.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,y?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")))},w.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(59496);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:()=>I});var i=o(59496),n=o(97754),s=o.n(n),r=o(28353),a=o(24377),l=o(88537),c=o(49483),d=o(50628),h=o(16396);const p=i.createContext(void 0);var u=o(6914),g=o(78679),_=o(24590);function m(t){const{index:e,color:o,selected:s,onSelect:a}=t,[m,v]=(0,i.useState)(!1),w=(0,i.useContext)(p),y=(0,i.useRef)(null),b=Boolean(w)&&!c.CheckMobile.any();return i.createElement(i.Fragment,null,i.createElement("div",{ref:y,style:o?{color:o}:void 0,className:n(_.swatch,m&&_.hover,s&&_.selected,!o&&_.empty,String(o).toLowerCase()===u.white&&_.white),onClick:function(){a(o)},onContextMenu:b?f:void 0}),b&&i.createElement(d.PopupMenu,{isOpened:m,onClose:f,position:function(){const t=(0,l.ensureNotNull)(y.current).getBoundingClientRect();return{x:t.left,y:t.top+t.height+4}},onClickOutside:f},i.createElement(h.PopupMenuItem,{className:_.contextItem,label:(0,r.t)("Remove color"),icon:g,onClick:function(){f(),(0,
l.ensureDefined)(w)(e)},dontClosePopup:!0})));function f(){v(!m)}}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 w=o(54368),y=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<l?6:0);break;case a:h=(l-r)/u+2;break;case l:h=(r-a)/u+4;break;default:h=0}h/=6}return{h,s:g,v:p}}var f=o(43370),C=o(88440);class S extends i.PureComponent{constructor(){super(...arguments),this._container=null,this._refContainer=t=>{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 x=o(24429);class T 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()(x.hue,t)},i.createElement("div",{className:x.pointerContainer,ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},i.createElement("div",{className:x.pointer,style:{top:100*e+"%"}})))}}var P=o(99565);const W=(0,r.t)("Add",{context:"Color Picker"});class E 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)||"#000000";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||"#000000";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:P.container},i.createElement("div",{className:P.form},i.createElement("div",{className:P.swatch,style:{backgroundColor:t}}),i.createElement("div",{className:P.inputWrap},i.createElement("span",{className:P.inputHash},"#"),i.createElement("input",{type:"text",className:P.input,value:o,onChange:this._handleInput})),i.createElement("div",{className:P.buttonWrap},i.createElement(y.Button,{size:"s",onClick:this._handleAddColor},W))),i.createElement("div",{className:P.hueSaturationWrap},i.createElement(S,{className:P.saturation,hsv:e,onChange:this._handleHSV}),i.createElement(T,{className:P.hue,hsv:e,onChange:this._handleHSV})))}}var k=o(10667);const L=(0,r.t)("Add custom color",{context:"Color Picker"}),B=(0,r.t)("Opacity",{context:"Color Picker"});class I 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(E,{color:t,onSelect:this._handleSelectColor,onAdd:this._handleAddColor}):i.createElement("div",{className:k.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:k.separator}),i.createElement(p.Provider,{value:a},i.createElement(v,{colors:r,color:t,onSelect:this._handleSelectColor},o&&i.createElement("div",{className:s()(k.customButton,"apply-common-tooltip"),onClick:this._handleCustomClick,title:L}))),n&&i.createElement(i.Fragment,null,i.createElement("div",{className:k.sectionTitle},B),i.createElement(w.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(59496),n=o(97754),s=o(88537),r=o(64514),a=o(15381);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,{white:()=>n,basic:()=>a,extended:()=>c});var i=o(45112);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(59496),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||e<t.length)&&(s.emit("remove_custom_color",e),(0,n.setJSON)("pickerCustomColors",d(e,t)))},[t]);return[t,o,l]}function c(t,e){const o=e.slice();return o.push(t),o.length>29&&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(59496),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}},31328:t=>{
t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none"><path fill="currentColor" fillRule="evenodd" clipRule="evenodd" d="M7.5 13a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM5 14.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0zm9.5-1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM12 14.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0zm9.5-1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM19 14.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0z"/></svg>'},19726:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="currentColor" d="M4 13h5v1H4v-1zM12 13h5v1h-5v-1zM20 13h5v1h-5v-1z"/></svg>'},56326:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="currentColor"><circle cx="9" cy="14" r="1"/><circle cx="4" cy="14" r="1"/><circle cx="14" cy="14" r="1"/><circle cx="19" cy="14" r="1"/><circle cx="24" cy="14" r="1"/></svg>'},20618:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path stroke="currentColor" d="M4 13.5h20"/></svg>'},16788:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none"><path stroke="currentColor" d="M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"/></svg>'},98510:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20" fill="none"><path stroke="currentColor" d="M13.5 6.5l-3-3-7 7 7.59 7.59a2 2 0 0 0 2.82 0l4.18-4.18a2 2 0 0 0 0-2.82L13.5 6.5zm0 0v-4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v6"/><path fill="currentColor" d="M0 16.5C0 15 2.5 12 2.5 12S5 15 5 16.5 4 19 2.5 19 0 18 0 16.5z"/><circle fill="currentColor" cx="9.5" cy="9.5" r="1.5"/></svg>'},25570:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 12" width="8" height="12" fill="currentColor"><rect width="2" height="2" rx="1"/><rect width="2" height="2" rx="1" y="5"/><rect width="2" height="2" rx="1" y="10"/><rect width="2" height="2" rx="1" x="6"/><rect width="2" height="2" rx="1" x="6" y="5"/><rect width="2" height="2" rx="1" x="6" y="10"/></svg>'},98985:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 1" width="18" height="1"><rect width="18" height="1" fill="currentColor" rx=".5"/></svg>'},47441:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 2" width="18" height="2"><rect width="18" height="2" fill="currentColor" rx="1"/></svg>'},93129:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 3" width="18" height="3"><rect width="18" height="3" fill="currentColor" rx="1.5"/></svg>'},37500:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 4" width="18" height="4"><rect width="18" height="4" fill="currentColor" rx="2"/></svg>'},4873:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="currentColor"><rect width="18" height="2" rx="1" x="5" y="14"/><rect width="18" height="1" rx=".5" x="5" y="20"/><rect width="18" height="3" rx="1.5" x="5" y="7"/></svg>'},58912:t=>{
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17" fill="none"><path stroke="currentColor" d="M1.5 11.5l-.7.7a1 1 0 0 0-.3.71v3.59h3.59a1 1 0 0 0 .7-.3l.71-.7m-4-4l9-9m-9 9l2 2m2 2l9-9m-9 9l-2-2m11-7l1.3-1.3a1 1 0 0 0 0-1.4l-2.6-2.6a1 1 0 0 0-1.4 0l-1.3 1.3m4 4l-4-4m-7 11l9-9"/></svg>'},95990:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 15" width="13" height="15" fill="none"><path stroke="currentColor" d="M4 14.5h2.5m2.5 0H6.5m0 0V.5m0 0h-5a1 1 0 0 0-1 1V4m6-3.5h5a1 1 0 0 1 1 1V4"/></svg>'},57979:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path fill="currentcolor" fill-rule="evenodd" clip-rule="evenodd" d="M13 5.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5V7.05l.4.09c.9.18 1.73.53 2.46 1.02l.34.23.29-.3.81-.8c.2-.2.52-.2.71 0l.7.7.36-.35-.35.35c.2.2.2.51 0 .7l-.82.82-.29.29.23.34c.49.73.84 1.57 1.02 2.46l.08.4H22.5c.28 0 .5.22.5.5v1a.5.5 0 0 1-.5.5H20.95l-.09.4c-.18.9-.53 1.73-1.02 2.46l-.23.34.3.29.8.81c.2.2.2.52 0 .71l-.7.7a.5.5 0 0 1-.7 0l-.82-.8-.29-.3-.34.23c-.73.49-1.57.84-2.46 1.02l-.4.08V22.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V20.95l-.4-.09a6.96 6.96 0 0 1-2.46-1.02l-.34-.23-.29.3-.81.8.35.36-.35-.35a.5.5 0 0 1-.71 0l-.7-.71a.5.5 0 0 1 0-.7l-.36-.36.35.35.82-.81.29-.29-.23-.34a6.96 6.96 0 0 1-1.02-2.46l-.08-.4H5.5a.5.5 0 0 1-.5-.5v-1c0-.28.22-.5.5-.5H7.05l.09-.4c.18-.9.53-1.73 1.02-2.46l.23-.34-.3-.29-.8-.81a.5.5 0 0 1 0-.71l.7-.7c.2-.2.51-.2.7 0l.82.8.29.3.34-.23a6.96 6.96 0 0 1 2.46-1.02l.4-.08V5.5zm.5-1.5c-.83 0-1.5.67-1.5 1.5v.75c-.73.2-1.43.48-2.06.86l-.54-.53a1.5 1.5 0 0 0-2.12 0l-.7.7a1.5 1.5 0 0 0 0 2.12l.53.54A7.95 7.95 0 0 0 6.25 12H5.5c-.83 0-1.5.67-1.5 1.5v1c0 .83.67 1.5 1.5 1.5h.75c.2.73.48 1.43.86 2.06l-.53.54a1.5 1.5 0 0 0 0 2.12l.7.7a1.5 1.5 0 0 0 2.12 0l.54-.53c.63.38 1.33.67 2.06.86v.75c0 .83.67 1.5 1.5 1.5h1c.83 0 1.5-.67 1.5-1.5v-.75a7.95 7.95 0 0 0 2.06-.86l.54.53a1.5 1.5 0 0 0 2.12 0l.7-.7a1.5 1.5 0 0 0 0-2.12l-.53-.54c.38-.63.67-1.33.86-2.06h.75c.83 0 1.5-.67 1.5-1.5v-1c0-.83-.67-1.5-1.5-1.5h-.75a7.95 7.95 0 0 0-.86-2.06l.53-.54a1.5 1.5 0 0 0 0-2.12l-.7-.7a1.5 1.5 0 0 0-2.12 0l-.54.53A7.95 7.95 0 0 0 16 6.25V5.5c0-.83-.67-1.5-1.5-1.5h-1zM12 14a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm2-3a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg>'}}]);