/**
 * Kendo UI v2023.3.1114 (http://www.telerik.com/kendo-ui)
 * Copyright 2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Kendo UI commercial licenses may be obtained at
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
 * If you do not own a commercial license, this file shall be governed by the trial license terms.
 */
import"./kendo.dataviz.chart.js";!function(){window.kendo.dataviz=window.kendo.dataviz||{};var e=kendo.dataviz,i=e.constants,t=e.Chart,n=e.elementSize,a=e.deepExtend,r=e.SharedTooltip.extend({_slotAnchor:function(i,t){var n=this.plotArea.categoryAxis.options.vertical,a=n?{horizontal:"left",vertical:"center"}:{horizontal:"center",vertical:"bottom"};return{point:n?new e.Point(this.plotArea.box.x2,t.center().y):new e.Point(t.center().x,-2),align:a}},_defaultAnchor:function(e,i){return this._slotAnchor({},i)}}),s=[i.BAR,i.BULLET];function o(e){for(var i=[],t=0;t<e.length;t++){var n=e[t];i[t]=n.style.display,n.style.display="none"}return i}function l(e,i){for(var t=0;t<e.length;t++)e[t].style.display=i[t]}function h(i){return e.isNumber(i)?[i]:i}var d=t.extend({_setElementClass:function(i){e.addClass(i,"k-sparkline")},_initElement:function(e){t.fn._initElement.call(this,e),this._initialWidth=Math.floor(n(e).width)},_resize:function(){var e=this.element,i=o(e.childNodes);this._initialWidth=Math.floor(n(e).width),l(e.childNodes,i),t.fn._resize.call(this)},_modelOptions:function(){var e=this.options,i=this._surfaceWrap(),t=o(i.childNodes),r=document.createElement("span");r.innerHTML="&nbsp;",i.appendChild(r);var s=a({width:this._autoWidth,height:n(i).height,transitions:e.transitions},e.chartArea,{inline:!0,align:!1});return n(i,{width:s.width,height:s.height}),i.removeChild(r),l(i.childNodes,t),this.surface&&this.surface.resize(),s},_surfaceWrap:function(){if(!this.stage){var e=this.stage=document.createElement("span");this.element.appendChild(e)}return this.stage},_createPlotArea:function(e){var i=t.fn._createPlotArea.call(this,e);return this._autoWidth=this._initialWidth||this._calculateWidth(i),i},_calculateWidth:function(t){for(var a=this.options,r=e.getSpacing(a.chartArea.margin),s=t.charts,o=this._surfaceWrap(),l=0,h=0;h<s.length;h++){var d=s[h],c=(d.options.series||[])[0];if(c){if(c.type===i.BAR)return 150;if(c.type===i.BULLET)return 150;if(c.type===i.PIE)return n(o).height;var p=d.categoryAxis;if(p){var u=p.categoriesCount()*(!d.options.isStacked&&e.inArray(c.type,[i.COLUMN,i.VERTICAL_BULLET])?d.seriesOptions.length:1);l=Math.max(l,u)}}}var v=l*a.pointWidth;return v>0&&(v+=r.left+r.right),v},_createSharedTooltip:function(e){return new r(this._plotArea,e)}});d.normalizeOptions=function(i){var t=h(i);return(t=e.isArray(t)?{seriesDefaults:{data:t}}:a({},t)).series||(t.series=[{data:h(t.data)}]),a(t,{seriesDefaults:{type:t.type}}),(e.inArray(t.series[0].type,s)||e.inArray(t.seriesDefaults.type,s))&&(t=a({},{categoryAxis:{crosshair:{visible:!1}}},t)),t},e.setDefaultOptions(d,{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]}),kendo.deepExtend(kendo.dataviz,{Sparkline:d})}(),function(e){var i=kendo.dataviz,t=i.ui.Chart,n=i.Sparkline,a=i.ChartInstanceObserver,r=e.extend,s=t.extend({init:function(e,i){var a=i;a instanceof kendo.data.ObservableArray&&(a={seriesDefaults:{data:a}}),t.fn.init.call(this,e,n.normalizeOptions(a))},_createChart:function(e,i){this._instance=new n(this.element[0],e,i,{observer:new a(this),sender:this,rtl:this._isRtl()})},_createTooltip:function(){return new o(this.element,r({},this.options.tooltip,{rtl:this._isRtl()}))},options:{name:"Sparkline",chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]}});i.ui.plugin(s);var o=i.Tooltip.extend({options:{animation:{duration:0}},_hideElement:function(){this.element&&this.element.hide().remove()}});i.SparklineTooltip=o}(window.kendo.jQuery);var __meta__={id:"dataviz.sparkline",name:"Sparkline",category:"dataviz",description:"Sparkline widgets.",depends:["dataviz.chart"]},kendo$1=kendo;export{kendo$1 as default};
//# sourceMappingURL=kendo.dataviz.sparkline.js.map
