@jspreadsheet/charts
Advanced tools
Comparing version 6.0.3 to 6.1.0
@@ -20,5 +20,5 @@ if (!lemonade && typeof(require) === 'function') { | ||
var Charts;!function(){var t={683:function(t,e,s){const o=s(555);t.exports=function(){"use strict";let t=null,e={};const s=function(t,e,s){if((t=t.split(".")).length){let o=this,n=null;for(;t.length>1;)if(n=t.shift(),o.hasOwnProperty(n))o=o[n];else{if(void 0===e)return;o[n]={},o=o[n]}if(n=t.shift(),void 0!==e)return!0===s?delete o[n]:o[n]=e,!0;if(o)return o[n]}return!1},n=function(t){return"undefined"!=typeof document&&document.dictionary&&document.dictionary[t]||t},i=function(t){return JSON.parse(JSON.stringify(t))},a=function(){var t="";return 8==this.status?this.scope&&-1!=this.scope.indexOf("charts")||(t="This charts plugin is not included on the scope of this license"):t="License required",t},r=function(t,e){for(let s in t)(this.hasOwnProperty(s)||e)&&(null!==this[s]&&"object"==typeof this[s]&&"object"==typeof t[s]?Object.assign(this[s],t[s]):this[s]=t[s]);return this},l=function(e){const s=[];let o=e.range.split(",");for(let e=0;e<o.length;e++){let n=o[e],i=this;const a=o[e].lastIndexOf("!");-1!==a&&(i=i.getWorksheetInstanceByName(n.slice(0,a)),n=n.slice(a+1)),s.push({worksheet:i,cellNames:t.helpers.getTokensFromRange(n)})}return s},c=function(t,e,s){let n=[],a=0,r=0,l=o.getDataFromRange(e,t);if(l&&l.length&&(a=l.length),l&&l[0]&&l[0].length&&(r=l[0].length),s.orientation)for(let t=0;t<r;t++){let e=[];for(let s=0;s<a;s++)e.push(l[s][t]);n[t]={label:"",data:e}}else for(let t=0;t<a;t++)n[t]={label:"",data:l[t]};s.headers&&n.forEach((function(t){t.label=t.data.shift()}));let c,d=[];if(s.datasets.forEach((function(t){n[t]&&d.push(i(n[t]))})),o.isBlank(s.labels)){if(c=[],n.length){const t=n[0].data.length;for(let e=0;e<t;e++)c.push("")}}else n[s.labels]&&(c=n[s.labels].data);return{labels:c,datasets:d}},d=function(e,s,n,a){n||(n={}),s=s.split(",")[0];let r=0,l=0,c=o.getDataFromRange(s,e);c&&c.length&&(r=c.length),c&&c[0]&&c[0].length&&(l=c[0].length);let d,p=0,u=0,h=[0,0];for(let t=0;t<r;t++){let e=0;for(let s=0;s<l;s++)o.isNumeric(c[t][s])?e++:0===t&&h[0]++;u=Math.max(u,e)}for(let t=0;t<l;t++){let e=0;for(let s=0;s<r;s++)o.isNumeric(c[s][t])?e++:0===t&&h[1]++;p=Math.max(p,e)}let f=[];if(d=void 0!==n.orientation?n.orientation?1:0:p>=u?1:0,!0===a){let e=s;e=e.split("!"),e=e[e.length-1],e=e.split(":");let o=t.helpers.getCoordsFromColumnName(e[0]),n=t.helpers.getCoordsFromColumnName(e[1]);c=[];for(let e=o[1];e<=n[1];e++){let s=[];for(let i=o[0];i<=n[0];i++)s.push(t.helpers.getCellNameFromCoords(i,e));c.push(s)}}if(d)for(let t=0;t<l;t++){let e=[];for(let s=0;s<r;s++)e.push(c[s][t]);f[t]={label:"",data:e}}else for(let t=0;t<r;t++)f[t]={label:"",data:c[t]};let g=null,y=null,b=null;if(b=void 0!==n.headers?!!n.headers:d?p-r==0?0:1:u-l==0?0:1,b&&f.forEach((function(t){t.label=t.data.shift()})),void 0!==n.labels?g=n.labels:h[d]>0&&(g=0),null!==g&&f[g]&&f[g].data&&(y=i(f[g].data)),n.datasets){let t=[];n.datasets.forEach((function(e){f[e]&&t.push(i(f[e]))})),f=t}else{let t=[];f.forEach((function(e,s){(!b||f.length<2||s>0)&&t.push(e)})),f=t}if(f.length&&(!y||!y.length)){y=[];for(let t=0;t<f[0].data.length;t++)y.push("")}return a&&y&&(y=t.helpers.getRangeFromTokens(y),f.forEach((function(e){e.data=t.helpers.getRangeFromTokens(e.data)}))),{labels:y,datasets:f,orientation:d?1:0,headers:!!b,xLabels:g,textCount:h}},p=function(t,e){let s=d(t,e);return{headers:s.headers,orientation:s.orientation}},u=function(t,e,s){e=e.split(",")[0];const o={data:c(t,e,s)},n={},i=O(s.title);i&&(n.title=i);const a=O(s.subtitle);a&&(n.subtitle=a);const r=A(s.legend);return r&&(n.legend=r),0!==Object.keys(n).length&&(o.options||(o.options={}),o.options.plugins=n),o},h=function(t,e,s){s||(s={});const o=u(t,e,s),n={base:L(s.axis?.base),side:W(s.axis?.side),side2:{type:"linear",display:!0,grid:{},...W(s.axis?.side2)}};return o.options||(o.options={}),o.options.scales=n,o},f=function(){let e=this;return e.instance=null,e.type="line",e.createPicker=function(s){t.picker(s,{worksheetName:!0,onchange:function(){e.data=s.innerText}})},e.cancel=function(){e.parent.close()},e.insert=function(){if(!e.data)return void alert(n("Range is mandatory"));let s=e.data,o=e.instance;if(-1!==s.indexOf("!")){let e=s.split("!");o=t.getWorksheetInstanceByName(e[0]),s=e[1]}-1===s.indexOf(":")&&(s=s+":"+s);let i=p(o,s),a={type:"chart",width:400,height:300,options:{type:e.type,range:s,...i}};o.setMedia(a),e.parent.close()},`<div class="jss_style_p20">\n <div class='jss_style_row jss_style_p2'>\n <div class='jss_style_column jss_style_f1'>\n <div class="jss_style_form_group">\n <label>${n("Data to analyze")}</label>\n <div :ready="self.createPicker(this)" :bind="self.data"></div>\n </div>\n </div>\n </div>\n <br>\n <div class='jss_style_row jss_style_p2 jss_style_center'>\n <div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="line" :bind="self.type"><i class="material-icons">show_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="bar" :bind="self.type"><i class="material-icons">bar_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="pie" :bind="self.type"><i class="material-icons">incomplete_circle</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="doughnut" :bind="self.type"><i class="material-icons">donut_large</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="radar" :bind="self.type"><i class="material-icons">radar</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="area" :bind="self.type"><i class="material-icons">area_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="scatter" :bind="self.type"><i class="material-icons">scatter_plot</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="stacked-bar" :bind="self.type"><i class="material-icons">stacked_bar_chart</i></label>\n </div>\n </div>\n <div class='jss_style_row jss_style_p2'>\n <div class='jss_style_column jss_style_f1'>\n <div class="jss_style_form_group">\n <br>\n <button type="button" class="jss_style_button" onclick="self.insert">${n("Insert")}</button>\n <button type="button" class="jss_style_button" onclick="self.cancel">${n("Cancel")}</button>\n </div>\n </div>\n </div>\n </div>`},g=function(){let t=`<Modal title="${n("Insert chart")}" :ref="self.modal" :closable="true" :draggable="true" :width="320" :height="410" :closed="true" icon="addchart">\n <InputForm :ref="self.form" />\n </Modal>`;return lemonade.element(t,this,{InputForm:f})},y={type:[{text:n("Line"),value:"line",group:"Line"},{text:n("Area Chart"),value:"area",group:"Area"},{text:n("Stacked Area Chart"),value:"stacked-area",group:"Area"},{text:n("100% Stacked Area Chart"),value:"percent-area",group:"Area"},{text:n("Bar Chart"),value:"bar",group:"Bar"},{text:n("Stacked Bar Chart"),value:"stacked-bar",group:"Bar"},{text:n("100% Stacked Bar Chart"),value:"percent-bar",group:"Bar"},{text:n("Column Chart"),value:"column",group:"Column"},{text:n("Stacked Column Chart"),value:"stacked-column",group:"Column"},{text:n("100% Stacked Column Chart"),value:"percent-column",group:"Column"},{text:n("Pie"),value:"pie",group:"Pie"},{text:n("Doughnut"),value:"doughnut",group:"Pie"},{text:n("Bubble"),value:"bubble",group:"Scatter"},{text:n("Scatter"),value:"scatter",group:"Scatter"},{text:n("Radar"),value:"radar",group:"Radar"},{text:n("Filled radar"),value:"filled-radar",group:"Radar"},{text:n("Histogram"),value:"histogram",group:"Other"},{text:n("Pareto"),value:"pareto",group:"Other"}],orientation:[{text:n("Horizontal"),value:0},{text:n("Vertical"),value:1}],position:[{text:n("Top"),value:"top"},{text:n("Bottom"),value:"bottom"},{text:n("Left"),value:"left"},{text:n("Right"),value:"right"}]};let b;const v=function(t,e){let o=this.parent.parent.parent.chart;if(o){let t=this.parent.parent.parent.options;if(e&&e.length)for(let o=0;o<e.length;o++){let n,i=e[o].element;i||(i=e[o].e),n="checkbox"===i.type?i.checked:"function"==typeof i.val?i.val():i.value;let a=i.getAttribute?i.getAttribute("data-path"):i["data-path"];a&&s.call(t,a,n)}let n=this.parent.parent.parent.worksheet;b&&clearTimeout(b),b=setTimeout((function(){G(n,t,o),b=null}),50)}},m=function(){let e=this;const s=function(){let s=i(e.parent.parent.parent.parent.allOptions),o=[];e.data.forEach((function(t){o.push(t.value)}));let n=[];s.forEach((function(t){n.push(t.value)})),t.helpers.compareArray(o,n)?e.value=null:e.value=o};return e.add=function(){let t=i(e.parent.parent.parent.parent.allOptions);e.data.push({datasets:t}),e.refresh("data")},e.remove=function(t,s){e.data.splice(e.data.indexOf(s),1),e.refresh("data")},e.update=function(){s()},e.onchange=function(t){"data"===t&&s()},'<div :value="self.value">\n <div :loop="self.data" data-path="series" class="jss_charts_series">\n <div class="jss_style_row start middle" style="margin-bottom: 4px;">\n <Dropdown :data="self.datasets" :bind="self.value" :onchange="self.parent.update" /> <i class="material-icons" onclick="self.parent.remove">close</i>\n </div>\n </div>\n <div class="jss_style_p2">\n <input type="button" value="{{self.button}}" onclick="self.add" class="jss_charts_button" />\n </div>\n </div>'},x=function(){let e=this;e.series=[],e.createRange=function(s){t.picker(s,{type:"picker",onchange:function(t){e.range=this.textContent=t}})},e.onchange=function(t,s){if(e.parent.parent.parent.chart){if(v.call(e,t,s),"range"===t){let t=d(e.parent.parent.parent.worksheet,e.range);e.orientation=t.orientation,e.headers=t.headers,e.labels=t.xLabels,e.datasets=null}if("orientation"===t||"headers"===t){let t=e.parent.parent.parent.loadDropdownOptions(),s=e.labels;e.currentDatasets=t.datasets,e.currentLabels=t.labels,e.labels=s}"orientation"===t&&(e.useHeaderText=e.orientation?n("Use the first column as headers"):n("Use the first row as headers"))}},e.useHeaderText=e.orientation?n("Use the first column as headers"):n("Use the first row as headers"),e.dropdown=y;let s=`<div>\n <div class="jss_style_row">\n <div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Chart type")}</label>\n <Dropdown :data="self.dropdown.type" :bind="self.type" width="220" data-path="type" data-value="line" />\n </div>\n </div><div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Data orientation")}</label>\n <Dropdown :data="self.dropdown.orientation" :bind="self.orientation" width="120" data-path="orientation" />\n </div>\n </div>\n </div>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Data range")}</label>\n <div :ready="self.createRange(this, self)" :bind="self.range" data-path="range"></div>\n </div>\n </div>\n </div>\n <div class="jss_style_form_group">\n <label>${n("Labels")}</label>\n <Dropdown :data="self.currentLabels" :bind="self.labels" data-path="labels" />\n </div>\n <div class="jss_style_form_group">\n <label>${n("Series")}</label>\n <Series :data="self.currentDatasets" :bind="self.datasets" data-path="datasets" button="${n("Add new serie")}" />\n </div>\n <br>\n <div class="jss_style_form_group">\n <Switch :bind="self.headers" data-path="headers" text="{{self.useHeaderText}}" />\n </div>\n </div>`;return lemonade.element(s,e,{Series:m})},_=function(){let t=this;return t.title={},t.legend={legendTitle:{text:""}},t.titlePosition=i(y.position),t.legendPosition=i(y.position),t.update=function(){v.call(t,null,[{element:this}])},`<>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Chart title")}</label>\n <input type="text" :bind="self.title.text" data-path="title.text" class="jss_object" onchange="self.update" />\n </div>\n </div><div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Chart title position")}</label>\n <Dropdown :data="self.titlePosition" :bind="self.legend.position" data-path="title.position" :width="120" onchange="self.update">\n </div>\n </div>\n </div>\n <br/>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Legend title")}</label>\n <input type="text" :bind="self.legend.legendTitle.text" data-path="legend.legendTitle.text" class="jss_object" onchange="self.update" />\n </div>\n </div>\n </div>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <Dropdown :data="self.legendPosition" :bind="self.legend.position" data-path="legend.position" :width="160" onchange="self.update">\n </div><div class="jss_style_col jss_style_f1">\n <Switch :bind="self.legend.display" data-path="legend.display" text="${n("Show Legend")}" onchange="self.update" />\n </div>\n </div>\n <br/>\n <>`},k=function(){let t=this;t.canvas=null,t.options=null,t.datasets=[],t.loadDropdownOptions=function(){let e=p(t.worksheet,t.options.range),s=d(t.worksheet,t.options.range,{...t.options,datasets:void 0,headers:!1},!0),o=d(t.worksheet,t.options.range,{...t.options,datasets:void 0,headers:!1}),n=[];s.datasets.map((function(e,s){let i=e.data;t.options.headers&&(i=o.datasets[s].data[0]),n.push({text:i,value:n.length})}));let a=s.textCount[s.orientation]>0&&0===s.xLabels,r=[];return n.forEach((function(t,o){(!e.headers&&!a||s.datasets.length<2||o>0)&&r.push({value:t.value,datasets:i(n)})})),t.options.datasets&&(r=[],t.options.datasets.map((function(t){r.push({value:t,datasets:i(n)})}))),t.allOptions=i(n),{datasets:r,labels:i(n)}},t.open=function(e,s){t.options=i(s.options);let o=d(this,t.options.range);void 0===t.options.orientation&&(t.options.orientation=o.orientation),void 0===t.options.headers&&(t.options.headers=o.headers),void 0===t.options.labels&&(t.options.labels=o.xLabels),t.worksheet=this;let n=t.loadDropdownOptions.call(this);t.modal.tabs.settings.currentDatasets=n.datasets,t.modal.tabs.settings.currentLabels=n.labels,r.call(t.modal.tabs.settings,t.options),r.call(t.modal.tabs.properties,t.options),t.chart=e,t.canvas=e.children[0],t.modal.closed=!1},t.close=function(e){t.chart&&(!0===e?t.worksheet.setMedia([{id:t.chart.id,options:t.options}]):t.chart.children[0]!==t.canvas&&(t.chart.children[0].remove(),t.chart.appendChild(t.canvas)),t.options=null,t.worksheet=null,t.chart=null,t.canvas=null),!1===t.modal.closed&&(t.modal.closed=!0)},t.save=function(){t.close(!0)},t.cancel=function(){t.close(!1)};let e=`<Modal title="Chart settings" position="right" :ref="self.modal" :closable="true" :draggable="true" :width="420" :height="600" :closed="true" :onclose="self.cancel">\n <div style="padding: 20px;">\n <Tabs :selected="0" :ref="self.tabs">\n <div title="${n("Configuration")}"><Settings :ref="self.settings" /></div>\n <div title="${n("Styling")}"><Properties :ref="self.properties" /></div>\n </Tabs>\n <div class='row'>\n <button type="button" class="jss_style_button" onclick="self.parent.save">${n("Save")}</button>\n <button type="button" class="jss_style_button" onclick="self.parent.cancel" style="margin-top: 4px">${n("Cancel")}</button>\n </div>\n </div>\n </Modal>`;return lemonade.element(e,t,{Settings:x,Properties:_})},C=function(e,s){let o=l.call(e,s.options);const n=o.length;for(let e=0;e<n;e++){const{cellNames:n,worksheet:i}=o[e],a=i.records,r=n.length;for(let e=0;e<r;e++){const o=n[e],i=t.helpers.getCoordsFromColumnName(o);a[i[1]][i[0]].chain.delete(s)}}},j={dotted:function(t){return t<3?[t,3]:[t,t]},dashed:function(t){return 1===t?[6,5]:[4*t,3*t]},"dashed-dotted":function(t){return 1===t?[6,4,1,4]:[4*t,2*t,t,2*t]}},w=function(t,e){if(t){const s=j[t];return"function"==typeof s?s(e):null}return null},S=function(t){const e={};void 0!==t.color&&(e.color=t.color);const{width:s}=t;if(e.width=s,t.dash){const o=j[t.dash];"function"==typeof o&&(e.dash=o(s))}return e},D=function(t){if(!t)return{};const e={};return void 0!==t.color&&(e.color=t.color),void 0!==t.family&&(e.family=t.family),void 0!==t.size&&(e.size=t.size),t.italic&&(e.style="italic"),t.bold?e.weight="bold":e.weight="normal",e},O=function(t){if(!t||!t.text)return null;const e={display:!0,text:t.text};void 0!==t.position&&(e.position=t.position),void 0!==t.align&&(e.align=t.align);const{color:s,...o}=D(t.font);return void 0!==s&&(e.color=s),0!==Object.keys(o).length&&(e.font=o),0!==Object.keys(e).length?e:null},A=function(t){if(!t)return null;if(!1===t.display)return{display:!1};const e={};void 0!==t.position&&(e.position=t.position),void 0!==t.align&&(e.align=t.align);const s=t.legendTitle;if(s&&s.text){const t={display:!0,text:s.text},{color:o,...n}=D(s.font);void 0!==o&&(t.color=o),0!==Object.keys(n).length&&(t.font=n),e.title=t}const o=t.labels;if(o){o.reverse&&(e.reverse=!0);const t={},{color:s,...n}=D(o.font);void 0!==s&&(t.color=s),0!==Object.keys(n).length&&(t.font=n),0!==Object.keys(t).length&&(e.labels=t)}return 0!==Object.keys(e).length?e:null},L=function(t){if(!t)return{};const e={},s=function(t){if(!t||!t.text)return null;const{color:e,...s}=D(t.font),o={display:!0,text:t.text};return 0!==Object.keys(s).length&&(o.font=s),void 0!==e&&(o.color=e),void 0!==t.align&&(o.align=t.align),o}(t.title);s&&(e.title=s),t.reverse&&(e.reverse=!0),e.grid=function(t){if(t||(t={}),!1===t.display)return{drawTicks:!1};const e={};e.tickLength=t.length;const{color:s,dash:o,width:n}=S(t);return void 0!==s&&(e.tickColor=s),void 0!==o&&(e.tickBorderDash=o),void 0!==n&&(e.tickWidth=n),e}(t.ticks),e.ticks=function(t){if(t||(t={}),!1===t.display)return{display:!1};const{color:e,...s}=D(t),o={};return void 0!==e&&(o.color=e),0!==Object.keys(s).length&&(o.font=s),o}(t.labels);const o=function(t){if(!t||0===Object.keys(t).length)return{};const e={};return void 0!==t.color&&(e.color=t.color),void 0!==t.width&&(e.width=t.width),e}(t.border);e.border=o;const n=function(t){if(t||(t={}),!1===t.display)return{grid:{drawOnChartArea:!1}};const e={},s={},{color:o,dash:n,width:i}=S(t);return void 0!==o&&(e.color=o),void 0!==n&&(s.dash=n),void 0!==i&&(e.lineWidth=i),{grid:e,border:s}}(t.grid);return e.grid=Object.assign(e.grid||{},n.grid),n.border&&(e.border=Object.assign(e.border||{},n.border)),e},W=function(t){if(!t)return{};const e=L(t);void 0!==t.min&&(e[t.forceTheLimits?"min":"suggestedMin"]=t.min),void 0!==t.max&&(e[t.forceTheLimits?"max":"suggestedMax"]=t.max);const s=t.spacingBetweenTicks;return s&&("count"===s.type?e.ticks.count=s.value:e.ticks.stepSize=s.value),e},F=function(t){if(!t)return{};const e={};if(t.reverse&&(e.reverse=!0),void 0!==t.min&&(e[t.forceTheLimits?"min":"suggestedMin"]=t.min),void 0!==t.max&&(e[t.forceTheLimits?"max":"suggestedMax"]=t.max),t.grid)if(!1===t.grid.display)e.grid={display:!1};else{const{color:s,dash:o,width:n}=S(t.grid),i={};void 0!==s&&(i.color=s),void 0!==o&&(i.borderDash=o),void 0!==n&&(i.lineWidth=n),e.grid=i}if(t.angleLines)if(!1===t.angleLines.display)e.angleLines={display:!1};else{const{color:s,dash:o,width:n}=S(t.angleLines),i={};void 0!==s&&(i.color=s),void 0!==o&&(i.borderDash=o),void 0!==n&&(i.lineWidth=n),e.angleLines=i}if(t.ticks)if(!1===t.ticks.display)e.ticks={display:!1};else{const{color:s,...o}=D(t.ticks),n={};void 0!==s&&(n.color=s),0!==Object.keys(o).length&&(n.font=o),e.ticks=n}const s=t.spacingBetweenTicks;if(s&&(e.ticks||(e.ticks={}),"count"===s.type?e.ticks.count=s.value:e.ticks.stepSize=s.value),t.pointLabels)if(!1===t.pointLabels.display)e.pointLabels={display:!1};else{const{color:s,...o}=D(t.pointLabels),n={};void 0!==s&&(n.color=s),0!==Object.keys(o).length&&(n.font=o),e.pointLabels=n}return e},I=function(t,e,s){t=o.fixCartesianChartConfig(t,e);const n={type:"bar",...h(e,t.range,t)},i=new Set,a=n.data.datasets,r=a.length;if(t.series)for(let e=0;e<r;e++){const o=t.series[e],n=a[e];void 0!==o.radius&&(n.borderRadius=o.radius),n.backgroundColor=o.color,o.borderColor&&o.borderWidth&&(n.borderColor=o.borderColor,n.borderWidth=o.borderWidth),s?"right"===o.yAxis?(n.yAxisID="y2",i.add("end")):(n.yAxisID="y",i.add("start")):"top"===o.xAxis?(n.xAxisID="x2",i.add("end")):(n.xAxisID="x",i.add("start"))}const{base:l,side:c,side2:d}=n.options.scales;let p={};return s?(2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,p.x=l):(2===i.size?(p.x=c,p.x2={...d,position:"top"},p.x2.grid||(p.x2.grid={}),p.x2.grid.drawOnChartArea=!1):i.has("end")?(p.x={display:!1},p.x2={...d,position:"top"}):p.x=c,p.y=l,n.options.indexAxis="y"),n.options.scales=p,n},R=function(t){const e=[],s=t.length;for(let o=0;o<s;o++){const s=t[o];for(let t=0;t<s.length;t++)e[t]=(e[t]||0)+Math.abs(s[t])}return e},E={style:"percent",maximumFractionDigits:0,minimumFractionDigits:0},B=function(t,e,s){t=o.fixLineChartConfig(t,e,s);const n={type:"line",...h(e,t.range,t)},i=new Set,a=n.data.datasets,r=a.length;if(t.series)for(let e=0;e<r;e++){const o=t.series[e],n=a[e];if("right"===o.yAxis?(n.yAxisID="y2",i.add("end")):(n.yAxisID="y",i.add("start")),s){const t=o.color;n.backgroundColor=t,n.pointBackgroundColor=t;const e=void 0!==o.borderColor?o.borderColor:t;n.borderColor=e,n.pointBorderColor=e}else{const t=o.borderColor;n.borderColor=t,n.pointBorderColor=t;const e=void 0!==o.color?o.color:t;n.backgroundColor=e,n.pointBackgroundColor=e}const r=o.line;if(r){const{width:t}=r;n.borderWidth=t;const e=w(r.dash,t);e&&(n.borderDash=e),void 0!==r.curve?n.tension=r.curve:void 0!==r.stepped&&(n.stepped=r.stepped)}const l=o.point;l?(void 0!==l.borderWidth&&(n.pointBorderWidth=l.borderWidth),void 0!==l.rotation&&(n.pointRotation=l.rotation),n.pointStyle=void 0!==l.style&&l.style,n.pointRadius=void 0!==l.radius?l.radius:0):n.pointStyle=!1,void 0!==o.drawNullValues&&(n.spanGaps=o.drawNullValues)}const{base:l,side:c,side2:d}=n.options.scales;let p={x:l};return 2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,n.options.scales=p,n},N=function(t,e){const s=B(t,e,!0),o=s.data.datasets;for(let t=0;t<o.length;t++)o[t].fill=!0;return s},T=function(t,e,s){t=o.fixPieChartConfig(t,e);const n={type:s?"pie":"doughnut",...u(e,t.range,t)},i=n.data.datasets,a=i.length;if(t.series)for(let e=0;e<a;e++){const s=t.series[e],o=i[e];o.backgroundColor=s.color,void 0!==s.borderColor&&(o.borderColor=s.borderColor),void 0!==s.circumference&&(o.circumference=s.circumference),void 0!==s.spacing&&(o.spacing=s.spacing),void 0!==s.rotation&&(o.rotation=s.rotation),o.borderWidth=0;const n=s.border;if(n){const{width:t=0}=n;if(o.borderWidth=t,void 0!==n.dash){const e=j[n.dash];e&&(o.borderDash=e(t))}void 0!==n.radius&&(o.borderRadius=n.radius)}}return s||void 0===t.cutout||(n.options||(n.options={}),n.options.cutout=100*t.cutout+"%"),n},M=/^(?:-|\+)?\d+(?:\.\d+)?$/,P=function(t){return M.test(t)},$=function(t,e){const s=[],o=e.length;for(let t=0;t<o;t++){let o=0;const n=e[t].data;for(let t=0;t<n.length;t++)"number"==typeof n[t]&&o++;s.push([o])}return{datasets:s,labels:["["+t[0]+", "+t[1]+"]"]}},z=function(t,e,s){if(1===t)return $(e,s);const o=(e[1]-e[0])/t,n=[];let i=e[0]+o;for(;i<e[1];){if(n.push(Math.round(100*i)/100),n.length>19)throw new Error("invalid chart");i+=o}const a=n.length,r=a+1,l=[],c=s.length;for(let t=0;t<c;t++){const e=s[t],o=new Array(r);o.fill(0);const i=e.data;for(let t=0;t<i.length;t++){const e=i[t];if("number"!=typeof e)continue;let s=0;for(;s<a&&e>n[s];)s++;o[s]++}l.push(o)}const d={datasets:l};let p=[];p.push("["+e[0]+" , "+n[0]+"[");for(let t=1;t<a;t++)p.push("["+n[t-1]+" , "+n[t]+"[");return p.push("["+n[a-1]+" , "+e[1]+"]"),d.labels=p,d},H=function(t,e){t=o.fixCartesianChartConfig(t,e);const s={type:"bar",...h(e,t.range,t)},n=[1/0,-1/0],i=s.data.datasets,a=i.length;for(let t=0;t<i.length;t++){const e=i[t].data;for(let t=0;t<e.length;t++){const s=e[t];"string"==typeof s&&P(s)&&(e[t]=parseFloat(s))}}for(let e=0;e<a;e++){const s=i[e],o=s.data;for(let t=0;t<o.length;t++){const e=o[t];"number"==typeof e&&(e<n[0]&&(n[0]=e),e>n[1]&&(n[1]=e))}const a=t.series[e];s.backgroundColor=a.color,a.borderWidth&&a.borderColor&&(s.borderWidth=a.borderWidth,s.borderColor=a.borderColor),void 0!==a.radius&&(s.borderRadius=a.radius)}if(n[0]===1/0&&n[1]===-1/0)throw new Error("invalid chart");const{base:r,side:l}=s.options.scales;let c;s.options.scales={x:r,y:l};const d=t.separation;if(d)c="number-of-pieces"===d.type?z(d.value,n,i):function(t,e,s){if(0===t)throw new Error("invalid chart");if(t>=e[1]-e[0])return $(e,s);const o=[];let n=e[0];do{if(n+=t,o.push(Math.round(100*n)/100),o.length>20)throw new Error("invalid chart")}while(n<e[1]);const i=o.length,a=[],r=s.length;for(let t=0;t<r;t++){const e=s[t],n=new Array(i);n.fill(0);const r=e.data;for(let t=0;t<r.length;t++){const e=r[t];if("number"!=typeof e)continue;let s=0;for(;e>o[s];)s++;n[s]++}a.push(n)}const l={datasets:a};let c=[];c.push("["+e[0]+" , "+o[0]+"[");for(let t=1;t<i-1;t++)c.push("["+o[t-1]+" , "+o[t]+"[");return c.push("["+o[i-2]+" , "+o[i-1]+"]"),l.labels=c,l}(d.value,n,i);else{const t=n[1]-n[0];let e=6,s=t/e;for(;e>1&&s<.01;)e--,s=t/e;c=z(e,n,i)}s.data.labels=c.labels;const p=c.datasets;for(let t=0;t<a;t++)i[t].data=p[t];return s},V=function(t,e,s){t=o.fixRadarChartConfig(t,e);const n={type:"radar",...u(e,t.range,t)},i=n.data.datasets,a=i.length;for(let e=0;e<a;e++){const o=i[e];o.fill=s;const n=t.series&&t.series[e],a=n.borderColor;o.borderColor=a,o.pointBorderColor=a;const r=n.color;o.backgroundColor=r,o.pointBackgroundColor=r;const l=n.line,{width:c}=l;o.borderWidth=c;const d=w(l.dash,c);d&&(o.borderDash=d),void 0!==l.curve&&(o.tension=l.curve);const p=n.point;p?(void 0!==p.borderWidth&&(o.pointBorderWidth=p.borderWidth),void 0!==p.rotation&&(o.pointRotation=p.rotation),o.pointStyle=void 0!==p.style&&p.style,o.pointRadius=void 0!==p.radius?p.radius:0):o.pointStyle=!1,void 0!==n.drawNullValues&&(o.spanGaps=n.drawNullValues)}return n.options||(n.options={}),n.options.scales={r:F(t.axis?.r)},n},J=function(t,e=[]){const s=[],o=t.length;for(let n=0;n<o;n++)e.includes(n)||s.push(t[n]);return s},U=function(t,e){return"bar"===e.type?I(e,t,!1):"stacked-bar"===e.type?function(t,e){const s=I(t,e,!1),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"x2"===e.xAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.y.stacked="origin",!1!==s.options.scales.x.display&&(s.options.scales.x.stacked="origin"),s.options.scales.x2&&(s.options.scales.x2.stacked="origin"),s}(e,t):"percent-bar"===e.type?function(t,e){const s=I(t,e,!1),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"x2"===e.xAxisID?(n.push(s),e.stack="Stack 2"):(o.push(s),e.stack="Stack 1");for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"string"===o?P(e)?s[t]=parseFloat(e):s[t]=0:"number"!==o&&(s[t]=0)}}const a=R(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=R(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.y.stacked="origin",!1!==s.options.scales.x.display&&(s.options.scales.x.stacked="origin",s.options.scales.x.ticks||(s.options.scales.x.ticks={}),s.options.scales.x.ticks.format=E),s.options.scales.x2&&(s.options.scales.x2.stacked="origin",s.options.scales.x2.ticks||(s.options.scales.x2.ticks={}),s.options.scales.x2.ticks.format=E),s}(e,t):"column"===e.type?I(e,t,!0):"stacked-column"===e.type?function(t,e){const s=I(t,e,!0),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"y2"===e.yAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.x.stacked="origin",!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin"),s.options.scales.y2&&(s.options.scales.y2.stacked="origin"),s}(e,t):"percent-column"===e.type?function(t,e){const s=I(t,e,!0),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"y2"===e.yAxisID?(n.push(s),e.stack="Stack 2"):(o.push(s),e.stack="Stack 1");for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"string"===o?P(e)?s[t]=parseFloat(e):s[t]=0:"number"!==o&&(s[t]=0)}}const a=R(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=R(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.x.stacked="origin",!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin",s.options.scales.y.ticks||(s.options.scales.y.ticks={}),s.options.scales.y.ticks.format=E),s.options.scales.y2&&(s.options.scales.y2.stacked="origin",s.options.scales.y2.ticks||(s.options.scales.y2.ticks={}),s.options.scales.y2.ticks.format=E),s}(e,t):"line"===e.type?B(e,t):"area"===e.type?N(e,t):"stacked-area"===e.type?function(t,e){const s=N(t,e),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"y2"===e.yAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.y||(s.options.scales.y={}),!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin"),s.options.scales.y2&&(s.options.scales.y2.stacked="origin"),s}(e,t):"percent-area"===e.type?function(t,e){const s=N(t,e),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"y2"===e.yAxisID?(e.stack="Stack 2",o.push(s)):(e.stack="Stack 1",n.push(s));for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"number"!==o&&(s[t]="string"===o&&P(e)?parseFloat(e):0)}}const a=R(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=R(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.y||(s.options.scales.y={}),!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin",s.options.scales.y.ticks||(s.options.scales.y.ticks={}),s.options.scales.y.ticks.format=E),s.options.scales.y2&&(s.options.scales.y2.stacked="origin",s.options.scales.y2.ticks||(s.options.scales.y2.ticks={}),s.options.scales.y2.ticks.format=E),s}(e,t):"pie"===e.type?T(e,t,!0):"doughnut"===e.type?T(e,t,!1):"scatter"===e.type?function(t,e){t=o.fixScatterChartConfig(t,e);const s={type:"scatter",...h(e,t.range,t)},n=s.data.labels;delete s.data.labels;const i=new Set,a=s.data.datasets,r=a.length;for(let e=0;e<r;e++){const s=a[e],o=s.data,r=[];for(let t=0;t<o.length;t++){let e=n[t],s=o[t];const i=typeof e;if("string"===i){if(!P(e))continue;e=parseFloat(e)}else if("number"!==i)continue;const a=typeof s;if("string"===a){if(!P(s))continue;s=parseFloat(s)}else if("number"!==a)continue;r.push({x:e,y:s})}s.data=r;const l=t.series[e];if(!l)continue;"right"===l.yAxis?(s.yAxisID="y2",i.add("end")):(s.yAxisID="y",i.add("start")),s.backgroundColor=l.color,void 0!==l.borderColor&&(s.borderColor=l.borderColor);const c=l.point;s.pointRadius=c.radius,s.pointStyle=c.style,s.pointBorderWidth=void 0!==c.borderWidth?c.borderWidth:0,void 0!==c.rotation&&(s.pointRotation=c.rotation)}const{base:l,side:c,side2:d}=s.options.scales;let p={x:l};return 2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,s.options.scales=p,s}(e,t):"histogram"===e.type?H(e,t):"radar"===e.type?V(e,t,!1):"filled-radar"===e.type?V(e,t,!0):"pareto"===e.type?function(t,e){t=o.fixParetoChartConfig(t,e);const s={type:"bar",...h(e,t.range,t)},n=t.series,i=n[0],a=s.data.datasets[0];a.order=1;let r=a.data;const l=[];for(let t=0;t<r.length;t++){const e=r[t],s=typeof e;"string"===s&&P(e)?(r[t]=parseFloat(e),r[t]<0&&l.push(t)):("number"!==s||e<0)&&l.push(t)}a.data=J(a.data,l),s.data.labels=J(s.data.labels,l),r=a.data;const c=r.reduce((function(t,e){return t+e}),0);let d=0;const p=[];for(let t=0;t<r.length;t++)d+=r[t],p.push(Math.round(d/c*100)/100);a.backgroundColor=i.color,void 0!==i.radius&&(a.borderRadius=i.radius),i.borderWidth&&i.borderColor&&(a.borderWidth=i.borderWidth,a.borderColor=i.borderColor);const u=n[1],f={type:"line",yAxisID:"y2",order:0,data:p};f.backgroundColor=u.color,f.borderColor=u.borderColor;const g=u.line;if(g){const{width:t}=g;f.borderWidth=t;const e=w(g.dash,t);e&&(f.borderDash=e),void 0!==g.curve?f.tension=g.curve:void 0!==g.stepped&&(f.stepped=g.stepped)}const y=u.point;y?(void 0!==y.borderWidth&&(f.pointBorderWidth=y.borderWidth),void 0!==y.rotation&&(f.pointRotation=y.rotation),f.pointStyle=void 0!==y.style&&y.style,f.pointRadius=void 0!==y.radius?y.radius:0):f.pointStyle=!1,f.backgroundColor||(f.backgroundColor=f.borderColor),s.data.datasets.push(f);const{base:b,side:v,side2:m}=s.options.scales;let x={x:b,y:v,y2:{...m,position:"right"}};return x.y2.grid||(x.y2.grid={}),x.y2.grid.drawOnChartArea=!1,x.y2.ticks||(x.y2.ticks={}),x.y2.ticks.format=E,s.options.scales=x,s.options.plugins||(s.options.plugins={}),s.options.plugins.legend={display:!1},s}(e,t):void 0},G=function(t,s,o){o.classList.remove("jss_charts_error"),o.removeAttribute("data-error");try{!function(t,s,o){o.innerHTML="";let n=document.createElement("canvas");o.appendChild(n);const i=U(t,s);i.options||(i.options={}),void 0!==e.animations&&(i.options.animations=e.animations),new Chart(n,i)}(t,s,o)}catch(t){console.error(t)}},q=function(e,s){let o=s.el;if("function"!=typeof s.handler){Object.defineProperty(s,"handler",{enumerable:!1,get:function(){return function(t){G(e,t.options,t.el)}}});const t=function(){e.isEditable()&&e.parent.plugins.charts.edition.open.call(e,o,s)};o.edit=t,o.addEventListener("dblclick",t),o.classList.add("jss_charts")}(function(e,s){let o;o="function"==typeof e.getCellObject?function(t,e,s){return t.getCellObject(e,s)}:function(t,e,s){return t.records[s][e]};let n=l.call(e,s.options);const i=n.length;for(let a=0;a<i;a++){let{cellNames:i,worksheet:r}=n[a];const l=i.length;for(let n=0;n<l;n++){const a=i[n],l=t.helpers.getCoordsFromColumnName(a),c=o(r,l[0],l[1]);c.chain||(c.chain=new Map),c.chain.set(s,e)}}})(e,s),G(e,s.options,o)},K=function(e){let s={init:function(t){const e=t.options.media;e&&e.forEach((function(e){"chart"===e.type&&q(t,e)}))},onevent:function(t,e,s,o,n){if("onchangemedia"===t){let t=s,i=o,a=n;s.forEach((function(s,o){"chart"===a[o].type&&(1===Object.keys(t[o]).length?C(e,a[o]):t[o].options&&(i[o].options&&C(e,i[o]),q(e,a[o])))}))}else if("onchangereferences"===t){let t=[],n=e.options.media;n&&(n.forEach((function(n){if("chart"===n.type){let a=!1,r=i(n.options);if(r.range){let t=e.updateFormula(r.range,s,o);t&&t!==r.range&&(r.range=t,a=!0)}!0===a&&(n.options=r,t.push({type:"media",id:n.id,value:{options:r}}))}})),t.length&&e.persistence("setFormula",{data:t}))}},toolbar:function(e){return e.items.push({content:"addchart",type:"i",tooltip:n("Insert chart"),onclick:function(){var e=t.current.getRange();e&&(e=e.split("!")[1]),s.open(t.current,e,"")},updateState:function(t,e,s,o){o.isEditable()?s.classList.remove("jtoolbar-disabled"):s.classList.add("jtoolbar-disabled")}}),e},contextMenu:function(e,o,i,a,r,l,c,d){if(null!=o&&null!=i){let a={title:n("Insert chart"),icon:"addchart",onclick:function(){let n=t.helpers.getColumnNameFromCoords(o,i);s.open(e,"",n)}},l=0;for(let t in r)if("divisor"===r[t].type||"line"===r[t].type){l=parseInt(t)+1;break}r.splice(l,0,{type:"divisor"}),r.splice(l,0,a)}},open:function(t,e,o){s.input.modal.form.instance=t,s.input.modal.form.data=e,s.input.modal.open()}};let o=document.createElement("div");return e.tools.append(o),lemonade.render((function(){return lemonade.element('<div class="jss_chartss">\n <div><InputChart :ref="self.input" /></div>\n <div><Edition :ref="self.edition" /></div>\n </div>',s,{InputChart:g,Edition:k})}),o),s},Q=function(t){return"object"==typeof t&&void 0!==t.animations&&(e.animations=t.animations),!0};return Q.oninit=function(t,e){let s=a.call(t);s?console.error(s):t.setPlugins({charts:K})},Q.license=function(e){null===t&&(t=this)},Q.getDataFromConfig=d,Q}()},555:function(t){t.exports=function(){const t=function(t){return"string"==typeof t&&(t=t.trim()),!isNaN(t)&&null!==t&&""!==t},e=function(t,e){let s;const o=t.lastIndexOf("!");if(-1!==o){const n=t.slice(0,o);s=e.getWorksheetInstanceByName(n),t=t.slice(o+1)}else s=e;const n=e.helpers.getCoordsFromRange(t),i=n[3],a=n[2],r=[],l=s.records;for(let t=n[1];t<=i;t++){const e=[],s=l[t];for(let t=n[0];t<=a;t++)e.push(s&&s[t]?s[t].v:0);r.push(e)}return r},s=function(s,o){let n=0,i=0;(s=s?JSON.parse(JSON.stringify(s)):{}).range=s.range.split(",")[0];const a=void 0===s.labels||null===s.labels,r=void 0===s.datasets||null===s.datasets,l=void 0===s.orientation||null===s.orientation,c=void 0===s.headers||null===s.headers;if(!o){if(a||r||l||c)throw new Error("The chart do not have a property whose default value needs a jss instance to be generated");return s}let d=e(s.range,o);d&&d.length&&(n=d.length),d&&d[0]&&d[0].length&&(i=d[0].length);let p=0,u=0,h=[0,0];for(let e=0;e<n;e++){let s=0;for(let o=0;o<i;o++)t(d[e][o])?s++:0===e&&h[0]++;u=Math.max(u,s)}for(let e=0;e<i;e++){let s=0;for(let o=0;o<n;o++)t(d[o][e])?s++:0===e&&h[1]++;p=Math.max(p,s)}l&&(s.orientation=p>=u);const f=s.orientation?1:0;if(c&&(s.headers=f?p-n!=0:u-i!=0),a&&h[f]>0&&(s.labels=0),r){s.datasets=[];const t=f?i:n,e=s.headers;for(let o=0;o<t;o++)(!e||t<2||o>0)&&s.datasets.push(o)}else s.datasets||(s.datasets=[]);return s},o=["#1E88E5","#E53935","#43A047","#FDD835","#8E24AA","#8E24AA","#5D4037"],n=function(t,e){(t=s(t,e)).series||(t.series=[]);const n=t.series,i=t.datasets.length;for(let t=0;t<i;t++){n.length===t&&n.push({});const e=n[t];void 0===e.color&&(e.color=o[t%o.length])}return t},i=function(t,e,n){(t=s(t,e)).series||(t.series=[]);const i=t.series,a=t.datasets.length,r=n?"color":"borderColor";for(let t=0;t<a;t++){i.length===t&&i.push({});const e=i[t];void 0===e[r]&&(e[r]=o[t%o.length]),e.line||(e.line={});const s=e.line;s.width||(s.width=3)}return t},a=function(t,e){t=s(t,e);const n=e.helpers.getCoordsFromRange(t.range);let i=t.orientation?n[3]-n[1]:n[2]-n[0];i++,t.headers&&i--,t.series||(t.series=[]);const a=t.series,r=t.datasets.length;for(let t=0;t<r;t++){a.length===t&&a.push({});const e=a[t];void 0===e.color&&(e.color=[]);const s=e.color;for(;s.length<i;)s.push(o[s.length%o.length])}return t},r=function(t,e){(t=s(t,e)).series||(t.series=[]);const n=t.series,i=t.datasets.length,a="filled-radar"===t.type;for(let t=0;t<i;t++){n.length===t&&n.push({});const e=n[t];a?(void 0===e.color&&(e.color=o[t%o.length]),void 0===e.borderColor&&(e.borderColor=e.color)):(void 0===e.borderColor&&(e.borderColor=o[t%o.length]),void 0===e.color&&(e.color=e.borderColor)),void 0===e.line&&(e.line={});const s=e.line;void 0===s.width&&(s.width=3)}return t},l=function(t,e){const s=(t=n(t,e)).series,o=s.length;for(let t=0;t<o;t++){const e=s[t];void 0===e.point&&(e.point={});const o=e.point;void 0===o.radius&&(o.radius=3),void 0===o.style&&(o.style="circle")}return t},c=function(t,e){const n=(t=s(t,e)).datasets;n.length>1&&n.splice(1,n.length-1);t.series||(t.series=[]);const i=t.series;i.length>2&&i.splice(2,i.length-2),i[0]||(i[0]={});const a=i[0];void 0===a.color&&(a.color=o[0]),i[1]||(i[1]={});const r=i[1];return void 0===r.borderColor&&(r.borderColor=o[1]),void 0===r.color&&(r.color=r.borderColor),t},d={bar:n,column:n,histogram:n,line:function(t,e){return i(t,e)},area:function(t,e){return i(t,e,!0)},doughnut:a,pie:a,radar:r,scatter:l,pareto:c};return{isBlank:function(t){return null===t||""===t||void 0===t},isNumeric:t,getDataFromRange:e,fixCartesianChartConfig:n,fixLineChartConfig:i,fixPieChartConfig:a,fixRadarChartConfig:r,fixScatterChartConfig:l,fixParetoChartConfig:c,fillChartConfig:function(t,e){const{type:s}=t,o=s.lastIndexOf("-"),n=o>-1?s.slice(o+1):s;return d[n](t,e)}}}()}},e={},s=function s(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,s),i.exports}(683);Charts=s}(); | ||
var Charts;!function(){var t={683:function(t,e,s){const o=s(555);t.exports=function(){"use strict";let t=null,e={};const s=function(t,e,s){if((t=t.split(".")).length){let o=this,n=null;for(;t.length>1;)if(n=t.shift(),o.hasOwnProperty(n))o=o[n];else{if(void 0===e)return;o[n]={},o=o[n]}if(n=t.shift(),void 0!==e)return!0===s?delete o[n]:o[n]=e,!0;if(o)return o[n]}return!1},n=function(t){return"undefined"!=typeof document&&document.dictionary&&document.dictionary[t]||t},i=function(t){return JSON.parse(JSON.stringify(t))},a={id:"customBackgroundColor",beforeDraw:(t,e,s)=>{if(s.color){const{ctx:e}=t;e.save(),e.globalCompositeOperation="destination-over",e.fillStyle=s.color||"#99ffff",e.fillRect(0,0,t.width,t.height),e.restore()}}},r=function(){var t="";return 8==this.status?this.scope&&-1!=this.scope.indexOf("charts")||(t="This charts plugin is not included on the scope of this license"):t="License required",t},l=function(t,e){for(let s in t)(this.hasOwnProperty(s)||e)&&(null!==this[s]&&"object"==typeof this[s]&&"object"==typeof t[s]?Object.assign(this[s],t[s]):this[s]=t[s]);return this},c=function(e){const s=[];let o=e.range.split(",");for(let e=0;e<o.length;e++){let n=o[e],i=this;const a=o[e].lastIndexOf("!");-1!==a&&(i=i.getWorksheetInstanceByName(n.slice(0,a)),n=n.slice(a+1)),s.push({worksheet:i,cellNames:t.helpers.getTokensFromRange(n)})}return s},d=function(t,e,s){let n=[],a=0,r=0,l=o.getDataFromRange(e,t);if(l&&l.length&&(a=l.length),l&&l[0]&&l[0].length&&(r=l[0].length),s.orientation)for(let t=0;t<r;t++){let e=[];for(let s=0;s<a;s++)e.push(l[s][t]);n[t]={label:"",data:e}}else for(let t=0;t<a;t++)n[t]={label:"",data:l[t]};s.headers&&n.forEach((function(t){t.label=t.data.shift()}));let c,d=[];if(s.datasets.forEach((function(t){n[t]&&d.push(i(n[t]))})),o.isBlank(s.labels)){if(c=[],n.length){const t=n[0].data.length;for(let e=0;e<t;e++)c.push("")}}else n[s.labels]&&(c=n[s.labels].data);return{labels:c,datasets:d}},p=function(e,s,n,a){n||(n={}),s=s.split(",")[0];let r=0,l=0,c=o.getDataFromRange(s,e);c&&c.length&&(r=c.length),c&&c[0]&&c[0].length&&(l=c[0].length);let d,p=0,u=0,h=[0,0];for(let t=0;t<r;t++){let e=0;for(let s=0;s<l;s++)o.isNumeric(c[t][s])?e++:0===t&&h[0]++;u=Math.max(u,e)}for(let t=0;t<l;t++){let e=0;for(let s=0;s<r;s++)o.isNumeric(c[s][t])?e++:0===t&&h[1]++;p=Math.max(p,e)}let f=[];if(d=void 0!==n.orientation?n.orientation?1:0:p>=u?1:0,!0===a){let e=s;e=e.split("!"),e=e[e.length-1],e=e.split(":");let o=t.helpers.getCoordsFromColumnName(e[0]),n=t.helpers.getCoordsFromColumnName(e[1]);c=[];for(let e=o[1];e<=n[1];e++){let s=[];for(let i=o[0];i<=n[0];i++)s.push(t.helpers.getCellNameFromCoords(i,e));c.push(s)}}if(d)for(let t=0;t<l;t++){let e=[];for(let s=0;s<r;s++)e.push(c[s][t]);f[t]={label:"",data:e}}else for(let t=0;t<r;t++)f[t]={label:"",data:c[t]};let g=null,y=null,b=null;if(b=void 0!==n.headers?!!n.headers:d?p-r==0?0:1:u-l==0?0:1,b&&f.forEach((function(t){t.label=t.data.shift()})),void 0!==n.labels?g=n.labels:h[d]>0&&(g=0),null!==g&&f[g]&&f[g].data&&(y=i(f[g].data)),n.datasets){let t=[];n.datasets.forEach((function(e){f[e]&&t.push(i(f[e]))})),f=t}else{let t=[];f.forEach((function(e,s){(!b||f.length<2||s>0)&&t.push(e)})),f=t}if(f.length&&(!y||!y.length)){y=[];for(let t=0;t<f[0].data.length;t++)y.push("")}return a&&y&&(y=t.helpers.getRangeFromTokens(y),f.forEach((function(e){e.data=t.helpers.getRangeFromTokens(e.data)}))),{labels:y,datasets:f,orientation:d?1:0,headers:!!b,xLabels:g,textCount:h}},u=function(t,e){let s=p(t,e);return{headers:s.headers,orientation:s.orientation}},h=function(t,e,s){e=e.split(",")[0];const o={data:d(t,e,s)},n={},i=A(s.title);i&&(n.title=i);const a=A(s.subtitle);a&&(n.subtitle=a);const r=L(s.legend);return r&&(n.legend=r),0!==Object.keys(n).length&&(o.options||(o.options={}),o.options.plugins=n),o},f=function(t,e,s){s||(s={});const o=h(t,e,s),n={base:W(s.axis?.base),side:R(s.axis?.side),side2:{type:"linear",display:!0,grid:{},...R(s.axis?.side2)}};return o.options||(o.options={}),o.options.scales=n,o},g=function(){let e=this;return e.instance=null,e.type="line",e.createPicker=function(s){t.picker(s,{worksheetName:!0,onchange:function(){e.data=s.innerText}})},e.cancel=function(){e.parent.close()},e.insert=function(){if(!e.data)return void alert(n("Range is mandatory"));let s=e.data,o=e.instance;if(-1!==s.indexOf("!")){let e=s.split("!");o=t.getWorksheetInstanceByName(e[0]),s=e[1]}-1===s.indexOf(":")&&(s=s+":"+s);let i=u(o,s),a={type:"chart",width:400,height:300,options:{type:e.type,range:s,...i}};o.setMedia(a),e.parent.close()},`<div class="jss_style_p20">\n <div class='jss_style_row jss_style_p2'>\n <div class='jss_style_column jss_style_f1'>\n <div class="jss_style_form_group">\n <label>${n("Data to analyze")}</label>\n <div :ready="self.createPicker(this)" :bind="self.data"></div>\n </div>\n </div>\n </div>\n <br>\n <div class='jss_style_row jss_style_p2 jss_style_center'>\n <div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="line" :bind="self.type"><i class="material-icons">show_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="bar" :bind="self.type"><i class="material-icons">bar_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="pie" :bind="self.type"><i class="material-icons">incomplete_circle</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="doughnut" :bind="self.type"><i class="material-icons">donut_large</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="radar" :bind="self.type"><i class="material-icons">radar</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="area" :bind="self.type"><i class="material-icons">area_chart</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="scatter" :bind="self.type"><i class="material-icons">scatter_plot</i></label>\n </div><div class='jss_style_column jss_style_f1 jss_charts_type'>\n <label><input type="radio" name="type" value="stacked-bar" :bind="self.type"><i class="material-icons">stacked_bar_chart</i></label>\n </div>\n </div>\n <div class='jss_style_row jss_style_p2'>\n <div class='jss_style_column jss_style_f1'>\n <div class="jss_style_form_group">\n <br>\n <button type="button" class="jss_style_button" onclick="self.insert">${n("Insert")}</button>\n <button type="button" class="jss_style_button" onclick="self.cancel">${n("Cancel")}</button>\n </div>\n </div>\n </div>\n </div>`},y=function(){let t=`<Modal title="${n("Insert chart")}" :ref="self.modal" :closable="true" :draggable="true" :width="320" :height="410" :closed="true" icon="addchart">\n <InputForm :ref="self.form" />\n </Modal>`;return lemonade.element(t,this,{InputForm:g})},b={type:[{text:n("Line"),value:"line",group:"Line"},{text:n("Area Chart"),value:"area",group:"Area"},{text:n("Stacked Area Chart"),value:"stacked-area",group:"Area"},{text:n("100% Stacked Area Chart"),value:"percent-area",group:"Area"},{text:n("Bar Chart"),value:"bar",group:"Bar"},{text:n("Stacked Bar Chart"),value:"stacked-bar",group:"Bar"},{text:n("100% Stacked Bar Chart"),value:"percent-bar",group:"Bar"},{text:n("Column Chart"),value:"column",group:"Column"},{text:n("Stacked Column Chart"),value:"stacked-column",group:"Column"},{text:n("100% Stacked Column Chart"),value:"percent-column",group:"Column"},{text:n("Pie"),value:"pie",group:"Pie"},{text:n("Doughnut"),value:"doughnut",group:"Pie"},{text:n("Bubble"),value:"bubble",group:"Scatter"},{text:n("Scatter"),value:"scatter",group:"Scatter"},{text:n("Radar"),value:"radar",group:"Radar"},{text:n("Filled radar"),value:"filled-radar",group:"Radar"},{text:n("Histogram"),value:"histogram",group:"Other"},{text:n("Pareto"),value:"pareto",group:"Other"}],orientation:[{text:n("Horizontal"),value:0},{text:n("Vertical"),value:1}],position:[{text:n("Top"),value:"top"},{text:n("Bottom"),value:"bottom"},{text:n("Left"),value:"left"},{text:n("Right"),value:"right"}]};let v;const m=function(t,e){let o=this.parent.parent.parent.chart;if(o){let t=this.parent.parent.parent.options;if(e&&e.length)for(let o=0;o<e.length;o++){let n,i=e[o].element;i||(i=e[o].e),n="checkbox"===i.type?i.checked:"function"==typeof i.val?i.val():i.value;let a=i.getAttribute?i.getAttribute("data-path"):i["data-path"];a&&s.call(t,a,n)}let n=this.parent.parent.parent.worksheet;v&&clearTimeout(v),v=setTimeout((function(){K(n,t,o),v=null}),50)}},x=function(){let e=this;const s=function(){let s=i(e.parent.parent.parent.parent.allOptions),o=[];e.data.forEach((function(t){o.push(t.value)}));let n=[];s.forEach((function(t){n.push(t.value)})),t.helpers.compareArray(o,n)?e.value=null:e.value=o};return e.add=function(){let t=i(e.parent.parent.parent.parent.allOptions);e.data.push({datasets:t}),e.refresh("data")},e.remove=function(t,s){e.data.splice(e.data.indexOf(s),1),e.refresh("data")},e.update=function(){s()},e.onchange=function(t){"data"===t&&s()},'<div :value="self.value">\n <div :loop="self.data" data-path="series" class="jss_charts_series">\n <div class="jss_style_row start middle" style="margin-bottom: 4px;">\n <Dropdown :data="self.datasets" :bind="self.value" :onchange="self.parent.update" /> <i class="material-icons" onclick="self.parent.remove">close</i>\n </div>\n </div>\n <div class="jss_style_p2">\n <input type="button" value="{{self.button}}" onclick="self.add" class="jss_charts_button" />\n </div>\n </div>'},_=function(){let e=this;e.series=[],e.createRange=function(s){t.picker(s,{type:"picker",onchange:function(t){e.range=this.textContent=t}})},e.onchange=function(t,s){if(e.parent.parent.parent.chart){if(m.call(e,t,s),"range"===t){let t=p(e.parent.parent.parent.worksheet,e.range);e.orientation=t.orientation,e.headers=t.headers,e.labels=t.xLabels,e.datasets=null}if("orientation"===t||"headers"===t){let t=e.parent.parent.parent.loadDropdownOptions(),s=e.labels;e.currentDatasets=t.datasets,e.currentLabels=t.labels,e.labels=s}"orientation"===t&&(e.useHeaderText=e.orientation?n("Use the first column as headers"):n("Use the first row as headers"))}},e.useHeaderText=e.orientation?n("Use the first column as headers"):n("Use the first row as headers"),e.dropdown=b;let s=`<div>\n <div class="jss_style_row">\n <div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Chart type")}</label>\n <Dropdown :data="self.dropdown.type" :bind="self.type" width="220" data-path="type" data-value="line" />\n </div>\n </div><div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Data orientation")}</label>\n <Dropdown :data="self.dropdown.orientation" :bind="self.orientation" width="120" data-path="orientation" />\n </div>\n </div>\n </div>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Data range")}</label>\n <div :ready="self.createRange(this, self)" :bind="self.range" data-path="range"></div>\n </div>\n </div>\n </div>\n <div class="jss_style_form_group">\n <label>${n("Labels")}</label>\n <Dropdown :data="self.currentLabels" :bind="self.labels" data-path="labels" />\n </div>\n <div class="jss_style_form_group">\n <label>${n("Series")}</label>\n <Series :data="self.currentDatasets" :bind="self.datasets" data-path="datasets" button="${n("Add new serie")}" />\n </div>\n <br>\n <div class="jss_style_form_group">\n <Switch :bind="self.headers" data-path="headers" text="{{self.useHeaderText}}" />\n </div>\n </div>`;return lemonade.element(s,e,{Series:x})},k=function(){let t=this;return t.title={},t.legend={legendTitle:{text:""}},t.titlePosition=i(b.position),t.legendPosition=i(b.position),t.update=function(){m.call(t,null,[{element:this}])},`<>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Chart title")}</label>\n <input type="text" :bind="self.title.text" data-path="title.text" class="jss_object" onchange="self.update" />\n </div>\n </div><div class="jss_style_col">\n <div class="jss_style_form_group">\n <label>${n("Chart title position")}</label>\n <Dropdown :data="self.titlePosition" :bind="self.legend.position" data-path="title.position" :width="120" onchange="self.update">\n </div>\n </div>\n </div>\n <br/>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <div class="jss_style_form_group">\n <label>${n("Legend title")}</label>\n <input type="text" :bind="self.legend.legendTitle.text" data-path="legend.legendTitle.text" class="jss_object" onchange="self.update" />\n </div>\n </div>\n </div>\n <div class="jss_style_row">\n <div class="jss_style_col jss_style_f1">\n <Dropdown :data="self.legendPosition" :bind="self.legend.position" data-path="legend.position" :width="160" onchange="self.update">\n </div><div class="jss_style_col jss_style_f1">\n <Switch :bind="self.legend.display" data-path="legend.display" text="${n("Show Legend")}" onchange="self.update" />\n </div>\n </div>\n <br/>\n <>`},C=function(){let t=this;t.canvas=null,t.options=null,t.datasets=[],t.loadDropdownOptions=function(){let e=u(t.worksheet,t.options.range),s=p(t.worksheet,t.options.range,{...t.options,datasets:void 0,headers:!1},!0),o=p(t.worksheet,t.options.range,{...t.options,datasets:void 0,headers:!1}),n=[];s.datasets.map((function(e,s){let i=e.data;t.options.headers&&(i=o.datasets[s].data[0]),n.push({text:i,value:n.length})}));let a=s.textCount[s.orientation]>0&&0===s.xLabels,r=[];return n.forEach((function(t,o){(!e.headers&&!a||s.datasets.length<2||o>0)&&r.push({value:t.value,datasets:i(n)})})),t.options.datasets&&(r=[],t.options.datasets.map((function(t){r.push({value:t,datasets:i(n)})}))),t.allOptions=i(n),{datasets:r,labels:i(n)}},t.open=function(e,s){t.options=i(s.options);let o=p(this,t.options.range);void 0===t.options.orientation&&(t.options.orientation=o.orientation),void 0===t.options.headers&&(t.options.headers=o.headers),void 0===t.options.labels&&(t.options.labels=o.xLabels),t.worksheet=this;let n=t.loadDropdownOptions.call(this);t.modal.tabs.settings.currentDatasets=n.datasets,t.modal.tabs.settings.currentLabels=n.labels,l.call(t.modal.tabs.settings,t.options),l.call(t.modal.tabs.properties,t.options),t.chart=e,t.canvas=e.children[0],t.modal.closed=!1},t.close=function(e){t.chart&&(!0===e?t.worksheet.setMedia([{id:t.chart.id,options:t.options}]):t.chart.children[0]!==t.canvas&&(t.chart.children[0].remove(),t.chart.appendChild(t.canvas)),t.options=null,t.worksheet=null,t.chart=null,t.canvas=null),!1===t.modal.closed&&(t.modal.closed=!0)},t.save=function(){t.close(!0)},t.cancel=function(){t.close(!1)};let e=`<Modal title="Chart settings" position="right" :ref="self.modal" :closable="true" :draggable="true" :width="420" :height="600" :closed="true" :onclose="self.cancel">\n <div style="padding: 20px;">\n <Tabs :selected="0" :ref="self.tabs">\n <div title="${n("Configuration")}"><Settings :ref="self.settings" /></div>\n <div title="${n("Styling")}"><Properties :ref="self.properties" /></div>\n </Tabs>\n <div class='row'>\n <button type="button" class="jss_style_button" onclick="self.parent.save">${n("Save")}</button>\n <button type="button" class="jss_style_button" onclick="self.parent.cancel" style="margin-top: 4px">${n("Cancel")}</button>\n </div>\n </div>\n </Modal>`;return lemonade.element(e,t,{Settings:_,Properties:k})},j=function(e,s){let o=c.call(e,s.options);const n=o.length;for(let e=0;e<n;e++){const{cellNames:n,worksheet:i}=o[e],a=i.records,r=n.length;for(let e=0;e<r;e++){const o=n[e],i=t.helpers.getCoordsFromColumnName(o);a[i[1]][i[0]].chain.delete(s)}}},w={dotted:function(t){return t<3?[t,3]:[t,t]},dashed:function(t){return 1===t?[6,5]:[4*t,3*t]},"dashed-dotted":function(t){return 1===t?[6,4,1,4]:[4*t,2*t,t,2*t]}},S=function(t,e){if(t){const s=w[t];return"function"==typeof s?s(e):null}return null},D=function(t){const e={};void 0!==t.color&&(e.color=t.color);const{width:s}=t;if(e.width=s,t.dash){const o=w[t.dash];"function"==typeof o&&(e.dash=o(s))}return e},O=function(t){if(!t)return{};const e={};return void 0!==t.color&&(e.color=t.color),void 0!==t.family&&(e.family=t.family),void 0!==t.size&&(e.size=t.size),t.italic&&(e.style="italic"),t.bold?e.weight="bold":e.weight="normal",e},A=function(t){if(!t||!t.text)return null;const e={display:!0,text:t.text};void 0!==t.position&&(e.position=t.position),void 0!==t.align&&(e.align=t.align);const{color:s,...o}=O(t.font);return void 0!==s&&(e.color=s),0!==Object.keys(o).length&&(e.font=o),0!==Object.keys(e).length?e:null},L=function(t){if(!t)return null;if(!1===t.display)return{display:!1};const e={};void 0!==t.position&&(e.position=t.position),void 0!==t.align&&(e.align=t.align);const s=t.legendTitle;if(s&&s.text){const t={display:!0,text:s.text},{color:o,...n}=O(s.font);void 0!==o&&(t.color=o),0!==Object.keys(n).length&&(t.font=n),e.title=t}const o=t.labels;if(o){o.reverse&&(e.reverse=!0);const t={},{color:s,...n}=O(o.font);void 0!==s&&(t.color=s),0!==Object.keys(n).length&&(t.font=n),0!==Object.keys(t).length&&(e.labels=t)}return 0!==Object.keys(e).length?e:null},W=function(t){if(!t)return{};const e={},s=function(t){if(!t||!t.text)return null;const{color:e,...s}=O(t.font),o={display:!0,text:t.text};return 0!==Object.keys(s).length&&(o.font=s),void 0!==e&&(o.color=e),void 0!==t.align&&(o.align=t.align),o}(t.title);s&&(e.title=s),t.reverse&&(e.reverse=!0),e.grid=function(t){if(t||(t={}),!1===t.display)return{drawTicks:!1};const e={};e.tickLength=t.length;const{color:s,dash:o,width:n}=D(t);return void 0!==s&&(e.tickColor=s),void 0!==o&&(e.tickBorderDash=o),void 0!==n&&(e.tickWidth=n),e}(t.ticks),e.ticks=function(t){if(t||(t={}),!1===t.display)return{display:!1};const{color:e,...s}=O(t),o={};return void 0!==e&&(o.color=e),0!==Object.keys(s).length&&(o.font=s),o}(t.labels);const o=function(t){if(!t||0===Object.keys(t).length)return{};const e={};return void 0!==t.color&&(e.color=t.color),void 0!==t.width&&(e.width=t.width),e}(t.border);e.border=o;const n=function(t){if(t||(t={}),!1===t.display)return{grid:{drawOnChartArea:!1}};const e={},s={},{color:o,dash:n,width:i}=D(t);return void 0!==o&&(e.color=o),void 0!==n&&(s.dash=n),void 0!==i&&(e.lineWidth=i),{grid:e,border:s}}(t.grid);return e.grid=Object.assign(e.grid||{},n.grid),n.border&&(e.border=Object.assign(e.border||{},n.border)),e},R=function(t){if(!t)return{};const e=W(t);void 0!==t.min&&(e[t.forceTheLimits?"min":"suggestedMin"]=t.min),void 0!==t.max&&(e[t.forceTheLimits?"max":"suggestedMax"]=t.max);const s=t.spacingBetweenTicks;return s&&("count"===s.type?e.ticks.count=s.value:e.ticks.stepSize=s.value),e},F=function(t){if(!t)return{};const e={};if(t.reverse&&(e.reverse=!0),void 0!==t.min&&(e[t.forceTheLimits?"min":"suggestedMin"]=t.min),void 0!==t.max&&(e[t.forceTheLimits?"max":"suggestedMax"]=t.max),t.grid)if(!1===t.grid.display)e.grid={display:!1};else{const{color:s,dash:o,width:n}=D(t.grid),i={};void 0!==s&&(i.color=s),void 0!==o&&(i.borderDash=o),void 0!==n&&(i.lineWidth=n),e.grid=i}if(t.angleLines)if(!1===t.angleLines.display)e.angleLines={display:!1};else{const{color:s,dash:o,width:n}=D(t.angleLines),i={};void 0!==s&&(i.color=s),void 0!==o&&(i.borderDash=o),void 0!==n&&(i.lineWidth=n),e.angleLines=i}if(t.ticks)if(!1===t.ticks.display)e.ticks={display:!1};else{const{color:s,...o}=O(t.ticks),n={};void 0!==s&&(n.color=s),0!==Object.keys(o).length&&(n.font=o),e.ticks=n}const s=t.spacingBetweenTicks;if(s&&(e.ticks||(e.ticks={}),"count"===s.type?e.ticks.count=s.value:e.ticks.stepSize=s.value),t.pointLabels)if(!1===t.pointLabels.display)e.pointLabels={display:!1};else{const{color:s,...o}=O(t.pointLabels),n={};void 0!==s&&(n.color=s),0!==Object.keys(o).length&&(n.font=o),e.pointLabels=n}return e},I=function(t,e,s){t=o.fixCartesianChartConfig(t,e);const n={type:"bar",...f(e,t.range,t)},i=new Set,a=n.data.datasets,r=a.length;if(t.series)for(let e=0;e<r;e++){const o=t.series[e],n=a[e];void 0!==o.radius&&(n.borderRadius=o.radius),n.backgroundColor=o.color,o.borderColor&&o.borderWidth&&(n.borderColor=o.borderColor,n.borderWidth=o.borderWidth),s?"right"===o.yAxis?(n.yAxisID="y2",i.add("end")):(n.yAxisID="y",i.add("start")):"top"===o.xAxis?(n.xAxisID="x2",i.add("end")):(n.xAxisID="x",i.add("start"))}const{base:l,side:c,side2:d}=n.options.scales;let p={};return s?(2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,p.x=l):(2===i.size?(p.x=c,p.x2={...d,position:"top"},p.x2.grid||(p.x2.grid={}),p.x2.grid.drawOnChartArea=!1):i.has("end")?(p.x={display:!1},p.x2={...d,position:"top"}):p.x=c,p.y=l,n.options.indexAxis="y"),n.options.scales=p,n},E=function(t){const e=[],s=t.length;for(let o=0;o<s;o++){const s=t[o];for(let t=0;t<s.length;t++)e[t]=(e[t]||0)+Math.abs(s[t])}return e},B={style:"percent",maximumFractionDigits:0,minimumFractionDigits:0},N=function(t,e,s){t=o.fixLineChartConfig(t,e,s);const n={type:"line",...f(e,t.range,t)},i=new Set,a=n.data.datasets,r=a.length;if(t.series)for(let e=0;e<r;e++){const o=t.series[e],n=a[e];if("right"===o.yAxis?(n.yAxisID="y2",i.add("end")):(n.yAxisID="y",i.add("start")),s){const t=o.color;n.backgroundColor=t,n.pointBackgroundColor=t;const e=void 0!==o.borderColor?o.borderColor:t;n.borderColor=e,n.pointBorderColor=e}else{const t=o.borderColor;n.borderColor=t,n.pointBorderColor=t;const e=void 0!==o.color?o.color:t;n.backgroundColor=e,n.pointBackgroundColor=e}const r=o.line;if(r){const{width:t}=r;n.borderWidth=t;const e=S(r.dash,t);e&&(n.borderDash=e),void 0!==r.curve?n.tension=r.curve:void 0!==r.stepped&&(n.stepped=r.stepped)}const l=o.point;l?(void 0!==l.borderWidth&&(n.pointBorderWidth=l.borderWidth),void 0!==l.rotation&&(n.pointRotation=l.rotation),n.pointStyle=void 0!==l.style&&l.style,n.pointRadius=void 0!==l.radius?l.radius:0):n.pointStyle=!1,void 0!==o.drawNullValues&&(n.spanGaps=o.drawNullValues)}const{base:l,side:c,side2:d}=n.options.scales;let p={x:l};return 2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,n.options.scales=p,n},T=function(t,e){const s=N(t,e,!0),o=s.data.datasets;for(let t=0;t<o.length;t++)o[t].fill=!0;return s},M=function(t,e,s){t=o.fixPieChartConfig(t,e);const n={type:s?"pie":"doughnut",...h(e,t.range,t)},i=n.data.datasets,a=i.length;if(t.series)for(let e=0;e<a;e++){const s=t.series[e],o=i[e];o.backgroundColor=s.color,void 0!==s.borderColor&&(o.borderColor=s.borderColor),void 0!==s.circumference&&(o.circumference=s.circumference),void 0!==s.spacing&&(o.spacing=s.spacing),void 0!==s.rotation&&(o.rotation=s.rotation),o.borderWidth=0;const n=s.border;if(n){const{width:t=0}=n;if(o.borderWidth=t,void 0!==n.dash){const e=w[n.dash];e&&(o.borderDash=e(t))}void 0!==n.radius&&(o.borderRadius=n.radius)}}return s||void 0===t.cutout||(n.options||(n.options={}),n.options.cutout=100*t.cutout+"%"),n},P=/^(?:-|\+)?\d+(?:\.\d+)?$/,$=function(t){return P.test(t)},z=function(t,e){const s=[],o=e.length;for(let t=0;t<o;t++){let o=0;const n=e[t].data;for(let t=0;t<n.length;t++)"number"==typeof n[t]&&o++;s.push([o])}return{datasets:s,labels:["["+t[0]+", "+t[1]+"]"]}},H=function(t,e,s){if(1===t)return z(e,s);const o=(e[1]-e[0])/t,n=[];let i=e[0]+o;for(;i<e[1];){if(n.push(Math.round(100*i)/100),n.length>19)throw new Error("invalid chart");i+=o}const a=n.length,r=a+1,l=[],c=s.length;for(let t=0;t<c;t++){const e=s[t],o=new Array(r);o.fill(0);const i=e.data;for(let t=0;t<i.length;t++){const e=i[t];if("number"!=typeof e)continue;let s=0;for(;s<a&&e>n[s];)s++;o[s]++}l.push(o)}const d={datasets:l};let p=[];p.push("["+e[0]+" , "+n[0]+"[");for(let t=1;t<a;t++)p.push("["+n[t-1]+" , "+n[t]+"[");return p.push("["+n[a-1]+" , "+e[1]+"]"),d.labels=p,d},V=function(t,e){t=o.fixCartesianChartConfig(t,e);const s={type:"bar",...f(e,t.range,t)},n=[1/0,-1/0],i=s.data.datasets,a=i.length;for(let t=0;t<i.length;t++){const e=i[t].data;for(let t=0;t<e.length;t++){const s=e[t];"string"==typeof s&&$(s)&&(e[t]=parseFloat(s))}}for(let e=0;e<a;e++){const s=i[e],o=s.data;for(let t=0;t<o.length;t++){const e=o[t];"number"==typeof e&&(e<n[0]&&(n[0]=e),e>n[1]&&(n[1]=e))}const a=t.series[e];s.backgroundColor=a.color,a.borderWidth&&a.borderColor&&(s.borderWidth=a.borderWidth,s.borderColor=a.borderColor),void 0!==a.radius&&(s.borderRadius=a.radius)}if(n[0]===1/0&&n[1]===-1/0)throw new Error("invalid chart");const{base:r,side:l}=s.options.scales;let c;s.options.scales={x:r,y:l};const d=t.separation;if(d)c="number-of-pieces"===d.type?H(d.value,n,i):function(t,e,s){if(0===t)throw new Error("invalid chart");if(t>=e[1]-e[0])return z(e,s);const o=[];let n=e[0];do{if(n+=t,o.push(Math.round(100*n)/100),o.length>20)throw new Error("invalid chart")}while(n<e[1]);const i=o.length,a=[],r=s.length;for(let t=0;t<r;t++){const e=s[t],n=new Array(i);n.fill(0);const r=e.data;for(let t=0;t<r.length;t++){const e=r[t];if("number"!=typeof e)continue;let s=0;for(;e>o[s];)s++;n[s]++}a.push(n)}const l={datasets:a};let c=[];c.push("["+e[0]+" , "+o[0]+"[");for(let t=1;t<i-1;t++)c.push("["+o[t-1]+" , "+o[t]+"[");return c.push("["+o[i-2]+" , "+o[i-1]+"]"),l.labels=c,l}(d.value,n,i);else{const t=n[1]-n[0];let e=6,s=t/e;for(;e>1&&s<.01;)e--,s=t/e;c=H(e,n,i)}s.data.labels=c.labels;const p=c.datasets;for(let t=0;t<a;t++)i[t].data=p[t];return s},J=function(t,e,s){t=o.fixRadarChartConfig(t,e);const n={type:"radar",...h(e,t.range,t)},i=n.data.datasets,a=i.length;for(let e=0;e<a;e++){const o=i[e];o.fill=s;const n=t.series&&t.series[e],a=n.borderColor;o.borderColor=a,o.pointBorderColor=a;const r=n.color;o.backgroundColor=r,o.pointBackgroundColor=r;const l=n.line,{width:c}=l;o.borderWidth=c;const d=S(l.dash,c);d&&(o.borderDash=d),void 0!==l.curve&&(o.tension=l.curve);const p=n.point;p?(void 0!==p.borderWidth&&(o.pointBorderWidth=p.borderWidth),void 0!==p.rotation&&(o.pointRotation=p.rotation),o.pointStyle=void 0!==p.style&&p.style,o.pointRadius=void 0!==p.radius?p.radius:0):o.pointStyle=!1,void 0!==n.drawNullValues&&(o.spanGaps=n.drawNullValues)}return n.options||(n.options={}),n.options.scales={r:F(t.axis?.r)},n},U=function(t,e=[]){const s=[],o=t.length;for(let n=0;n<o;n++)e.includes(n)||s.push(t[n]);return s},G=function(t,e){return"bar"===e.type?I(e,t,!1):"stacked-bar"===e.type?function(t,e){const s=I(t,e,!1),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"x2"===e.xAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.y.stacked="origin",!1!==s.options.scales.x.display&&(s.options.scales.x.stacked="origin"),s.options.scales.x2&&(s.options.scales.x2.stacked="origin"),s}(e,t):"percent-bar"===e.type?function(t,e){const s=I(t,e,!1),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"x2"===e.xAxisID?(n.push(s),e.stack="Stack 2"):(o.push(s),e.stack="Stack 1");for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"string"===o?$(e)?s[t]=parseFloat(e):s[t]=0:"number"!==o&&(s[t]=0)}}const a=E(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=E(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.y.stacked="origin",!1!==s.options.scales.x.display&&(s.options.scales.x.stacked="origin",s.options.scales.x.ticks||(s.options.scales.x.ticks={}),s.options.scales.x.ticks.format=B),s.options.scales.x2&&(s.options.scales.x2.stacked="origin",s.options.scales.x2.ticks||(s.options.scales.x2.ticks={}),s.options.scales.x2.ticks.format=B),s}(e,t):"column"===e.type?I(e,t,!0):"stacked-column"===e.type?function(t,e){const s=I(t,e,!0),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"y2"===e.yAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.x.stacked="origin",!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin"),s.options.scales.y2&&(s.options.scales.y2.stacked="origin"),s}(e,t):"percent-column"===e.type?function(t,e){const s=I(t,e,!0),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"y2"===e.yAxisID?(n.push(s),e.stack="Stack 2"):(o.push(s),e.stack="Stack 1");for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"string"===o?$(e)?s[t]=parseFloat(e):s[t]=0:"number"!==o&&(s[t]=0)}}const a=E(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=E(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.x||(s.options.scales.x={}),s.options.scales.y||(s.options.scales.y={}),s.options.scales.x.stacked="origin",!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin",s.options.scales.y.ticks||(s.options.scales.y.ticks={}),s.options.scales.y.ticks.format=B),s.options.scales.y2&&(s.options.scales.y2.stacked="origin",s.options.scales.y2.ticks||(s.options.scales.y2.ticks={}),s.options.scales.y2.ticks.format=B),s}(e,t):"line"===e.type?N(e,t):"area"===e.type?T(e,t):"stacked-area"===e.type?function(t,e){const s=T(t,e),o=s.data.datasets;for(let t=0;t<o.length;t++){const e=o[t];"y2"===e.yAxisID?e.stack="Stack 2":e.stack="Stack 1"}return s.options.scales||(s.options.scales={}),s.options.scales.y||(s.options.scales.y={}),!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin"),s.options.scales.y2&&(s.options.scales.y2.stacked="origin"),s}(e,t):"percent-area"===e.type?function(t,e){const s=T(t,e),o=[],n=[],i=s.data.datasets;for(let t=0;t<i.length;t++){const e=i[t],s=e.data;"y2"===e.yAxisID?(e.stack="Stack 2",o.push(s)):(e.stack="Stack 1",n.push(s));for(let t=0;t<s.length;t++){const e=s[t],o=typeof e;"number"!==o&&(s[t]="string"===o&&$(e)?parseFloat(e):0)}}const a=E(n);for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<e.length;t++)e[t]/=a[t]}const r=E(o);for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)e[t]/=r[t]}return s.options.scales||(s.options.scales={}),s.options.scales.y||(s.options.scales.y={}),!1!==s.options.scales.y.display&&(s.options.scales.y.stacked="origin",s.options.scales.y.ticks||(s.options.scales.y.ticks={}),s.options.scales.y.ticks.format=B),s.options.scales.y2&&(s.options.scales.y2.stacked="origin",s.options.scales.y2.ticks||(s.options.scales.y2.ticks={}),s.options.scales.y2.ticks.format=B),s}(e,t):"pie"===e.type?M(e,t,!0):"doughnut"===e.type?M(e,t,!1):"scatter"===e.type?function(t,e){t=o.fixScatterChartConfig(t,e);const s={type:"scatter",...f(e,t.range,t)},n=s.data.labels;delete s.data.labels;const i=new Set,a=s.data.datasets,r=a.length;for(let e=0;e<r;e++){const s=a[e],o=s.data,r=[];for(let t=0;t<o.length;t++){let e=n[t],s=o[t];const i=typeof e;if("string"===i){if(!$(e))continue;e=parseFloat(e)}else if("number"!==i)continue;const a=typeof s;if("string"===a){if(!$(s))continue;s=parseFloat(s)}else if("number"!==a)continue;r.push({x:e,y:s})}s.data=r;const l=t.series[e];if(!l)continue;"right"===l.yAxis?(s.yAxisID="y2",i.add("end")):(s.yAxisID="y",i.add("start")),s.backgroundColor=l.color,void 0!==l.borderColor&&(s.borderColor=l.borderColor);const c=l.point;s.pointRadius=c.radius,s.pointStyle=c.style,s.pointBorderWidth=void 0!==c.borderWidth?c.borderWidth:0,void 0!==c.rotation&&(s.pointRotation=c.rotation)}const{base:l,side:c,side2:d}=s.options.scales;let p={x:l};return 2===i.size?(p.y=c,p.y2={...d,position:"right"},p.y2.grid||(p.y2.grid={}),p.y2.grid.drawOnChartArea=!1):i.has("end")?(p.y={display:!1},p.y2={...d,position:"right"}):p.y=c,s.options.scales=p,s}(e,t):"histogram"===e.type?V(e,t):"radar"===e.type?J(e,t,!1):"filled-radar"===e.type?J(e,t,!0):"pareto"===e.type?function(t,e){t=o.fixParetoChartConfig(t,e);const s={type:"bar",...f(e,t.range,t)},n=t.series,i=n[0],a=s.data.datasets[0];a.order=1;let r=a.data;const l=[];for(let t=0;t<r.length;t++){const e=r[t],s=typeof e;"string"===s&&$(e)?(r[t]=parseFloat(e),r[t]<0&&l.push(t)):("number"!==s||e<0)&&l.push(t)}a.data=U(a.data,l),s.data.labels=U(s.data.labels,l),r=a.data;const c=r.reduce((function(t,e){return t+e}),0);let d=0;const p=[];for(let t=0;t<r.length;t++)d+=r[t],p.push(Math.round(d/c*100)/100);a.backgroundColor=i.color,void 0!==i.radius&&(a.borderRadius=i.radius),i.borderWidth&&i.borderColor&&(a.borderWidth=i.borderWidth,a.borderColor=i.borderColor);const u=n[1],h={type:"line",yAxisID:"y2",order:0,data:p};h.backgroundColor=u.color,h.borderColor=u.borderColor;const g=u.line;if(g){const{width:t}=g;h.borderWidth=t;const e=S(g.dash,t);e&&(h.borderDash=e),void 0!==g.curve?h.tension=g.curve:void 0!==g.stepped&&(h.stepped=g.stepped)}const y=u.point;y?(void 0!==y.borderWidth&&(h.pointBorderWidth=y.borderWidth),void 0!==y.rotation&&(h.pointRotation=y.rotation),h.pointStyle=void 0!==y.style&&y.style,h.pointRadius=void 0!==y.radius?y.radius:0):h.pointStyle=!1,h.backgroundColor||(h.backgroundColor=h.borderColor),s.data.datasets.push(h);const{base:b,side:v,side2:m}=s.options.scales;let x={x:b,y:v,y2:{...m,position:"right"}};return x.y2.grid||(x.y2.grid={}),x.y2.grid.drawOnChartArea=!1,x.y2.ticks||(x.y2.ticks={}),x.y2.ticks.format=B,s.options.scales=x,s.options.plugins||(s.options.plugins={}),s.options.plugins.legend={display:!1},s}(e,t):void 0},q=function(t,s,o){o.innerHTML="";let n=document.createElement("canvas");o.appendChild(n);const i=function(t,e){const s=G(t,e);return e.backgroundColor&&(s.options||(s.options={}),s.options.plugins||(s.options.plugins={}),s.options.plugins.customBackgroundColor={color:e.backgroundColor}),s}(t,s);return i.options||(i.options={}),void 0!==e.animations&&(i.options.animations=e.animations),i.plugins=[a],new Chart(n,i),n},K=function(t,e,s){s.classList.remove("jss_charts_error"),s.removeAttribute("data-error");try{q(t,e,s)}catch(t){console.error(t)}},Q=function(e,s){let o=s.el;if("function"!=typeof s.handler){Object.defineProperty(s,"handler",{enumerable:!1,get:function(){return function(t){K(e,t.options,t.el)}}});const t=function(){e.isEditable()&&e.parent.plugins.charts.edition.open.call(e,o,s)};o.edit=t,o.addEventListener("dblclick",t),o.classList.add("jss_charts")}(function(e,s){let o;o="function"==typeof e.getCellObject?function(t,e,s){return t.getCellObject(e,s)}:function(t,e,s){return t.records[s][e]};let n=c.call(e,s.options);const i=n.length;for(let a=0;a<i;a++){let{cellNames:i,worksheet:r}=n[a];const l=i.length;for(let n=0;n<l;n++){const a=i[n],l=t.helpers.getCoordsFromColumnName(a),c=o(r,l[0],l[1]);c.chain||(c.chain=new Map),c.chain.set(s,e)}}})(e,s),K(e,s.options,o)},X=function(e){let s={init:function(t){const e=t.options.media;e&&e.forEach((function(e){"chart"===e.type&&Q(t,e)}))},onevent:function(t,e,s,o,n){if("onchangemedia"===t){let t=s,i=o,a=n;s.forEach((function(s,o){"chart"===a[o].type&&(1===Object.keys(t[o]).length?j(e,a[o]):t[o].options&&(i[o].options&&j(e,i[o]),Q(e,a[o])))}))}else if("onchangereferences"===t){let t=[],n=e.options.media;n&&(n.forEach((function(n){if("chart"===n.type){let a=!1,r=i(n.options);if(r.range){let t=e.updateFormula(r.range,s,o);t&&t!==r.range&&(r.range=t,a=!0)}!0===a&&(n.options=r,t.push({type:"media",id:n.id,value:{options:r}}))}})),t.length&&e.persistence("setFormula",{data:t}))}},toolbar:function(e){return e.items.push({content:"addchart",type:"i",tooltip:n("Insert chart"),onclick:function(){var e=t.current.getRange();e&&(e=e.split("!")[1]),s.open(t.current,e,"")},updateState:function(t,e,s,o){o.isEditable()?s.classList.remove("jtoolbar-disabled"):s.classList.add("jtoolbar-disabled")}}),e},contextMenu:function(e,o,i,a,r,l,c,d){if(null!=o&&null!=i){let a={title:n("Insert chart"),icon:"addchart",onclick:function(){let n=t.helpers.getColumnNameFromCoords(o,i);s.open(e,"",n)}},l=0;for(let t in r)if("divisor"===r[t].type||"line"===r[t].type){l=parseInt(t)+1;break}r.splice(l,0,{type:"divisor"}),r.splice(l,0,a)}},open:function(t,e,o){s.input.modal.form.instance=t,s.input.modal.form.data=e,s.input.modal.open()}};let o=document.createElement("div");return e.tools.append(o),lemonade.render((function(){return lemonade.element('<div class="jss_chartss">\n <div><InputChart :ref="self.input" /></div>\n <div><Edition :ref="self.edition" /></div>\n </div>',s,{InputChart:y,Edition:C})}),o),s},Y=function(t){return"object"==typeof t&&void 0!==t.animations&&(e.animations=t.animations),!0};return Y.oninit=function(t,e){let s=r.call(t);s?console.error(s):t.setPlugins({charts:X})},Y.license=function(e){null===t&&(t=this)},Y.getDataFromConfig=p,Y}()},555:function(t){t.exports=function(){const t=function(t){return"string"==typeof t&&(t=t.trim()),!isNaN(t)&&null!==t&&""!==t},e=function(t,e){let s;const o=t.lastIndexOf("!");if(-1!==o){const n=t.slice(0,o);s=e.getWorksheetInstanceByName(n),t=t.slice(o+1)}else s=e;const n=e.helpers.getCoordsFromRange(t),i=n[3],a=n[2],r=[],l=s.records;for(let t=n[1];t<=i;t++){const e=[],s=l[t];for(let t=n[0];t<=a;t++)e.push(s&&s[t]?s[t].v:0);r.push(e)}return r},s=function(s,o){let n=0,i=0;(s=s?JSON.parse(JSON.stringify(s)):{}).range=s.range.split(",")[0];const a=void 0===s.labels||null===s.labels,r=void 0===s.datasets||null===s.datasets,l=void 0===s.orientation||null===s.orientation,c=void 0===s.headers||null===s.headers;if(!o){if(a||r||l||c)throw new Error("The chart do not have a property whose default value needs a jss instance to be generated");return s}let d=e(s.range,o);d&&d.length&&(n=d.length),d&&d[0]&&d[0].length&&(i=d[0].length);let p=0,u=0,h=[0,0];for(let e=0;e<n;e++){let s=0;for(let o=0;o<i;o++)t(d[e][o])?s++:0===e&&h[0]++;u=Math.max(u,s)}for(let e=0;e<i;e++){let s=0;for(let o=0;o<n;o++)t(d[o][e])?s++:0===e&&h[1]++;p=Math.max(p,s)}l&&(s.orientation=p>=u);const f=s.orientation?1:0;if(c&&(s.headers=f?p-n!=0:u-i!=0),a&&h[f]>0&&(s.labels=0),r){s.datasets=[];const t=f?i:n,e=s.headers;for(let o=0;o<t;o++)(!e||t<2||o>0)&&s.datasets.push(o)}else s.datasets||(s.datasets=[]);return s},o=["#1E88E5","#E53935","#43A047","#FDD835","#8E24AA","#8E24AA","#5D4037"],n=function(t,e){(t=s(t,e)).series||(t.series=[]);const n=t.series,i=t.datasets.length;for(let t=0;t<i;t++){n.length===t&&n.push({});const e=n[t];void 0===e.color&&(e.color=o[t%o.length])}return t},i=function(t,e,n){(t=s(t,e)).series||(t.series=[]);const i=t.series,a=t.datasets.length,r=n?"color":"borderColor";for(let t=0;t<a;t++){i.length===t&&i.push({});const e=i[t];void 0===e[r]&&(e[r]=o[t%o.length]),e.line||(e.line={});const s=e.line;s.width||(s.width=3)}return t},a=function(t,e){t=s(t,e);const n=e.helpers.getCoordsFromRange(t.range);let i=t.orientation?n[3]-n[1]:n[2]-n[0];i++,t.headers&&i--,t.series||(t.series=[]);const a=t.series,r=t.datasets.length;for(let t=0;t<r;t++){a.length===t&&a.push({});const e=a[t];void 0===e.color&&(e.color=[]);const s=e.color;for(;s.length<i;)s.push(o[s.length%o.length])}return t},r=function(t,e){(t=s(t,e)).series||(t.series=[]);const n=t.series,i=t.datasets.length,a="filled-radar"===t.type;for(let t=0;t<i;t++){n.length===t&&n.push({});const e=n[t];a?(void 0===e.color&&(e.color=o[t%o.length]),void 0===e.borderColor&&(e.borderColor=e.color)):(void 0===e.borderColor&&(e.borderColor=o[t%o.length]),void 0===e.color&&(e.color=e.borderColor)),void 0===e.line&&(e.line={});const s=e.line;void 0===s.width&&(s.width=3)}return t},l=function(t,e){const s=(t=n(t,e)).series,o=s.length;for(let t=0;t<o;t++){const e=s[t];void 0===e.point&&(e.point={});const o=e.point;void 0===o.radius&&(o.radius=3),void 0===o.style&&(o.style="circle")}return t},c=function(t,e){const n=(t=s(t,e)).datasets;n.length>1&&n.splice(1,n.length-1);t.series||(t.series=[]);const i=t.series;i.length>2&&i.splice(2,i.length-2),i[0]||(i[0]={});const a=i[0];void 0===a.color&&(a.color=o[0]),i[1]||(i[1]={});const r=i[1];return void 0===r.borderColor&&(r.borderColor=o[1]),void 0===r.color&&(r.color=r.borderColor),t},d={bar:n,column:n,histogram:n,line:function(t,e){return i(t,e)},area:function(t,e){return i(t,e,!0)},doughnut:a,pie:a,radar:r,scatter:l,pareto:c};return{isBlank:function(t){return null===t||""===t||void 0===t},isNumeric:t,getDataFromRange:e,fixCartesianChartConfig:n,fixLineChartConfig:i,fixPieChartConfig:a,fixRadarChartConfig:r,fixScatterChartConfig:l,fixParetoChartConfig:c,fillChartConfig:function(t,e){const{type:s}=t,o=s.lastIndexOf("-"),n=o>-1?s.slice(o+1):s;return d[n](t,e)}}}()}},e={},s=function s(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,s),i.exports}(683);Charts=s}(); | ||
return Charts; | ||
}))); |
@@ -31,3 +31,3 @@ { | ||
"dependencies": { | ||
"lemonadejs": "^4.2.2", | ||
"lemonadejs": "^4.3.2", | ||
"@lemonadejs/studio": "^1.0.5", | ||
@@ -38,3 +38,3 @@ "chart.js": "^4.4.2" | ||
"types": "dist/index.d.ts", | ||
"version": "6.0.3", | ||
"version": "6.1.0", | ||
"bugs": "https://github.com/jspreadsheet/pro/issues", | ||
@@ -41,0 +41,0 @@ "homepage": "https://github.com/jspreadsheet/pro", |
56990
516
Updatedlemonadejs@^4.3.2